@project-sunbird/collection-editor-react 1.0.6 → 1.0.7

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.
@@ -1,4 +1,4 @@
1
- (function(ke,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("react"),require("react-dom"),require("react/jsx-runtime")):typeof define=="function"&&define.amd?define(["exports","react","react-dom","react/jsx-runtime"],p):(ke=typeof globalThis<"u"?globalThis:ke||self,p(ke.CollectionEditorReact={},ke.React,ke.ReactDOM,ke.jsxRuntime))})(this,(function(ke,p,Ue,l){"use strict";var EI=Object.defineProperty;var ig=ke=>{throw TypeError(ke)};var AI=(ke,p,Ue)=>p in ke?EI(ke,p,{enumerable:!0,configurable:!0,writable:!0,value:Ue}):ke[p]=Ue;var us=(ke,p,Ue)=>AI(ke,typeof p!="symbol"?p+"":p,Ue),Gl=(ke,p,Ue)=>p.has(ke)||ig("Cannot "+Ue);var I=(ke,p,Ue)=>(Gl(ke,p,"read from private field"),Ue?Ue.call(ke):p.get(ke)),me=(ke,p,Ue)=>p.has(ke)?ig("Cannot add the same private member more than once"):p instanceof WeakSet?p.add(ke):p.set(ke,Ue),X=(ke,p,Ue,l)=>(Gl(ke,p,"write to private field"),l?l.call(ke,Ue):p.set(ke,Ue),Ue),Oe=(ke,p,Ue)=>(Gl(ke,p,"access private method"),Ue);var Fa=(ke,p,Ue,l)=>({set _(Ma){X(ke,p,Ma,Ue)},get _(){return I(ke,p,l)}});var dn,qr,Kn,Zp,mr,un,Xp,Yn,jr,Zn,Jp,fn,eg,Xn,hn,Jn,Jt,pn,pt,ts,gn,Ht,lg,Ar,tg,qt,Ne,rs,Pt,mn,eo,_r,Ur,ns,to,ro,vn,yn,zr,no,je,fs,Kl,Yl,Zl,Xl,Jl,ec,tc,cg,rg,os,vr,Dt,bn,yr,Gr,ng,Tr,lr,ss,og,br,sg,tt,Vr,Hr,oo,so,Qr,ao,io,ag;function Ma(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const qe=Ma(p);var uo=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},fg=(Zp=class extends uo{constructor(){super();me(this,dn);me(this,qr);me(this,Kn);X(this,Kn,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){I(this,qr)||this.setEventListener(I(this,Kn))}onUnsubscribe(){var t;this.hasListeners()||((t=I(this,qr))==null||t.call(this),X(this,qr,void 0))}setEventListener(t){var r;X(this,Kn,t),(r=I(this,qr))==null||r.call(this),X(this,qr,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){I(this,dn)!==t&&(X(this,dn,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof I(this,dn)=="boolean"?I(this,dn):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},dn=new WeakMap,qr=new WeakMap,Kn=new WeakMap,Zp),$a=new fg,hg={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},pg=(Xp=class{constructor(){me(this,mr,hg);me(this,un,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&I(this,un)&&e!==I(this,mr)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:I(this,mr),provider:e}),X(this,mr,e),process.env.NODE_ENV!=="production"&&X(this,un,!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&X(this,un,!0),I(this,mr).setTimeout(e,t)}clearTimeout(e){I(this,mr).clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&X(this,un,!0),I(this,mr).setInterval(e,t)}clearInterval(e){I(this,mr).clearInterval(e)}},mr=new WeakMap,un=new WeakMap,Xp),Kr=new pg;function gg(e){setTimeout(e,0)}var mg=typeof window>"u"||"Deno"in globalThis;function xt(){}function vg(e,t){return typeof e=="function"?e(t):e}function Ba(e){return typeof e=="number"&&e>=0&&e!==1/0}function rc(e,t){return Math.max(e+(t||0)-Date.now(),0)}function kr(e,t){return typeof e=="function"?e(t):e}function jt(e,t){return typeof e=="function"?e(t):e}function nc(e,t){const{type:r="all",exact:n,fetchStatus:o,predicate:s,queryKey:a,stale:i}=e;if(a){if(n){if(t.queryHash!==qa(a,t.options))return!1}else if(!ho(t.queryKey,a))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof i=="boolean"&&t.isStale()!==i||o&&o!==t.state.fetchStatus||s&&!s(t))}function oc(e,t){const{exact:r,status:n,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(r){if(fo(t.options.mutationKey)!==fo(s))return!1}else if(!ho(t.options.mutationKey,s))return!1}return!(n&&t.state.status!==n||o&&!o(t))}function qa(e,t){return((t==null?void 0:t.queryKeyHashFn)||fo)(e)}function fo(e){return JSON.stringify(e,(t,r)=>za(r)?Object.keys(r).sort().reduce((n,o)=>(n[o]=r[o],n),{}):r)}function ho(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>ho(e[r],t[r])):!1}var yg=Object.prototype.hasOwnProperty;function ja(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=sc(e)&&sc(t);if(!n&&!(za(e)&&za(t)))return t;const s=(n?e:Object.keys(e)).length,a=n?t:Object.keys(t),i=a.length,c=n?new Array(i):{};let d=0;for(let u=0;u<i;u++){const f=n?u:a[u],m=e[f],g=t[f];if(m===g){c[f]=m,(n?u<s:yg.call(e,f))&&d++;continue}if(m===null||g===null||typeof m!="object"||typeof g!="object"){c[f]=g;continue}const b=ja(m,g,r+1);c[f]=b,b===m&&d++}return s===i&&d===s?e:c}function Ua(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function sc(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function za(e){if(!ac(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!ac(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function ac(e){return Object.prototype.toString.call(e)==="[object Object]"}function bg(e){return new Promise(t=>{Kr.setTimeout(t,e)})}function Va(e,t,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(e,t);if(r.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return ja(e,t)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return ja(e,t)}return t}function Cg(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function Sg(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var hs=Symbol();function ic(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===hs&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===hs?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function lc(e,t){return typeof e=="function"?e(...t):!!e}function wg(e,t,r){let n=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??(o=t()),n||(n=!0,o.aborted?r():o.addEventListener("abort",r,{once:!0})),o)}),e}var po=(()=>{let e=()=>mg;return{isServer(){return e()},setIsServer(t){e=t}}})();function Ha(){let e,t;const r=new Promise((o,s)=>{e=o,t=s});r.status="pending",r.catch(()=>{});function n(o){Object.assign(r,o),delete r.resolve,delete r.reject}return r.resolve=o=>{n({status:"fulfilled",value:o}),e(o)},r.reject=o=>{n({status:"rejected",reason:o}),t(o)},r}var _g=gg;function Tg(){let e=[],t=0,r=i=>{i()},n=i=>{i()},o=_g;const s=i=>{t?e.push(i):o(()=>{r(i)})},a=()=>{const i=e;e=[],i.length&&o(()=>{n(()=>{i.forEach(c=>{r(c)})})})};return{batch:i=>{let c;t++;try{c=i()}finally{t--,t||a()}return c},batchCalls:i=>(...c)=>{s(()=>{i(...c)})},schedule:s,setNotifyFunction:i=>{r=i},setBatchNotifyFunction:i=>{n=i},setScheduler:i=>{o=i}}}var vt=Tg(),Eg=(Jp=class extends uo{constructor(){super();me(this,Yn,!0);me(this,jr);me(this,Zn);X(this,Zn,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){I(this,jr)||this.setEventListener(I(this,Zn))}onUnsubscribe(){var t;this.hasListeners()||((t=I(this,jr))==null||t.call(this),X(this,jr,void 0))}setEventListener(t){var r;X(this,Zn,t),(r=I(this,jr))==null||r.call(this),X(this,jr,t(this.setOnline.bind(this)))}setOnline(t){I(this,Yn)!==t&&(X(this,Yn,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return I(this,Yn)}},Yn=new WeakMap,jr=new WeakMap,Zn=new WeakMap,Jp),ps=new Eg;function Ag(e){return Math.min(1e3*2**e,3e4)}function cc(e){return(e??"online")==="online"?ps.isOnline():!0}var Qa=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function dc(e){let t=!1,r=0,n;const o=Ha(),s=()=>o.status!=="pending",a=h=>{var v;if(!s()){const y=new Qa(h);m(y),(v=e.onCancel)==null||v.call(e,y)}},i=()=>{t=!0},c=()=>{t=!1},d=()=>$a.isFocused()&&(e.networkMode==="always"||ps.isOnline())&&e.canRun(),u=()=>cc(e.networkMode)&&e.canRun(),f=h=>{s()||(n==null||n(),o.resolve(h))},m=h=>{s()||(n==null||n(),o.reject(h))},g=()=>new Promise(h=>{var v;n=y=>{(s()||d())&&h(y)},(v=e.onPause)==null||v.call(e)}).then(()=>{var h;n=void 0,s()||(h=e.onContinue)==null||h.call(e)}),b=()=>{if(s())return;let h;const v=r===0?e.initialPromise:void 0;try{h=v??e.fn()}catch(y){h=Promise.reject(y)}Promise.resolve(h).then(f).catch(y=>{var E;if(s())return;const C=e.retry??(po.isServer()?0:3),S=e.retryDelay??Ag,w=typeof S=="function"?S(r,y):S,T=C===!0||typeof C=="number"&&r<C||typeof C=="function"&&C(r,y);if(t||!T){m(y);return}r++,(E=e.onFail)==null||E.call(e,r,y),bg(w).then(()=>d()?void 0:g()).then(()=>{t?m(y):b()})})};return{promise:o,status:()=>o.status,cancel:a,continue:()=>(n==null||n(),o),cancelRetry:i,continueRetry:c,canStart:u,start:()=>(u()?b():g().then(b),o)}}var uc=(eg=class{constructor(){me(this,fn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ba(this.gcTime)&&X(this,fn,Kr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(po.isServer()?1/0:300*1e3))}clearGcTimeout(){I(this,fn)!==void 0&&(Kr.clearTimeout(I(this,fn)),X(this,fn,void 0))}},fn=new WeakMap,eg);function kg(e){return{onFetch:(t,r)=>{var u,f,m,g,b;const n=t.options,o=(m=(f=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:f.fetchMore)==null?void 0:m.direction,s=((g=t.state.data)==null?void 0:g.pages)||[],a=((b=t.state.data)==null?void 0:b.pageParams)||[];let i={pages:[],pageParams:[]},c=0;const d=async()=>{let h=!1;const v=S=>{wg(S,()=>t.signal,()=>h=!0)},y=ic(t.options,t.fetchOptions),C=async(S,w,T)=>{if(h)return Promise.reject(t.signal.reason);if(w==null&&S.pages.length)return Promise.resolve(S);const L=(()=>{const P={client:t.client,queryKey:t.queryKey,pageParam:w,direction:T?"backward":"forward",meta:t.options.meta};return v(P),P})(),A=await y(L),{maxPages:x}=t.options,F=T?Sg:Cg;return{pages:F(S.pages,A,x),pageParams:F(S.pageParams,w,x)}};if(o&&s.length){const S=o==="backward",w=S?Ig:fc,T={pages:s,pageParams:a},E=w(n,T);i=await C(T,E,S)}else{const S=e??s.length;do{const w=c===0?a[0]??n.initialPageParam:fc(n,i);if(c>0&&w==null)break;i=await C(i,w),c++}while(c<S)}return i};t.options.persister?t.fetchFn=()=>{var h,v;return(v=(h=t.options).persister)==null?void 0:v.call(h,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=d}}}function fc(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function Ig(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var Dg=(tg=class extends uc{constructor(t){super();me(this,Ht);me(this,Xn);me(this,hn);me(this,Jn);me(this,Jt);me(this,pn);me(this,pt);me(this,ts);me(this,gn);X(this,gn,!1),X(this,ts,t.defaultOptions),this.setOptions(t.options),this.observers=[],X(this,pn,t.client),X(this,Jt,I(this,pn).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,X(this,hn,gc(this.options)),this.state=t.state??I(this,hn),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return I(this,Xn)}get promise(){var t;return(t=I(this,pt))==null?void 0:t.promise}setOptions(t){if(this.options={...I(this,ts),...t},t!=null&&t._type&&X(this,Xn,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=gc(this.options);r.data!==void 0&&(this.setState(pc(r.data,r.dataUpdatedAt)),X(this,hn,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&I(this,Jt).remove(this)}setData(t,r){const n=Va(this.state.data,t,this.options);return Oe(this,Ht,Ar).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t){Oe(this,Ht,Ar).call(this,{type:"setState",state:t})}cancel(t){var n,o;const r=(n=I(this,pt))==null?void 0:n.promise;return(o=I(this,pt))==null||o.cancel(t),r?r.then(xt).catch(xt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return I(this,hn)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>jt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===hs||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>kr(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!rc(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=I(this,pt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=I(this,pt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),I(this,Jt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(I(this,pt)&&(I(this,gn)||Oe(this,Ht,lg).call(this)?I(this,pt).cancel({revert:!0}):I(this,pt).cancelRetry()),this.scheduleGc()),I(this,Jt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Oe(this,Ht,Ar).call(this,{type:"invalidate"})}async fetch(t,r){var d,u,f,m,g,b,h,v,y,C,S;if(this.state.fetchStatus!=="idle"&&((d=I(this,pt))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(I(this,pt))return I(this,pt).continueRetry(),I(this,pt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const w=this.observers.find(T=>T.options.queryFn);w&&this.setOptions(w.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,o=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(X(this,gn,!0),n.signal)})},s=()=>{const w=ic(this.options,r),E=(()=>{const L={client:I(this,pn),queryKey:this.queryKey,meta:this.meta};return o(L),L})();return X(this,gn,!1),this.options.persister?this.options.persister(w,E,this):w(E)},i=(()=>{const w={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:I(this,pn),state:this.state,fetchFn:s};return o(w),w})(),c=I(this,Xn)==="infinite"?kg(this.options.pages):this.options.behavior;c==null||c.onFetch(i,this),X(this,Jn,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=i.fetchOptions)==null?void 0:u.meta))&&Oe(this,Ht,Ar).call(this,{type:"fetch",meta:(f=i.fetchOptions)==null?void 0:f.meta}),X(this,pt,dc({initialPromise:r==null?void 0:r.initialPromise,fn:i.fetchFn,onCancel:w=>{w instanceof Qa&&w.revert&&this.setState({...I(this,Jn),fetchStatus:"idle"}),n.abort()},onFail:(w,T)=>{Oe(this,Ht,Ar).call(this,{type:"failed",failureCount:w,error:T})},onPause:()=>{Oe(this,Ht,Ar).call(this,{type:"pause"})},onContinue:()=>{Oe(this,Ht,Ar).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}));try{const w=await I(this,pt).start();if(w===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(w),(g=(m=I(this,Jt).config).onSuccess)==null||g.call(m,w,this),(h=(b=I(this,Jt).config).onSettled)==null||h.call(b,w,this.state.error,this),w}catch(w){if(w instanceof Qa){if(w.silent)return I(this,pt).promise;if(w.revert){if(this.state.data===void 0)throw w;return this.state.data}}throw Oe(this,Ht,Ar).call(this,{type:"error",error:w}),(y=(v=I(this,Jt).config).onError)==null||y.call(v,w,this),(S=(C=I(this,Jt).config).onSettled)==null||S.call(C,this.state.data,w,this),w}finally{this.scheduleGc()}}},Xn=new WeakMap,hn=new WeakMap,Jn=new WeakMap,Jt=new WeakMap,pn=new WeakMap,pt=new WeakMap,ts=new WeakMap,gn=new WeakMap,Ht=new WeakSet,lg=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Ar=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...hc(n.data,this.options),fetchMeta:t.meta??null};case"success":const o={...n,...pc(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return X(this,Jn,t.manual?o:void 0),o;case"error":const s=t.error;return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),vt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),I(this,Jt).notify({query:this,type:"updated",action:t})})},tg);function hc(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:cc(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function pc(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function gc(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Lg=(rg=class extends uo{constructor(t,r){super();me(this,je);me(this,qt);me(this,Ne);me(this,rs);me(this,Pt);me(this,mn);me(this,eo);me(this,_r);me(this,Ur);me(this,ns);me(this,to);me(this,ro);me(this,vn);me(this,yn);me(this,zr);me(this,no,new Set);this.options=r,X(this,qt,t),X(this,Ur,null),X(this,_r,Ha()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(I(this,Ne).addObserver(this),mc(I(this,Ne),this.options)?Oe(this,je,fs).call(this):this.updateResult(),Oe(this,je,Xl).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Wa(I(this,Ne),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Wa(I(this,Ne),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Oe(this,je,Jl).call(this),Oe(this,je,ec).call(this),I(this,Ne).removeObserver(this)}setOptions(t){const r=this.options,n=I(this,Ne);if(this.options=I(this,qt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof jt(this.options.enabled,I(this,Ne))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Oe(this,je,tc).call(this),I(this,Ne).setOptions(this.options),r._defaulted&&!Ua(this.options,r)&&I(this,qt).getQueryCache().notify({type:"observerOptionsUpdated",query:I(this,Ne),observer:this});const o=this.hasListeners();o&&vc(I(this,Ne),n,this.options,r)&&Oe(this,je,fs).call(this),this.updateResult(),o&&(I(this,Ne)!==n||jt(this.options.enabled,I(this,Ne))!==jt(r.enabled,I(this,Ne))||kr(this.options.staleTime,I(this,Ne))!==kr(r.staleTime,I(this,Ne)))&&Oe(this,je,Kl).call(this);const s=Oe(this,je,Yl).call(this);o&&(I(this,Ne)!==n||jt(this.options.enabled,I(this,Ne))!==jt(r.enabled,I(this,Ne))||s!==I(this,zr))&&Oe(this,je,Zl).call(this,s)}getOptimisticResult(t){const r=I(this,qt).getQueryCache().build(I(this,qt),t),n=this.createResult(r,t);return Pg(this,n)&&(X(this,Pt,n),X(this,eo,this.options),X(this,mn,I(this,Ne).state)),n}getCurrentResult(){return I(this,Pt)}trackResult(t,r){return new Proxy(t,{get:(n,o)=>(this.trackProp(o),r==null||r(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&I(this,_r).status==="pending"&&I(this,_r).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,o))})}trackProp(t){I(this,no).add(t)}getCurrentQuery(){return I(this,Ne)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=I(this,qt).defaultQueryOptions(t),n=I(this,qt).getQueryCache().build(I(this,qt),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Oe(this,je,fs).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),I(this,Pt)))}createResult(t,r){var x;const n=I(this,Ne),o=this.options,s=I(this,Pt),a=I(this,mn),i=I(this,eo),d=t!==n?t.state:I(this,rs),{state:u}=t;let f={...u},m=!1,g;if(r._optimisticResults){const F=this.hasListeners(),P=!F&&mc(t,r),N=F&&vc(t,n,r,o);(P||N)&&(f={...f,...hc(u.data,t.options)}),r._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:b,errorUpdatedAt:h,status:v}=f;g=f.data;let y=!1;if(r.placeholderData!==void 0&&g===void 0&&v==="pending"){let F;s!=null&&s.isPlaceholderData&&r.placeholderData===(i==null?void 0:i.placeholderData)?(F=s.data,y=!0):F=typeof r.placeholderData=="function"?r.placeholderData((x=I(this,ro))==null?void 0:x.state.data,I(this,ro)):r.placeholderData,F!==void 0&&(v="success",g=Va(s==null?void 0:s.data,F,r),m=!0)}if(r.select&&g!==void 0&&!y)if(s&&g===(a==null?void 0:a.data)&&r.select===I(this,ns))g=I(this,to);else try{X(this,ns,r.select),g=r.select(g),g=Va(s==null?void 0:s.data,g,r),X(this,to,g),X(this,Ur,null)}catch(F){X(this,Ur,F)}I(this,Ur)&&(b=I(this,Ur),g=I(this,to),h=Date.now(),v="error");const C=f.fetchStatus==="fetching",S=v==="pending",w=v==="error",T=S&&C,E=g!==void 0,A={status:v,fetchStatus:f.fetchStatus,isPending:S,isSuccess:v==="success",isError:w,isInitialLoading:T,isLoading:T,data:g,dataUpdatedAt:f.dataUpdatedAt,error:b,errorUpdatedAt:h,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:f.dataUpdateCount>d.dataUpdateCount||f.errorUpdateCount>d.errorUpdateCount,isFetching:C,isRefetching:C&&!S,isLoadingError:w&&!E,isPaused:f.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:w&&E,isStale:Ra(t,r),refetch:this.refetch,promise:I(this,_r),isEnabled:jt(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const F=A.data!==void 0,P=A.status==="error"&&!F,N=U=>{P?U.reject(A.error):F&&U.resolve(A.data)},M=()=>{const U=X(this,_r,A.promise=Ha());N(U)},B=I(this,_r);switch(B.status){case"pending":t.queryHash===n.queryHash&&N(B);break;case"fulfilled":(P||A.data!==B.value)&&M();break;case"rejected":(!P||A.error!==B.reason)&&M();break}}return A}updateResult(){const t=I(this,Pt),r=this.createResult(I(this,Ne),this.options);if(X(this,mn,I(this,Ne).state),X(this,eo,this.options),I(this,mn).data!==void 0&&X(this,ro,I(this,Ne)),Ua(r,t))return;X(this,Pt,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,s=typeof o=="function"?o():o;if(s==="all"||!s&&!I(this,no).size)return!0;const a=new Set(s??I(this,no));return this.options.throwOnError&&a.add("error"),Object.keys(I(this,Pt)).some(i=>{const c=i;return I(this,Pt)[c]!==t[c]&&a.has(c)})};Oe(this,je,cg).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Oe(this,je,Xl).call(this)}},qt=new WeakMap,Ne=new WeakMap,rs=new WeakMap,Pt=new WeakMap,mn=new WeakMap,eo=new WeakMap,_r=new WeakMap,Ur=new WeakMap,ns=new WeakMap,to=new WeakMap,ro=new WeakMap,vn=new WeakMap,yn=new WeakMap,zr=new WeakMap,no=new WeakMap,je=new WeakSet,fs=function(t){Oe(this,je,tc).call(this);let r=I(this,Ne).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(xt)),r},Kl=function(){Oe(this,je,Jl).call(this);const t=kr(this.options.staleTime,I(this,Ne));if(po.isServer()||I(this,Pt).isStale||!Ba(t))return;const n=rc(I(this,Pt).dataUpdatedAt,t)+1;X(this,vn,Kr.setTimeout(()=>{I(this,Pt).isStale||this.updateResult()},n))},Yl=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(I(this,Ne)):this.options.refetchInterval)??!1},Zl=function(t){Oe(this,je,ec).call(this),X(this,zr,t),!(po.isServer()||jt(this.options.enabled,I(this,Ne))===!1||!Ba(I(this,zr))||I(this,zr)===0)&&X(this,yn,Kr.setInterval(()=>{(this.options.refetchIntervalInBackground||$a.isFocused())&&Oe(this,je,fs).call(this)},I(this,zr)))},Xl=function(){Oe(this,je,Kl).call(this),Oe(this,je,Zl).call(this,Oe(this,je,Yl).call(this))},Jl=function(){I(this,vn)!==void 0&&(Kr.clearTimeout(I(this,vn)),X(this,vn,void 0))},ec=function(){I(this,yn)!==void 0&&(Kr.clearInterval(I(this,yn)),X(this,yn,void 0))},tc=function(){const t=I(this,qt).getQueryCache().build(I(this,qt),this.options);if(t===I(this,Ne))return;const r=I(this,Ne);X(this,Ne,t),X(this,rs,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},cg=function(t){vt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(I(this,Pt))}),I(this,qt).getQueryCache().notify({query:I(this,Ne),type:"observerResultsUpdated"})})},rg);function Og(e,t){return jt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&jt(t.retryOnMount,e)===!1)}function mc(e,t){return Og(e,t)||e.state.data!==void 0&&Wa(e,t,t.refetchOnMount)}function Wa(e,t,r){if(jt(t.enabled,e)!==!1&&kr(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Ra(e,t)}return!1}function vc(e,t,r,n){return(e!==t||jt(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Ra(e,r)}function Ra(e,t){return jt(t.enabled,e)!==!1&&e.isStaleByTime(kr(t.staleTime,e))}function Pg(e,t){return!Ua(e.getCurrentResult(),t)}var Ng=(ng=class extends uc{constructor(t){super();me(this,yr);me(this,os);me(this,vr);me(this,Dt);me(this,bn);X(this,os,t.client),this.mutationId=t.mutationId,X(this,Dt,t.mutationCache),X(this,vr,[]),this.state=t.state||xg(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){I(this,vr).includes(t)||(I(this,vr).push(t),this.clearGcTimeout(),I(this,Dt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){X(this,vr,I(this,vr).filter(r=>r!==t)),this.scheduleGc(),I(this,Dt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){I(this,vr).length||(this.state.status==="pending"?this.scheduleGc():I(this,Dt).remove(this))}continue(){var t;return((t=I(this,bn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var a,i,c,d,u,f,m,g,b,h,v,y,C,S,w,T,E,L;const r=()=>{Oe(this,yr,Gr).call(this,{type:"continue"})},n={client:I(this,os),meta:this.options.meta,mutationKey:this.options.mutationKey};X(this,bn,dc({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(A,x)=>{Oe(this,yr,Gr).call(this,{type:"failed",failureCount:A,error:x})},onPause:()=>{Oe(this,yr,Gr).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>I(this,Dt).canRun(this)}));const o=this.state.status==="pending",s=!I(this,bn).canStart();try{if(o)r();else{Oe(this,yr,Gr).call(this,{type:"pending",variables:t,isPaused:s}),I(this,Dt).config.onMutate&&await I(this,Dt).config.onMutate(t,this,n);const x=await((i=(a=this.options).onMutate)==null?void 0:i.call(a,t,n));x!==this.state.context&&Oe(this,yr,Gr).call(this,{type:"pending",context:x,variables:t,isPaused:s})}const A=await I(this,bn).start();return await((d=(c=I(this,Dt).config).onSuccess)==null?void 0:d.call(c,A,t,this.state.context,this,n)),await((f=(u=this.options).onSuccess)==null?void 0:f.call(u,A,t,this.state.context,n)),await((g=(m=I(this,Dt).config).onSettled)==null?void 0:g.call(m,A,null,this.state.variables,this.state.context,this,n)),await((h=(b=this.options).onSettled)==null?void 0:h.call(b,A,null,t,this.state.context,n)),Oe(this,yr,Gr).call(this,{type:"success",data:A}),A}catch(A){try{await((y=(v=I(this,Dt).config).onError)==null?void 0:y.call(v,A,t,this.state.context,this,n))}catch(x){Promise.reject(x)}try{await((S=(C=this.options).onError)==null?void 0:S.call(C,A,t,this.state.context,n))}catch(x){Promise.reject(x)}try{await((T=(w=I(this,Dt).config).onSettled)==null?void 0:T.call(w,void 0,A,this.state.variables,this.state.context,this,n))}catch(x){Promise.reject(x)}try{await((L=(E=this.options).onSettled)==null?void 0:L.call(E,void 0,A,t,this.state.context,n))}catch(x){Promise.reject(x)}throw Oe(this,yr,Gr).call(this,{type:"error",error:A}),A}finally{I(this,Dt).runNext(this)}}},os=new WeakMap,vr=new WeakMap,Dt=new WeakMap,bn=new WeakMap,yr=new WeakSet,Gr=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),vt.batch(()=>{I(this,vr).forEach(n=>{n.onMutationUpdate(t)}),I(this,Dt).notify({mutation:this,type:"updated",action:t})})},ng);function xg(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Fg=(og=class extends uo{constructor(t={}){super();me(this,Tr);me(this,lr);me(this,ss);this.config=t,X(this,Tr,new Set),X(this,lr,new Map),X(this,ss,0)}build(t,r,n){const o=new Ng({client:t,mutationCache:this,mutationId:++Fa(this,ss)._,options:t.defaultMutationOptions(r),state:n});return this.add(o),o}add(t){I(this,Tr).add(t);const r=gs(t);if(typeof r=="string"){const n=I(this,lr).get(r);n?n.push(t):I(this,lr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(I(this,Tr).delete(t)){const r=gs(t);if(typeof r=="string"){const n=I(this,lr).get(r);if(n)if(n.length>1){const o=n.indexOf(t);o!==-1&&n.splice(o,1)}else n[0]===t&&I(this,lr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=gs(t);if(typeof r=="string"){const n=I(this,lr).get(r),o=n==null?void 0:n.find(s=>s.state.status==="pending");return!o||o===t}else return!0}runNext(t){var n;const r=gs(t);if(typeof r=="string"){const o=(n=I(this,lr).get(r))==null?void 0:n.find(s=>s!==t&&s.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){vt.batch(()=>{I(this,Tr).forEach(t=>{this.notify({type:"removed",mutation:t})}),I(this,Tr).clear(),I(this,lr).clear()})}getAll(){return Array.from(I(this,Tr))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>oc(r,n))}findAll(t={}){return this.getAll().filter(r=>oc(t,r))}notify(t){vt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return vt.batch(()=>Promise.all(t.map(r=>r.continue().catch(xt))))}},Tr=new WeakMap,lr=new WeakMap,ss=new WeakMap,og);function gs(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Mg=(sg=class extends uo{constructor(t={}){super();me(this,br);this.config=t,X(this,br,new Map)}build(t,r,n){const o=r.queryKey,s=r.queryHash??qa(o,r);let a=this.get(s);return a||(a=new Dg({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(o)}),this.add(a)),a}add(t){I(this,br).has(t.queryHash)||(I(this,br).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=I(this,br).get(t.queryHash);r&&(t.destroy(),r===t&&I(this,br).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){vt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return I(this,br).get(t)}getAll(){return[...I(this,br).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>nc(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>nc(t,n)):r}notify(t){vt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){vt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){vt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},br=new WeakMap,sg),$g=(ag=class{constructor(e={}){me(this,tt);me(this,Vr);me(this,Hr);me(this,oo);me(this,so);me(this,Qr);me(this,ao);me(this,io);X(this,tt,e.queryCache||new Mg),X(this,Vr,e.mutationCache||new Fg),X(this,Hr,e.defaultOptions||{}),X(this,oo,new Map),X(this,so,new Map),X(this,Qr,0)}mount(){Fa(this,Qr)._++,I(this,Qr)===1&&(X(this,ao,$a.subscribe(async e=>{e&&(await this.resumePausedMutations(),I(this,tt).onFocus())})),X(this,io,ps.subscribe(async e=>{e&&(await this.resumePausedMutations(),I(this,tt).onOnline())})))}unmount(){var e,t;Fa(this,Qr)._--,I(this,Qr)===0&&((e=I(this,ao))==null||e.call(this),X(this,ao,void 0),(t=I(this,io))==null||t.call(this),X(this,io,void 0))}isFetching(e){return I(this,tt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return I(this,Vr).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=I(this,tt).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=I(this,tt).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(kr(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return I(this,tt).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),o=I(this,tt).get(n.queryHash),s=o==null?void 0:o.state.data,a=vg(t,s);if(a!==void 0)return I(this,tt).build(this,n).setData(a,{...r,manual:!0})}setQueriesData(e,t,r){return vt.batch(()=>I(this,tt).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=I(this,tt).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=I(this,tt);vt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=I(this,tt);return vt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=vt.batch(()=>I(this,tt).findAll(e).map(o=>o.cancel(r)));return Promise.all(n).then(xt).catch(xt)}invalidateQueries(e,t={}){return vt.batch(()=>(I(this,tt).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=vt.batch(()=>I(this,tt).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,r);return r.throwOnError||(s=s.catch(xt)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(n).then(xt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=I(this,tt).build(this,t);return r.isStaleByTime(kr(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(xt).catch(xt)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(xt).catch(xt)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return ps.isOnline()?I(this,Vr).resumePausedMutations():Promise.resolve()}getQueryCache(){return I(this,tt)}getMutationCache(){return I(this,Vr)}getDefaultOptions(){return I(this,Hr)}setDefaultOptions(e){X(this,Hr,e)}setQueryDefaults(e,t){I(this,oo).set(fo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...I(this,oo).values()],r={};return t.forEach(n=>{ho(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){I(this,so).set(fo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...I(this,so).values()],r={};return t.forEach(n=>{ho(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...I(this,Hr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=qa(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===hs&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...I(this,Hr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){I(this,tt).clear(),I(this,Vr).clear()}},tt=new WeakMap,Vr=new WeakMap,Hr=new WeakMap,oo=new WeakMap,so=new WeakMap,Qr=new WeakMap,ao=new WeakMap,io=new WeakMap,ag),yc=qe.createContext(void 0),Bg=e=>{const t=qe.useContext(yc);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},qg=({client:e,children:t})=>(qe.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(yc.Provider,{value:e,children:t})),bc=qe.createContext(!1),jg=()=>qe.useContext(bc);bc.Provider;function Ug(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var zg=qe.createContext(Ug()),Vg=()=>qe.useContext(zg),Hg=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?lc(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},Qg=e=>{qe.useEffect(()=>{e.clearReset()},[e])},Wg=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(o&&e.data===void 0||lc(r,[e.error,n])),Rg=e=>{if(e.suspense){const r=o=>o==="static"?o:Math.max(o??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...o)=>r(n(...o)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Gg=(e,t)=>e.isLoading&&e.isFetching&&!t,Kg=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Cc=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function Yg(e,t,r){var g,b,h,v;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const n=jg(),o=Vg(),s=Bg(),a=s.defaultQueryOptions(e);(b=(g=s.getDefaultOptions().queries)==null?void 0:g._experimental_beforeQuery)==null||b.call(g,a);const i=s.getQueryCache().get(a.queryHash);process.env.NODE_ENV!=="production"&&(a.queryFn||console.error(`[${a.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`));const c=e.subscribed!==!1;a._optimisticResults=n?"isRestoring":c?"optimistic":void 0,Rg(a),Hg(a,o,i),Qg(o);const d=!s.getQueryCache().get(a.queryHash),[u]=qe.useState(()=>new t(s,a)),f=u.getOptimisticResult(a),m=!n&&c;if(qe.useSyncExternalStore(qe.useCallback(y=>{const C=m?u.subscribe(vt.batchCalls(y)):xt;return u.updateResult(),C},[u,m]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),qe.useEffect(()=>{u.setOptions(a)},[a,u]),Kg(a,f))throw Cc(a,u,o);if(Wg({result:f,errorResetBoundary:o,throwOnError:a.throwOnError,query:i,suspense:a.suspense}))throw f.error;if((v=(h=s.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||v.call(h,a,f),a.experimental_prefetchInRender&&!po.isServer()&&Gg(f,n)){const y=d?Cc(a,u,o):i==null?void 0:i.promise;y==null||y.catch(xt).finally(()=>{u.updateResult()})}return a.notifyOnChangeProps?f:u.trackResult(f)}function _n(e,t){return Yg(e,Lg)}let Zg={data:""},Xg=e=>{if(typeof window=="object"){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||Zg},Jg=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,em=/\/\*[^]*?\*\/| +/g,Sc=/\n+/g,Ir=(e,t)=>{let r="",n="",o="";for(let s in e){let a=e[s];s[0]=="@"?s[1]=="i"?r=s+" "+a+";":n+=s[1]=="f"?Ir(a,s):s+"{"+Ir(a,s[1]=="k"?"":t)+"}":typeof a=="object"?n+=Ir(a,t?t.replace(/([^,])+/g,i=>s.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,i):i?i+" "+c:c)):s):a!=null&&(s=s[1]=="-"?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=Ir.p?Ir.p(s,a):s+":"+a+";")}return r+(t&&o?t+"{"+o+"}":o)+n},Dr={},wc=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+wc(e[r]);return t}return e},tm=(e,t,r,n,o)=>{let s=wc(e),a=Dr[s]||(Dr[s]=(c=>{let d=0,u=11;for(;d<c.length;)u=101*u+c.charCodeAt(d++)>>>0;return"go"+u})(s));if(!Dr[a]){let c=s!==e?e:(d=>{let u,f,m=[{}];for(;u=Jg.exec(d.replace(em,""));)u[4]?m.shift():u[3]?(f=u[3].replace(Sc," ").trim(),m.unshift(m[0][f]=m[0][f]||{})):m[0][u[1]]=u[2].replace(Sc," ").trim();return m[0]})(e);Dr[a]=Ir(o?{["@keyframes "+a]:c}:c,r?"":"."+a)}let i=r&&Dr.g;return r&&(Dr.g=Dr[a]),((c,d,u,f)=>{f?d.data=d.data.replace(f,c):d.data.indexOf(c)===-1&&(d.data=u?c+d.data:d.data+c)})(Dr[a],t,n,i),a},rm=(e,t,r)=>e.reduce((n,o,s)=>{let a=t[s];if(a&&a.call){let i=a(r),c=i&&i.props&&i.props.className||/^go/.test(i)&&i;a=c?"."+c:i&&typeof i=="object"?i.props?"":Ir(i,""):i===!1?"":i}return n+o+(a??"")},"");function ms(e){let t=this||{},r=e.call?e(t.p):e;return tm(r.unshift?r.raw?rm(r,[].slice.call(arguments,1),t.p):r.reduce((n,o)=>Object.assign(n,o&&o.call?o(t.p):o),{}):r,Xg(t.target),t.g,t.o,t.k)}let _c,Ga,Ka;ms.bind({g:1});let wr=ms.bind({k:1});function nm(e,t,r,n){Ir.p=t,_c=e,Ga=r,Ka=n}function Lr(e,t){let r=this||{};return function(){let n=arguments;function o(s,a){let i=Object.assign({},s),c=i.className||o.className;r.p=Object.assign({theme:Ga&&Ga()},i),r.o=/go\d/.test(c),i.className=ms.apply(r,n)+(c?" "+c:"");let d=e;return e[0]&&(d=i.as||e,delete i.as),Ka&&d[0]&&Ka(i),_c(d,i)}return o}}var om=e=>typeof e=="function",vs=(e,t)=>om(e)?e(t):e,sm=(()=>{let e=0;return()=>(++e).toString()})(),Tc=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),am=20,Ya="default",Ec=(e,t)=>{let{toastLimit:r}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,r)};case 1:return{...e,toasts:e.toasts.map(a=>a.id===t.toast.id?{...a,...t.toast}:a)};case 2:let{toast:n}=t;return Ec(e,{type:e.toasts.find(a=>a.id===n.id)?1:0,toast:n});case 3:let{toastId:o}=t;return{...e,toasts:e.toasts.map(a=>a.id===o||o===void 0?{...a,dismissed:!0,visible:!1}:a)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(a=>a.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let s=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(a=>({...a,pauseDuration:a.pauseDuration+s}))}}},ys=[],Ac={toasts:[],pausedAt:void 0,settings:{toastLimit:am}},dr={},kc=(e,t=Ya)=>{dr[t]=Ec(dr[t]||Ac,e),ys.forEach(([r,n])=>{r===t&&n(dr[t])})},Ic=e=>Object.keys(dr).forEach(t=>kc(e,t)),im=e=>Object.keys(dr).find(t=>dr[t].toasts.some(r=>r.id===e)),bs=(e=Ya)=>t=>{kc(t,e)},lm={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},cm=(e={},t=Ya)=>{let[r,n]=p.useState(dr[t]||Ac),o=p.useRef(dr[t]);p.useEffect(()=>(o.current!==dr[t]&&n(dr[t]),ys.push([t,n]),()=>{let a=ys.findIndex(([i])=>i===t);a>-1&&ys.splice(a,1)}),[t]);let s=r.toasts.map(a=>{var i,c,d;return{...e,...e[a.type],...a,removeDelay:a.removeDelay||((i=e[a.type])==null?void 0:i.removeDelay)||(e==null?void 0:e.removeDelay),duration:a.duration||((c=e[a.type])==null?void 0:c.duration)||(e==null?void 0:e.duration)||lm[a.type],style:{...e.style,...(d=e[a.type])==null?void 0:d.style,...a.style}}});return{...r,toasts:s}},dm=(e,t="blank",r)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:(r==null?void 0:r.id)||sm()}),go=e=>(t,r)=>{let n=dm(t,e,r);return bs(n.toasterId||im(n.id))({type:2,toast:n}),n.id},at=(e,t)=>go("blank")(e,t);at.error=go("error"),at.success=go("success"),at.loading=go("loading"),at.custom=go("custom"),at.dismiss=(e,t)=>{let r={type:3,toastId:e};t?bs(t)(r):Ic(r)},at.dismissAll=e=>at.dismiss(void 0,e),at.remove=(e,t)=>{let r={type:4,toastId:e};t?bs(t)(r):Ic(r)},at.removeAll=e=>at.remove(void 0,e),at.promise=(e,t,r)=>{let n=at.loading(t.loading,{...r,...r==null?void 0:r.loading});return typeof e=="function"&&(e=e()),e.then(o=>{let s=t.success?vs(t.success,o):void 0;return s?at.success(s,{id:n,...r,...r==null?void 0:r.success}):at.dismiss(n),o}).catch(o=>{let s=t.error?vs(t.error,o):void 0;s?at.error(s,{id:n,...r,...r==null?void 0:r.error}):at.dismiss(n)}),e};var um=1e3,fm=(e,t="default")=>{let{toasts:r,pausedAt:n}=cm(e,t),o=p.useRef(new Map).current,s=p.useCallback((f,m=um)=>{if(o.has(f))return;let g=setTimeout(()=>{o.delete(f),a({type:4,toastId:f})},m);o.set(f,g)},[]);p.useEffect(()=>{if(n)return;let f=Date.now(),m=r.map(g=>{if(g.duration===1/0)return;let b=(g.duration||0)+g.pauseDuration-(f-g.createdAt);if(b<0){g.visible&&at.dismiss(g.id);return}return setTimeout(()=>at.dismiss(g.id,t),b)});return()=>{m.forEach(g=>g&&clearTimeout(g))}},[r,n,t]);let a=p.useCallback(bs(t),[t]),i=p.useCallback(()=>{a({type:5,time:Date.now()})},[a]),c=p.useCallback((f,m)=>{a({type:1,toast:{id:f,height:m}})},[a]),d=p.useCallback(()=>{n&&a({type:6,time:Date.now()})},[n,a]),u=p.useCallback((f,m)=>{let{reverseOrder:g=!1,gutter:b=8,defaultPosition:h}=m||{},v=r.filter(S=>(S.position||h)===(f.position||h)&&S.height),y=v.findIndex(S=>S.id===f.id),C=v.filter((S,w)=>w<y&&S.visible).length;return v.filter(S=>S.visible).slice(...g?[C+1]:[0,C]).reduce((S,w)=>S+(w.height||0)+b,0)},[r]);return p.useEffect(()=>{r.forEach(f=>{if(f.dismissed)s(f.id,f.removeDelay);else{let m=o.get(f.id);m&&(clearTimeout(m),o.delete(f.id))}})},[r,s]),{toasts:r,handlers:{updateHeight:c,startPause:i,endPause:d,calculateOffset:u}}},hm=wr`
1
+ (function(ke,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("react"),require("react-dom"),require("react/jsx-runtime")):typeof define=="function"&&define.amd?define(["exports","react","react-dom","react/jsx-runtime"],p):(ke=typeof globalThis<"u"?globalThis:ke||self,p(ke.CollectionEditorReact={},ke.React,ke.ReactDOM,ke.jsxRuntime))})(this,(function(ke,p,Ue,l){"use strict";var kI=Object.defineProperty;var lg=ke=>{throw TypeError(ke)};var II=(ke,p,Ue)=>p in ke?kI(ke,p,{enumerable:!0,configurable:!0,writable:!0,value:Ue}):ke[p]=Ue;var us=(ke,p,Ue)=>II(ke,typeof p!="symbol"?p+"":p,Ue),Gl=(ke,p,Ue)=>p.has(ke)||lg("Cannot "+Ue);var I=(ke,p,Ue)=>(Gl(ke,p,"read from private field"),Ue?Ue.call(ke):p.get(ke)),me=(ke,p,Ue)=>p.has(ke)?lg("Cannot add the same private member more than once"):p instanceof WeakSet?p.add(ke):p.set(ke,Ue),X=(ke,p,Ue,l)=>(Gl(ke,p,"write to private field"),l?l.call(ke,Ue):p.set(ke,Ue),Ue),Oe=(ke,p,Ue)=>(Gl(ke,p,"access private method"),Ue);var Fa=(ke,p,Ue,l)=>({set _(Ma){X(ke,p,Ma,Ue)},get _(){return I(ke,p,l)}});var un,qr,Kn,Xp,mr,fn,Jp,Yn,jr,Zn,eg,hn,tg,Xn,pn,Jn,Jt,gn,pt,ts,mn,Ht,cg,Ar,rg,qt,Ne,rs,Pt,vn,eo,_r,Ur,ns,to,ro,yn,bn,zr,no,je,fs,Kl,Yl,Zl,Xl,Jl,ec,tc,dg,ng,os,vr,Dt,Cn,yr,Gr,og,Tr,cr,ss,sg,br,ag,tt,Vr,Hr,oo,so,Qr,ao,io,ig;function Ma(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const qe=Ma(p);var uo=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},hg=(Xp=class extends uo{constructor(){super();me(this,un);me(this,qr);me(this,Kn);X(this,Kn,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){I(this,qr)||this.setEventListener(I(this,Kn))}onUnsubscribe(){var t;this.hasListeners()||((t=I(this,qr))==null||t.call(this),X(this,qr,void 0))}setEventListener(t){var r;X(this,Kn,t),(r=I(this,qr))==null||r.call(this),X(this,qr,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){I(this,un)!==t&&(X(this,un,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof I(this,un)=="boolean"?I(this,un):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},un=new WeakMap,qr=new WeakMap,Kn=new WeakMap,Xp),$a=new hg,pg={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},gg=(Jp=class{constructor(){me(this,mr,pg);me(this,fn,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&I(this,fn)&&e!==I(this,mr)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:I(this,mr),provider:e}),X(this,mr,e),process.env.NODE_ENV!=="production"&&X(this,fn,!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&X(this,fn,!0),I(this,mr).setTimeout(e,t)}clearTimeout(e){I(this,mr).clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&X(this,fn,!0),I(this,mr).setInterval(e,t)}clearInterval(e){I(this,mr).clearInterval(e)}},mr=new WeakMap,fn=new WeakMap,Jp),Kr=new gg;function mg(e){setTimeout(e,0)}var vg=typeof window>"u"||"Deno"in globalThis;function xt(){}function yg(e,t){return typeof e=="function"?e(t):e}function Ba(e){return typeof e=="number"&&e>=0&&e!==1/0}function rc(e,t){return Math.max(e+(t||0)-Date.now(),0)}function kr(e,t){return typeof e=="function"?e(t):e}function jt(e,t){return typeof e=="function"?e(t):e}function nc(e,t){const{type:r="all",exact:n,fetchStatus:o,predicate:s,queryKey:a,stale:i}=e;if(a){if(n){if(t.queryHash!==qa(a,t.options))return!1}else if(!ho(t.queryKey,a))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof i=="boolean"&&t.isStale()!==i||o&&o!==t.state.fetchStatus||s&&!s(t))}function oc(e,t){const{exact:r,status:n,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(r){if(fo(t.options.mutationKey)!==fo(s))return!1}else if(!ho(t.options.mutationKey,s))return!1}return!(n&&t.state.status!==n||o&&!o(t))}function qa(e,t){return((t==null?void 0:t.queryKeyHashFn)||fo)(e)}function fo(e){return JSON.stringify(e,(t,r)=>za(r)?Object.keys(r).sort().reduce((n,o)=>(n[o]=r[o],n),{}):r)}function ho(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>ho(e[r],t[r])):!1}var bg=Object.prototype.hasOwnProperty;function ja(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=sc(e)&&sc(t);if(!n&&!(za(e)&&za(t)))return t;const s=(n?e:Object.keys(e)).length,a=n?t:Object.keys(t),i=a.length,c=n?new Array(i):{};let d=0;for(let u=0;u<i;u++){const f=n?u:a[u],m=e[f],g=t[f];if(m===g){c[f]=m,(n?u<s:bg.call(e,f))&&d++;continue}if(m===null||g===null||typeof m!="object"||typeof g!="object"){c[f]=g;continue}const b=ja(m,g,r+1);c[f]=b,b===m&&d++}return s===i&&d===s?e:c}function Ua(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function sc(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function za(e){if(!ac(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!ac(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function ac(e){return Object.prototype.toString.call(e)==="[object Object]"}function Cg(e){return new Promise(t=>{Kr.setTimeout(t,e)})}function Va(e,t,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(e,t);if(r.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return ja(e,t)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return ja(e,t)}return t}function Sg(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function wg(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var hs=Symbol();function ic(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===hs&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===hs?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function lc(e,t){return typeof e=="function"?e(...t):!!e}function _g(e,t,r){let n=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??(o=t()),n||(n=!0,o.aborted?r():o.addEventListener("abort",r,{once:!0})),o)}),e}var po=(()=>{let e=()=>vg;return{isServer(){return e()},setIsServer(t){e=t}}})();function Ha(){let e,t;const r=new Promise((o,s)=>{e=o,t=s});r.status="pending",r.catch(()=>{});function n(o){Object.assign(r,o),delete r.resolve,delete r.reject}return r.resolve=o=>{n({status:"fulfilled",value:o}),e(o)},r.reject=o=>{n({status:"rejected",reason:o}),t(o)},r}var Tg=mg;function Eg(){let e=[],t=0,r=i=>{i()},n=i=>{i()},o=Tg;const s=i=>{t?e.push(i):o(()=>{r(i)})},a=()=>{const i=e;e=[],i.length&&o(()=>{n(()=>{i.forEach(c=>{r(c)})})})};return{batch:i=>{let c;t++;try{c=i()}finally{t--,t||a()}return c},batchCalls:i=>(...c)=>{s(()=>{i(...c)})},schedule:s,setNotifyFunction:i=>{r=i},setBatchNotifyFunction:i=>{n=i},setScheduler:i=>{o=i}}}var vt=Eg(),Ag=(eg=class extends uo{constructor(){super();me(this,Yn,!0);me(this,jr);me(this,Zn);X(this,Zn,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){I(this,jr)||this.setEventListener(I(this,Zn))}onUnsubscribe(){var t;this.hasListeners()||((t=I(this,jr))==null||t.call(this),X(this,jr,void 0))}setEventListener(t){var r;X(this,Zn,t),(r=I(this,jr))==null||r.call(this),X(this,jr,t(this.setOnline.bind(this)))}setOnline(t){I(this,Yn)!==t&&(X(this,Yn,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return I(this,Yn)}},Yn=new WeakMap,jr=new WeakMap,Zn=new WeakMap,eg),ps=new Ag;function kg(e){return Math.min(1e3*2**e,3e4)}function cc(e){return(e??"online")==="online"?ps.isOnline():!0}var Qa=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function dc(e){let t=!1,r=0,n;const o=Ha(),s=()=>o.status!=="pending",a=h=>{var v;if(!s()){const y=new Qa(h);m(y),(v=e.onCancel)==null||v.call(e,y)}},i=()=>{t=!0},c=()=>{t=!1},d=()=>$a.isFocused()&&(e.networkMode==="always"||ps.isOnline())&&e.canRun(),u=()=>cc(e.networkMode)&&e.canRun(),f=h=>{s()||(n==null||n(),o.resolve(h))},m=h=>{s()||(n==null||n(),o.reject(h))},g=()=>new Promise(h=>{var v;n=y=>{(s()||d())&&h(y)},(v=e.onPause)==null||v.call(e)}).then(()=>{var h;n=void 0,s()||(h=e.onContinue)==null||h.call(e)}),b=()=>{if(s())return;let h;const v=r===0?e.initialPromise:void 0;try{h=v??e.fn()}catch(y){h=Promise.reject(y)}Promise.resolve(h).then(f).catch(y=>{var E;if(s())return;const C=e.retry??(po.isServer()?0:3),S=e.retryDelay??kg,w=typeof S=="function"?S(r,y):S,T=C===!0||typeof C=="number"&&r<C||typeof C=="function"&&C(r,y);if(t||!T){m(y);return}r++,(E=e.onFail)==null||E.call(e,r,y),Cg(w).then(()=>d()?void 0:g()).then(()=>{t?m(y):b()})})};return{promise:o,status:()=>o.status,cancel:a,continue:()=>(n==null||n(),o),cancelRetry:i,continueRetry:c,canStart:u,start:()=>(u()?b():g().then(b),o)}}var uc=(tg=class{constructor(){me(this,hn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ba(this.gcTime)&&X(this,hn,Kr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(po.isServer()?1/0:300*1e3))}clearGcTimeout(){I(this,hn)!==void 0&&(Kr.clearTimeout(I(this,hn)),X(this,hn,void 0))}},hn=new WeakMap,tg);function Ig(e){return{onFetch:(t,r)=>{var u,f,m,g,b;const n=t.options,o=(m=(f=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:f.fetchMore)==null?void 0:m.direction,s=((g=t.state.data)==null?void 0:g.pages)||[],a=((b=t.state.data)==null?void 0:b.pageParams)||[];let i={pages:[],pageParams:[]},c=0;const d=async()=>{let h=!1;const v=S=>{_g(S,()=>t.signal,()=>h=!0)},y=ic(t.options,t.fetchOptions),C=async(S,w,T)=>{if(h)return Promise.reject(t.signal.reason);if(w==null&&S.pages.length)return Promise.resolve(S);const L=(()=>{const P={client:t.client,queryKey:t.queryKey,pageParam:w,direction:T?"backward":"forward",meta:t.options.meta};return v(P),P})(),A=await y(L),{maxPages:x}=t.options,F=T?wg:Sg;return{pages:F(S.pages,A,x),pageParams:F(S.pageParams,w,x)}};if(o&&s.length){const S=o==="backward",w=S?Dg:fc,T={pages:s,pageParams:a},E=w(n,T);i=await C(T,E,S)}else{const S=e??s.length;do{const w=c===0?a[0]??n.initialPageParam:fc(n,i);if(c>0&&w==null)break;i=await C(i,w),c++}while(c<S)}return i};t.options.persister?t.fetchFn=()=>{var h,v;return(v=(h=t.options).persister)==null?void 0:v.call(h,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=d}}}function fc(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function Dg(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var Lg=(rg=class extends uc{constructor(t){super();me(this,Ht);me(this,Xn);me(this,pn);me(this,Jn);me(this,Jt);me(this,gn);me(this,pt);me(this,ts);me(this,mn);X(this,mn,!1),X(this,ts,t.defaultOptions),this.setOptions(t.options),this.observers=[],X(this,gn,t.client),X(this,Jt,I(this,gn).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,X(this,pn,gc(this.options)),this.state=t.state??I(this,pn),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return I(this,Xn)}get promise(){var t;return(t=I(this,pt))==null?void 0:t.promise}setOptions(t){if(this.options={...I(this,ts),...t},t!=null&&t._type&&X(this,Xn,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=gc(this.options);r.data!==void 0&&(this.setState(pc(r.data,r.dataUpdatedAt)),X(this,pn,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&I(this,Jt).remove(this)}setData(t,r){const n=Va(this.state.data,t,this.options);return Oe(this,Ht,Ar).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t){Oe(this,Ht,Ar).call(this,{type:"setState",state:t})}cancel(t){var n,o;const r=(n=I(this,pt))==null?void 0:n.promise;return(o=I(this,pt))==null||o.cancel(t),r?r.then(xt).catch(xt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return I(this,pn)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>jt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===hs||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>kr(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!rc(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=I(this,pt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=I(this,pt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),I(this,Jt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(I(this,pt)&&(I(this,mn)||Oe(this,Ht,cg).call(this)?I(this,pt).cancel({revert:!0}):I(this,pt).cancelRetry()),this.scheduleGc()),I(this,Jt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Oe(this,Ht,Ar).call(this,{type:"invalidate"})}async fetch(t,r){var d,u,f,m,g,b,h,v,y,C,S;if(this.state.fetchStatus!=="idle"&&((d=I(this,pt))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(I(this,pt))return I(this,pt).continueRetry(),I(this,pt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const w=this.observers.find(T=>T.options.queryFn);w&&this.setOptions(w.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,o=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(X(this,mn,!0),n.signal)})},s=()=>{const w=ic(this.options,r),E=(()=>{const L={client:I(this,gn),queryKey:this.queryKey,meta:this.meta};return o(L),L})();return X(this,mn,!1),this.options.persister?this.options.persister(w,E,this):w(E)},i=(()=>{const w={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:I(this,gn),state:this.state,fetchFn:s};return o(w),w})(),c=I(this,Xn)==="infinite"?Ig(this.options.pages):this.options.behavior;c==null||c.onFetch(i,this),X(this,Jn,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=i.fetchOptions)==null?void 0:u.meta))&&Oe(this,Ht,Ar).call(this,{type:"fetch",meta:(f=i.fetchOptions)==null?void 0:f.meta}),X(this,pt,dc({initialPromise:r==null?void 0:r.initialPromise,fn:i.fetchFn,onCancel:w=>{w instanceof Qa&&w.revert&&this.setState({...I(this,Jn),fetchStatus:"idle"}),n.abort()},onFail:(w,T)=>{Oe(this,Ht,Ar).call(this,{type:"failed",failureCount:w,error:T})},onPause:()=>{Oe(this,Ht,Ar).call(this,{type:"pause"})},onContinue:()=>{Oe(this,Ht,Ar).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}));try{const w=await I(this,pt).start();if(w===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(w),(g=(m=I(this,Jt).config).onSuccess)==null||g.call(m,w,this),(h=(b=I(this,Jt).config).onSettled)==null||h.call(b,w,this.state.error,this),w}catch(w){if(w instanceof Qa){if(w.silent)return I(this,pt).promise;if(w.revert){if(this.state.data===void 0)throw w;return this.state.data}}throw Oe(this,Ht,Ar).call(this,{type:"error",error:w}),(y=(v=I(this,Jt).config).onError)==null||y.call(v,w,this),(S=(C=I(this,Jt).config).onSettled)==null||S.call(C,this.state.data,w,this),w}finally{this.scheduleGc()}}},Xn=new WeakMap,pn=new WeakMap,Jn=new WeakMap,Jt=new WeakMap,gn=new WeakMap,pt=new WeakMap,ts=new WeakMap,mn=new WeakMap,Ht=new WeakSet,cg=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Ar=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...hc(n.data,this.options),fetchMeta:t.meta??null};case"success":const o={...n,...pc(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return X(this,Jn,t.manual?o:void 0),o;case"error":const s=t.error;return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),vt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),I(this,Jt).notify({query:this,type:"updated",action:t})})},rg);function hc(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:cc(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function pc(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function gc(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Og=(ng=class extends uo{constructor(t,r){super();me(this,je);me(this,qt);me(this,Ne);me(this,rs);me(this,Pt);me(this,vn);me(this,eo);me(this,_r);me(this,Ur);me(this,ns);me(this,to);me(this,ro);me(this,yn);me(this,bn);me(this,zr);me(this,no,new Set);this.options=r,X(this,qt,t),X(this,Ur,null),X(this,_r,Ha()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(I(this,Ne).addObserver(this),mc(I(this,Ne),this.options)?Oe(this,je,fs).call(this):this.updateResult(),Oe(this,je,Xl).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Wa(I(this,Ne),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Wa(I(this,Ne),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Oe(this,je,Jl).call(this),Oe(this,je,ec).call(this),I(this,Ne).removeObserver(this)}setOptions(t){const r=this.options,n=I(this,Ne);if(this.options=I(this,qt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof jt(this.options.enabled,I(this,Ne))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Oe(this,je,tc).call(this),I(this,Ne).setOptions(this.options),r._defaulted&&!Ua(this.options,r)&&I(this,qt).getQueryCache().notify({type:"observerOptionsUpdated",query:I(this,Ne),observer:this});const o=this.hasListeners();o&&vc(I(this,Ne),n,this.options,r)&&Oe(this,je,fs).call(this),this.updateResult(),o&&(I(this,Ne)!==n||jt(this.options.enabled,I(this,Ne))!==jt(r.enabled,I(this,Ne))||kr(this.options.staleTime,I(this,Ne))!==kr(r.staleTime,I(this,Ne)))&&Oe(this,je,Kl).call(this);const s=Oe(this,je,Yl).call(this);o&&(I(this,Ne)!==n||jt(this.options.enabled,I(this,Ne))!==jt(r.enabled,I(this,Ne))||s!==I(this,zr))&&Oe(this,je,Zl).call(this,s)}getOptimisticResult(t){const r=I(this,qt).getQueryCache().build(I(this,qt),t),n=this.createResult(r,t);return Ng(this,n)&&(X(this,Pt,n),X(this,eo,this.options),X(this,vn,I(this,Ne).state)),n}getCurrentResult(){return I(this,Pt)}trackResult(t,r){return new Proxy(t,{get:(n,o)=>(this.trackProp(o),r==null||r(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&I(this,_r).status==="pending"&&I(this,_r).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,o))})}trackProp(t){I(this,no).add(t)}getCurrentQuery(){return I(this,Ne)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=I(this,qt).defaultQueryOptions(t),n=I(this,qt).getQueryCache().build(I(this,qt),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Oe(this,je,fs).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),I(this,Pt)))}createResult(t,r){var x;const n=I(this,Ne),o=this.options,s=I(this,Pt),a=I(this,vn),i=I(this,eo),d=t!==n?t.state:I(this,rs),{state:u}=t;let f={...u},m=!1,g;if(r._optimisticResults){const F=this.hasListeners(),P=!F&&mc(t,r),N=F&&vc(t,n,r,o);(P||N)&&(f={...f,...hc(u.data,t.options)}),r._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:b,errorUpdatedAt:h,status:v}=f;g=f.data;let y=!1;if(r.placeholderData!==void 0&&g===void 0&&v==="pending"){let F;s!=null&&s.isPlaceholderData&&r.placeholderData===(i==null?void 0:i.placeholderData)?(F=s.data,y=!0):F=typeof r.placeholderData=="function"?r.placeholderData((x=I(this,ro))==null?void 0:x.state.data,I(this,ro)):r.placeholderData,F!==void 0&&(v="success",g=Va(s==null?void 0:s.data,F,r),m=!0)}if(r.select&&g!==void 0&&!y)if(s&&g===(a==null?void 0:a.data)&&r.select===I(this,ns))g=I(this,to);else try{X(this,ns,r.select),g=r.select(g),g=Va(s==null?void 0:s.data,g,r),X(this,to,g),X(this,Ur,null)}catch(F){X(this,Ur,F)}I(this,Ur)&&(b=I(this,Ur),g=I(this,to),h=Date.now(),v="error");const C=f.fetchStatus==="fetching",S=v==="pending",w=v==="error",T=S&&C,E=g!==void 0,A={status:v,fetchStatus:f.fetchStatus,isPending:S,isSuccess:v==="success",isError:w,isInitialLoading:T,isLoading:T,data:g,dataUpdatedAt:f.dataUpdatedAt,error:b,errorUpdatedAt:h,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:f.dataUpdateCount>d.dataUpdateCount||f.errorUpdateCount>d.errorUpdateCount,isFetching:C,isRefetching:C&&!S,isLoadingError:w&&!E,isPaused:f.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:w&&E,isStale:Ra(t,r),refetch:this.refetch,promise:I(this,_r),isEnabled:jt(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const F=A.data!==void 0,P=A.status==="error"&&!F,N=U=>{P?U.reject(A.error):F&&U.resolve(A.data)},M=()=>{const U=X(this,_r,A.promise=Ha());N(U)},B=I(this,_r);switch(B.status){case"pending":t.queryHash===n.queryHash&&N(B);break;case"fulfilled":(P||A.data!==B.value)&&M();break;case"rejected":(!P||A.error!==B.reason)&&M();break}}return A}updateResult(){const t=I(this,Pt),r=this.createResult(I(this,Ne),this.options);if(X(this,vn,I(this,Ne).state),X(this,eo,this.options),I(this,vn).data!==void 0&&X(this,ro,I(this,Ne)),Ua(r,t))return;X(this,Pt,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,s=typeof o=="function"?o():o;if(s==="all"||!s&&!I(this,no).size)return!0;const a=new Set(s??I(this,no));return this.options.throwOnError&&a.add("error"),Object.keys(I(this,Pt)).some(i=>{const c=i;return I(this,Pt)[c]!==t[c]&&a.has(c)})};Oe(this,je,dg).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Oe(this,je,Xl).call(this)}},qt=new WeakMap,Ne=new WeakMap,rs=new WeakMap,Pt=new WeakMap,vn=new WeakMap,eo=new WeakMap,_r=new WeakMap,Ur=new WeakMap,ns=new WeakMap,to=new WeakMap,ro=new WeakMap,yn=new WeakMap,bn=new WeakMap,zr=new WeakMap,no=new WeakMap,je=new WeakSet,fs=function(t){Oe(this,je,tc).call(this);let r=I(this,Ne).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(xt)),r},Kl=function(){Oe(this,je,Jl).call(this);const t=kr(this.options.staleTime,I(this,Ne));if(po.isServer()||I(this,Pt).isStale||!Ba(t))return;const n=rc(I(this,Pt).dataUpdatedAt,t)+1;X(this,yn,Kr.setTimeout(()=>{I(this,Pt).isStale||this.updateResult()},n))},Yl=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(I(this,Ne)):this.options.refetchInterval)??!1},Zl=function(t){Oe(this,je,ec).call(this),X(this,zr,t),!(po.isServer()||jt(this.options.enabled,I(this,Ne))===!1||!Ba(I(this,zr))||I(this,zr)===0)&&X(this,bn,Kr.setInterval(()=>{(this.options.refetchIntervalInBackground||$a.isFocused())&&Oe(this,je,fs).call(this)},I(this,zr)))},Xl=function(){Oe(this,je,Kl).call(this),Oe(this,je,Zl).call(this,Oe(this,je,Yl).call(this))},Jl=function(){I(this,yn)!==void 0&&(Kr.clearTimeout(I(this,yn)),X(this,yn,void 0))},ec=function(){I(this,bn)!==void 0&&(Kr.clearInterval(I(this,bn)),X(this,bn,void 0))},tc=function(){const t=I(this,qt).getQueryCache().build(I(this,qt),this.options);if(t===I(this,Ne))return;const r=I(this,Ne);X(this,Ne,t),X(this,rs,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},dg=function(t){vt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(I(this,Pt))}),I(this,qt).getQueryCache().notify({query:I(this,Ne),type:"observerResultsUpdated"})})},ng);function Pg(e,t){return jt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&jt(t.retryOnMount,e)===!1)}function mc(e,t){return Pg(e,t)||e.state.data!==void 0&&Wa(e,t,t.refetchOnMount)}function Wa(e,t,r){if(jt(t.enabled,e)!==!1&&kr(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Ra(e,t)}return!1}function vc(e,t,r,n){return(e!==t||jt(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Ra(e,r)}function Ra(e,t){return jt(t.enabled,e)!==!1&&e.isStaleByTime(kr(t.staleTime,e))}function Ng(e,t){return!Ua(e.getCurrentResult(),t)}var xg=(og=class extends uc{constructor(t){super();me(this,yr);me(this,os);me(this,vr);me(this,Dt);me(this,Cn);X(this,os,t.client),this.mutationId=t.mutationId,X(this,Dt,t.mutationCache),X(this,vr,[]),this.state=t.state||Fg(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){I(this,vr).includes(t)||(I(this,vr).push(t),this.clearGcTimeout(),I(this,Dt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){X(this,vr,I(this,vr).filter(r=>r!==t)),this.scheduleGc(),I(this,Dt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){I(this,vr).length||(this.state.status==="pending"?this.scheduleGc():I(this,Dt).remove(this))}continue(){var t;return((t=I(this,Cn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var a,i,c,d,u,f,m,g,b,h,v,y,C,S,w,T,E,L;const r=()=>{Oe(this,yr,Gr).call(this,{type:"continue"})},n={client:I(this,os),meta:this.options.meta,mutationKey:this.options.mutationKey};X(this,Cn,dc({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(A,x)=>{Oe(this,yr,Gr).call(this,{type:"failed",failureCount:A,error:x})},onPause:()=>{Oe(this,yr,Gr).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>I(this,Dt).canRun(this)}));const o=this.state.status==="pending",s=!I(this,Cn).canStart();try{if(o)r();else{Oe(this,yr,Gr).call(this,{type:"pending",variables:t,isPaused:s}),I(this,Dt).config.onMutate&&await I(this,Dt).config.onMutate(t,this,n);const x=await((i=(a=this.options).onMutate)==null?void 0:i.call(a,t,n));x!==this.state.context&&Oe(this,yr,Gr).call(this,{type:"pending",context:x,variables:t,isPaused:s})}const A=await I(this,Cn).start();return await((d=(c=I(this,Dt).config).onSuccess)==null?void 0:d.call(c,A,t,this.state.context,this,n)),await((f=(u=this.options).onSuccess)==null?void 0:f.call(u,A,t,this.state.context,n)),await((g=(m=I(this,Dt).config).onSettled)==null?void 0:g.call(m,A,null,this.state.variables,this.state.context,this,n)),await((h=(b=this.options).onSettled)==null?void 0:h.call(b,A,null,t,this.state.context,n)),Oe(this,yr,Gr).call(this,{type:"success",data:A}),A}catch(A){try{await((y=(v=I(this,Dt).config).onError)==null?void 0:y.call(v,A,t,this.state.context,this,n))}catch(x){Promise.reject(x)}try{await((S=(C=this.options).onError)==null?void 0:S.call(C,A,t,this.state.context,n))}catch(x){Promise.reject(x)}try{await((T=(w=I(this,Dt).config).onSettled)==null?void 0:T.call(w,void 0,A,this.state.variables,this.state.context,this,n))}catch(x){Promise.reject(x)}try{await((L=(E=this.options).onSettled)==null?void 0:L.call(E,void 0,A,t,this.state.context,n))}catch(x){Promise.reject(x)}throw Oe(this,yr,Gr).call(this,{type:"error",error:A}),A}finally{I(this,Dt).runNext(this)}}},os=new WeakMap,vr=new WeakMap,Dt=new WeakMap,Cn=new WeakMap,yr=new WeakSet,Gr=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),vt.batch(()=>{I(this,vr).forEach(n=>{n.onMutationUpdate(t)}),I(this,Dt).notify({mutation:this,type:"updated",action:t})})},og);function Fg(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Mg=(sg=class extends uo{constructor(t={}){super();me(this,Tr);me(this,cr);me(this,ss);this.config=t,X(this,Tr,new Set),X(this,cr,new Map),X(this,ss,0)}build(t,r,n){const o=new xg({client:t,mutationCache:this,mutationId:++Fa(this,ss)._,options:t.defaultMutationOptions(r),state:n});return this.add(o),o}add(t){I(this,Tr).add(t);const r=gs(t);if(typeof r=="string"){const n=I(this,cr).get(r);n?n.push(t):I(this,cr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(I(this,Tr).delete(t)){const r=gs(t);if(typeof r=="string"){const n=I(this,cr).get(r);if(n)if(n.length>1){const o=n.indexOf(t);o!==-1&&n.splice(o,1)}else n[0]===t&&I(this,cr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=gs(t);if(typeof r=="string"){const n=I(this,cr).get(r),o=n==null?void 0:n.find(s=>s.state.status==="pending");return!o||o===t}else return!0}runNext(t){var n;const r=gs(t);if(typeof r=="string"){const o=(n=I(this,cr).get(r))==null?void 0:n.find(s=>s!==t&&s.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){vt.batch(()=>{I(this,Tr).forEach(t=>{this.notify({type:"removed",mutation:t})}),I(this,Tr).clear(),I(this,cr).clear()})}getAll(){return Array.from(I(this,Tr))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>oc(r,n))}findAll(t={}){return this.getAll().filter(r=>oc(t,r))}notify(t){vt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return vt.batch(()=>Promise.all(t.map(r=>r.continue().catch(xt))))}},Tr=new WeakMap,cr=new WeakMap,ss=new WeakMap,sg);function gs(e){var t;return(t=e.options.scope)==null?void 0:t.id}var $g=(ag=class extends uo{constructor(t={}){super();me(this,br);this.config=t,X(this,br,new Map)}build(t,r,n){const o=r.queryKey,s=r.queryHash??qa(o,r);let a=this.get(s);return a||(a=new Lg({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(o)}),this.add(a)),a}add(t){I(this,br).has(t.queryHash)||(I(this,br).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=I(this,br).get(t.queryHash);r&&(t.destroy(),r===t&&I(this,br).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){vt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return I(this,br).get(t)}getAll(){return[...I(this,br).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>nc(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>nc(t,n)):r}notify(t){vt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){vt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){vt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},br=new WeakMap,ag),Bg=(ig=class{constructor(e={}){me(this,tt);me(this,Vr);me(this,Hr);me(this,oo);me(this,so);me(this,Qr);me(this,ao);me(this,io);X(this,tt,e.queryCache||new $g),X(this,Vr,e.mutationCache||new Mg),X(this,Hr,e.defaultOptions||{}),X(this,oo,new Map),X(this,so,new Map),X(this,Qr,0)}mount(){Fa(this,Qr)._++,I(this,Qr)===1&&(X(this,ao,$a.subscribe(async e=>{e&&(await this.resumePausedMutations(),I(this,tt).onFocus())})),X(this,io,ps.subscribe(async e=>{e&&(await this.resumePausedMutations(),I(this,tt).onOnline())})))}unmount(){var e,t;Fa(this,Qr)._--,I(this,Qr)===0&&((e=I(this,ao))==null||e.call(this),X(this,ao,void 0),(t=I(this,io))==null||t.call(this),X(this,io,void 0))}isFetching(e){return I(this,tt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return I(this,Vr).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=I(this,tt).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=I(this,tt).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(kr(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return I(this,tt).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),o=I(this,tt).get(n.queryHash),s=o==null?void 0:o.state.data,a=yg(t,s);if(a!==void 0)return I(this,tt).build(this,n).setData(a,{...r,manual:!0})}setQueriesData(e,t,r){return vt.batch(()=>I(this,tt).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=I(this,tt).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=I(this,tt);vt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=I(this,tt);return vt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=vt.batch(()=>I(this,tt).findAll(e).map(o=>o.cancel(r)));return Promise.all(n).then(xt).catch(xt)}invalidateQueries(e,t={}){return vt.batch(()=>(I(this,tt).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=vt.batch(()=>I(this,tt).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,r);return r.throwOnError||(s=s.catch(xt)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(n).then(xt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=I(this,tt).build(this,t);return r.isStaleByTime(kr(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(xt).catch(xt)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(xt).catch(xt)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return ps.isOnline()?I(this,Vr).resumePausedMutations():Promise.resolve()}getQueryCache(){return I(this,tt)}getMutationCache(){return I(this,Vr)}getDefaultOptions(){return I(this,Hr)}setDefaultOptions(e){X(this,Hr,e)}setQueryDefaults(e,t){I(this,oo).set(fo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...I(this,oo).values()],r={};return t.forEach(n=>{ho(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){I(this,so).set(fo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...I(this,so).values()],r={};return t.forEach(n=>{ho(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...I(this,Hr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=qa(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===hs&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...I(this,Hr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){I(this,tt).clear(),I(this,Vr).clear()}},tt=new WeakMap,Vr=new WeakMap,Hr=new WeakMap,oo=new WeakMap,so=new WeakMap,Qr=new WeakMap,ao=new WeakMap,io=new WeakMap,ig),yc=qe.createContext(void 0),qg=e=>{const t=qe.useContext(yc);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},jg=({client:e,children:t})=>(qe.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(yc.Provider,{value:e,children:t})),bc=qe.createContext(!1),Ug=()=>qe.useContext(bc);bc.Provider;function zg(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Vg=qe.createContext(zg()),Hg=()=>qe.useContext(Vg),Qg=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?lc(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},Wg=e=>{qe.useEffect(()=>{e.clearReset()},[e])},Rg=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(o&&e.data===void 0||lc(r,[e.error,n])),Gg=e=>{if(e.suspense){const r=o=>o==="static"?o:Math.max(o??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...o)=>r(n(...o)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Kg=(e,t)=>e.isLoading&&e.isFetching&&!t,Yg=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Cc=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function Zg(e,t,r){var g,b,h,v;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const n=Ug(),o=Hg(),s=qg(),a=s.defaultQueryOptions(e);(b=(g=s.getDefaultOptions().queries)==null?void 0:g._experimental_beforeQuery)==null||b.call(g,a);const i=s.getQueryCache().get(a.queryHash);process.env.NODE_ENV!=="production"&&(a.queryFn||console.error(`[${a.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`));const c=e.subscribed!==!1;a._optimisticResults=n?"isRestoring":c?"optimistic":void 0,Gg(a),Qg(a,o,i),Wg(o);const d=!s.getQueryCache().get(a.queryHash),[u]=qe.useState(()=>new t(s,a)),f=u.getOptimisticResult(a),m=!n&&c;if(qe.useSyncExternalStore(qe.useCallback(y=>{const C=m?u.subscribe(vt.batchCalls(y)):xt;return u.updateResult(),C},[u,m]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),qe.useEffect(()=>{u.setOptions(a)},[a,u]),Yg(a,f))throw Cc(a,u,o);if(Rg({result:f,errorResetBoundary:o,throwOnError:a.throwOnError,query:i,suspense:a.suspense}))throw f.error;if((v=(h=s.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||v.call(h,a,f),a.experimental_prefetchInRender&&!po.isServer()&&Kg(f,n)){const y=d?Cc(a,u,o):i==null?void 0:i.promise;y==null||y.catch(xt).finally(()=>{u.updateResult()})}return a.notifyOnChangeProps?f:u.trackResult(f)}function Tn(e,t){return Zg(e,Og)}let Xg={data:""},Jg=e=>{if(typeof window=="object"){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||Xg},em=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,tm=/\/\*[^]*?\*\/| +/g,Sc=/\n+/g,Ir=(e,t)=>{let r="",n="",o="";for(let s in e){let a=e[s];s[0]=="@"?s[1]=="i"?r=s+" "+a+";":n+=s[1]=="f"?Ir(a,s):s+"{"+Ir(a,s[1]=="k"?"":t)+"}":typeof a=="object"?n+=Ir(a,t?t.replace(/([^,])+/g,i=>s.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,i):i?i+" "+c:c)):s):a!=null&&(s=s[1]=="-"?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=Ir.p?Ir.p(s,a):s+":"+a+";")}return r+(t&&o?t+"{"+o+"}":o)+n},Dr={},wc=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+wc(e[r]);return t}return e},rm=(e,t,r,n,o)=>{let s=wc(e),a=Dr[s]||(Dr[s]=(c=>{let d=0,u=11;for(;d<c.length;)u=101*u+c.charCodeAt(d++)>>>0;return"go"+u})(s));if(!Dr[a]){let c=s!==e?e:(d=>{let u,f,m=[{}];for(;u=em.exec(d.replace(tm,""));)u[4]?m.shift():u[3]?(f=u[3].replace(Sc," ").trim(),m.unshift(m[0][f]=m[0][f]||{})):m[0][u[1]]=u[2].replace(Sc," ").trim();return m[0]})(e);Dr[a]=Ir(o?{["@keyframes "+a]:c}:c,r?"":"."+a)}let i=r&&Dr.g;return r&&(Dr.g=Dr[a]),((c,d,u,f)=>{f?d.data=d.data.replace(f,c):d.data.indexOf(c)===-1&&(d.data=u?c+d.data:d.data+c)})(Dr[a],t,n,i),a},nm=(e,t,r)=>e.reduce((n,o,s)=>{let a=t[s];if(a&&a.call){let i=a(r),c=i&&i.props&&i.props.className||/^go/.test(i)&&i;a=c?"."+c:i&&typeof i=="object"?i.props?"":Ir(i,""):i===!1?"":i}return n+o+(a??"")},"");function ms(e){let t=this||{},r=e.call?e(t.p):e;return rm(r.unshift?r.raw?nm(r,[].slice.call(arguments,1),t.p):r.reduce((n,o)=>Object.assign(n,o&&o.call?o(t.p):o),{}):r,Jg(t.target),t.g,t.o,t.k)}let _c,Ga,Ka;ms.bind({g:1});let wr=ms.bind({k:1});function om(e,t,r,n){Ir.p=t,_c=e,Ga=r,Ka=n}function Lr(e,t){let r=this||{};return function(){let n=arguments;function o(s,a){let i=Object.assign({},s),c=i.className||o.className;r.p=Object.assign({theme:Ga&&Ga()},i),r.o=/go\d/.test(c),i.className=ms.apply(r,n)+(c?" "+c:"");let d=e;return e[0]&&(d=i.as||e,delete i.as),Ka&&d[0]&&Ka(i),_c(d,i)}return o}}var sm=e=>typeof e=="function",vs=(e,t)=>sm(e)?e(t):e,am=(()=>{let e=0;return()=>(++e).toString()})(),Tc=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),im=20,Ya="default",Ec=(e,t)=>{let{toastLimit:r}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,r)};case 1:return{...e,toasts:e.toasts.map(a=>a.id===t.toast.id?{...a,...t.toast}:a)};case 2:let{toast:n}=t;return Ec(e,{type:e.toasts.find(a=>a.id===n.id)?1:0,toast:n});case 3:let{toastId:o}=t;return{...e,toasts:e.toasts.map(a=>a.id===o||o===void 0?{...a,dismissed:!0,visible:!1}:a)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(a=>a.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let s=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(a=>({...a,pauseDuration:a.pauseDuration+s}))}}},ys=[],Ac={toasts:[],pausedAt:void 0,settings:{toastLimit:im}},ur={},kc=(e,t=Ya)=>{ur[t]=Ec(ur[t]||Ac,e),ys.forEach(([r,n])=>{r===t&&n(ur[t])})},Ic=e=>Object.keys(ur).forEach(t=>kc(e,t)),lm=e=>Object.keys(ur).find(t=>ur[t].toasts.some(r=>r.id===e)),bs=(e=Ya)=>t=>{kc(t,e)},cm={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},dm=(e={},t=Ya)=>{let[r,n]=p.useState(ur[t]||Ac),o=p.useRef(ur[t]);p.useEffect(()=>(o.current!==ur[t]&&n(ur[t]),ys.push([t,n]),()=>{let a=ys.findIndex(([i])=>i===t);a>-1&&ys.splice(a,1)}),[t]);let s=r.toasts.map(a=>{var i,c,d;return{...e,...e[a.type],...a,removeDelay:a.removeDelay||((i=e[a.type])==null?void 0:i.removeDelay)||(e==null?void 0:e.removeDelay),duration:a.duration||((c=e[a.type])==null?void 0:c.duration)||(e==null?void 0:e.duration)||cm[a.type],style:{...e.style,...(d=e[a.type])==null?void 0:d.style,...a.style}}});return{...r,toasts:s}},um=(e,t="blank",r)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:(r==null?void 0:r.id)||am()}),go=e=>(t,r)=>{let n=um(t,e,r);return bs(n.toasterId||lm(n.id))({type:2,toast:n}),n.id},at=(e,t)=>go("blank")(e,t);at.error=go("error"),at.success=go("success"),at.loading=go("loading"),at.custom=go("custom"),at.dismiss=(e,t)=>{let r={type:3,toastId:e};t?bs(t)(r):Ic(r)},at.dismissAll=e=>at.dismiss(void 0,e),at.remove=(e,t)=>{let r={type:4,toastId:e};t?bs(t)(r):Ic(r)},at.removeAll=e=>at.remove(void 0,e),at.promise=(e,t,r)=>{let n=at.loading(t.loading,{...r,...r==null?void 0:r.loading});return typeof e=="function"&&(e=e()),e.then(o=>{let s=t.success?vs(t.success,o):void 0;return s?at.success(s,{id:n,...r,...r==null?void 0:r.success}):at.dismiss(n),o}).catch(o=>{let s=t.error?vs(t.error,o):void 0;s?at.error(s,{id:n,...r,...r==null?void 0:r.error}):at.dismiss(n)}),e};var fm=1e3,hm=(e,t="default")=>{let{toasts:r,pausedAt:n}=dm(e,t),o=p.useRef(new Map).current,s=p.useCallback((f,m=fm)=>{if(o.has(f))return;let g=setTimeout(()=>{o.delete(f),a({type:4,toastId:f})},m);o.set(f,g)},[]);p.useEffect(()=>{if(n)return;let f=Date.now(),m=r.map(g=>{if(g.duration===1/0)return;let b=(g.duration||0)+g.pauseDuration-(f-g.createdAt);if(b<0){g.visible&&at.dismiss(g.id);return}return setTimeout(()=>at.dismiss(g.id,t),b)});return()=>{m.forEach(g=>g&&clearTimeout(g))}},[r,n,t]);let a=p.useCallback(bs(t),[t]),i=p.useCallback(()=>{a({type:5,time:Date.now()})},[a]),c=p.useCallback((f,m)=>{a({type:1,toast:{id:f,height:m}})},[a]),d=p.useCallback(()=>{n&&a({type:6,time:Date.now()})},[n,a]),u=p.useCallback((f,m)=>{let{reverseOrder:g=!1,gutter:b=8,defaultPosition:h}=m||{},v=r.filter(S=>(S.position||h)===(f.position||h)&&S.height),y=v.findIndex(S=>S.id===f.id),C=v.filter((S,w)=>w<y&&S.visible).length;return v.filter(S=>S.visible).slice(...g?[C+1]:[0,C]).reduce((S,w)=>S+(w.height||0)+b,0)},[r]);return p.useEffect(()=>{r.forEach(f=>{if(f.dismissed)s(f.id,f.removeDelay);else{let m=o.get(f.id);m&&(clearTimeout(m),o.delete(f.id))}})},[r,s]),{toasts:r,handlers:{updateHeight:c,startPause:i,endPause:d,calculateOffset:u}}},pm=wr`
2
2
  from {
3
3
  transform: scale(0) rotate(45deg);
4
4
  opacity: 0;
@@ -6,7 +6,7 @@ from {
6
6
  to {
7
7
  transform: scale(1) rotate(45deg);
8
8
  opacity: 1;
9
- }`,pm=wr`
9
+ }`,gm=wr`
10
10
  from {
11
11
  transform: scale(0);
12
12
  opacity: 0;
@@ -14,7 +14,7 @@ from {
14
14
  to {
15
15
  transform: scale(1);
16
16
  opacity: 1;
17
- }`,gm=wr`
17
+ }`,mm=wr`
18
18
  from {
19
19
  transform: scale(0) rotate(90deg);
20
20
  opacity: 0;
@@ -22,7 +22,7 @@ from {
22
22
  to {
23
23
  transform: scale(1) rotate(90deg);
24
24
  opacity: 1;
25
- }`,mm=Lr("div")`
25
+ }`,vm=Lr("div")`
26
26
  width: 20px;
27
27
  opacity: 0;
28
28
  height: 20px;
@@ -31,14 +31,14 @@ to {
31
31
  position: relative;
32
32
  transform: rotate(45deg);
33
33
 
34
- animation: ${hm} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
34
+ animation: ${pm} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
35
35
  forwards;
36
36
  animation-delay: 100ms;
37
37
 
38
38
  &:after,
39
39
  &:before {
40
40
  content: '';
41
- animation: ${pm} 0.15s ease-out forwards;
41
+ animation: ${gm} 0.15s ease-out forwards;
42
42
  animation-delay: 150ms;
43
43
  position: absolute;
44
44
  border-radius: 3px;
@@ -51,18 +51,18 @@ to {
51
51
  }
52
52
 
53
53
  &:before {
54
- animation: ${gm} 0.15s ease-out forwards;
54
+ animation: ${mm} 0.15s ease-out forwards;
55
55
  animation-delay: 180ms;
56
56
  transform: rotate(90deg);
57
57
  }
58
- `,vm=wr`
58
+ `,ym=wr`
59
59
  from {
60
60
  transform: rotate(0deg);
61
61
  }
62
62
  to {
63
63
  transform: rotate(360deg);
64
64
  }
65
- `,ym=Lr("div")`
65
+ `,bm=Lr("div")`
66
66
  width: 12px;
67
67
  height: 12px;
68
68
  box-sizing: border-box;
@@ -70,8 +70,8 @@ to {
70
70
  border-radius: 100%;
71
71
  border-color: ${e=>e.secondary||"#e0e0e0"};
72
72
  border-right-color: ${e=>e.primary||"#616161"};
73
- animation: ${vm} 1s linear infinite;
74
- `,bm=wr`
73
+ animation: ${ym} 1s linear infinite;
74
+ `,Cm=wr`
75
75
  from {
76
76
  transform: scale(0) rotate(45deg);
77
77
  opacity: 0;
@@ -79,7 +79,7 @@ from {
79
79
  to {
80
80
  transform: scale(1) rotate(45deg);
81
81
  opacity: 1;
82
- }`,Cm=wr`
82
+ }`,Sm=wr`
83
83
  0% {
84
84
  height: 0;
85
85
  width: 0;
@@ -93,7 +93,7 @@ to {
93
93
  100% {
94
94
  opacity: 1;
95
95
  height: 10px;
96
- }`,Sm=Lr("div")`
96
+ }`,wm=Lr("div")`
97
97
  width: 20px;
98
98
  opacity: 0;
99
99
  height: 20px;
@@ -102,13 +102,13 @@ to {
102
102
  position: relative;
103
103
  transform: rotate(45deg);
104
104
 
105
- animation: ${bm} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
105
+ animation: ${Cm} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
106
106
  forwards;
107
107
  animation-delay: 100ms;
108
108
  &:after {
109
109
  content: '';
110
110
  box-sizing: border-box;
111
- animation: ${Cm} 0.2s ease-out forwards;
111
+ animation: ${Sm} 0.2s ease-out forwards;
112
112
  opacity: 0;
113
113
  animation-delay: 200ms;
114
114
  position: absolute;
@@ -120,16 +120,16 @@ to {
120
120
  height: 10px;
121
121
  width: 6px;
122
122
  }
123
- `,wm=Lr("div")`
124
- position: absolute;
125
123
  `,_m=Lr("div")`
124
+ position: absolute;
125
+ `,Tm=Lr("div")`
126
126
  position: relative;
127
127
  display: flex;
128
128
  justify-content: center;
129
129
  align-items: center;
130
130
  min-width: 20px;
131
131
  min-height: 20px;
132
- `,Tm=wr`
132
+ `,Em=wr`
133
133
  from {
134
134
  transform: scale(0.6);
135
135
  opacity: 0.4;
@@ -137,20 +137,20 @@ from {
137
137
  to {
138
138
  transform: scale(1);
139
139
  opacity: 1;
140
- }`,Em=Lr("div")`
140
+ }`,Am=Lr("div")`
141
141
  position: relative;
142
142
  transform: scale(0.6);
143
143
  opacity: 0.4;
144
144
  min-width: 20px;
145
- animation: ${Tm} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
145
+ animation: ${Em} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
146
146
  forwards;
147
- `,Am=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return t!==void 0?typeof t=="string"?qe.createElement(Em,null,t):t:r==="blank"?null:qe.createElement(_m,null,qe.createElement(ym,{...n}),r!=="loading"&&qe.createElement(wm,null,r==="error"?qe.createElement(mm,{...n}):qe.createElement(Sm,{...n})))},km=e=>`
147
+ `,km=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return t!==void 0?typeof t=="string"?qe.createElement(Am,null,t):t:r==="blank"?null:qe.createElement(Tm,null,qe.createElement(bm,{...n}),r!=="loading"&&qe.createElement(_m,null,r==="error"?qe.createElement(vm,{...n}):qe.createElement(wm,{...n})))},Im=e=>`
148
148
  0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
149
149
  100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
150
- `,Im=e=>`
150
+ `,Dm=e=>`
151
151
  0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
152
152
  100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
153
- `,Dm="0%{opacity:0;} 100%{opacity:1;}",Lm="0%{opacity:1;} 100%{opacity:0;}",Om=Lr("div")`
153
+ `,Lm="0%{opacity:0;} 100%{opacity:1;}",Om="0%{opacity:1;} 100%{opacity:0;}",Pm=Lr("div")`
154
154
  display: flex;
155
155
  align-items: center;
156
156
  background: #fff;
@@ -162,338 +162,338 @@ to {
162
162
  pointer-events: auto;
163
163
  padding: 8px 10px;
164
164
  border-radius: 8px;
165
- `,Pm=Lr("div")`
165
+ `,Nm=Lr("div")`
166
166
  display: flex;
167
167
  justify-content: center;
168
168
  margin: 4px 10px;
169
169
  color: inherit;
170
170
  flex: 1 1 auto;
171
171
  white-space: pre-line;
172
- `,Nm=(e,t)=>{let r=e.includes("top")?1:-1,[n,o]=Tc()?[Dm,Lm]:[km(r),Im(r)];return{animation:t?`${wr(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${wr(o)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},xm=qe.memo(({toast:e,position:t,style:r,children:n})=>{let o=e.height?Nm(e.position||t||"top-center",e.visible):{opacity:0},s=qe.createElement(Am,{toast:e}),a=qe.createElement(Pm,{...e.ariaProps},vs(e.message,e));return qe.createElement(Om,{className:e.className,style:{...o,...r,...e.style}},typeof n=="function"?n({icon:s,message:a}):qe.createElement(qe.Fragment,null,s,a))});nm(qe.createElement);var Fm=({id:e,className:t,style:r,onHeightUpdate:n,children:o})=>{let s=qe.useCallback(a=>{if(a){let i=()=>{let c=a.getBoundingClientRect().height;n(e,c)};i(),new MutationObserver(i).observe(a,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return qe.createElement("div",{ref:s,className:t,style:r},o)},Mm=(e,t)=>{let r=e.includes("top"),n=r?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:Tc()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...o}},$m=ms`
172
+ `,xm=(e,t)=>{let r=e.includes("top")?1:-1,[n,o]=Tc()?[Lm,Om]:[Im(r),Dm(r)];return{animation:t?`${wr(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${wr(o)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Fm=qe.memo(({toast:e,position:t,style:r,children:n})=>{let o=e.height?xm(e.position||t||"top-center",e.visible):{opacity:0},s=qe.createElement(km,{toast:e}),a=qe.createElement(Nm,{...e.ariaProps},vs(e.message,e));return qe.createElement(Pm,{className:e.className,style:{...o,...r,...e.style}},typeof n=="function"?n({icon:s,message:a}):qe.createElement(qe.Fragment,null,s,a))});om(qe.createElement);var Mm=({id:e,className:t,style:r,onHeightUpdate:n,children:o})=>{let s=qe.useCallback(a=>{if(a){let i=()=>{let c=a.getBoundingClientRect().height;n(e,c)};i(),new MutationObserver(i).observe(a,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return qe.createElement("div",{ref:s,className:t,style:r},o)},$m=(e,t)=>{let r=e.includes("top"),n=r?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:Tc()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...o}},Bm=ms`
173
173
  z-index: 9999;
174
174
  > * {
175
175
  pointer-events: auto;
176
176
  }
177
- `,Cs=16,Bm=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:o,toasterId:s,containerStyle:a,containerClassName:i})=>{let{toasts:c,handlers:d}=fm(r,s);return qe.createElement("div",{"data-rht-toaster":s||"",style:{position:"fixed",zIndex:9999,top:Cs,left:Cs,right:Cs,bottom:Cs,pointerEvents:"none",...a},className:i,onMouseEnter:d.startPause,onMouseLeave:d.endPause},c.map(u=>{let f=u.position||t,m=d.calculateOffset(u,{reverseOrder:e,gutter:n,defaultPosition:t}),g=Mm(f,m);return qe.createElement(Fm,{id:u.id,key:u.id,onHeightUpdate:d.updateHeight,className:u.visible?$m:"",style:g},u.type==="custom"?vs(u.message,u):o?o(u):qe.createElement(xm,{toast:u,position:f}))}))},Se=at;function qm(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return p.useMemo(()=>n=>{t.forEach(o=>o(n))},t)}const Ss=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Tn(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Za(e){return"nodeType"in e}function Ot(e){var t,r;return e?Tn(e)?e:Za(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function Xa(e){const{Document:t}=Ot(e);return e instanceof t}function mo(e){return Tn(e)?!1:e instanceof Ot(e).HTMLElement}function Dc(e){return e instanceof Ot(e).SVGElement}function En(e){return e?Tn(e)?e.document:Za(e)?Xa(e)?e:mo(e)||Dc(e)?e.ownerDocument:document:document:document}const rr=Ss?p.useLayoutEffect:p.useEffect;function ws(e){const t=p.useRef(e);return rr(()=>{t.current=e}),p.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}function jm(){const e=p.useRef(null),t=p.useCallback((n,o)=>{e.current=setInterval(n,o)},[]),r=p.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function vo(e,t){t===void 0&&(t=[e]);const r=p.useRef(e);return rr(()=>{r.current!==e&&(r.current=e)},t),r}function yo(e,t){const r=p.useRef();return p.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function _s(e){const t=ws(e),r=p.useRef(null),n=p.useCallback(o=>{o!==r.current&&(t==null||t(o,r.current)),r.current=o},[]);return[r,n]}function Ts(e){const t=p.useRef();return p.useEffect(()=>{t.current=e},[e]),t.current}let Ja={};function bo(e,t){return p.useMemo(()=>{if(t)return t;const r=Ja[e]==null?0:Ja[e]+1;return Ja[e]=r,e+"-"+r},[e,t])}function Lc(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return n.reduce((s,a)=>{const i=Object.entries(a);for(const[c,d]of i){const u=s[c];u!=null&&(s[c]=u+e*d)}return s},{...t})}}const An=Lc(1),Co=Lc(-1);function Um(e){return"clientX"in e&&"clientY"in e}function Es(e){if(!e)return!1;const{KeyboardEvent:t}=Ot(e.target);return t&&e instanceof t}function zm(e){if(!e)return!1;const{TouchEvent:t}=Ot(e.target);return t&&e instanceof t}function As(e){if(zm(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return Um(e)?{x:e.clientX,y:e.clientY}:null}const Or=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[Or.Translate.toString(e),Or.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),Oc="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Vm(e){return e.matches(Oc)?e:e.querySelector(Oc)}const Hm={display:"none"};function Qm(e){let{id:t,value:r}=e;return p.createElement("div",{id:t,style:Hm},r)}function Wm(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return p.createElement("div",{id:t,style:o,role:"status","aria-live":n,"aria-atomic":!0},r)}function Rm(){const[e,t]=p.useState("");return{announce:p.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const Pc=p.createContext(null);function Gm(e){const t=p.useContext(Pc);p.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Km(){const[e]=p.useState(()=>new Set),t=p.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[p.useCallback(n=>{let{type:o,event:s}=n;e.forEach(a=>{var i;return(i=a[o])==null?void 0:i.call(a,s)})},[e]),t]}const Ym={draggable:`
177
+ `,Cs=16,qm=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:o,toasterId:s,containerStyle:a,containerClassName:i})=>{let{toasts:c,handlers:d}=hm(r,s);return qe.createElement("div",{"data-rht-toaster":s||"",style:{position:"fixed",zIndex:9999,top:Cs,left:Cs,right:Cs,bottom:Cs,pointerEvents:"none",...a},className:i,onMouseEnter:d.startPause,onMouseLeave:d.endPause},c.map(u=>{let f=u.position||t,m=d.calculateOffset(u,{reverseOrder:e,gutter:n,defaultPosition:t}),g=$m(f,m);return qe.createElement(Mm,{id:u.id,key:u.id,onHeightUpdate:d.updateHeight,className:u.visible?Bm:"",style:g},u.type==="custom"?vs(u.message,u):o?o(u):qe.createElement(Fm,{toast:u,position:f}))}))},Se=at;function jm(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return p.useMemo(()=>n=>{t.forEach(o=>o(n))},t)}const Ss=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function En(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Za(e){return"nodeType"in e}function Ot(e){var t,r;return e?En(e)?e:Za(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function Xa(e){const{Document:t}=Ot(e);return e instanceof t}function mo(e){return En(e)?!1:e instanceof Ot(e).HTMLElement}function Dc(e){return e instanceof Ot(e).SVGElement}function An(e){return e?En(e)?e.document:Za(e)?Xa(e)?e:mo(e)||Dc(e)?e.ownerDocument:document:document:document}const rr=Ss?p.useLayoutEffect:p.useEffect;function ws(e){const t=p.useRef(e);return rr(()=>{t.current=e}),p.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}function Um(){const e=p.useRef(null),t=p.useCallback((n,o)=>{e.current=setInterval(n,o)},[]),r=p.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function vo(e,t){t===void 0&&(t=[e]);const r=p.useRef(e);return rr(()=>{r.current!==e&&(r.current=e)},t),r}function yo(e,t){const r=p.useRef();return p.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function _s(e){const t=ws(e),r=p.useRef(null),n=p.useCallback(o=>{o!==r.current&&(t==null||t(o,r.current)),r.current=o},[]);return[r,n]}function Ts(e){const t=p.useRef();return p.useEffect(()=>{t.current=e},[e]),t.current}let Ja={};function bo(e,t){return p.useMemo(()=>{if(t)return t;const r=Ja[e]==null?0:Ja[e]+1;return Ja[e]=r,e+"-"+r},[e,t])}function Lc(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return n.reduce((s,a)=>{const i=Object.entries(a);for(const[c,d]of i){const u=s[c];u!=null&&(s[c]=u+e*d)}return s},{...t})}}const kn=Lc(1),Co=Lc(-1);function zm(e){return"clientX"in e&&"clientY"in e}function Es(e){if(!e)return!1;const{KeyboardEvent:t}=Ot(e.target);return t&&e instanceof t}function Vm(e){if(!e)return!1;const{TouchEvent:t}=Ot(e.target);return t&&e instanceof t}function As(e){if(Vm(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return zm(e)?{x:e.clientX,y:e.clientY}:null}const Or=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[Or.Translate.toString(e),Or.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),Oc="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Hm(e){return e.matches(Oc)?e:e.querySelector(Oc)}const Qm={display:"none"};function Wm(e){let{id:t,value:r}=e;return p.createElement("div",{id:t,style:Qm},r)}function Rm(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return p.createElement("div",{id:t,style:o,role:"status","aria-live":n,"aria-atomic":!0},r)}function Gm(){const[e,t]=p.useState("");return{announce:p.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const Pc=p.createContext(null);function Km(e){const t=p.useContext(Pc);p.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Ym(){const[e]=p.useState(()=>new Set),t=p.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[p.useCallback(n=>{let{type:o,event:s}=n;e.forEach(a=>{var i;return(i=a[o])==null?void 0:i.call(a,s)})},[e]),t]}const Zm={draggable:`
178
178
  To pick up a draggable item, press the space bar.
179
179
  While dragging, use the arrow keys to move the item.
180
180
  Press space again to drop the item in its new position, or press escape to cancel.
181
- `},Zm={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Xm(e){let{announcements:t=Zm,container:r,hiddenTextDescribedById:n,screenReaderInstructions:o=Ym}=e;const{announce:s,announcement:a}=Rm(),i=bo("DndLiveRegion"),[c,d]=p.useState(!1);if(p.useEffect(()=>{d(!0)},[]),Gm(p.useMemo(()=>({onDragStart(f){let{active:m}=f;s(t.onDragStart({active:m}))},onDragMove(f){let{active:m,over:g}=f;t.onDragMove&&s(t.onDragMove({active:m,over:g}))},onDragOver(f){let{active:m,over:g}=f;s(t.onDragOver({active:m,over:g}))},onDragEnd(f){let{active:m,over:g}=f;s(t.onDragEnd({active:m,over:g}))},onDragCancel(f){let{active:m,over:g}=f;s(t.onDragCancel({active:m,over:g}))}}),[s,t])),!c)return null;const u=p.createElement(p.Fragment,null,p.createElement(Qm,{id:n,value:o.draggable}),p.createElement(Wm,{id:i,announcement:a}));return r?Ue.createPortal(u,r):u}var it;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(it||(it={}));function ks(){}function ei(e,t){return p.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Nc(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return p.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const nr=Object.freeze({x:0,y:0});function xc(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Jm(e,t){const r=As(e);if(!r)return"0 0";const n={x:(r.x-t.left)/t.width*100,y:(r.y-t.top)/t.height*100};return n.x+"% "+n.y+"%"}function Fc(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function ev(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function Mc(e){let{left:t,top:r,height:n,width:o}=e;return[{x:t,y:r},{x:t+o,y:r},{x:t,y:r+n},{x:t+o,y:r+n}]}function $c(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function Bc(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const tv=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=Bc(t,t.left,t.top),s=[];for(const a of n){const{id:i}=a,c=r.get(i);if(c){const d=xc(Bc(c),o);s.push({id:i,data:{droppableContainer:a,value:d}})}}return s.sort(Fc)},rv=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=Mc(t),s=[];for(const a of n){const{id:i}=a,c=r.get(i);if(c){const d=Mc(c),u=o.reduce((m,g,b)=>m+xc(d[b],g),0),f=Number((u/4).toFixed(4));s.push({id:i,data:{droppableContainer:a,value:f}})}}return s.sort(Fc)};function nv(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),a=o-n,i=s-r;if(n<o&&r<s){const c=t.width*t.height,d=e.width*e.height,u=a*i,f=u/(c+d-u);return Number(f.toFixed(4))}return 0}const ov=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=[];for(const s of n){const{id:a}=s,i=r.get(a);if(i){const c=nv(i,t);c>0&&o.push({id:a,data:{droppableContainer:s,value:c}})}}return o.sort(ev)};function sv(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function qc(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:nr}function av(e){return function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),s=1;s<n;s++)o[s-1]=arguments[s];return o.reduce((a,i)=>({...a,top:a.top+e*i.y,bottom:a.bottom+e*i.y,left:a.left+e*i.x,right:a.right+e*i.x}),{...r})}}const iv=av(1);function jc(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function lv(e,t,r){const n=jc(t);if(!n)return e;const{scaleX:o,scaleY:s,x:a,y:i}=n,c=e.left-a-(1-o)*parseFloat(r),d=e.top-i-(1-s)*parseFloat(r.slice(r.indexOf(" ")+1)),u=o?e.width/o:e.width,f=s?e.height/s:e.height;return{width:u,height:f,top:d,right:c+u,bottom:d+f,left:c}}const cv={ignoreTransform:!1};function kn(e,t){t===void 0&&(t=cv);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:u}=Ot(e).getComputedStyle(e);d&&(r=lv(r,d,u))}const{top:n,left:o,width:s,height:a,bottom:i,right:c}=r;return{top:n,left:o,width:s,height:a,bottom:i,right:c}}function Uc(e){return kn(e,{ignoreTransform:!0})}function dv(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function uv(e,t){return t===void 0&&(t=Ot(e).getComputedStyle(e)),t.position==="fixed"}function fv(e,t){t===void 0&&(t=Ot(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const s=t[o];return typeof s=="string"?r.test(s):!1})}function Is(e,t){const r=[];function n(o){if(t!=null&&r.length>=t||!o)return r;if(Xa(o)&&o.scrollingElement!=null&&!r.includes(o.scrollingElement))return r.push(o.scrollingElement),r;if(!mo(o)||Dc(o)||r.includes(o))return r;const s=Ot(e).getComputedStyle(o);return o!==e&&fv(o,s)&&r.push(o),uv(o,s)?r:n(o.parentNode)}return e?n(e):r}function zc(e){const[t]=Is(e,1);return t??null}function ti(e){return!Ss||!e?null:Tn(e)?e:Za(e)?Xa(e)||e===En(e).scrollingElement?window:mo(e)?e:null:null}function Vc(e){return Tn(e)?e.scrollX:e.scrollLeft}function Hc(e){return Tn(e)?e.scrollY:e.scrollTop}function ri(e){return{x:Vc(e),y:Hc(e)}}var ut;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(ut||(ut={}));function Qc(e){return!Ss||!e?!1:e===document.scrollingElement}function Wc(e){const t={x:0,y:0},r=Qc(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},o=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,a=e.scrollTop>=n.y,i=e.scrollLeft>=n.x;return{isTop:o,isLeft:s,isBottom:a,isRight:i,maxScroll:n,minScroll:t}}const hv={x:.2,y:.2};function pv(e,t,r,n,o){let{top:s,left:a,right:i,bottom:c}=r;n===void 0&&(n=10),o===void 0&&(o=hv);const{isTop:d,isBottom:u,isLeft:f,isRight:m}=Wc(e),g={x:0,y:0},b={x:0,y:0},h={height:t.height*o.y,width:t.width*o.x};return!d&&s<=t.top+h.height?(g.y=ut.Backward,b.y=n*Math.abs((t.top+h.height-s)/h.height)):!u&&c>=t.bottom-h.height&&(g.y=ut.Forward,b.y=n*Math.abs((t.bottom-h.height-c)/h.height)),!m&&i>=t.right-h.width?(g.x=ut.Forward,b.x=n*Math.abs((t.right-h.width-i)/h.width)):!f&&a<=t.left+h.width&&(g.x=ut.Backward,b.x=n*Math.abs((t.left+h.width-a)/h.width)),{direction:g,speed:b}}function gv(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:a}=window;return{top:0,left:0,right:s,bottom:a,width:s,height:a}}const{top:t,left:r,right:n,bottom:o}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:o,width:e.clientWidth,height:e.clientHeight}}function Rc(e){return e.reduce((t,r)=>An(t,ri(r)),nr)}function mv(e){return e.reduce((t,r)=>t+Vc(r),0)}function vv(e){return e.reduce((t,r)=>t+Hc(r),0)}function Gc(e,t){if(t===void 0&&(t=kn),!e)return;const{top:r,left:n,bottom:o,right:s}=t(e);zc(e)&&(o<=0||s<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const yv=[["x",["left","right"],mv],["y",["top","bottom"],vv]];class ni{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=Is(r),o=Rc(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,a,i]of yv)for(const c of a)Object.defineProperty(this,c,{get:()=>{const d=i(n),u=o[s]-d;return this.rect[c]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class So{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var o;(o=this.target)==null||o.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function bv(e){const{EventTarget:t}=Ot(e);return e instanceof t?e:En(e)}function oi(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var Wt;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Wt||(Wt={}));function Kc(e){e.preventDefault()}function Cv(e){e.stopPropagation()}var Pe;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Pe||(Pe={}));const Yc={start:[Pe.Space,Pe.Enter],cancel:[Pe.Esc],end:[Pe.Space,Pe.Enter,Pe.Tab]},Sv=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case Pe.Right:return{...r,x:r.x+25};case Pe.Left:return{...r,x:r.x-25};case Pe.Down:return{...r,y:r.y+25};case Pe.Up:return{...r,y:r.y-25}}};class si{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new So(En(r)),this.windowListeners=new So(Ot(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Wt.Resize,this.handleCancel),this.windowListeners.add(Wt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Wt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&Gc(n),r(nr)}handleKeyDown(t){if(Es(t)){const{active:r,context:n,options:o}=this.props,{keyboardCodes:s=Yc,coordinateGetter:a=Sv,scrollBehavior:i="smooth"}=o,{code:c}=t;if(s.end.includes(c)){this.handleEnd(t);return}if(s.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:d}=n.current,u=d?{x:d.left,y:d.top}:nr;this.referenceCoordinates||(this.referenceCoordinates=u);const f=a(t,{active:r,context:n.current,currentCoordinates:u});if(f){const m=Co(f,u),g={x:0,y:0},{scrollableAncestors:b}=n.current;for(const h of b){const v=t.code,{isTop:y,isRight:C,isLeft:S,isBottom:w,maxScroll:T,minScroll:E}=Wc(h),L=gv(h),A={x:Math.min(v===Pe.Right?L.right-L.width/2:L.right,Math.max(v===Pe.Right?L.left:L.left+L.width/2,f.x)),y:Math.min(v===Pe.Down?L.bottom-L.height/2:L.bottom,Math.max(v===Pe.Down?L.top:L.top+L.height/2,f.y))},x=v===Pe.Right&&!C||v===Pe.Left&&!S,F=v===Pe.Down&&!w||v===Pe.Up&&!y;if(x&&A.x!==f.x){const P=h.scrollLeft+m.x,N=v===Pe.Right&&P<=T.x||v===Pe.Left&&P>=E.x;if(N&&!m.y){h.scrollTo({left:P,behavior:i});return}N?g.x=h.scrollLeft-P:g.x=v===Pe.Right?h.scrollLeft-T.x:h.scrollLeft-E.x,g.x&&h.scrollBy({left:-g.x,behavior:i});break}else if(F&&A.y!==f.y){const P=h.scrollTop+m.y,N=v===Pe.Down&&P<=T.y||v===Pe.Up&&P>=E.y;if(N&&!m.x){h.scrollTo({top:P,behavior:i});return}N?g.y=h.scrollTop-P:g.y=v===Pe.Down?h.scrollTop-T.y:h.scrollTop-E.y,g.y&&h.scrollBy({top:-g.y,behavior:i});break}}this.handleMove(t,An(Co(f,this.referenceCoordinates),g))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}si.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=Yc,onActivation:o}=t,{active:s}=r;const{code:a}=e.nativeEvent;if(n.start.includes(a)){const i=s.activatorNode.current;return i&&e.target!==i?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function Zc(e){return!!(e&&"distance"in e)}function Xc(e){return!!(e&&"delay"in e)}class ai{constructor(t,r,n){var o;n===void 0&&(n=bv(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:s}=t,{target:a}=s;this.props=t,this.events=r,this.document=En(a),this.documentListeners=new So(this.document),this.listeners=new So(n),this.windowListeners=new So(Ot(a)),this.initialCoordinates=(o=As(s))!=null?o:nr,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Wt.Resize,this.handleCancel),this.windowListeners.add(Wt.DragStart,Kc),this.windowListeners.add(Wt.VisibilityChange,this.handleCancel),this.windowListeners.add(Wt.ContextMenu,Kc),this.documentListeners.add(Wt.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Xc(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(Zc(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:o}=this.props;o(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(Wt.Click,Cv,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Wt.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:o,props:s}=this,{onMove:a,options:{activationConstraint:i}}=s;if(!o)return;const c=(r=As(t))!=null?r:nr,d=Co(o,c);if(!n&&i){if(Zc(i)){if(i.tolerance!=null&&oi(d,i.tolerance))return this.handleCancel();if(oi(d,i.distance))return this.handleStart()}if(Xc(i)&&oi(d,i.tolerance))return this.handleCancel();this.handlePending(i,d);return}t.cancelable&&t.preventDefault(),a(c)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===Pe.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const wv={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Ds extends ai{constructor(t){const{event:r}=t,n=En(r.target);super(t,wv,n)}}Ds.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n==null||n({event:r}),!0)}}];const _v={move:{name:"mousemove"},end:{name:"mouseup"}};var ii;(function(e){e[e.RightClick=2]="RightClick"})(ii||(ii={}));class Tv extends ai{constructor(t){super(t,_v,En(t.event.target))}}Tv.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===ii.RightClick?!1:(n==null||n({event:r}),!0)}}];const li={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Ev extends ai{constructor(t){super(t,li)}static setup(){return window.addEventListener(li.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(li.move.name,t)};function t(){}}}Ev.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:o}=r;return o.length>1?!1:(n==null||n({event:r}),!0)}}];var wo;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(wo||(wo={}));var Ls;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Ls||(Ls={}));function Av(e){let{acceleration:t,activator:r=wo.Pointer,canScroll:n,draggingRect:o,enabled:s,interval:a=5,order:i=Ls.TreeOrder,pointerCoordinates:c,scrollableAncestors:d,scrollableAncestorRects:u,delta:f,threshold:m}=e;const g=Iv({delta:f,disabled:!s}),[b,h]=jm(),v=p.useRef({x:0,y:0}),y=p.useRef({x:0,y:0}),C=p.useMemo(()=>{switch(r){case wo.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case wo.DraggableRect:return o}},[r,o,c]),S=p.useRef(null),w=p.useCallback(()=>{const E=S.current;if(!E)return;const L=v.current.x*y.current.x,A=v.current.y*y.current.y;E.scrollBy(L,A)},[]),T=p.useMemo(()=>i===Ls.TreeOrder?[...d].reverse():d,[i,d]);p.useEffect(()=>{if(!s||!d.length||!C){h();return}for(const E of T){if((n==null?void 0:n(E))===!1)continue;const L=d.indexOf(E),A=u[L];if(!A)continue;const{direction:x,speed:F}=pv(E,A,C,t,m);for(const P of["x","y"])g[P][x[P]]||(F[P]=0,x[P]=0);if(F.x>0||F.y>0){h(),S.current=E,b(w,a),v.current=F,y.current=x;return}}v.current={x:0,y:0},y.current={x:0,y:0},h()},[t,w,n,h,s,a,JSON.stringify(C),JSON.stringify(g),b,d,T,u,JSON.stringify(m)])}const kv={x:{[ut.Backward]:!1,[ut.Forward]:!1},y:{[ut.Backward]:!1,[ut.Forward]:!1}};function Iv(e){let{delta:t,disabled:r}=e;const n=Ts(t);return yo(o=>{if(r||!n||!o)return kv;const s={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[ut.Backward]:o.x[ut.Backward]||s.x===-1,[ut.Forward]:o.x[ut.Forward]||s.x===1},y:{[ut.Backward]:o.y[ut.Backward]||s.y===-1,[ut.Forward]:o.y[ut.Forward]||s.y===1}}},[r,t,n])}function Dv(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return yo(o=>{var s;return t==null?null:(s=n??o)!=null?s:null},[n,t])}function Lv(e,t){return p.useMemo(()=>e.reduce((r,n)=>{const{sensor:o}=n,s=o.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,n)}));return[...r,...s]},[]),[e,t])}var _o;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(_o||(_o={}));var ci;(function(e){e.Optimized="optimized"})(ci||(ci={}));const Jc=new Map;function Ov(e,t){let{dragging:r,dependencies:n,config:o}=t;const[s,a]=p.useState(null),{frequency:i,measure:c,strategy:d}=o,u=p.useRef(e),f=v(),m=vo(f),g=p.useCallback(function(y){y===void 0&&(y=[]),!m.current&&a(C=>C===null?y:C.concat(y.filter(S=>!C.includes(S))))},[m]),b=p.useRef(null),h=yo(y=>{if(f&&!r)return Jc;if(!y||y===Jc||u.current!==e||s!=null){const C=new Map;for(let S of e){if(!S)continue;if(s&&s.length>0&&!s.includes(S.id)&&S.rect.current){C.set(S.id,S.rect.current);continue}const w=S.node.current,T=w?new ni(c(w),w):null;S.rect.current=T,T&&C.set(S.id,T)}return C}return y},[e,s,r,f,c]);return p.useEffect(()=>{u.current=e},[e]),p.useEffect(()=>{f||g()},[r,f]),p.useEffect(()=>{s&&s.length>0&&a(null)},[JSON.stringify(s)]),p.useEffect(()=>{f||typeof i!="number"||b.current!==null||(b.current=setTimeout(()=>{g(),b.current=null},i))},[i,f,g,...n]),{droppableRects:h,measureDroppableContainers:g,measuringScheduled:s!=null};function v(){switch(d){case _o.Always:return!1;case _o.BeforeDragging:return r;default:return!r}}}function di(e,t){return yo(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function Pv(e,t){return di(e,t)}function Nv(e){let{callback:t,disabled:r}=e;const n=ws(t),o=p.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(n)},[n,r]);return p.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Os(e){let{callback:t,disabled:r}=e;const n=ws(t),o=p.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(n)},[r]);return p.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function xv(e){return new ni(kn(e),e)}function ed(e,t,r){t===void 0&&(t=xv);const[n,o]=p.useState(null);function s(){o(c=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=c??r)!=null?d:null}const u=t(e);return JSON.stringify(c)===JSON.stringify(u)?c:u})}const a=Nv({callback(c){if(e)for(const d of c){const{type:u,target:f}=d;if(u==="childList"&&f instanceof HTMLElement&&f.contains(e)){s();break}}}}),i=Os({callback:s});return rr(()=>{s(),e?(i==null||i.observe(e),a==null||a.observe(document.body,{childList:!0,subtree:!0})):(i==null||i.disconnect(),a==null||a.disconnect())},[e]),n}function Fv(e){const t=di(e);return qc(e,t)}const td=[];function Mv(e){const t=p.useRef(e),r=yo(n=>e?n&&n!==td&&e&&t.current&&e.parentNode===t.current.parentNode?n:Is(e):td,[e]);return p.useEffect(()=>{t.current=e},[e]),r}function $v(e){const[t,r]=p.useState(null),n=p.useRef(e),o=p.useCallback(s=>{const a=ti(s.target);a&&r(i=>i?(i.set(a,ri(a)),new Map(i)):null)},[]);return p.useEffect(()=>{const s=n.current;if(e!==s){a(s);const i=e.map(c=>{const d=ti(c);return d?(d.addEventListener("scroll",o,{passive:!0}),[d,ri(d)]):null}).filter(c=>c!=null);r(i.length?new Map(i):null),n.current=e}return()=>{a(e),a(s)};function a(i){i.forEach(c=>{const d=ti(c);d==null||d.removeEventListener("scroll",o)})}},[o,e]),p.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,a)=>An(s,a),nr):Rc(e):nr,[e,t])}function rd(e,t){t===void 0&&(t=[]);const r=p.useRef(null);return p.useEffect(()=>{r.current=null},t),p.useEffect(()=>{const n=e!==nr;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?Co(e,r.current):nr}function Bv(e){p.useEffect(()=>{if(!Ss)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r==null||r()}},e.map(t=>{let{sensor:r}=t;return r}))}function qv(e,t){return p.useMemo(()=>e.reduce((r,n)=>{let{eventName:o,handler:s}=n;return r[o]=a=>{s(a,t)},r},{}),[e,t])}function nd(e){return p.useMemo(()=>e?dv(e):null,[e])}const od=[];function jv(e,t){t===void 0&&(t=kn);const[r]=e,n=nd(r?Ot(r):null),[o,s]=p.useState(od);function a(){s(()=>e.length?e.map(c=>Qc(c)?n:new ni(t(c),c)):od)}const i=Os({callback:a});return rr(()=>{i==null||i.disconnect(),a(),e.forEach(c=>i==null?void 0:i.observe(c))},[e]),o}function sd(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return mo(t)?t:e}function Uv(e){let{measure:t}=e;const[r,n]=p.useState(null),o=p.useCallback(d=>{for(const{target:u}of d)if(mo(u)){n(f=>{const m=t(u);return f?{...f,width:m.width,height:m.height}:m});break}},[t]),s=Os({callback:o}),a=p.useCallback(d=>{const u=sd(d);s==null||s.disconnect(),u&&(s==null||s.observe(u)),n(u?t(u):null)},[t,s]),[i,c]=_s(a);return p.useMemo(()=>({nodeRef:i,rect:r,setRef:c}),[r,i,c])}const zv=[{sensor:Ds,options:{}},{sensor:si,options:{}}],Vv={current:{}},Ps={draggable:{measure:Uc},droppable:{measure:Uc,strategy:_o.WhileDragging,frequency:ci.Optimized},dragOverlay:{measure:kn}};class To extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const Hv={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new To,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ks},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ps,measureDroppableContainers:ks,windowRect:null,measuringScheduled:!1},ad={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ks,draggableNodes:new Map,over:null,measureDroppableContainers:ks},Eo=p.createContext(ad),id=p.createContext(Hv);function Qv(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new To}}}function Wv(e,t){switch(t.type){case it.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case it.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case it.DragEnd:case it.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case it.RegisterDroppable:{const{element:r}=t,{id:n}=r,o=new To(e.droppable.containers);return o.set(n,r),{...e,droppable:{...e.droppable,containers:o}}}case it.SetDroppableDisabled:{const{id:r,key:n,disabled:o}=t,s=e.droppable.containers.get(r);if(!s||n!==s.key)return e;const a=new To(e.droppable.containers);return a.set(r,{...s,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case it.UnregisterDroppable:{const{id:r,key:n}=t,o=e.droppable.containers.get(r);if(!o||n!==o.key)return e;const s=new To(e.droppable.containers);return s.delete(r),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function Rv(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:o}=p.useContext(Eo),s=Ts(n),a=Ts(r==null?void 0:r.id);return p.useEffect(()=>{if(!t&&!n&&s&&a!=null){if(!Es(s)||document.activeElement===s.target)return;const i=o.get(a);if(!i)return;const{activatorNode:c,node:d}=i;if(!c.current&&!d.current)return;requestAnimationFrame(()=>{for(const u of[c.current,d.current]){if(!u)continue;const f=Vm(u);if(f){f.focus();break}}})}},[n,t,o,a,s]),null}function ld(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((o,s)=>s({transform:o,...n}),r):r}function Gv(e){return p.useMemo(()=>({draggable:{...Ps.draggable,...e==null?void 0:e.draggable},droppable:{...Ps.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Ps.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function Kv(e){let{activeNode:t,measure:r,initialRect:n,config:o=!0}=e;const s=p.useRef(!1),{x:a,y:i}=typeof o=="boolean"?{x:o,y:o}:o;rr(()=>{if(!a&&!i||!t){s.current=!1;return}if(s.current||!n)return;const d=t==null?void 0:t.node.current;if(!d||d.isConnected===!1)return;const u=r(d),f=qc(u,n);if(a||(f.x=0),i||(f.y=0),s.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const m=zc(d);m&&m.scrollBy({top:f.y,left:f.x})}},[t,a,i,n,r])}const Ns=p.createContext({...nr,scaleX:1,scaleY:1});var Pr;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Pr||(Pr={}));const cd=p.memo(function(t){var r,n,o,s;let{id:a,accessibility:i,autoScroll:c=!0,children:d,sensors:u=zv,collisionDetection:f=ov,measuring:m,modifiers:g,...b}=t;const h=p.useReducer(Wv,void 0,Qv),[v,y]=h,[C,S]=Km(),[w,T]=p.useState(Pr.Uninitialized),E=w===Pr.Initialized,{draggable:{active:L,nodes:A,translate:x},droppable:{containers:F}}=v,P=L!=null?A.get(L):null,N=p.useRef({initial:null,translated:null}),M=p.useMemo(()=>{var mt;return L!=null?{id:L,data:(mt=P==null?void 0:P.data)!=null?mt:Vv,rect:N}:null},[L,P]),B=p.useRef(null),[U,ee]=p.useState(null),[Q,te]=p.useState(null),ue=vo(b,Object.values(b)),fe=bo("DndDescribedBy",a),pe=p.useMemo(()=>F.getEnabled(),[F]),ie=Gv(m),{droppableRects:Te,measureDroppableContainers:ye,measuringScheduled:$}=Ov(pe,{dragging:E,dependencies:[x.x,x.y],config:ie.droppable}),q=Dv(A,L),Z=p.useMemo(()=>Q?As(Q):null,[Q]),he=wn(),be=Pv(q,ie.draggable.measure);Kv({activeNode:L!=null?A.get(L):null,config:he.layoutShiftCompensation,initialRect:be,measure:ie.draggable.measure});const ge=ed(q,ie.draggable.measure,be),le=ed(q?q.parentElement:null),ve=p.useRef({activatorEvent:null,active:null,activeNode:q,collisionRect:null,collisions:null,droppableRects:Te,draggableNodes:A,draggingNode:null,draggingNodeRect:null,droppableContainers:F,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ae=F.getNodeFor((r=ve.current.over)==null?void 0:r.id),Y=Uv({measure:ie.dragOverlay.measure}),de=(n=Y.nodeRef.current)!=null?n:q,W=E?(o=Y.rect)!=null?o:ge:null,Ce=!!(Y.nodeRef.current&&Y.rect),Ve=Fv(Ce?null:ge),nt=nd(de?Ot(de):null),He=Mv(E?Ae??q:null),Ke=jv(He),ot=ld(g,{transform:{x:x.x-Ve.x,y:x.y-Ve.y,scaleX:1,scaleY:1},activatorEvent:Q,active:M,activeNodeRect:ge,containerNodeRect:le,draggingNodeRect:W,over:ve.current.over,overlayNodeRect:Y.rect,scrollableAncestors:He,scrollableAncestorRects:Ke,windowRect:nt}),Cn=Z?An(Z,x):null,lo=$v(He),as=rd(lo),Sn=rd(lo,[ge]),_=An(ot,as),k=W?iv(W,ot):null,D=M&&k?f({active:M,collisionRect:k,droppableRects:Te,droppableContainers:pe,pointerCoordinates:Cn}):null,z=$c(D,"id"),[V,R]=p.useState(null),H=Ce?ot:An(ot,Sn),oe=sv(H,(s=V==null?void 0:V.rect)!=null?s:null,ge),se=p.useRef(null),Fe=p.useCallback((mt,Lt)=>{let{sensor:Nt,options:cr}=Lt;if(B.current==null)return;const tr=A.get(B.current);if(!tr)return;const Qt=mt.nativeEvent,Cr=new Nt({active:B.current,activeNode:tr,event:Qt,options:cr,context:ve,onAbort(St){if(!A.get(St))return;const{onDragAbort:Sr}=ue.current,Er={id:St};Sr==null||Sr(Er),C({type:"onDragAbort",event:Er})},onPending(St,Wr,Sr,Er){if(!A.get(St))return;const{onDragPending:cs}=ue.current,Rr={id:St,constraint:Wr,initialCoordinates:Sr,offset:Er};cs==null||cs(Rr),C({type:"onDragPending",event:Rr})},onStart(St){const Wr=B.current;if(Wr==null)return;const Sr=A.get(Wr);if(!Sr)return;const{onDragStart:Er}=ue.current,ls={activatorEvent:Qt,active:{id:Wr,data:Sr.data,rect:N}};Ue.unstable_batchedUpdates(()=>{Er==null||Er(ls),T(Pr.Initializing),y({type:it.DragStart,initialCoordinates:St,active:Wr}),C({type:"onDragStart",event:ls}),ee(se.current),te(Qt)})},onMove(St){y({type:it.DragMove,coordinates:St})},onEnd:co(it.DragEnd),onCancel:co(it.DragCancel)});se.current=Cr;function co(St){return async function(){const{active:Sr,collisions:Er,over:ls,scrollAdjustedTranslate:cs}=ve.current;let Rr=null;if(Sr&&cs){const{cancelDrop:ds}=ue.current;Rr={activatorEvent:Qt,active:Sr,collisions:Er,delta:cs,over:ls},St===it.DragEnd&&typeof ds=="function"&&await Promise.resolve(ds(Rr))&&(St=it.DragCancel)}B.current=null,Ue.unstable_batchedUpdates(()=>{y({type:St}),T(Pr.Uninitialized),R(null),ee(null),te(null),se.current=null;const ds=St===it.DragEnd?"onDragEnd":"onDragCancel";if(Rr){const Rl=ue.current[ds];Rl==null||Rl(Rr),C({type:ds,event:Rr})}})}}},[A]),Je=p.useCallback((mt,Lt)=>(Nt,cr)=>{const tr=Nt.nativeEvent,Qt=A.get(cr);if(B.current!==null||!Qt||tr.dndKit||tr.defaultPrevented)return;const Cr={active:Qt};mt(Nt,Lt.options,Cr)===!0&&(tr.dndKit={capturedBy:Lt.sensor},B.current=cr,Fe(Nt,Lt))},[A,Fe]),dt=Lv(u,Je);Bv(u),rr(()=>{ge&&w===Pr.Initializing&&T(Pr.Initialized)},[ge,w]),p.useEffect(()=>{const{onDragMove:mt}=ue.current,{active:Lt,activatorEvent:Nt,collisions:cr,over:tr}=ve.current;if(!Lt||!Nt)return;const Qt={active:Lt,activatorEvent:Nt,collisions:cr,delta:{x:_.x,y:_.y},over:tr};Ue.unstable_batchedUpdates(()=>{mt==null||mt(Qt),C({type:"onDragMove",event:Qt})})},[_.x,_.y]),p.useEffect(()=>{const{active:mt,activatorEvent:Lt,collisions:Nt,droppableContainers:cr,scrollAdjustedTranslate:tr}=ve.current;if(!mt||B.current==null||!Lt||!tr)return;const{onDragOver:Qt}=ue.current,Cr=cr.get(z),co=Cr&&Cr.rect.current?{id:Cr.id,rect:Cr.rect.current,data:Cr.data,disabled:Cr.disabled}:null,St={active:mt,activatorEvent:Lt,collisions:Nt,delta:{x:tr.x,y:tr.y},over:co};Ue.unstable_batchedUpdates(()=>{R(co),Qt==null||Qt(St),C({type:"onDragOver",event:St})})},[z]),rr(()=>{ve.current={activatorEvent:Q,active:M,activeNode:q,collisionRect:k,collisions:D,droppableRects:Te,draggableNodes:A,draggingNode:de,draggingNodeRect:W,droppableContainers:F,over:V,scrollableAncestors:He,scrollAdjustedTranslate:_},N.current={initial:W,translated:k}},[M,q,D,k,A,de,W,Te,F,V,He,_]),Av({...he,delta:x,draggingRect:k,pointerCoordinates:Cn,scrollableAncestors:He,scrollableAncestorRects:Ke});const er=p.useMemo(()=>({active:M,activeNode:q,activeNodeRect:ge,activatorEvent:Q,collisions:D,containerNodeRect:le,dragOverlay:Y,draggableNodes:A,droppableContainers:F,droppableRects:Te,over:V,measureDroppableContainers:ye,scrollableAncestors:He,scrollableAncestorRects:Ke,measuringConfiguration:ie,measuringScheduled:$,windowRect:nt}),[M,q,ge,Q,D,le,Y,A,F,Te,V,ye,He,Ke,ie,$,nt]),is=p.useMemo(()=>({activatorEvent:Q,activators:dt,active:M,activeNodeRect:ge,ariaDescribedById:{draggable:fe},dispatch:y,draggableNodes:A,over:V,measureDroppableContainers:ye}),[Q,dt,M,ge,y,fe,A,V,ye]);return p.createElement(Pc.Provider,{value:S},p.createElement(Eo.Provider,{value:is},p.createElement(id.Provider,{value:er},p.createElement(Ns.Provider,{value:oe},d)),p.createElement(Rv,{disabled:(i==null?void 0:i.restoreFocus)===!1})),p.createElement(Xm,{...i,hiddenTextDescribedById:fe}));function wn(){const mt=(U==null?void 0:U.autoScrollEnabled)===!1,Lt=typeof c=="object"?c.enabled===!1:c===!1,Nt=E&&!mt&&!Lt;return typeof c=="object"?{...c,enabled:Nt}:{enabled:Nt}}}),Yv=p.createContext(null),dd="button",Zv="Draggable";function ud(e){let{id:t,data:r,disabled:n=!1,attributes:o}=e;const s=bo(Zv),{activators:a,activatorEvent:i,active:c,activeNodeRect:d,ariaDescribedById:u,draggableNodes:f,over:m}=p.useContext(Eo),{role:g=dd,roleDescription:b="draggable",tabIndex:h=0}=o??{},v=(c==null?void 0:c.id)===t,y=p.useContext(v?Ns:Yv),[C,S]=_s(),[w,T]=_s(),E=qv(a,t),L=vo(r);rr(()=>(f.set(t,{id:t,key:s,node:C,activatorNode:w,data:L}),()=>{const x=f.get(t);x&&x.key===s&&f.delete(t)}),[f,t]);const A=p.useMemo(()=>({role:g,tabIndex:h,"aria-disabled":n,"aria-pressed":v&&g===dd?!0:void 0,"aria-roledescription":b,"aria-describedby":u.draggable}),[n,g,h,v,b,u.draggable]);return{active:c,activatorEvent:i,activeNodeRect:d,attributes:A,isDragging:v,listeners:n?void 0:E,node:C,over:m,setNodeRef:S,setActivatorNodeRef:T,transform:y}}function fd(){return p.useContext(id)}const Xv="Droppable",Jv={timeout:25};function ey(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:o}=e;const s=bo(Xv),{active:a,dispatch:i,over:c,measureDroppableContainers:d}=p.useContext(Eo),u=p.useRef({disabled:r}),f=p.useRef(!1),m=p.useRef(null),g=p.useRef(null),{disabled:b,updateMeasurementsFor:h,timeout:v}={...Jv,...o},y=vo(h??n),C=p.useCallback(()=>{if(!f.current){f.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{d(Array.isArray(y.current)?y.current:[y.current]),g.current=null},v)},[v]),S=Os({callback:C,disabled:b||!a}),w=p.useCallback((A,x)=>{S&&(x&&(S.unobserve(x),f.current=!1),A&&S.observe(A))},[S]),[T,E]=_s(w),L=vo(t);return p.useEffect(()=>{!S||!T.current||(S.disconnect(),f.current=!1,S.observe(T.current))},[T,S]),p.useEffect(()=>(i({type:it.RegisterDroppable,element:{id:n,key:s,disabled:r,node:T,rect:m,data:L}}),()=>i({type:it.UnregisterDroppable,key:s,id:n})),[n]),p.useEffect(()=>{r!==u.current.disabled&&(i({type:it.SetDroppableDisabled,id:n,key:s,disabled:r}),u.current.disabled=r)},[n,s,r,i]),{active:a,rect:m,isOver:(c==null?void 0:c.id)===n,node:T,over:c,setNodeRef:E}}function ty(e){let{animation:t,children:r}=e;const[n,o]=p.useState(null),[s,a]=p.useState(null),i=Ts(r);return!r&&!n&&i&&o(i),rr(()=>{if(!s)return;const c=n==null?void 0:n.key,d=n==null?void 0:n.props.id;if(c==null||d==null){o(null);return}Promise.resolve(t(d,s)).then(()=>{o(null)})},[t,n,s]),p.createElement(p.Fragment,null,r,n?p.cloneElement(n,{ref:a}):null)}const ry={x:0,y:0,scaleX:1,scaleY:1};function ny(e){let{children:t}=e;return p.createElement(Eo.Provider,{value:ad},p.createElement(Ns.Provider,{value:ry},t))}const oy={position:"fixed",touchAction:"none"},sy=e=>Es(e)?"transform 250ms ease":void 0,ay=p.forwardRef((e,t)=>{let{as:r,activatorEvent:n,adjustScale:o,children:s,className:a,rect:i,style:c,transform:d,transition:u=sy}=e;if(!i)return null;const f=o?d:{...d,scaleX:1,scaleY:1},m={...oy,width:i.width,height:i.height,top:i.top,left:i.left,transform:Or.Transform.toString(f),transformOrigin:o&&n?Jm(n,i):void 0,transition:typeof u=="function"?u(n):u,...c};return p.createElement(r,{className:a,style:m,ref:t},s)}),iy={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:r}}=e;return[{transform:Or.Transform.toString(t)},{transform:Or.Transform.toString(r)}]},sideEffects:(e=>t=>{let{active:r,dragOverlay:n}=t;const o={},{styles:s,className:a}=e;if(s!=null&&s.active)for(const[i,c]of Object.entries(s.active))c!==void 0&&(o[i]=r.node.style.getPropertyValue(i),r.node.style.setProperty(i,c));if(s!=null&&s.dragOverlay)for(const[i,c]of Object.entries(s.dragOverlay))c!==void 0&&n.node.style.setProperty(i,c);return a!=null&&a.active&&r.node.classList.add(a.active),a!=null&&a.dragOverlay&&n.node.classList.add(a.dragOverlay),function(){for(const[c,d]of Object.entries(o))r.node.style.setProperty(c,d);a!=null&&a.active&&r.node.classList.remove(a.active)}})({styles:{active:{opacity:"0"}}})};function ly(e){let{config:t,draggableNodes:r,droppableContainers:n,measuringConfiguration:o}=e;return ws((s,a)=>{if(t===null)return;const i=r.get(s);if(!i)return;const c=i.node.current;if(!c)return;const d=sd(a);if(!d)return;const{transform:u}=Ot(a).getComputedStyle(a),f=jc(u);if(!f)return;const m=typeof t=="function"?t:cy(t);return Gc(c,o.draggable.measure),m({active:{id:s,data:i.data,node:c,rect:o.draggable.measure(c)},draggableNodes:r,dragOverlay:{node:a,rect:o.dragOverlay.measure(d)},droppableContainers:n,measuringConfiguration:o,transform:f})})}function cy(e){const{duration:t,easing:r,sideEffects:n,keyframes:o}={...iy,...e};return s=>{let{active:a,dragOverlay:i,transform:c,...d}=s;if(!t)return;const u={x:i.rect.left-a.rect.left,y:i.rect.top-a.rect.top},f={scaleX:c.scaleX!==1?a.rect.width*c.scaleX/i.rect.width:1,scaleY:c.scaleY!==1?a.rect.height*c.scaleY/i.rect.height:1},m={x:c.x-u.x,y:c.y-u.y,...f},g=o({...d,active:a,dragOverlay:i,transform:{initial:c,final:m}}),[b]=g,h=g[g.length-1];if(JSON.stringify(b)===JSON.stringify(h))return;const v=n==null?void 0:n({active:a,dragOverlay:i,...d}),y=i.node.animate(g,{duration:t,easing:r,fill:"forwards"});return new Promise(C=>{y.onfinish=()=>{v==null||v(),C()}})}}let hd=0;function dy(e){return p.useMemo(()=>{if(e!=null)return hd++,hd},[e])}const uy=p.memo(e=>{let{adjustScale:t=!1,children:r,dropAnimation:n,style:o,transition:s,modifiers:a,wrapperElement:i="div",className:c,zIndex:d=999}=e;const{activatorEvent:u,active:f,activeNodeRect:m,containerNodeRect:g,draggableNodes:b,droppableContainers:h,dragOverlay:v,over:y,measuringConfiguration:C,scrollableAncestors:S,scrollableAncestorRects:w,windowRect:T}=fd(),E=p.useContext(Ns),L=dy(f==null?void 0:f.id),A=ld(a,{activatorEvent:u,active:f,activeNodeRect:m,containerNodeRect:g,draggingNodeRect:v.rect,over:y,overlayNodeRect:v.rect,scrollableAncestors:S,scrollableAncestorRects:w,transform:E,windowRect:T}),x=di(m),F=ly({config:n,draggableNodes:b,droppableContainers:h,measuringConfiguration:C}),P=x?v.setRef:void 0;return p.createElement(ny,null,p.createElement(ty,{animation:F},f&&L?p.createElement(ay,{key:L,id:f.id,ref:P,as:i,activatorEvent:u,adjustScale:t,className:c,transition:s,rect:x,style:{zIndex:d,...o},transform:A},r):null))});/**
181
+ `},Xm={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Jm(e){let{announcements:t=Xm,container:r,hiddenTextDescribedById:n,screenReaderInstructions:o=Zm}=e;const{announce:s,announcement:a}=Gm(),i=bo("DndLiveRegion"),[c,d]=p.useState(!1);if(p.useEffect(()=>{d(!0)},[]),Km(p.useMemo(()=>({onDragStart(f){let{active:m}=f;s(t.onDragStart({active:m}))},onDragMove(f){let{active:m,over:g}=f;t.onDragMove&&s(t.onDragMove({active:m,over:g}))},onDragOver(f){let{active:m,over:g}=f;s(t.onDragOver({active:m,over:g}))},onDragEnd(f){let{active:m,over:g}=f;s(t.onDragEnd({active:m,over:g}))},onDragCancel(f){let{active:m,over:g}=f;s(t.onDragCancel({active:m,over:g}))}}),[s,t])),!c)return null;const u=p.createElement(p.Fragment,null,p.createElement(Wm,{id:n,value:o.draggable}),p.createElement(Rm,{id:i,announcement:a}));return r?Ue.createPortal(u,r):u}var it;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(it||(it={}));function ks(){}function ei(e,t){return p.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Nc(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return p.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const nr=Object.freeze({x:0,y:0});function xc(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function ev(e,t){const r=As(e);if(!r)return"0 0";const n={x:(r.x-t.left)/t.width*100,y:(r.y-t.top)/t.height*100};return n.x+"% "+n.y+"%"}function Fc(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function tv(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function Mc(e){let{left:t,top:r,height:n,width:o}=e;return[{x:t,y:r},{x:t+o,y:r},{x:t,y:r+n},{x:t+o,y:r+n}]}function $c(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function Bc(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const rv=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=Bc(t,t.left,t.top),s=[];for(const a of n){const{id:i}=a,c=r.get(i);if(c){const d=xc(Bc(c),o);s.push({id:i,data:{droppableContainer:a,value:d}})}}return s.sort(Fc)},nv=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=Mc(t),s=[];for(const a of n){const{id:i}=a,c=r.get(i);if(c){const d=Mc(c),u=o.reduce((m,g,b)=>m+xc(d[b],g),0),f=Number((u/4).toFixed(4));s.push({id:i,data:{droppableContainer:a,value:f}})}}return s.sort(Fc)};function ov(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),a=o-n,i=s-r;if(n<o&&r<s){const c=t.width*t.height,d=e.width*e.height,u=a*i,f=u/(c+d-u);return Number(f.toFixed(4))}return 0}const sv=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=[];for(const s of n){const{id:a}=s,i=r.get(a);if(i){const c=ov(i,t);c>0&&o.push({id:a,data:{droppableContainer:s,value:c}})}}return o.sort(tv)};function av(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function qc(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:nr}function iv(e){return function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),s=1;s<n;s++)o[s-1]=arguments[s];return o.reduce((a,i)=>({...a,top:a.top+e*i.y,bottom:a.bottom+e*i.y,left:a.left+e*i.x,right:a.right+e*i.x}),{...r})}}const lv=iv(1);function jc(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function cv(e,t,r){const n=jc(t);if(!n)return e;const{scaleX:o,scaleY:s,x:a,y:i}=n,c=e.left-a-(1-o)*parseFloat(r),d=e.top-i-(1-s)*parseFloat(r.slice(r.indexOf(" ")+1)),u=o?e.width/o:e.width,f=s?e.height/s:e.height;return{width:u,height:f,top:d,right:c+u,bottom:d+f,left:c}}const dv={ignoreTransform:!1};function In(e,t){t===void 0&&(t=dv);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:u}=Ot(e).getComputedStyle(e);d&&(r=cv(r,d,u))}const{top:n,left:o,width:s,height:a,bottom:i,right:c}=r;return{top:n,left:o,width:s,height:a,bottom:i,right:c}}function Uc(e){return In(e,{ignoreTransform:!0})}function uv(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function fv(e,t){return t===void 0&&(t=Ot(e).getComputedStyle(e)),t.position==="fixed"}function hv(e,t){t===void 0&&(t=Ot(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const s=t[o];return typeof s=="string"?r.test(s):!1})}function Is(e,t){const r=[];function n(o){if(t!=null&&r.length>=t||!o)return r;if(Xa(o)&&o.scrollingElement!=null&&!r.includes(o.scrollingElement))return r.push(o.scrollingElement),r;if(!mo(o)||Dc(o)||r.includes(o))return r;const s=Ot(e).getComputedStyle(o);return o!==e&&hv(o,s)&&r.push(o),fv(o,s)?r:n(o.parentNode)}return e?n(e):r}function zc(e){const[t]=Is(e,1);return t??null}function ti(e){return!Ss||!e?null:En(e)?e:Za(e)?Xa(e)||e===An(e).scrollingElement?window:mo(e)?e:null:null}function Vc(e){return En(e)?e.scrollX:e.scrollLeft}function Hc(e){return En(e)?e.scrollY:e.scrollTop}function ri(e){return{x:Vc(e),y:Hc(e)}}var ut;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(ut||(ut={}));function Qc(e){return!Ss||!e?!1:e===document.scrollingElement}function Wc(e){const t={x:0,y:0},r=Qc(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},o=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,a=e.scrollTop>=n.y,i=e.scrollLeft>=n.x;return{isTop:o,isLeft:s,isBottom:a,isRight:i,maxScroll:n,minScroll:t}}const pv={x:.2,y:.2};function gv(e,t,r,n,o){let{top:s,left:a,right:i,bottom:c}=r;n===void 0&&(n=10),o===void 0&&(o=pv);const{isTop:d,isBottom:u,isLeft:f,isRight:m}=Wc(e),g={x:0,y:0},b={x:0,y:0},h={height:t.height*o.y,width:t.width*o.x};return!d&&s<=t.top+h.height?(g.y=ut.Backward,b.y=n*Math.abs((t.top+h.height-s)/h.height)):!u&&c>=t.bottom-h.height&&(g.y=ut.Forward,b.y=n*Math.abs((t.bottom-h.height-c)/h.height)),!m&&i>=t.right-h.width?(g.x=ut.Forward,b.x=n*Math.abs((t.right-h.width-i)/h.width)):!f&&a<=t.left+h.width&&(g.x=ut.Backward,b.x=n*Math.abs((t.left+h.width-a)/h.width)),{direction:g,speed:b}}function mv(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:a}=window;return{top:0,left:0,right:s,bottom:a,width:s,height:a}}const{top:t,left:r,right:n,bottom:o}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:o,width:e.clientWidth,height:e.clientHeight}}function Rc(e){return e.reduce((t,r)=>kn(t,ri(r)),nr)}function vv(e){return e.reduce((t,r)=>t+Vc(r),0)}function yv(e){return e.reduce((t,r)=>t+Hc(r),0)}function Gc(e,t){if(t===void 0&&(t=In),!e)return;const{top:r,left:n,bottom:o,right:s}=t(e);zc(e)&&(o<=0||s<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const bv=[["x",["left","right"],vv],["y",["top","bottom"],yv]];class ni{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=Is(r),o=Rc(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,a,i]of bv)for(const c of a)Object.defineProperty(this,c,{get:()=>{const d=i(n),u=o[s]-d;return this.rect[c]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class So{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var o;(o=this.target)==null||o.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function Cv(e){const{EventTarget:t}=Ot(e);return e instanceof t?e:An(e)}function oi(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var Wt;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Wt||(Wt={}));function Kc(e){e.preventDefault()}function Sv(e){e.stopPropagation()}var Pe;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Pe||(Pe={}));const Yc={start:[Pe.Space,Pe.Enter],cancel:[Pe.Esc],end:[Pe.Space,Pe.Enter,Pe.Tab]},wv=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case Pe.Right:return{...r,x:r.x+25};case Pe.Left:return{...r,x:r.x-25};case Pe.Down:return{...r,y:r.y+25};case Pe.Up:return{...r,y:r.y-25}}};class si{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new So(An(r)),this.windowListeners=new So(Ot(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Wt.Resize,this.handleCancel),this.windowListeners.add(Wt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Wt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&Gc(n),r(nr)}handleKeyDown(t){if(Es(t)){const{active:r,context:n,options:o}=this.props,{keyboardCodes:s=Yc,coordinateGetter:a=wv,scrollBehavior:i="smooth"}=o,{code:c}=t;if(s.end.includes(c)){this.handleEnd(t);return}if(s.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:d}=n.current,u=d?{x:d.left,y:d.top}:nr;this.referenceCoordinates||(this.referenceCoordinates=u);const f=a(t,{active:r,context:n.current,currentCoordinates:u});if(f){const m=Co(f,u),g={x:0,y:0},{scrollableAncestors:b}=n.current;for(const h of b){const v=t.code,{isTop:y,isRight:C,isLeft:S,isBottom:w,maxScroll:T,minScroll:E}=Wc(h),L=mv(h),A={x:Math.min(v===Pe.Right?L.right-L.width/2:L.right,Math.max(v===Pe.Right?L.left:L.left+L.width/2,f.x)),y:Math.min(v===Pe.Down?L.bottom-L.height/2:L.bottom,Math.max(v===Pe.Down?L.top:L.top+L.height/2,f.y))},x=v===Pe.Right&&!C||v===Pe.Left&&!S,F=v===Pe.Down&&!w||v===Pe.Up&&!y;if(x&&A.x!==f.x){const P=h.scrollLeft+m.x,N=v===Pe.Right&&P<=T.x||v===Pe.Left&&P>=E.x;if(N&&!m.y){h.scrollTo({left:P,behavior:i});return}N?g.x=h.scrollLeft-P:g.x=v===Pe.Right?h.scrollLeft-T.x:h.scrollLeft-E.x,g.x&&h.scrollBy({left:-g.x,behavior:i});break}else if(F&&A.y!==f.y){const P=h.scrollTop+m.y,N=v===Pe.Down&&P<=T.y||v===Pe.Up&&P>=E.y;if(N&&!m.x){h.scrollTo({top:P,behavior:i});return}N?g.y=h.scrollTop-P:g.y=v===Pe.Down?h.scrollTop-T.y:h.scrollTop-E.y,g.y&&h.scrollBy({top:-g.y,behavior:i});break}}this.handleMove(t,kn(Co(f,this.referenceCoordinates),g))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}si.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=Yc,onActivation:o}=t,{active:s}=r;const{code:a}=e.nativeEvent;if(n.start.includes(a)){const i=s.activatorNode.current;return i&&e.target!==i?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function Zc(e){return!!(e&&"distance"in e)}function Xc(e){return!!(e&&"delay"in e)}class ai{constructor(t,r,n){var o;n===void 0&&(n=Cv(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:s}=t,{target:a}=s;this.props=t,this.events=r,this.document=An(a),this.documentListeners=new So(this.document),this.listeners=new So(n),this.windowListeners=new So(Ot(a)),this.initialCoordinates=(o=As(s))!=null?o:nr,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Wt.Resize,this.handleCancel),this.windowListeners.add(Wt.DragStart,Kc),this.windowListeners.add(Wt.VisibilityChange,this.handleCancel),this.windowListeners.add(Wt.ContextMenu,Kc),this.documentListeners.add(Wt.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Xc(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(Zc(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:o}=this.props;o(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(Wt.Click,Sv,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Wt.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:o,props:s}=this,{onMove:a,options:{activationConstraint:i}}=s;if(!o)return;const c=(r=As(t))!=null?r:nr,d=Co(o,c);if(!n&&i){if(Zc(i)){if(i.tolerance!=null&&oi(d,i.tolerance))return this.handleCancel();if(oi(d,i.distance))return this.handleStart()}if(Xc(i)&&oi(d,i.tolerance))return this.handleCancel();this.handlePending(i,d);return}t.cancelable&&t.preventDefault(),a(c)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===Pe.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const _v={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Ds extends ai{constructor(t){const{event:r}=t,n=An(r.target);super(t,_v,n)}}Ds.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n==null||n({event:r}),!0)}}];const Tv={move:{name:"mousemove"},end:{name:"mouseup"}};var ii;(function(e){e[e.RightClick=2]="RightClick"})(ii||(ii={}));class Ev extends ai{constructor(t){super(t,Tv,An(t.event.target))}}Ev.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===ii.RightClick?!1:(n==null||n({event:r}),!0)}}];const li={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Av extends ai{constructor(t){super(t,li)}static setup(){return window.addEventListener(li.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(li.move.name,t)};function t(){}}}Av.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:o}=r;return o.length>1?!1:(n==null||n({event:r}),!0)}}];var wo;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(wo||(wo={}));var Ls;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Ls||(Ls={}));function kv(e){let{acceleration:t,activator:r=wo.Pointer,canScroll:n,draggingRect:o,enabled:s,interval:a=5,order:i=Ls.TreeOrder,pointerCoordinates:c,scrollableAncestors:d,scrollableAncestorRects:u,delta:f,threshold:m}=e;const g=Dv({delta:f,disabled:!s}),[b,h]=Um(),v=p.useRef({x:0,y:0}),y=p.useRef({x:0,y:0}),C=p.useMemo(()=>{switch(r){case wo.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case wo.DraggableRect:return o}},[r,o,c]),S=p.useRef(null),w=p.useCallback(()=>{const E=S.current;if(!E)return;const L=v.current.x*y.current.x,A=v.current.y*y.current.y;E.scrollBy(L,A)},[]),T=p.useMemo(()=>i===Ls.TreeOrder?[...d].reverse():d,[i,d]);p.useEffect(()=>{if(!s||!d.length||!C){h();return}for(const E of T){if((n==null?void 0:n(E))===!1)continue;const L=d.indexOf(E),A=u[L];if(!A)continue;const{direction:x,speed:F}=gv(E,A,C,t,m);for(const P of["x","y"])g[P][x[P]]||(F[P]=0,x[P]=0);if(F.x>0||F.y>0){h(),S.current=E,b(w,a),v.current=F,y.current=x;return}}v.current={x:0,y:0},y.current={x:0,y:0},h()},[t,w,n,h,s,a,JSON.stringify(C),JSON.stringify(g),b,d,T,u,JSON.stringify(m)])}const Iv={x:{[ut.Backward]:!1,[ut.Forward]:!1},y:{[ut.Backward]:!1,[ut.Forward]:!1}};function Dv(e){let{delta:t,disabled:r}=e;const n=Ts(t);return yo(o=>{if(r||!n||!o)return Iv;const s={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[ut.Backward]:o.x[ut.Backward]||s.x===-1,[ut.Forward]:o.x[ut.Forward]||s.x===1},y:{[ut.Backward]:o.y[ut.Backward]||s.y===-1,[ut.Forward]:o.y[ut.Forward]||s.y===1}}},[r,t,n])}function Lv(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return yo(o=>{var s;return t==null?null:(s=n??o)!=null?s:null},[n,t])}function Ov(e,t){return p.useMemo(()=>e.reduce((r,n)=>{const{sensor:o}=n,s=o.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,n)}));return[...r,...s]},[]),[e,t])}var _o;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(_o||(_o={}));var ci;(function(e){e.Optimized="optimized"})(ci||(ci={}));const Jc=new Map;function Pv(e,t){let{dragging:r,dependencies:n,config:o}=t;const[s,a]=p.useState(null),{frequency:i,measure:c,strategy:d}=o,u=p.useRef(e),f=v(),m=vo(f),g=p.useCallback(function(y){y===void 0&&(y=[]),!m.current&&a(C=>C===null?y:C.concat(y.filter(S=>!C.includes(S))))},[m]),b=p.useRef(null),h=yo(y=>{if(f&&!r)return Jc;if(!y||y===Jc||u.current!==e||s!=null){const C=new Map;for(let S of e){if(!S)continue;if(s&&s.length>0&&!s.includes(S.id)&&S.rect.current){C.set(S.id,S.rect.current);continue}const w=S.node.current,T=w?new ni(c(w),w):null;S.rect.current=T,T&&C.set(S.id,T)}return C}return y},[e,s,r,f,c]);return p.useEffect(()=>{u.current=e},[e]),p.useEffect(()=>{f||g()},[r,f]),p.useEffect(()=>{s&&s.length>0&&a(null)},[JSON.stringify(s)]),p.useEffect(()=>{f||typeof i!="number"||b.current!==null||(b.current=setTimeout(()=>{g(),b.current=null},i))},[i,f,g,...n]),{droppableRects:h,measureDroppableContainers:g,measuringScheduled:s!=null};function v(){switch(d){case _o.Always:return!1;case _o.BeforeDragging:return r;default:return!r}}}function di(e,t){return yo(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function Nv(e,t){return di(e,t)}function xv(e){let{callback:t,disabled:r}=e;const n=ws(t),o=p.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(n)},[n,r]);return p.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Os(e){let{callback:t,disabled:r}=e;const n=ws(t),o=p.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(n)},[r]);return p.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Fv(e){return new ni(In(e),e)}function ed(e,t,r){t===void 0&&(t=Fv);const[n,o]=p.useState(null);function s(){o(c=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=c??r)!=null?d:null}const u=t(e);return JSON.stringify(c)===JSON.stringify(u)?c:u})}const a=xv({callback(c){if(e)for(const d of c){const{type:u,target:f}=d;if(u==="childList"&&f instanceof HTMLElement&&f.contains(e)){s();break}}}}),i=Os({callback:s});return rr(()=>{s(),e?(i==null||i.observe(e),a==null||a.observe(document.body,{childList:!0,subtree:!0})):(i==null||i.disconnect(),a==null||a.disconnect())},[e]),n}function Mv(e){const t=di(e);return qc(e,t)}const td=[];function $v(e){const t=p.useRef(e),r=yo(n=>e?n&&n!==td&&e&&t.current&&e.parentNode===t.current.parentNode?n:Is(e):td,[e]);return p.useEffect(()=>{t.current=e},[e]),r}function Bv(e){const[t,r]=p.useState(null),n=p.useRef(e),o=p.useCallback(s=>{const a=ti(s.target);a&&r(i=>i?(i.set(a,ri(a)),new Map(i)):null)},[]);return p.useEffect(()=>{const s=n.current;if(e!==s){a(s);const i=e.map(c=>{const d=ti(c);return d?(d.addEventListener("scroll",o,{passive:!0}),[d,ri(d)]):null}).filter(c=>c!=null);r(i.length?new Map(i):null),n.current=e}return()=>{a(e),a(s)};function a(i){i.forEach(c=>{const d=ti(c);d==null||d.removeEventListener("scroll",o)})}},[o,e]),p.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,a)=>kn(s,a),nr):Rc(e):nr,[e,t])}function rd(e,t){t===void 0&&(t=[]);const r=p.useRef(null);return p.useEffect(()=>{r.current=null},t),p.useEffect(()=>{const n=e!==nr;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?Co(e,r.current):nr}function qv(e){p.useEffect(()=>{if(!Ss)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r==null||r()}},e.map(t=>{let{sensor:r}=t;return r}))}function jv(e,t){return p.useMemo(()=>e.reduce((r,n)=>{let{eventName:o,handler:s}=n;return r[o]=a=>{s(a,t)},r},{}),[e,t])}function nd(e){return p.useMemo(()=>e?uv(e):null,[e])}const od=[];function Uv(e,t){t===void 0&&(t=In);const[r]=e,n=nd(r?Ot(r):null),[o,s]=p.useState(od);function a(){s(()=>e.length?e.map(c=>Qc(c)?n:new ni(t(c),c)):od)}const i=Os({callback:a});return rr(()=>{i==null||i.disconnect(),a(),e.forEach(c=>i==null?void 0:i.observe(c))},[e]),o}function sd(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return mo(t)?t:e}function zv(e){let{measure:t}=e;const[r,n]=p.useState(null),o=p.useCallback(d=>{for(const{target:u}of d)if(mo(u)){n(f=>{const m=t(u);return f?{...f,width:m.width,height:m.height}:m});break}},[t]),s=Os({callback:o}),a=p.useCallback(d=>{const u=sd(d);s==null||s.disconnect(),u&&(s==null||s.observe(u)),n(u?t(u):null)},[t,s]),[i,c]=_s(a);return p.useMemo(()=>({nodeRef:i,rect:r,setRef:c}),[r,i,c])}const Vv=[{sensor:Ds,options:{}},{sensor:si,options:{}}],Hv={current:{}},Ps={draggable:{measure:Uc},droppable:{measure:Uc,strategy:_o.WhileDragging,frequency:ci.Optimized},dragOverlay:{measure:In}};class To extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const Qv={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new To,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ks},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ps,measureDroppableContainers:ks,windowRect:null,measuringScheduled:!1},ad={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ks,draggableNodes:new Map,over:null,measureDroppableContainers:ks},Eo=p.createContext(ad),id=p.createContext(Qv);function Wv(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new To}}}function Rv(e,t){switch(t.type){case it.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case it.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case it.DragEnd:case it.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case it.RegisterDroppable:{const{element:r}=t,{id:n}=r,o=new To(e.droppable.containers);return o.set(n,r),{...e,droppable:{...e.droppable,containers:o}}}case it.SetDroppableDisabled:{const{id:r,key:n,disabled:o}=t,s=e.droppable.containers.get(r);if(!s||n!==s.key)return e;const a=new To(e.droppable.containers);return a.set(r,{...s,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case it.UnregisterDroppable:{const{id:r,key:n}=t,o=e.droppable.containers.get(r);if(!o||n!==o.key)return e;const s=new To(e.droppable.containers);return s.delete(r),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function Gv(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:o}=p.useContext(Eo),s=Ts(n),a=Ts(r==null?void 0:r.id);return p.useEffect(()=>{if(!t&&!n&&s&&a!=null){if(!Es(s)||document.activeElement===s.target)return;const i=o.get(a);if(!i)return;const{activatorNode:c,node:d}=i;if(!c.current&&!d.current)return;requestAnimationFrame(()=>{for(const u of[c.current,d.current]){if(!u)continue;const f=Hm(u);if(f){f.focus();break}}})}},[n,t,o,a,s]),null}function ld(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((o,s)=>s({transform:o,...n}),r):r}function Kv(e){return p.useMemo(()=>({draggable:{...Ps.draggable,...e==null?void 0:e.draggable},droppable:{...Ps.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Ps.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function Yv(e){let{activeNode:t,measure:r,initialRect:n,config:o=!0}=e;const s=p.useRef(!1),{x:a,y:i}=typeof o=="boolean"?{x:o,y:o}:o;rr(()=>{if(!a&&!i||!t){s.current=!1;return}if(s.current||!n)return;const d=t==null?void 0:t.node.current;if(!d||d.isConnected===!1)return;const u=r(d),f=qc(u,n);if(a||(f.x=0),i||(f.y=0),s.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const m=zc(d);m&&m.scrollBy({top:f.y,left:f.x})}},[t,a,i,n,r])}const Ns=p.createContext({...nr,scaleX:1,scaleY:1});var Pr;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Pr||(Pr={}));const cd=p.memo(function(t){var r,n,o,s;let{id:a,accessibility:i,autoScroll:c=!0,children:d,sensors:u=Vv,collisionDetection:f=sv,measuring:m,modifiers:g,...b}=t;const h=p.useReducer(Rv,void 0,Wv),[v,y]=h,[C,S]=Ym(),[w,T]=p.useState(Pr.Uninitialized),E=w===Pr.Initialized,{draggable:{active:L,nodes:A,translate:x},droppable:{containers:F}}=v,P=L!=null?A.get(L):null,N=p.useRef({initial:null,translated:null}),M=p.useMemo(()=>{var mt;return L!=null?{id:L,data:(mt=P==null?void 0:P.data)!=null?mt:Hv,rect:N}:null},[L,P]),B=p.useRef(null),[U,ee]=p.useState(null),[Q,te]=p.useState(null),ue=vo(b,Object.values(b)),fe=bo("DndDescribedBy",a),pe=p.useMemo(()=>F.getEnabled(),[F]),ie=Kv(m),{droppableRects:Te,measureDroppableContainers:ye,measuringScheduled:$}=Pv(pe,{dragging:E,dependencies:[x.x,x.y],config:ie.droppable}),q=Lv(A,L),Z=p.useMemo(()=>Q?As(Q):null,[Q]),he=_n(),be=Nv(q,ie.draggable.measure);Yv({activeNode:L!=null?A.get(L):null,config:he.layoutShiftCompensation,initialRect:be,measure:ie.draggable.measure});const ge=ed(q,ie.draggable.measure,be),le=ed(q?q.parentElement:null),ve=p.useRef({activatorEvent:null,active:null,activeNode:q,collisionRect:null,collisions:null,droppableRects:Te,draggableNodes:A,draggingNode:null,draggingNodeRect:null,droppableContainers:F,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ae=F.getNodeFor((r=ve.current.over)==null?void 0:r.id),Y=zv({measure:ie.dragOverlay.measure}),de=(n=Y.nodeRef.current)!=null?n:q,W=E?(o=Y.rect)!=null?o:ge:null,Ce=!!(Y.nodeRef.current&&Y.rect),Ve=Mv(Ce?null:ge),nt=nd(de?Ot(de):null),He=$v(E?Ae??q:null),Ke=Uv(He),ot=ld(g,{transform:{x:x.x-Ve.x,y:x.y-Ve.y,scaleX:1,scaleY:1},activatorEvent:Q,active:M,activeNodeRect:ge,containerNodeRect:le,draggingNodeRect:W,over:ve.current.over,overlayNodeRect:Y.rect,scrollableAncestors:He,scrollableAncestorRects:Ke,windowRect:nt}),Sn=Z?kn(Z,x):null,lo=Bv(He),as=rd(lo),wn=rd(lo,[ge]),_=kn(ot,as),k=W?lv(W,ot):null,D=M&&k?f({active:M,collisionRect:k,droppableRects:Te,droppableContainers:pe,pointerCoordinates:Sn}):null,z=$c(D,"id"),[V,R]=p.useState(null),H=Ce?ot:kn(ot,wn),se=av(H,(s=V==null?void 0:V.rect)!=null?s:null,ge),ae=p.useRef(null),Fe=p.useCallback((mt,Lt)=>{let{sensor:Nt,options:dr}=Lt;if(B.current==null)return;const tr=A.get(B.current);if(!tr)return;const Qt=mt.nativeEvent,Cr=new Nt({active:B.current,activeNode:tr,event:Qt,options:dr,context:ve,onAbort(St){if(!A.get(St))return;const{onDragAbort:Sr}=ue.current,Er={id:St};Sr==null||Sr(Er),C({type:"onDragAbort",event:Er})},onPending(St,Wr,Sr,Er){if(!A.get(St))return;const{onDragPending:cs}=ue.current,Rr={id:St,constraint:Wr,initialCoordinates:Sr,offset:Er};cs==null||cs(Rr),C({type:"onDragPending",event:Rr})},onStart(St){const Wr=B.current;if(Wr==null)return;const Sr=A.get(Wr);if(!Sr)return;const{onDragStart:Er}=ue.current,ls={activatorEvent:Qt,active:{id:Wr,data:Sr.data,rect:N}};Ue.unstable_batchedUpdates(()=>{Er==null||Er(ls),T(Pr.Initializing),y({type:it.DragStart,initialCoordinates:St,active:Wr}),C({type:"onDragStart",event:ls}),ee(ae.current),te(Qt)})},onMove(St){y({type:it.DragMove,coordinates:St})},onEnd:co(it.DragEnd),onCancel:co(it.DragCancel)});ae.current=Cr;function co(St){return async function(){const{active:Sr,collisions:Er,over:ls,scrollAdjustedTranslate:cs}=ve.current;let Rr=null;if(Sr&&cs){const{cancelDrop:ds}=ue.current;Rr={activatorEvent:Qt,active:Sr,collisions:Er,delta:cs,over:ls},St===it.DragEnd&&typeof ds=="function"&&await Promise.resolve(ds(Rr))&&(St=it.DragCancel)}B.current=null,Ue.unstable_batchedUpdates(()=>{y({type:St}),T(Pr.Uninitialized),R(null),ee(null),te(null),ae.current=null;const ds=St===it.DragEnd?"onDragEnd":"onDragCancel";if(Rr){const Rl=ue.current[ds];Rl==null||Rl(Rr),C({type:ds,event:Rr})}})}}},[A]),Je=p.useCallback((mt,Lt)=>(Nt,dr)=>{const tr=Nt.nativeEvent,Qt=A.get(dr);if(B.current!==null||!Qt||tr.dndKit||tr.defaultPrevented)return;const Cr={active:Qt};mt(Nt,Lt.options,Cr)===!0&&(tr.dndKit={capturedBy:Lt.sensor},B.current=dr,Fe(Nt,Lt))},[A,Fe]),dt=Ov(u,Je);qv(u),rr(()=>{ge&&w===Pr.Initializing&&T(Pr.Initialized)},[ge,w]),p.useEffect(()=>{const{onDragMove:mt}=ue.current,{active:Lt,activatorEvent:Nt,collisions:dr,over:tr}=ve.current;if(!Lt||!Nt)return;const Qt={active:Lt,activatorEvent:Nt,collisions:dr,delta:{x:_.x,y:_.y},over:tr};Ue.unstable_batchedUpdates(()=>{mt==null||mt(Qt),C({type:"onDragMove",event:Qt})})},[_.x,_.y]),p.useEffect(()=>{const{active:mt,activatorEvent:Lt,collisions:Nt,droppableContainers:dr,scrollAdjustedTranslate:tr}=ve.current;if(!mt||B.current==null||!Lt||!tr)return;const{onDragOver:Qt}=ue.current,Cr=dr.get(z),co=Cr&&Cr.rect.current?{id:Cr.id,rect:Cr.rect.current,data:Cr.data,disabled:Cr.disabled}:null,St={active:mt,activatorEvent:Lt,collisions:Nt,delta:{x:tr.x,y:tr.y},over:co};Ue.unstable_batchedUpdates(()=>{R(co),Qt==null||Qt(St),C({type:"onDragOver",event:St})})},[z]),rr(()=>{ve.current={activatorEvent:Q,active:M,activeNode:q,collisionRect:k,collisions:D,droppableRects:Te,draggableNodes:A,draggingNode:de,draggingNodeRect:W,droppableContainers:F,over:V,scrollableAncestors:He,scrollAdjustedTranslate:_},N.current={initial:W,translated:k}},[M,q,D,k,A,de,W,Te,F,V,He,_]),kv({...he,delta:x,draggingRect:k,pointerCoordinates:Sn,scrollableAncestors:He,scrollableAncestorRects:Ke});const er=p.useMemo(()=>({active:M,activeNode:q,activeNodeRect:ge,activatorEvent:Q,collisions:D,containerNodeRect:le,dragOverlay:Y,draggableNodes:A,droppableContainers:F,droppableRects:Te,over:V,measureDroppableContainers:ye,scrollableAncestors:He,scrollableAncestorRects:Ke,measuringConfiguration:ie,measuringScheduled:$,windowRect:nt}),[M,q,ge,Q,D,le,Y,A,F,Te,V,ye,He,Ke,ie,$,nt]),is=p.useMemo(()=>({activatorEvent:Q,activators:dt,active:M,activeNodeRect:ge,ariaDescribedById:{draggable:fe},dispatch:y,draggableNodes:A,over:V,measureDroppableContainers:ye}),[Q,dt,M,ge,y,fe,A,V,ye]);return p.createElement(Pc.Provider,{value:S},p.createElement(Eo.Provider,{value:is},p.createElement(id.Provider,{value:er},p.createElement(Ns.Provider,{value:se},d)),p.createElement(Gv,{disabled:(i==null?void 0:i.restoreFocus)===!1})),p.createElement(Jm,{...i,hiddenTextDescribedById:fe}));function _n(){const mt=(U==null?void 0:U.autoScrollEnabled)===!1,Lt=typeof c=="object"?c.enabled===!1:c===!1,Nt=E&&!mt&&!Lt;return typeof c=="object"?{...c,enabled:Nt}:{enabled:Nt}}}),Zv=p.createContext(null),dd="button",Xv="Draggable";function ud(e){let{id:t,data:r,disabled:n=!1,attributes:o}=e;const s=bo(Xv),{activators:a,activatorEvent:i,active:c,activeNodeRect:d,ariaDescribedById:u,draggableNodes:f,over:m}=p.useContext(Eo),{role:g=dd,roleDescription:b="draggable",tabIndex:h=0}=o??{},v=(c==null?void 0:c.id)===t,y=p.useContext(v?Ns:Zv),[C,S]=_s(),[w,T]=_s(),E=jv(a,t),L=vo(r);rr(()=>(f.set(t,{id:t,key:s,node:C,activatorNode:w,data:L}),()=>{const x=f.get(t);x&&x.key===s&&f.delete(t)}),[f,t]);const A=p.useMemo(()=>({role:g,tabIndex:h,"aria-disabled":n,"aria-pressed":v&&g===dd?!0:void 0,"aria-roledescription":b,"aria-describedby":u.draggable}),[n,g,h,v,b,u.draggable]);return{active:c,activatorEvent:i,activeNodeRect:d,attributes:A,isDragging:v,listeners:n?void 0:E,node:C,over:m,setNodeRef:S,setActivatorNodeRef:T,transform:y}}function fd(){return p.useContext(id)}const Jv="Droppable",ey={timeout:25};function ty(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:o}=e;const s=bo(Jv),{active:a,dispatch:i,over:c,measureDroppableContainers:d}=p.useContext(Eo),u=p.useRef({disabled:r}),f=p.useRef(!1),m=p.useRef(null),g=p.useRef(null),{disabled:b,updateMeasurementsFor:h,timeout:v}={...ey,...o},y=vo(h??n),C=p.useCallback(()=>{if(!f.current){f.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{d(Array.isArray(y.current)?y.current:[y.current]),g.current=null},v)},[v]),S=Os({callback:C,disabled:b||!a}),w=p.useCallback((A,x)=>{S&&(x&&(S.unobserve(x),f.current=!1),A&&S.observe(A))},[S]),[T,E]=_s(w),L=vo(t);return p.useEffect(()=>{!S||!T.current||(S.disconnect(),f.current=!1,S.observe(T.current))},[T,S]),p.useEffect(()=>(i({type:it.RegisterDroppable,element:{id:n,key:s,disabled:r,node:T,rect:m,data:L}}),()=>i({type:it.UnregisterDroppable,key:s,id:n})),[n]),p.useEffect(()=>{r!==u.current.disabled&&(i({type:it.SetDroppableDisabled,id:n,key:s,disabled:r}),u.current.disabled=r)},[n,s,r,i]),{active:a,rect:m,isOver:(c==null?void 0:c.id)===n,node:T,over:c,setNodeRef:E}}function ry(e){let{animation:t,children:r}=e;const[n,o]=p.useState(null),[s,a]=p.useState(null),i=Ts(r);return!r&&!n&&i&&o(i),rr(()=>{if(!s)return;const c=n==null?void 0:n.key,d=n==null?void 0:n.props.id;if(c==null||d==null){o(null);return}Promise.resolve(t(d,s)).then(()=>{o(null)})},[t,n,s]),p.createElement(p.Fragment,null,r,n?p.cloneElement(n,{ref:a}):null)}const ny={x:0,y:0,scaleX:1,scaleY:1};function oy(e){let{children:t}=e;return p.createElement(Eo.Provider,{value:ad},p.createElement(Ns.Provider,{value:ny},t))}const sy={position:"fixed",touchAction:"none"},ay=e=>Es(e)?"transform 250ms ease":void 0,iy=p.forwardRef((e,t)=>{let{as:r,activatorEvent:n,adjustScale:o,children:s,className:a,rect:i,style:c,transform:d,transition:u=ay}=e;if(!i)return null;const f=o?d:{...d,scaleX:1,scaleY:1},m={...sy,width:i.width,height:i.height,top:i.top,left:i.left,transform:Or.Transform.toString(f),transformOrigin:o&&n?ev(n,i):void 0,transition:typeof u=="function"?u(n):u,...c};return p.createElement(r,{className:a,style:m,ref:t},s)}),ly={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:r}}=e;return[{transform:Or.Transform.toString(t)},{transform:Or.Transform.toString(r)}]},sideEffects:(e=>t=>{let{active:r,dragOverlay:n}=t;const o={},{styles:s,className:a}=e;if(s!=null&&s.active)for(const[i,c]of Object.entries(s.active))c!==void 0&&(o[i]=r.node.style.getPropertyValue(i),r.node.style.setProperty(i,c));if(s!=null&&s.dragOverlay)for(const[i,c]of Object.entries(s.dragOverlay))c!==void 0&&n.node.style.setProperty(i,c);return a!=null&&a.active&&r.node.classList.add(a.active),a!=null&&a.dragOverlay&&n.node.classList.add(a.dragOverlay),function(){for(const[c,d]of Object.entries(o))r.node.style.setProperty(c,d);a!=null&&a.active&&r.node.classList.remove(a.active)}})({styles:{active:{opacity:"0"}}})};function cy(e){let{config:t,draggableNodes:r,droppableContainers:n,measuringConfiguration:o}=e;return ws((s,a)=>{if(t===null)return;const i=r.get(s);if(!i)return;const c=i.node.current;if(!c)return;const d=sd(a);if(!d)return;const{transform:u}=Ot(a).getComputedStyle(a),f=jc(u);if(!f)return;const m=typeof t=="function"?t:dy(t);return Gc(c,o.draggable.measure),m({active:{id:s,data:i.data,node:c,rect:o.draggable.measure(c)},draggableNodes:r,dragOverlay:{node:a,rect:o.dragOverlay.measure(d)},droppableContainers:n,measuringConfiguration:o,transform:f})})}function dy(e){const{duration:t,easing:r,sideEffects:n,keyframes:o}={...ly,...e};return s=>{let{active:a,dragOverlay:i,transform:c,...d}=s;if(!t)return;const u={x:i.rect.left-a.rect.left,y:i.rect.top-a.rect.top},f={scaleX:c.scaleX!==1?a.rect.width*c.scaleX/i.rect.width:1,scaleY:c.scaleY!==1?a.rect.height*c.scaleY/i.rect.height:1},m={x:c.x-u.x,y:c.y-u.y,...f},g=o({...d,active:a,dragOverlay:i,transform:{initial:c,final:m}}),[b]=g,h=g[g.length-1];if(JSON.stringify(b)===JSON.stringify(h))return;const v=n==null?void 0:n({active:a,dragOverlay:i,...d}),y=i.node.animate(g,{duration:t,easing:r,fill:"forwards"});return new Promise(C=>{y.onfinish=()=>{v==null||v(),C()}})}}let hd=0;function uy(e){return p.useMemo(()=>{if(e!=null)return hd++,hd},[e])}const fy=p.memo(e=>{let{adjustScale:t=!1,children:r,dropAnimation:n,style:o,transition:s,modifiers:a,wrapperElement:i="div",className:c,zIndex:d=999}=e;const{activatorEvent:u,active:f,activeNodeRect:m,containerNodeRect:g,draggableNodes:b,droppableContainers:h,dragOverlay:v,over:y,measuringConfiguration:C,scrollableAncestors:S,scrollableAncestorRects:w,windowRect:T}=fd(),E=p.useContext(Ns),L=uy(f==null?void 0:f.id),A=ld(a,{activatorEvent:u,active:f,activeNodeRect:m,containerNodeRect:g,draggingNodeRect:v.rect,over:y,overlayNodeRect:v.rect,scrollableAncestors:S,scrollableAncestorRects:w,transform:E,windowRect:T}),x=di(m),F=cy({config:n,draggableNodes:b,droppableContainers:h,measuringConfiguration:C}),P=x?v.setRef:void 0;return p.createElement(oy,null,p.createElement(ry,{animation:F},f&&L?p.createElement(iy,{key:L,id:f.id,ref:P,as:i,activatorEvent:u,adjustScale:t,className:c,transition:s,rect:x,style:{zIndex:d,...o},transform:A},r):null))});/**
182
182
  * @license lucide-react v0.400.0 - ISC
183
183
  *
184
184
  * This source code is licensed under the ISC license.
185
185
  * See the LICENSE file in the root directory of this source tree.
186
- */const fy=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),pd=(...e)=>e.filter((t,r,n)=>!!t&&n.indexOf(t)===r).join(" ");/**
186
+ */const hy=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),pd=(...e)=>e.filter((t,r,n)=>!!t&&n.indexOf(t)===r).join(" ");/**
187
187
  * @license lucide-react v0.400.0 - ISC
188
188
  *
189
189
  * This source code is licensed under the ISC license.
190
190
  * See the LICENSE file in the root directory of this source tree.
191
- */var hy={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
191
+ */var py={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
192
192
  * @license lucide-react v0.400.0 - ISC
193
193
  *
194
194
  * This source code is licensed under the ISC license.
195
195
  * See the LICENSE file in the root directory of this source tree.
196
- */const py=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:s,iconNode:a,...i},c)=>p.createElement("svg",{ref:c,...hy,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:pd("lucide",o),...i},[...a.map(([d,u])=>p.createElement(d,u)),...Array.isArray(s)?s:[s]]));/**
196
+ */const gy=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:s,iconNode:a,...i},c)=>p.createElement("svg",{ref:c,...py,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:pd("lucide",o),...i},[...a.map(([d,u])=>p.createElement(d,u)),...Array.isArray(s)?s:[s]]));/**
197
197
  * @license lucide-react v0.400.0 - ISC
198
198
  *
199
199
  * This source code is licensed under the ISC license.
200
200
  * See the LICENSE file in the root directory of this source tree.
201
- */const re=(e,t)=>{const r=p.forwardRef(({className:n,...o},s)=>p.createElement(py,{ref:s,iconNode:t,className:pd(`lucide-${fy(e)}`,n),...o}));return r.displayName=`${e}`,r};/**
201
+ */const ne=(e,t)=>{const r=p.forwardRef(({className:n,...o},s)=>p.createElement(gy,{ref:s,iconNode:t,className:pd(`lucide-${hy(e)}`,n),...o}));return r.displayName=`${e}`,r};/**
202
202
  * @license lucide-react v0.400.0 - ISC
203
203
  *
204
204
  * This source code is licensed under the ISC license.
205
205
  * See the LICENSE file in the root directory of this source tree.
206
- */const gy=re("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
206
+ */const my=ne("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
207
207
  * @license lucide-react v0.400.0 - ISC
208
208
  *
209
209
  * This source code is licensed under the ISC license.
210
210
  * See the LICENSE file in the root directory of this source tree.
211
- */const ui=re("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
211
+ */const ui=ne("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
212
212
  * @license lucide-react v0.400.0 - ISC
213
213
  *
214
214
  * This source code is licensed under the ISC license.
215
215
  * See the LICENSE file in the root directory of this source tree.
216
- */const my=re("ArrowUpAZ",[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M20 8h-5",key:"1vsyxs"}],["path",{d:"M15 10V6.5a2.5 2.5 0 0 1 5 0V10",key:"ag13bf"}],["path",{d:"M15 14h5l-5 6h5",key:"ur5jdg"}]]);/**
216
+ */const vy=ne("ArrowUpAZ",[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M20 8h-5",key:"1vsyxs"}],["path",{d:"M15 10V6.5a2.5 2.5 0 0 1 5 0V10",key:"ag13bf"}],["path",{d:"M15 14h5l-5 6h5",key:"ur5jdg"}]]);/**
217
217
  * @license lucide-react v0.400.0 - ISC
218
218
  *
219
219
  * This source code is licensed under the ISC license.
220
220
  * See the LICENSE file in the root directory of this source tree.
221
- */const vy=re("Award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);/**
221
+ */const yy=ne("Award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);/**
222
222
  * @license lucide-react v0.400.0 - ISC
223
223
  *
224
224
  * This source code is licensed under the ISC license.
225
225
  * See the LICENSE file in the root directory of this source tree.
226
- */const Nr=re("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/**
226
+ */const Nr=ne("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/**
227
227
  * @license lucide-react v0.400.0 - ISC
228
228
  *
229
229
  * This source code is licensed under the ISC license.
230
230
  * See the LICENSE file in the root directory of this source tree.
231
- */const yy=re("Book",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20",key:"t4utmx"}]]);/**
231
+ */const by=ne("Book",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20",key:"t4utmx"}]]);/**
232
232
  * @license lucide-react v0.400.0 - ISC
233
233
  *
234
234
  * This source code is licensed under the ISC license.
235
235
  * See the LICENSE file in the root directory of this source tree.
236
- */const Yr=re("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
236
+ */const Yr=ne("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
237
237
  * @license lucide-react v0.400.0 - ISC
238
238
  *
239
239
  * This source code is licensed under the ISC license.
240
240
  * See the LICENSE file in the root directory of this source tree.
241
- */const Zr=re("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
241
+ */const Zr=ne("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
242
242
  * @license lucide-react v0.400.0 - ISC
243
243
  *
244
244
  * This source code is licensed under the ISC license.
245
245
  * See the LICENSE file in the root directory of this source tree.
246
- */const fi=re("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
246
+ */const fi=ne("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
247
247
  * @license lucide-react v0.400.0 - ISC
248
248
  *
249
249
  * This source code is licensed under the ISC license.
250
250
  * See the LICENSE file in the root directory of this source tree.
251
- */const by=re("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
251
+ */const Cy=ne("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
252
252
  * @license lucide-react v0.400.0 - ISC
253
253
  *
254
254
  * This source code is licensed under the ISC license.
255
255
  * See the LICENSE file in the root directory of this source tree.
256
- */const gd=re("CircleCheckBig",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
256
+ */const gd=ne("CircleCheckBig",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
257
257
  * @license lucide-react v0.400.0 - ISC
258
258
  *
259
259
  * This source code is licensed under the ISC license.
260
260
  * See the LICENSE file in the root directory of this source tree.
261
- */const xs=re("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
261
+ */const xs=ne("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
262
262
  * @license lucide-react v0.400.0 - ISC
263
263
  *
264
264
  * This source code is licensed under the ISC license.
265
265
  * See the LICENSE file in the root directory of this source tree.
266
- */const Cy=re("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
266
+ */const Sy=ne("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
267
267
  * @license lucide-react v0.400.0 - ISC
268
268
  *
269
269
  * This source code is licensed under the ISC license.
270
270
  * See the LICENSE file in the root directory of this source tree.
271
- */const Sy=re("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
271
+ */const wy=ne("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
272
272
  * @license lucide-react v0.400.0 - ISC
273
273
  *
274
274
  * This source code is licensed under the ISC license.
275
275
  * See the LICENSE file in the root directory of this source tree.
276
- */const wy=re("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
276
+ */const _y=ne("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
277
277
  * @license lucide-react v0.400.0 - ISC
278
278
  *
279
279
  * This source code is licensed under the ISC license.
280
280
  * See the LICENSE file in the root directory of this source tree.
281
- */const md=re("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/**
281
+ */const md=ne("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/**
282
282
  * @license lucide-react v0.400.0 - ISC
283
283
  *
284
284
  * This source code is licensed under the ISC license.
285
285
  * See the LICENSE file in the root directory of this source tree.
286
- */const _y=re("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
286
+ */const Ty=ne("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
287
287
  * @license lucide-react v0.400.0 - ISC
288
288
  *
289
289
  * This source code is licensed under the ISC license.
290
290
  * See the LICENSE file in the root directory of this source tree.
291
- */const Ao=re("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
291
+ */const Ao=ne("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
292
292
  * @license lucide-react v0.400.0 - ISC
293
293
  *
294
294
  * This source code is licensed under the ISC license.
295
295
  * See the LICENSE file in the root directory of this source tree.
296
- */const xr=re("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/**
296
+ */const xr=ne("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/**
297
297
  * @license lucide-react v0.400.0 - ISC
298
298
  *
299
299
  * This source code is licensed under the ISC license.
300
300
  * See the LICENSE file in the root directory of this source tree.
301
- */const vd=re("Flag",[["path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",key:"i9b6wo"}],["line",{x1:"4",x2:"4",y1:"22",y2:"15",key:"1cm3nv"}]]);/**
301
+ */const vd=ne("Flag",[["path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",key:"i9b6wo"}],["line",{x1:"4",x2:"4",y1:"22",y2:"15",key:"1cm3nv"}]]);/**
302
302
  * @license lucide-react v0.400.0 - ISC
303
303
  *
304
304
  * This source code is licensed under the ISC license.
305
305
  * See the LICENSE file in the root directory of this source tree.
306
- */const Ty=re("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
306
+ */const Ey=ne("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
307
307
  * @license lucide-react v0.400.0 - ISC
308
308
  *
309
309
  * This source code is licensed under the ISC license.
310
310
  * See the LICENSE file in the root directory of this source tree.
311
- */const yd=re("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
311
+ */const yd=ne("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
312
312
  * @license lucide-react v0.400.0 - ISC
313
313
  *
314
314
  * This source code is licensed under the ISC license.
315
315
  * See the LICENSE file in the root directory of this source tree.
316
- */const bd=re("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
316
+ */const bd=ne("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
317
317
  * @license lucide-react v0.400.0 - ISC
318
318
  *
319
319
  * This source code is licensed under the ISC license.
320
320
  * See the LICENSE file in the root directory of this source tree.
321
- */const Ey=re("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
321
+ */const Ay=ne("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
322
322
  * @license lucide-react v0.400.0 - ISC
323
323
  *
324
324
  * This source code is licensed under the ISC license.
325
325
  * See the LICENSE file in the root directory of this source tree.
326
- */const Cd=re("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
326
+ */const Cd=ne("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
327
327
  * @license lucide-react v0.400.0 - ISC
328
328
  *
329
329
  * This source code is licensed under the ISC license.
330
330
  * See the LICENSE file in the root directory of this source tree.
331
- */const Ay=re("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
331
+ */const ky=ne("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
332
332
  * @license lucide-react v0.400.0 - ISC
333
333
  *
334
334
  * This source code is licensed under the ISC license.
335
335
  * See the LICENSE file in the root directory of this source tree.
336
- */const Sd=re("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
336
+ */const Sd=ne("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
337
337
  * @license lucide-react v0.400.0 - ISC
338
338
  *
339
339
  * This source code is licensed under the ISC license.
340
340
  * See the LICENSE file in the root directory of this source tree.
341
- */const In=re("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
341
+ */const Dn=ne("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
342
342
  * @license lucide-react v0.400.0 - ISC
343
343
  *
344
344
  * This source code is licensed under the ISC license.
345
345
  * See the LICENSE file in the root directory of this source tree.
346
- */const Fs=re("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
346
+ */const Fs=ne("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
347
347
  * @license lucide-react v0.400.0 - ISC
348
348
  *
349
349
  * This source code is licensed under the ISC license.
350
350
  * See the LICENSE file in the root directory of this source tree.
351
- */const ky=re("Library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);/**
351
+ */const Iy=ne("Library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);/**
352
352
  * @license lucide-react v0.400.0 - ISC
353
353
  *
354
354
  * This source code is licensed under the ISC license.
355
355
  * See the LICENSE file in the root directory of this source tree.
356
- */const Ms=re("Loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);/**
356
+ */const Ms=ne("Loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);/**
357
357
  * @license lucide-react v0.400.0 - ISC
358
358
  *
359
359
  * This source code is licensed under the ISC license.
360
360
  * See the LICENSE file in the root directory of this source tree.
361
- */const wd=re("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
361
+ */const wd=ne("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
362
362
  * @license lucide-react v0.400.0 - ISC
363
363
  *
364
364
  * This source code is licensed under the ISC license.
365
365
  * See the LICENSE file in the root directory of this source tree.
366
- */const Iy=re("Milestone",[["path",{d:"M18 6H5a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h13l4-3.5L18 6Z",key:"1mp5s7"}],["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M12 3v3",key:"1n5kay"}]]);/**
366
+ */const Dy=ne("Milestone",[["path",{d:"M18 6H5a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h13l4-3.5L18 6Z",key:"1mp5s7"}],["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M12 3v3",key:"1n5kay"}]]);/**
367
367
  * @license lucide-react v0.400.0 - ISC
368
368
  *
369
369
  * This source code is licensed under the ISC license.
370
370
  * See the LICENSE file in the root directory of this source tree.
371
- */const $s=re("Music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);/**
371
+ */const $s=ne("Music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);/**
372
372
  * @license lucide-react v0.400.0 - ISC
373
373
  *
374
374
  * This source code is licensed under the ISC license.
375
375
  * See the LICENSE file in the root directory of this source tree.
376
- */const Bs=re("Package",[["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
376
+ */const Bs=ne("Package",[["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
377
377
  * @license lucide-react v0.400.0 - ISC
378
378
  *
379
379
  * This source code is licensed under the ISC license.
380
380
  * See the LICENSE file in the root directory of this source tree.
381
- */const Dy=re("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);/**
381
+ */const Ly=ne("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);/**
382
382
  * @license lucide-react v0.400.0 - ISC
383
383
  *
384
384
  * This source code is licensed under the ISC license.
385
385
  * See the LICENSE file in the root directory of this source tree.
386
- */const Ly=re("PanelLeftOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);/**
386
+ */const Oy=ne("PanelLeftOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);/**
387
387
  * @license lucide-react v0.400.0 - ISC
388
388
  *
389
389
  * This source code is licensed under the ISC license.
390
390
  * See the LICENSE file in the root directory of this source tree.
391
- */const Oy=re("PanelRightClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]]);/**
391
+ */const Py=ne("PanelRightClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]]);/**
392
392
  * @license lucide-react v0.400.0 - ISC
393
393
  *
394
394
  * This source code is licensed under the ISC license.
395
395
  * See the LICENSE file in the root directory of this source tree.
396
- */const Py=re("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
396
+ */const Ny=ne("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
397
397
  * @license lucide-react v0.400.0 - ISC
398
398
  *
399
399
  * This source code is licensed under the ISC license.
400
400
  * See the LICENSE file in the root directory of this source tree.
401
- */const Xr=re("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
401
+ */const Xr=ne("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
402
402
  * @license lucide-react v0.400.0 - ISC
403
403
  *
404
404
  * This source code is licensed under the ISC license.
405
405
  * See the LICENSE file in the root directory of this source tree.
406
- */const _d=re("QrCode",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]);/**
406
+ */const _d=ne("QrCode",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]);/**
407
407
  * @license lucide-react v0.400.0 - ISC
408
408
  *
409
409
  * This source code is licensed under the ISC license.
410
410
  * See the LICENSE file in the root directory of this source tree.
411
- */const Td=re("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
411
+ */const Td=ne("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
412
412
  * @license lucide-react v0.400.0 - ISC
413
413
  *
414
414
  * This source code is licensed under the ISC license.
415
415
  * See the LICENSE file in the root directory of this source tree.
416
- */const Ny=re("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
416
+ */const xy=ne("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
417
417
  * @license lucide-react v0.400.0 - ISC
418
418
  *
419
419
  * This source code is licensed under the ISC license.
420
420
  * See the LICENSE file in the root directory of this source tree.
421
- */const xy=re("Scale",[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]]);/**
421
+ */const Fy=ne("Scale",[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]]);/**
422
422
  * @license lucide-react v0.400.0 - ISC
423
423
  *
424
424
  * This source code is licensed under the ISC license.
425
425
  * See the LICENSE file in the root directory of this source tree.
426
- */const Fy=re("School",[["path",{d:"M14 22v-4a2 2 0 1 0-4 0v4",key:"hhkicm"}],["path",{d:"m18 10 4 2v8a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-8l4-2",key:"1vwozw"}],["path",{d:"M18 5v17",key:"1sw6gf"}],["path",{d:"m4 6 8-4 8 4",key:"1q0ilc"}],["path",{d:"M6 5v17",key:"1xfsm0"}],["circle",{cx:"12",cy:"9",r:"2",key:"1092wv"}]]);/**
426
+ */const My=ne("School",[["path",{d:"M14 22v-4a2 2 0 1 0-4 0v4",key:"hhkicm"}],["path",{d:"m18 10 4 2v8a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-8l4-2",key:"1vwozw"}],["path",{d:"M18 5v17",key:"1sw6gf"}],["path",{d:"m4 6 8-4 8 4",key:"1q0ilc"}],["path",{d:"M6 5v17",key:"1xfsm0"}],["circle",{cx:"12",cy:"9",r:"2",key:"1092wv"}]]);/**
427
427
  * @license lucide-react v0.400.0 - ISC
428
428
  *
429
429
  * This source code is licensed under the ISC license.
430
430
  * See the LICENSE file in the root directory of this source tree.
431
- */const qs=re("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
431
+ */const qs=ne("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
432
432
  * @license lucide-react v0.400.0 - ISC
433
433
  *
434
434
  * This source code is licensed under the ISC license.
435
435
  * See the LICENSE file in the root directory of this source tree.
436
- */const My=re("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
436
+ */const $y=ne("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
437
437
  * @license lucide-react v0.400.0 - ISC
438
438
  *
439
439
  * This source code is licensed under the ISC license.
440
440
  * See the LICENSE file in the root directory of this source tree.
441
- */const $y=re("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
441
+ */const By=ne("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
442
442
  * @license lucide-react v0.400.0 - ISC
443
443
  *
444
444
  * This source code is licensed under the ISC license.
445
445
  * See the LICENSE file in the root directory of this source tree.
446
- */const By=re("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
446
+ */const qy=ne("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
447
447
  * @license lucide-react v0.400.0 - ISC
448
448
  *
449
449
  * This source code is licensed under the ISC license.
450
450
  * See the LICENSE file in the root directory of this source tree.
451
- */const qy=re("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
451
+ */const jy=ne("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
452
452
  * @license lucide-react v0.400.0 - ISC
453
453
  *
454
454
  * This source code is licensed under the ISC license.
455
455
  * See the LICENSE file in the root directory of this source tree.
456
- */const jy=re("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
456
+ */const Uy=ne("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
457
457
  * @license lucide-react v0.400.0 - ISC
458
458
  *
459
459
  * This source code is licensed under the ISC license.
460
460
  * See the LICENSE file in the root directory of this source tree.
461
- */const js=re("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
461
+ */const js=ne("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
462
462
  * @license lucide-react v0.400.0 - ISC
463
463
  *
464
464
  * This source code is licensed under the ISC license.
465
465
  * See the LICENSE file in the root directory of this source tree.
466
- */const Uy=re("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
466
+ */const zy=ne("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
467
467
  * @license lucide-react v0.400.0 - ISC
468
468
  *
469
469
  * This source code is licensed under the ISC license.
470
470
  * See the LICENSE file in the root directory of this source tree.
471
- */const hi=re("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
471
+ */const hi=ne("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
472
472
  * @license lucide-react v0.400.0 - ISC
473
473
  *
474
474
  * This source code is licensed under the ISC license.
475
475
  * See the LICENSE file in the root directory of this source tree.
476
- */const zy=re("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
476
+ */const Vy=ne("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
477
477
  * @license lucide-react v0.400.0 - ISC
478
478
  *
479
479
  * This source code is licensed under the ISC license.
480
480
  * See the LICENSE file in the root directory of this source tree.
481
- */const Vy=re("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
481
+ */const Hy=ne("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
482
482
  * @license lucide-react v0.400.0 - ISC
483
483
  *
484
484
  * This source code is licensed under the ISC license.
485
485
  * See the LICENSE file in the root directory of this source tree.
486
- */const Us=re("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/**
486
+ */const Us=ne("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/**
487
487
  * @license lucide-react v0.400.0 - ISC
488
488
  *
489
489
  * This source code is licensed under the ISC license.
490
490
  * See the LICENSE file in the root directory of this source tree.
491
- */const ur=re("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
491
+ */const fr=ne("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
492
492
  * @license lucide-react v0.400.0 - ISC
493
493
  *
494
494
  * This source code is licensed under the ISC license.
495
495
  * See the LICENSE file in the root directory of this source tree.
496
- */const Hy=re("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),Qy={},Ed=e=>{let t;const r=new Set,n=(u,f)=>{const m=typeof u=="function"?u(t):u;if(!Object.is(m,t)){const g=t;t=f??(typeof m!="object"||m===null)?m:Object.assign({},t,m),r.forEach(b=>b(t,g))}},o=()=>t,c={setState:n,getState:o,getInitialState:()=>d,subscribe:u=>(r.add(u),()=>r.delete(u)),destroy:()=>{(Qy?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},d=t=e(n,o,c);return c},Wy=e=>e?Ed(e):Ed;function pi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zs={exports:{}},gi={},Vs={exports:{}},mi={};/**
496
+ */const Qy=ne("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),Wy={},Ed=e=>{let t;const r=new Set,n=(u,f)=>{const m=typeof u=="function"?u(t):u;if(!Object.is(m,t)){const g=t;t=f??(typeof m!="object"||m===null)?m:Object.assign({},t,m),r.forEach(b=>b(t,g))}},o=()=>t,c={setState:n,getState:o,getInitialState:()=>d,subscribe:u=>(r.add(u),()=>r.delete(u)),destroy:()=>{(Wy?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},d=t=e(n,o,c);return c},Ry=e=>e?Ed(e):Ed;function pi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zs={exports:{}},gi={},Vs={exports:{}},mi={};/**
497
497
  * @license React
498
498
  * use-sync-external-store-shim.production.js
499
499
  *
@@ -501,7 +501,7 @@ to {
501
501
  *
502
502
  * This source code is licensed under the MIT license found in the
503
503
  * LICENSE file in the root directory of this source tree.
504
- */var Ad;function Ry(){if(Ad)return mi;Ad=1;var e=p;function t(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,o=e.useEffect,s=e.useLayoutEffect,a=e.useDebugValue;function i(f,m){var g=m(),b=n({inst:{value:g,getSnapshot:m}}),h=b[0].inst,v=b[1];return s(function(){h.value=g,h.getSnapshot=m,c(h)&&v({inst:h})},[f,g,m]),o(function(){return c(h)&&v({inst:h}),f(function(){c(h)&&v({inst:h})})},[f]),a(g),g}function c(f){var m=f.getSnapshot;f=f.value;try{var g=m();return!r(f,g)}catch{return!0}}function d(f,m){return m()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:i;return mi.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,mi}var vi={};/**
504
+ */var Ad;function Gy(){if(Ad)return mi;Ad=1;var e=p;function t(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,o=e.useEffect,s=e.useLayoutEffect,a=e.useDebugValue;function i(f,m){var g=m(),b=n({inst:{value:g,getSnapshot:m}}),h=b[0].inst,v=b[1];return s(function(){h.value=g,h.getSnapshot=m,c(h)&&v({inst:h})},[f,g,m]),o(function(){return c(h)&&v({inst:h}),f(function(){c(h)&&v({inst:h})})},[f]),a(g),g}function c(f){var m=f.getSnapshot;f=f.value;try{var g=m();return!r(f,g)}catch{return!0}}function d(f,m){return m()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:i;return mi.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,mi}var vi={};/**
505
505
  * @license React
506
506
  * use-sync-external-store-shim.development.js
507
507
  *
@@ -509,7 +509,7 @@ to {
509
509
  *
510
510
  * This source code is licensed under the MIT license found in the
511
511
  * LICENSE file in the root directory of this source tree.
512
- */var kd;function Gy(){return kd||(kd=1,process.env.NODE_ENV!=="production"&&(function(){function e(g,b){return g===b&&(g!==0||1/g===1/b)||g!==g&&b!==b}function t(g,b){u||o.startTransition===void 0||(u=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var h=b();if(!f){var v=b();s(h,v)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}v=a({inst:{value:h,getSnapshot:b}});var y=v[0].inst,C=v[1];return c(function(){y.value=h,y.getSnapshot=b,r(y)&&C({inst:y})},[g,h,b]),i(function(){return r(y)&&C({inst:y}),g(function(){r(y)&&C({inst:y})})},[g]),d(h),h}function r(g){var b=g.getSnapshot;g=g.value;try{var h=b();return!s(g,h)}catch{return!0}}function n(g,b){return b()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=p,s=typeof Object.is=="function"?Object.is:e,a=o.useState,i=o.useEffect,c=o.useLayoutEffect,d=o.useDebugValue,u=!1,f=!1,m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?n:t;vi.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:m,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),vi}var Id;function yi(){return Id||(Id=1,process.env.NODE_ENV==="production"?Vs.exports=Ry():Vs.exports=Gy()),Vs.exports}/**
512
+ */var kd;function Ky(){return kd||(kd=1,process.env.NODE_ENV!=="production"&&(function(){function e(g,b){return g===b&&(g!==0||1/g===1/b)||g!==g&&b!==b}function t(g,b){u||o.startTransition===void 0||(u=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var h=b();if(!f){var v=b();s(h,v)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}v=a({inst:{value:h,getSnapshot:b}});var y=v[0].inst,C=v[1];return c(function(){y.value=h,y.getSnapshot=b,r(y)&&C({inst:y})},[g,h,b]),i(function(){return r(y)&&C({inst:y}),g(function(){r(y)&&C({inst:y})})},[g]),d(h),h}function r(g){var b=g.getSnapshot;g=g.value;try{var h=b();return!s(g,h)}catch{return!0}}function n(g,b){return b()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=p,s=typeof Object.is=="function"?Object.is:e,a=o.useState,i=o.useEffect,c=o.useLayoutEffect,d=o.useDebugValue,u=!1,f=!1,m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?n:t;vi.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:m,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),vi}var Id;function yi(){return Id||(Id=1,process.env.NODE_ENV==="production"?Vs.exports=Gy():Vs.exports=Ky()),Vs.exports}/**
513
513
  * @license React
514
514
  * use-sync-external-store-shim/with-selector.production.js
515
515
  *
@@ -517,7 +517,7 @@ to {
517
517
  *
518
518
  * This source code is licensed under the MIT license found in the
519
519
  * LICENSE file in the root directory of this source tree.
520
- */var Dd;function Ky(){if(Dd)return gi;Dd=1;var e=p,t=yi();function r(d,u){return d===u&&(d!==0||1/d===1/u)||d!==d&&u!==u}var n=typeof Object.is=="function"?Object.is:r,o=t.useSyncExternalStore,s=e.useRef,a=e.useEffect,i=e.useMemo,c=e.useDebugValue;return gi.useSyncExternalStoreWithSelector=function(d,u,f,m,g){var b=s(null);if(b.current===null){var h={hasValue:!1,value:null};b.current=h}else h=b.current;b=i(function(){function y(E){if(!C){if(C=!0,S=E,E=m(E),g!==void 0&&h.hasValue){var L=h.value;if(g(L,E))return w=L}return w=E}if(L=w,n(S,E))return L;var A=m(E);return g!==void 0&&g(L,A)?(S=E,L):(S=E,w=A)}var C=!1,S,w,T=f===void 0?null:f;return[function(){return y(u())},T===null?void 0:function(){return y(T())}]},[u,f,m,g]);var v=o(d,b[0],b[1]);return a(function(){h.hasValue=!0,h.value=v},[v]),c(v),v},gi}var bi={};/**
520
+ */var Dd;function Yy(){if(Dd)return gi;Dd=1;var e=p,t=yi();function r(d,u){return d===u&&(d!==0||1/d===1/u)||d!==d&&u!==u}var n=typeof Object.is=="function"?Object.is:r,o=t.useSyncExternalStore,s=e.useRef,a=e.useEffect,i=e.useMemo,c=e.useDebugValue;return gi.useSyncExternalStoreWithSelector=function(d,u,f,m,g){var b=s(null);if(b.current===null){var h={hasValue:!1,value:null};b.current=h}else h=b.current;b=i(function(){function y(E){if(!C){if(C=!0,S=E,E=m(E),g!==void 0&&h.hasValue){var L=h.value;if(g(L,E))return w=L}return w=E}if(L=w,n(S,E))return L;var A=m(E);return g!==void 0&&g(L,A)?(S=E,L):(S=E,w=A)}var C=!1,S,w,T=f===void 0?null:f;return[function(){return y(u())},T===null?void 0:function(){return y(T())}]},[u,f,m,g]);var v=o(d,b[0],b[1]);return a(function(){h.hasValue=!0,h.value=v},[v]),c(v),v},gi}var bi={};/**
521
521
  * @license React
522
522
  * use-sync-external-store-shim/with-selector.development.js
523
523
  *
@@ -525,22 +525,22 @@ to {
525
525
  *
526
526
  * This source code is licensed under the MIT license found in the
527
527
  * LICENSE file in the root directory of this source tree.
528
- */var Ld;function Yy(){return Ld||(Ld=1,process.env.NODE_ENV!=="production"&&(function(){function e(d,u){return d===u&&(d!==0||1/d===1/u)||d!==d&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=p,r=yi(),n=typeof Object.is=="function"?Object.is:e,o=r.useSyncExternalStore,s=t.useRef,a=t.useEffect,i=t.useMemo,c=t.useDebugValue;bi.useSyncExternalStoreWithSelector=function(d,u,f,m,g){var b=s(null);if(b.current===null){var h={hasValue:!1,value:null};b.current=h}else h=b.current;b=i(function(){function y(E){if(!C){if(C=!0,S=E,E=m(E),g!==void 0&&h.hasValue){var L=h.value;if(g(L,E))return w=L}return w=E}if(L=w,n(S,E))return L;var A=m(E);return g!==void 0&&g(L,A)?(S=E,L):(S=E,w=A)}var C=!1,S,w,T=f===void 0?null:f;return[function(){return y(u())},T===null?void 0:function(){return y(T())}]},[u,f,m,g]);var v=o(d,b[0],b[1]);return a(function(){h.hasValue=!0,h.value=v},[v]),c(v),v},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),bi}var Od;function Zy(){return Od||(Od=1,process.env.NODE_ENV==="production"?zs.exports=Ky():zs.exports=Yy()),zs.exports}var Xy=Zy();const Jy=pi(Xy),Pd={},{useDebugValue:eb}=p,{useSyncExternalStoreWithSelector:tb}=Jy;let Nd=!1;const rb=e=>e;function nb(e,t=rb,r){(Pd?"production":void 0)!=="production"&&r&&!Nd&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Nd=!0);const n=tb(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return eb(n),n}const xd=e=>{(Pd?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?Wy(e):e,r=(n,o)=>nb(t,n,o);return Object.assign(r,t),r},ko=e=>e?xd(e):xd,Ci={key:"collection",unitPrimaryCategory:"Course Unit",unitContentType:"CourseUnit",unitLabelKey:"unit",defaultUnitName:"Untitled Unit",maxDepth:4,linkedLeavesOnly:!1,leafPrimaryCategories:[],derivedRoles:!1,competencyScoped:!1,features:{csvUpload:!0,dialcodes:!0,pageNumbers:!0,bulkUpload:!0,collaborators:!0}},ob={key:"learningPath",unitPrimaryCategory:"Level",unitContentType:"Level",unitLabelKey:"level",defaultUnitName:"Untitled Level",maxDepth:1,linkedLeavesOnly:!0,leafPrimaryCategories:["Course"],derivedRoles:!0,competencyScoped:!0,features:{csvUpload:!1,dialcodes:!1,pageNumbers:!1,bulkUpload:!1,collaborators:!1}};function sb(e){return e.config.primaryCategory==="Learning Path"?ob:Ci}const K=ko(e=>({editorConfig:null,editorMode:"edit",buttonLoaders:{saveCollection:!1,publishCollection:!1,addFromLibrary:!1,rejectCollection:!1,sourcingApproveCollection:!1,sourcingRejectCollection:!1},showPreview:!1,pageId:"collection_editor",isCurrentNodeFolder:!1,isCurrentNodeRoot:!1,isQumlPlayer:!1,isDirty:!1,lastSaved:null,formStatusMapper:{},contentFramework:null,contentTargetFWIds:null,editorProfile:Ci,rootFormConfig:null,unitFormConfig:null,childFormConfig:null,searchFormConfig:null,relationalFormConfig:null,publishChecklist:null,reviewChecklist:null,rfcChecklist:null,categoryMeta:null,setEditorConfig:t=>e({editorConfig:t}),setEditorProfile:t=>e({editorProfile:t}),setEditorMode:t=>e({editorMode:t}),setButtonLoader:(t,r)=>e(n=>({buttonLoaders:{...n.buttonLoaders,[t]:r}})),setShowPreview:t=>e({showPreview:t}),setPageId:t=>e({pageId:t}),setNodeFlags:t=>e({...t.isFolder!==void 0&&{isCurrentNodeFolder:t.isFolder},...t.isRoot!==void 0&&{isCurrentNodeRoot:t.isRoot},...t.isQuml!==void 0&&{isQumlPlayer:t.isQuml}}),setLastSaved:t=>e({lastSaved:t}),setIsDirty:t=>e({isDirty:t}),setContentFramework:(t,r)=>e({contentFramework:t,contentTargetFWIds:r}),setFormStatus:(t,r)=>e(n=>({formStatusMapper:{...n.formStatusMapper,[t]:r}})),validateAllForms:t=>{const r=K.getState().formStatusMapper,n=[...t];for(;n.length>0;){const o=n.shift();if(r[o.id]===!1)return!1;o.children&&n.push(...o.children)}return!0},setCategoryDefinition:t=>e({rootFormConfig:t.rootForm,unitFormConfig:t.unitForm,childFormConfig:t.childForm,searchFormConfig:t.searchForm,relationalFormConfig:t.relationalForm,publishChecklist:t.publishChecklist,reviewChecklist:t.reviewChecklist,rfcChecklist:t.rfcChecklist,categoryMeta:{schemaDefaults:t.schemaDefaults,frameworkMetadata:t.frameworkMetadata,sourcingSettings:t.sourcingSettings}})})),ab=Object.freeze(Object.defineProperty({__proto__:null,useEditorStore:K},Symbol.toStringTag,{value:"Module"})),fr=ko(e=>({activeModal:null,modalData:{},activeAssessmentSlot:null,openModal:(t,r={})=>e({activeModal:t,modalData:r}),closeModal:()=>e({activeModal:null,modalData:{}}),setActiveAssessmentSlot:t=>e({activeAssessmentSlot:t})})),Si={contextualEditor:{emptyStateMessage:"Select a unit from the outline to edit its details",reviewCommentLabel:"Reviewer comment:",untitledPlaceholder:"Untitled",nodeTitleAriaLabel:"Node title",dropZoneLabel:"Drop to add content to this unit"},languageSelector:{ariaLabel:"Select language"},collectionEditor:{errorBoundaryTitle:"Something went wrong",retryButton:"Retry",loadingMessage:"Loading editor...",loadErrorTitle:"Failed to load editor"},breadcrumb:{nodePathAriaLabel:"Node path",homeAriaLabel:"Home"},tabBar:{detailsTab:"Details",audienceCurriculumTab:"Audience & Curriculum",licensingTab:"Licensing",metadataSectionsAriaLabel:"Metadata sections",hasErrorsAriaLabel:"Has errors"},contentEditForm:{moveToAnotherUnitButton:"Move to another unit",collapseMetadataPanelAriaLabel:"Collapse metadata panel",expandMetadataPanelAriaLabel:"Expand metadata panel",collapseTitle:"Collapse",expandTitle:"Expand",iconAlt:"icon",contentNamePlaceholder:"Content name",keywordsLabel:"Keywords",addKeywordPlaceholder:"Add keyword and press Enter",addButton:"Add",optionalInCollectionLabel:"Optional in Collection",yesOption:"Yes",noOption:"No"},titleAppIcon:{selectAppIconAriaLabel:"Select app icon",appIconAriaLabel:"App icon",appIconAlt:"App icon",removeIconAriaLabel:"Remove icon"},unitContentList:{removeConfirm:"Remove this content from the unit?",heading:"Content in this unit",emptyTitle:"No content yet",emptyHint:"Drag from the library or click Add content",addContentAriaLabel:"Add content to unit",addContent:"Add content"},contentRow:{dragToReorderAriaLabel:"Drag to reorder",removeAriaLabel:"Remove {name}"},csvUpload:{invalidFileType:"Only .csv files are accepted.",fileTooLarge:"File size must not exceed 50 MB.",downloadSampleFailed:"Failed to download sample CSV.",processingFailed:"Upload processing failed. Please check the error rows below.",connectionLost:"Lost connection while checking status. Please try again.",uploadFailed:"Upload failed. Please check your file and try again.",statusUploading:"Uploading...",statusProcessing:"Processing...",statusDone:"Done!",statusError:"Error",titleUpdate:"Update Folder Metadata via CSV",titleCreate:"Create Folders via CSV",closeAriaLabel:"Close",dropZoneAriaLabel:"Drop CSV file here or click to browse",dropText:"Drag & drop your CSV here",dropSubtext:"or click to browse",downloadSample:"Download Sample CSV",itemsImportedSuffix:"— {count} item(s) imported",failedRowsTitle:"Failed Rows ({count})",rowHeader:"Row",nameHeader:"Name",reasonHeader:"Reason",unknownError:"Unknown error",cancel:"Cancel",uploaded:"Uploaded",upload:"Upload"},manageCollaborators:{saveFailed:"Failed to save collaborators. Please try again.",title:"Manage Collaborators",closeAriaLabel:"Close",searchUsersLabel:"Search users",searchPlaceholder:"Search by name or email...",searchingAriaLabel:"Searching...",searchResultsAriaLabel:"Search results",add:"Add",noUsersFound:"No users found.",currentCollaborators:"Current Collaborators",noCollaboratorsYet:"No collaborators added yet.",remove:"Remove",saveSuccess:"Collaborators saved successfully.",cancel:"Cancel",save:"Save"},sparkMetaForm:{shuffleEnabledMessage:"Shuffling is enabled for this question set.",noFieldsMessage:"No fields configured for this tab."},appIconField:{requiredError:"{field} is required",selectIconAriaLabel:"Select app icon",iconAlt:"App icon",selectIconLabel:"Select icon",removeIconAriaLabel:"Remove app icon",removeLabel:"Remove"},appIconPickerModal:{dialogAriaLabel:"Select App Icon",title:"Select App Icon",closeAriaLabel:"Close",myImagesTab:"My Images",allImagesTab:"All Images",uploadTab:"Upload",searchPlaceholder:"Search images…",loadingText:"Loading…",noImagesFound:"No images found",noThumbnailText:"IMG",loadMoreButton:"Load More",previewAlt:"Preview",dropZoneText:"Drag & drop or click to browse",acceptedTypesInfo:"{types} · max {size} MB",cancelButton:"Cancel",uploadingText:"Uploading…",uploadAndUseButton:"Upload & Use",useSelectedButton:"Use Selected",invalidFileTypeError:"Only {types} files are accepted.",fileTooLargeError:"Image must be under {size} MB.",uploadFailedError:"Upload failed."},chipGroupField:{addPlaceholder:"Add…",addButtonLabel:"Add"},dateTimeField:{requiredError:"{field} is required"},dialcodeInputField:{requiredError:"{field} is required",enterCodeMessage:"Enter a dial code to validate.",validMessage:"Dial code is valid.",notFoundMessage:"Dial code not found.",validationFailedMessage:"Validation failed. Please try again.",placeholderExample:"e.g. A1B2C3",validateAriaLabel:"Validate dial code",validatingLabel:"Validating…",validateButtonLabel:"Validate"},keywordSuggestField:{requiredError:"{field} is required",inputPlaceholder:"Type and press Enter or comma…"},licenseSelectField:{requiredError:"{field} is required",selectPlaceholder:"Select license…"},multiSelectField:{requiredError:"{field} is required",selectedCountSuffix:"selected",selectPlaceholder:"Select…",noOptionsMessage:"No options"},nestedSelectField:{requiredError:"{field} is required",selectPlaceholder:"Select…"},radioField:{requiredError:"{field} is required"},selectField:{requiredError:"{field} is required",selectPlaceholder:"Select…",noOptionsMessage:"No options"},textField:{requiredError:"{field} is required",maxLengthError:"Max {max} characters"},assetBrowser:{dialogAriaLabel:"Asset Browser",title:"Asset Browser",closeAriaLabel:"Close",browseTab:"Browse",uploadTab:"Upload",searchPlaceholder:"Search assets...",searchButton:"Search",loadingMessage:"Loading...",uploadingMessage:"Uploading...",chooseFileButton:"Choose file to upload"},resourceReorderDialog:{dialogAriaLabel:"Move resource",moveHeaderPrefix:"Move",closeAriaLabel:"Close",selectUnitHint:"Select a unit to move this content to:",noUnitsAvailable:"No other units available",cancelButton:"Cancel",moveButton:"Move here"},assignPageNumber:{dialogAriaLabel:"Assign Page Numbers",title:"Assign Page Numbers",closeAriaLabel:"Close",emptyState:"No content items found in this collection.",contentColumnHeader:"Content",pageNumberColumnHeader:"Page Number",cancelButton:"Cancel",saveButton:"Save"},confirmDialog:{title:"Confirm deletion",confirmButton:"Confirm",cancelButton:"Cancel",closeAriaLabel:"Close"},publishChecklist:{publishTitlePrefix:"Publish",closeAriaLabel:"Close",confirmPublishPrefix:"Are you sure you want to publish this",checklistInstructions:"Please confirm that ALL the following items are verified (by ticking the check-boxes) before you can publish:",noButton:"No",yesButton:"Yes"},qualityParamsModal:{reviewQualityTitle:"Review Quality",rejectContentTitle:"Reject Content",closeAriaLabel:"Close",qualityScoreLabel:"Quality Score",scorePoorLabel:"0 — Poor",scoreExcellentLabel:"10 — Excellent",commentLabel:"Comment",optionalLabel:"(optional)",commentPlaceholder:"Add any notes for the content creator…",rejectionReasonLabel:"Rejection Reason",rejectReasonPlaceholder:"Describe why this content is being rejected…",rejectionRequiredMessage:"A rejection reason is required.",cancelButton:"Cancel",approveButton:"Approve",rejectButton:"Reject"},unsavedChangesModal:{title:"Unsaved changes",closeAriaLabel:"Close",bodyMessage:"You have unsaved changes. Would you like to save them before leaving?",cancelButton:"Cancel",discardButton:"Discard",saveButton:"Save"},filterChips:{contentTypeFiltersAriaLabel:"Content type filters"},libraryCard:{alreadyAddedAriaLabel:"Already added",alreadyAddedTitle:"Already added to this collection",addItemAriaLabel:"Add {name} to unit",addToUnitTitle:"Add to unit",selectUnitToAddTitle:"Select a unit to add",draftOnlyTitle:"Only Draft content can be added"},libraryDock:{selectUnitFirstToast:"Select a unit first",selectUnitFromOutlineToast:"Select a unit from the outline to add content — resources cannot be added directly to the course.",itemAlreadyAddedToast:'"{name}" is already in this collection',itemAddedToast:'Added "{name}"',collapseLibraryPanelAriaLabel:"Collapse library panel",collapseLibraryTitle:"Collapse library",headerTitle:"Library",searchPlaceholder:"Search content…",searchAriaLabel:"Search library",sortAZAriaLabel:"Sort: A–Z (click for Recent)",sortRecentAriaLabel:"Sort: Recent (click for A–Z)",sortAZTitle:"A–Z",sortRecentTitle:"Recent",toggleAdvancedFiltersAriaLabel:"Toggle advanced filters",advancedFiltersTitle:"Advanced filters",libraryContentAriaLabel:"Library content",loadMoreAriaLabel:"Load more content",loadingText:"Loading…",loadMoreText:"Load More",noContentFound:"No content found",tryDifferentSearch:"Try a different search or filter"},libraryFilterPanel:{boardLabel:"Board",mediumLabel:"Medium",classLabel:"Class",subjectLabel:"Subject",primaryCategoryLabel:"Primary Category",filterLibraryAriaLabel:"Filter library",filtersHeaderTitle:"Filters",closeFiltersAriaLabel:"Close filters",resetButton:"Reset",applyButton:"Apply"},libraryPreviewPanel:{contentPreviewAriaLabel:"Content preview",closePreviewAriaLabel:"Close preview",addToUnitButton:"+ Add to Unit"},outlineTree:{maxDepthReachedToast:"Maximum depth reached",downloadCsvFailedToast:"Failed to download CSV",outlineRefreshedToast:"Course outline refreshed.",outlineRefreshFailedToast:"Outline could not be refreshed automatically. Please reload the page.",moreOptionsAriaLabel:"More options",moreOptionsTitle:"More options",foldersExistTitle:'Folders already exist — use "Update" instead',createFoldersCsvButton:"Create folders using csv file",noFoldersYetTitle:'No folders yet — use "Create" first',downloadFoldersCsvButton:"Download folders as csv file",updateFoldersCsvButton:"Update folder metadata using csv file",expandOutlineAriaLabel:"Expand outline",collapseOutlineAriaLabel:"Collapse outline",addUnitButton:"Add Unit",addSubunitButton:"Add Sub-unit"},treeNode:{expandAriaLabel:"Expand",collapseAriaLabel:"Collapse",dropHereLabel:"Drop here",nodeOptionsAriaLabel:"Node options",renameMenuItem:"Rename",addSubunitMenuItem:"Add sub-unit",addSiblingMenuItem:"Add Sibling",deleteMenuItem:"Delete"},contentPlayer:{mimeLabelVideo:"Video",mimeLabelAudio:"Audio",mimeLabelPdf:"PDF",mimeLabelEpub:"ePub",mimeLabelEcml:"ECML",mimeLabelH5p:"H5P",mimeLabelScorm:"SCORM",mimeLabelOther:"Content",infoFieldAuthor:"Author",infoFieldLicense:"License",infoFieldLanguage:"Language",infoFieldClass:"Class",infoFieldSubject:"Subject",infoFieldType:"Type",loadingPreview:"Loading preview…",previewPlayerUnavailable:"Preview player unavailable. Check that /content/preview is reachable.",failedToInitializePlayer:"Failed to initialize the content player.",previewPlayerLoadFailed:"Preview player could not be loaded.",unableToLoadQuestionset:"Unable to load questionset:",parentQuestionsetNotResolved:"Could not resolve the parent questionset for this question.",questionNotFoundInQuestionset:"Question not found in the questionset."},dialcodePanel:{title:"QR Code (Dialcode)",invalidFormatError:"Invalid DIAL code format. Use uppercase letters and digits only (e.g. A1B2C3).",duplicateDialcodeError:'DIAL code "{code}" is already linked to another node in this collection.',dialcodeNotFoundError:"Dialcode not found. Please enter a valid code.",linkFailedError:"Failed to link dialcode. Please try again.",unlinkFailedError:"Failed to remove dialcode. Please try again.",qrCodeAltPrefix:"QR code for",linkedCodeLabel:"Linked code:",removeButton:"Remove",noCodeLinkedMessage:"No QR code linked to this content.",linkManuallyLabel:"Link manually",dialcodeInputPlaceholder:"Enter dialcode (e.g. A1B2C3)",dialcodeInputAriaLabel:"Dialcode input",linkButton:"Link",linkedSuccessMessage:"Dialcode linked successfully."},progressStatus:{unitsAddedLabel:"Units added",contentItemsLabel:"Content items",progressLabel:"Progress"},splitBuilderShell:{dropOntoUnitError:"Drop onto a unit to add content",dropOntoCourseError:"Drop content onto a unit, not directly on the course.",alreadyInCollectionError:'"{name}" is already in this collection',addedToUnitSuccess:'Added "{name}" to unit',fillRequiredMetadataError:"Please fill the required metadata",outlineAriaLabel:"Course outline",showOutlineTitle:"Show outline",editorAriaLabel:"Content editor",libraryAriaLabel:"Content library",showLibraryTitle:"Show library"},topbar:{draftStatusFallback:"Draft",backAriaLabel:"Go back",statusAriaLabelPrefix:"Status:",savingIndicator:"Saving…",unsavedIndicator:"Unsaved",savedIndicatorPrefix:"Saved",fillRequiredFieldsTooltip:"Fill all required fields before saving",saveAsDraftButton:"Save as Draft",sendForReviewButton:"Send for review",collaboratorsLabel:"Collaborators",qrCodesLabel:"QR Codes",generatingEllipsis:"Generating…",generateQrCodesMenuItem:"Generate QR Codes",downloadingEllipsis:"Downloading…",downloadQrCodesMenuItem:"Download QR Codes",publishButton:"Publish",requestForChangesButton:"Request for Changes",approveButton:"Approve",qrGenerationStartedToast:'QR Codes generation started. Use "Download QR Codes" once ready.',qrGenerationFailedToast:"Failed to generate QR Codes. Please try again.",qrCodesNotGeneratedToast:"No QR codes generated yet. Generate QR Codes first.",qrGenerationInProgressToast:"QR code image generation is in progress. Please try downloading after some time.",qrCodesNotReadyToast:"QR Codes not ready yet. Please wait and try again.",qrCodesDownloadedToast:"QR codes downloaded.",qrCodesDownloadFailedToast:"Failed to download QR Codes.",requestChangesTitle:"Request Changes",changesRequestedLabel:"Changes requested",describeChangesPlaceholder:"Describe the changes the author needs to make"},reviewCommentModal:{closeAriaLabel:"Close",fillCommentsError:"Fill comments",cancelButton:"Cancel"},confirmReviewModal:{closeAriaLabel:"Close",title:"Accepting Terms & Conditions",agreementTextPart1:"I agree that by submitting / publishing this Content, I confirm that this Content complies with prescribed guidelines, including the Terms of Use and Content Policy and that I consent to publish it under the",creativeCommonsLinkText:"Creative Commons Framework",agreementTextPart2:"in accordance with the",contentPolicyText:"Content Policy",agreementTextPart3:". I have made sure that I do not violate others' copyright or privacy rights.",cancelButton:"Cancel",submitButton:"Submit"},generateQRModal:{closeAriaLabel:"Close",title:"Generate QR Codes",numberOfCodesLabel:"Number of QR Codes",countPlaceholder:"Enter number (2–250)",countRangeError:"Enter a number between 2 and 250.",cancelButton:"Cancel",generateButton:"Generate"},chip:{remove:"Remove"},dropZone:{dropHere:"Drop here"},spinner:{loading:"Loading"},learningPath:{profileBadgeLabel:"Learning Path",pathStructureLabel:"Path Structure",addLevelButton:"Add Level",levelNumberPrefix:"Level {n}",priorAssessmentLabel:"Prior Assessment",priorAssessmentHint:"Always required · not a level",outcomeAssessmentLabel:"Outcome Assessment",outcomeAssessmentHint:"Confirms outcome · not a level",skillCheckBadge:"Skill check",outcomeCheckBadge:"Outcome check",assessmentCourseMeta:"Course · Question set only",addAssessmentSlotButton:"Add {label} — a course with only a question set",requiredSlotBadge:"Required",removeAssessmentSlotButton:"Remove",deletePriorAssessmentConfirm:"Deleting the Prior Assessment removes the score this path's Adaptive skips are based on. Continue?",deleteAssessmentSlotConfirm:"Remove this assessment course from the path?",deleteLevelConfirm:'Delete "{name}" and everything in it?',deleteCourseConfirm:"Remove this course from the path?",deleteMultipleConfirm:"Delete {count} selected items from the path?",courseNameUnavailable:"Course details unavailable",notAssessmentCourseToast:`"{name}" isn't a question-set-only course, so it can't be used as an assessment.`,bothSlotsFilledToast:"Both Prior and Outcome Assessment slots are already filled.",assessmentCheckFailedToast:"Could not verify this course. Please try again.",skillsHeading:"Skills",skillsOutOfScopeWarning:"Out of scope, please re-select: {skills}",skillsUncoveredWarning:"No course covers these yet: {skills}",skillUncoveredPillTitle:"No linked course is tagged with this skill yet",searchSkillsPlaceholder:"Search skills",noSkillsAvailable:"No skills available yet",noMatchingSkills:"No matching skills",noSkillsSelectedYet:"No skills selected",removeSkillAriaLabel:"Remove {skill}",skillScopeFromPriorNote:"Pick which skills — from the Prior Assessment — this level builds. The Library filters courses to these skills.",skillScopeManualNote:"No Prior Assessment yet, so pick from the general skill catalog. The Library filters courses to these skills.",skillsCoveredHeading:"Skills covered",skillsCoveredDescription:"All skills tagged across this path's Prior Assessment, levels, and Outcome Assessment.",noSkillsYet:"No skills yet — add courses to see skills here.",levelCountLabel:"{count} level",levelCountLabelPlural:"{count} levels",courseCountLabel:"{count} course",courseCountLabelPlural:"{count} courses",backToPathButton:"Back to path",backToLevelButton:"Back to {label}",courseDetailsLoading:"Loading course details…",courseDetailsEmpty:"This course has no units yet.",courseDetailsError:"Could not load course details.",courseDetailsCardTitle:"Course details",courseTitleFieldLabel:"Title",courseDescriptionFieldLabel:"Description",noCourseDescriptionPlaceholder:"No description available.",unitsSectionLabel:"Units",unitsSectionDescription:"Units group related content; each content item is tagged with the skills it builds.",unitTopicsFieldLabel:"Topics",contentCountLabel:"{count} content",contentCountLabelPlural:"{count} contents",courseUnitTopicsLabel:"{count} topic",courseUnitTopicsLabelPlural:"{count} topics",verifyingAssessmentCourses:"Verifying assessment courses…",resolveBeforePublishing:"Resolve these before publishing:",resolveBeforeSendingForReview:"Resolve these before sending for review:",assessmentsCardHeading:"Prior & outcome assessments",assessmentsCardDescription:"Add the question-set-only courses that open and close this path.",assessmentNotAddedYet:"Not added yet — pick a question-set-only course from the Library.",viewCourseMenuItem:"View",priorAssessmentExplainerTitle:"Why this can't be skipped",priorAssessmentExplainerBody:"This question set's score is what every level reads to decide a skip — there's nothing to compare against yet, so it always runs in full.",priorAssessmentPurposeLabel:"Sets the skill baseline",outcomeAssessmentExplainerTitle:"Closes the path",outcomeAssessmentExplainerBody:"Passing this question set is what certifies the skill gain for the whole path — its score is what appears on the learner's certificate.",outcomeUnlocksHint:"Unlocks after the last level",assessmentCourseSectionTitle:"Course",assessmentCourseSectionDescription:"A single course whose only content is a question set — no other content types belong here.",libraryOpenLevelToAdd:"Open a level to add",libraryAddToLevel:"Add to {level}",libraryAddPriorAssessmentCourse:"Add Prior Assessment course",libraryAddOutcomeAssessmentCourse:"Add Outcome Assessment course",policyStrictLabel:"Strict",policyStrictDescription:"Every learner completes every level, in order — regardless of prior assessment score.",policyAdaptiveLabel:"Adaptive",policyAdaptiveDescriptionPre:"A level can be skipped, but only when the learner's score on the Prior Assessment",policyAdaptiveDescriptionPost:" clears its waiver threshold.",policyPriorLearningLabel:"Prior learning",policyPriorLearningDescription:"Skips can also draw on skills the learner already holds — a verified certificate or prior course — not the assessment alone.",selectLevelFirstToast:"Select a level first",selectLevelFromOutlineToast:"Open a level in the path structure to add courses — courses cannot be added to the path itself or under another course.",selectCurriculumFirstToast:"Select a Curriculum for this path before adding courses.",noCurriculumEmptyTitle:"No Curriculum selected",noCurriculumEmptyHint:"Select a Curriculum for this path to browse courses.",noSkillsEmptyTitle:"No skills selected",noSkillsEmptyHint:"Select skills for this level to see matching courses.",itemAlreadyInPathToast:'"{name}" is already in this learning path',addedToLevelSuccess:'Added "{name}" to level',dropOntoLevelError:"Drop onto a level to add a course",dropOntoPathError:"Drop courses onto a level, not directly on the learning path.",priorSlotFilledToast:"The Prior Assessment already has a course — remove it before adding a different one.",outcomeSlotFilledToast:"The Outcome Assessment already has a course — remove it before adding a different one.",coursesRemovedFrameworkChangeToast:"{count} course(s) tagged to a different curriculum were removed from this path.",levelSkillsResetFrameworkChangeToast:"{count} Level(s) had their selected skills cleared — they don't apply to the new curriculum.",priorAssessmentNarrowedScopeToast:"The Prior Assessment narrowed the skill scope — {count} Level(s) now have skills outside it."}},ib={contextualEditor:{emptyStateMessage:"اختر وحدة من المخطط التفصيلي لتحرير تفاصيلها",reviewCommentLabel:"تعليق المراجع:",untitledPlaceholder:"بدون عنوان",nodeTitleAriaLabel:"عنوان العنصر",dropZoneLabel:"أفلت هنا لإضافة محتوى إلى هذه الوحدة"},languageSelector:{ariaLabel:"اختيار اللغة"},collectionEditor:{errorBoundaryTitle:"حدث خطأ ما",retryButton:"إعادة المحاولة",loadingMessage:"جارٍ تحميل المحرر...",loadErrorTitle:"فشل تحميل المحرر"},breadcrumb:{nodePathAriaLabel:"مسار العنصر",homeAriaLabel:"الصفحة الرئيسية"},tabBar:{detailsTab:"التفاصيل",audienceCurriculumTab:"الجمهور والمنهج",licensingTab:"الترخيص",metadataSectionsAriaLabel:"أقسام البيانات الوصفية",hasErrorsAriaLabel:"يحتوي على أخطاء"},contentEditForm:{moveToAnotherUnitButton:"نقل إلى وحدة أخرى",collapseMetadataPanelAriaLabel:"طي لوحة البيانات الوصفية",expandMetadataPanelAriaLabel:"توسيع لوحة البيانات الوصفية",collapseTitle:"طي",expandTitle:"توسيع",iconAlt:"أيقونة",contentNamePlaceholder:"اسم المحتوى",keywordsLabel:"الكلمات المفتاحية",addKeywordPlaceholder:"أضف كلمة مفتاحية واضغط Enter",addButton:"إضافة",optionalInCollectionLabel:"اختياري في المجموعة",yesOption:"نعم",noOption:"لا"},titleAppIcon:{selectAppIconAriaLabel:"اختيار أيقونة التطبيق",appIconAriaLabel:"أيقونة التطبيق",appIconAlt:"أيقونة التطبيق",removeIconAriaLabel:"إزالة الأيقونة"},unitContentList:{removeConfirm:"هل تريد إزالة هذا المحتوى من الوحدة؟",heading:"المحتوى في هذه الوحدة",emptyTitle:"لا يوجد محتوى بعد",emptyHint:"اسحب من المكتبة أو انقر فوق إضافة محتوى",addContentAriaLabel:"إضافة محتوى إلى الوحدة",addContent:"إضافة محتوى"},contentRow:{dragToReorderAriaLabel:"اسحب لإعادة الترتيب",removeAriaLabel:"إزالة {name}"},csvUpload:{invalidFileType:"يُقبل فقط ملفات .csv.",fileTooLarge:"يجب ألا يتجاوز حجم الملف 50 ميجابايت.",downloadSampleFailed:"فشل تنزيل نموذج ملف CSV.",processingFailed:"فشلت معالجة التحميل. يرجى التحقق من صفوف الأخطاء أدناه.",connectionLost:"انقطع الاتصال أثناء التحقق من الحالة. يرجى المحاولة مرة أخرى.",uploadFailed:"فشل التحميل. يرجى التحقق من الملف والمحاولة مرة أخرى.",statusUploading:"جارٍ التحميل...",statusProcessing:"جارٍ المعالجة...",statusDone:"تم!",statusError:"خطأ",titleUpdate:"تحديث بيانات المجلدات الوصفية عبر CSV",titleCreate:"إنشاء مجلدات عبر CSV",closeAriaLabel:"إغلاق",dropZoneAriaLabel:"أفلت ملف CSV هنا أو انقر للتصفح",dropText:"اسحب وأفلت ملف CSV هنا",dropSubtext:"أو انقر للتصفح",downloadSample:"تنزيل نموذج CSV",itemsImportedSuffix:"— تم استيراد {count} عنصر (عناصر)",failedRowsTitle:"الصفوف الفاشلة ({count})",rowHeader:"الصف",nameHeader:"الاسم",reasonHeader:"السبب",unknownError:"خطأ غير معروف",cancel:"إلغاء",uploaded:"تم التحميل",upload:"تحميل"},manageCollaborators:{saveFailed:"فشل حفظ المتعاونين. يرجى المحاولة مرة أخرى.",title:"إدارة المتعاونين",closeAriaLabel:"إغلاق",searchUsersLabel:"البحث عن المستخدمين",searchPlaceholder:"البحث بالاسم أو البريد الإلكتروني...",searchingAriaLabel:"جارٍ البحث...",searchResultsAriaLabel:"نتائج البحث",add:"إضافة",noUsersFound:"لم يتم العثور على مستخدمين.",currentCollaborators:"المتعاونون الحاليون",noCollaboratorsYet:"لم تتم إضافة أي متعاونين بعد.",remove:"إزالة",saveSuccess:"تم حفظ المتعاونين بنجاح.",cancel:"إلغاء",save:"حفظ"},sparkMetaForm:{shuffleEnabledMessage:"تم تفعيل الترتيب العشوائي لهذه المجموعة من الأسئلة.",noFieldsMessage:"لا توجد حقول مُهيَّأة لهذا التبويب."},appIconField:{requiredError:"{field} مطلوب",selectIconAriaLabel:"اختيار أيقونة التطبيق",iconAlt:"أيقونة التطبيق",selectIconLabel:"اختيار أيقونة",removeIconAriaLabel:"إزالة أيقونة التطبيق",removeLabel:"إزالة"},appIconPickerModal:{dialogAriaLabel:"اختيار أيقونة التطبيق",title:"اختيار أيقونة التطبيق",closeAriaLabel:"إغلاق",myImagesTab:"صوري",allImagesTab:"جميع الصور",uploadTab:"تحميل",searchPlaceholder:"البحث في الصور…",loadingText:"جارٍ التحميل…",noImagesFound:"لم يتم العثور على صور",noThumbnailText:"صورة",loadMoreButton:"تحميل المزيد",previewAlt:"معاينة",dropZoneText:"اسحب وأفلت أو انقر للتصفح",acceptedTypesInfo:"{types} · بحد أقصى {size} ميجابايت",cancelButton:"إلغاء",uploadingText:"جارٍ التحميل…",uploadAndUseButton:"تحميل واستخدام",useSelectedButton:"استخدام المحدد",invalidFileTypeError:"يُقبل فقط ملفات {types}.",fileTooLargeError:"يجب أن يكون حجم الصورة أقل من {size} ميجابايت.",uploadFailedError:"فشل التحميل."},chipGroupField:{addPlaceholder:"إضافة…",addButtonLabel:"إضافة"},dateTimeField:{requiredError:"{field} مطلوب"},dialcodeInputField:{requiredError:"{field} مطلوب",enterCodeMessage:"أدخل رمز الطلب للتحقق منه.",validMessage:"رمز الطلب صالح.",notFoundMessage:"رمز الطلب غير موجود.",validationFailedMessage:"فشل التحقق. يرجى المحاولة مرة أخرى.",placeholderExample:"مثال: A1B2C3",validateAriaLabel:"التحقق من رمز الطلب",validatingLabel:"جارٍ التحقق…",validateButtonLabel:"تحقق"},keywordSuggestField:{requiredError:"{field} مطلوب",inputPlaceholder:"اكتب واضغط Enter أو فاصلة…"},licenseSelectField:{requiredError:"{field} مطلوب",selectPlaceholder:"اختر ترخيصًا…"},multiSelectField:{requiredError:"{field} مطلوب",selectedCountSuffix:"محدد",selectPlaceholder:"اختر…",noOptionsMessage:"لا توجد خيارات"},nestedSelectField:{requiredError:"{field} مطلوب",selectPlaceholder:"اختر…"},radioField:{requiredError:"{field} مطلوب"},selectField:{requiredError:"{field} مطلوب",selectPlaceholder:"اختر…",noOptionsMessage:"لا توجد خيارات"},textField:{requiredError:"{field} مطلوب",maxLengthError:"الحد الأقصى {max} حرفًا"},assetBrowser:{dialogAriaLabel:"متصفح الأصول",title:"متصفح الأصول",closeAriaLabel:"إغلاق",browseTab:"تصفح",uploadTab:"تحميل",searchPlaceholder:"البحث في الأصول...",searchButton:"بحث",loadingMessage:"جارٍ التحميل...",uploadingMessage:"جارٍ التحميل...",chooseFileButton:"اختر ملفًا للتحميل"},resourceReorderDialog:{dialogAriaLabel:"نقل المورد",moveHeaderPrefix:"نقل",closeAriaLabel:"إغلاق",selectUnitHint:"اختر وحدة لنقل هذا المحتوى إليها:",noUnitsAvailable:"لا توجد وحدات أخرى متاحة",cancelButton:"إلغاء",moveButton:"نقل إلى هنا"},assignPageNumber:{dialogAriaLabel:"تعيين أرقام الصفحات",title:"تعيين أرقام الصفحات",closeAriaLabel:"إغلاق",emptyState:"لم يتم العثور على عناصر محتوى في هذه المجموعة.",contentColumnHeader:"المحتوى",pageNumberColumnHeader:"رقم الصفحة",cancelButton:"إلغاء",saveButton:"حفظ"},confirmDialog:{title:"تأكيد الحذف",confirmButton:"تأكيد",cancelButton:"إلغاء",closeAriaLabel:"إغلاق"},publishChecklist:{publishTitlePrefix:"نشر",closeAriaLabel:"إغلاق",confirmPublishPrefix:"هل أنت متأكد من رغبتك في نشر هذا",checklistInstructions:"يرجى تأكيد التحقق من جميع العناصر التالية (بتحديد مربعات الاختيار) قبل أن تتمكن من النشر:",noButton:"لا",yesButton:"نعم"},qualityParamsModal:{reviewQualityTitle:"مراجعة الجودة",rejectContentTitle:"رفض المحتوى",closeAriaLabel:"إغلاق",qualityScoreLabel:"درجة الجودة",scorePoorLabel:"0 — ضعيف",scoreExcellentLabel:"10 — ممتاز",commentLabel:"تعليق",optionalLabel:"(اختياري)",commentPlaceholder:"أضف أي ملاحظات لمنشئ المحتوى…",rejectionReasonLabel:"سبب الرفض",rejectReasonPlaceholder:"اذكر سبب رفض هذا المحتوى…",rejectionRequiredMessage:"سبب الرفض مطلوب.",cancelButton:"إلغاء",approveButton:"قبول",rejectButton:"رفض"},unsavedChangesModal:{title:"تغييرات غير محفوظة",closeAriaLabel:"إغلاق",bodyMessage:"لديك تغييرات غير محفوظة. هل تريد حفظها قبل المغادرة؟",cancelButton:"إلغاء",discardButton:"تجاهل",saveButton:"حفظ"},filterChips:{contentTypeFiltersAriaLabel:"مرشحات نوع المحتوى"},libraryCard:{alreadyAddedAriaLabel:"تمت إضافته مسبقًا",alreadyAddedTitle:"تمت إضافته مسبقًا إلى هذه المجموعة",addItemAriaLabel:"إضافة {name} إلى الوحدة",addToUnitTitle:"إضافة إلى الوحدة",selectUnitToAddTitle:"اختر وحدة للإضافة إليها",draftOnlyTitle:"يمكن إضافة المحتوى المسودة فقط"},libraryDock:{selectUnitFirstToast:"اختر وحدة أولاً",selectUnitFromOutlineToast:"اختر وحدة من المخطط التفصيلي لإضافة محتوى — لا يمكن إضافة الموارد مباشرة إلى الدورة.",itemAlreadyAddedToast:'"{name}" موجود مسبقًا في هذه المجموعة',itemAddedToast:'تمت إضافة "{name}"',collapseLibraryPanelAriaLabel:"طي لوحة المكتبة",collapseLibraryTitle:"طي المكتبة",headerTitle:"المكتبة",searchPlaceholder:"البحث في المحتوى…",searchAriaLabel:"البحث في المكتبة",sortAZAriaLabel:"الترتيب: أ–ي (انقر للأحدث)",sortRecentAriaLabel:"الترتيب: الأحدث (انقر لـ أ–ي)",sortAZTitle:"أ–ي",sortRecentTitle:"الأحدث",toggleAdvancedFiltersAriaLabel:"تبديل المرشحات المتقدمة",advancedFiltersTitle:"المرشحات المتقدمة",libraryContentAriaLabel:"محتوى المكتبة",loadMoreAriaLabel:"تحميل المزيد من المحتوى",loadingText:"جارٍ التحميل…",loadMoreText:"تحميل المزيد",noContentFound:"لم يتم العثور على محتوى",tryDifferentSearch:"جرّب بحثًا أو مرشحًا مختلفًا"},libraryFilterPanel:{boardLabel:"المجلس التعليمي",mediumLabel:"لغة التدريس",classLabel:"الصف",subjectLabel:"المادة",primaryCategoryLabel:"الفئة الأساسية",filterLibraryAriaLabel:"تصفية المكتبة",filtersHeaderTitle:"المرشحات",closeFiltersAriaLabel:"إغلاق المرشحات",resetButton:"إعادة تعيين",applyButton:"تطبيق"},libraryPreviewPanel:{contentPreviewAriaLabel:"معاينة المحتوى",closePreviewAriaLabel:"إغلاق المعاينة",addToUnitButton:"+ إضافة إلى الوحدة"},outlineTree:{maxDepthReachedToast:"تم الوصول إلى الحد الأقصى للعمق",downloadCsvFailedToast:"فشل تنزيل ملف CSV",outlineRefreshedToast:"تم تحديث مخطط الدورة.",outlineRefreshFailedToast:"تعذّر تحديث المخطط التفصيلي تلقائيًا. يرجى إعادة تحميل الصفحة.",moreOptionsAriaLabel:"خيارات إضافية",moreOptionsTitle:"خيارات إضافية",foldersExistTitle:'المجلدات موجودة مسبقًا — استخدم "تحديث" بدلاً من ذلك',createFoldersCsvButton:"إنشاء مجلدات باستخدام ملف csv",noFoldersYetTitle:'لا توجد مجلدات بعد — استخدم "إنشاء" أولاً',downloadFoldersCsvButton:"تنزيل المجلدات كملف csv",updateFoldersCsvButton:"تحديث بيانات المجلدات الوصفية باستخدام ملف csv",expandOutlineAriaLabel:"توسيع المخطط التفصيلي",collapseOutlineAriaLabel:"طي المخطط التفصيلي",addUnitButton:"إضافة وحدة",addSubunitButton:"إضافة وحدة فرعية"},treeNode:{expandAriaLabel:"توسيع",collapseAriaLabel:"طي",dropHereLabel:"أفلت هنا",nodeOptionsAriaLabel:"خيارات العنصر",renameMenuItem:"إعادة تسمية",addSubunitMenuItem:"إضافة وحدة فرعية",addSiblingMenuItem:"إضافة عنصر مماثل",deleteMenuItem:"حذف"},contentPlayer:{mimeLabelVideo:"فيديو",mimeLabelAudio:"صوت",mimeLabelPdf:"PDF",mimeLabelEpub:"ePub",mimeLabelEcml:"ECML",mimeLabelH5p:"H5P",mimeLabelScorm:"SCORM",mimeLabelOther:"محتوى",infoFieldAuthor:"المؤلف",infoFieldLicense:"الترخيص",infoFieldLanguage:"اللغة",infoFieldClass:"الصف",infoFieldSubject:"المادة",infoFieldType:"النوع",loadingPreview:"جارٍ تحميل المعاينة…",previewPlayerUnavailable:"مشغّل المعاينة غير متاح. تحقق من إمكانية الوصول إلى /content/preview.",failedToInitializePlayer:"فشل تهيئة مشغّل المحتوى.",previewPlayerLoadFailed:"تعذّر تحميل مشغّل المعاينة.",unableToLoadQuestionset:"تعذّر تحميل مجموعة الأسئلة:",parentQuestionsetNotResolved:"تعذّر تحديد مجموعة الأسئلة الرئيسية لهذا السؤال.",questionNotFoundInQuestionset:"لم يتم العثور على السؤال في مجموعة الأسئلة."},dialcodePanel:{title:"رمز الاستجابة السريعة (رمز الطلب)",invalidFormatError:"تنسيق رمز DIAL غير صالح. استخدم الأحرف الكبيرة والأرقام فقط (مثال: A1B2C3).",duplicateDialcodeError:'رمز DIAL "{code}" مرتبط مسبقًا بعنصر آخر في هذه المجموعة.',dialcodeNotFoundError:"رمز الطلب غير موجود. يرجى إدخال رمز صالح.",linkFailedError:"فشل ربط رمز الطلب. يرجى المحاولة مرة أخرى.",unlinkFailedError:"فشلت إزالة رمز الطلب. يرجى المحاولة مرة أخرى.",qrCodeAltPrefix:"رمز الاستجابة السريعة لـ",linkedCodeLabel:"الرمز المرتبط:",removeButton:"إزالة",noCodeLinkedMessage:"لا يوجد رمز استجابة سريعة مرتبط بهذا المحتوى.",linkManuallyLabel:"الربط يدويًا",dialcodeInputPlaceholder:"أدخل رمز الطلب (مثال: A1B2C3)",dialcodeInputAriaLabel:"إدخال رمز الطلب",linkButton:"ربط",linkedSuccessMessage:"تم ربط رمز الطلب بنجاح."},progressStatus:{unitsAddedLabel:"الوحدات المضافة",contentItemsLabel:"عناصر المحتوى",progressLabel:"التقدّم"},splitBuilderShell:{dropOntoUnitError:"أفلت على وحدة لإضافة محتوى",dropOntoCourseError:"أفلت المحتوى على وحدة، وليس مباشرة على الدورة.",alreadyInCollectionError:'"{name}" موجود مسبقًا في هذه المجموعة',addedToUnitSuccess:'تمت إضافة "{name}" إلى الوحدة',fillRequiredMetadataError:"يرجى تعبئة البيانات الوصفية المطلوبة",outlineAriaLabel:"مخطط الدورة",showOutlineTitle:"إظهار المخطط التفصيلي",editorAriaLabel:"محرر المحتوى",libraryAriaLabel:"مكتبة المحتوى",showLibraryTitle:"إظهار المكتبة"},topbar:{draftStatusFallback:"مسودة",backAriaLabel:"رجوع",statusAriaLabelPrefix:"الحالة:",savingIndicator:"جارٍ الحفظ…",unsavedIndicator:"غير محفوظ",savedIndicatorPrefix:"تم الحفظ",fillRequiredFieldsTooltip:"عبّئ جميع الحقول المطلوبة قبل الحفظ",saveAsDraftButton:"حفظ كمسودة",sendForReviewButton:"إرسال للمراجعة",collaboratorsLabel:"المتعاونون",qrCodesLabel:"رموز الاستجابة السريعة",generatingEllipsis:"جارٍ الإنشاء…",generateQrCodesMenuItem:"إنشاء رموز استجابة سريعة",downloadingEllipsis:"جارٍ التنزيل…",downloadQrCodesMenuItem:"تنزيل رموز الاستجابة السريعة",publishButton:"نشر",requestForChangesButton:"طلب إجراء تغييرات",approveButton:"قبول",qrGenerationStartedToast:'بدأ إنشاء رموز الاستجابة السريعة. استخدم "تنزيل رموز الاستجابة السريعة" عند الجهوز.',qrGenerationFailedToast:"فشل إنشاء رموز الاستجابة السريعة. يرجى المحاولة مرة أخرى.",qrCodesNotGeneratedToast:"لم يتم إنشاء أي رموز استجابة سريعة بعد. قم بإنشاء رموز الاستجابة السريعة أولاً.",qrGenerationInProgressToast:"إنشاء صور رموز الاستجابة السريعة قيد التنفيذ. يرجى المحاولة بالتنزيل بعد قليل.",qrCodesNotReadyToast:"رموز الاستجابة السريعة ليست جاهزة بعد. يرجى الانتظار والمحاولة مرة أخرى.",qrCodesDownloadedToast:"تم تنزيل رموز الاستجابة السريعة.",qrCodesDownloadFailedToast:"فشل تنزيل رموز الاستجابة السريعة.",requestChangesTitle:"طلب إجراء تغييرات",changesRequestedLabel:"تم طلب تغييرات",describeChangesPlaceholder:"اذكر التغييرات التي يجب على المؤلف إجراؤها"},reviewCommentModal:{closeAriaLabel:"إغلاق",fillCommentsError:"أضف تعليقات",cancelButton:"إلغاء"},confirmReviewModal:{closeAriaLabel:"إغلاق",title:"قبول الشروط والأحكام",agreementTextPart1:"أوافق على أنه بإرسال / نشر هذا المحتوى، فإنني أؤكد أن هذا المحتوى يتوافق مع الإرشادات المعتمدة، بما في ذلك شروط الاستخدام وسياسة المحتوى، وأني أوافق على نشره بموجب",creativeCommonsLinkText:"إطار عمل Creative Commons",agreementTextPart2:"وفقًا لـ",contentPolicyText:"سياسة المحتوى",agreementTextPart3:". وقد تحققت من أنني لا أنتهك حقوق النشر أو الخصوصية الخاصة بالآخرين.",cancelButton:"إلغاء",submitButton:"إرسال"},generateQRModal:{closeAriaLabel:"إغلاق",title:"إنشاء رموز الاستجابة السريعة",numberOfCodesLabel:"عدد رموز الاستجابة السريعة",countPlaceholder:"أدخل رقمًا (2–250)",countRangeError:"أدخل رقمًا بين 2 و 250.",cancelButton:"إلغاء",generateButton:"إنشاء"},chip:{remove:"إزالة"},dropZone:{dropHere:"أفلت هنا"},spinner:{loading:"جارٍ التحميل"},learningPath:{profileBadgeLabel:"مسار التعلم",pathStructureLabel:"بنية المسار",addLevelButton:"إضافة مستوى",levelNumberPrefix:"المستوى {n}",priorAssessmentLabel:"التقييم المسبق",priorAssessmentHint:"مطلوب دائمًا · لا يُحسب كمستوى",outcomeAssessmentLabel:"تقييم النتائج",outcomeAssessmentHint:"يؤكد النتيجة · لا يُحسب كمستوى",skillCheckBadge:"فحص المهارة",outcomeCheckBadge:"فحص النتيجة",assessmentCourseMeta:"مقرر · بنك أسئلة فقط",addAssessmentSlotButton:"إضافة {label} — مقرر يحتوي على بنك أسئلة فقط",requiredSlotBadge:"مطلوب",removeAssessmentSlotButton:"إزالة",deletePriorAssessmentConfirm:"حذف التقييم المسبق يزيل الدرجة التي يعتمد عليها التخطي التكيفي لهذا المسار. هل تريد الاستمرار؟",deleteAssessmentSlotConfirm:"هل تريد إزالة مقرر التقييم هذا من المسار؟",deleteLevelConfirm:'هل تريد حذف "{name}" وكل ما يحتويه؟',deleteCourseConfirm:"هل تريد إزالة هذا المقرر من المسار؟",deleteMultipleConfirm:"هل تريد حذف {count} من العناصر المحددة من المسار؟",courseNameUnavailable:"تفاصيل المقرر غير متوفرة",notAssessmentCourseToast:'"{name}" ليس مقررًا يحتوي على بنك أسئلة فقط، لذا لا يمكن استخدامه كتقييم.',bothSlotsFilledToast:"تم تعبئة تقييمي المسبق والنتائج بالفعل.",assessmentCheckFailedToast:"تعذر التحقق من هذا المقرر. حاول مرة أخرى.",skillsHeading:"المهارات",skillsOutOfScopeWarning:"خارج النطاق، يرجى إعادة الاختيار: {skills}",skillsUncoveredWarning:"لا يغطي أي مقرر هذه المهارات بعد: {skills}",skillUncoveredPillTitle:"لا يوجد مقرر مرتبط موسوم بهذه المهارة بعد",searchSkillsPlaceholder:"البحث عن المهارات",noSkillsAvailable:"لا توجد مهارات متاحة حتى الآن",noMatchingSkills:"لا توجد مهارات مطابقة",noSkillsSelectedYet:"لم يتم تحديد مهارات",removeSkillAriaLabel:"إزالة {skill}",skillScopeFromPriorNote:"اختر المهارات — من التقييم المسبق — التي يبنيها هذا المستوى. تُصفّي المكتبة المقررات وفق هذه المهارات.",skillScopeManualNote:"لا يوجد تقييم مسبق حتى الآن، فاختر من كتالوج المهارات العام. تُصفّي المكتبة المقررات وفق هذه المهارات.",skillsCoveredHeading:"المهارات المشمولة",skillsCoveredDescription:"جميع المهارات الموسومة عبر التقييم المسبق والمستويات وتقييم النتائج لهذا المسار.",noSkillsYet:"لا توجد مهارات بعد — أضف مقررات لرؤية المهارات هنا.",levelCountLabel:"{count} مستوى",levelCountLabelPlural:"{count} مستويات",courseCountLabel:"{count} مقرر",courseCountLabelPlural:"{count} مقررات",backToPathButton:"العودة إلى المسار",backToLevelButton:"العودة إلى {label}",courseDetailsLoading:"جارٍ تحميل تفاصيل المقرر…",courseDetailsEmpty:"لا يحتوي هذا المقرر على وحدات بعد.",courseDetailsError:"تعذر تحميل تفاصيل المقرر.",courseDetailsCardTitle:"تفاصيل المقرر",courseTitleFieldLabel:"العنوان",courseDescriptionFieldLabel:"الوصف",noCourseDescriptionPlaceholder:"لا يتوفر وصف.",unitsSectionLabel:"الوحدات",unitsSectionDescription:"تجمع الوحدات المحتوى المرتبط؛ كل عنصر محتوى موسوم بالمهارات التي يبنيها.",unitTopicsFieldLabel:"المواضيع",contentCountLabel:"{count} عنصر محتوى",contentCountLabelPlural:"{count} عناصر محتوى",courseUnitTopicsLabel:"{count} موضوع",courseUnitTopicsLabelPlural:"{count} مواضيع",verifyingAssessmentCourses:"جارٍ التحقق من مقررات التقييم…",resolveBeforePublishing:"حل هذه النقاط قبل النشر:",resolveBeforeSendingForReview:"حل هذه النقاط قبل الإرسال للمراجعة:",assessmentsCardHeading:"التقييم المسبق وتقييم النتائج",assessmentsCardDescription:"أضف المقررات التي تحتوي على بنك أسئلة فقط والتي تفتح وتغلق هذا المسار.",assessmentNotAddedYet:"لم تتم إضافته بعد — اختر مقررًا يحتوي على بنك أسئلة فقط من المكتبة.",viewCourseMenuItem:"عرض",priorAssessmentExplainerTitle:"لماذا لا يمكن تخطي هذا",priorAssessmentExplainerBody:"درجة بنك الأسئلة هذا هي ما يعتمد عليه كل مستوى لتحديد التخطي — ولا يوجد حتى الآن ما يُقارن به، لذا يُنفَّذ بالكامل دائمًا.",priorAssessmentPurposeLabel:"يحدد خط أساس المهارة",outcomeAssessmentExplainerTitle:"يُغلق المسار",outcomeAssessmentExplainerBody:"النجاح في بنك الأسئلة هذا هو ما يُصادق على اكتساب المهارة للمسار بأكمله — ودرجته هي ما تظهر في شهادة المتعلم.",outcomeUnlocksHint:"يُفتح بعد المستوى الأخير",assessmentCourseSectionTitle:"المقرر",assessmentCourseSectionDescription:"مقرر واحد يكون محتواه الوحيد بنك أسئلة — لا تنتمي هنا أي أنواع محتوى أخرى.",libraryOpenLevelToAdd:"افتح مستوى للإضافة",libraryAddToLevel:"إضافة إلى {level}",libraryAddPriorAssessmentCourse:"إضافة مقرر التقييم المسبق",libraryAddOutcomeAssessmentCourse:"إضافة مقرر تقييم النتائج",policyStrictLabel:"صارمة",policyStrictDescription:"يُنهي كل متعلم كل مستوى، بالترتيب — بصرف النظر عن درجة التقييم المسبق.",policyAdaptiveLabel:"تكيفية",policyAdaptiveDescriptionPre:"يمكن تخطي مستوى، ولكن فقط عندما تتجاوز درجة المتعلم في التقييم المسبق",policyAdaptiveDescriptionPost:" حد الإعفاء.",policyPriorLearningLabel:"التعلم المسبق",policyPriorLearningDescription:"يمكن أن يستند التخطي أيضًا إلى مهارات يمتلكها المتعلم بالفعل — شهادة موثقة أو مقرر سابق — لا التقييم وحده.",selectLevelFirstToast:"اختر مستوى أولاً",selectLevelFromOutlineToast:"افتح مستوى في هيكل المسار لإضافة المقررات — لا يمكن إضافة المقررات إلى المسار نفسه أو داخل مقرر آخر.",selectCurriculumFirstToast:"حدد المنهج (Curriculum) لهذا المسار قبل إضافة المقررات.",noCurriculumEmptyTitle:"لم يتم تحديد منهج",noCurriculumEmptyHint:"حدد منهجًا لهذا المسار لتصفح المقررات.",noSkillsEmptyTitle:"لم يتم تحديد مهارات",noSkillsEmptyHint:"حدد مهارات لهذا المستوى لرؤية المقررات المطابقة.",itemAlreadyInPathToast:'"{name}" موجود بالفعل في مسار التعلم هذا',addedToLevelSuccess:'تمت إضافة "{name}" إلى المستوى',dropOntoLevelError:"أفلِت على مستوى لإضافة مقرر",dropOntoPathError:"أفلِت المقررات على مستوى، وليس على مسار التعلم مباشرة.",priorSlotFilledToast:"التقييم المسبق يحتوي على مقرر بالفعل — أزِله قبل إضافة مقرر آخر.",outcomeSlotFilledToast:"التقييم الختامي يحتوي على مقرر بالفعل — أزِله قبل إضافة مقرر آخر.",coursesRemovedFrameworkChangeToast:"تمت إزالة {count} من المقررات المرتبطة بمنهج مختلف من هذا المسار.",levelSkillsResetFrameworkChangeToast:"تم مسح المهارات المختارة في {count} من المستويات — فهي لا تنطبق على المنهج الجديد.",priorAssessmentNarrowedScopeToast:"أدى التقييم المسبق إلى تضييق نطاق المهارات — أصبح لدى {count} من المستويات مهارات خارج هذا النطاق."}},lb={contextualEditor:{emptyStateMessage:"Sélectionnez une unité dans le plan pour modifier ses détails",reviewCommentLabel:"Commentaire du réviseur :",untitledPlaceholder:"Sans titre",nodeTitleAriaLabel:"Titre du nœud",dropZoneLabel:"Déposez ici pour ajouter du contenu à cette unité"},languageSelector:{ariaLabel:"Sélectionner la langue"},collectionEditor:{errorBoundaryTitle:"Une erreur s'est produite",retryButton:"Réessayer",loadingMessage:"Chargement de l'éditeur...",loadErrorTitle:"Échec du chargement de l'éditeur"},breadcrumb:{nodePathAriaLabel:"Chemin du nœud",homeAriaLabel:"Accueil"},tabBar:{detailsTab:"Détails",audienceCurriculumTab:"Public et programme",licensingTab:"Licence",metadataSectionsAriaLabel:"Sections de métadonnées",hasErrorsAriaLabel:"Contient des erreurs"},contentEditForm:{moveToAnotherUnitButton:"Déplacer vers une autre unité",collapseMetadataPanelAriaLabel:"Réduire le panneau de métadonnées",expandMetadataPanelAriaLabel:"Développer le panneau de métadonnées",collapseTitle:"Réduire",expandTitle:"Développer",iconAlt:"icône",contentNamePlaceholder:"Nom du contenu",keywordsLabel:"Mots-clés",addKeywordPlaceholder:"Ajoutez un mot-clé et appuyez sur Entrée",addButton:"Ajouter",optionalInCollectionLabel:"Facultatif dans la collection",yesOption:"Oui",noOption:"Non"},titleAppIcon:{selectAppIconAriaLabel:"Sélectionner l'icône de l'application",appIconAriaLabel:"Icône de l'application",appIconAlt:"Icône de l'application",removeIconAriaLabel:"Supprimer l'icône"},unitContentList:{removeConfirm:"Retirer ce contenu de l'unité ?",heading:"Contenu de cette unité",emptyTitle:"Aucun contenu pour le moment",emptyHint:"Faites glisser depuis la bibliothèque ou cliquez sur Ajouter du contenu",addContentAriaLabel:"Ajouter du contenu à l'unité",addContent:"Ajouter du contenu"},contentRow:{dragToReorderAriaLabel:"Faire glisser pour réorganiser",removeAriaLabel:"Supprimer {name}"},csvUpload:{invalidFileType:"Seuls les fichiers .csv sont acceptés.",fileTooLarge:"La taille du fichier ne doit pas dépasser 50 Mo.",downloadSampleFailed:"Échec du téléchargement de l'exemple de CSV.",processingFailed:"Le traitement du téléversement a échoué. Veuillez vérifier les lignes en erreur ci-dessous.",connectionLost:"Connexion perdue pendant la vérification du statut. Veuillez réessayer.",uploadFailed:"Le téléversement a échoué. Veuillez vérifier votre fichier et réessayer.",statusUploading:"Téléversement en cours...",statusProcessing:"Traitement en cours...",statusDone:"Terminé !",statusError:"Erreur",titleUpdate:"Mettre à jour les métadonnées des dossiers via CSV",titleCreate:"Créer des dossiers via CSV",closeAriaLabel:"Fermer",dropZoneAriaLabel:"Déposez le fichier CSV ici ou cliquez pour parcourir",dropText:"Faites glisser et déposez votre CSV ici",dropSubtext:"ou cliquez pour parcourir",downloadSample:"Télécharger l'exemple de CSV",itemsImportedSuffix:"— {count} élément(s) importé(s)",failedRowsTitle:"Lignes en échec ({count})",rowHeader:"Ligne",nameHeader:"Nom",reasonHeader:"Raison",unknownError:"Erreur inconnue",cancel:"Annuler",uploaded:"Téléversé",upload:"Téléverser"},manageCollaborators:{saveFailed:"Échec de l'enregistrement des collaborateurs. Veuillez réessayer.",title:"Gérer les collaborateurs",closeAriaLabel:"Fermer",searchUsersLabel:"Rechercher des utilisateurs",searchPlaceholder:"Rechercher par nom ou e-mail...",searchingAriaLabel:"Recherche en cours...",searchResultsAriaLabel:"Résultats de recherche",add:"Ajouter",noUsersFound:"Aucun utilisateur trouvé.",currentCollaborators:"Collaborateurs actuels",noCollaboratorsYet:"Aucun collaborateur ajouté pour le moment.",remove:"Retirer",saveSuccess:"Collaborateurs enregistrés avec succès.",cancel:"Annuler",save:"Enregistrer"},sparkMetaForm:{shuffleEnabledMessage:"La lecture aléatoire est activée pour cet ensemble de questions.",noFieldsMessage:"Aucun champ configuré pour cet onglet."},appIconField:{requiredError:"{field} est requis",selectIconAriaLabel:"Sélectionner l'icône de l'application",iconAlt:"Icône de l'application",selectIconLabel:"Sélectionner l'icône",removeIconAriaLabel:"Supprimer l'icône de l'application",removeLabel:"Supprimer"},appIconPickerModal:{dialogAriaLabel:"Sélectionner l'icône de l'application",title:"Sélectionner l'icône de l'application",closeAriaLabel:"Fermer",myImagesTab:"Mes images",allImagesTab:"Toutes les images",uploadTab:"Téléverser",searchPlaceholder:"Rechercher des images…",loadingText:"Chargement…",noImagesFound:"Aucune image trouvée",noThumbnailText:"IMG",loadMoreButton:"Charger plus",previewAlt:"Aperçu",dropZoneText:"Faites glisser et déposez ou cliquez pour parcourir",acceptedTypesInfo:"{types} · max {size} Mo",cancelButton:"Annuler",uploadingText:"Téléversement…",uploadAndUseButton:"Téléverser et utiliser",useSelectedButton:"Utiliser la sélection",invalidFileTypeError:"Seuls les fichiers {types} sont acceptés.",fileTooLargeError:"L'image doit faire moins de {size} Mo.",uploadFailedError:"Le téléversement a échoué."},chipGroupField:{addPlaceholder:"Ajouter…",addButtonLabel:"Ajouter"},dateTimeField:{requiredError:"{field} est requis"},dialcodeInputField:{requiredError:"{field} est requis",enterCodeMessage:"Saisissez un code d'appel à valider.",validMessage:"Le code d'appel est valide.",notFoundMessage:"Code d'appel introuvable.",validationFailedMessage:"La validation a échoué. Veuillez réessayer.",placeholderExample:"ex. A1B2C3",validateAriaLabel:"Valider le code d'appel",validatingLabel:"Validation en cours…",validateButtonLabel:"Valider"},keywordSuggestField:{requiredError:"{field} est requis",inputPlaceholder:"Saisissez et appuyez sur Entrée ou virgule…"},licenseSelectField:{requiredError:"{field} est requis",selectPlaceholder:"Sélectionner une licence…"},multiSelectField:{requiredError:"{field} est requis",selectedCountSuffix:"sélectionné(s)",selectPlaceholder:"Sélectionner…",noOptionsMessage:"Aucune option"},nestedSelectField:{requiredError:"{field} est requis",selectPlaceholder:"Sélectionner…"},radioField:{requiredError:"{field} est requis"},selectField:{requiredError:"{field} est requis",selectPlaceholder:"Sélectionner…",noOptionsMessage:"Aucune option"},textField:{requiredError:"{field} est requis",maxLengthError:"Maximum {max} caractères"},assetBrowser:{dialogAriaLabel:"Navigateur de ressources",title:"Navigateur de ressources",closeAriaLabel:"Fermer",browseTab:"Parcourir",uploadTab:"Téléverser",searchPlaceholder:"Rechercher des ressources...",searchButton:"Rechercher",loadingMessage:"Chargement...",uploadingMessage:"Téléversement...",chooseFileButton:"Choisir un fichier à téléverser"},resourceReorderDialog:{dialogAriaLabel:"Déplacer la ressource",moveHeaderPrefix:"Déplacer",closeAriaLabel:"Fermer",selectUnitHint:"Sélectionnez une unité vers laquelle déplacer ce contenu :",noUnitsAvailable:"Aucune autre unité disponible",cancelButton:"Annuler",moveButton:"Déplacer ici"},assignPageNumber:{dialogAriaLabel:"Attribuer des numéros de page",title:"Attribuer des numéros de page",closeAriaLabel:"Fermer",emptyState:"Aucun élément de contenu trouvé dans cette collection.",contentColumnHeader:"Contenu",pageNumberColumnHeader:"Numéro de page",cancelButton:"Annuler",saveButton:"Enregistrer"},confirmDialog:{title:"Confirmer la suppression",confirmButton:"Confirmer",cancelButton:"Annuler",closeAriaLabel:"Fermer"},publishChecklist:{publishTitlePrefix:"Publier",closeAriaLabel:"Fermer",confirmPublishPrefix:"Êtes-vous sûr de vouloir publier ce",checklistInstructions:"Veuillez confirmer que TOUS les éléments suivants sont vérifiés (en cochant les cases) avant de pouvoir publier :",noButton:"Non",yesButton:"Oui"},qualityParamsModal:{reviewQualityTitle:"Évaluer la qualité",rejectContentTitle:"Rejeter le contenu",closeAriaLabel:"Fermer",qualityScoreLabel:"Score de qualité",scorePoorLabel:"0 — Faible",scoreExcellentLabel:"10 — Excellent",commentLabel:"Commentaire",optionalLabel:"(facultatif)",commentPlaceholder:"Ajoutez des remarques pour le créateur du contenu…",rejectionReasonLabel:"Motif du rejet",rejectReasonPlaceholder:"Décrivez pourquoi ce contenu est rejeté…",rejectionRequiredMessage:"Un motif de rejet est requis.",cancelButton:"Annuler",approveButton:"Approuver",rejectButton:"Rejeter"},unsavedChangesModal:{title:"Modifications non enregistrées",closeAriaLabel:"Fermer",bodyMessage:"Vous avez des modifications non enregistrées. Souhaitez-vous les enregistrer avant de quitter ?",cancelButton:"Annuler",discardButton:"Ignorer",saveButton:"Enregistrer"},filterChips:{contentTypeFiltersAriaLabel:"Filtres par type de contenu"},libraryCard:{alreadyAddedAriaLabel:"Déjà ajouté",alreadyAddedTitle:"Déjà ajouté à cette collection",addItemAriaLabel:"Ajouter {name} à l'unité",addToUnitTitle:"Ajouter à l'unité",selectUnitToAddTitle:"Sélectionner une unité pour ajouter",draftOnlyTitle:"Seul le contenu à l'état de brouillon peut être ajouté"},libraryDock:{selectUnitFirstToast:"Sélectionnez d'abord une unité",selectUnitFromOutlineToast:"Sélectionnez une unité dans le plan pour ajouter du contenu — les ressources ne peuvent pas être ajoutées directement au cours.",itemAlreadyAddedToast:"« {name} » est déjà dans cette collection",itemAddedToast:"« {name} » ajouté",collapseLibraryPanelAriaLabel:"Réduire le panneau de la bibliothèque",collapseLibraryTitle:"Réduire la bibliothèque",headerTitle:"Bibliothèque",searchPlaceholder:"Rechercher du contenu…",searchAriaLabel:"Rechercher dans la bibliothèque",sortAZAriaLabel:"Trier : A–Z (cliquer pour Récent)",sortRecentAriaLabel:"Trier : Récent (cliquer pour A–Z)",sortAZTitle:"A–Z",sortRecentTitle:"Récent",toggleAdvancedFiltersAriaLabel:"Afficher/masquer les filtres avancés",advancedFiltersTitle:"Filtres avancés",libraryContentAriaLabel:"Contenu de la bibliothèque",loadMoreAriaLabel:"Charger plus de contenu",loadingText:"Chargement…",loadMoreText:"Charger plus",noContentFound:"Aucun contenu trouvé",tryDifferentSearch:"Essayez une autre recherche ou un autre filtre"},libraryFilterPanel:{boardLabel:"Conseil",mediumLabel:"Médium",classLabel:"Classe",subjectLabel:"Matière",primaryCategoryLabel:"Catégorie principale",filterLibraryAriaLabel:"Filtrer la bibliothèque",filtersHeaderTitle:"Filtres",closeFiltersAriaLabel:"Fermer les filtres",resetButton:"Réinitialiser",applyButton:"Appliquer"},libraryPreviewPanel:{contentPreviewAriaLabel:"Aperçu du contenu",closePreviewAriaLabel:"Fermer l'aperçu",addToUnitButton:"+ Ajouter à l'unité"},outlineTree:{maxDepthReachedToast:"Profondeur maximale atteinte",downloadCsvFailedToast:"Échec du téléchargement du CSV",outlineRefreshedToast:"Plan du cours actualisé.",outlineRefreshFailedToast:"Le plan n'a pas pu être actualisé automatiquement. Veuillez recharger la page.",moreOptionsAriaLabel:"Plus d'options",moreOptionsTitle:"Plus d'options",foldersExistTitle:"Des dossiers existent déjà — utilisez « Mettre à jour » à la place",createFoldersCsvButton:"Créer des dossiers à partir d'un fichier CSV",noFoldersYetTitle:"Aucun dossier pour le moment — utilisez d'abord « Créer »",downloadFoldersCsvButton:"Télécharger les dossiers en fichier CSV",updateFoldersCsvButton:"Mettre à jour les métadonnées des dossiers à partir d'un fichier CSV",expandOutlineAriaLabel:"Développer le plan",collapseOutlineAriaLabel:"Réduire le plan",addUnitButton:"Ajouter une unité",addSubunitButton:"Ajouter une sous-unité"},treeNode:{expandAriaLabel:"Développer",collapseAriaLabel:"Réduire",dropHereLabel:"Déposer ici",nodeOptionsAriaLabel:"Options du nœud",renameMenuItem:"Renommer",addSubunitMenuItem:"Ajouter une sous-unité",addSiblingMenuItem:"Ajouter un élément au même niveau",deleteMenuItem:"Supprimer"},contentPlayer:{mimeLabelVideo:"Vidéo",mimeLabelAudio:"Audio",mimeLabelPdf:"PDF",mimeLabelEpub:"ePub",mimeLabelEcml:"ECML",mimeLabelH5p:"H5P",mimeLabelScorm:"SCORM",mimeLabelOther:"Contenu",infoFieldAuthor:"Auteur",infoFieldLicense:"Licence",infoFieldLanguage:"Langue",infoFieldClass:"Classe",infoFieldSubject:"Matière",infoFieldType:"Type",loadingPreview:"Chargement de l'aperçu…",previewPlayerUnavailable:"Lecteur d'aperçu indisponible. Vérifiez que /content/preview est accessible.",failedToInitializePlayer:"Échec de l'initialisation du lecteur de contenu.",previewPlayerLoadFailed:"Le lecteur d'aperçu n'a pas pu être chargé.",unableToLoadQuestionset:"Impossible de charger l'ensemble de questions :",parentQuestionsetNotResolved:"Impossible de résoudre l'ensemble de questions parent pour cette question.",questionNotFoundInQuestionset:"Question introuvable dans l'ensemble de questions."},dialcodePanel:{title:"Code QR (Dialcode)",invalidFormatError:"Format de code DIAL invalide. Utilisez uniquement des lettres majuscules et des chiffres (ex. A1B2C3).",duplicateDialcodeError:"Le code DIAL « {code} » est déjà associé à un autre nœud de cette collection.",dialcodeNotFoundError:"Code d'appel introuvable. Veuillez saisir un code valide.",linkFailedError:"Échec de l'association du code d'appel. Veuillez réessayer.",unlinkFailedError:"Échec de la suppression du code d'appel. Veuillez réessayer.",qrCodeAltPrefix:"Code QR pour",linkedCodeLabel:"Code associé :",removeButton:"Supprimer",noCodeLinkedMessage:"Aucun code QR associé à ce contenu.",linkManuallyLabel:"Associer manuellement",dialcodeInputPlaceholder:"Saisissez le code d'appel (ex. A1B2C3)",dialcodeInputAriaLabel:"Champ de saisie du code d'appel",linkButton:"Associer",linkedSuccessMessage:"Code d'appel associé avec succès."},progressStatus:{unitsAddedLabel:"Unités ajoutées",contentItemsLabel:"Éléments de contenu",progressLabel:"Progression"},splitBuilderShell:{dropOntoUnitError:"Déposez sur une unité pour ajouter du contenu",dropOntoCourseError:"Déposez le contenu sur une unité, pas directement sur le cours.",alreadyInCollectionError:"« {name} » est déjà dans cette collection",addedToUnitSuccess:"« {name} » ajouté à l'unité",fillRequiredMetadataError:"Veuillez renseigner les métadonnées requises",outlineAriaLabel:"Plan du cours",showOutlineTitle:"Afficher le plan",editorAriaLabel:"Éditeur de contenu",libraryAriaLabel:"Bibliothèque de contenu",showLibraryTitle:"Afficher la bibliothèque"},topbar:{draftStatusFallback:"Brouillon",backAriaLabel:"Retour",statusAriaLabelPrefix:"Statut :",savingIndicator:"Enregistrement…",unsavedIndicator:"Non enregistré",savedIndicatorPrefix:"Enregistré",fillRequiredFieldsTooltip:"Renseignez tous les champs requis avant d'enregistrer",saveAsDraftButton:"Enregistrer comme brouillon",sendForReviewButton:"Envoyer pour révision",collaboratorsLabel:"Collaborateurs",qrCodesLabel:"Codes QR",generatingEllipsis:"Génération en cours…",generateQrCodesMenuItem:"Générer des codes QR",downloadingEllipsis:"Téléchargement…",downloadQrCodesMenuItem:"Télécharger les codes QR",publishButton:"Publier",requestForChangesButton:"Demander des modifications",approveButton:"Approuver",qrGenerationStartedToast:"La génération des codes QR a démarré. Utilisez « Télécharger les codes QR » une fois prêts.",qrGenerationFailedToast:"Échec de la génération des codes QR. Veuillez réessayer.",qrCodesNotGeneratedToast:"Aucun code QR généré pour le moment. Générez d'abord des codes QR.",qrGenerationInProgressToast:"La génération des images de codes QR est en cours. Veuillez réessayer le téléchargement dans quelques instants.",qrCodesNotReadyToast:"Les codes QR ne sont pas encore prêts. Veuillez patienter et réessayer.",qrCodesDownloadedToast:"Codes QR téléchargés.",qrCodesDownloadFailedToast:"Échec du téléchargement des codes QR.",requestChangesTitle:"Demander des modifications",changesRequestedLabel:"Modifications demandées",describeChangesPlaceholder:"Décrivez les modifications que l'auteur doit apporter"},reviewCommentModal:{closeAriaLabel:"Fermer",fillCommentsError:"Renseignez les commentaires",cancelButton:"Annuler"},confirmReviewModal:{closeAriaLabel:"Fermer",title:"Acceptation des conditions générales",agreementTextPart1:"J'accepte qu'en soumettant / publiant ce contenu, je confirme qu'il est conforme aux directives prescrites, y compris les conditions d'utilisation et la politique de contenu, et que je consens à le publier selon le",creativeCommonsLinkText:"cadre Creative Commons",agreementTextPart2:"conformément à la",contentPolicyText:"politique de contenu",agreementTextPart3:". Je me suis assuré(e) de ne pas porter atteinte aux droits d'auteur ou à la vie privée d'autrui.",cancelButton:"Annuler",submitButton:"Soumettre"},generateQRModal:{closeAriaLabel:"Fermer",title:"Générer des codes QR",numberOfCodesLabel:"Nombre de codes QR",countPlaceholder:"Saisissez un nombre (2–250)",countRangeError:"Saisissez un nombre entre 2 et 250.",cancelButton:"Annuler",generateButton:"Générer"},chip:{remove:"Supprimer"},dropZone:{dropHere:"Déposer ici"},spinner:{loading:"Chargement"},learningPath:{profileBadgeLabel:"Parcours d'apprentissage",pathStructureLabel:"Structure du parcours",addLevelButton:"Ajouter un niveau",levelNumberPrefix:"Niveau {n}",priorAssessmentLabel:"Évaluation préalable",priorAssessmentHint:"Toujours requise · ne compte pas comme un niveau",outcomeAssessmentLabel:"Évaluation finale",outcomeAssessmentHint:"Confirme le résultat · ne compte pas comme un niveau",skillCheckBadge:"Vérification des compétences",outcomeCheckBadge:"Vérification du résultat",assessmentCourseMeta:"Cours · Questionnaire uniquement",addAssessmentSlotButton:"Ajouter {label} — un cours contenant uniquement un questionnaire",requiredSlotBadge:"Obligatoire",removeAssessmentSlotButton:"Retirer",deletePriorAssessmentConfirm:"Supprimer l'évaluation préalable retire le score sur lequel se basent les sauts adaptatifs de ce parcours. Continuer ?",deleteAssessmentSlotConfirm:"Retirer ce cours d'évaluation du parcours ?",deleteLevelConfirm:"Supprimer « {name} » et tout son contenu ?",deleteCourseConfirm:"Retirer ce cours du parcours ?",deleteMultipleConfirm:"Supprimer les {count} éléments sélectionnés du parcours ?",courseNameUnavailable:"Détails du cours indisponibles",notAssessmentCourseToast:"« {name} » n'est pas un cours composé uniquement d'un questionnaire, il ne peut donc pas être utilisé comme évaluation.",bothSlotsFilledToast:"Les évaluations préalable et finale sont déjà renseignées.",assessmentCheckFailedToast:"Impossible de vérifier ce cours. Veuillez réessayer.",skillsHeading:"Compétences",skillsOutOfScopeWarning:"Hors du périmètre, veuillez resélectionner : {skills}",skillsUncoveredWarning:"Aucun cours ne couvre encore : {skills}",skillUncoveredPillTitle:"Aucun cours associé n'est encore étiqueté avec cette compétence",searchSkillsPlaceholder:"Rechercher des compétences",noSkillsAvailable:"Aucune compétence disponible pour le moment",noMatchingSkills:"Aucune compétence correspondante",noSkillsSelectedYet:"Aucune compétence sélectionnée",removeSkillAriaLabel:"Supprimer {skill}",skillScopeFromPriorNote:"Choisissez les compétences — issues de l'évaluation préalable — que ce niveau développe. La bibliothèque filtre les cours selon ces compétences.",skillScopeManualNote:"Aucune évaluation préalable pour le moment — choisissez dans le catalogue général des compétences. La bibliothèque filtre les cours selon ces compétences.",skillsCoveredHeading:"Compétences couvertes",skillsCoveredDescription:"Toutes les compétences associées à l'évaluation préalable, aux niveaux et à l'évaluation finale de ce parcours.",noSkillsYet:"Aucune compétence pour le moment — ajoutez des cours pour voir les compétences ici.",levelCountLabel:"{count} niveau",levelCountLabelPlural:"{count} niveaux",courseCountLabel:"{count} cours",courseCountLabelPlural:"{count} cours",backToPathButton:"Retour au parcours",backToLevelButton:"Retour à {label}",courseDetailsLoading:"Chargement des détails du cours…",courseDetailsEmpty:"Ce cours ne contient pas encore d'unités.",courseDetailsError:"Impossible de charger les détails du cours.",courseDetailsCardTitle:"Détails du cours",courseTitleFieldLabel:"Titre",courseDescriptionFieldLabel:"Description",noCourseDescriptionPlaceholder:"Aucune description disponible.",unitsSectionLabel:"Unités",unitsSectionDescription:"Les unités regroupent le contenu associé ; chaque contenu est associé aux compétences qu'il développe.",unitTopicsFieldLabel:"Sujets",contentCountLabel:"{count} contenu",contentCountLabelPlural:"{count} contenus",courseUnitTopicsLabel:"{count} sujet",courseUnitTopicsLabelPlural:"{count} sujets",verifyingAssessmentCourses:"Vérification des cours d'évaluation…",resolveBeforePublishing:"Résolvez les points suivants avant de publier :",resolveBeforeSendingForReview:"Résolvez les points suivants avant d'envoyer pour révision :",assessmentsCardHeading:"Évaluations préalable et finale",assessmentsCardDescription:"Ajoutez les cours composés uniquement d'un questionnaire qui ouvrent et ferment ce parcours.",assessmentNotAddedYet:"Pas encore ajouté — choisissez un cours composé uniquement d'un questionnaire dans la bibliothèque.",viewCourseMenuItem:"Voir",priorAssessmentExplainerTitle:"Pourquoi cela ne peut pas être ignoré",priorAssessmentExplainerBody:"Le score de ce questionnaire est ce que chaque niveau utilise pour décider d'un saut — il n'y a encore rien à comparer, donc il s'exécute toujours en entier.",priorAssessmentPurposeLabel:"Établit la base de compétences",outcomeAssessmentExplainerTitle:"Termine le parcours",outcomeAssessmentExplainerBody:"Réussir ce questionnaire certifie l'acquisition de la compétence pour l'ensemble du parcours — son score est celui qui apparaît sur le certificat de l'apprenant.",outcomeUnlocksHint:"Se débloque après le dernier niveau",assessmentCourseSectionTitle:"Cours",assessmentCourseSectionDescription:"Un seul cours dont le seul contenu est un questionnaire — aucun autre type de contenu n'a sa place ici.",libraryOpenLevelToAdd:"Ouvrez un niveau pour ajouter",libraryAddToLevel:"Ajouter à {level}",libraryAddPriorAssessmentCourse:"Ajouter le cours d'évaluation préalable",libraryAddOutcomeAssessmentCourse:"Ajouter le cours d'évaluation finale",policyStrictLabel:"Strict",policyStrictDescription:"Chaque apprenant termine chaque niveau, dans l'ordre — quel que soit le score de l'évaluation préalable.",policyAdaptiveLabel:"Adaptatif",policyAdaptiveDescriptionPre:"Un niveau peut être ignoré, mais seulement si le score de l'apprenant à l'Évaluation préalable",policyAdaptiveDescriptionPost:" dépasse le seuil de dispense.",policyPriorLearningLabel:"Acquis antérieurs",policyPriorLearningDescription:"Les sauts peuvent aussi s'appuyer sur des compétences déjà détenues par l'apprenant — un certificat vérifié ou un cours antérieur — pas seulement l'évaluation.",selectLevelFirstToast:"Sélectionnez d'abord un niveau",selectLevelFromOutlineToast:"Ouvrez un niveau dans la structure du parcours pour ajouter des cours — les cours ne peuvent pas être ajoutés au parcours lui-même ni sous un autre cours.",selectCurriculumFirstToast:"Sélectionnez un programme (Curriculum) pour ce parcours avant d'ajouter des cours.",noCurriculumEmptyTitle:"Aucun programme sélectionné",noCurriculumEmptyHint:"Sélectionnez un programme (Curriculum) pour ce parcours afin de parcourir les cours.",noSkillsEmptyTitle:"Aucune compétence sélectionnée",noSkillsEmptyHint:"Sélectionnez des compétences pour ce niveau afin de voir les cours correspondants.",itemAlreadyInPathToast:"« {name} » fait déjà partie de ce parcours d'apprentissage",addedToLevelSuccess:"« {name} » ajouté au niveau",dropOntoLevelError:"Déposez sur un niveau pour ajouter un cours",dropOntoPathError:"Déposez les cours sur un niveau, pas directement sur le parcours d'apprentissage.",priorSlotFilledToast:"L'Évaluation préalable contient déjà un cours — retirez-le avant d'en ajouter un autre.",outcomeSlotFilledToast:"L'Évaluation finale contient déjà un cours — retirez-le avant d'en ajouter un autre.",coursesRemovedFrameworkChangeToast:"{count} cours associé(s) à un autre curriculum ont été retirés de ce parcours.",levelSkillsResetFrameworkChangeToast:"{count} niveau(x) ont eu leurs compétences sélectionnées effacées — elles ne s'appliquent pas au nouveau curriculum.",priorAssessmentNarrowedScopeToast:"L'évaluation préalable a réduit le périmètre des compétences — {count} niveau(x) ont désormais des compétences hors de ce périmètre."}},cb={contextualEditor:{emptyStateMessage:"Selecione uma unidade no esquema para editar seus detalhes",reviewCommentLabel:"Comentário do revisor:",untitledPlaceholder:"Sem título",nodeTitleAriaLabel:"Título do nó",dropZoneLabel:"Solte para adicionar conteúdo a esta unidade"},languageSelector:{ariaLabel:"Selecionar idioma"},collectionEditor:{errorBoundaryTitle:"Algo deu errado",retryButton:"Tentar novamente",loadingMessage:"Carregando editor...",loadErrorTitle:"Falha ao carregar o editor"},breadcrumb:{nodePathAriaLabel:"Caminho do nó",homeAriaLabel:"Início"},tabBar:{detailsTab:"Detalhes",audienceCurriculumTab:"Público e Currículo",licensingTab:"Licenciamento",metadataSectionsAriaLabel:"Seções de metadados",hasErrorsAriaLabel:"Contém erros"},contentEditForm:{moveToAnotherUnitButton:"Mover para outra unidade",collapseMetadataPanelAriaLabel:"Recolher painel de metadados",expandMetadataPanelAriaLabel:"Expandir painel de metadados",collapseTitle:"Recolher",expandTitle:"Expandir",iconAlt:"ícone",contentNamePlaceholder:"Nome do conteúdo",keywordsLabel:"Palavras-chave",addKeywordPlaceholder:"Adicione uma palavra-chave e pressione Enter",addButton:"Adicionar",optionalInCollectionLabel:"Opcional na coleção",yesOption:"Sim",noOption:"Não"},titleAppIcon:{selectAppIconAriaLabel:"Selecionar ícone do aplicativo",appIconAriaLabel:"Ícone do aplicativo",appIconAlt:"Ícone do aplicativo",removeIconAriaLabel:"Remover ícone"},unitContentList:{removeConfirm:"Remover este conteúdo da unidade?",heading:"Conteúdo nesta unidade",emptyTitle:"Ainda não há conteúdo",emptyHint:"Arraste da biblioteca ou clique em Adicionar conteúdo",addContentAriaLabel:"Adicionar conteúdo à unidade",addContent:"Adicionar conteúdo"},contentRow:{dragToReorderAriaLabel:"Arrastar para reordenar",removeAriaLabel:"Remover {name}"},csvUpload:{invalidFileType:"Somente arquivos .csv são aceitos.",fileTooLarge:"O tamanho do arquivo não deve exceder 50 MB.",downloadSampleFailed:"Falha ao baixar o CSV de exemplo.",processingFailed:"Falha no processamento do upload. Verifique as linhas com erro abaixo.",connectionLost:"Conexão perdida ao verificar o status. Tente novamente.",uploadFailed:"Falha no envio. Verifique seu arquivo e tente novamente.",statusUploading:"Enviando...",statusProcessing:"Processando...",statusDone:"Concluído!",statusError:"Erro",titleUpdate:"Atualizar metadados das pastas via CSV",titleCreate:"Criar pastas via CSV",closeAriaLabel:"Fechar",dropZoneAriaLabel:"Solte o arquivo CSV aqui ou clique para procurar",dropText:"Arraste e solte seu CSV aqui",dropSubtext:"ou clique para procurar",downloadSample:"Baixar CSV de exemplo",itemsImportedSuffix:"— {count} item(ns) importado(s)",failedRowsTitle:"Linhas com falha ({count})",rowHeader:"Linha",nameHeader:"Nome",reasonHeader:"Motivo",unknownError:"Erro desconhecido",cancel:"Cancelar",uploaded:"Enviado",upload:"Enviar"},manageCollaborators:{saveFailed:"Falha ao salvar colaboradores. Tente novamente.",title:"Gerenciar colaboradores",closeAriaLabel:"Fechar",searchUsersLabel:"Buscar usuários",searchPlaceholder:"Buscar por nome ou e-mail...",searchingAriaLabel:"Buscando...",searchResultsAriaLabel:"Resultados da busca",add:"Adicionar",noUsersFound:"Nenhum usuário encontrado.",currentCollaborators:"Colaboradores atuais",noCollaboratorsYet:"Nenhum colaborador adicionado ainda.",remove:"Remover",saveSuccess:"Colaboradores salvos com sucesso.",cancel:"Cancelar",save:"Salvar"},sparkMetaForm:{shuffleEnabledMessage:"A ordem aleatória está ativada para este conjunto de questões.",noFieldsMessage:"Nenhum campo configurado para esta aba."},appIconField:{requiredError:"{field} é obrigatório",selectIconAriaLabel:"Selecionar ícone do aplicativo",iconAlt:"Ícone do aplicativo",selectIconLabel:"Selecionar ícone",removeIconAriaLabel:"Remover ícone do aplicativo",removeLabel:"Remover"},appIconPickerModal:{dialogAriaLabel:"Selecionar ícone do aplicativo",title:"Selecionar ícone do aplicativo",closeAriaLabel:"Fechar",myImagesTab:"Minhas imagens",allImagesTab:"Todas as imagens",uploadTab:"Enviar",searchPlaceholder:"Buscar imagens…",loadingText:"Carregando…",noImagesFound:"Nenhuma imagem encontrada",noThumbnailText:"IMG",loadMoreButton:"Carregar mais",previewAlt:"Pré-visualização",dropZoneText:"Arraste e solte ou clique para procurar",acceptedTypesInfo:"{types} · máx. {size} MB",cancelButton:"Cancelar",uploadingText:"Enviando…",uploadAndUseButton:"Enviar e usar",useSelectedButton:"Usar selecionado",invalidFileTypeError:"Somente arquivos {types} são aceitos.",fileTooLargeError:"A imagem deve ter menos de {size} MB.",uploadFailedError:"Falha no envio."},chipGroupField:{addPlaceholder:"Adicionar…",addButtonLabel:"Adicionar"},dateTimeField:{requiredError:"{field} é obrigatório"},dialcodeInputField:{requiredError:"{field} é obrigatório",enterCodeMessage:"Insira um código dial para validar.",validMessage:"O código dial é válido.",notFoundMessage:"Código dial não encontrado.",validationFailedMessage:"Falha na validação. Tente novamente.",placeholderExample:"ex. A1B2C3",validateAriaLabel:"Validar código dial",validatingLabel:"Validando…",validateButtonLabel:"Validar"},keywordSuggestField:{requiredError:"{field} é obrigatório",inputPlaceholder:"Digite e pressione Enter ou vírgula…"},licenseSelectField:{requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar licença…"},multiSelectField:{requiredError:"{field} é obrigatório",selectedCountSuffix:"selecionado(s)",selectPlaceholder:"Selecionar…",noOptionsMessage:"Sem opções"},nestedSelectField:{requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar…"},radioField:{requiredError:"{field} é obrigatório"},selectField:{requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar…",noOptionsMessage:"Sem opções"},textField:{requiredError:"{field} é obrigatório",maxLengthError:"Máx. {max} caracteres"},assetBrowser:{dialogAriaLabel:"Navegador de recursos",title:"Navegador de recursos",closeAriaLabel:"Fechar",browseTab:"Procurar",uploadTab:"Enviar",searchPlaceholder:"Buscar recursos...",searchButton:"Buscar",loadingMessage:"Carregando...",uploadingMessage:"Enviando...",chooseFileButton:"Escolher arquivo para enviar"},resourceReorderDialog:{dialogAriaLabel:"Mover recurso",moveHeaderPrefix:"Mover",closeAriaLabel:"Fechar",selectUnitHint:"Selecione uma unidade para mover este conteúdo:",noUnitsAvailable:"Nenhuma outra unidade disponível",cancelButton:"Cancelar",moveButton:"Mover para aqui"},assignPageNumber:{dialogAriaLabel:"Atribuir números de página",title:"Atribuir números de página",closeAriaLabel:"Fechar",emptyState:"Nenhum item de conteúdo encontrado nesta coleção.",contentColumnHeader:"Conteúdo",pageNumberColumnHeader:"Número da página",cancelButton:"Cancelar",saveButton:"Salvar"},confirmDialog:{title:"Confirmar exclusão",confirmButton:"Confirmar",cancelButton:"Cancelar",closeAriaLabel:"Fechar"},publishChecklist:{publishTitlePrefix:"Publicar",closeAriaLabel:"Fechar",confirmPublishPrefix:"Tem certeza de que deseja publicar este(a)",checklistInstructions:"Confirme que TODOS os itens a seguir foram verificados (marcando as caixas de seleção) antes de publicar:",noButton:"Não",yesButton:"Sim"},qualityParamsModal:{reviewQualityTitle:"Revisar qualidade",rejectContentTitle:"Rejeitar conteúdo",closeAriaLabel:"Fechar",qualityScoreLabel:"Nota de qualidade",scorePoorLabel:"0 — Ruim",scoreExcellentLabel:"10 — Excelente",commentLabel:"Comentário",optionalLabel:"(opcional)",commentPlaceholder:"Adicione observações para o criador do conteúdo…",rejectionReasonLabel:"Motivo da rejeição",rejectReasonPlaceholder:"Descreva por que este conteúdo está sendo rejeitado…",rejectionRequiredMessage:"É necessário informar um motivo de rejeição.",cancelButton:"Cancelar",approveButton:"Aprovar",rejectButton:"Rejeitar"},unsavedChangesModal:{title:"Alterações não salvas",closeAriaLabel:"Fechar",bodyMessage:"Você tem alterações não salvas. Deseja salvá-las antes de sair?",cancelButton:"Cancelar",discardButton:"Descartar",saveButton:"Salvar"},filterChips:{contentTypeFiltersAriaLabel:"Filtros de tipo de conteúdo"},libraryCard:{alreadyAddedAriaLabel:"Já adicionado",alreadyAddedTitle:"Já adicionado a esta coleção",addItemAriaLabel:"Adicionar {name} à unidade",addToUnitTitle:"Adicionar à unidade",selectUnitToAddTitle:"Selecione uma unidade para adicionar",draftOnlyTitle:"Somente conteúdo em rascunho pode ser adicionado"},libraryDock:{selectUnitFirstToast:"Selecione uma unidade primeiro",selectUnitFromOutlineToast:"Selecione uma unidade no esquema para adicionar conteúdo — recursos não podem ser adicionados diretamente ao curso.",itemAlreadyAddedToast:'"{name}" já está nesta coleção',itemAddedToast:'"{name}" adicionado',collapseLibraryPanelAriaLabel:"Recolher painel da biblioteca",collapseLibraryTitle:"Recolher biblioteca",headerTitle:"Biblioteca",searchPlaceholder:"Buscar conteúdo…",searchAriaLabel:"Buscar na biblioteca",sortAZAriaLabel:"Ordenar: A–Z (clique para Recentes)",sortRecentAriaLabel:"Ordenar: Recentes (clique para A–Z)",sortAZTitle:"A–Z",sortRecentTitle:"Recentes",toggleAdvancedFiltersAriaLabel:"Alternar filtros avançados",advancedFiltersTitle:"Filtros avançados",libraryContentAriaLabel:"Conteúdo da biblioteca",loadMoreAriaLabel:"Carregar mais conteúdo",loadingText:"Carregando…",loadMoreText:"Carregar mais",noContentFound:"Nenhum conteúdo encontrado",tryDifferentSearch:"Tente uma busca ou filtro diferente"},libraryFilterPanel:{boardLabel:"Conselho",mediumLabel:"Idioma de Instrução",classLabel:"Série",subjectLabel:"Disciplina",primaryCategoryLabel:"Categoria principal",filterLibraryAriaLabel:"Filtrar biblioteca",filtersHeaderTitle:"Filtros",closeFiltersAriaLabel:"Fechar filtros",resetButton:"Redefinir",applyButton:"Aplicar"},libraryPreviewPanel:{contentPreviewAriaLabel:"Pré-visualização do conteúdo",closePreviewAriaLabel:"Fechar pré-visualização",addToUnitButton:"+ Adicionar à unidade"},outlineTree:{maxDepthReachedToast:"Profundidade máxima atingida",downloadCsvFailedToast:"Falha ao baixar o CSV",outlineRefreshedToast:"Esquema do curso atualizado.",outlineRefreshFailedToast:"Não foi possível atualizar o esquema automaticamente. Recarregue a página.",moreOptionsAriaLabel:"Mais opções",moreOptionsTitle:"Mais opções",foldersExistTitle:'As pastas já existem — use "Atualizar"',createFoldersCsvButton:"Criar pastas usando arquivo csv",noFoldersYetTitle:'Ainda não há pastas — use "Criar" primeiro',downloadFoldersCsvButton:"Baixar pastas como arquivo csv",updateFoldersCsvButton:"Atualizar metadados das pastas usando arquivo csv",expandOutlineAriaLabel:"Expandir esquema",collapseOutlineAriaLabel:"Recolher esquema",addUnitButton:"Adicionar unidade",addSubunitButton:"Adicionar subunidade"},treeNode:{expandAriaLabel:"Expandir",collapseAriaLabel:"Recolher",dropHereLabel:"Solte aqui",nodeOptionsAriaLabel:"Opções do nó",renameMenuItem:"Renomear",addSubunitMenuItem:"Adicionar subunidade",addSiblingMenuItem:"Adicionar item no mesmo nível",deleteMenuItem:"Excluir"},contentPlayer:{mimeLabelVideo:"Vídeo",mimeLabelAudio:"Áudio",mimeLabelPdf:"PDF",mimeLabelEpub:"ePub",mimeLabelEcml:"ECML",mimeLabelH5p:"H5P",mimeLabelScorm:"SCORM",mimeLabelOther:"Conteúdo",infoFieldAuthor:"Autor",infoFieldLicense:"Licença",infoFieldLanguage:"Idioma",infoFieldClass:"Série",infoFieldSubject:"Disciplina",infoFieldType:"Tipo",loadingPreview:"Carregando pré-visualização…",previewPlayerUnavailable:"Player de pré-visualização indisponível. Verifique se /content/preview está acessível.",failedToInitializePlayer:"Falha ao inicializar o player de conteúdo.",previewPlayerLoadFailed:"Não foi possível carregar o player de pré-visualização.",unableToLoadQuestionset:"Não foi possível carregar o conjunto de questões:",parentQuestionsetNotResolved:"Não foi possível identificar o conjunto de questões principal desta questão.",questionNotFoundInQuestionset:"Questão não encontrada no conjunto de questões."},dialcodePanel:{title:"Código QR (Dialcode)",invalidFormatError:"Formato de código DIAL inválido. Use apenas letras maiúsculas e números (ex. A1B2C3).",duplicateDialcodeError:'O código DIAL "{code}" já está vinculado a outro nó nesta coleção.',dialcodeNotFoundError:"Dialcode não encontrado. Insira um código válido.",linkFailedError:"Falha ao vincular o dialcode. Tente novamente.",unlinkFailedError:"Falha ao remover o dialcode. Tente novamente.",qrCodeAltPrefix:"Código QR para",linkedCodeLabel:"Código vinculado:",removeButton:"Remover",noCodeLinkedMessage:"Nenhum código QR vinculado a este conteúdo.",linkManuallyLabel:"Vincular manualmente",dialcodeInputPlaceholder:"Insira o dialcode (ex. A1B2C3)",dialcodeInputAriaLabel:"Campo de dialcode",linkButton:"Vincular",linkedSuccessMessage:"Dialcode vinculado com sucesso."},progressStatus:{unitsAddedLabel:"Unidades adicionadas",contentItemsLabel:"Itens de conteúdo",progressLabel:"Progresso"},splitBuilderShell:{dropOntoUnitError:"Solte sobre uma unidade para adicionar conteúdo",dropOntoCourseError:"Solte o conteúdo sobre uma unidade, não diretamente sobre o curso.",alreadyInCollectionError:'"{name}" já está nesta coleção',addedToUnitSuccess:'"{name}" adicionado à unidade',fillRequiredMetadataError:"Preencha os metadados obrigatórios",outlineAriaLabel:"Esquema do curso",showOutlineTitle:"Mostrar esquema",editorAriaLabel:"Editor de conteúdo",libraryAriaLabel:"Biblioteca de conteúdo",showLibraryTitle:"Mostrar biblioteca"},topbar:{draftStatusFallback:"Rascunho",backAriaLabel:"Voltar",statusAriaLabelPrefix:"Status:",savingIndicator:"Salvando…",unsavedIndicator:"Não salvo",savedIndicatorPrefix:"Salvo",fillRequiredFieldsTooltip:"Preencha todos os campos obrigatórios antes de salvar",saveAsDraftButton:"Salvar como rascunho",sendForReviewButton:"Enviar para revisão",collaboratorsLabel:"Colaboradores",qrCodesLabel:"Códigos QR",generatingEllipsis:"Gerando…",generateQrCodesMenuItem:"Gerar códigos QR",downloadingEllipsis:"Baixando…",downloadQrCodesMenuItem:"Baixar códigos QR",publishButton:"Publicar",requestForChangesButton:"Solicitar alterações",approveButton:"Aprovar",qrGenerationStartedToast:'Geração dos códigos QR iniciada. Use "Baixar códigos QR" quando estiverem prontos.',qrGenerationFailedToast:"Falha ao gerar os códigos QR. Tente novamente.",qrCodesNotGeneratedToast:"Nenhum código QR gerado ainda. Gere os códigos QR primeiro.",qrGenerationInProgressToast:"A geração das imagens dos códigos QR está em andamento. Tente baixar novamente mais tarde.",qrCodesNotReadyToast:"Os códigos QR ainda não estão prontos. Aguarde e tente novamente.",qrCodesDownloadedToast:"Códigos QR baixados.",qrCodesDownloadFailedToast:"Falha ao baixar os códigos QR.",requestChangesTitle:"Solicitar alterações",changesRequestedLabel:"Alterações solicitadas",describeChangesPlaceholder:"Descreva as alterações que o autor precisa fazer"},reviewCommentModal:{closeAriaLabel:"Fechar",fillCommentsError:"Preencha os comentários",cancelButton:"Cancelar"},confirmReviewModal:{closeAriaLabel:"Fechar",title:"Aceitar Termos e Condições",agreementTextPart1:"Concordo que, ao enviar/publicar este Conteúdo, confirmo que ele está em conformidade com as diretrizes estabelecidas, incluindo os Termos de Uso e a Política de Conteúdo, e que consinto em publicá-lo sob a",creativeCommonsLinkText:"Estrutura Creative Commons",agreementTextPart2:"de acordo com a",contentPolicyText:"Política de Conteúdo",agreementTextPart3:". Certifiquei-me de que não violo direitos de autor ou de privacidade de terceiros.",cancelButton:"Cancelar",submitButton:"Enviar"},generateQRModal:{closeAriaLabel:"Fechar",title:"Gerar códigos QR",numberOfCodesLabel:"Número de códigos QR",countPlaceholder:"Insira um número (2–250)",countRangeError:"Insira um número entre 2 e 250.",cancelButton:"Cancelar",generateButton:"Gerar"},chip:{remove:"Remover"},dropZone:{dropHere:"Solte aqui"},spinner:{loading:"Carregando"},learningPath:{profileBadgeLabel:"Trilha de Aprendizagem",pathStructureLabel:"Estrutura da trilha",addLevelButton:"Adicionar nível",levelNumberPrefix:"Nível {n}",priorAssessmentLabel:"Avaliação prévia",priorAssessmentHint:"Sempre obrigatória · não conta como um nível",outcomeAssessmentLabel:"Avaliação de resultado",outcomeAssessmentHint:"Confirma o resultado · não conta como um nível",skillCheckBadge:"Verificação de habilidade",outcomeCheckBadge:"Verificação de resultado",assessmentCourseMeta:"Curso · Apenas banco de questões",addAssessmentSlotButton:"Adicionar {label} — um curso com apenas um banco de questões",requiredSlotBadge:"Obrigatório",removeAssessmentSlotButton:"Remover",deletePriorAssessmentConfirm:"Excluir a Avaliação prévia remove a pontuação usada pelos avanços adaptativos deste percurso. Continuar?",deleteAssessmentSlotConfirm:"Remover este curso de avaliação do percurso?",deleteLevelConfirm:'Excluir "{name}" e tudo o que ele contém?',deleteCourseConfirm:"Remover este curso do percurso?",deleteMultipleConfirm:"Excluir os {count} itens selecionados do percurso?",courseNameUnavailable:"Detalhes do curso indisponíveis",notAssessmentCourseToast:'"{name}" não é um curso composto somente por um banco de questões, portanto não pode ser usado como avaliação.',bothSlotsFilledToast:"As avaliações prévia e de resultado já estão preenchidas.",assessmentCheckFailedToast:"Não foi possível verificar este curso. Tente novamente.",skillsHeading:"Habilidades",skillsOutOfScopeWarning:"Fora do escopo, selecione novamente: {skills}",skillsUncoveredWarning:"Nenhum curso cobre ainda: {skills}",skillUncoveredPillTitle:"Nenhum curso vinculado está marcado com esta habilidade ainda",searchSkillsPlaceholder:"Buscar habilidades",noSkillsAvailable:"Nenhuma habilidade disponível ainda",noMatchingSkills:"Nenhuma habilidade correspondente",noSkillsSelectedYet:"Nenhuma habilidade selecionada",removeSkillAriaLabel:"Remover {skill}",skillScopeFromPriorNote:"Escolha quais habilidades — da Avaliação prévia — este nível desenvolve. A biblioteca filtra os cursos por essas habilidades.",skillScopeManualNote:"Ainda não há Avaliação prévia, então escolha no catálogo geral de habilidades. A biblioteca filtra os cursos por essas habilidades.",skillsCoveredHeading:"Habilidades abordadas",skillsCoveredDescription:"Todas as habilidades marcadas na Avaliação prévia, nos níveis e na Avaliação de resultado deste percurso.",noSkillsYet:"Nenhuma habilidade ainda — adicione cursos para ver as habilidades aqui.",levelCountLabel:"{count} nível",levelCountLabelPlural:"{count} níveis",courseCountLabel:"{count} curso",courseCountLabelPlural:"{count} cursos",backToPathButton:"Voltar ao percurso",backToLevelButton:"Voltar a {label}",courseDetailsLoading:"Carregando detalhes do curso…",courseDetailsEmpty:"Este curso ainda não tem unidades.",courseDetailsError:"Não foi possível carregar os detalhes do curso.",courseDetailsCardTitle:"Detalhes do curso",courseTitleFieldLabel:"Título",courseDescriptionFieldLabel:"Descrição",noCourseDescriptionPlaceholder:"Nenhuma descrição disponível.",unitsSectionLabel:"Unidades",unitsSectionDescription:"As unidades agrupam conteúdo relacionado; cada item de conteúdo é marcado com as habilidades que desenvolve.",unitTopicsFieldLabel:"Tópicos",contentCountLabel:"{count} conteúdo",contentCountLabelPlural:"{count} conteúdos",courseUnitTopicsLabel:"{count} tópico",courseUnitTopicsLabelPlural:"{count} tópicos",verifyingAssessmentCourses:"Verificando cursos de avaliação…",resolveBeforePublishing:"Resolva os itens abaixo antes de publicar:",resolveBeforeSendingForReview:"Resolva os itens abaixo antes de enviar para revisão:",assessmentsCardHeading:"Avaliações prévia e de resultado",assessmentsCardDescription:"Adicione os cursos compostos apenas por banco de questões que abrem e encerram este percurso.",assessmentNotAddedYet:"Ainda não adicionado — escolha um curso composto apenas por banco de questões na Biblioteca.",viewCourseMenuItem:"Ver",priorAssessmentExplainerTitle:"Por que isso não pode ser pulado",priorAssessmentExplainerBody:"A pontuação deste banco de questões é o que cada nível usa para decidir um avanço — ainda não há nada para comparar, então ele sempre é executado por completo.",priorAssessmentPurposeLabel:"Define a linha de base de habilidades",outcomeAssessmentExplainerTitle:"Encerra o percurso",outcomeAssessmentExplainerBody:"Passar neste banco de questões certifica o ganho de habilidade de todo o percurso — sua pontuação é o que aparece no certificado do aprendiz.",outcomeUnlocksHint:"Desbloqueia após o último nível",assessmentCourseSectionTitle:"Curso",assessmentCourseSectionDescription:"Um único curso cujo único conteúdo é um banco de questões — nenhum outro tipo de conteúdo pertence aqui.",libraryOpenLevelToAdd:"Abra um nível para adicionar",libraryAddToLevel:"Adicionar a {level}",libraryAddPriorAssessmentCourse:"Adicionar curso de Avaliação prévia",libraryAddOutcomeAssessmentCourse:"Adicionar curso de Avaliação de resultado",policyStrictLabel:"Estrita",policyStrictDescription:"Todo aprendiz completa todos os níveis, em ordem — independentemente da pontuação da avaliação prévia.",policyAdaptiveLabel:"Adaptativa",policyAdaptiveDescriptionPre:"Um nível pode ser pulado, mas somente quando a pontuação do aprendiz na Avaliação prévia",policyAdaptiveDescriptionPost:" atinge o limite de dispensa.",policyPriorLearningLabel:"Aprendizagem prévia",policyPriorLearningDescription:"Os avanços também podem se basear em habilidades que o aprendiz já possui — um certificado verificado ou curso anterior — não apenas na avaliação.",selectLevelFirstToast:"Selecione um nível primeiro",selectLevelFromOutlineToast:"Abra um nível na estrutura da trilha para adicionar cursos — cursos não podem ser adicionados à própria trilha nem dentro de outro curso.",selectCurriculumFirstToast:"Selecione um Currículo para esta trilha antes de adicionar cursos.",noCurriculumEmptyTitle:"Nenhum currículo selecionado",noCurriculumEmptyHint:"Selecione um currículo para esta trilha para navegar pelos cursos.",noSkillsEmptyTitle:"Nenhuma habilidade selecionada",noSkillsEmptyHint:"Selecione habilidades para este nível para ver os cursos correspondentes.",itemAlreadyInPathToast:'"{name}" já está nesta trilha de aprendizagem',addedToLevelSuccess:'"{name}" adicionado ao nível',dropOntoLevelError:"Solte sobre um nível para adicionar um curso",dropOntoPathError:"Solte os cursos sobre um nível, não diretamente na trilha de aprendizagem.",priorSlotFilledToast:"A Avaliação prévia já tem um curso — remova-o antes de adicionar outro.",outcomeSlotFilledToast:"A Avaliação final já tem um curso — remova-o antes de adicionar outro.",coursesRemovedFrameworkChangeToast:"{count} curso(s) vinculados a outro currículo foram removidos desta trilha.",levelSkillsResetFrameworkChangeToast:"{count} nível(is) tiveram as habilidades selecionadas apagadas — elas não se aplicam ao novo currículo.",priorAssessmentNarrowedScopeToast:"A Avaliação prévia reduziu o escopo de habilidades — {count} nível(is) agora têm habilidades fora dele."}},db=["ar"],ub={en:Si,ar:ib,fr:lb,pt:cb};function Fd(e,t){const r={...e};for(const n of Object.keys(t)){const o=e[n],s=t[n];o&&s&&typeof o=="object"&&typeof s=="object"&&!Array.isArray(o)&&!Array.isArray(s)?r[n]=Fd(o,s):s!==void 0&&(r[n]=s)}return r}function Md(e){const t=ub[e];return!t||e==="en"?Si:Fd(Si,t)}function fb(e){return db.includes(e)}const wi="app-language",_i="app-language-change",Ti=ko(e=>({lang:"en",labelConfig:Md("en"),setLanguage:(t,r={})=>{e({lang:t,labelConfig:Md(t)}),localStorage.setItem(wi,t),document.documentElement.setAttribute("dir",fb(t)?"rtl":"ltr"),document.documentElement.setAttribute("lang",t),r.broadcast!==!1&&window.dispatchEvent(new CustomEvent(_i,{detail:{lang:t}}))}}));function $d(e,t){return function(){return e.apply(t,arguments)}}const{toString:hb}=Object.prototype,{getPrototypeOf:Dn}=Object,{iterator:Io,toStringTag:Bd}=Symbol,Hs=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Do=(e,t)=>{let r=e;const n=[];for(;r!=null&&r!==Object.prototype;){if(n.indexOf(r)!==-1)return!1;if(n.push(r),Hs(r,t))return!0;r=Dn(r)}return!1},pb=(e,t)=>e!=null&&Do(e,t)?e[t]:void 0,Ei=(e=>t=>{const r=hb.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),or=e=>(e=e.toLowerCase(),t=>Ei(t)===e),Qs=e=>t=>typeof t===e,{isArray:Jr}=Array,Ln=Qs("undefined");function On(e){return e!==null&&!Ln(e)&&e.constructor!==null&&!Ln(e.constructor)&&Ft(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const qd=or("ArrayBuffer");function gb(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&qd(e.buffer),t}const mb=Qs("string"),Ft=Qs("function"),jd=Qs("number"),Pn=e=>e!==null&&typeof e=="object",vb=e=>e===!0||e===!1,Ws=e=>{if(!Pn(e))return!1;const t=Dn(e);return(t===null||t===Object.prototype||Dn(t)===null)&&!Do(e,Bd)&&!Do(e,Io)},yb=e=>{if(!Pn(e)||On(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},bb=or("Date"),Cb=or("File"),Sb=e=>!!(e&&typeof e.uri<"u"),wb=e=>e&&typeof e.getParts<"u",_b=or("Blob"),Tb=or("FileList"),Eb=e=>Pn(e)&&Ft(e.pipe);function Ab(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Ud=Ab(),zd=typeof Ud.FormData<"u"?Ud.FormData:void 0,kb=e=>{if(!e)return!1;if(zd&&e instanceof zd)return!0;const t=Dn(e);if(!t||t===Object.prototype||!Ft(e.append))return!1;const r=Ei(e);return r==="formdata"||r==="object"&&Ft(e.toString)&&e.toString()==="[object FormData]"},Ib=or("URLSearchParams"),[Db,Lb,Ob,Pb]=["ReadableStream","Request","Response","Headers"].map(or),Nb=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Lo(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),Jr(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(On(e))return;const s=r?Object.getOwnPropertyNames(e):Object.keys(e),a=s.length;let i;for(n=0;n<a;n++)i=s[n],t.call(null,e[i],i,e)}}function Vd(e,t){if(On(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,o;for(;n-- >0;)if(o=r[n],t===o.toLowerCase())return o;return null}const en=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Hd=e=>!Ln(e)&&e!==en;function Ai(...e){const{caseless:t,skipUndefined:r}=Hd(this)&&this||{},n={},o=(s,a)=>{if(a==="__proto__"||a==="constructor"||a==="prototype")return;const i=t&&typeof a=="string"&&Vd(n,a)||a,c=Hs(n,i)?n[i]:void 0;Ws(c)&&Ws(s)?n[i]=Ai(c,s):Ws(s)?n[i]=Ai({},s):Jr(s)?n[i]=s.slice():(!r||!Ln(s))&&(n[i]=s)};for(let s=0,a=e.length;s<a;s++){const i=e[s];if(!i||On(i)||(Lo(i,o),typeof i!="object"||Jr(i)))continue;const c=Object.getOwnPropertySymbols(i);for(let d=0;d<c.length;d++){const u=c[d];Qb.call(i,u)&&o(i[u],u)}}return n}const xb=(e,t,r,{allOwnKeys:n}={})=>(Lo(t,(o,s)=>{r&&Ft(o)?Object.defineProperty(e,s,{__proto__:null,value:$d(o,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,s,{__proto__:null,value:o,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),e),Fb=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Mb=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),r&&Object.assign(e.prototype,r)},$b=(e,t,r,n)=>{let o,s,a;const i={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)a=o[s],(!n||n(a,e,t))&&!i[a]&&(t[a]=e[a],i[a]=!0);e=r!==!1&&Dn(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Bb=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},qb=e=>{if(!e)return null;if(Jr(e))return e;let t=e.length;if(!jd(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},jb=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Dn(Uint8Array)),Ub=(e,t)=>{const n=(e&&e[Io]).call(e);let o;for(;(o=n.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},zb=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Vb=or("HTMLFormElement"),Hb=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),{propertyIsEnumerable:Qb}=Object.prototype,Wb=or("RegExp"),Qd=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Lo(r,(o,s)=>{let a;(a=t(o,s,e))!==!1&&(n[s]=a||o)}),Object.defineProperties(e,n)},Rb=e=>{Qd(e,(t,r)=>{if(Ft(e)&&["arguments","caller","callee"].includes(r))return!1;const n=e[r];if(Ft(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Gb=(e,t)=>{const r={},n=o=>{o.forEach(s=>{r[s]=!0})};return Jr(e)?n(e):n(String(e).split(t)),r},Kb=()=>{},Yb=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Zb(e){return!!(e&&Ft(e.append)&&e[Bd]==="FormData"&&e[Io])}const Xb=e=>{const t=new WeakSet,r=n=>{if(Pn(n)){if(t.has(n))return;if(On(n))return n;if(!("toJSON"in n)){t.add(n);const o=Jr(n)?[]:{};return Lo(n,(s,a)=>{const i=r(s);!Ln(i)&&(o[a]=i)}),t.delete(n),o}}return n};return r(e)},Jb=or("AsyncFunction"),eC=e=>e&&(Pn(e)||Ft(e))&&Ft(e.then)&&Ft(e.catch),Wd=((e,t)=>e?setImmediate:t?((r,n)=>(en.addEventListener("message",({source:o,data:s})=>{o===en&&s===r&&n.length&&n.shift()()},!1),o=>{n.push(o),en.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Ft(en.postMessage)),tC=typeof queueMicrotask<"u"?queueMicrotask.bind(en):typeof process<"u"&&process.nextTick||Wd,Rd=e=>e!=null&&Ft(e[Io]),O={isArray:Jr,isArrayBuffer:qd,isBuffer:On,isFormData:kb,isArrayBufferView:gb,isString:mb,isNumber:jd,isBoolean:vb,isObject:Pn,isPlainObject:Ws,isEmptyObject:yb,isReadableStream:Db,isRequest:Lb,isResponse:Ob,isHeaders:Pb,isUndefined:Ln,isDate:bb,isFile:Cb,isReactNativeBlob:Sb,isReactNative:wb,isBlob:_b,isRegExp:Wb,isFunction:Ft,isStream:Eb,isURLSearchParams:Ib,isTypedArray:jb,isFileList:Tb,forEach:Lo,merge:Ai,extend:xb,trim:Nb,stripBOM:Fb,inherits:Mb,toFlatObject:$b,kindOf:Ei,kindOfTest:or,endsWith:Bb,toArray:qb,forEachEntry:Ub,matchAll:zb,isHTMLForm:Vb,hasOwnProperty:Hs,hasOwnProp:Hs,hasOwnInPrototypeChain:Do,getSafeProp:pb,reduceDescriptors:Qd,freezeMethods:Rb,toObjectSet:Gb,toCamelCase:Hb,noop:Kb,toFiniteNumber:Yb,findKey:Vd,global:en,isContextDefined:Hd,isSpecCompliantForm:Zb,toJSONObject:Xb,isAsyncFn:Jb,isThenable:eC,setImmediate:Wd,asap:tC,isIterable:Rd,isSafeIterable:e=>e!=null&&Do(e,Io)&&Rd(e)},rC=O.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),nC=e=>{const t={};let r,n,o;return e&&e.split(`
529
- `).forEach(function(a){o=a.indexOf(":"),r=a.substring(0,o).trim().toLowerCase(),n=a.substring(o+1).trim(),!(!r||t[r]&&rC[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t};function oC(e){let t=0,r=e.length;for(;t<r;){const n=e.charCodeAt(t);if(n!==9&&n!==32)break;t+=1}for(;r>t;){const n=e.charCodeAt(r-1);if(n!==9&&n!==32)break;r-=1}return t===0&&r===e.length?e:e.slice(t,r)}const sC=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),aC=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function ki(e,t){return O.isArray(e)?e.map(r=>ki(r,t)):oC(String(e).replace(t,""))}const iC=e=>ki(e,sC),lC=e=>ki(e,aC);function Gd(e){const t=Object.create(null);return O.forEach(e.toJSON(),(r,n)=>{t[n]=lC(r)}),t}const Kd=Symbol("internals");function Oo(e){return e&&String(e).trim().toLowerCase()}function Rs(e){return e===!1||e==null?e:O.isArray(e)?e.map(Rs):iC(String(e))}function cC(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const dC=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Ii(e,t,r,n,o){if(O.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!O.isString(t)){if(O.isString(n))return t.indexOf(n)!==-1;if(O.isRegExp(n))return n.test(t)}}function uC(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function fC(e,t){const r=O.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{__proto__:null,value:function(o,s,a){return this[n].call(this,t,o,s,a)},configurable:!0})})}let wt=class{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function s(i,c,d){const u=Oo(c);if(!u)return;const f=O.findKey(o,u);(!f||o[f]===void 0||d===!0||d===void 0&&o[f]!==!1)&&(o[f||c]=Rs(i))}const a=(i,c)=>O.forEach(i,(d,u)=>s(d,u,c));if(O.isPlainObject(t)||t instanceof this.constructor)a(t,r);else if(O.isString(t)&&(t=t.trim())&&!dC(t))a(nC(t),r);else if(O.isObject(t)&&O.isSafeIterable(t)){let i=Object.create(null),c,d;for(const u of t){if(!O.isArray(u))throw new TypeError("Object iterator must return a key-value pair");d=u[0],O.hasOwnProp(i,d)?(c=i[d],i[d]=O.isArray(c)?[...c,u[1]]:[c,u[1]]):i[d]=u[1]}a(i,r)}else t!=null&&s(r,t,n);return this}get(t,r){if(t=Oo(t),t){const n=O.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return cC(o);if(O.isFunction(r))return r.call(this,o,n);if(O.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=Oo(t),t){const n=O.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||Ii(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function s(a){if(a=Oo(a),a){const i=O.findKey(n,a);i&&(!r||Ii(n,n[i],i,r))&&(delete n[i],o=!0)}}return O.isArray(t)?t.forEach(s):s(t),o}clear(t){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const s=r[n];(!t||Ii(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){const r=this,n={};return O.forEach(this,(o,s)=>{const a=O.findKey(n,s);if(a){r[a]=Rs(o),delete r[s];return}const i=t?uC(s):String(s).trim();i!==s&&delete r[s],r[i]=Rs(o),n[i]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return O.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=t&&O.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
530
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){const n=(this[Kd]=this[Kd]={accessors:{}}).accessors,o=this.prototype;function s(a){const i=Oo(a);n[i]||(fC(o,a),n[i]=!0)}return O.isArray(t)?t.forEach(s):s(t),this}};wt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),O.reduceDescriptors(wt.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),O.freezeMethods(wt);const hC="[REDACTED ****]";function pC(e){if(O.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(O.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function gC(e,t){const r=new Set(t.map(s=>String(s).toLowerCase())),n=[],o=s=>{if(s===null||typeof s!="object"||O.isBuffer(s))return s;if(n.indexOf(s)!==-1)return;s instanceof wt&&(s=s.toJSON()),n.push(s);let a;if(O.isArray(s))a=[],s.forEach((i,c)=>{const d=o(i);O.isUndefined(d)||(a[c]=d)});else{if(!O.isPlainObject(s)&&pC(s))return n.pop(),s;a=Object.create(null);for(const[i,c]of Object.entries(s)){const d=r.has(i.toLowerCase())?hC:o(c);O.isUndefined(d)||(a[i]=d)}}return n.pop(),a};return o(e)}let J=class dg extends Error{static from(t,r,n,o,s,a){const i=new dg(t.message,r||t.code,n,o,s);return i.cause=t,i.name=t.name,t.status!=null&&i.status==null&&(i.status=t.status),a&&Object.assign(i,a),i}constructor(t,r,n,o,s){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),n&&(this.config=n),o&&(this.request=o),s&&(this.response=s,this.status=s.status)}toJSON(){const t=this.config,r=t&&O.hasOwnProp(t,"redact")?t.redact:void 0,n=O.isArray(r)&&r.length>0?gC(t,r):O.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}};J.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",J.ERR_BAD_OPTION="ERR_BAD_OPTION",J.ECONNABORTED="ECONNABORTED",J.ETIMEDOUT="ETIMEDOUT",J.ECONNREFUSED="ECONNREFUSED",J.ERR_NETWORK="ERR_NETWORK",J.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",J.ERR_DEPRECATED="ERR_DEPRECATED",J.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",J.ERR_BAD_REQUEST="ERR_BAD_REQUEST",J.ERR_CANCELED="ERR_CANCELED",J.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",J.ERR_INVALID_URL="ERR_INVALID_URL",J.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const mC=null,Yd=100;function Di(e){return O.isPlainObject(e)||O.isArray(e)}function Zd(e){return O.endsWith(e,"[]")?e.slice(0,-2):e}function Li(e,t,r){return e?e.concat(t).map(function(o,s){return o=Zd(o),!r&&s?"["+o+"]":o}).join(r?".":""):t}function vC(e){return O.isArray(e)&&!e.some(Di)}const yC=O.toFlatObject(O,{},null,function(t){return/^is[A-Z]/.test(t)});function Gs(e,t,r){if(!O.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=O.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(C,S){return!O.isUndefined(S[C])});const n=r.metaTokens,o=r.visitor||b,s=r.dots,a=r.indexes,i=r.Blob||typeof Blob<"u"&&Blob,c=r.maxDepth===void 0?Yd:r.maxDepth,d=i&&O.isSpecCompliantForm(t),u=[];if(!O.isFunction(o))throw new TypeError("visitor must be a function");function f(y){if(y===null)return"";if(O.isDate(y))return y.toISOString();if(O.isBoolean(y))return y.toString();if(!d&&O.isBlob(y))throw new J("Blob is not supported. Use a Buffer instead.");return O.isArrayBuffer(y)||O.isTypedArray(y)?d&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function m(y){if(y>c)throw new J("Object is too deeply nested ("+y+" levels). Max depth: "+c,J.ERR_FORM_DATA_DEPTH_EXCEEDED)}function g(y,C){if(c===1/0)return JSON.stringify(y);const S=[];return JSON.stringify(y,function(T,E){if(!O.isObject(E))return E;for(;S.length&&S[S.length-1]!==this;)S.pop();return S.push(E),m(C+S.length-1),E})}function b(y,C,S){let w=y;if(O.isReactNative(t)&&O.isReactNativeBlob(y))return t.append(Li(S,C,s),f(y)),!1;if(y&&!S&&typeof y=="object"){if(O.endsWith(C,"{}"))C=n?C:C.slice(0,-2),y=g(y,1);else if(O.isArray(y)&&vC(y)||(O.isFileList(y)||O.endsWith(C,"[]"))&&(w=O.toArray(y)))return C=Zd(C),w.forEach(function(E,L){!(O.isUndefined(E)||E===null)&&t.append(a===!0?Li([C],L,s):a===null?C:C+"[]",f(E))}),!1}return Di(y)?!0:(t.append(Li(S,C,s),f(y)),!1)}const h=Object.assign(yC,{defaultVisitor:b,convertValue:f,isVisitable:Di});function v(y,C,S=0){if(!O.isUndefined(y)){if(m(S),u.indexOf(y)!==-1)throw new Error("Circular reference detected in "+C.join("."));u.push(y),O.forEach(y,function(T,E){(!(O.isUndefined(T)||T===null)&&o.call(t,T,O.isString(E)?E.trim():E,C,h))===!0&&v(T,C?C.concat(E):[E],S+1)}),u.pop()}}if(!O.isObject(e))throw new TypeError("data must be an object");return v(e),t}function Xd(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(n){return t[n]})}function Oi(e,t){this._pairs=[],e&&Gs(e,this,t)}const Jd=Oi.prototype;Jd.append=function(t,r){this._pairs.push([t,r])},Jd.toString=function(t){const r=t?function(n){return t.call(this,n,Xd)}:Xd;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function bC(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function eu(e,t,r){if(!t)return e;const n=O.isFunction(r)?{serialize:r}:r,o=O.getSafeProp(n,"encode")||bC,s=O.getSafeProp(n,"serialize");let a;if(s?a=s(t,n):a=O.isURLSearchParams(t)?t.toString():new Oi(t,n).toString(o),a){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class tu{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){O.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Pi={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},CC={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Oi,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Ni=typeof window<"u"&&typeof document<"u",xi=typeof navigator=="object"&&navigator||void 0,SC=Ni&&(!xi||["ReactNative","NativeScript","NS"].indexOf(xi.product)<0),wC=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",_C=Ni&&window.location.href||"http://localhost",yt={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ni,hasStandardBrowserEnv:SC,hasStandardBrowserWebWorkerEnv:wC,navigator:xi,origin:_C},Symbol.toStringTag,{value:"Module"})),...CC};function TC(e,t){return Gs(e,new yt.classes.URLSearchParams,{visitor:function(r,n,o,s){return yt.isNode&&O.isBuffer(r)?(this.append(n,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}const ru=Yd;function nu(e){if(e>ru)throw new J("FormData field is too deeply nested ("+e+" levels). Max depth: "+ru,J.ERR_FORM_DATA_DEPTH_EXCEEDED)}function EC(e){const t=[],r=/\w+|\[(\w*)]/g;let n;for(;(n=r.exec(e))!==null;)nu(t.length),t.push(n[0]==="[]"?"":n[1]||n[0]);return t}function AC(e){const t={},r=Object.keys(e);let n;const o=r.length;let s;for(n=0;n<o;n++)s=r[n],t[s]=e[s];return t}function ou(e){function t(r,n,o,s){nu(s);let a=r[s++];if(a==="__proto__")return!0;const i=Number.isFinite(+a),c=s>=r.length;return a=!a&&O.isArray(o)?o.length:a,c?(O.hasOwnProp(o,a)?o[a]=O.isArray(o[a])?o[a].concat(n):[o[a],n]:o[a]=n,!i):((!O.hasOwnProp(o,a)||!O.isObject(o[a]))&&(o[a]=[]),t(r,n,o[a],s)&&O.isArray(o[a])&&(o[a]=AC(o[a])),!i)}if(O.isFormData(e)&&O.isFunction(e.entries)){const r={};return O.forEachEntry(e,(n,o)=>{t(EC(n),o,r,0)}),r}return null}const Nn=(e,t)=>e!=null&&O.hasOwnProp(e,t)?e[t]:void 0;function kC(e,t,r){if(O.isString(e))try{return(t||JSON.parse)(e),O.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const Po={transitional:Pi,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,s=O.isObject(t);if(s&&O.isHTMLForm(t)&&(t=new FormData(t)),O.isFormData(t))return o?JSON.stringify(ou(t)):t;if(O.isArrayBuffer(t)||O.isBuffer(t)||O.isStream(t)||O.isFile(t)||O.isBlob(t)||O.isReadableStream(t))return t;if(O.isArrayBufferView(t))return t.buffer;if(O.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(s){const c=Nn(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return TC(t,c).toString();if((i=O.isFileList(t))||n.indexOf("multipart/form-data")>-1){const d=Nn(this,"env"),u=d&&d.FormData;return Gs(i?{"files[]":t}:t,u&&new u,c)}}return s||o?(r.setContentType("application/json",!1),kC(t)):t}],transformResponse:[function(t){const r=Nn(this,"transitional")||Po.transitional,n=r&&r.forcedJSONParsing,o=Nn(this,"responseType"),s=o==="json";if(O.isResponse(t)||O.isReadableStream(t))return t;if(t&&O.isString(t)&&(n&&!o||s)){const i=!(r&&r.silentJSONParsing)&&s;try{return JSON.parse(t,Nn(this,"parseReviver"))}catch(c){if(i)throw c.name==="SyntaxError"?J.from(c,J.ERR_BAD_RESPONSE,this,null,Nn(this,"response")):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:yt.classes.FormData,Blob:yt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};O.forEach(["delete","get","head","post","put","patch","query"],e=>{Po.headers[e]={}});function Fi(e,t){const r=this||Po,n=t||r,o=wt.from(n.headers);let s=n.data;return O.forEach(e,function(i){s=i.call(r,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function su(e){return!!(e&&e.__CANCEL__)}let No=class extends J{constructor(t,r,n){super(t??"canceled",J.ERR_CANCELED,r,n),this.name="CanceledError",this.__CANCEL__=!0}};function au(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new J("Request failed with status code "+r.status,r.status>=400&&r.status<500?J.ERR_BAD_REQUEST:J.ERR_BAD_RESPONSE,r.config,r.request,r))}function IC(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}function DC(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,s=0,a;return t=t!==void 0?t:1e3,function(c){const d=Date.now(),u=n[s];a||(a=d),r[o]=c,n[o]=d;let f=s,m=0;for(;f!==o;)m+=r[f++],f=f%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),d-a<t)return;const g=u&&d-u;return g?Math.round(m*1e3/g):void 0}}function LC(e,t){let r=0,n=1e3/t,o,s;const a=(d,u=Date.now())=>{r=u,o=null,s&&(clearTimeout(s),s=null),e(...d)};return[(...d)=>{const u=Date.now(),f=u-r;f>=n?a(d,u):(o=d,s||(s=setTimeout(()=>{s=null,a(o)},n-f)))},()=>o&&a(o)]}const Ks=(e,t,r=3)=>{let n=0;const o=DC(50,250);return LC(s=>{if(!s||typeof s.loaded!="number")return;const a=s.loaded,i=s.lengthComputable?s.total:void 0,c=i!=null?Math.min(a,i):a,d=Math.max(0,c-n),u=o(d);n=Math.max(n,c);const f={loaded:c,total:i,progress:i?c/i:void 0,bytes:d,rate:u||void 0,estimated:u&&i?(i-c)/u:void 0,event:s,lengthComputable:i!=null,[t?"download":"upload"]:!0};e(f)},r)},iu=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},lu=e=>(...t)=>O.asap(()=>e(...t)),OC=yt.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,yt.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(yt.origin),yt.navigator&&/(msie|trident)/i.test(yt.navigator.userAgent)):()=>!0,PC=yt.hasStandardBrowserEnv?{write(e,t,r,n,o,s,a){if(typeof document>"u")return;const i=[`${e}=${encodeURIComponent(t)}`];O.isNumber(r)&&i.push(`expires=${new Date(r).toUTCString()}`),O.isString(n)&&i.push(`path=${n}`),O.isString(o)&&i.push(`domain=${o}`),s===!0&&i.push("secure"),O.isString(a)&&i.push(`SameSite=${a}`),document.cookie=i.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.split(";");for(let r=0;r<t.length;r++){const n=t[r].replace(/^\s+/,""),o=n.indexOf("=");if(o!==-1&&n.slice(0,o)===e)return decodeURIComponent(n.slice(o+1))}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function NC(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function xC(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}const FC=/^https?:(?!\/\/)/i,MC=/[\t\n\r]/g;function $C(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}function BC(e){return $C(e).replace(MC,"")}function cu(e,t){if(typeof e=="string"&&FC.test(BC(e)))throw new J('Invalid URL: missing "//" after protocol',J.ERR_INVALID_URL,t)}function du(e,t,r,n){cu(t,n);let o=!NC(t);return e&&(o||r===!1)?(cu(e,n),xC(e,t)):t}const uu=e=>e instanceof wt?{...e}:e;function tn(e,t){t=t||{};const r=Object.create(null);Object.defineProperty(r,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function n(u,f,m,g){return O.isPlainObject(u)&&O.isPlainObject(f)?O.merge.call({caseless:g},u,f):O.isPlainObject(f)?O.merge({},f):O.isArray(f)?f.slice():f}function o(u,f,m,g){if(O.isUndefined(f)){if(!O.isUndefined(u))return n(void 0,u,m,g)}else return n(u,f,m,g)}function s(u,f){if(!O.isUndefined(f))return n(void 0,f)}function a(u,f){if(O.isUndefined(f)){if(!O.isUndefined(u))return n(void 0,u)}else return n(void 0,f)}function i(u){const f=O.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!O.isUndefined(f))if(O.isPlainObject(f)){if(O.hasOwnProp(f,u))return f[u]}else return;const m=O.hasOwnProp(e,"transitional")?e.transitional:void 0;if(O.isPlainObject(m)&&O.hasOwnProp(m,u))return m[u]}function c(u,f,m){if(O.hasOwnProp(t,m))return n(u,f);if(O.hasOwnProp(e,m))return n(void 0,u)}const d={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,allowedSocketPaths:a,responseEncoding:a,validateStatus:c,headers:(u,f,m)=>o(uu(u),uu(f),m,!0)};return O.forEach(Object.keys({...e,...t}),function(f){if(f==="__proto__"||f==="constructor"||f==="prototype")return;const m=O.hasOwnProp(d,f)?d[f]:o,g=O.hasOwnProp(e,f)?e[f]:void 0,b=O.hasOwnProp(t,f)?t[f]:void 0,h=m(g,b,f);O.isUndefined(h)&&m!==c||(r[f]=h)}),O.hasOwnProp(t,"validateStatus")&&O.isUndefined(t.validateStatus)&&i("validateStatusUndefinedResolves")===!1&&(O.hasOwnProp(e,"validateStatus")?r.validateStatus=n(void 0,e.validateStatus):delete r.validateStatus),r}const qC=["content-type","content-length"];function jC(e,t,r){if(r!=="content-only"){e.set(t);return}Object.entries(t).forEach(([n,o])=>{qC.includes(n.toLowerCase())&&e.set(n,o)})}const UC=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16)));function fu(e){const t=tn({},e),r=m=>O.hasOwnProp(t,m)?t[m]:void 0,n=r("data");let o=r("withXSRFToken");const s=r("xsrfHeaderName"),a=r("xsrfCookieName");let i=r("headers");const c=r("auth"),d=r("baseURL"),u=r("allowAbsoluteUrls"),f=r("url");if(t.headers=i=wt.from(i),t.url=eu(du(d,f,u,t),r("params"),r("paramsSerializer")),c){const m=O.getSafeProp(c,"username")||"",g=O.getSafeProp(c,"password")||"";i.set("Authorization","Basic "+btoa(m+":"+(g?UC(g):"")))}if(O.isFormData(n)&&(yt.hasStandardBrowserEnv||yt.hasStandardBrowserWebWorkerEnv||O.isReactNative(n)?i.setContentType(void 0):O.isFunction(n.getHeaders)&&jC(i,n.getHeaders(),r("formDataHeaderPolicy"))),yt.hasStandardBrowserEnv&&(O.isFunction(o)&&(o=o(t)),o===!0||o==null&&OC(t.url))){const g=s&&a&&PC.read(a);g&&i.set(s,g)}return t}const zC=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const o=fu(e);let s=o.data;const a=wt.from(o.headers).normalize();let{responseType:i,onUploadProgress:c,onDownloadProgress:d}=o,u,f,m,g,b;function h(){g&&g(),b&&b(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let v=new XMLHttpRequest;v.open(o.method.toUpperCase(),o.url,!0),v.timeout=o.timeout;function y(){if(!v)return;const S=wt.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),T={data:!i||i==="text"||i==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:S,config:e,request:v};au(function(L){r(L),h()},function(L){n(L),h()},T),v=null}"onloadend"in v?v.onloadend=y:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.startsWith("file:"))||setTimeout(y)},v.onabort=function(){v&&(n(new J("Request aborted",J.ECONNABORTED,e,v)),h(),v=null)},v.onerror=function(w){const T=w&&w.message?w.message:"Network Error",E=new J(T,J.ERR_NETWORK,e,v);E.event=w||null,n(E),h(),v=null},v.ontimeout=function(){let w=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const T=o.transitional||Pi;o.timeoutErrorMessage&&(w=o.timeoutErrorMessage),n(new J(w,T.clarifyTimeoutError?J.ETIMEDOUT:J.ECONNABORTED,e,v)),h(),v=null},s===void 0&&a.setContentType(null),"setRequestHeader"in v&&O.forEach(Gd(a),function(w,T){v.setRequestHeader(T,w)}),O.isUndefined(o.withCredentials)||(v.withCredentials=!!o.withCredentials),i&&i!=="json"&&(v.responseType=o.responseType),d&&([m,b]=Ks(d,!0),v.addEventListener("progress",m)),c&&v.upload&&([f,g]=Ks(c),v.upload.addEventListener("progress",f),v.upload.addEventListener("loadend",g)),(o.cancelToken||o.signal)&&(u=S=>{v&&(n(!S||S.type?new No(null,e,v):S),v.abort(),h(),v=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const C=IC(o.url);if(C&&!yt.protocols.includes(C)){n(new J("Unsupported protocol "+C+":",J.ERR_BAD_REQUEST,e));return}v.send(s||null)})},VC=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const r=new AbortController;let n=!1;const o=function(c){if(!n){n=!0,a();const d=c instanceof Error?c:this.reason;r.abort(d instanceof J?d:new No(d instanceof Error?d.message:d))}};let s=t&&setTimeout(()=>{s=null,o(new J(`timeout of ${t}ms exceeded`,J.ETIMEDOUT))},t);const a=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(o):c.removeEventListener("abort",o)}),e=null)};e.forEach(c=>c.addEventListener("abort",o));const{signal:i}=r;return i.unsubscribe=()=>O.asap(a),i},HC=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,o;for(;n<r;)o=n+t,yield e.slice(n,o),n=o},QC=async function*(e,t){for await(const r of WC(e))yield*HC(r,t)},WC=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},hu=(e,t,r,n)=>{const o=QC(e,t);let s=0,a,i=c=>{a||(a=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:d,value:u}=await o.next();if(d){i(),c.close();return}let f=u.byteLength;if(r){let m=s+=f;r(m)}c.enqueue(new Uint8Array(u))}catch(d){throw i(d),d}},cancel(c){return i(c),o.return()}},{highWaterMark:2})},Ys=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,RC=(e,t,r)=>t+2<r&&Ys(e.charCodeAt(t+1))&&Ys(e.charCodeAt(t+2));function GC(e){if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;const t=e.indexOf(",");if(t<0)return 0;const r=e.slice(5,t),n=e.slice(t+1);if(/;base64/i.test(r)){let a=n.length;const i=n.length;for(let g=0;g<i;g++)if(n.charCodeAt(g)===37&&g+2<i){const b=n.charCodeAt(g+1),h=n.charCodeAt(g+2);Ys(b)&&Ys(h)&&(a-=2,g+=2)}let c=0,d=i-1;const u=g=>g>=2&&n.charCodeAt(g-2)===37&&n.charCodeAt(g-1)===51&&(n.charCodeAt(g)===68||n.charCodeAt(g)===100);d>=0&&(n.charCodeAt(d)===61?(c++,d--):u(d)&&(c++,d-=3)),c===1&&d>=0&&(n.charCodeAt(d)===61||u(d))&&c++;const m=Math.floor(a/4)*3-(c||0);return m>0?m:0}let s=0;for(let a=0,i=n.length;a<i;a++){const c=n.charCodeAt(a);if(c===37&&RC(n,a,i))s+=1,a+=2;else if(c<128)s+=1;else if(c<2048)s+=2;else if(c>=55296&&c<=56319&&a+1<i){const d=n.charCodeAt(a+1);d>=56320&&d<=57343?(s+=4,a++):s+=3}else s+=3}return s}const Mi="1.18.0",pu=64*1024,{isFunction:Zs}=O,KC=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16))),gu=e=>{if(!O.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},mu=(e,...t)=>{try{return!!e(...t)}catch{return!1}},YC=e=>{const t=e.indexOf("://");let r=e;return t!==-1&&(r=r.slice(t+3)),r.includes("@")||r.includes(":")},ZC=e=>{const t=O.global!==void 0&&O.global!==null?O.global:globalThis,{ReadableStream:r,TextEncoder:n}=t;e=O.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:o,Request:s,Response:a}=e,i=o?Zs(o):typeof fetch=="function",c=Zs(s),d=Zs(a);if(!i)return!1;const u=i&&Zs(r),f=i&&(typeof n=="function"?(y=>C=>y.encode(C))(new n):async y=>new Uint8Array(await new s(y).arrayBuffer())),m=c&&u&&mu(()=>{let y=!1;const C=new s(yt.origin,{body:new r,method:"POST",get duplex(){return y=!0,"half"}}),S=C.headers.has("Content-Type");return C.body!=null&&C.body.cancel(),y&&!S}),g=d&&u&&mu(()=>O.isReadableStream(new a("").body)),b={stream:g&&(y=>y.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(y=>{!b[y]&&(b[y]=(C,S)=>{let w=C&&C[y];if(w)return w.call(C);throw new J(`Response type '${y}' is not supported`,J.ERR_NOT_SUPPORT,S)})});const h=async y=>{if(y==null)return 0;if(O.isBlob(y))return y.size;if(O.isSpecCompliantForm(y))return(await new s(yt.origin,{method:"POST",body:y}).arrayBuffer()).byteLength;if(O.isArrayBufferView(y)||O.isArrayBuffer(y))return y.byteLength;if(O.isURLSearchParams(y)&&(y=y+""),O.isString(y))return(await f(y)).byteLength},v=async(y,C)=>{const S=O.toFiniteNumber(y.getContentLength());return S??h(C)};return async y=>{let{url:C,method:S,data:w,signal:T,cancelToken:E,timeout:L,onDownloadProgress:A,onUploadProgress:x,responseType:F,headers:P,withCredentials:N="same-origin",fetchOptions:M,maxContentLength:B,maxBodyLength:U}=fu(y);const ee=O.isNumber(B)&&B>-1,Q=O.isNumber(U)&&U>-1,te=q=>O.hasOwnProp(y,q)?y[q]:void 0;let ue=o||fetch;F=F?(F+"").toLowerCase():"text";let fe=VC([T,E&&E.toAbortSignal()],L),pe=null;const ie=fe&&fe.unsubscribe&&(()=>{fe.unsubscribe()});let Te,ye=null;const $=()=>new J("Request body larger than maxBodyLength limit",J.ERR_BAD_REQUEST,y,pe);try{let q;const Z=te("auth");if(Z){const W=O.getSafeProp(Z,"username")||"",Ce=O.getSafeProp(Z,"password")||"";q={username:W,password:Ce}}if(YC(C)){const W=new URL(C,yt.origin);if(!q&&(W.username||W.password)){const Ce=gu(W.username),Ve=gu(W.password);q={username:Ce,password:Ve}}(W.username||W.password)&&(W.username="",W.password="",C=W.href)}if(q&&(P.delete("authorization"),P.set("Authorization","Basic "+btoa(KC((q.username||"")+":"+(q.password||""))))),ee&&typeof C=="string"&&C.startsWith("data:")&&GC(C)>B)throw new J("maxContentLength size of "+B+" exceeded",J.ERR_BAD_RESPONSE,y,pe);if(Q&&S!=="get"&&S!=="head"){const W=await h(w);if(typeof W=="number"&&isFinite(W)&&(Te=W,W>U))throw $()}const he=Q&&(O.isReadableStream(w)||O.isStream(w)),be=(W,Ce,Ve)=>hu(W,pu,nt=>{if(Q&&nt>U)throw ye=$();Ce&&Ce(nt)},Ve);if(m&&S!=="get"&&S!=="head"&&(x||he)){if(Te=Te??await v(P,w),Te!==0||he){let W=new s(C,{method:"POST",body:w,duplex:"half"}),Ce;if(O.isFormData(w)&&(Ce=W.headers.get("content-type"))&&P.setContentType(Ce),W.body){const[Ve,nt]=x&&iu(Te,Ks(lu(x)))||[];w=be(W.body,Ve,nt)}}}else if(he&&!c&&u&&S!=="get"&&S!=="head")w=be(w);else if(he&&c&&!m&&S!=="get"&&S!=="head")throw new J("Stream request bodies are not supported by the current fetch implementation",J.ERR_NOT_SUPPORT,y,pe);O.isString(N)||(N=N?"include":"omit");const ge=c&&"credentials"in s.prototype;if(O.isFormData(w)){const W=P.getContentType();W&&/^multipart\/form-data/i.test(W)&&!/boundary=/i.test(W)&&P.delete("content-type")}P.set("User-Agent","axios/"+Mi,!1);const le={...M,signal:fe,method:S.toUpperCase(),headers:Gd(P.normalize()),body:w,duplex:"half",credentials:ge?N:void 0};pe=c&&new s(C,le);let ve=await(c?ue(pe,M):ue(C,le));const Ae=wt.from(ve.headers);if(ee){const W=O.toFiniteNumber(Ae.getContentLength());if(W!=null&&W>B)throw new J("maxContentLength size of "+B+" exceeded",J.ERR_BAD_RESPONSE,y,pe)}const Y=g&&(F==="stream"||F==="response");if(g&&ve.body&&(A||ee||Y&&ie)){const W={};["status","statusText","headers"].forEach(ot=>{W[ot]=ve[ot]});const Ce=O.toFiniteNumber(Ae.getContentLength()),[Ve,nt]=A&&iu(Ce,Ks(lu(A),!0))||[];let He=0;const Ke=ot=>{if(ee&&(He=ot,He>B))throw new J("maxContentLength size of "+B+" exceeded",J.ERR_BAD_RESPONSE,y,pe);Ve&&Ve(ot)};ve=new a(hu(ve.body,pu,Ke,()=>{nt&&nt(),ie&&ie()}),W)}F=F||"text";let de=await b[O.findKey(b,F)||"text"](ve,y);if(ee&&!g&&!Y){let W;if(de!=null&&(typeof de.byteLength=="number"?W=de.byteLength:typeof de.size=="number"?W=de.size:typeof de=="string"&&(W=typeof n=="function"?new n().encode(de).byteLength:de.length)),typeof W=="number"&&W>B)throw new J("maxContentLength size of "+B+" exceeded",J.ERR_BAD_RESPONSE,y,pe)}return!Y&&ie&&ie(),await new Promise((W,Ce)=>{au(W,Ce,{data:de,headers:wt.from(ve.headers),status:ve.status,statusText:ve.statusText,config:y,request:pe})})}catch(q){if(ie&&ie(),fe&&fe.aborted&&fe.reason instanceof J){const Z=fe.reason;throw Z.config=y,pe&&(Z.request=pe),q!==Z&&(Z.cause=q),Z}throw ye?(pe&&!ye.request&&(ye.request=pe),ye):q instanceof J?(pe&&!q.request&&(q.request=pe),q):q&&q.name==="TypeError"&&/Load failed|fetch/i.test(q.message)?Object.assign(new J("Network Error",J.ERR_NETWORK,y,pe,q&&q.response),{cause:q.cause||q}):J.from(q,q&&q.code,y,pe,q&&q.response)}}},XC=new Map,vu=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,s=[n,o,r];let a=s.length,i=a,c,d,u=XC;for(;i--;)c=s[i],d=u.get(c),d===void 0&&u.set(c,d=i?new Map:ZC(t)),u=d;return d};vu();const $i={http:mC,xhr:zC,fetch:{get:vu}};O.forEach($i,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const yu=e=>`- ${e}`,JC=e=>O.isFunction(e)||e===null||e===!1;function eS(e,t){e=O.isArray(e)?e:[e];const{length:r}=e;let n,o;const s={};for(let a=0;a<r;a++){n=e[a];let i;if(o=n,!JC(n)&&(o=$i[(i=String(n)).toLowerCase()],o===void 0))throw new J(`Unknown adapter '${i}'`);if(o&&(O.isFunction(o)||(o=o.get(t))))break;s[i||"#"+a]=o}if(!o){const a=Object.entries(s).map(([c,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let i=r?a.length>1?`since :
528
+ */var Ld;function Zy(){return Ld||(Ld=1,process.env.NODE_ENV!=="production"&&(function(){function e(d,u){return d===u&&(d!==0||1/d===1/u)||d!==d&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=p,r=yi(),n=typeof Object.is=="function"?Object.is:e,o=r.useSyncExternalStore,s=t.useRef,a=t.useEffect,i=t.useMemo,c=t.useDebugValue;bi.useSyncExternalStoreWithSelector=function(d,u,f,m,g){var b=s(null);if(b.current===null){var h={hasValue:!1,value:null};b.current=h}else h=b.current;b=i(function(){function y(E){if(!C){if(C=!0,S=E,E=m(E),g!==void 0&&h.hasValue){var L=h.value;if(g(L,E))return w=L}return w=E}if(L=w,n(S,E))return L;var A=m(E);return g!==void 0&&g(L,A)?(S=E,L):(S=E,w=A)}var C=!1,S,w,T=f===void 0?null:f;return[function(){return y(u())},T===null?void 0:function(){return y(T())}]},[u,f,m,g]);var v=o(d,b[0],b[1]);return a(function(){h.hasValue=!0,h.value=v},[v]),c(v),v},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),bi}var Od;function Xy(){return Od||(Od=1,process.env.NODE_ENV==="production"?zs.exports=Yy():zs.exports=Zy()),zs.exports}var Jy=Xy();const eb=pi(Jy),Pd={},{useDebugValue:tb}=p,{useSyncExternalStoreWithSelector:rb}=eb;let Nd=!1;const nb=e=>e;function ob(e,t=nb,r){(Pd?"production":void 0)!=="production"&&r&&!Nd&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Nd=!0);const n=rb(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return tb(n),n}const xd=e=>{(Pd?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?Ry(e):e,r=(n,o)=>ob(t,n,o);return Object.assign(r,t),r},ko=e=>e?xd(e):xd,Ci={key:"collection",unitPrimaryCategory:"Course Unit",unitContentType:"CourseUnit",unitLabelKey:"unit",defaultUnitName:"Untitled Unit",maxDepth:4,linkedLeavesOnly:!1,leafPrimaryCategories:[],derivedRoles:!1,competencyScoped:!1,features:{csvUpload:!0,dialcodes:!0,pageNumbers:!0,bulkUpload:!0,collaborators:!0}},sb={key:"learningPath",unitPrimaryCategory:"Level",unitContentType:"Level",unitLabelKey:"level",defaultUnitName:"Untitled Level",maxDepth:1,linkedLeavesOnly:!0,leafPrimaryCategories:["Course"],derivedRoles:!0,competencyScoped:!0,features:{csvUpload:!1,dialcodes:!1,pageNumbers:!1,bulkUpload:!1,collaborators:!1}};function ab(e){return e.config.primaryCategory==="Learning Path"?sb:Ci}const K=ko(e=>({editorConfig:null,editorMode:"edit",buttonLoaders:{saveCollection:!1,publishCollection:!1,addFromLibrary:!1,rejectCollection:!1,sourcingApproveCollection:!1,sourcingRejectCollection:!1},showPreview:!1,pageId:"collection_editor",isCurrentNodeFolder:!1,isCurrentNodeRoot:!1,isQumlPlayer:!1,isDirty:!1,lastSaved:null,formStatusMapper:{},contentFramework:null,contentTargetFWIds:null,editorProfile:Ci,rootFormConfig:null,unitFormConfig:null,childFormConfig:null,searchFormConfig:null,relationalFormConfig:null,publishChecklist:null,reviewChecklist:null,rfcChecklist:null,categoryMeta:null,setEditorConfig:t=>e({editorConfig:t}),setEditorProfile:t=>e({editorProfile:t}),setEditorMode:t=>e({editorMode:t}),setButtonLoader:(t,r)=>e(n=>({buttonLoaders:{...n.buttonLoaders,[t]:r}})),setShowPreview:t=>e({showPreview:t}),setPageId:t=>e({pageId:t}),setNodeFlags:t=>e({...t.isFolder!==void 0&&{isCurrentNodeFolder:t.isFolder},...t.isRoot!==void 0&&{isCurrentNodeRoot:t.isRoot},...t.isQuml!==void 0&&{isQumlPlayer:t.isQuml}}),setLastSaved:t=>e({lastSaved:t}),setIsDirty:t=>e({isDirty:t}),setContentFramework:(t,r)=>e({contentFramework:t,contentTargetFWIds:r}),setFormStatus:(t,r)=>e(n=>({formStatusMapper:{...n.formStatusMapper,[t]:r}})),validateAllForms:t=>{const r=K.getState().formStatusMapper,n=[...t];for(;n.length>0;){const o=n.shift();if(r[o.id]===!1)return!1;o.children&&n.push(...o.children)}return!0},setCategoryDefinition:t=>e({rootFormConfig:t.rootForm,unitFormConfig:t.unitForm,childFormConfig:t.childForm,searchFormConfig:t.searchForm,relationalFormConfig:t.relationalForm,publishChecklist:t.publishChecklist,reviewChecklist:t.reviewChecklist,rfcChecklist:t.rfcChecklist,categoryMeta:{schemaDefaults:t.schemaDefaults,frameworkMetadata:t.frameworkMetadata,sourcingSettings:t.sourcingSettings}})})),ib=Object.freeze(Object.defineProperty({__proto__:null,useEditorStore:K},Symbol.toStringTag,{value:"Module"})),hr=ko(e=>({activeModal:null,modalData:{},activeAssessmentSlot:null,openModal:(t,r={})=>e({activeModal:t,modalData:r}),closeModal:()=>e({activeModal:null,modalData:{}}),setActiveAssessmentSlot:t=>e({activeAssessmentSlot:t})})),Si={contextualEditor:{emptyStateMessage:"Select a unit from the outline to edit its details",reviewCommentLabel:"Reviewer comment:",untitledPlaceholder:"Untitled",nodeTitleAriaLabel:"Node title",dropZoneLabel:"Drop to add content to this unit"},languageSelector:{ariaLabel:"Select language"},collectionEditor:{errorBoundaryTitle:"Something went wrong",retryButton:"Retry",loadingMessage:"Loading editor...",loadErrorTitle:"Failed to load editor"},breadcrumb:{nodePathAriaLabel:"Node path",homeAriaLabel:"Home"},tabBar:{detailsTab:"Details",audienceCurriculumTab:"Audience & Curriculum",licensingTab:"Licensing",metadataSectionsAriaLabel:"Metadata sections",hasErrorsAriaLabel:"Has errors"},contentEditForm:{moveToAnotherUnitButton:"Move to another unit",collapseMetadataPanelAriaLabel:"Collapse metadata panel",expandMetadataPanelAriaLabel:"Expand metadata panel",collapseTitle:"Collapse",expandTitle:"Expand",iconAlt:"icon",contentNamePlaceholder:"Content name",keywordsLabel:"Keywords",addKeywordPlaceholder:"Add keyword and press Enter",addButton:"Add",optionalInCollectionLabel:"Optional in Collection",yesOption:"Yes",noOption:"No"},titleAppIcon:{selectAppIconAriaLabel:"Select app icon",appIconAriaLabel:"App icon",appIconAlt:"App icon",removeIconAriaLabel:"Remove icon"},unitContentList:{removeConfirm:"Remove this content from the unit?",heading:"Content in this unit",emptyTitle:"No content yet",emptyHint:"Drag from the library or click Add content",addContentAriaLabel:"Add content to unit",addContent:"Add content"},contentRow:{dragToReorderAriaLabel:"Drag to reorder",removeAriaLabel:"Remove {name}"},csvUpload:{invalidFileType:"Only .csv files are accepted.",fileTooLarge:"File size must not exceed 50 MB.",downloadSampleFailed:"Failed to download sample CSV.",processingFailed:"Upload processing failed. Please check the error rows below.",connectionLost:"Lost connection while checking status. Please try again.",uploadFailed:"Upload failed. Please check your file and try again.",statusUploading:"Uploading...",statusProcessing:"Processing...",statusDone:"Done!",statusError:"Error",titleUpdate:"Update Folder Metadata via CSV",titleCreate:"Create Folders via CSV",closeAriaLabel:"Close",dropZoneAriaLabel:"Drop CSV file here or click to browse",dropText:"Drag & drop your CSV here",dropSubtext:"or click to browse",downloadSample:"Download Sample CSV",itemsImportedSuffix:"— {count} item(s) imported",failedRowsTitle:"Failed Rows ({count})",rowHeader:"Row",nameHeader:"Name",reasonHeader:"Reason",unknownError:"Unknown error",cancel:"Cancel",uploaded:"Uploaded",upload:"Upload"},manageCollaborators:{saveFailed:"Failed to save collaborators. Please try again.",title:"Manage Collaborators",closeAriaLabel:"Close",searchUsersLabel:"Search users",searchPlaceholder:"Search by name or email...",searchingAriaLabel:"Searching...",searchResultsAriaLabel:"Search results",add:"Add",noUsersFound:"No users found.",currentCollaborators:"Current Collaborators",noCollaboratorsYet:"No collaborators added yet.",remove:"Remove",saveSuccess:"Collaborators saved successfully.",cancel:"Cancel",save:"Save"},sparkMetaForm:{shuffleEnabledMessage:"Shuffling is enabled for this question set.",noFieldsMessage:"No fields configured for this tab."},appIconField:{requiredError:"{field} is required",selectIconAriaLabel:"Select app icon",iconAlt:"App icon",selectIconLabel:"Select icon",removeIconAriaLabel:"Remove app icon",removeLabel:"Remove"},appIconPickerModal:{dialogAriaLabel:"Select App Icon",title:"Select App Icon",closeAriaLabel:"Close",myImagesTab:"My Images",allImagesTab:"All Images",uploadTab:"Upload",searchPlaceholder:"Search images…",loadingText:"Loading…",noImagesFound:"No images found",noThumbnailText:"IMG",loadMoreButton:"Load More",previewAlt:"Preview",dropZoneText:"Drag & drop or click to browse",acceptedTypesInfo:"{types} · max {size} MB",cancelButton:"Cancel",uploadingText:"Uploading…",uploadAndUseButton:"Upload & Use",useSelectedButton:"Use Selected",invalidFileTypeError:"Only {types} files are accepted.",fileTooLargeError:"Image must be under {size} MB.",uploadFailedError:"Upload failed."},chipGroupField:{addPlaceholder:"Add…",addButtonLabel:"Add"},dateTimeField:{requiredError:"{field} is required"},dialcodeInputField:{requiredError:"{field} is required",enterCodeMessage:"Enter a dial code to validate.",validMessage:"Dial code is valid.",notFoundMessage:"Dial code not found.",validationFailedMessage:"Validation failed. Please try again.",placeholderExample:"e.g. A1B2C3",validateAriaLabel:"Validate dial code",validatingLabel:"Validating…",validateButtonLabel:"Validate"},keywordSuggestField:{requiredError:"{field} is required",inputPlaceholder:"Type and press Enter or comma…"},licenseSelectField:{requiredError:"{field} is required",selectPlaceholder:"Select license…"},multiSelectField:{requiredError:"{field} is required",selectedCountSuffix:"selected",selectPlaceholder:"Select…",noOptionsMessage:"No options"},nestedSelectField:{requiredError:"{field} is required",selectPlaceholder:"Select…"},radioField:{requiredError:"{field} is required"},selectField:{requiredError:"{field} is required",selectPlaceholder:"Select…",noOptionsMessage:"No options"},textField:{requiredError:"{field} is required",maxLengthError:"Max {max} characters"},assetBrowser:{dialogAriaLabel:"Asset Browser",title:"Asset Browser",closeAriaLabel:"Close",browseTab:"Browse",uploadTab:"Upload",searchPlaceholder:"Search assets...",searchButton:"Search",loadingMessage:"Loading...",uploadingMessage:"Uploading...",chooseFileButton:"Choose file to upload"},resourceReorderDialog:{dialogAriaLabel:"Move resource",moveHeaderPrefix:"Move",closeAriaLabel:"Close",selectUnitHint:"Select a unit to move this content to:",noUnitsAvailable:"No other units available",cancelButton:"Cancel",moveButton:"Move here"},assignPageNumber:{dialogAriaLabel:"Assign Page Numbers",title:"Assign Page Numbers",closeAriaLabel:"Close",emptyState:"No content items found in this collection.",contentColumnHeader:"Content",pageNumberColumnHeader:"Page Number",cancelButton:"Cancel",saveButton:"Save"},confirmDialog:{title:"Confirm deletion",confirmButton:"Confirm",cancelButton:"Cancel",closeAriaLabel:"Close"},publishChecklist:{publishTitlePrefix:"Publish",closeAriaLabel:"Close",confirmPublishPrefix:"Are you sure you want to publish this",checklistInstructions:"Please confirm that ALL the following items are verified (by ticking the check-boxes) before you can publish:",noButton:"No",yesButton:"Yes"},qualityParamsModal:{reviewQualityTitle:"Review Quality",rejectContentTitle:"Reject Content",closeAriaLabel:"Close",qualityScoreLabel:"Quality Score",scorePoorLabel:"0 — Poor",scoreExcellentLabel:"10 — Excellent",commentLabel:"Comment",optionalLabel:"(optional)",commentPlaceholder:"Add any notes for the content creator…",rejectionReasonLabel:"Rejection Reason",rejectReasonPlaceholder:"Describe why this content is being rejected…",rejectionRequiredMessage:"A rejection reason is required.",cancelButton:"Cancel",approveButton:"Approve",rejectButton:"Reject"},unsavedChangesModal:{title:"Unsaved changes",closeAriaLabel:"Close",bodyMessage:"You have unsaved changes. Would you like to save them before leaving?",cancelButton:"Cancel",discardButton:"Discard",saveButton:"Save"},filterChips:{contentTypeFiltersAriaLabel:"Content type filters"},libraryCard:{alreadyAddedAriaLabel:"Already added",alreadyAddedTitle:"Already added to this collection",addItemAriaLabel:"Add {name} to unit",addToUnitTitle:"Add to unit",selectUnitToAddTitle:"Select a unit to add",draftOnlyTitle:"Only Draft content can be added"},libraryDock:{selectUnitFirstToast:"Select a unit first",selectUnitFromOutlineToast:"Select a unit from the outline to add content — resources cannot be added directly to the course.",itemAlreadyAddedToast:'"{name}" is already in this collection',itemAddedToast:'Added "{name}"',collapseLibraryPanelAriaLabel:"Collapse library panel",collapseLibraryTitle:"Collapse library",headerTitle:"Library",searchPlaceholder:"Search content…",searchAriaLabel:"Search library",sortAZAriaLabel:"Sort: A–Z (click for Recent)",sortRecentAriaLabel:"Sort: Recent (click for A–Z)",sortAZTitle:"A–Z",sortRecentTitle:"Recent",toggleAdvancedFiltersAriaLabel:"Toggle advanced filters",advancedFiltersTitle:"Advanced filters",libraryContentAriaLabel:"Library content",loadMoreAriaLabel:"Load more content",loadingText:"Loading…",loadMoreText:"Load More",noContentFound:"No content found",tryDifferentSearch:"Try a different search or filter"},libraryFilterPanel:{boardLabel:"Board",mediumLabel:"Medium",classLabel:"Class",subjectLabel:"Subject",primaryCategoryLabel:"Primary Category",filterLibraryAriaLabel:"Filter library",filtersHeaderTitle:"Filters",closeFiltersAriaLabel:"Close filters",resetButton:"Reset",applyButton:"Apply"},libraryPreviewPanel:{contentPreviewAriaLabel:"Content preview",closePreviewAriaLabel:"Close preview",addToUnitButton:"+ Add to Unit"},outlineTree:{maxDepthReachedToast:"Maximum depth reached",downloadCsvFailedToast:"Failed to download CSV",outlineRefreshedToast:"Course outline refreshed.",outlineRefreshFailedToast:"Outline could not be refreshed automatically. Please reload the page.",moreOptionsAriaLabel:"More options",moreOptionsTitle:"More options",foldersExistTitle:'Folders already exist — use "Update" instead',createFoldersCsvButton:"Create folders using csv file",noFoldersYetTitle:'No folders yet — use "Create" first',downloadFoldersCsvButton:"Download folders as csv file",updateFoldersCsvButton:"Update folder metadata using csv file",expandOutlineAriaLabel:"Expand outline",collapseOutlineAriaLabel:"Collapse outline",addUnitButton:"Add Unit",addSubunitButton:"Add Sub-unit"},treeNode:{expandAriaLabel:"Expand",collapseAriaLabel:"Collapse",dropHereLabel:"Drop here",nodeOptionsAriaLabel:"Node options",renameMenuItem:"Rename",addSubunitMenuItem:"Add sub-unit",addSiblingMenuItem:"Add Sibling",deleteMenuItem:"Delete"},contentPlayer:{mimeLabelVideo:"Video",mimeLabelAudio:"Audio",mimeLabelPdf:"PDF",mimeLabelEpub:"ePub",mimeLabelEcml:"ECML",mimeLabelH5p:"H5P",mimeLabelScorm:"SCORM",mimeLabelOther:"Content",infoFieldAuthor:"Author",infoFieldLicense:"License",infoFieldLanguage:"Language",infoFieldClass:"Class",infoFieldSubject:"Subject",infoFieldType:"Type",loadingPreview:"Loading preview…",previewPlayerUnavailable:"Preview player unavailable. Check that /content/preview is reachable.",failedToInitializePlayer:"Failed to initialize the content player.",previewPlayerLoadFailed:"Preview player could not be loaded.",unableToLoadQuestionset:"Unable to load questionset:",parentQuestionsetNotResolved:"Could not resolve the parent questionset for this question.",questionNotFoundInQuestionset:"Question not found in the questionset."},dialcodePanel:{title:"QR Code (Dialcode)",invalidFormatError:"Invalid DIAL code format. Use uppercase letters and digits only (e.g. A1B2C3).",duplicateDialcodeError:'DIAL code "{code}" is already linked to another node in this collection.',dialcodeNotFoundError:"Dialcode not found. Please enter a valid code.",linkFailedError:"Failed to link dialcode. Please try again.",unlinkFailedError:"Failed to remove dialcode. Please try again.",qrCodeAltPrefix:"QR code for",linkedCodeLabel:"Linked code:",removeButton:"Remove",noCodeLinkedMessage:"No QR code linked to this content.",linkManuallyLabel:"Link manually",dialcodeInputPlaceholder:"Enter dialcode (e.g. A1B2C3)",dialcodeInputAriaLabel:"Dialcode input",linkButton:"Link",linkedSuccessMessage:"Dialcode linked successfully."},progressStatus:{unitsAddedLabel:"Units added",contentItemsLabel:"Content items",progressLabel:"Progress"},splitBuilderShell:{dropOntoUnitError:"Drop onto a unit to add content",dropOntoCourseError:"Drop content onto a unit, not directly on the course.",alreadyInCollectionError:'"{name}" is already in this collection',addedToUnitSuccess:'Added "{name}" to unit',fillRequiredMetadataError:"Please fill the required metadata",outlineAriaLabel:"Course outline",showOutlineTitle:"Show outline",editorAriaLabel:"Content editor",libraryAriaLabel:"Content library",showLibraryTitle:"Show library"},topbar:{draftStatusFallback:"Draft",backAriaLabel:"Go back",statusAriaLabelPrefix:"Status:",savingIndicator:"Saving…",unsavedIndicator:"Unsaved",savedIndicatorPrefix:"Saved",fillRequiredFieldsTooltip:"Fill all required fields before saving",saveAsDraftButton:"Save as Draft",sendForReviewButton:"Send for review",collaboratorsLabel:"Collaborators",qrCodesLabel:"QR Codes",generatingEllipsis:"Generating…",generateQrCodesMenuItem:"Generate QR Codes",downloadingEllipsis:"Downloading…",downloadQrCodesMenuItem:"Download QR Codes",publishButton:"Publish",requestForChangesButton:"Request for Changes",approveButton:"Approve",qrGenerationStartedToast:'QR Codes generation started. Use "Download QR Codes" once ready.',qrGenerationFailedToast:"Failed to generate QR Codes. Please try again.",qrCodesNotGeneratedToast:"No QR codes generated yet. Generate QR Codes first.",qrGenerationInProgressToast:"QR code image generation is in progress. Please try downloading after some time.",qrCodesNotReadyToast:"QR Codes not ready yet. Please wait and try again.",qrCodesDownloadedToast:"QR codes downloaded.",qrCodesDownloadFailedToast:"Failed to download QR Codes.",requestChangesTitle:"Request Changes",changesRequestedLabel:"Changes requested",describeChangesPlaceholder:"Describe the changes the author needs to make"},reviewCommentModal:{closeAriaLabel:"Close",fillCommentsError:"Fill comments",cancelButton:"Cancel"},confirmReviewModal:{closeAriaLabel:"Close",title:"Accepting Terms & Conditions",agreementTextPart1:"I agree that by submitting / publishing this Content, I confirm that this Content complies with prescribed guidelines, including the Terms of Use and Content Policy and that I consent to publish it under the",creativeCommonsLinkText:"Creative Commons Framework",agreementTextPart2:"in accordance with the",contentPolicyText:"Content Policy",agreementTextPart3:". I have made sure that I do not violate others' copyright or privacy rights.",cancelButton:"Cancel",submitButton:"Submit"},generateQRModal:{closeAriaLabel:"Close",title:"Generate QR Codes",numberOfCodesLabel:"Number of QR Codes",countPlaceholder:"Enter number (2–250)",countRangeError:"Enter a number between 2 and 250.",cancelButton:"Cancel",generateButton:"Generate"},chip:{remove:"Remove"},dropZone:{dropHere:"Drop here"},spinner:{loading:"Loading"},learningPath:{profileBadgeLabel:"Learning Path",pathStructureLabel:"Path Structure",addLevelButton:"Add Level",levelNumberPrefix:"Level {n}",priorAssessmentLabel:"Prior Assessment",priorAssessmentHint:"Always required · not a level",outcomeAssessmentLabel:"Outcome Assessment",outcomeAssessmentHint:"Confirms outcome · not a level",skillCheckBadge:"Skill check",outcomeCheckBadge:"Outcome check",assessmentCourseMeta:"Course · Question set only",addAssessmentSlotButton:"Add {label} — a course with only a question set",requiredSlotBadge:"Required",removeAssessmentSlotButton:"Remove",deletePriorAssessmentConfirm:"Deleting the Prior Assessment removes the score this path's Adaptive skips are based on. Continue?",deleteAssessmentSlotConfirm:"Remove this assessment course from the path?",deleteLevelConfirm:'Delete "{name}" and everything in it?',deleteCourseConfirm:"Remove this course from the path?",deleteMultipleConfirm:"Delete {count} selected items from the path?",courseNameUnavailable:"Course details unavailable",notAssessmentCourseToast:`"{name}" isn't a question-set-only course, so it can't be used as an assessment.`,bothSlotsFilledToast:"Both Prior and Outcome Assessment slots are already filled.",assessmentCheckFailedToast:"Could not verify this course. Please try again.",skillsHeading:"Skills",skillsOutOfScopeWarning:"Out of scope, please re-select: {skills}",skillsUncoveredWarning:"No course covers these yet: {skills}",skillUncoveredPillTitle:"No linked course is tagged with this skill yet",searchSkillsPlaceholder:"Search skills",noSkillsAvailable:"No skills available yet",noMatchingSkills:"No matching skills",noSkillsSelectedYet:"No skills selected",removeSkillAriaLabel:"Remove {skill}",skillScopeFromPriorNote:"Pick which skills — from the Prior Assessment — this level builds. The Library filters courses to these skills.",skillScopeManualNote:"No Prior Assessment yet, so pick from the general skill catalog. The Library filters courses to these skills.",skillsCoveredHeading:"Skills covered",skillsCoveredDescription:"All skills tagged across this path's Prior Assessment, levels, and Outcome Assessment.",noSkillsYet:"No skills yet — add courses to see skills here.",levelCountLabel:"{count} level",levelCountLabelPlural:"{count} levels",courseCountLabel:"{count} course",courseCountLabelPlural:"{count} courses",backToPathButton:"Back to path",backToLevelButton:"Back to {label}",courseDetailsLoading:"Loading course details…",courseDetailsEmpty:"This course has no units yet.",courseDetailsError:"Could not load course details.",courseDetailsCardTitle:"Course details",courseTitleFieldLabel:"Title",courseDescriptionFieldLabel:"Description",noCourseDescriptionPlaceholder:"No description available.",unitsSectionLabel:"Units",unitsSectionDescription:"Units group related content; each content item is tagged with the skills it builds.",unitTopicsFieldLabel:"Topics",contentCountLabel:"{count} content",contentCountLabelPlural:"{count} contents",courseUnitTopicsLabel:"{count} topic",courseUnitTopicsLabelPlural:"{count} topics",verifyingAssessmentCourses:"Verifying assessment courses…",resolveBeforePublishing:"Resolve these before publishing:",resolveBeforeSendingForReview:"Resolve these before sending for review:",assessmentsCardHeading:"Prior & outcome assessments",assessmentsCardDescription:"Add the question-set-only courses that open and close this path.",assessmentNotAddedYet:"Not added yet — pick a question-set-only course from the Library.",viewCourseMenuItem:"View",priorAssessmentExplainerTitle:"Why this can't be skipped",priorAssessmentExplainerBody:"This question set's score is what every level reads to decide a skip — there's nothing to compare against yet, so it always runs in full.",priorAssessmentPurposeLabel:"Sets the skill baseline",outcomeAssessmentExplainerTitle:"Closes the path",outcomeAssessmentExplainerBody:"Passing this question set is what certifies the skill gain for the whole path — its score is what appears on the learner's certificate.",outcomeUnlocksHint:"Unlocks after the last level",assessmentCourseSectionTitle:"Course",assessmentCourseSectionDescription:"A single course whose only content is a question set — no other content types belong here.",libraryOpenLevelToAdd:"Open a level to add",libraryAddToLevel:"Add to {level}",libraryAddPriorAssessmentCourse:"Add Prior Assessment course",libraryAddOutcomeAssessmentCourse:"Add Outcome Assessment course",policyStrictLabel:"Strict",policyStrictDescription:"Every learner completes every level, in order — regardless of prior assessment score.",policyAdaptiveLabel:"Adaptive",policyAdaptiveDescriptionPre:"A level can be skipped, but only when the learner's score on the Prior Assessment",policyAdaptiveDescriptionPost:" clears its waiver threshold.",policyPriorLearningLabel:"Prior learning",policyPriorLearningDescription:"Skips can also draw on skills the learner already holds — a verified certificate or prior course — not the assessment alone.",selectLevelFirstToast:"Select a level first",selectLevelFromOutlineToast:"Open a level in the path structure to add courses — courses cannot be added to the path itself or under another course.",selectCurriculumFirstToast:"Select a Curriculum for this path before adding courses.",noCurriculumEmptyTitle:"No Curriculum selected",noCurriculumEmptyHint:"Select a Curriculum for this path to browse courses.",noSkillsEmptyTitle:"No skills selected",noSkillsEmptyHint:"Select skills for this level to see matching courses.",itemAlreadyInPathToast:'"{name}" is already in this learning path',addedToLevelSuccess:'Added "{name}" to level',dropOntoLevelError:"Drop onto a level to add a course",dropOntoPathError:"Drop courses onto a level, not directly on the learning path.",priorSlotFilledToast:"The Prior Assessment already has a course — remove it before adding a different one.",outcomeSlotFilledToast:"The Outcome Assessment already has a course — remove it before adding a different one.",coursesRemovedFrameworkChangeToast:"{count} course(s) tagged to a different curriculum were removed from this path.",levelSkillsResetFrameworkChangeToast:"{count} Level(s) had their selected skills cleared — they don't apply to the new curriculum.",priorAssessmentNarrowedScopeToast:"The Prior Assessment narrowed the skill scope — {count} Level(s) now have skills outside it."}},lb={contextualEditor:{emptyStateMessage:"اختر وحدة من المخطط التفصيلي لتحرير تفاصيلها",reviewCommentLabel:"تعليق المراجع:",untitledPlaceholder:"بدون عنوان",nodeTitleAriaLabel:"عنوان العنصر",dropZoneLabel:"أفلت هنا لإضافة محتوى إلى هذه الوحدة"},languageSelector:{ariaLabel:"اختيار اللغة"},collectionEditor:{errorBoundaryTitle:"حدث خطأ ما",retryButton:"إعادة المحاولة",loadingMessage:"جارٍ تحميل المحرر...",loadErrorTitle:"فشل تحميل المحرر"},breadcrumb:{nodePathAriaLabel:"مسار العنصر",homeAriaLabel:"الصفحة الرئيسية"},tabBar:{detailsTab:"التفاصيل",audienceCurriculumTab:"الجمهور والمنهج",licensingTab:"الترخيص",metadataSectionsAriaLabel:"أقسام البيانات الوصفية",hasErrorsAriaLabel:"يحتوي على أخطاء"},contentEditForm:{moveToAnotherUnitButton:"نقل إلى وحدة أخرى",collapseMetadataPanelAriaLabel:"طي لوحة البيانات الوصفية",expandMetadataPanelAriaLabel:"توسيع لوحة البيانات الوصفية",collapseTitle:"طي",expandTitle:"توسيع",iconAlt:"أيقونة",contentNamePlaceholder:"اسم المحتوى",keywordsLabel:"الكلمات المفتاحية",addKeywordPlaceholder:"أضف كلمة مفتاحية واضغط Enter",addButton:"إضافة",optionalInCollectionLabel:"اختياري في المجموعة",yesOption:"نعم",noOption:"لا"},titleAppIcon:{selectAppIconAriaLabel:"اختيار أيقونة التطبيق",appIconAriaLabel:"أيقونة التطبيق",appIconAlt:"أيقونة التطبيق",removeIconAriaLabel:"إزالة الأيقونة"},unitContentList:{removeConfirm:"هل تريد إزالة هذا المحتوى من الوحدة؟",heading:"المحتوى في هذه الوحدة",emptyTitle:"لا يوجد محتوى بعد",emptyHint:"اسحب من المكتبة أو انقر فوق إضافة محتوى",addContentAriaLabel:"إضافة محتوى إلى الوحدة",addContent:"إضافة محتوى"},contentRow:{dragToReorderAriaLabel:"اسحب لإعادة الترتيب",removeAriaLabel:"إزالة {name}"},csvUpload:{invalidFileType:"يُقبل فقط ملفات .csv.",fileTooLarge:"يجب ألا يتجاوز حجم الملف 50 ميجابايت.",downloadSampleFailed:"فشل تنزيل نموذج ملف CSV.",processingFailed:"فشلت معالجة التحميل. يرجى التحقق من صفوف الأخطاء أدناه.",connectionLost:"انقطع الاتصال أثناء التحقق من الحالة. يرجى المحاولة مرة أخرى.",uploadFailed:"فشل التحميل. يرجى التحقق من الملف والمحاولة مرة أخرى.",statusUploading:"جارٍ التحميل...",statusProcessing:"جارٍ المعالجة...",statusDone:"تم!",statusError:"خطأ",titleUpdate:"تحديث بيانات المجلدات الوصفية عبر CSV",titleCreate:"إنشاء مجلدات عبر CSV",closeAriaLabel:"إغلاق",dropZoneAriaLabel:"أفلت ملف CSV هنا أو انقر للتصفح",dropText:"اسحب وأفلت ملف CSV هنا",dropSubtext:"أو انقر للتصفح",downloadSample:"تنزيل نموذج CSV",itemsImportedSuffix:"— تم استيراد {count} عنصر (عناصر)",failedRowsTitle:"الصفوف الفاشلة ({count})",rowHeader:"الصف",nameHeader:"الاسم",reasonHeader:"السبب",unknownError:"خطأ غير معروف",cancel:"إلغاء",uploaded:"تم التحميل",upload:"تحميل"},manageCollaborators:{saveFailed:"فشل حفظ المتعاونين. يرجى المحاولة مرة أخرى.",title:"إدارة المتعاونين",closeAriaLabel:"إغلاق",searchUsersLabel:"البحث عن المستخدمين",searchPlaceholder:"البحث بالاسم أو البريد الإلكتروني...",searchingAriaLabel:"جارٍ البحث...",searchResultsAriaLabel:"نتائج البحث",add:"إضافة",noUsersFound:"لم يتم العثور على مستخدمين.",currentCollaborators:"المتعاونون الحاليون",noCollaboratorsYet:"لم تتم إضافة أي متعاونين بعد.",remove:"إزالة",saveSuccess:"تم حفظ المتعاونين بنجاح.",cancel:"إلغاء",save:"حفظ"},sparkMetaForm:{shuffleEnabledMessage:"تم تفعيل الترتيب العشوائي لهذه المجموعة من الأسئلة.",noFieldsMessage:"لا توجد حقول مُهيَّأة لهذا التبويب."},appIconField:{requiredError:"{field} مطلوب",selectIconAriaLabel:"اختيار أيقونة التطبيق",iconAlt:"أيقونة التطبيق",selectIconLabel:"اختيار أيقونة",removeIconAriaLabel:"إزالة أيقونة التطبيق",removeLabel:"إزالة"},appIconPickerModal:{dialogAriaLabel:"اختيار أيقونة التطبيق",title:"اختيار أيقونة التطبيق",closeAriaLabel:"إغلاق",myImagesTab:"صوري",allImagesTab:"جميع الصور",uploadTab:"تحميل",searchPlaceholder:"البحث في الصور…",loadingText:"جارٍ التحميل…",noImagesFound:"لم يتم العثور على صور",noThumbnailText:"صورة",loadMoreButton:"تحميل المزيد",previewAlt:"معاينة",dropZoneText:"اسحب وأفلت أو انقر للتصفح",acceptedTypesInfo:"{types} · بحد أقصى {size} ميجابايت",cancelButton:"إلغاء",uploadingText:"جارٍ التحميل…",uploadAndUseButton:"تحميل واستخدام",useSelectedButton:"استخدام المحدد",invalidFileTypeError:"يُقبل فقط ملفات {types}.",fileTooLargeError:"يجب أن يكون حجم الصورة أقل من {size} ميجابايت.",uploadFailedError:"فشل التحميل."},chipGroupField:{addPlaceholder:"إضافة…",addButtonLabel:"إضافة"},dateTimeField:{requiredError:"{field} مطلوب"},dialcodeInputField:{requiredError:"{field} مطلوب",enterCodeMessage:"أدخل رمز الطلب للتحقق منه.",validMessage:"رمز الطلب صالح.",notFoundMessage:"رمز الطلب غير موجود.",validationFailedMessage:"فشل التحقق. يرجى المحاولة مرة أخرى.",placeholderExample:"مثال: A1B2C3",validateAriaLabel:"التحقق من رمز الطلب",validatingLabel:"جارٍ التحقق…",validateButtonLabel:"تحقق"},keywordSuggestField:{requiredError:"{field} مطلوب",inputPlaceholder:"اكتب واضغط Enter أو فاصلة…"},licenseSelectField:{requiredError:"{field} مطلوب",selectPlaceholder:"اختر ترخيصًا…"},multiSelectField:{requiredError:"{field} مطلوب",selectedCountSuffix:"محدد",selectPlaceholder:"اختر…",noOptionsMessage:"لا توجد خيارات"},nestedSelectField:{requiredError:"{field} مطلوب",selectPlaceholder:"اختر…"},radioField:{requiredError:"{field} مطلوب"},selectField:{requiredError:"{field} مطلوب",selectPlaceholder:"اختر…",noOptionsMessage:"لا توجد خيارات"},textField:{requiredError:"{field} مطلوب",maxLengthError:"الحد الأقصى {max} حرفًا"},assetBrowser:{dialogAriaLabel:"متصفح الأصول",title:"متصفح الأصول",closeAriaLabel:"إغلاق",browseTab:"تصفح",uploadTab:"تحميل",searchPlaceholder:"البحث في الأصول...",searchButton:"بحث",loadingMessage:"جارٍ التحميل...",uploadingMessage:"جارٍ التحميل...",chooseFileButton:"اختر ملفًا للتحميل"},resourceReorderDialog:{dialogAriaLabel:"نقل المورد",moveHeaderPrefix:"نقل",closeAriaLabel:"إغلاق",selectUnitHint:"اختر وحدة لنقل هذا المحتوى إليها:",noUnitsAvailable:"لا توجد وحدات أخرى متاحة",cancelButton:"إلغاء",moveButton:"نقل إلى هنا"},assignPageNumber:{dialogAriaLabel:"تعيين أرقام الصفحات",title:"تعيين أرقام الصفحات",closeAriaLabel:"إغلاق",emptyState:"لم يتم العثور على عناصر محتوى في هذه المجموعة.",contentColumnHeader:"المحتوى",pageNumberColumnHeader:"رقم الصفحة",cancelButton:"إلغاء",saveButton:"حفظ"},confirmDialog:{title:"تأكيد الحذف",confirmButton:"تأكيد",cancelButton:"إلغاء",closeAriaLabel:"إغلاق"},publishChecklist:{publishTitlePrefix:"نشر",closeAriaLabel:"إغلاق",confirmPublishPrefix:"هل أنت متأكد من رغبتك في نشر هذا",checklistInstructions:"يرجى تأكيد التحقق من جميع العناصر التالية (بتحديد مربعات الاختيار) قبل أن تتمكن من النشر:",noButton:"لا",yesButton:"نعم"},qualityParamsModal:{reviewQualityTitle:"مراجعة الجودة",rejectContentTitle:"رفض المحتوى",closeAriaLabel:"إغلاق",qualityScoreLabel:"درجة الجودة",scorePoorLabel:"0 — ضعيف",scoreExcellentLabel:"10 — ممتاز",commentLabel:"تعليق",optionalLabel:"(اختياري)",commentPlaceholder:"أضف أي ملاحظات لمنشئ المحتوى…",rejectionReasonLabel:"سبب الرفض",rejectReasonPlaceholder:"اذكر سبب رفض هذا المحتوى…",rejectionRequiredMessage:"سبب الرفض مطلوب.",cancelButton:"إلغاء",approveButton:"قبول",rejectButton:"رفض"},unsavedChangesModal:{title:"تغييرات غير محفوظة",closeAriaLabel:"إغلاق",bodyMessage:"لديك تغييرات غير محفوظة. هل تريد حفظها قبل المغادرة؟",cancelButton:"إلغاء",discardButton:"تجاهل",saveButton:"حفظ"},filterChips:{contentTypeFiltersAriaLabel:"مرشحات نوع المحتوى"},libraryCard:{alreadyAddedAriaLabel:"تمت إضافته مسبقًا",alreadyAddedTitle:"تمت إضافته مسبقًا إلى هذه المجموعة",addItemAriaLabel:"إضافة {name} إلى الوحدة",addToUnitTitle:"إضافة إلى الوحدة",selectUnitToAddTitle:"اختر وحدة للإضافة إليها",draftOnlyTitle:"يمكن إضافة المحتوى المسودة فقط"},libraryDock:{selectUnitFirstToast:"اختر وحدة أولاً",selectUnitFromOutlineToast:"اختر وحدة من المخطط التفصيلي لإضافة محتوى — لا يمكن إضافة الموارد مباشرة إلى الدورة.",itemAlreadyAddedToast:'"{name}" موجود مسبقًا في هذه المجموعة',itemAddedToast:'تمت إضافة "{name}"',collapseLibraryPanelAriaLabel:"طي لوحة المكتبة",collapseLibraryTitle:"طي المكتبة",headerTitle:"المكتبة",searchPlaceholder:"البحث في المحتوى…",searchAriaLabel:"البحث في المكتبة",sortAZAriaLabel:"الترتيب: أ–ي (انقر للأحدث)",sortRecentAriaLabel:"الترتيب: الأحدث (انقر لـ أ–ي)",sortAZTitle:"أ–ي",sortRecentTitle:"الأحدث",toggleAdvancedFiltersAriaLabel:"تبديل المرشحات المتقدمة",advancedFiltersTitle:"المرشحات المتقدمة",libraryContentAriaLabel:"محتوى المكتبة",loadMoreAriaLabel:"تحميل المزيد من المحتوى",loadingText:"جارٍ التحميل…",loadMoreText:"تحميل المزيد",noContentFound:"لم يتم العثور على محتوى",tryDifferentSearch:"جرّب بحثًا أو مرشحًا مختلفًا"},libraryFilterPanel:{boardLabel:"المجلس التعليمي",mediumLabel:"لغة التدريس",classLabel:"الصف",subjectLabel:"المادة",primaryCategoryLabel:"الفئة الأساسية",filterLibraryAriaLabel:"تصفية المكتبة",filtersHeaderTitle:"المرشحات",closeFiltersAriaLabel:"إغلاق المرشحات",resetButton:"إعادة تعيين",applyButton:"تطبيق"},libraryPreviewPanel:{contentPreviewAriaLabel:"معاينة المحتوى",closePreviewAriaLabel:"إغلاق المعاينة",addToUnitButton:"+ إضافة إلى الوحدة"},outlineTree:{maxDepthReachedToast:"تم الوصول إلى الحد الأقصى للعمق",downloadCsvFailedToast:"فشل تنزيل ملف CSV",outlineRefreshedToast:"تم تحديث مخطط الدورة.",outlineRefreshFailedToast:"تعذّر تحديث المخطط التفصيلي تلقائيًا. يرجى إعادة تحميل الصفحة.",moreOptionsAriaLabel:"خيارات إضافية",moreOptionsTitle:"خيارات إضافية",foldersExistTitle:'المجلدات موجودة مسبقًا — استخدم "تحديث" بدلاً من ذلك',createFoldersCsvButton:"إنشاء مجلدات باستخدام ملف csv",noFoldersYetTitle:'لا توجد مجلدات بعد — استخدم "إنشاء" أولاً',downloadFoldersCsvButton:"تنزيل المجلدات كملف csv",updateFoldersCsvButton:"تحديث بيانات المجلدات الوصفية باستخدام ملف csv",expandOutlineAriaLabel:"توسيع المخطط التفصيلي",collapseOutlineAriaLabel:"طي المخطط التفصيلي",addUnitButton:"إضافة وحدة",addSubunitButton:"إضافة وحدة فرعية"},treeNode:{expandAriaLabel:"توسيع",collapseAriaLabel:"طي",dropHereLabel:"أفلت هنا",nodeOptionsAriaLabel:"خيارات العنصر",renameMenuItem:"إعادة تسمية",addSubunitMenuItem:"إضافة وحدة فرعية",addSiblingMenuItem:"إضافة عنصر مماثل",deleteMenuItem:"حذف"},contentPlayer:{mimeLabelVideo:"فيديو",mimeLabelAudio:"صوت",mimeLabelPdf:"PDF",mimeLabelEpub:"ePub",mimeLabelEcml:"ECML",mimeLabelH5p:"H5P",mimeLabelScorm:"SCORM",mimeLabelOther:"محتوى",infoFieldAuthor:"المؤلف",infoFieldLicense:"الترخيص",infoFieldLanguage:"اللغة",infoFieldClass:"الصف",infoFieldSubject:"المادة",infoFieldType:"النوع",loadingPreview:"جارٍ تحميل المعاينة…",previewPlayerUnavailable:"مشغّل المعاينة غير متاح. تحقق من إمكانية الوصول إلى /content/preview.",failedToInitializePlayer:"فشل تهيئة مشغّل المحتوى.",previewPlayerLoadFailed:"تعذّر تحميل مشغّل المعاينة.",unableToLoadQuestionset:"تعذّر تحميل مجموعة الأسئلة:",parentQuestionsetNotResolved:"تعذّر تحديد مجموعة الأسئلة الرئيسية لهذا السؤال.",questionNotFoundInQuestionset:"لم يتم العثور على السؤال في مجموعة الأسئلة."},dialcodePanel:{title:"رمز الاستجابة السريعة (رمز الطلب)",invalidFormatError:"تنسيق رمز DIAL غير صالح. استخدم الأحرف الكبيرة والأرقام فقط (مثال: A1B2C3).",duplicateDialcodeError:'رمز DIAL "{code}" مرتبط مسبقًا بعنصر آخر في هذه المجموعة.',dialcodeNotFoundError:"رمز الطلب غير موجود. يرجى إدخال رمز صالح.",linkFailedError:"فشل ربط رمز الطلب. يرجى المحاولة مرة أخرى.",unlinkFailedError:"فشلت إزالة رمز الطلب. يرجى المحاولة مرة أخرى.",qrCodeAltPrefix:"رمز الاستجابة السريعة لـ",linkedCodeLabel:"الرمز المرتبط:",removeButton:"إزالة",noCodeLinkedMessage:"لا يوجد رمز استجابة سريعة مرتبط بهذا المحتوى.",linkManuallyLabel:"الربط يدويًا",dialcodeInputPlaceholder:"أدخل رمز الطلب (مثال: A1B2C3)",dialcodeInputAriaLabel:"إدخال رمز الطلب",linkButton:"ربط",linkedSuccessMessage:"تم ربط رمز الطلب بنجاح."},progressStatus:{unitsAddedLabel:"الوحدات المضافة",contentItemsLabel:"عناصر المحتوى",progressLabel:"التقدّم"},splitBuilderShell:{dropOntoUnitError:"أفلت على وحدة لإضافة محتوى",dropOntoCourseError:"أفلت المحتوى على وحدة، وليس مباشرة على الدورة.",alreadyInCollectionError:'"{name}" موجود مسبقًا في هذه المجموعة',addedToUnitSuccess:'تمت إضافة "{name}" إلى الوحدة',fillRequiredMetadataError:"يرجى تعبئة البيانات الوصفية المطلوبة",outlineAriaLabel:"مخطط الدورة",showOutlineTitle:"إظهار المخطط التفصيلي",editorAriaLabel:"محرر المحتوى",libraryAriaLabel:"مكتبة المحتوى",showLibraryTitle:"إظهار المكتبة"},topbar:{draftStatusFallback:"مسودة",backAriaLabel:"رجوع",statusAriaLabelPrefix:"الحالة:",savingIndicator:"جارٍ الحفظ…",unsavedIndicator:"غير محفوظ",savedIndicatorPrefix:"تم الحفظ",fillRequiredFieldsTooltip:"عبّئ جميع الحقول المطلوبة قبل الحفظ",saveAsDraftButton:"حفظ كمسودة",sendForReviewButton:"إرسال للمراجعة",collaboratorsLabel:"المتعاونون",qrCodesLabel:"رموز الاستجابة السريعة",generatingEllipsis:"جارٍ الإنشاء…",generateQrCodesMenuItem:"إنشاء رموز استجابة سريعة",downloadingEllipsis:"جارٍ التنزيل…",downloadQrCodesMenuItem:"تنزيل رموز الاستجابة السريعة",publishButton:"نشر",requestForChangesButton:"طلب إجراء تغييرات",approveButton:"قبول",qrGenerationStartedToast:'بدأ إنشاء رموز الاستجابة السريعة. استخدم "تنزيل رموز الاستجابة السريعة" عند الجهوز.',qrGenerationFailedToast:"فشل إنشاء رموز الاستجابة السريعة. يرجى المحاولة مرة أخرى.",qrCodesNotGeneratedToast:"لم يتم إنشاء أي رموز استجابة سريعة بعد. قم بإنشاء رموز الاستجابة السريعة أولاً.",qrGenerationInProgressToast:"إنشاء صور رموز الاستجابة السريعة قيد التنفيذ. يرجى المحاولة بالتنزيل بعد قليل.",qrCodesNotReadyToast:"رموز الاستجابة السريعة ليست جاهزة بعد. يرجى الانتظار والمحاولة مرة أخرى.",qrCodesDownloadedToast:"تم تنزيل رموز الاستجابة السريعة.",qrCodesDownloadFailedToast:"فشل تنزيل رموز الاستجابة السريعة.",requestChangesTitle:"طلب إجراء تغييرات",changesRequestedLabel:"تم طلب تغييرات",describeChangesPlaceholder:"اذكر التغييرات التي يجب على المؤلف إجراؤها"},reviewCommentModal:{closeAriaLabel:"إغلاق",fillCommentsError:"أضف تعليقات",cancelButton:"إلغاء"},confirmReviewModal:{closeAriaLabel:"إغلاق",title:"قبول الشروط والأحكام",agreementTextPart1:"أوافق على أنه بإرسال / نشر هذا المحتوى، فإنني أؤكد أن هذا المحتوى يتوافق مع الإرشادات المعتمدة، بما في ذلك شروط الاستخدام وسياسة المحتوى، وأني أوافق على نشره بموجب",creativeCommonsLinkText:"إطار عمل Creative Commons",agreementTextPart2:"وفقًا لـ",contentPolicyText:"سياسة المحتوى",agreementTextPart3:". وقد تحققت من أنني لا أنتهك حقوق النشر أو الخصوصية الخاصة بالآخرين.",cancelButton:"إلغاء",submitButton:"إرسال"},generateQRModal:{closeAriaLabel:"إغلاق",title:"إنشاء رموز الاستجابة السريعة",numberOfCodesLabel:"عدد رموز الاستجابة السريعة",countPlaceholder:"أدخل رقمًا (2–250)",countRangeError:"أدخل رقمًا بين 2 و 250.",cancelButton:"إلغاء",generateButton:"إنشاء"},chip:{remove:"إزالة"},dropZone:{dropHere:"أفلت هنا"},spinner:{loading:"جارٍ التحميل"},learningPath:{profileBadgeLabel:"مسار التعلم",pathStructureLabel:"بنية المسار",addLevelButton:"إضافة مستوى",levelNumberPrefix:"المستوى {n}",priorAssessmentLabel:"التقييم المسبق",priorAssessmentHint:"مطلوب دائمًا · لا يُحسب كمستوى",outcomeAssessmentLabel:"تقييم النتائج",outcomeAssessmentHint:"يؤكد النتيجة · لا يُحسب كمستوى",skillCheckBadge:"فحص المهارة",outcomeCheckBadge:"فحص النتيجة",assessmentCourseMeta:"مقرر · بنك أسئلة فقط",addAssessmentSlotButton:"إضافة {label} — مقرر يحتوي على بنك أسئلة فقط",requiredSlotBadge:"مطلوب",removeAssessmentSlotButton:"إزالة",deletePriorAssessmentConfirm:"حذف التقييم المسبق يزيل الدرجة التي يعتمد عليها التخطي التكيفي لهذا المسار. هل تريد الاستمرار؟",deleteAssessmentSlotConfirm:"هل تريد إزالة مقرر التقييم هذا من المسار؟",deleteLevelConfirm:'هل تريد حذف "{name}" وكل ما يحتويه؟',deleteCourseConfirm:"هل تريد إزالة هذا المقرر من المسار؟",deleteMultipleConfirm:"هل تريد حذف {count} من العناصر المحددة من المسار؟",courseNameUnavailable:"تفاصيل المقرر غير متوفرة",notAssessmentCourseToast:'"{name}" ليس مقررًا يحتوي على بنك أسئلة فقط، لذا لا يمكن استخدامه كتقييم.',bothSlotsFilledToast:"تم تعبئة تقييمي المسبق والنتائج بالفعل.",assessmentCheckFailedToast:"تعذر التحقق من هذا المقرر. حاول مرة أخرى.",skillsHeading:"المهارات",skillsOutOfScopeWarning:"خارج النطاق، يرجى إعادة الاختيار: {skills}",skillsUncoveredWarning:"لا يغطي أي مقرر هذه المهارات بعد: {skills}",skillUncoveredPillTitle:"لا يوجد مقرر مرتبط موسوم بهذه المهارة بعد",searchSkillsPlaceholder:"البحث عن المهارات",noSkillsAvailable:"لا توجد مهارات متاحة حتى الآن",noMatchingSkills:"لا توجد مهارات مطابقة",noSkillsSelectedYet:"لم يتم تحديد مهارات",removeSkillAriaLabel:"إزالة {skill}",skillScopeFromPriorNote:"اختر المهارات — من التقييم المسبق — التي يبنيها هذا المستوى. تُصفّي المكتبة المقررات وفق هذه المهارات.",skillScopeManualNote:"لا يوجد تقييم مسبق حتى الآن، فاختر من كتالوج المهارات العام. تُصفّي المكتبة المقررات وفق هذه المهارات.",skillsCoveredHeading:"المهارات المشمولة",skillsCoveredDescription:"جميع المهارات الموسومة عبر التقييم المسبق والمستويات وتقييم النتائج لهذا المسار.",noSkillsYet:"لا توجد مهارات بعد — أضف مقررات لرؤية المهارات هنا.",levelCountLabel:"{count} مستوى",levelCountLabelPlural:"{count} مستويات",courseCountLabel:"{count} مقرر",courseCountLabelPlural:"{count} مقررات",backToPathButton:"العودة إلى المسار",backToLevelButton:"العودة إلى {label}",courseDetailsLoading:"جارٍ تحميل تفاصيل المقرر…",courseDetailsEmpty:"لا يحتوي هذا المقرر على وحدات بعد.",courseDetailsError:"تعذر تحميل تفاصيل المقرر.",courseDetailsCardTitle:"تفاصيل المقرر",courseTitleFieldLabel:"العنوان",courseDescriptionFieldLabel:"الوصف",noCourseDescriptionPlaceholder:"لا يتوفر وصف.",unitsSectionLabel:"الوحدات",unitsSectionDescription:"تجمع الوحدات المحتوى المرتبط؛ كل عنصر محتوى موسوم بالمهارات التي يبنيها.",unitTopicsFieldLabel:"المواضيع",contentCountLabel:"{count} عنصر محتوى",contentCountLabelPlural:"{count} عناصر محتوى",courseUnitTopicsLabel:"{count} موضوع",courseUnitTopicsLabelPlural:"{count} مواضيع",verifyingAssessmentCourses:"جارٍ التحقق من مقررات التقييم…",resolveBeforePublishing:"حل هذه النقاط قبل النشر:",resolveBeforeSendingForReview:"حل هذه النقاط قبل الإرسال للمراجعة:",assessmentsCardHeading:"التقييم المسبق وتقييم النتائج",assessmentsCardDescription:"أضف المقررات التي تحتوي على بنك أسئلة فقط والتي تفتح وتغلق هذا المسار.",assessmentNotAddedYet:"لم تتم إضافته بعد — اختر مقررًا يحتوي على بنك أسئلة فقط من المكتبة.",viewCourseMenuItem:"عرض",priorAssessmentExplainerTitle:"لماذا لا يمكن تخطي هذا",priorAssessmentExplainerBody:"درجة بنك الأسئلة هذا هي ما يعتمد عليه كل مستوى لتحديد التخطي — ولا يوجد حتى الآن ما يُقارن به، لذا يُنفَّذ بالكامل دائمًا.",priorAssessmentPurposeLabel:"يحدد خط أساس المهارة",outcomeAssessmentExplainerTitle:"يُغلق المسار",outcomeAssessmentExplainerBody:"النجاح في بنك الأسئلة هذا هو ما يُصادق على اكتساب المهارة للمسار بأكمله — ودرجته هي ما تظهر في شهادة المتعلم.",outcomeUnlocksHint:"يُفتح بعد المستوى الأخير",assessmentCourseSectionTitle:"المقرر",assessmentCourseSectionDescription:"مقرر واحد يكون محتواه الوحيد بنك أسئلة — لا تنتمي هنا أي أنواع محتوى أخرى.",libraryOpenLevelToAdd:"افتح مستوى للإضافة",libraryAddToLevel:"إضافة إلى {level}",libraryAddPriorAssessmentCourse:"إضافة مقرر التقييم المسبق",libraryAddOutcomeAssessmentCourse:"إضافة مقرر تقييم النتائج",policyStrictLabel:"صارمة",policyStrictDescription:"يُنهي كل متعلم كل مستوى، بالترتيب — بصرف النظر عن درجة التقييم المسبق.",policyAdaptiveLabel:"تكيفية",policyAdaptiveDescriptionPre:"يمكن تخطي مستوى، ولكن فقط عندما تتجاوز درجة المتعلم في التقييم المسبق",policyAdaptiveDescriptionPost:" حد الإعفاء.",policyPriorLearningLabel:"التعلم المسبق",policyPriorLearningDescription:"يمكن أن يستند التخطي أيضًا إلى مهارات يمتلكها المتعلم بالفعل — شهادة موثقة أو مقرر سابق — لا التقييم وحده.",selectLevelFirstToast:"اختر مستوى أولاً",selectLevelFromOutlineToast:"افتح مستوى في هيكل المسار لإضافة المقررات — لا يمكن إضافة المقررات إلى المسار نفسه أو داخل مقرر آخر.",selectCurriculumFirstToast:"حدد المنهج (Curriculum) لهذا المسار قبل إضافة المقررات.",noCurriculumEmptyTitle:"لم يتم تحديد منهج",noCurriculumEmptyHint:"حدد منهجًا لهذا المسار لتصفح المقررات.",noSkillsEmptyTitle:"لم يتم تحديد مهارات",noSkillsEmptyHint:"حدد مهارات لهذا المستوى لرؤية المقررات المطابقة.",itemAlreadyInPathToast:'"{name}" موجود بالفعل في مسار التعلم هذا',addedToLevelSuccess:'تمت إضافة "{name}" إلى المستوى',dropOntoLevelError:"أفلِت على مستوى لإضافة مقرر",dropOntoPathError:"أفلِت المقررات على مستوى، وليس على مسار التعلم مباشرة.",priorSlotFilledToast:"التقييم المسبق يحتوي على مقرر بالفعل — أزِله قبل إضافة مقرر آخر.",outcomeSlotFilledToast:"التقييم الختامي يحتوي على مقرر بالفعل — أزِله قبل إضافة مقرر آخر.",coursesRemovedFrameworkChangeToast:"تمت إزالة {count} من المقررات المرتبطة بمنهج مختلف من هذا المسار.",levelSkillsResetFrameworkChangeToast:"تم مسح المهارات المختارة في {count} من المستويات — فهي لا تنطبق على المنهج الجديد.",priorAssessmentNarrowedScopeToast:"أدى التقييم المسبق إلى تضييق نطاق المهارات — أصبح لدى {count} من المستويات مهارات خارج هذا النطاق."}},cb={contextualEditor:{emptyStateMessage:"Sélectionnez une unité dans le plan pour modifier ses détails",reviewCommentLabel:"Commentaire du réviseur :",untitledPlaceholder:"Sans titre",nodeTitleAriaLabel:"Titre du nœud",dropZoneLabel:"Déposez ici pour ajouter du contenu à cette unité"},languageSelector:{ariaLabel:"Sélectionner la langue"},collectionEditor:{errorBoundaryTitle:"Une erreur s'est produite",retryButton:"Réessayer",loadingMessage:"Chargement de l'éditeur...",loadErrorTitle:"Échec du chargement de l'éditeur"},breadcrumb:{nodePathAriaLabel:"Chemin du nœud",homeAriaLabel:"Accueil"},tabBar:{detailsTab:"Détails",audienceCurriculumTab:"Public et programme",licensingTab:"Licence",metadataSectionsAriaLabel:"Sections de métadonnées",hasErrorsAriaLabel:"Contient des erreurs"},contentEditForm:{moveToAnotherUnitButton:"Déplacer vers une autre unité",collapseMetadataPanelAriaLabel:"Réduire le panneau de métadonnées",expandMetadataPanelAriaLabel:"Développer le panneau de métadonnées",collapseTitle:"Réduire",expandTitle:"Développer",iconAlt:"icône",contentNamePlaceholder:"Nom du contenu",keywordsLabel:"Mots-clés",addKeywordPlaceholder:"Ajoutez un mot-clé et appuyez sur Entrée",addButton:"Ajouter",optionalInCollectionLabel:"Facultatif dans la collection",yesOption:"Oui",noOption:"Non"},titleAppIcon:{selectAppIconAriaLabel:"Sélectionner l'icône de l'application",appIconAriaLabel:"Icône de l'application",appIconAlt:"Icône de l'application",removeIconAriaLabel:"Supprimer l'icône"},unitContentList:{removeConfirm:"Retirer ce contenu de l'unité ?",heading:"Contenu de cette unité",emptyTitle:"Aucun contenu pour le moment",emptyHint:"Faites glisser depuis la bibliothèque ou cliquez sur Ajouter du contenu",addContentAriaLabel:"Ajouter du contenu à l'unité",addContent:"Ajouter du contenu"},contentRow:{dragToReorderAriaLabel:"Faire glisser pour réorganiser",removeAriaLabel:"Supprimer {name}"},csvUpload:{invalidFileType:"Seuls les fichiers .csv sont acceptés.",fileTooLarge:"La taille du fichier ne doit pas dépasser 50 Mo.",downloadSampleFailed:"Échec du téléchargement de l'exemple de CSV.",processingFailed:"Le traitement du téléversement a échoué. Veuillez vérifier les lignes en erreur ci-dessous.",connectionLost:"Connexion perdue pendant la vérification du statut. Veuillez réessayer.",uploadFailed:"Le téléversement a échoué. Veuillez vérifier votre fichier et réessayer.",statusUploading:"Téléversement en cours...",statusProcessing:"Traitement en cours...",statusDone:"Terminé !",statusError:"Erreur",titleUpdate:"Mettre à jour les métadonnées des dossiers via CSV",titleCreate:"Créer des dossiers via CSV",closeAriaLabel:"Fermer",dropZoneAriaLabel:"Déposez le fichier CSV ici ou cliquez pour parcourir",dropText:"Faites glisser et déposez votre CSV ici",dropSubtext:"ou cliquez pour parcourir",downloadSample:"Télécharger l'exemple de CSV",itemsImportedSuffix:"— {count} élément(s) importé(s)",failedRowsTitle:"Lignes en échec ({count})",rowHeader:"Ligne",nameHeader:"Nom",reasonHeader:"Raison",unknownError:"Erreur inconnue",cancel:"Annuler",uploaded:"Téléversé",upload:"Téléverser"},manageCollaborators:{saveFailed:"Échec de l'enregistrement des collaborateurs. Veuillez réessayer.",title:"Gérer les collaborateurs",closeAriaLabel:"Fermer",searchUsersLabel:"Rechercher des utilisateurs",searchPlaceholder:"Rechercher par nom ou e-mail...",searchingAriaLabel:"Recherche en cours...",searchResultsAriaLabel:"Résultats de recherche",add:"Ajouter",noUsersFound:"Aucun utilisateur trouvé.",currentCollaborators:"Collaborateurs actuels",noCollaboratorsYet:"Aucun collaborateur ajouté pour le moment.",remove:"Retirer",saveSuccess:"Collaborateurs enregistrés avec succès.",cancel:"Annuler",save:"Enregistrer"},sparkMetaForm:{shuffleEnabledMessage:"La lecture aléatoire est activée pour cet ensemble de questions.",noFieldsMessage:"Aucun champ configuré pour cet onglet."},appIconField:{requiredError:"{field} est requis",selectIconAriaLabel:"Sélectionner l'icône de l'application",iconAlt:"Icône de l'application",selectIconLabel:"Sélectionner l'icône",removeIconAriaLabel:"Supprimer l'icône de l'application",removeLabel:"Supprimer"},appIconPickerModal:{dialogAriaLabel:"Sélectionner l'icône de l'application",title:"Sélectionner l'icône de l'application",closeAriaLabel:"Fermer",myImagesTab:"Mes images",allImagesTab:"Toutes les images",uploadTab:"Téléverser",searchPlaceholder:"Rechercher des images…",loadingText:"Chargement…",noImagesFound:"Aucune image trouvée",noThumbnailText:"IMG",loadMoreButton:"Charger plus",previewAlt:"Aperçu",dropZoneText:"Faites glisser et déposez ou cliquez pour parcourir",acceptedTypesInfo:"{types} · max {size} Mo",cancelButton:"Annuler",uploadingText:"Téléversement…",uploadAndUseButton:"Téléverser et utiliser",useSelectedButton:"Utiliser la sélection",invalidFileTypeError:"Seuls les fichiers {types} sont acceptés.",fileTooLargeError:"L'image doit faire moins de {size} Mo.",uploadFailedError:"Le téléversement a échoué."},chipGroupField:{addPlaceholder:"Ajouter…",addButtonLabel:"Ajouter"},dateTimeField:{requiredError:"{field} est requis"},dialcodeInputField:{requiredError:"{field} est requis",enterCodeMessage:"Saisissez un code d'appel à valider.",validMessage:"Le code d'appel est valide.",notFoundMessage:"Code d'appel introuvable.",validationFailedMessage:"La validation a échoué. Veuillez réessayer.",placeholderExample:"ex. A1B2C3",validateAriaLabel:"Valider le code d'appel",validatingLabel:"Validation en cours…",validateButtonLabel:"Valider"},keywordSuggestField:{requiredError:"{field} est requis",inputPlaceholder:"Saisissez et appuyez sur Entrée ou virgule…"},licenseSelectField:{requiredError:"{field} est requis",selectPlaceholder:"Sélectionner une licence…"},multiSelectField:{requiredError:"{field} est requis",selectedCountSuffix:"sélectionné(s)",selectPlaceholder:"Sélectionner…",noOptionsMessage:"Aucune option"},nestedSelectField:{requiredError:"{field} est requis",selectPlaceholder:"Sélectionner…"},radioField:{requiredError:"{field} est requis"},selectField:{requiredError:"{field} est requis",selectPlaceholder:"Sélectionner…",noOptionsMessage:"Aucune option"},textField:{requiredError:"{field} est requis",maxLengthError:"Maximum {max} caractères"},assetBrowser:{dialogAriaLabel:"Navigateur de ressources",title:"Navigateur de ressources",closeAriaLabel:"Fermer",browseTab:"Parcourir",uploadTab:"Téléverser",searchPlaceholder:"Rechercher des ressources...",searchButton:"Rechercher",loadingMessage:"Chargement...",uploadingMessage:"Téléversement...",chooseFileButton:"Choisir un fichier à téléverser"},resourceReorderDialog:{dialogAriaLabel:"Déplacer la ressource",moveHeaderPrefix:"Déplacer",closeAriaLabel:"Fermer",selectUnitHint:"Sélectionnez une unité vers laquelle déplacer ce contenu :",noUnitsAvailable:"Aucune autre unité disponible",cancelButton:"Annuler",moveButton:"Déplacer ici"},assignPageNumber:{dialogAriaLabel:"Attribuer des numéros de page",title:"Attribuer des numéros de page",closeAriaLabel:"Fermer",emptyState:"Aucun élément de contenu trouvé dans cette collection.",contentColumnHeader:"Contenu",pageNumberColumnHeader:"Numéro de page",cancelButton:"Annuler",saveButton:"Enregistrer"},confirmDialog:{title:"Confirmer la suppression",confirmButton:"Confirmer",cancelButton:"Annuler",closeAriaLabel:"Fermer"},publishChecklist:{publishTitlePrefix:"Publier",closeAriaLabel:"Fermer",confirmPublishPrefix:"Êtes-vous sûr de vouloir publier ce",checklistInstructions:"Veuillez confirmer que TOUS les éléments suivants sont vérifiés (en cochant les cases) avant de pouvoir publier :",noButton:"Non",yesButton:"Oui"},qualityParamsModal:{reviewQualityTitle:"Évaluer la qualité",rejectContentTitle:"Rejeter le contenu",closeAriaLabel:"Fermer",qualityScoreLabel:"Score de qualité",scorePoorLabel:"0 — Faible",scoreExcellentLabel:"10 — Excellent",commentLabel:"Commentaire",optionalLabel:"(facultatif)",commentPlaceholder:"Ajoutez des remarques pour le créateur du contenu…",rejectionReasonLabel:"Motif du rejet",rejectReasonPlaceholder:"Décrivez pourquoi ce contenu est rejeté…",rejectionRequiredMessage:"Un motif de rejet est requis.",cancelButton:"Annuler",approveButton:"Approuver",rejectButton:"Rejeter"},unsavedChangesModal:{title:"Modifications non enregistrées",closeAriaLabel:"Fermer",bodyMessage:"Vous avez des modifications non enregistrées. Souhaitez-vous les enregistrer avant de quitter ?",cancelButton:"Annuler",discardButton:"Ignorer",saveButton:"Enregistrer"},filterChips:{contentTypeFiltersAriaLabel:"Filtres par type de contenu"},libraryCard:{alreadyAddedAriaLabel:"Déjà ajouté",alreadyAddedTitle:"Déjà ajouté à cette collection",addItemAriaLabel:"Ajouter {name} à l'unité",addToUnitTitle:"Ajouter à l'unité",selectUnitToAddTitle:"Sélectionner une unité pour ajouter",draftOnlyTitle:"Seul le contenu à l'état de brouillon peut être ajouté"},libraryDock:{selectUnitFirstToast:"Sélectionnez d'abord une unité",selectUnitFromOutlineToast:"Sélectionnez une unité dans le plan pour ajouter du contenu — les ressources ne peuvent pas être ajoutées directement au cours.",itemAlreadyAddedToast:"« {name} » est déjà dans cette collection",itemAddedToast:"« {name} » ajouté",collapseLibraryPanelAriaLabel:"Réduire le panneau de la bibliothèque",collapseLibraryTitle:"Réduire la bibliothèque",headerTitle:"Bibliothèque",searchPlaceholder:"Rechercher du contenu…",searchAriaLabel:"Rechercher dans la bibliothèque",sortAZAriaLabel:"Trier : A–Z (cliquer pour Récent)",sortRecentAriaLabel:"Trier : Récent (cliquer pour A–Z)",sortAZTitle:"A–Z",sortRecentTitle:"Récent",toggleAdvancedFiltersAriaLabel:"Afficher/masquer les filtres avancés",advancedFiltersTitle:"Filtres avancés",libraryContentAriaLabel:"Contenu de la bibliothèque",loadMoreAriaLabel:"Charger plus de contenu",loadingText:"Chargement…",loadMoreText:"Charger plus",noContentFound:"Aucun contenu trouvé",tryDifferentSearch:"Essayez une autre recherche ou un autre filtre"},libraryFilterPanel:{boardLabel:"Conseil",mediumLabel:"Médium",classLabel:"Classe",subjectLabel:"Matière",primaryCategoryLabel:"Catégorie principale",filterLibraryAriaLabel:"Filtrer la bibliothèque",filtersHeaderTitle:"Filtres",closeFiltersAriaLabel:"Fermer les filtres",resetButton:"Réinitialiser",applyButton:"Appliquer"},libraryPreviewPanel:{contentPreviewAriaLabel:"Aperçu du contenu",closePreviewAriaLabel:"Fermer l'aperçu",addToUnitButton:"+ Ajouter à l'unité"},outlineTree:{maxDepthReachedToast:"Profondeur maximale atteinte",downloadCsvFailedToast:"Échec du téléchargement du CSV",outlineRefreshedToast:"Plan du cours actualisé.",outlineRefreshFailedToast:"Le plan n'a pas pu être actualisé automatiquement. Veuillez recharger la page.",moreOptionsAriaLabel:"Plus d'options",moreOptionsTitle:"Plus d'options",foldersExistTitle:"Des dossiers existent déjà — utilisez « Mettre à jour » à la place",createFoldersCsvButton:"Créer des dossiers à partir d'un fichier CSV",noFoldersYetTitle:"Aucun dossier pour le moment — utilisez d'abord « Créer »",downloadFoldersCsvButton:"Télécharger les dossiers en fichier CSV",updateFoldersCsvButton:"Mettre à jour les métadonnées des dossiers à partir d'un fichier CSV",expandOutlineAriaLabel:"Développer le plan",collapseOutlineAriaLabel:"Réduire le plan",addUnitButton:"Ajouter une unité",addSubunitButton:"Ajouter une sous-unité"},treeNode:{expandAriaLabel:"Développer",collapseAriaLabel:"Réduire",dropHereLabel:"Déposer ici",nodeOptionsAriaLabel:"Options du nœud",renameMenuItem:"Renommer",addSubunitMenuItem:"Ajouter une sous-unité",addSiblingMenuItem:"Ajouter un élément au même niveau",deleteMenuItem:"Supprimer"},contentPlayer:{mimeLabelVideo:"Vidéo",mimeLabelAudio:"Audio",mimeLabelPdf:"PDF",mimeLabelEpub:"ePub",mimeLabelEcml:"ECML",mimeLabelH5p:"H5P",mimeLabelScorm:"SCORM",mimeLabelOther:"Contenu",infoFieldAuthor:"Auteur",infoFieldLicense:"Licence",infoFieldLanguage:"Langue",infoFieldClass:"Classe",infoFieldSubject:"Matière",infoFieldType:"Type",loadingPreview:"Chargement de l'aperçu…",previewPlayerUnavailable:"Lecteur d'aperçu indisponible. Vérifiez que /content/preview est accessible.",failedToInitializePlayer:"Échec de l'initialisation du lecteur de contenu.",previewPlayerLoadFailed:"Le lecteur d'aperçu n'a pas pu être chargé.",unableToLoadQuestionset:"Impossible de charger l'ensemble de questions :",parentQuestionsetNotResolved:"Impossible de résoudre l'ensemble de questions parent pour cette question.",questionNotFoundInQuestionset:"Question introuvable dans l'ensemble de questions."},dialcodePanel:{title:"Code QR (Dialcode)",invalidFormatError:"Format de code DIAL invalide. Utilisez uniquement des lettres majuscules et des chiffres (ex. A1B2C3).",duplicateDialcodeError:"Le code DIAL « {code} » est déjà associé à un autre nœud de cette collection.",dialcodeNotFoundError:"Code d'appel introuvable. Veuillez saisir un code valide.",linkFailedError:"Échec de l'association du code d'appel. Veuillez réessayer.",unlinkFailedError:"Échec de la suppression du code d'appel. Veuillez réessayer.",qrCodeAltPrefix:"Code QR pour",linkedCodeLabel:"Code associé :",removeButton:"Supprimer",noCodeLinkedMessage:"Aucun code QR associé à ce contenu.",linkManuallyLabel:"Associer manuellement",dialcodeInputPlaceholder:"Saisissez le code d'appel (ex. A1B2C3)",dialcodeInputAriaLabel:"Champ de saisie du code d'appel",linkButton:"Associer",linkedSuccessMessage:"Code d'appel associé avec succès."},progressStatus:{unitsAddedLabel:"Unités ajoutées",contentItemsLabel:"Éléments de contenu",progressLabel:"Progression"},splitBuilderShell:{dropOntoUnitError:"Déposez sur une unité pour ajouter du contenu",dropOntoCourseError:"Déposez le contenu sur une unité, pas directement sur le cours.",alreadyInCollectionError:"« {name} » est déjà dans cette collection",addedToUnitSuccess:"« {name} » ajouté à l'unité",fillRequiredMetadataError:"Veuillez renseigner les métadonnées requises",outlineAriaLabel:"Plan du cours",showOutlineTitle:"Afficher le plan",editorAriaLabel:"Éditeur de contenu",libraryAriaLabel:"Bibliothèque de contenu",showLibraryTitle:"Afficher la bibliothèque"},topbar:{draftStatusFallback:"Brouillon",backAriaLabel:"Retour",statusAriaLabelPrefix:"Statut :",savingIndicator:"Enregistrement…",unsavedIndicator:"Non enregistré",savedIndicatorPrefix:"Enregistré",fillRequiredFieldsTooltip:"Renseignez tous les champs requis avant d'enregistrer",saveAsDraftButton:"Enregistrer comme brouillon",sendForReviewButton:"Envoyer pour révision",collaboratorsLabel:"Collaborateurs",qrCodesLabel:"Codes QR",generatingEllipsis:"Génération en cours…",generateQrCodesMenuItem:"Générer des codes QR",downloadingEllipsis:"Téléchargement…",downloadQrCodesMenuItem:"Télécharger les codes QR",publishButton:"Publier",requestForChangesButton:"Demander des modifications",approveButton:"Approuver",qrGenerationStartedToast:"La génération des codes QR a démarré. Utilisez « Télécharger les codes QR » une fois prêts.",qrGenerationFailedToast:"Échec de la génération des codes QR. Veuillez réessayer.",qrCodesNotGeneratedToast:"Aucun code QR généré pour le moment. Générez d'abord des codes QR.",qrGenerationInProgressToast:"La génération des images de codes QR est en cours. Veuillez réessayer le téléchargement dans quelques instants.",qrCodesNotReadyToast:"Les codes QR ne sont pas encore prêts. Veuillez patienter et réessayer.",qrCodesDownloadedToast:"Codes QR téléchargés.",qrCodesDownloadFailedToast:"Échec du téléchargement des codes QR.",requestChangesTitle:"Demander des modifications",changesRequestedLabel:"Modifications demandées",describeChangesPlaceholder:"Décrivez les modifications que l'auteur doit apporter"},reviewCommentModal:{closeAriaLabel:"Fermer",fillCommentsError:"Renseignez les commentaires",cancelButton:"Annuler"},confirmReviewModal:{closeAriaLabel:"Fermer",title:"Acceptation des conditions générales",agreementTextPart1:"J'accepte qu'en soumettant / publiant ce contenu, je confirme qu'il est conforme aux directives prescrites, y compris les conditions d'utilisation et la politique de contenu, et que je consens à le publier selon le",creativeCommonsLinkText:"cadre Creative Commons",agreementTextPart2:"conformément à la",contentPolicyText:"politique de contenu",agreementTextPart3:". Je me suis assuré(e) de ne pas porter atteinte aux droits d'auteur ou à la vie privée d'autrui.",cancelButton:"Annuler",submitButton:"Soumettre"},generateQRModal:{closeAriaLabel:"Fermer",title:"Générer des codes QR",numberOfCodesLabel:"Nombre de codes QR",countPlaceholder:"Saisissez un nombre (2–250)",countRangeError:"Saisissez un nombre entre 2 et 250.",cancelButton:"Annuler",generateButton:"Générer"},chip:{remove:"Supprimer"},dropZone:{dropHere:"Déposer ici"},spinner:{loading:"Chargement"},learningPath:{profileBadgeLabel:"Parcours d'apprentissage",pathStructureLabel:"Structure du parcours",addLevelButton:"Ajouter un niveau",levelNumberPrefix:"Niveau {n}",priorAssessmentLabel:"Évaluation préalable",priorAssessmentHint:"Toujours requise · ne compte pas comme un niveau",outcomeAssessmentLabel:"Évaluation finale",outcomeAssessmentHint:"Confirme le résultat · ne compte pas comme un niveau",skillCheckBadge:"Vérification des compétences",outcomeCheckBadge:"Vérification du résultat",assessmentCourseMeta:"Cours · Questionnaire uniquement",addAssessmentSlotButton:"Ajouter {label} — un cours contenant uniquement un questionnaire",requiredSlotBadge:"Obligatoire",removeAssessmentSlotButton:"Retirer",deletePriorAssessmentConfirm:"Supprimer l'évaluation préalable retire le score sur lequel se basent les sauts adaptatifs de ce parcours. Continuer ?",deleteAssessmentSlotConfirm:"Retirer ce cours d'évaluation du parcours ?",deleteLevelConfirm:"Supprimer « {name} » et tout son contenu ?",deleteCourseConfirm:"Retirer ce cours du parcours ?",deleteMultipleConfirm:"Supprimer les {count} éléments sélectionnés du parcours ?",courseNameUnavailable:"Détails du cours indisponibles",notAssessmentCourseToast:"« {name} » n'est pas un cours composé uniquement d'un questionnaire, il ne peut donc pas être utilisé comme évaluation.",bothSlotsFilledToast:"Les évaluations préalable et finale sont déjà renseignées.",assessmentCheckFailedToast:"Impossible de vérifier ce cours. Veuillez réessayer.",skillsHeading:"Compétences",skillsOutOfScopeWarning:"Hors du périmètre, veuillez resélectionner : {skills}",skillsUncoveredWarning:"Aucun cours ne couvre encore : {skills}",skillUncoveredPillTitle:"Aucun cours associé n'est encore étiqueté avec cette compétence",searchSkillsPlaceholder:"Rechercher des compétences",noSkillsAvailable:"Aucune compétence disponible pour le moment",noMatchingSkills:"Aucune compétence correspondante",noSkillsSelectedYet:"Aucune compétence sélectionnée",removeSkillAriaLabel:"Supprimer {skill}",skillScopeFromPriorNote:"Choisissez les compétences — issues de l'évaluation préalable — que ce niveau développe. La bibliothèque filtre les cours selon ces compétences.",skillScopeManualNote:"Aucune évaluation préalable pour le moment — choisissez dans le catalogue général des compétences. La bibliothèque filtre les cours selon ces compétences.",skillsCoveredHeading:"Compétences couvertes",skillsCoveredDescription:"Toutes les compétences associées à l'évaluation préalable, aux niveaux et à l'évaluation finale de ce parcours.",noSkillsYet:"Aucune compétence pour le moment — ajoutez des cours pour voir les compétences ici.",levelCountLabel:"{count} niveau",levelCountLabelPlural:"{count} niveaux",courseCountLabel:"{count} cours",courseCountLabelPlural:"{count} cours",backToPathButton:"Retour au parcours",backToLevelButton:"Retour à {label}",courseDetailsLoading:"Chargement des détails du cours…",courseDetailsEmpty:"Ce cours ne contient pas encore d'unités.",courseDetailsError:"Impossible de charger les détails du cours.",courseDetailsCardTitle:"Détails du cours",courseTitleFieldLabel:"Titre",courseDescriptionFieldLabel:"Description",noCourseDescriptionPlaceholder:"Aucune description disponible.",unitsSectionLabel:"Unités",unitsSectionDescription:"Les unités regroupent le contenu associé ; chaque contenu est associé aux compétences qu'il développe.",unitTopicsFieldLabel:"Sujets",contentCountLabel:"{count} contenu",contentCountLabelPlural:"{count} contenus",courseUnitTopicsLabel:"{count} sujet",courseUnitTopicsLabelPlural:"{count} sujets",verifyingAssessmentCourses:"Vérification des cours d'évaluation…",resolveBeforePublishing:"Résolvez les points suivants avant de publier :",resolveBeforeSendingForReview:"Résolvez les points suivants avant d'envoyer pour révision :",assessmentsCardHeading:"Évaluations préalable et finale",assessmentsCardDescription:"Ajoutez les cours composés uniquement d'un questionnaire qui ouvrent et ferment ce parcours.",assessmentNotAddedYet:"Pas encore ajouté — choisissez un cours composé uniquement d'un questionnaire dans la bibliothèque.",viewCourseMenuItem:"Voir",priorAssessmentExplainerTitle:"Pourquoi cela ne peut pas être ignoré",priorAssessmentExplainerBody:"Le score de ce questionnaire est ce que chaque niveau utilise pour décider d'un saut — il n'y a encore rien à comparer, donc il s'exécute toujours en entier.",priorAssessmentPurposeLabel:"Établit la base de compétences",outcomeAssessmentExplainerTitle:"Termine le parcours",outcomeAssessmentExplainerBody:"Réussir ce questionnaire certifie l'acquisition de la compétence pour l'ensemble du parcours — son score est celui qui apparaît sur le certificat de l'apprenant.",outcomeUnlocksHint:"Se débloque après le dernier niveau",assessmentCourseSectionTitle:"Cours",assessmentCourseSectionDescription:"Un seul cours dont le seul contenu est un questionnaire — aucun autre type de contenu n'a sa place ici.",libraryOpenLevelToAdd:"Ouvrez un niveau pour ajouter",libraryAddToLevel:"Ajouter à {level}",libraryAddPriorAssessmentCourse:"Ajouter le cours d'évaluation préalable",libraryAddOutcomeAssessmentCourse:"Ajouter le cours d'évaluation finale",policyStrictLabel:"Strict",policyStrictDescription:"Chaque apprenant termine chaque niveau, dans l'ordre — quel que soit le score de l'évaluation préalable.",policyAdaptiveLabel:"Adaptatif",policyAdaptiveDescriptionPre:"Un niveau peut être ignoré, mais seulement si le score de l'apprenant à l'Évaluation préalable",policyAdaptiveDescriptionPost:" dépasse le seuil de dispense.",policyPriorLearningLabel:"Acquis antérieurs",policyPriorLearningDescription:"Les sauts peuvent aussi s'appuyer sur des compétences déjà détenues par l'apprenant — un certificat vérifié ou un cours antérieur — pas seulement l'évaluation.",selectLevelFirstToast:"Sélectionnez d'abord un niveau",selectLevelFromOutlineToast:"Ouvrez un niveau dans la structure du parcours pour ajouter des cours — les cours ne peuvent pas être ajoutés au parcours lui-même ni sous un autre cours.",selectCurriculumFirstToast:"Sélectionnez un programme (Curriculum) pour ce parcours avant d'ajouter des cours.",noCurriculumEmptyTitle:"Aucun programme sélectionné",noCurriculumEmptyHint:"Sélectionnez un programme (Curriculum) pour ce parcours afin de parcourir les cours.",noSkillsEmptyTitle:"Aucune compétence sélectionnée",noSkillsEmptyHint:"Sélectionnez des compétences pour ce niveau afin de voir les cours correspondants.",itemAlreadyInPathToast:"« {name} » fait déjà partie de ce parcours d'apprentissage",addedToLevelSuccess:"« {name} » ajouté au niveau",dropOntoLevelError:"Déposez sur un niveau pour ajouter un cours",dropOntoPathError:"Déposez les cours sur un niveau, pas directement sur le parcours d'apprentissage.",priorSlotFilledToast:"L'Évaluation préalable contient déjà un cours — retirez-le avant d'en ajouter un autre.",outcomeSlotFilledToast:"L'Évaluation finale contient déjà un cours — retirez-le avant d'en ajouter un autre.",coursesRemovedFrameworkChangeToast:"{count} cours associé(s) à un autre curriculum ont été retirés de ce parcours.",levelSkillsResetFrameworkChangeToast:"{count} niveau(x) ont eu leurs compétences sélectionnées effacées — elles ne s'appliquent pas au nouveau curriculum.",priorAssessmentNarrowedScopeToast:"L'évaluation préalable a réduit le périmètre des compétences — {count} niveau(x) ont désormais des compétences hors de ce périmètre."}},db={contextualEditor:{emptyStateMessage:"Selecione uma unidade no esquema para editar seus detalhes",reviewCommentLabel:"Comentário do revisor:",untitledPlaceholder:"Sem título",nodeTitleAriaLabel:"Título do nó",dropZoneLabel:"Solte para adicionar conteúdo a esta unidade"},languageSelector:{ariaLabel:"Selecionar idioma"},collectionEditor:{errorBoundaryTitle:"Algo deu errado",retryButton:"Tentar novamente",loadingMessage:"Carregando editor...",loadErrorTitle:"Falha ao carregar o editor"},breadcrumb:{nodePathAriaLabel:"Caminho do nó",homeAriaLabel:"Início"},tabBar:{detailsTab:"Detalhes",audienceCurriculumTab:"Público e Currículo",licensingTab:"Licenciamento",metadataSectionsAriaLabel:"Seções de metadados",hasErrorsAriaLabel:"Contém erros"},contentEditForm:{moveToAnotherUnitButton:"Mover para outra unidade",collapseMetadataPanelAriaLabel:"Recolher painel de metadados",expandMetadataPanelAriaLabel:"Expandir painel de metadados",collapseTitle:"Recolher",expandTitle:"Expandir",iconAlt:"ícone",contentNamePlaceholder:"Nome do conteúdo",keywordsLabel:"Palavras-chave",addKeywordPlaceholder:"Adicione uma palavra-chave e pressione Enter",addButton:"Adicionar",optionalInCollectionLabel:"Opcional na coleção",yesOption:"Sim",noOption:"Não"},titleAppIcon:{selectAppIconAriaLabel:"Selecionar ícone do aplicativo",appIconAriaLabel:"Ícone do aplicativo",appIconAlt:"Ícone do aplicativo",removeIconAriaLabel:"Remover ícone"},unitContentList:{removeConfirm:"Remover este conteúdo da unidade?",heading:"Conteúdo nesta unidade",emptyTitle:"Ainda não há conteúdo",emptyHint:"Arraste da biblioteca ou clique em Adicionar conteúdo",addContentAriaLabel:"Adicionar conteúdo à unidade",addContent:"Adicionar conteúdo"},contentRow:{dragToReorderAriaLabel:"Arrastar para reordenar",removeAriaLabel:"Remover {name}"},csvUpload:{invalidFileType:"Somente arquivos .csv são aceitos.",fileTooLarge:"O tamanho do arquivo não deve exceder 50 MB.",downloadSampleFailed:"Falha ao baixar o CSV de exemplo.",processingFailed:"Falha no processamento do upload. Verifique as linhas com erro abaixo.",connectionLost:"Conexão perdida ao verificar o status. Tente novamente.",uploadFailed:"Falha no envio. Verifique seu arquivo e tente novamente.",statusUploading:"Enviando...",statusProcessing:"Processando...",statusDone:"Concluído!",statusError:"Erro",titleUpdate:"Atualizar metadados das pastas via CSV",titleCreate:"Criar pastas via CSV",closeAriaLabel:"Fechar",dropZoneAriaLabel:"Solte o arquivo CSV aqui ou clique para procurar",dropText:"Arraste e solte seu CSV aqui",dropSubtext:"ou clique para procurar",downloadSample:"Baixar CSV de exemplo",itemsImportedSuffix:"— {count} item(ns) importado(s)",failedRowsTitle:"Linhas com falha ({count})",rowHeader:"Linha",nameHeader:"Nome",reasonHeader:"Motivo",unknownError:"Erro desconhecido",cancel:"Cancelar",uploaded:"Enviado",upload:"Enviar"},manageCollaborators:{saveFailed:"Falha ao salvar colaboradores. Tente novamente.",title:"Gerenciar colaboradores",closeAriaLabel:"Fechar",searchUsersLabel:"Buscar usuários",searchPlaceholder:"Buscar por nome ou e-mail...",searchingAriaLabel:"Buscando...",searchResultsAriaLabel:"Resultados da busca",add:"Adicionar",noUsersFound:"Nenhum usuário encontrado.",currentCollaborators:"Colaboradores atuais",noCollaboratorsYet:"Nenhum colaborador adicionado ainda.",remove:"Remover",saveSuccess:"Colaboradores salvos com sucesso.",cancel:"Cancelar",save:"Salvar"},sparkMetaForm:{shuffleEnabledMessage:"A ordem aleatória está ativada para este conjunto de questões.",noFieldsMessage:"Nenhum campo configurado para esta aba."},appIconField:{requiredError:"{field} é obrigatório",selectIconAriaLabel:"Selecionar ícone do aplicativo",iconAlt:"Ícone do aplicativo",selectIconLabel:"Selecionar ícone",removeIconAriaLabel:"Remover ícone do aplicativo",removeLabel:"Remover"},appIconPickerModal:{dialogAriaLabel:"Selecionar ícone do aplicativo",title:"Selecionar ícone do aplicativo",closeAriaLabel:"Fechar",myImagesTab:"Minhas imagens",allImagesTab:"Todas as imagens",uploadTab:"Enviar",searchPlaceholder:"Buscar imagens…",loadingText:"Carregando…",noImagesFound:"Nenhuma imagem encontrada",noThumbnailText:"IMG",loadMoreButton:"Carregar mais",previewAlt:"Pré-visualização",dropZoneText:"Arraste e solte ou clique para procurar",acceptedTypesInfo:"{types} · máx. {size} MB",cancelButton:"Cancelar",uploadingText:"Enviando…",uploadAndUseButton:"Enviar e usar",useSelectedButton:"Usar selecionado",invalidFileTypeError:"Somente arquivos {types} são aceitos.",fileTooLargeError:"A imagem deve ter menos de {size} MB.",uploadFailedError:"Falha no envio."},chipGroupField:{addPlaceholder:"Adicionar…",addButtonLabel:"Adicionar"},dateTimeField:{requiredError:"{field} é obrigatório"},dialcodeInputField:{requiredError:"{field} é obrigatório",enterCodeMessage:"Insira um código dial para validar.",validMessage:"O código dial é válido.",notFoundMessage:"Código dial não encontrado.",validationFailedMessage:"Falha na validação. Tente novamente.",placeholderExample:"ex. A1B2C3",validateAriaLabel:"Validar código dial",validatingLabel:"Validando…",validateButtonLabel:"Validar"},keywordSuggestField:{requiredError:"{field} é obrigatório",inputPlaceholder:"Digite e pressione Enter ou vírgula…"},licenseSelectField:{requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar licença…"},multiSelectField:{requiredError:"{field} é obrigatório",selectedCountSuffix:"selecionado(s)",selectPlaceholder:"Selecionar…",noOptionsMessage:"Sem opções"},nestedSelectField:{requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar…"},radioField:{requiredError:"{field} é obrigatório"},selectField:{requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar…",noOptionsMessage:"Sem opções"},textField:{requiredError:"{field} é obrigatório",maxLengthError:"Máx. {max} caracteres"},assetBrowser:{dialogAriaLabel:"Navegador de recursos",title:"Navegador de recursos",closeAriaLabel:"Fechar",browseTab:"Procurar",uploadTab:"Enviar",searchPlaceholder:"Buscar recursos...",searchButton:"Buscar",loadingMessage:"Carregando...",uploadingMessage:"Enviando...",chooseFileButton:"Escolher arquivo para enviar"},resourceReorderDialog:{dialogAriaLabel:"Mover recurso",moveHeaderPrefix:"Mover",closeAriaLabel:"Fechar",selectUnitHint:"Selecione uma unidade para mover este conteúdo:",noUnitsAvailable:"Nenhuma outra unidade disponível",cancelButton:"Cancelar",moveButton:"Mover para aqui"},assignPageNumber:{dialogAriaLabel:"Atribuir números de página",title:"Atribuir números de página",closeAriaLabel:"Fechar",emptyState:"Nenhum item de conteúdo encontrado nesta coleção.",contentColumnHeader:"Conteúdo",pageNumberColumnHeader:"Número da página",cancelButton:"Cancelar",saveButton:"Salvar"},confirmDialog:{title:"Confirmar exclusão",confirmButton:"Confirmar",cancelButton:"Cancelar",closeAriaLabel:"Fechar"},publishChecklist:{publishTitlePrefix:"Publicar",closeAriaLabel:"Fechar",confirmPublishPrefix:"Tem certeza de que deseja publicar este(a)",checklistInstructions:"Confirme que TODOS os itens a seguir foram verificados (marcando as caixas de seleção) antes de publicar:",noButton:"Não",yesButton:"Sim"},qualityParamsModal:{reviewQualityTitle:"Revisar qualidade",rejectContentTitle:"Rejeitar conteúdo",closeAriaLabel:"Fechar",qualityScoreLabel:"Nota de qualidade",scorePoorLabel:"0 — Ruim",scoreExcellentLabel:"10 — Excelente",commentLabel:"Comentário",optionalLabel:"(opcional)",commentPlaceholder:"Adicione observações para o criador do conteúdo…",rejectionReasonLabel:"Motivo da rejeição",rejectReasonPlaceholder:"Descreva por que este conteúdo está sendo rejeitado…",rejectionRequiredMessage:"É necessário informar um motivo de rejeição.",cancelButton:"Cancelar",approveButton:"Aprovar",rejectButton:"Rejeitar"},unsavedChangesModal:{title:"Alterações não salvas",closeAriaLabel:"Fechar",bodyMessage:"Você tem alterações não salvas. Deseja salvá-las antes de sair?",cancelButton:"Cancelar",discardButton:"Descartar",saveButton:"Salvar"},filterChips:{contentTypeFiltersAriaLabel:"Filtros de tipo de conteúdo"},libraryCard:{alreadyAddedAriaLabel:"Já adicionado",alreadyAddedTitle:"Já adicionado a esta coleção",addItemAriaLabel:"Adicionar {name} à unidade",addToUnitTitle:"Adicionar à unidade",selectUnitToAddTitle:"Selecione uma unidade para adicionar",draftOnlyTitle:"Somente conteúdo em rascunho pode ser adicionado"},libraryDock:{selectUnitFirstToast:"Selecione uma unidade primeiro",selectUnitFromOutlineToast:"Selecione uma unidade no esquema para adicionar conteúdo — recursos não podem ser adicionados diretamente ao curso.",itemAlreadyAddedToast:'"{name}" já está nesta coleção',itemAddedToast:'"{name}" adicionado',collapseLibraryPanelAriaLabel:"Recolher painel da biblioteca",collapseLibraryTitle:"Recolher biblioteca",headerTitle:"Biblioteca",searchPlaceholder:"Buscar conteúdo…",searchAriaLabel:"Buscar na biblioteca",sortAZAriaLabel:"Ordenar: A–Z (clique para Recentes)",sortRecentAriaLabel:"Ordenar: Recentes (clique para A–Z)",sortAZTitle:"A–Z",sortRecentTitle:"Recentes",toggleAdvancedFiltersAriaLabel:"Alternar filtros avançados",advancedFiltersTitle:"Filtros avançados",libraryContentAriaLabel:"Conteúdo da biblioteca",loadMoreAriaLabel:"Carregar mais conteúdo",loadingText:"Carregando…",loadMoreText:"Carregar mais",noContentFound:"Nenhum conteúdo encontrado",tryDifferentSearch:"Tente uma busca ou filtro diferente"},libraryFilterPanel:{boardLabel:"Conselho",mediumLabel:"Idioma de Instrução",classLabel:"Série",subjectLabel:"Disciplina",primaryCategoryLabel:"Categoria principal",filterLibraryAriaLabel:"Filtrar biblioteca",filtersHeaderTitle:"Filtros",closeFiltersAriaLabel:"Fechar filtros",resetButton:"Redefinir",applyButton:"Aplicar"},libraryPreviewPanel:{contentPreviewAriaLabel:"Pré-visualização do conteúdo",closePreviewAriaLabel:"Fechar pré-visualização",addToUnitButton:"+ Adicionar à unidade"},outlineTree:{maxDepthReachedToast:"Profundidade máxima atingida",downloadCsvFailedToast:"Falha ao baixar o CSV",outlineRefreshedToast:"Esquema do curso atualizado.",outlineRefreshFailedToast:"Não foi possível atualizar o esquema automaticamente. Recarregue a página.",moreOptionsAriaLabel:"Mais opções",moreOptionsTitle:"Mais opções",foldersExistTitle:'As pastas já existem — use "Atualizar"',createFoldersCsvButton:"Criar pastas usando arquivo csv",noFoldersYetTitle:'Ainda não há pastas — use "Criar" primeiro',downloadFoldersCsvButton:"Baixar pastas como arquivo csv",updateFoldersCsvButton:"Atualizar metadados das pastas usando arquivo csv",expandOutlineAriaLabel:"Expandir esquema",collapseOutlineAriaLabel:"Recolher esquema",addUnitButton:"Adicionar unidade",addSubunitButton:"Adicionar subunidade"},treeNode:{expandAriaLabel:"Expandir",collapseAriaLabel:"Recolher",dropHereLabel:"Solte aqui",nodeOptionsAriaLabel:"Opções do nó",renameMenuItem:"Renomear",addSubunitMenuItem:"Adicionar subunidade",addSiblingMenuItem:"Adicionar item no mesmo nível",deleteMenuItem:"Excluir"},contentPlayer:{mimeLabelVideo:"Vídeo",mimeLabelAudio:"Áudio",mimeLabelPdf:"PDF",mimeLabelEpub:"ePub",mimeLabelEcml:"ECML",mimeLabelH5p:"H5P",mimeLabelScorm:"SCORM",mimeLabelOther:"Conteúdo",infoFieldAuthor:"Autor",infoFieldLicense:"Licença",infoFieldLanguage:"Idioma",infoFieldClass:"Série",infoFieldSubject:"Disciplina",infoFieldType:"Tipo",loadingPreview:"Carregando pré-visualização…",previewPlayerUnavailable:"Player de pré-visualização indisponível. Verifique se /content/preview está acessível.",failedToInitializePlayer:"Falha ao inicializar o player de conteúdo.",previewPlayerLoadFailed:"Não foi possível carregar o player de pré-visualização.",unableToLoadQuestionset:"Não foi possível carregar o conjunto de questões:",parentQuestionsetNotResolved:"Não foi possível identificar o conjunto de questões principal desta questão.",questionNotFoundInQuestionset:"Questão não encontrada no conjunto de questões."},dialcodePanel:{title:"Código QR (Dialcode)",invalidFormatError:"Formato de código DIAL inválido. Use apenas letras maiúsculas e números (ex. A1B2C3).",duplicateDialcodeError:'O código DIAL "{code}" já está vinculado a outro nó nesta coleção.',dialcodeNotFoundError:"Dialcode não encontrado. Insira um código válido.",linkFailedError:"Falha ao vincular o dialcode. Tente novamente.",unlinkFailedError:"Falha ao remover o dialcode. Tente novamente.",qrCodeAltPrefix:"Código QR para",linkedCodeLabel:"Código vinculado:",removeButton:"Remover",noCodeLinkedMessage:"Nenhum código QR vinculado a este conteúdo.",linkManuallyLabel:"Vincular manualmente",dialcodeInputPlaceholder:"Insira o dialcode (ex. A1B2C3)",dialcodeInputAriaLabel:"Campo de dialcode",linkButton:"Vincular",linkedSuccessMessage:"Dialcode vinculado com sucesso."},progressStatus:{unitsAddedLabel:"Unidades adicionadas",contentItemsLabel:"Itens de conteúdo",progressLabel:"Progresso"},splitBuilderShell:{dropOntoUnitError:"Solte sobre uma unidade para adicionar conteúdo",dropOntoCourseError:"Solte o conteúdo sobre uma unidade, não diretamente sobre o curso.",alreadyInCollectionError:'"{name}" já está nesta coleção',addedToUnitSuccess:'"{name}" adicionado à unidade',fillRequiredMetadataError:"Preencha os metadados obrigatórios",outlineAriaLabel:"Esquema do curso",showOutlineTitle:"Mostrar esquema",editorAriaLabel:"Editor de conteúdo",libraryAriaLabel:"Biblioteca de conteúdo",showLibraryTitle:"Mostrar biblioteca"},topbar:{draftStatusFallback:"Rascunho",backAriaLabel:"Voltar",statusAriaLabelPrefix:"Status:",savingIndicator:"Salvando…",unsavedIndicator:"Não salvo",savedIndicatorPrefix:"Salvo",fillRequiredFieldsTooltip:"Preencha todos os campos obrigatórios antes de salvar",saveAsDraftButton:"Salvar como rascunho",sendForReviewButton:"Enviar para revisão",collaboratorsLabel:"Colaboradores",qrCodesLabel:"Códigos QR",generatingEllipsis:"Gerando…",generateQrCodesMenuItem:"Gerar códigos QR",downloadingEllipsis:"Baixando…",downloadQrCodesMenuItem:"Baixar códigos QR",publishButton:"Publicar",requestForChangesButton:"Solicitar alterações",approveButton:"Aprovar",qrGenerationStartedToast:'Geração dos códigos QR iniciada. Use "Baixar códigos QR" quando estiverem prontos.',qrGenerationFailedToast:"Falha ao gerar os códigos QR. Tente novamente.",qrCodesNotGeneratedToast:"Nenhum código QR gerado ainda. Gere os códigos QR primeiro.",qrGenerationInProgressToast:"A geração das imagens dos códigos QR está em andamento. Tente baixar novamente mais tarde.",qrCodesNotReadyToast:"Os códigos QR ainda não estão prontos. Aguarde e tente novamente.",qrCodesDownloadedToast:"Códigos QR baixados.",qrCodesDownloadFailedToast:"Falha ao baixar os códigos QR.",requestChangesTitle:"Solicitar alterações",changesRequestedLabel:"Alterações solicitadas",describeChangesPlaceholder:"Descreva as alterações que o autor precisa fazer"},reviewCommentModal:{closeAriaLabel:"Fechar",fillCommentsError:"Preencha os comentários",cancelButton:"Cancelar"},confirmReviewModal:{closeAriaLabel:"Fechar",title:"Aceitar Termos e Condições",agreementTextPart1:"Concordo que, ao enviar/publicar este Conteúdo, confirmo que ele está em conformidade com as diretrizes estabelecidas, incluindo os Termos de Uso e a Política de Conteúdo, e que consinto em publicá-lo sob a",creativeCommonsLinkText:"Estrutura Creative Commons",agreementTextPart2:"de acordo com a",contentPolicyText:"Política de Conteúdo",agreementTextPart3:". Certifiquei-me de que não violo direitos de autor ou de privacidade de terceiros.",cancelButton:"Cancelar",submitButton:"Enviar"},generateQRModal:{closeAriaLabel:"Fechar",title:"Gerar códigos QR",numberOfCodesLabel:"Número de códigos QR",countPlaceholder:"Insira um número (2–250)",countRangeError:"Insira um número entre 2 e 250.",cancelButton:"Cancelar",generateButton:"Gerar"},chip:{remove:"Remover"},dropZone:{dropHere:"Solte aqui"},spinner:{loading:"Carregando"},learningPath:{profileBadgeLabel:"Trilha de Aprendizagem",pathStructureLabel:"Estrutura da trilha",addLevelButton:"Adicionar nível",levelNumberPrefix:"Nível {n}",priorAssessmentLabel:"Avaliação prévia",priorAssessmentHint:"Sempre obrigatória · não conta como um nível",outcomeAssessmentLabel:"Avaliação de resultado",outcomeAssessmentHint:"Confirma o resultado · não conta como um nível",skillCheckBadge:"Verificação de habilidade",outcomeCheckBadge:"Verificação de resultado",assessmentCourseMeta:"Curso · Apenas banco de questões",addAssessmentSlotButton:"Adicionar {label} — um curso com apenas um banco de questões",requiredSlotBadge:"Obrigatório",removeAssessmentSlotButton:"Remover",deletePriorAssessmentConfirm:"Excluir a Avaliação prévia remove a pontuação usada pelos avanços adaptativos deste percurso. Continuar?",deleteAssessmentSlotConfirm:"Remover este curso de avaliação do percurso?",deleteLevelConfirm:'Excluir "{name}" e tudo o que ele contém?',deleteCourseConfirm:"Remover este curso do percurso?",deleteMultipleConfirm:"Excluir os {count} itens selecionados do percurso?",courseNameUnavailable:"Detalhes do curso indisponíveis",notAssessmentCourseToast:'"{name}" não é um curso composto somente por um banco de questões, portanto não pode ser usado como avaliação.',bothSlotsFilledToast:"As avaliações prévia e de resultado já estão preenchidas.",assessmentCheckFailedToast:"Não foi possível verificar este curso. Tente novamente.",skillsHeading:"Habilidades",skillsOutOfScopeWarning:"Fora do escopo, selecione novamente: {skills}",skillsUncoveredWarning:"Nenhum curso cobre ainda: {skills}",skillUncoveredPillTitle:"Nenhum curso vinculado está marcado com esta habilidade ainda",searchSkillsPlaceholder:"Buscar habilidades",noSkillsAvailable:"Nenhuma habilidade disponível ainda",noMatchingSkills:"Nenhuma habilidade correspondente",noSkillsSelectedYet:"Nenhuma habilidade selecionada",removeSkillAriaLabel:"Remover {skill}",skillScopeFromPriorNote:"Escolha quais habilidades — da Avaliação prévia — este nível desenvolve. A biblioteca filtra os cursos por essas habilidades.",skillScopeManualNote:"Ainda não há Avaliação prévia, então escolha no catálogo geral de habilidades. A biblioteca filtra os cursos por essas habilidades.",skillsCoveredHeading:"Habilidades abordadas",skillsCoveredDescription:"Todas as habilidades marcadas na Avaliação prévia, nos níveis e na Avaliação de resultado deste percurso.",noSkillsYet:"Nenhuma habilidade ainda — adicione cursos para ver as habilidades aqui.",levelCountLabel:"{count} nível",levelCountLabelPlural:"{count} níveis",courseCountLabel:"{count} curso",courseCountLabelPlural:"{count} cursos",backToPathButton:"Voltar ao percurso",backToLevelButton:"Voltar a {label}",courseDetailsLoading:"Carregando detalhes do curso…",courseDetailsEmpty:"Este curso ainda não tem unidades.",courseDetailsError:"Não foi possível carregar os detalhes do curso.",courseDetailsCardTitle:"Detalhes do curso",courseTitleFieldLabel:"Título",courseDescriptionFieldLabel:"Descrição",noCourseDescriptionPlaceholder:"Nenhuma descrição disponível.",unitsSectionLabel:"Unidades",unitsSectionDescription:"As unidades agrupam conteúdo relacionado; cada item de conteúdo é marcado com as habilidades que desenvolve.",unitTopicsFieldLabel:"Tópicos",contentCountLabel:"{count} conteúdo",contentCountLabelPlural:"{count} conteúdos",courseUnitTopicsLabel:"{count} tópico",courseUnitTopicsLabelPlural:"{count} tópicos",verifyingAssessmentCourses:"Verificando cursos de avaliação…",resolveBeforePublishing:"Resolva os itens abaixo antes de publicar:",resolveBeforeSendingForReview:"Resolva os itens abaixo antes de enviar para revisão:",assessmentsCardHeading:"Avaliações prévia e de resultado",assessmentsCardDescription:"Adicione os cursos compostos apenas por banco de questões que abrem e encerram este percurso.",assessmentNotAddedYet:"Ainda não adicionado — escolha um curso composto apenas por banco de questões na Biblioteca.",viewCourseMenuItem:"Ver",priorAssessmentExplainerTitle:"Por que isso não pode ser pulado",priorAssessmentExplainerBody:"A pontuação deste banco de questões é o que cada nível usa para decidir um avanço — ainda não há nada para comparar, então ele sempre é executado por completo.",priorAssessmentPurposeLabel:"Define a linha de base de habilidades",outcomeAssessmentExplainerTitle:"Encerra o percurso",outcomeAssessmentExplainerBody:"Passar neste banco de questões certifica o ganho de habilidade de todo o percurso — sua pontuação é o que aparece no certificado do aprendiz.",outcomeUnlocksHint:"Desbloqueia após o último nível",assessmentCourseSectionTitle:"Curso",assessmentCourseSectionDescription:"Um único curso cujo único conteúdo é um banco de questões — nenhum outro tipo de conteúdo pertence aqui.",libraryOpenLevelToAdd:"Abra um nível para adicionar",libraryAddToLevel:"Adicionar a {level}",libraryAddPriorAssessmentCourse:"Adicionar curso de Avaliação prévia",libraryAddOutcomeAssessmentCourse:"Adicionar curso de Avaliação de resultado",policyStrictLabel:"Estrita",policyStrictDescription:"Todo aprendiz completa todos os níveis, em ordem — independentemente da pontuação da avaliação prévia.",policyAdaptiveLabel:"Adaptativa",policyAdaptiveDescriptionPre:"Um nível pode ser pulado, mas somente quando a pontuação do aprendiz na Avaliação prévia",policyAdaptiveDescriptionPost:" atinge o limite de dispensa.",policyPriorLearningLabel:"Aprendizagem prévia",policyPriorLearningDescription:"Os avanços também podem se basear em habilidades que o aprendiz já possui — um certificado verificado ou curso anterior — não apenas na avaliação.",selectLevelFirstToast:"Selecione um nível primeiro",selectLevelFromOutlineToast:"Abra um nível na estrutura da trilha para adicionar cursos — cursos não podem ser adicionados à própria trilha nem dentro de outro curso.",selectCurriculumFirstToast:"Selecione um Currículo para esta trilha antes de adicionar cursos.",noCurriculumEmptyTitle:"Nenhum currículo selecionado",noCurriculumEmptyHint:"Selecione um currículo para esta trilha para navegar pelos cursos.",noSkillsEmptyTitle:"Nenhuma habilidade selecionada",noSkillsEmptyHint:"Selecione habilidades para este nível para ver os cursos correspondentes.",itemAlreadyInPathToast:'"{name}" já está nesta trilha de aprendizagem',addedToLevelSuccess:'"{name}" adicionado ao nível',dropOntoLevelError:"Solte sobre um nível para adicionar um curso",dropOntoPathError:"Solte os cursos sobre um nível, não diretamente na trilha de aprendizagem.",priorSlotFilledToast:"A Avaliação prévia já tem um curso — remova-o antes de adicionar outro.",outcomeSlotFilledToast:"A Avaliação final já tem um curso — remova-o antes de adicionar outro.",coursesRemovedFrameworkChangeToast:"{count} curso(s) vinculados a outro currículo foram removidos desta trilha.",levelSkillsResetFrameworkChangeToast:"{count} nível(is) tiveram as habilidades selecionadas apagadas — elas não se aplicam ao novo currículo.",priorAssessmentNarrowedScopeToast:"A Avaliação prévia reduziu o escopo de habilidades — {count} nível(is) agora têm habilidades fora dele."}},ub=["ar"],fb={en:Si,ar:lb,fr:cb,pt:db};function Fd(e,t){const r={...e};for(const n of Object.keys(t)){const o=e[n],s=t[n];o&&s&&typeof o=="object"&&typeof s=="object"&&!Array.isArray(o)&&!Array.isArray(s)?r[n]=Fd(o,s):s!==void 0&&(r[n]=s)}return r}function Md(e){const t=fb[e];return!t||e==="en"?Si:Fd(Si,t)}function hb(e){return ub.includes(e)}const wi="app-language",_i="app-language-change",Ti=ko(e=>({lang:"en",labelConfig:Md("en"),setLanguage:(t,r={})=>{e({lang:t,labelConfig:Md(t)}),localStorage.setItem(wi,t),document.documentElement.setAttribute("dir",hb(t)?"rtl":"ltr"),document.documentElement.setAttribute("lang",t),r.broadcast!==!1&&window.dispatchEvent(new CustomEvent(_i,{detail:{lang:t}}))}}));function $d(e,t){return function(){return e.apply(t,arguments)}}const{toString:pb}=Object.prototype,{getPrototypeOf:Ln}=Object,{iterator:Io,toStringTag:Bd}=Symbol,Hs=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Do=(e,t)=>{let r=e;const n=[];for(;r!=null&&r!==Object.prototype;){if(n.indexOf(r)!==-1)return!1;if(n.push(r),Hs(r,t))return!0;r=Ln(r)}return!1},gb=(e,t)=>e!=null&&Do(e,t)?e[t]:void 0,Ei=(e=>t=>{const r=pb.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),or=e=>(e=e.toLowerCase(),t=>Ei(t)===e),Qs=e=>t=>typeof t===e,{isArray:Jr}=Array,On=Qs("undefined");function Pn(e){return e!==null&&!On(e)&&e.constructor!==null&&!On(e.constructor)&&Ft(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const qd=or("ArrayBuffer");function mb(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&qd(e.buffer),t}const vb=Qs("string"),Ft=Qs("function"),jd=Qs("number"),Nn=e=>e!==null&&typeof e=="object",yb=e=>e===!0||e===!1,Ws=e=>{if(!Nn(e))return!1;const t=Ln(e);return(t===null||t===Object.prototype||Ln(t)===null)&&!Do(e,Bd)&&!Do(e,Io)},bb=e=>{if(!Nn(e)||Pn(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Cb=or("Date"),Sb=or("File"),wb=e=>!!(e&&typeof e.uri<"u"),_b=e=>e&&typeof e.getParts<"u",Tb=or("Blob"),Eb=or("FileList"),Ab=e=>Nn(e)&&Ft(e.pipe);function kb(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Ud=kb(),zd=typeof Ud.FormData<"u"?Ud.FormData:void 0,Ib=e=>{if(!e)return!1;if(zd&&e instanceof zd)return!0;const t=Ln(e);if(!t||t===Object.prototype||!Ft(e.append))return!1;const r=Ei(e);return r==="formdata"||r==="object"&&Ft(e.toString)&&e.toString()==="[object FormData]"},Db=or("URLSearchParams"),[Lb,Ob,Pb,Nb]=["ReadableStream","Request","Response","Headers"].map(or),xb=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Lo(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),Jr(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(Pn(e))return;const s=r?Object.getOwnPropertyNames(e):Object.keys(e),a=s.length;let i;for(n=0;n<a;n++)i=s[n],t.call(null,e[i],i,e)}}function Vd(e,t){if(Pn(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,o;for(;n-- >0;)if(o=r[n],t===o.toLowerCase())return o;return null}const en=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Hd=e=>!On(e)&&e!==en;function Ai(...e){const{caseless:t,skipUndefined:r}=Hd(this)&&this||{},n={},o=(s,a)=>{if(a==="__proto__"||a==="constructor"||a==="prototype")return;const i=t&&typeof a=="string"&&Vd(n,a)||a,c=Hs(n,i)?n[i]:void 0;Ws(c)&&Ws(s)?n[i]=Ai(c,s):Ws(s)?n[i]=Ai({},s):Jr(s)?n[i]=s.slice():(!r||!On(s))&&(n[i]=s)};for(let s=0,a=e.length;s<a;s++){const i=e[s];if(!i||Pn(i)||(Lo(i,o),typeof i!="object"||Jr(i)))continue;const c=Object.getOwnPropertySymbols(i);for(let d=0;d<c.length;d++){const u=c[d];Wb.call(i,u)&&o(i[u],u)}}return n}const Fb=(e,t,r,{allOwnKeys:n}={})=>(Lo(t,(o,s)=>{r&&Ft(o)?Object.defineProperty(e,s,{__proto__:null,value:$d(o,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,s,{__proto__:null,value:o,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),e),Mb=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),$b=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),r&&Object.assign(e.prototype,r)},Bb=(e,t,r,n)=>{let o,s,a;const i={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)a=o[s],(!n||n(a,e,t))&&!i[a]&&(t[a]=e[a],i[a]=!0);e=r!==!1&&Ln(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},qb=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},jb=e=>{if(!e)return null;if(Jr(e))return e;let t=e.length;if(!jd(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Ub=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ln(Uint8Array)),zb=(e,t)=>{const n=(e&&e[Io]).call(e);let o;for(;(o=n.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},Vb=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Hb=or("HTMLFormElement"),Qb=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),{propertyIsEnumerable:Wb}=Object.prototype,Rb=or("RegExp"),Qd=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Lo(r,(o,s)=>{let a;(a=t(o,s,e))!==!1&&(n[s]=a||o)}),Object.defineProperties(e,n)},Gb=e=>{Qd(e,(t,r)=>{if(Ft(e)&&["arguments","caller","callee"].includes(r))return!1;const n=e[r];if(Ft(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Kb=(e,t)=>{const r={},n=o=>{o.forEach(s=>{r[s]=!0})};return Jr(e)?n(e):n(String(e).split(t)),r},Yb=()=>{},Zb=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Xb(e){return!!(e&&Ft(e.append)&&e[Bd]==="FormData"&&e[Io])}const Jb=e=>{const t=new WeakSet,r=n=>{if(Nn(n)){if(t.has(n))return;if(Pn(n))return n;if(!("toJSON"in n)){t.add(n);const o=Jr(n)?[]:{};return Lo(n,(s,a)=>{const i=r(s);!On(i)&&(o[a]=i)}),t.delete(n),o}}return n};return r(e)},eC=or("AsyncFunction"),tC=e=>e&&(Nn(e)||Ft(e))&&Ft(e.then)&&Ft(e.catch),Wd=((e,t)=>e?setImmediate:t?((r,n)=>(en.addEventListener("message",({source:o,data:s})=>{o===en&&s===r&&n.length&&n.shift()()},!1),o=>{n.push(o),en.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Ft(en.postMessage)),rC=typeof queueMicrotask<"u"?queueMicrotask.bind(en):typeof process<"u"&&process.nextTick||Wd,Rd=e=>e!=null&&Ft(e[Io]),O={isArray:Jr,isArrayBuffer:qd,isBuffer:Pn,isFormData:Ib,isArrayBufferView:mb,isString:vb,isNumber:jd,isBoolean:yb,isObject:Nn,isPlainObject:Ws,isEmptyObject:bb,isReadableStream:Lb,isRequest:Ob,isResponse:Pb,isHeaders:Nb,isUndefined:On,isDate:Cb,isFile:Sb,isReactNativeBlob:wb,isReactNative:_b,isBlob:Tb,isRegExp:Rb,isFunction:Ft,isStream:Ab,isURLSearchParams:Db,isTypedArray:Ub,isFileList:Eb,forEach:Lo,merge:Ai,extend:Fb,trim:xb,stripBOM:Mb,inherits:$b,toFlatObject:Bb,kindOf:Ei,kindOfTest:or,endsWith:qb,toArray:jb,forEachEntry:zb,matchAll:Vb,isHTMLForm:Hb,hasOwnProperty:Hs,hasOwnProp:Hs,hasOwnInPrototypeChain:Do,getSafeProp:gb,reduceDescriptors:Qd,freezeMethods:Gb,toObjectSet:Kb,toCamelCase:Qb,noop:Yb,toFiniteNumber:Zb,findKey:Vd,global:en,isContextDefined:Hd,isSpecCompliantForm:Xb,toJSONObject:Jb,isAsyncFn:eC,isThenable:tC,setImmediate:Wd,asap:rC,isIterable:Rd,isSafeIterable:e=>e!=null&&Do(e,Io)&&Rd(e)},nC=O.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),oC=e=>{const t={};let r,n,o;return e&&e.split(`
529
+ `).forEach(function(a){o=a.indexOf(":"),r=a.substring(0,o).trim().toLowerCase(),n=a.substring(o+1).trim(),!(!r||t[r]&&nC[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t};function sC(e){let t=0,r=e.length;for(;t<r;){const n=e.charCodeAt(t);if(n!==9&&n!==32)break;t+=1}for(;r>t;){const n=e.charCodeAt(r-1);if(n!==9&&n!==32)break;r-=1}return t===0&&r===e.length?e:e.slice(t,r)}const aC=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),iC=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function ki(e,t){return O.isArray(e)?e.map(r=>ki(r,t)):sC(String(e).replace(t,""))}const lC=e=>ki(e,aC),cC=e=>ki(e,iC);function Gd(e){const t=Object.create(null);return O.forEach(e.toJSON(),(r,n)=>{t[n]=cC(r)}),t}const Kd=Symbol("internals");function Oo(e){return e&&String(e).trim().toLowerCase()}function Rs(e){return e===!1||e==null?e:O.isArray(e)?e.map(Rs):lC(String(e))}function dC(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const uC=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Ii(e,t,r,n,o){if(O.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!O.isString(t)){if(O.isString(n))return t.indexOf(n)!==-1;if(O.isRegExp(n))return n.test(t)}}function fC(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function hC(e,t){const r=O.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{__proto__:null,value:function(o,s,a){return this[n].call(this,t,o,s,a)},configurable:!0})})}let wt=class{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function s(i,c,d){const u=Oo(c);if(!u)return;const f=O.findKey(o,u);(!f||o[f]===void 0||d===!0||d===void 0&&o[f]!==!1)&&(o[f||c]=Rs(i))}const a=(i,c)=>O.forEach(i,(d,u)=>s(d,u,c));if(O.isPlainObject(t)||t instanceof this.constructor)a(t,r);else if(O.isString(t)&&(t=t.trim())&&!uC(t))a(oC(t),r);else if(O.isObject(t)&&O.isSafeIterable(t)){let i=Object.create(null),c,d;for(const u of t){if(!O.isArray(u))throw new TypeError("Object iterator must return a key-value pair");d=u[0],O.hasOwnProp(i,d)?(c=i[d],i[d]=O.isArray(c)?[...c,u[1]]:[c,u[1]]):i[d]=u[1]}a(i,r)}else t!=null&&s(r,t,n);return this}get(t,r){if(t=Oo(t),t){const n=O.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return dC(o);if(O.isFunction(r))return r.call(this,o,n);if(O.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=Oo(t),t){const n=O.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||Ii(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function s(a){if(a=Oo(a),a){const i=O.findKey(n,a);i&&(!r||Ii(n,n[i],i,r))&&(delete n[i],o=!0)}}return O.isArray(t)?t.forEach(s):s(t),o}clear(t){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const s=r[n];(!t||Ii(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){const r=this,n={};return O.forEach(this,(o,s)=>{const a=O.findKey(n,s);if(a){r[a]=Rs(o),delete r[s];return}const i=t?fC(s):String(s).trim();i!==s&&delete r[s],r[i]=Rs(o),n[i]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return O.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=t&&O.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
530
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){const n=(this[Kd]=this[Kd]={accessors:{}}).accessors,o=this.prototype;function s(a){const i=Oo(a);n[i]||(hC(o,a),n[i]=!0)}return O.isArray(t)?t.forEach(s):s(t),this}};wt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),O.reduceDescriptors(wt.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),O.freezeMethods(wt);const pC="[REDACTED ****]";function gC(e){if(O.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(O.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function mC(e,t){const r=new Set(t.map(s=>String(s).toLowerCase())),n=[],o=s=>{if(s===null||typeof s!="object"||O.isBuffer(s))return s;if(n.indexOf(s)!==-1)return;s instanceof wt&&(s=s.toJSON()),n.push(s);let a;if(O.isArray(s))a=[],s.forEach((i,c)=>{const d=o(i);O.isUndefined(d)||(a[c]=d)});else{if(!O.isPlainObject(s)&&gC(s))return n.pop(),s;a=Object.create(null);for(const[i,c]of Object.entries(s)){const d=r.has(i.toLowerCase())?pC:o(c);O.isUndefined(d)||(a[i]=d)}}return n.pop(),a};return o(e)}let J=class ug extends Error{static from(t,r,n,o,s,a){const i=new ug(t.message,r||t.code,n,o,s);return i.cause=t,i.name=t.name,t.status!=null&&i.status==null&&(i.status=t.status),a&&Object.assign(i,a),i}constructor(t,r,n,o,s){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),n&&(this.config=n),o&&(this.request=o),s&&(this.response=s,this.status=s.status)}toJSON(){const t=this.config,r=t&&O.hasOwnProp(t,"redact")?t.redact:void 0,n=O.isArray(r)&&r.length>0?mC(t,r):O.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}};J.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",J.ERR_BAD_OPTION="ERR_BAD_OPTION",J.ECONNABORTED="ECONNABORTED",J.ETIMEDOUT="ETIMEDOUT",J.ECONNREFUSED="ECONNREFUSED",J.ERR_NETWORK="ERR_NETWORK",J.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",J.ERR_DEPRECATED="ERR_DEPRECATED",J.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",J.ERR_BAD_REQUEST="ERR_BAD_REQUEST",J.ERR_CANCELED="ERR_CANCELED",J.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",J.ERR_INVALID_URL="ERR_INVALID_URL",J.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const vC=null,Yd=100;function Di(e){return O.isPlainObject(e)||O.isArray(e)}function Zd(e){return O.endsWith(e,"[]")?e.slice(0,-2):e}function Li(e,t,r){return e?e.concat(t).map(function(o,s){return o=Zd(o),!r&&s?"["+o+"]":o}).join(r?".":""):t}function yC(e){return O.isArray(e)&&!e.some(Di)}const bC=O.toFlatObject(O,{},null,function(t){return/^is[A-Z]/.test(t)});function Gs(e,t,r){if(!O.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=O.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(C,S){return!O.isUndefined(S[C])});const n=r.metaTokens,o=r.visitor||b,s=r.dots,a=r.indexes,i=r.Blob||typeof Blob<"u"&&Blob,c=r.maxDepth===void 0?Yd:r.maxDepth,d=i&&O.isSpecCompliantForm(t),u=[];if(!O.isFunction(o))throw new TypeError("visitor must be a function");function f(y){if(y===null)return"";if(O.isDate(y))return y.toISOString();if(O.isBoolean(y))return y.toString();if(!d&&O.isBlob(y))throw new J("Blob is not supported. Use a Buffer instead.");return O.isArrayBuffer(y)||O.isTypedArray(y)?d&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function m(y){if(y>c)throw new J("Object is too deeply nested ("+y+" levels). Max depth: "+c,J.ERR_FORM_DATA_DEPTH_EXCEEDED)}function g(y,C){if(c===1/0)return JSON.stringify(y);const S=[];return JSON.stringify(y,function(T,E){if(!O.isObject(E))return E;for(;S.length&&S[S.length-1]!==this;)S.pop();return S.push(E),m(C+S.length-1),E})}function b(y,C,S){let w=y;if(O.isReactNative(t)&&O.isReactNativeBlob(y))return t.append(Li(S,C,s),f(y)),!1;if(y&&!S&&typeof y=="object"){if(O.endsWith(C,"{}"))C=n?C:C.slice(0,-2),y=g(y,1);else if(O.isArray(y)&&yC(y)||(O.isFileList(y)||O.endsWith(C,"[]"))&&(w=O.toArray(y)))return C=Zd(C),w.forEach(function(E,L){!(O.isUndefined(E)||E===null)&&t.append(a===!0?Li([C],L,s):a===null?C:C+"[]",f(E))}),!1}return Di(y)?!0:(t.append(Li(S,C,s),f(y)),!1)}const h=Object.assign(bC,{defaultVisitor:b,convertValue:f,isVisitable:Di});function v(y,C,S=0){if(!O.isUndefined(y)){if(m(S),u.indexOf(y)!==-1)throw new Error("Circular reference detected in "+C.join("."));u.push(y),O.forEach(y,function(T,E){(!(O.isUndefined(T)||T===null)&&o.call(t,T,O.isString(E)?E.trim():E,C,h))===!0&&v(T,C?C.concat(E):[E],S+1)}),u.pop()}}if(!O.isObject(e))throw new TypeError("data must be an object");return v(e),t}function Xd(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(n){return t[n]})}function Oi(e,t){this._pairs=[],e&&Gs(e,this,t)}const Jd=Oi.prototype;Jd.append=function(t,r){this._pairs.push([t,r])},Jd.toString=function(t){const r=t?function(n){return t.call(this,n,Xd)}:Xd;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function CC(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function eu(e,t,r){if(!t)return e;const n=O.isFunction(r)?{serialize:r}:r,o=O.getSafeProp(n,"encode")||CC,s=O.getSafeProp(n,"serialize");let a;if(s?a=s(t,n):a=O.isURLSearchParams(t)?t.toString():new Oi(t,n).toString(o),a){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class tu{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){O.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Pi={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},SC={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Oi,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Ni=typeof window<"u"&&typeof document<"u",xi=typeof navigator=="object"&&navigator||void 0,wC=Ni&&(!xi||["ReactNative","NativeScript","NS"].indexOf(xi.product)<0),_C=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",TC=Ni&&window.location.href||"http://localhost",yt={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ni,hasStandardBrowserEnv:wC,hasStandardBrowserWebWorkerEnv:_C,navigator:xi,origin:TC},Symbol.toStringTag,{value:"Module"})),...SC};function EC(e,t){return Gs(e,new yt.classes.URLSearchParams,{visitor:function(r,n,o,s){return yt.isNode&&O.isBuffer(r)?(this.append(n,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}const ru=Yd;function nu(e){if(e>ru)throw new J("FormData field is too deeply nested ("+e+" levels). Max depth: "+ru,J.ERR_FORM_DATA_DEPTH_EXCEEDED)}function AC(e){const t=[],r=/\w+|\[(\w*)]/g;let n;for(;(n=r.exec(e))!==null;)nu(t.length),t.push(n[0]==="[]"?"":n[1]||n[0]);return t}function kC(e){const t={},r=Object.keys(e);let n;const o=r.length;let s;for(n=0;n<o;n++)s=r[n],t[s]=e[s];return t}function ou(e){function t(r,n,o,s){nu(s);let a=r[s++];if(a==="__proto__")return!0;const i=Number.isFinite(+a),c=s>=r.length;return a=!a&&O.isArray(o)?o.length:a,c?(O.hasOwnProp(o,a)?o[a]=O.isArray(o[a])?o[a].concat(n):[o[a],n]:o[a]=n,!i):((!O.hasOwnProp(o,a)||!O.isObject(o[a]))&&(o[a]=[]),t(r,n,o[a],s)&&O.isArray(o[a])&&(o[a]=kC(o[a])),!i)}if(O.isFormData(e)&&O.isFunction(e.entries)){const r={};return O.forEachEntry(e,(n,o)=>{t(AC(n),o,r,0)}),r}return null}const xn=(e,t)=>e!=null&&O.hasOwnProp(e,t)?e[t]:void 0;function IC(e,t,r){if(O.isString(e))try{return(t||JSON.parse)(e),O.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const Po={transitional:Pi,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,s=O.isObject(t);if(s&&O.isHTMLForm(t)&&(t=new FormData(t)),O.isFormData(t))return o?JSON.stringify(ou(t)):t;if(O.isArrayBuffer(t)||O.isBuffer(t)||O.isStream(t)||O.isFile(t)||O.isBlob(t)||O.isReadableStream(t))return t;if(O.isArrayBufferView(t))return t.buffer;if(O.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(s){const c=xn(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return EC(t,c).toString();if((i=O.isFileList(t))||n.indexOf("multipart/form-data")>-1){const d=xn(this,"env"),u=d&&d.FormData;return Gs(i?{"files[]":t}:t,u&&new u,c)}}return s||o?(r.setContentType("application/json",!1),IC(t)):t}],transformResponse:[function(t){const r=xn(this,"transitional")||Po.transitional,n=r&&r.forcedJSONParsing,o=xn(this,"responseType"),s=o==="json";if(O.isResponse(t)||O.isReadableStream(t))return t;if(t&&O.isString(t)&&(n&&!o||s)){const i=!(r&&r.silentJSONParsing)&&s;try{return JSON.parse(t,xn(this,"parseReviver"))}catch(c){if(i)throw c.name==="SyntaxError"?J.from(c,J.ERR_BAD_RESPONSE,this,null,xn(this,"response")):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:yt.classes.FormData,Blob:yt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};O.forEach(["delete","get","head","post","put","patch","query"],e=>{Po.headers[e]={}});function Fi(e,t){const r=this||Po,n=t||r,o=wt.from(n.headers);let s=n.data;return O.forEach(e,function(i){s=i.call(r,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function su(e){return!!(e&&e.__CANCEL__)}let No=class extends J{constructor(t,r,n){super(t??"canceled",J.ERR_CANCELED,r,n),this.name="CanceledError",this.__CANCEL__=!0}};function au(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new J("Request failed with status code "+r.status,r.status>=400&&r.status<500?J.ERR_BAD_REQUEST:J.ERR_BAD_RESPONSE,r.config,r.request,r))}function DC(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}function LC(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,s=0,a;return t=t!==void 0?t:1e3,function(c){const d=Date.now(),u=n[s];a||(a=d),r[o]=c,n[o]=d;let f=s,m=0;for(;f!==o;)m+=r[f++],f=f%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),d-a<t)return;const g=u&&d-u;return g?Math.round(m*1e3/g):void 0}}function OC(e,t){let r=0,n=1e3/t,o,s;const a=(d,u=Date.now())=>{r=u,o=null,s&&(clearTimeout(s),s=null),e(...d)};return[(...d)=>{const u=Date.now(),f=u-r;f>=n?a(d,u):(o=d,s||(s=setTimeout(()=>{s=null,a(o)},n-f)))},()=>o&&a(o)]}const Ks=(e,t,r=3)=>{let n=0;const o=LC(50,250);return OC(s=>{if(!s||typeof s.loaded!="number")return;const a=s.loaded,i=s.lengthComputable?s.total:void 0,c=i!=null?Math.min(a,i):a,d=Math.max(0,c-n),u=o(d);n=Math.max(n,c);const f={loaded:c,total:i,progress:i?c/i:void 0,bytes:d,rate:u||void 0,estimated:u&&i?(i-c)/u:void 0,event:s,lengthComputable:i!=null,[t?"download":"upload"]:!0};e(f)},r)},iu=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},lu=e=>(...t)=>O.asap(()=>e(...t)),PC=yt.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,yt.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(yt.origin),yt.navigator&&/(msie|trident)/i.test(yt.navigator.userAgent)):()=>!0,NC=yt.hasStandardBrowserEnv?{write(e,t,r,n,o,s,a){if(typeof document>"u")return;const i=[`${e}=${encodeURIComponent(t)}`];O.isNumber(r)&&i.push(`expires=${new Date(r).toUTCString()}`),O.isString(n)&&i.push(`path=${n}`),O.isString(o)&&i.push(`domain=${o}`),s===!0&&i.push("secure"),O.isString(a)&&i.push(`SameSite=${a}`),document.cookie=i.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.split(";");for(let r=0;r<t.length;r++){const n=t[r].replace(/^\s+/,""),o=n.indexOf("=");if(o!==-1&&n.slice(0,o)===e)return decodeURIComponent(n.slice(o+1))}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function xC(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function FC(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}const MC=/^https?:(?!\/\/)/i,$C=/[\t\n\r]/g;function BC(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}function qC(e){return BC(e).replace($C,"")}function cu(e,t){if(typeof e=="string"&&MC.test(qC(e)))throw new J('Invalid URL: missing "//" after protocol',J.ERR_INVALID_URL,t)}function du(e,t,r,n){cu(t,n);let o=!xC(t);return e&&(o||r===!1)?(cu(e,n),FC(e,t)):t}const uu=e=>e instanceof wt?{...e}:e;function tn(e,t){t=t||{};const r=Object.create(null);Object.defineProperty(r,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function n(u,f,m,g){return O.isPlainObject(u)&&O.isPlainObject(f)?O.merge.call({caseless:g},u,f):O.isPlainObject(f)?O.merge({},f):O.isArray(f)?f.slice():f}function o(u,f,m,g){if(O.isUndefined(f)){if(!O.isUndefined(u))return n(void 0,u,m,g)}else return n(u,f,m,g)}function s(u,f){if(!O.isUndefined(f))return n(void 0,f)}function a(u,f){if(O.isUndefined(f)){if(!O.isUndefined(u))return n(void 0,u)}else return n(void 0,f)}function i(u){const f=O.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!O.isUndefined(f))if(O.isPlainObject(f)){if(O.hasOwnProp(f,u))return f[u]}else return;const m=O.hasOwnProp(e,"transitional")?e.transitional:void 0;if(O.isPlainObject(m)&&O.hasOwnProp(m,u))return m[u]}function c(u,f,m){if(O.hasOwnProp(t,m))return n(u,f);if(O.hasOwnProp(e,m))return n(void 0,u)}const d={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,allowedSocketPaths:a,responseEncoding:a,validateStatus:c,headers:(u,f,m)=>o(uu(u),uu(f),m,!0)};return O.forEach(Object.keys({...e,...t}),function(f){if(f==="__proto__"||f==="constructor"||f==="prototype")return;const m=O.hasOwnProp(d,f)?d[f]:o,g=O.hasOwnProp(e,f)?e[f]:void 0,b=O.hasOwnProp(t,f)?t[f]:void 0,h=m(g,b,f);O.isUndefined(h)&&m!==c||(r[f]=h)}),O.hasOwnProp(t,"validateStatus")&&O.isUndefined(t.validateStatus)&&i("validateStatusUndefinedResolves")===!1&&(O.hasOwnProp(e,"validateStatus")?r.validateStatus=n(void 0,e.validateStatus):delete r.validateStatus),r}const jC=["content-type","content-length"];function UC(e,t,r){if(r!=="content-only"){e.set(t);return}Object.entries(t).forEach(([n,o])=>{jC.includes(n.toLowerCase())&&e.set(n,o)})}const zC=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16)));function fu(e){const t=tn({},e),r=m=>O.hasOwnProp(t,m)?t[m]:void 0,n=r("data");let o=r("withXSRFToken");const s=r("xsrfHeaderName"),a=r("xsrfCookieName");let i=r("headers");const c=r("auth"),d=r("baseURL"),u=r("allowAbsoluteUrls"),f=r("url");if(t.headers=i=wt.from(i),t.url=eu(du(d,f,u,t),r("params"),r("paramsSerializer")),c){const m=O.getSafeProp(c,"username")||"",g=O.getSafeProp(c,"password")||"";i.set("Authorization","Basic "+btoa(m+":"+(g?zC(g):"")))}if(O.isFormData(n)&&(yt.hasStandardBrowserEnv||yt.hasStandardBrowserWebWorkerEnv||O.isReactNative(n)?i.setContentType(void 0):O.isFunction(n.getHeaders)&&UC(i,n.getHeaders(),r("formDataHeaderPolicy"))),yt.hasStandardBrowserEnv&&(O.isFunction(o)&&(o=o(t)),o===!0||o==null&&PC(t.url))){const g=s&&a&&NC.read(a);g&&i.set(s,g)}return t}const VC=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const o=fu(e);let s=o.data;const a=wt.from(o.headers).normalize();let{responseType:i,onUploadProgress:c,onDownloadProgress:d}=o,u,f,m,g,b;function h(){g&&g(),b&&b(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let v=new XMLHttpRequest;v.open(o.method.toUpperCase(),o.url,!0),v.timeout=o.timeout;function y(){if(!v)return;const S=wt.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),T={data:!i||i==="text"||i==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:S,config:e,request:v};au(function(L){r(L),h()},function(L){n(L),h()},T),v=null}"onloadend"in v?v.onloadend=y:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.startsWith("file:"))||setTimeout(y)},v.onabort=function(){v&&(n(new J("Request aborted",J.ECONNABORTED,e,v)),h(),v=null)},v.onerror=function(w){const T=w&&w.message?w.message:"Network Error",E=new J(T,J.ERR_NETWORK,e,v);E.event=w||null,n(E),h(),v=null},v.ontimeout=function(){let w=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const T=o.transitional||Pi;o.timeoutErrorMessage&&(w=o.timeoutErrorMessage),n(new J(w,T.clarifyTimeoutError?J.ETIMEDOUT:J.ECONNABORTED,e,v)),h(),v=null},s===void 0&&a.setContentType(null),"setRequestHeader"in v&&O.forEach(Gd(a),function(w,T){v.setRequestHeader(T,w)}),O.isUndefined(o.withCredentials)||(v.withCredentials=!!o.withCredentials),i&&i!=="json"&&(v.responseType=o.responseType),d&&([m,b]=Ks(d,!0),v.addEventListener("progress",m)),c&&v.upload&&([f,g]=Ks(c),v.upload.addEventListener("progress",f),v.upload.addEventListener("loadend",g)),(o.cancelToken||o.signal)&&(u=S=>{v&&(n(!S||S.type?new No(null,e,v):S),v.abort(),h(),v=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const C=DC(o.url);if(C&&!yt.protocols.includes(C)){n(new J("Unsupported protocol "+C+":",J.ERR_BAD_REQUEST,e));return}v.send(s||null)})},HC=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const r=new AbortController;let n=!1;const o=function(c){if(!n){n=!0,a();const d=c instanceof Error?c:this.reason;r.abort(d instanceof J?d:new No(d instanceof Error?d.message:d))}};let s=t&&setTimeout(()=>{s=null,o(new J(`timeout of ${t}ms exceeded`,J.ETIMEDOUT))},t);const a=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(o):c.removeEventListener("abort",o)}),e=null)};e.forEach(c=>c.addEventListener("abort",o));const{signal:i}=r;return i.unsubscribe=()=>O.asap(a),i},QC=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,o;for(;n<r;)o=n+t,yield e.slice(n,o),n=o},WC=async function*(e,t){for await(const r of RC(e))yield*QC(r,t)},RC=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},hu=(e,t,r,n)=>{const o=WC(e,t);let s=0,a,i=c=>{a||(a=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:d,value:u}=await o.next();if(d){i(),c.close();return}let f=u.byteLength;if(r){let m=s+=f;r(m)}c.enqueue(new Uint8Array(u))}catch(d){throw i(d),d}},cancel(c){return i(c),o.return()}},{highWaterMark:2})},Ys=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,GC=(e,t,r)=>t+2<r&&Ys(e.charCodeAt(t+1))&&Ys(e.charCodeAt(t+2));function KC(e){if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;const t=e.indexOf(",");if(t<0)return 0;const r=e.slice(5,t),n=e.slice(t+1);if(/;base64/i.test(r)){let a=n.length;const i=n.length;for(let g=0;g<i;g++)if(n.charCodeAt(g)===37&&g+2<i){const b=n.charCodeAt(g+1),h=n.charCodeAt(g+2);Ys(b)&&Ys(h)&&(a-=2,g+=2)}let c=0,d=i-1;const u=g=>g>=2&&n.charCodeAt(g-2)===37&&n.charCodeAt(g-1)===51&&(n.charCodeAt(g)===68||n.charCodeAt(g)===100);d>=0&&(n.charCodeAt(d)===61?(c++,d--):u(d)&&(c++,d-=3)),c===1&&d>=0&&(n.charCodeAt(d)===61||u(d))&&c++;const m=Math.floor(a/4)*3-(c||0);return m>0?m:0}let s=0;for(let a=0,i=n.length;a<i;a++){const c=n.charCodeAt(a);if(c===37&&GC(n,a,i))s+=1,a+=2;else if(c<128)s+=1;else if(c<2048)s+=2;else if(c>=55296&&c<=56319&&a+1<i){const d=n.charCodeAt(a+1);d>=56320&&d<=57343?(s+=4,a++):s+=3}else s+=3}return s}const Mi="1.18.0",pu=64*1024,{isFunction:Zs}=O,YC=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16))),gu=e=>{if(!O.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},mu=(e,...t)=>{try{return!!e(...t)}catch{return!1}},ZC=e=>{const t=e.indexOf("://");let r=e;return t!==-1&&(r=r.slice(t+3)),r.includes("@")||r.includes(":")},XC=e=>{const t=O.global!==void 0&&O.global!==null?O.global:globalThis,{ReadableStream:r,TextEncoder:n}=t;e=O.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:o,Request:s,Response:a}=e,i=o?Zs(o):typeof fetch=="function",c=Zs(s),d=Zs(a);if(!i)return!1;const u=i&&Zs(r),f=i&&(typeof n=="function"?(y=>C=>y.encode(C))(new n):async y=>new Uint8Array(await new s(y).arrayBuffer())),m=c&&u&&mu(()=>{let y=!1;const C=new s(yt.origin,{body:new r,method:"POST",get duplex(){return y=!0,"half"}}),S=C.headers.has("Content-Type");return C.body!=null&&C.body.cancel(),y&&!S}),g=d&&u&&mu(()=>O.isReadableStream(new a("").body)),b={stream:g&&(y=>y.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(y=>{!b[y]&&(b[y]=(C,S)=>{let w=C&&C[y];if(w)return w.call(C);throw new J(`Response type '${y}' is not supported`,J.ERR_NOT_SUPPORT,S)})});const h=async y=>{if(y==null)return 0;if(O.isBlob(y))return y.size;if(O.isSpecCompliantForm(y))return(await new s(yt.origin,{method:"POST",body:y}).arrayBuffer()).byteLength;if(O.isArrayBufferView(y)||O.isArrayBuffer(y))return y.byteLength;if(O.isURLSearchParams(y)&&(y=y+""),O.isString(y))return(await f(y)).byteLength},v=async(y,C)=>{const S=O.toFiniteNumber(y.getContentLength());return S??h(C)};return async y=>{let{url:C,method:S,data:w,signal:T,cancelToken:E,timeout:L,onDownloadProgress:A,onUploadProgress:x,responseType:F,headers:P,withCredentials:N="same-origin",fetchOptions:M,maxContentLength:B,maxBodyLength:U}=fu(y);const ee=O.isNumber(B)&&B>-1,Q=O.isNumber(U)&&U>-1,te=q=>O.hasOwnProp(y,q)?y[q]:void 0;let ue=o||fetch;F=F?(F+"").toLowerCase():"text";let fe=HC([T,E&&E.toAbortSignal()],L),pe=null;const ie=fe&&fe.unsubscribe&&(()=>{fe.unsubscribe()});let Te,ye=null;const $=()=>new J("Request body larger than maxBodyLength limit",J.ERR_BAD_REQUEST,y,pe);try{let q;const Z=te("auth");if(Z){const W=O.getSafeProp(Z,"username")||"",Ce=O.getSafeProp(Z,"password")||"";q={username:W,password:Ce}}if(ZC(C)){const W=new URL(C,yt.origin);if(!q&&(W.username||W.password)){const Ce=gu(W.username),Ve=gu(W.password);q={username:Ce,password:Ve}}(W.username||W.password)&&(W.username="",W.password="",C=W.href)}if(q&&(P.delete("authorization"),P.set("Authorization","Basic "+btoa(YC((q.username||"")+":"+(q.password||""))))),ee&&typeof C=="string"&&C.startsWith("data:")&&KC(C)>B)throw new J("maxContentLength size of "+B+" exceeded",J.ERR_BAD_RESPONSE,y,pe);if(Q&&S!=="get"&&S!=="head"){const W=await h(w);if(typeof W=="number"&&isFinite(W)&&(Te=W,W>U))throw $()}const he=Q&&(O.isReadableStream(w)||O.isStream(w)),be=(W,Ce,Ve)=>hu(W,pu,nt=>{if(Q&&nt>U)throw ye=$();Ce&&Ce(nt)},Ve);if(m&&S!=="get"&&S!=="head"&&(x||he)){if(Te=Te??await v(P,w),Te!==0||he){let W=new s(C,{method:"POST",body:w,duplex:"half"}),Ce;if(O.isFormData(w)&&(Ce=W.headers.get("content-type"))&&P.setContentType(Ce),W.body){const[Ve,nt]=x&&iu(Te,Ks(lu(x)))||[];w=be(W.body,Ve,nt)}}}else if(he&&!c&&u&&S!=="get"&&S!=="head")w=be(w);else if(he&&c&&!m&&S!=="get"&&S!=="head")throw new J("Stream request bodies are not supported by the current fetch implementation",J.ERR_NOT_SUPPORT,y,pe);O.isString(N)||(N=N?"include":"omit");const ge=c&&"credentials"in s.prototype;if(O.isFormData(w)){const W=P.getContentType();W&&/^multipart\/form-data/i.test(W)&&!/boundary=/i.test(W)&&P.delete("content-type")}P.set("User-Agent","axios/"+Mi,!1);const le={...M,signal:fe,method:S.toUpperCase(),headers:Gd(P.normalize()),body:w,duplex:"half",credentials:ge?N:void 0};pe=c&&new s(C,le);let ve=await(c?ue(pe,M):ue(C,le));const Ae=wt.from(ve.headers);if(ee){const W=O.toFiniteNumber(Ae.getContentLength());if(W!=null&&W>B)throw new J("maxContentLength size of "+B+" exceeded",J.ERR_BAD_RESPONSE,y,pe)}const Y=g&&(F==="stream"||F==="response");if(g&&ve.body&&(A||ee||Y&&ie)){const W={};["status","statusText","headers"].forEach(ot=>{W[ot]=ve[ot]});const Ce=O.toFiniteNumber(Ae.getContentLength()),[Ve,nt]=A&&iu(Ce,Ks(lu(A),!0))||[];let He=0;const Ke=ot=>{if(ee&&(He=ot,He>B))throw new J("maxContentLength size of "+B+" exceeded",J.ERR_BAD_RESPONSE,y,pe);Ve&&Ve(ot)};ve=new a(hu(ve.body,pu,Ke,()=>{nt&&nt(),ie&&ie()}),W)}F=F||"text";let de=await b[O.findKey(b,F)||"text"](ve,y);if(ee&&!g&&!Y){let W;if(de!=null&&(typeof de.byteLength=="number"?W=de.byteLength:typeof de.size=="number"?W=de.size:typeof de=="string"&&(W=typeof n=="function"?new n().encode(de).byteLength:de.length)),typeof W=="number"&&W>B)throw new J("maxContentLength size of "+B+" exceeded",J.ERR_BAD_RESPONSE,y,pe)}return!Y&&ie&&ie(),await new Promise((W,Ce)=>{au(W,Ce,{data:de,headers:wt.from(ve.headers),status:ve.status,statusText:ve.statusText,config:y,request:pe})})}catch(q){if(ie&&ie(),fe&&fe.aborted&&fe.reason instanceof J){const Z=fe.reason;throw Z.config=y,pe&&(Z.request=pe),q!==Z&&(Z.cause=q),Z}throw ye?(pe&&!ye.request&&(ye.request=pe),ye):q instanceof J?(pe&&!q.request&&(q.request=pe),q):q&&q.name==="TypeError"&&/Load failed|fetch/i.test(q.message)?Object.assign(new J("Network Error",J.ERR_NETWORK,y,pe,q&&q.response),{cause:q.cause||q}):J.from(q,q&&q.code,y,pe,q&&q.response)}}},JC=new Map,vu=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,s=[n,o,r];let a=s.length,i=a,c,d,u=JC;for(;i--;)c=s[i],d=u.get(c),d===void 0&&u.set(c,d=i?new Map:XC(t)),u=d;return d};vu();const $i={http:vC,xhr:VC,fetch:{get:vu}};O.forEach($i,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const yu=e=>`- ${e}`,eS=e=>O.isFunction(e)||e===null||e===!1;function tS(e,t){e=O.isArray(e)?e:[e];const{length:r}=e;let n,o;const s={};for(let a=0;a<r;a++){n=e[a];let i;if(o=n,!eS(n)&&(o=$i[(i=String(n)).toLowerCase()],o===void 0))throw new J(`Unknown adapter '${i}'`);if(o&&(O.isFunction(o)||(o=o.get(t))))break;s[i||"#"+a]=o}if(!o){const a=Object.entries(s).map(([c,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let i=r?a.length>1?`since :
531
531
  `+a.map(yu).join(`
532
- `):" "+yu(a[0]):"as no adapter specified";throw new J("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return o}const bu={getAdapter:eS,adapters:$i};function Bi(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new No(null,e)}function Cu(e){return Bi(e),e.headers=wt.from(e.headers),e.data=Fi.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),bu.getAdapter(e.adapter||Po.adapter,e)(e).then(function(n){Bi(e),e.response=n;try{n.data=Fi.call(e,e.transformResponse,n)}finally{delete e.response}return n.headers=wt.from(n.headers),n},function(n){if(!su(n)&&(Bi(e),n&&n.response)){e.response=n.response;try{n.response.data=Fi.call(e,e.transformResponse,n.response)}finally{delete e.response}n.response.headers=wt.from(n.response.headers)}return Promise.reject(n)})}const Xs={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Xs[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Su={};Xs.transitional=function(t,r,n){function o(s,a){return"[Axios v"+Mi+"] Transitional option '"+s+"'"+a+(n?". "+n:"")}return(s,a,i)=>{if(t===!1)throw new J(o(a," has been removed"+(r?" in "+r:"")),J.ERR_DEPRECATED);return r&&!Su[a]&&(Su[a]=!0,console.warn(o(a," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(s,a,i):!0}},Xs.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function tS(e,t,r){if(typeof e!="object")throw new J("options must be an object",J.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const s=n[o],a=Object.prototype.hasOwnProperty.call(t,s)?t[s]:void 0;if(a){const i=e[s],c=i===void 0||a(i,s,e);if(c!==!0)throw new J("option "+s+" must be "+c,J.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new J("Unknown option "+s,J.ERR_BAD_OPTION)}}const Js={assertOptions:tS,validators:Xs},_t=Js.validators;let rn=class{constructor(t){this.defaults=t||{},this.interceptors={request:new tu,response:new tu}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const s=(()=>{if(!o.stack)return"";const a=o.stack.indexOf(`
532
+ `):" "+yu(a[0]):"as no adapter specified";throw new J("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return o}const bu={getAdapter:tS,adapters:$i};function Bi(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new No(null,e)}function Cu(e){return Bi(e),e.headers=wt.from(e.headers),e.data=Fi.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),bu.getAdapter(e.adapter||Po.adapter,e)(e).then(function(n){Bi(e),e.response=n;try{n.data=Fi.call(e,e.transformResponse,n)}finally{delete e.response}return n.headers=wt.from(n.headers),n},function(n){if(!su(n)&&(Bi(e),n&&n.response)){e.response=n.response;try{n.response.data=Fi.call(e,e.transformResponse,n.response)}finally{delete e.response}n.response.headers=wt.from(n.response.headers)}return Promise.reject(n)})}const Xs={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Xs[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Su={};Xs.transitional=function(t,r,n){function o(s,a){return"[Axios v"+Mi+"] Transitional option '"+s+"'"+a+(n?". "+n:"")}return(s,a,i)=>{if(t===!1)throw new J(o(a," has been removed"+(r?" in "+r:"")),J.ERR_DEPRECATED);return r&&!Su[a]&&(Su[a]=!0,console.warn(o(a," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(s,a,i):!0}},Xs.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function rS(e,t,r){if(typeof e!="object")throw new J("options must be an object",J.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const s=n[o],a=Object.prototype.hasOwnProperty.call(t,s)?t[s]:void 0;if(a){const i=e[s],c=i===void 0||a(i,s,e);if(c!==!0)throw new J("option "+s+" must be "+c,J.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new J("Unknown option "+s,J.ERR_BAD_OPTION)}}const Js={assertOptions:rS,validators:Xs},_t=Js.validators;let rn=class{constructor(t){this.defaults=t||{},this.interceptors={request:new tu,response:new tu}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const s=(()=>{if(!o.stack)return"";const a=o.stack.indexOf(`
533
533
  `);return a===-1?"":o.stack.slice(a+1)})();try{if(!n.stack)n.stack=s;else if(s){const a=s.indexOf(`
534
534
  `),i=a===-1?-1:s.indexOf(`
535
535
  `,a+1),c=i===-1?"":s.slice(i+1);String(n.stack).endsWith(c)||(n.stack+=`
536
- `+s)}}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=tn(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:s}=r;n!==void 0&&Js.assertOptions(n,{silentJSONParsing:_t.transitional(_t.boolean),forcedJSONParsing:_t.transitional(_t.boolean),clarifyTimeoutError:_t.transitional(_t.boolean),legacyInterceptorReqResOrdering:_t.transitional(_t.boolean),advertiseZstdAcceptEncoding:_t.transitional(_t.boolean),validateStatusUndefinedResolves:_t.transitional(_t.boolean)},!1),o!=null&&(O.isFunction(o)?r.paramsSerializer={serialize:o}:Js.assertOptions(o,{encode:_t.function,serialize:_t.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Js.assertOptions(r,{baseUrl:_t.spelling("baseURL"),withXsrfToken:_t.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let a=s&&O.merge(s.common,s[r.method]);s&&O.forEach(["delete","get","head","post","put","patch","query","common"],b=>{delete s[b]}),r.headers=wt.concat(a,s);const i=[];let c=!0;this.interceptors.request.forEach(function(h){if(typeof h.runWhen=="function"&&h.runWhen(r)===!1)return;c=c&&h.synchronous;const v=r.transitional||Pi;v&&v.legacyInterceptorReqResOrdering?i.unshift(h.fulfilled,h.rejected):i.push(h.fulfilled,h.rejected)});const d=[];this.interceptors.response.forEach(function(h){d.push(h.fulfilled,h.rejected)});let u,f=0,m;if(!c){const b=[Cu.bind(this),void 0];for(b.unshift(...i),b.push(...d),m=b.length,u=Promise.resolve(r);f<m;)u=u.then(b[f++],b[f++]);return u}m=i.length;let g=r;for(;f<m;){const b=i[f++],h=i[f++];try{g=b(g)}catch(v){h.call(this,v);break}}try{u=Cu.call(this,g)}catch(b){return Promise.reject(b)}for(f=0,m=d.length;f<m;)u=u.then(d[f++],d[f++]);return u}getUri(t){t=tn(this.defaults,t);const r=du(t.baseURL,t.url,t.allowAbsoluteUrls,t);return eu(r,t.params,t.paramsSerializer)}};O.forEach(["delete","get","head","options"],function(t){rn.prototype[t]=function(r,n){return this.request(tn(n||{},{method:t,url:r,data:n&&O.hasOwnProp(n,"data")?n.data:void 0}))}}),O.forEach(["post","put","patch","query"],function(t){function r(n){return function(s,a,i){return this.request(tn(i||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}rn.prototype[t]=r(),t!=="query"&&(rn.prototype[t+"Form"]=r(!0))});let rS=class ug{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(s){r=s});const n=this;this.promise.then(o=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](o);n._listeners=null}),this.promise.then=o=>{let s;const a=new Promise(i=>{n.subscribe(i),s=i}).then(o);return a.cancel=function(){n.unsubscribe(s)},a},t(function(s,a,i){n.reason||(n.reason=new No(s,a,i),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new ug(function(o){t=o}),cancel:t}}};function nS(e){return function(r){return e.apply(null,r)}}function oS(e){return O.isObject(e)&&e.isAxiosError===!0}const qi={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(qi).forEach(([e,t])=>{qi[t]=e});function wu(e){const t=new rn(e),r=$d(rn.prototype.request,t);return O.extend(r,rn.prototype,t,{allOwnKeys:!0}),O.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return wu(tn(e,o))},r}const rt=wu(Po);rt.Axios=rn,rt.CanceledError=No,rt.CancelToken=rS,rt.isCancel=su,rt.VERSION=Mi,rt.toFormData=Gs,rt.AxiosError=J,rt.Cancel=rt.CanceledError,rt.all=function(t){return Promise.all(t)},rt.spread=nS,rt.isAxiosError=oS,rt.mergeConfig=tn,rt.AxiosHeaders=wt,rt.formToJSON=e=>ou(O.isHTMLForm(e)?new FormData(e):e),rt.getAdapter=bu.getAdapter,rt.HttpStatusCode=qi,rt.default=rt;const{Axios:bP,AxiosError:CP,CanceledError:SP,isCancel:wP,CancelToken:_P,VERSION:TP,all:EP,Cancel:AP,isAxiosError:kP,spread:IP,toFormData:DP,AxiosHeaders:LP,HttpStatusCode:OP,formToJSON:PP,getAdapter:NP,mergeConfig:xP,create:FP}=rt;let ji="";function _u(e){ji=e}const Me=rt.create({timeout:3e4});function sS(e,t){if(!e||typeof t!="string"||!t.trim())return e;const r=t.trim().replace(/\/+$/,""),n=r.startsWith("/")?r:`/${r}`;return e.replace(/^\/(action|api|portal)(?=\/|$)/,n)}Me.interceptors.request.use(async e=>{var o,s,a;const{useEditorStore:t}=await Promise.resolve().then(()=>ab),r=t.getState(),n=(o=r.editorConfig)==null?void 0:o.context;return e.headers=e.headers??{},n!=null&&n.authToken&&(e.headers.Authorization=`Bearer ${n.authToken}`),n!=null&&n.userToken&&(e.headers["X-Authenticated-User-Token"]=n.userToken),n!=null&&n.channel&&(e.headers["X-Channel-Id"]=n.channel),e.url=sS(e.url,(a=(s=r.editorConfig)==null?void 0:s.config)==null?void 0:a.apiSlug),ji&&(e.baseURL=ji),e});const Tu="/portal";async function Eu(e){var n,o,s,a,i,c,d;const t=await Me.get(`${Tu}/questionset/v2/hierarchy/${e}`,{params:{mode:"edit"}}),r=(o=(n=t.data)==null?void 0:n.result)==null?void 0:o.questionset;if(!r||!r.identifier){const u=((a=(s=t.data)==null?void 0:s.params)==null?void 0:a.errmsg)||((c=(i=t.data)==null?void 0:i.params)==null?void 0:c.err)||((d=t.data)==null?void 0:d.responseCode)||`No questionset returned for "${e}"`;throw new Error(`Unable to load questionset hierarchy: ${u}`)}return r}async function aS(e){var r,n;return e.length?((n=(r=(await Me.post(`${Tu}/question/v2/list`,{request:{search:{identifier:e}}})).data)==null?void 0:r.result)==null?void 0:n.questions)??[]:[]}function ea(e,t){const r=e??{},n=r.identifier??"",o=r.objectType??"",s=r.mimeType??"",a=r.children,i=Array.isArray(a)?a.map(d=>ea(d,n)):[],c=s==="application/vnd.ekstep.content-collection"||o.toLowerCase().includes("unit")||o.toLowerCase().includes("textbook")||o.toLowerCase().includes("collection")||o.toLowerCase().includes("course")||o.toLowerCase().includes("lesson")||r.visibility==="Parent"||s==="application/vnd.sunbird.questionset"&&i.length>0;return{id:n,identifier:n,name:r.name??"Untitled",title:r.name??"Untitled",description:r.description,primaryCategory:r.primaryCategory,mimeType:r.mimeType,objectType:o,contentType:r.contentType,visibility:r.visibility,status:r.status,appIcon:r.appIcon,isFolder:c,children:i,metadata:r,parent:t}}async function Au(e){var o,s,a,i,c,d,u;const t=await Me.get(`/action/content/v3/hierarchy/${e}`,{params:{mode:"edit"}}),r=(s=(o=t.data)==null?void 0:o.result)==null?void 0:s.content;if(!r||!r.identifier){const f=((i=(a=t.data)==null?void 0:a.params)==null?void 0:i.errmsg)||((d=(c=t.data)==null?void 0:c.params)==null?void 0:d.err)||((u=t.data)==null?void 0:u.responseCode)||`No content returned for "${e}"`;throw new Error(`Unable to load hierarchy: ${f}`)}const n=ea(r);return{content:r,rootNode:n}}async function iS(e){const t=await Eu(e),r=ea(t);return{content:t,rootNode:r}}async function lS(e,t,r,n){var s;return((s=(await Me.patch("/action/content/v3/hierarchy/update",{request:{data:{nodesModified:t,hierarchy:r,...n?{lastUpdatedBy:n}:{}}}})).data)==null?void 0:s.result)??{}}async function cS(e,t=""){await Me.post(`/action/content/v3/publish/${e}`,{request:{content:{lastPublishedBy:t}}})}async function ku(e){var n,o,s,a,i,c,d;const t=await Me.get(`/action/course/v1/hierarchy/${e}`,{params:{mode:"edit"}}),r=(o=(n=t.data)==null?void 0:n.result)==null?void 0:o.content;if(!r||!r.identifier){const u=((a=(s=t.data)==null?void 0:s.params)==null?void 0:a.errmsg)||((c=(i=t.data)==null?void 0:i.params)==null?void 0:c.err)||((d=t.data)==null?void 0:d.responseCode)||`No course returned for "${e}"`;throw new Error(`Unable to load course hierarchy: ${u}`)}return r}async function dS(e){var r,n;return(n=(r=(await Me.get(`/action/content/v3/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.content}async function uS(e){await Me.post(`/action/content/v3/review/${e}`,{request:{content:{}}})}async function fS(e,t){await Me.post(`/action/content/v3/reject/${e}`,{request:{content:{rejectComment:t}}})}async function hS(e,t){await Me.patch(`/action/content/v1/collaborator/update/${e}`,{request:{content:{collaborators:t}}})}const pS="application/vnd.sunbird.questionset";function Iu(e){let t=!1,r=!0;function n(o){for(const s of o){const a=s.children??[];if(a.length>0){n(a);continue}t=!0,s.objectType==="QuestionSet"&&s.mimeType===pS||(r=!1)}}return n(e.children??[]),t&&r}const Du=new Map;async function Lu(e){const t=Du.get(e);if(t)return t;const r=await ku(e),{children:n,...o}=r??{},s={qualifies:Iu(r),meta:o};return Du.set(e,s),s}async function Ou(e){return(await Lu(e)).qualifies}async function gS(e){var n;const t=e.children??[],r=[];for(let o=0;o<t.length;o++){const s=t[o],a=s.children??[],i=[];for(const c of a){let d=!!((n=c.metadata)!=null&&n.isAssessmentCourse);if(!d){if((c.children??[]).length>0)d=Iu(c);else if(a.length===1&&(o===0||o===t.length-1))try{d=await Ou(c.identifier)}catch(u){console.error("[lpStructure] assessment-course check failed on load:",u)}}i.push({...c,isFolder:!1,children:[],metadata:{...c.metadata??{},...d?{isAssessmentCourse:!0}:{}}})}r.push({...s,children:i})}return{...e,children:r}}function lt(e){var r,n;const t=(e==null?void 0:e.children)??[];return t.length===1&&!!((n=(r=t[0])==null?void 0:r.metadata)!=null&&n.isAssessmentCourse)}function mS(e,t,r){return r?e===0?"pre":e===t-1?"post":"levelAssessment":"content"}function vS(e,t){const r=e.findIndex(o=>o.id===t);return r===-1?null:Fo(e,r)?{role:r===0?"pre":"post",levelNumber:null}:{role:"level",levelNumber:e.slice(0,r+1).filter((o,s)=>!Fo(e,s)).length}}function xo(e,t){return t==="pre"?e.length>0&&lt(e[0]):e.length>1&&lt(e[e.length-1])}function Fo(e,t){const r=mS(t,e.length,lt(e[t]));return r==="pre"||r==="post"}function Ui(e,t){const r=t?e.findIndex(n=>n.id===t.id):-1;return r!==-1&&Fo(e,r)}function yS(e){return xo(e,"pre")?xo(e,"post")?null:"post":"pre"}function bS(e,t,r){if(t<0||t>=e.length)return!1;const n=lt(e[0])?e[0]:null,o=e.length>1&&lt(e[e.length-1])?e[e.length-1]:null;if(!n&&!o)return!0;const s=[...e],[a]=s.splice(t,1);return s.splice(r,0,a),!(n&&s[0]!==n||o&&s[s.length-1]!==o)}function Pu(e,t,r){return r?!1:t?!((e==null?void 0:e.children)??[]).some(o=>{var s;return!!((s=o.metadata)!=null&&s.isAssessmentCourse)}):!0}function xn(e){return Array.isArray(e)?e.map(String):e?[String(e)]:[]}function Nu(e,t){var n,o;return e?((n=t[e.id])==null?void 0:n.framework)??((o=e.metadata)==null?void 0:o.framework):void 0}function xu(e,t){return!!Nu(e,t)}function CS(e,t){if(!e||!t)return[];const r=new Set,n=e.children??[];return n.forEach((o,s)=>{var a,i;Fo(n,s)?xn((a=o.children[0].metadata)==null?void 0:a[t]).forEach(c=>r.add(c)):xn((i=o.metadata)==null?void 0:i[t]).forEach(c=>r.add(c))}),Array.from(r)}function SS(e,t,r){if(!e||!t||r.length===0)return[];const n=e.children??[];return n.filter((o,s)=>{var i;return Fo(n,s)?!1:xn((i=o.metadata)==null?void 0:i[t]).some(c=>!r.includes(c))})}function Fu(e,t,r){var o;if(!e||!r||t.length===0)return[];const n=new Set;for(const s of e.children??[])xn((o=s.metadata)==null?void 0:o[r]).forEach(a=>n.add(a));return t.filter(s=>!n.has(s))}const Mu=new Set(["adaptive"]);function zi(e,t,r,n={}){var b,h,v,y;const o=[];if(!e)return o;const s=((b=n[e.id])==null?void 0:b.policy)??((h=e.metadata)==null?void 0:h.policy);s||o.push({code:"policyMissing",message:"Set a consumption policy for this path."});const a=e.children??[],i=a[0],c=a.length>1?a[a.length-1]:void 0,d=lt(i),u=lt(c);!d&&s&&Mu.has(s)&&o.push({code:"priorAssessmentRequired",message:"A Prior Assessment is required for the Adaptive policy."}),[[i,"Prior Assessment"],[c,"Outcome Assessment"]].forEach(([C,S])=>{var T,E;if(!C)return;const w=C.children??[];(w.length!==1||!((E=(T=w[0])==null?void 0:T.metadata)!=null&&E.isAssessmentCourse))&&o.push({code:"slotNotPure",nodeId:C.id,message:`${S} must contain exactly one question-set-only course.`})});const f=new Set,m=(C,S)=>{f.has(C)&&o.push({code:"duplicateCourse",nodeId:S,message:"A course appears more than once in this path."}),f.add(C)},g=a.slice(d?1:0,a.length-(u?1:0));d&&m(i.children[0].id,i.id),u&&m(c.children[0].id,c.id);for(const C of g){const S=C.children??[],w=S.length===0;w&&o.push({code:"emptyLevel",nodeId:C.id,message:`"${C.name}" has no courses yet.`});const T=t?xn((v=C.metadata)==null?void 0:v[t]):[];if(T.length===0)w||o.push({code:"levelMissingSkills",nodeId:C.id,message:`"${C.name}" needs at least one skill selected.`});else{if(r.length>0){const L=T.filter(A=>!r.includes(A));L.length>0&&o.push({code:"levelSkillsOutOfScope",nodeId:C.id,message:`"${C.name}" has skills outside the current scope: ${L.join(", ")}.`})}const E=Fu(C,T,t);E.length>0&&o.push({code:"levelSkillsUncovered",nodeId:C.id,message:`"${C.name}" has no course covering: ${E.join(", ")}.`})}for(const E of S)m(E.id,C.id),(t?xn((y=E.metadata)==null?void 0:y[t]):[]).length===0&&o.push({code:"courseMissingSkillTag",nodeId:E.id,message:`"${E.name}" has no skill tag.`})}return o}async function wS(e){const t=[],r=(e==null?void 0:e.children)??[],n=r[0],o=r.length>1?r[r.length-1]:void 0;for(const[s,a]of[[n,"Prior Assessment"],[o,"Outcome Assessment"]]){if(!s||!lt(s))continue;const i=s.children[0].id;await Ou(i)||t.push({code:"slotCourseChanged",nodeId:s.id,message:`${a}'s course is no longer question-set-only — pick a different course.`})}return t}function Mt(e,t){const r=[...e];for(;r.length>0;){const n=r.shift();if(n.id===t)return n;n.children&&r.push(...n.children)}}function $u(e,t,r=0){var n;for(const o of e){if(o.id===t)return r;if((n=o.children)!=null&&n.length){const s=$u(o.children,t,r+1);if(s>=0)return s}}return-1}const Bu=new Set(["name","appIcon","description","keywords","trackable","qrCodeProcessId","reservedDialcodes"]);function qu(e,t,r,n){return e.map(o=>{if(o.id===t){const s=r.metadata??{},a=n!=null&&n.length?new Set([...Bu,...n]):Bu,i={};for(const c of a)c in r&&(i[c]=r[c]);return{...o,...r,metadata:{...o.metadata??{},...i,...s}}}return o.children&&o.children.length>0?{...o,children:qu(o.children,t,r,n)}:o})}function ta(e,t,r){return e.map(n=>n.id===t?{...n,children:[...n.children??[],r]}:n.children&&n.children.length>0?{...n,children:ta(n.children,t,r)}:n)}function ju(e,t,r,n){return e.map(o=>{if(o.id===t){const s=[...o.children??[]];return s.splice(n,0,r),{...o,children:s}}return o.children&&o.children.length>0?{...o,children:ju(o.children,t,r,n)}:o})}function Vi(e,t){return e.filter(r=>r.id!==t).map(r=>({...r,children:r.children?Vi(r.children,t):[]}))}function Hi(e,t,r,n){return e.map(o=>{if(o.id===t){const s=[...o.children??[]],[a]=s.splice(r,1);return s.splice(n,0,a),{...o,children:s}}return o.children&&o.children.length>0?{...o,children:Hi(o.children,t,r,n)}:o})}function Uu(e,t){return e.map(r=>{const n=t[r.id]??r.id,o=r.parent?t[r.parent]??r.parent:r.parent;return{...r,id:n,identifier:n,parent:o,children:r.children?Uu(r.children,t):[]}})}function _S(e){let t=0;const r=[...e];for(;r.length>0;){const n=r.shift();n.isFolder||t++,n.children&&r.push(...n.children)}return t}function TS(e,t){const r=Mt(e,t);if(!r)return[];const n=[];let o=r;for(;o;)n.unshift({id:o.id,name:o.name}),o=o.parent?Mt(e,o.parent):void 0;return n}const ae=ko((e,t)=>({treeData:[],selectedNodeId:null,treeCache:{},breadcrumb:[],activeNodeMeta:{},setTreeData:r=>{var o;const n=((o=r[0])==null?void 0:o.id)??null;e({treeData:r,selectedNodeId:n}),n&&setTimeout(()=>t().selectNode(n),0)},selectNode:r=>{const{treeData:n,treeCache:o,getBreadcrumb:s}=t(),a=Mt(n,r),i=s(r),c={...(a==null?void 0:a.metadata)??{},...o[r]??{}};K.getState().setNodeFlags({isFolder:(a==null?void 0:a.isFolder)??!1,isRoot:!(a!=null&&a.parent),isQuml:!1}),fr.getState().setActiveAssessmentSlot(null),e({selectedNodeId:r,breadcrumb:i,activeNodeMeta:c})},updateNode:(r,n,o)=>{if(e(s=>({treeData:qu(s.treeData,r,n,o),treeCache:{...s.treeCache,[r]:{...s.treeCache[r]??{},...n}}})),t().selectedNodeId===r){const s=Mt(t().treeData,r);e(a=>({activeNodeMeta:{...(s==null?void 0:s.metadata)??{},...a.treeCache[r]??{}}}))}t().markDirty()},addNode:(r,n)=>{var m,g,b;const o=t(),s=K.getState().editorProfile,a=((g=(m=K.getState().editorConfig)==null?void 0:m.config)==null?void 0:g.maxDepth)??s.maxDepth,i=$u(o.treeData,r);if(i>=a)return console.warn(`[tree.store] addNode: depth would exceed maxDepth (${a}). parentDepth=${i}`),"";const c="temp-"+Math.random().toString(36).slice(2),d={id:c,identifier:c,name:s.defaultUnitName,isFolder:!0,children:[],parent:r,metadata:{mimeType:"application/vnd.ekstep.content-collection",code:c,name:s.defaultUnitName,contentType:s.unitContentType,primaryCategory:s.unitPrimaryCategory,visibility:"Parent"}},u=((b=Mt(o.treeData,r))==null?void 0:b.children)??[],f=s.derivedRoles&&xo(u,"post");return e(h=>({treeData:f?ju(h.treeData,r,d,u.length-1):ta(h.treeData,r,d),treeCache:{...h.treeCache,[c]:{...d.metadata,isNew:!0}}})),setTimeout(()=>t().selectNode(c),0),c},deleteNode:r=>{var o;const n=(o=t().treeData[0])==null?void 0:o.id;r!==n&&e(s=>({treeData:Vi(s.treeData,r),selectedNodeId:s.selectedNodeId===r?null:s.selectedNodeId}))},reorderChildren:(r,n,o)=>{var i;const s=K.getState().editorProfile,a=(i=t().treeData[0])==null?void 0:i.id;if(s.derivedRoles&&r===a){const c=Mt(t().treeData,r);if(c!=null&&c.children&&!bS(c.children,n,o))return}e(c=>({treeData:Hi(c.treeData,r,n,o)}))},moveNode:(r,n,o)=>{var d,u,f;const s=K.getState().editorProfile,a=Mt(t().treeData,r),i=Mt(t().treeData,o);if(!(i!=null&&i.isFolder))return;const c=(d=t().treeData[0])==null?void 0:d.id;if(!(s.derivedRoles&&(a!=null&&a.isFolder)&&o!==c)){if(s.derivedRoles&&a&&!a.isFolder){const m=!!((u=a.metadata)!=null&&u.isAssessmentCourse),g=((f=t().treeData[0])==null?void 0:f.children)??[];if(!Pu(i,m,Ui(g,i)))return}e(m=>{const g=Mt(m.treeData,r);if(!g)return m;let b=Vi(m.treeData,r);return b=ta(b,o,{...g,parent:o}),{treeData:b}}),t().markDirty()}},addResource:(r,n,o)=>{var b,h,v,y,C,S;const s=K.getState().editorConfig,a=K.getState().editorProfile,i=(b=t().treeData[0])==null?void 0:b.id,c=!!(o!=null&&o.isAssessmentCourse);if(a.derivedRoles&&n===i){if(!c||Mt(t().treeData,r.identifier))return!1;const w=t().treeData[0],T=(w==null?void 0:w.children)??[],E=(o==null?void 0:o.slot)??yS(T);if(!E||xo(T,E))return!1;const L=t().addNode(i,"unit");if(!L)return!1;const{learningPath:A}=Ti.getState().labelConfig;if(t().updateNode(L,{name:E==="pre"?A.priorAssessmentLabel:A.outcomeAssessmentLabel}),E==="pre"){const x=(((v=(h=t().treeData[0])==null?void 0:h.children)==null?void 0:v.length)??1)-1;e(F=>({treeData:Hi(F.treeData,i,x,0)}))}return t().addResource(r,L,o)}if(!(((y=s==null?void 0:s.config)==null?void 0:y.allowContentUnderRoot)??!1)&&n===i||Mt(t().treeData,r.identifier))return!1;const u=Mt(t().treeData,n);if(!(u!=null&&u.isFolder))return!1;if(a.derivedRoles){const w=((C=t().treeData[0])==null?void 0:C.children)??[];if(!Pu(u,c,Ui(w,u)))return!1}const f=((S=s==null?void 0:s.config)==null?void 0:S.maxContentsLimit)??1200;if(_S(t().treeData)>=f)return!1;const g={id:r.identifier,identifier:r.identifier,name:r.name,isFolder:!1,children:[],parent:n,mimeType:r.mimeType,primaryCategory:r.primaryCategory,contentType:r.contentType,appIcon:r.appIcon,status:r.status,metadata:{...r,...c?{isAssessmentCourse:!0}:{}}};return e(w=>({treeData:ta(w.treeData,n,g)})),t().markDirty(),!0},markDirty:()=>{const{editorMode:r,setIsDirty:n}=K.getState();r==="edit"&&n(!0)},pruneCoursesByFramework:r=>{let n=0;return e(o=>{const s=o.treeData[0];if(!s)return o;const a=[];for(const i of s.children??[]){const c=lt(i),d=(i.children??[]).filter(u=>{var g;if(u.isFolder)return!0;const f=(g=u.metadata)==null?void 0:g.framework,m=!f||(Array.isArray(f)?f.includes(r):f===r);return m||n++,m});c&&d.length===0||a.push(d.length===(i.children??[]).length?i:{...i,children:d})}return n===0?o:{treeData:[{...s,children:a}]}}),n>0&&t().markDirty(),n},clearLevelSkills:r=>{if(!r)return 0;let n=0;return e(o=>{const s=o.treeData[0];if(!s)return o;const a={...o.treeCache},i=(s.children??[]).map(c=>{var m,g;if(!(((m=c.metadata)==null?void 0:m[r])!==void 0||((g=a[c.id])==null?void 0:g[r])!==void 0))return c;n++;const{[r]:u,...f}=c.metadata??{};if(a[c.id]){const{[r]:b,...h}=a[c.id];a[c.id]=h}return{...c,metadata:f}});return n===0?o:{treeData:[{...s,children:i}],treeCache:a}}),n>0&&t().markDirty(),n},replaceNodeIds:r=>{!r||Object.keys(r).length===0||e(n=>{const o=Uu(n.treeData,r),s={};for(const[i,c]of Object.entries(n.treeCache)){const d=r[i]??i,{isNew:u,...f}=c;s[d]=f}const a=n.selectedNodeId?r[n.selectedNodeId]??n.selectedNodeId:null;return{treeData:o,treeCache:s,selectedNodeId:a}})},getNodeById:r=>Mt(t().treeData,r),getChildrenOf:r=>{const n=Mt(t().treeData,r);return(n==null?void 0:n.children)??[]},getBreadcrumb:r=>TS(t().treeData,r)})),ES={spin:"_spin_1ah4d_9"};function ne(){return Ti(e=>e.labelConfig)}const AS=({size:e=16,color:t="currentColor"})=>{const r=ne();return l.jsx("svg",{className:ES.spin,width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-label":r.spinner.loading,role:"status",children:l.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:t,strokeWidth:"3",strokeDasharray:"31.4",strokeDashoffset:"10",strokeLinecap:"round"})})},$e=({variant:e="ghost",size:t="md",isLoading:r,disabled:n,onClick:o,children:s,className:a,type:i="button"})=>l.jsxs("button",{type:i,className:`sbx-btn-${e} ${t==="sm"?"sbx-btn-sm":""} ${a??""}`,onClick:o,disabled:r||n,"aria-busy":r?!0:void 0,children:[r?l.jsx(AS,{size:14}):null,s]}),zu=({size:e=16,...t})=>l.jsxs("svg",{width:e,height:e,viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[l.jsx("circle",{cx:"58",cy:"12",r:"4",stroke:"currentColor",strokeWidth:"4"}),l.jsx("circle",{cx:"8",cy:"58",r:"4",stroke:"currentColor",strokeWidth:"4"}),l.jsx("path",{d:"M52 12 H24 A12 12 0 0 0 24 36 H40 A12 12 0 0 1 40 60 H12",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]});async function Vu(e){var r,n;return(n=(r=(await Me.get(`/action/framework/v1/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.framework}async function kS(e){var r,n;return((n=(r=(await Me.post("/action/composite/v3/search",{request:{filters:{objectType:"Framework",status:["Live"],...e.type?{type:e.type}:{},...e.identifier?{identifier:e.identifier}:{},...e.channel?{channel:e.channel}:{},...e.systemDefault?{systemDefault:e.systemDefault}:{}}}})).data)==null?void 0:r.result)==null?void 0:n.Framework)??[]}function ra(e,t){const r=_n({queryKey:["framework",e],queryFn:()=>Vu(e),enabled:!!e,staleTime:3e5}),n=t==null?void 0:t[0],o=_n({queryKey:["framework",n],queryFn:()=>Vu(n),enabled:!!n,staleTime:300*1e3}),s=o.data?[o.data]:[];return{organisationFramework:r.data,targetFrameworks:s,isLoading:r.isLoading||o.isLoading}}function Hu(e){if(!(e!=null&&e.length))return null;const t=e.reduce((r,n)=>(n.index??-1/0)>(r.index??-1/0)?n:r);return{code:t.code,terms:t.terms??[]}}function IS(e){var n,o,s,a;const t=(n=e==null?void 0:e.children)==null?void 0:n[0];if(!lt(t))return;const r=(a=(s=(o=t==null?void 0:t.children)==null?void 0:o[0])==null?void 0:s.metadata)==null?void 0:a.framework;return Array.isArray(r)?r[0]:r}function hr(){var s;const e=K(a=>a.editorConfig),t=K(a=>a.contentFramework),r=ae(a=>a.treeData),n=IS(r[0])??t??((s=e==null?void 0:e.context)==null?void 0:s.framework),{organisationFramework:o}=ra(n);return Hu(o==null?void 0:o.categories)}function DS(e,t,r){var d,u,f,m;const n={scope:((t==null?void 0:t.terms)??[]).map(g=>g.name),source:"manual"};if(!t)return n;const o=(d=e==null?void 0:e.children)==null?void 0:d[0];if(!lt(o))return n;const s=(u=o==null?void 0:o.children)==null?void 0:u[0];if(!s)return n;const i=((f=r[s.id])==null?void 0:f[t.code])??((m=s.metadata)==null?void 0:m[t.code]);return{scope:Array.isArray(i)?i:i?[i]:[],source:"prior"}}function Mo(){const e=hr(),t=ae(n=>n.treeData),r=ae(n=>n.treeCache);return p.useMemo(()=>DS(t[0],e,r),[t,e,r])}const Ie={overlay:"_overlay_kdzmi_1",modal:"_modal_kdzmi_15",modalHeader:"_modalHeader_kdzmi_27",modalHeaderClose:"_modalHeaderClose_kdzmi_37",modalBody:"_modalBody_kdzmi_55",modalFooter:"_modalFooter_kdzmi_62",checkRow:"_checkRow_kdzmi_69",formGroup:"_formGroup_kdzmi_112",textarea:"_textarea_kdzmi_123",sliderGroup:"_sliderGroup_kdzmi_144",sliderValue:"_sliderValue_kdzmi_156",sliderLabels:"_sliderLabels_kdzmi_164",sectionTitle:"_sectionTitle_kdzmi_172"},LS=({objectType:e,onConfirm:t,onCancel:r})=>{const n=ne(),o=ae(b=>b.treeData[0]),s=ae(b=>b.treeCache),a=hr(),{scope:i}=Mo(),[c,d]=p.useState(null),u=zi(o,a==null?void 0:a.code,i,s);p.useEffect(()=>{let b=!1;return d(null),wS(o).then(h=>{b||d(h)}),()=>{b=!0}},[o]);const f=c===null,m=[...u,...c??[]],g=!f&&m.length===0;return l.jsx("div",{className:Ie.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"publish-modal-title",children:l.jsxs("div",{className:Ie.modal,children:[l.jsxs("div",{className:Ie.modalHeader,children:[l.jsxs("span",{id:"publish-modal-title",children:[n.publishChecklist.publishTitlePrefix," ",e]}),l.jsx("button",{className:Ie.modalHeaderClose,onClick:r,"aria-label":n.publishChecklist.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:Ie.modalBody,children:m.length===0?l.jsx("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:f?n.learningPath.verifyingAssessmentCourses:`${n.publishChecklist.confirmPublishPrefix} ${e}?`}):l.jsxs(l.Fragment,{children:[l.jsx("p",{className:Ie.sectionTitle,children:n.learningPath.resolveBeforePublishing}),l.jsx("ul",{style:{margin:0,paddingLeft:18,fontSize:13,lineHeight:1.6},children:m.map((b,h)=>l.jsx("li",{children:b.message},`${b.code}-${b.nodeId??h}`))})]})}),l.jsxs("div",{className:Ie.modalFooter,children:[l.jsx($e,{variant:"ghost",onClick:r,children:n.publishChecklist.noButton}),l.jsx($e,{variant:"primary",onClick:t,disabled:!g,children:n.publishChecklist.yesButton})]})]})})},OS=({contentId:e,onConfirm:t,onCancel:r})=>{const n=ne(),o=K(m=>{var g,b;return(b=(g=m.editorConfig)==null?void 0:g.config)==null?void 0:b.objectType})||"Content",s=K(m=>m.editorProfile.key==="learningPath"),a=K(m=>m.publishChecklist)??[],[i,c]=p.useState({}),d=a.every(m=>i[m.code]),u=a.length===0||d,f=()=>{t()};return s?l.jsx(LS,{objectType:o,onConfirm:t,onCancel:r}):l.jsx("div",{className:Ie.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"publish-modal-title",children:l.jsxs("div",{className:Ie.modal,children:[l.jsxs("div",{className:Ie.modalHeader,children:[l.jsxs("span",{id:"publish-modal-title",children:[n.publishChecklist.publishTitlePrefix," ",o]}),l.jsx("button",{className:Ie.modalHeaderClose,onClick:r,"aria-label":n.publishChecklist.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:Ie.modalBody,children:a.length===0?l.jsxs("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:[n.publishChecklist.confirmPublishPrefix," ",o,"?"]}):l.jsxs(l.Fragment,{children:[l.jsx("p",{className:Ie.sectionTitle,children:n.publishChecklist.checklistInstructions}),a.map(m=>l.jsxs("label",{className:Ie.checkRow,children:[l.jsx("input",{type:"checkbox",checked:!!i[m.code],onChange:g=>c(b=>({...b,[m.code]:g.target.checked}))}),l.jsx("span",{children:m.label})]},m.code))]})}),l.jsxs("div",{className:Ie.modalFooter,children:[l.jsx($e,{variant:"ghost",onClick:r,children:n.publishChecklist.noButton}),l.jsx($e,{variant:"primary",onClick:f,disabled:!u,children:n.publishChecklist.yesButton})]})]})})},PS=({contentId:e,action:t,onConfirm:r,onCancel:n})=>{const o=ne(),[s,a]=p.useState(""),[i,c]=p.useState(7),d=t==="approve",u=d?o.qualityParamsModal.reviewQualityTitle:o.qualityParamsModal.rejectContentTitle,f=!d&&s.trim().length===0,m=()=>{d?r(s.trim(),i):r(s.trim())};return l.jsx("div",{className:Ie.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"quality-modal-title",children:l.jsxs("div",{className:Ie.modal,children:[l.jsxs("div",{className:Ie.modalHeader,children:[l.jsx("span",{id:"quality-modal-title",children:u}),l.jsx("button",{className:Ie.modalHeaderClose,onClick:n,"aria-label":o.qualityParamsModal.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:Ie.modalBody,children:d?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:Ie.formGroup,children:[l.jsx("label",{htmlFor:"quality-score",children:o.qualityParamsModal.qualityScoreLabel}),l.jsxs("div",{className:Ie.sliderGroup,children:[l.jsx("input",{id:"quality-score",type:"range",min:0,max:10,step:1,value:i,onChange:g=>c(Number(g.target.value)),"aria-valuemin":0,"aria-valuemax":10,"aria-valuenow":i}),l.jsx("span",{className:Ie.sliderValue,children:i})]}),l.jsxs("div",{className:Ie.sliderLabels,children:[l.jsx("span",{children:o.qualityParamsModal.scorePoorLabel}),l.jsx("span",{children:o.qualityParamsModal.scoreExcellentLabel})]})]}),l.jsxs("div",{className:Ie.formGroup,children:[l.jsxs("label",{htmlFor:"quality-comment",children:[o.qualityParamsModal.commentLabel," ",l.jsx("span",{style:{fontWeight:400,color:"var(--sbx-gray-400, #9CA3AF)"},children:o.qualityParamsModal.optionalLabel})]}),l.jsx("textarea",{id:"quality-comment",className:Ie.textarea,placeholder:o.qualityParamsModal.commentPlaceholder,value:s,onChange:g=>a(g.target.value),rows:4})]})]}):l.jsxs("div",{className:Ie.formGroup,children:[l.jsxs("label",{htmlFor:"reject-reason",children:[o.qualityParamsModal.rejectionReasonLabel," ",l.jsx("span",{style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),l.jsx("textarea",{id:"reject-reason",className:Ie.textarea,placeholder:o.qualityParamsModal.rejectReasonPlaceholder,value:s,onChange:g=>a(g.target.value),rows:5,required:!0,"aria-required":"true"}),s.trim().length===0&&l.jsx("p",{style:{fontSize:12,color:"var(--sbx-error, #DC2626)",marginTop:4},children:o.qualityParamsModal.rejectionRequiredMessage})]})}),l.jsxs("div",{className:Ie.modalFooter,children:[l.jsx($e,{variant:"ghost",onClick:n,children:o.qualityParamsModal.cancelButton}),l.jsx($e,{variant:d?"primary":"danger",onClick:m,disabled:f,children:d?o.qualityParamsModal.approveButton:o.qualityParamsModal.rejectButton})]})]})})},NS=({message:e,onConfirm:t,onCancel:r})=>{const n=ne();return Ue.createPortal(l.jsx("div",{className:Ie.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"confirm-dialog-title",children:l.jsxs("div",{className:Ie.modal,children:[l.jsxs("div",{className:Ie.modalHeader,children:[l.jsx("span",{id:"confirm-dialog-title",children:n.confirmDialog.title}),l.jsx("button",{className:Ie.modalHeaderClose,onClick:r,"aria-label":n.confirmDialog.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:Ie.modalBody,children:l.jsx("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:e})}),l.jsxs("div",{className:Ie.modalFooter,children:[l.jsx($e,{variant:"ghost",onClick:r,children:n.confirmDialog.cancelButton}),l.jsx($e,{variant:"danger",onClick:t,children:n.confirmDialog.confirmButton})]})]})}),document.body)},Qu=["email","firstName","lastName","identifier","organisations","rootOrgName","phone"];async function xS(e,t={}){var c,d,u,f;const n={"organisations.roles":[((c=t.objectType)==null?void 0:c.toLowerCase())==="textbook"?"BOOK_CREATOR":"CONTENT_CREATOR"]};t.rootOrgId&&(n.rootOrgId=[t.rootOrgId]);const o=e.includes("@"),s=/^\d{10,}$/.test(e.trim()),a={filters:n,fields:Qu,offset:0,limit:t.limit??200};return o?n.email=e.trim():s?n.phone=e.trim():a.query=e,((f=(u=(d=(await Me.post("/action/user/v1/search",{request:a},{params:{fields:"orgName"},headers:{"X-Source":"web","X-msgid":Math.random().toString(36).slice(2)}})).data)==null?void 0:d.result)==null?void 0:u.response)==null?void 0:f.content)??[]}async function FS(e){var r,n,o;return e.length?((o=(n=(r=(await Me.post("/action/user/v1/search",{request:{filters:{userId:e},fields:Qu,limit:e.length}},{headers:{"X-Source":"web","X-msgid":Math.random().toString(36).slice(2)}})).data)==null?void 0:r.result)==null?void 0:n.response)==null?void 0:o.content)??[]:[]}async function MS(e){var r,n;return((n=(r=(await Me.get(`/portal/user/v5/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.response)??{}}const Be={container:"_container_1hnn8_1",header:"_header_1hnn8_13",title:"_title_1hnn8_22",closeBtn:"_closeBtn_1hnn8_29",body:"_body_1hnn8_45",label:"_label_1hnn8_54",searchSection:"_searchSection_1hnn8_62",searchRow:"_searchRow_1hnn8_68",searchInput:"_searchInput_1hnn8_74",searchSpinner:"_searchSpinner_1hnn8_89",resultsList:"_resultsList_1hnn8_105",resultItem:"_resultItem_1hnn8_118",userInfo:"_userInfo_1hnn8_133",userName:"_userName_1hnn8_141",userEmail:"_userEmail_1hnn8_150",userOrg:"_userOrg_1hnn8_158",noResults:"_noResults_1hnn8_167",collabSection:"_collabSection_1hnn8_174",sectionTitle:"_sectionTitle_1hnn8_179",badge:"_badge_1hnn8_189",emptyCollab:"_emptyCollab_1hnn8_203",collabList:"_collabList_1hnn8_214",collabItem:"_collabItem_1hnn8_223",userAvatar:"_userAvatar_1hnn8_237",error:"_error_1hnn8_251",success:"_success_1hnn8_257",footer:"_footer_1hnn8_263"},$S=({contentId:e,onClose:t})=>{var x,F;const r=ne(),n=K(P=>P.editorConfig),o=(x=n==null?void 0:n.context)==null?void 0:x.channel,s=(F=n==null?void 0:n.config)==null?void 0:F.objectType,[a,i]=p.useState(""),[c,d]=p.useState([]),[u,f]=p.useState(!1),[m,g]=p.useState([]),[b,h]=p.useState(!1),[v,y]=p.useState(""),[C,S]=p.useState(!1),w=p.useRef(null);p.useEffect(()=>{let P=!1;return(async()=>{try{const N=await dS(e),M=(N==null?void 0:N.collaborators)??[];if(!M.length)return;const B=await FS(M);if(P)return;const U=M.map(ee=>B.find(Q=>Q.identifier===ee)??{identifier:ee,firstName:ee});g(U)}catch{}})(),()=>{P=!0}},[e]),p.useEffect(()=>{w.current&&clearTimeout(w.current);const P=a.trim();if(P.length<2){d([]);return}return w.current=setTimeout(async()=>{f(!0);try{const N=await xS(P,{rootOrgId:o,objectType:s}),M=new Set(m.map(B=>B.identifier));d(N.filter(B=>!M.has(B.identifier)))}catch{d([])}finally{f(!1)}},300),()=>{w.current&&clearTimeout(w.current)}},[a,m,o,s]);const T=p.useCallback(P=>{g(N=>N.find(M=>M.identifier===P.identifier)?N:[...N,P]),d(N=>N.filter(M=>M.identifier!==P.identifier)),S(!1)},[]),E=p.useCallback(P=>{g(N=>N.filter(M=>M.identifier!==P)),S(!1)},[]),L=p.useCallback(async()=>{h(!0),y(""),S(!1);try{await hS(e,m.map(P=>P.identifier)),S(!0)}catch{y(r.manageCollaborators.saveFailed)}finally{h(!1)}},[e,m,r.manageCollaborators.saveFailed]),A=P=>`${P.firstName}${P.lastName?` ${P.lastName}`:""}`;return l.jsxs("div",{className:Be.container,children:[l.jsxs("div",{className:Be.header,children:[l.jsx("h2",{className:Be.title,children:r.manageCollaborators.title}),l.jsx("button",{className:Be.closeBtn,onClick:t,"aria-label":r.manageCollaborators.closeAriaLabel,children:l.jsx(ur,{size:18})})]}),l.jsxs("div",{className:Be.body,children:[l.jsxs("div",{className:Be.searchSection,children:[l.jsx("label",{className:Be.label,htmlFor:"collab-search",children:r.manageCollaborators.searchUsersLabel}),l.jsxs("div",{className:Be.searchRow,children:[l.jsx("input",{id:"collab-search",type:"text",className:Be.searchInput,placeholder:r.manageCollaborators.searchPlaceholder,value:a,onChange:P=>i(P.target.value)}),u&&l.jsx("span",{className:Be.searchSpinner,"aria-label":r.manageCollaborators.searchingAriaLabel})]}),c.length>0&&l.jsx("ul",{className:Be.resultsList,role:"listbox","aria-label":r.manageCollaborators.searchResultsAriaLabel,children:c.map(P=>{var N,M,B,U;return l.jsxs("li",{className:Be.resultItem,role:"option","aria-selected":"false",children:[l.jsxs("div",{className:Be.userInfo,children:[l.jsx("span",{className:Be.userName,children:A(P)}),P.email&&l.jsx("span",{className:Be.userEmail,children:P.email}),(((M=(N=P.organisations)==null?void 0:N[0])==null?void 0:M.orgName)??P.rootOrgName)&&l.jsx("span",{className:Be.userOrg,children:((U=(B=P.organisations)==null?void 0:B[0])==null?void 0:U.orgName)??P.rootOrgName})]}),l.jsx($e,{variant:"primary",size:"sm",onClick:()=>T(P),children:r.manageCollaborators.add})]},P.identifier)})}),a.trim().length>=2&&!u&&c.length===0&&l.jsx("p",{className:Be.noResults,children:r.manageCollaborators.noUsersFound})]}),l.jsxs("div",{className:Be.collabSection,children:[l.jsxs("h3",{className:Be.sectionTitle,children:[r.manageCollaborators.currentCollaborators,m.length>0&&l.jsx("span",{className:Be.badge,children:m.length})]}),m.length===0?l.jsx("p",{className:Be.emptyCollab,children:r.manageCollaborators.noCollaboratorsYet}):l.jsx("ul",{className:Be.collabList,children:m.map(P=>{var N,M,B,U;return l.jsxs("li",{className:Be.collabItem,children:[l.jsx("div",{className:Be.userAvatar,"aria-hidden":"true",children:A(P).charAt(0).toUpperCase()}),l.jsxs("div",{className:Be.userInfo,children:[l.jsx("span",{className:Be.userName,children:A(P)}),P.email&&l.jsx("span",{className:Be.userEmail,children:P.email}),(((M=(N=P.organisations)==null?void 0:N[0])==null?void 0:M.orgName)??P.rootOrgName)&&l.jsx("span",{className:Be.userOrg,children:((U=(B=P.organisations)==null?void 0:B[0])==null?void 0:U.orgName)??P.rootOrgName})]}),l.jsx($e,{variant:"danger",size:"sm",onClick:()=>E(P.identifier),children:r.manageCollaborators.remove})]},P.identifier)})})]}),v&&l.jsx("p",{className:Be.error,role:"alert",children:v}),C&&l.jsx("p",{className:Be.success,role:"status",children:r.manageCollaborators.saveSuccess})]}),l.jsxs("div",{className:Be.footer,children:[l.jsx($e,{variant:"ghost",onClick:t,disabled:b,children:r.manageCollaborators.cancel}),l.jsx($e,{variant:"primary",isLoading:b,onClick:L,children:r.manageCollaborators.save})]})]})};async function BS(e){return(await Me.post("/api/dialcode/v1/read",{request:{dialcodes:[e]}})).data}async function qS(e,t){var o;const n=((o=(await Me.post(`/action/dialcode/v1/reserve/${e}`,{request:{dialcodes:{count:t,qrCodeSpec:{errorCorrectionLevel:"H"}}}})).data)==null?void 0:o.result)??{};return{processId:n.processId??"",reservedDialcodes:n.reservedDialcodes??{}}}async function jS(e){var n;const r=((n=(await Me.get(`/action/dialcode/v1/process/status/${e}`)).data)==null?void 0:n.result)??{status:"PENDING"};return{...r,status:r.status==="PENDING"?"in-process":r.status}}const we={topbar:"_topbar_c3y0z_1",left:"_left_c3y0z_15",right:"_right_c3y0z_23",backBtn:"_backBtn_c3y0z_30",title:"_title_c3y0z_49",profileBadge:"_profileBadge_c3y0z_61",statusChip:"_statusChip_c3y0z_76",savedIndicator:"_savedIndicator_c3y0z_88",unsaved:"_unsaved_c3y0z_98",iconBtn:"_iconBtn_c3y0z_103",iconBtnLabel:"_iconBtnLabel_c3y0z_130",qrDropdown:"_qrDropdown_c3y0z_134",qrMenu:"_qrMenu_c3y0z_138",reviewBtns:"_reviewBtns_c3y0z_173",sourcingBtns:"_sourcingBtns_c3y0z_182",modalOverlay:"_modalOverlay_c3y0z_191",sbOverlay:"_sbOverlay_c3y0z_201",sbModal:"_sbModal_c3y0z_211",sbModalHeader:"_sbModalHeader_c3y0z_222",sbModalTitle:"_sbModalTitle_c3y0z_230",sbModalClose:"_sbModalClose_c3y0z_237",sbModalBody:"_sbModalBody_c3y0z_250",sbLabel:"_sbLabel_c3y0z_257",sbTextarea:"_sbTextarea_c3y0z_264",sbError:"_sbError_c3y0z_281",sbModalFooter:"_sbModalFooter_c3y0z_288"};function US(e){return e?new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):""}function zS(e,t){return typeof e=="string"&&e.trim().length>0?e.trim():t}const VS=({titleText:e,labelText:t,placeholderText:r,submitLabel:n,submitVariant:o="primary",onConfirm:s,onCancel:a})=>{const i=ne(),[c,d]=p.useState(""),u=e.toLowerCase().replace(/\s+/g,"-");return l.jsx("div",{className:we.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":`${u}-title`,children:l.jsxs("div",{className:we.sbModal,children:[l.jsxs("div",{className:we.sbModalHeader,children:[l.jsx("span",{id:`${u}-title`,className:we.sbModalTitle,children:e}),l.jsx("button",{className:we.sbModalClose,onClick:a,"aria-label":i.reviewCommentModal.closeAriaLabel,type:"button",children:"×"})]}),l.jsxs("div",{className:we.sbModalBody,children:[l.jsxs("label",{className:we.sbLabel,htmlFor:`${u}-comment`,children:[t," ",l.jsx("span",{"aria-hidden":"true",style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),l.jsx("textarea",{id:`${u}-comment`,className:we.sbTextarea,placeholder:r,value:c,onChange:f=>d(f.target.value),rows:4,required:!0,"aria-required":"true"}),c.trim().length===0&&l.jsx("p",{className:we.sbError,children:i.reviewCommentModal.fillCommentsError})]}),l.jsxs("div",{className:we.sbModalFooter,children:[l.jsx($e,{variant:"ghost",onClick:a,children:i.reviewCommentModal.cancelButton}),l.jsx($e,{variant:o,onClick:()=>s(c.trim()),disabled:c.trim().length===0,children:n})]})]})})},HS=({onConfirm:e,onCancel:t})=>{const r=ne(),[n,o]=p.useState(!1),s=K(m=>m.editorProfile.key==="learningPath"),a=ae(m=>m.treeData[0]),i=ae(m=>m.treeCache),c=hr(),{scope:d}=Mo(),u=s?zi(a,c==null?void 0:c.code,d,i):[],f=u.length>0;return l.jsx("div",{className:we.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":"review-confirm-title",children:l.jsxs("div",{className:we.sbModal,children:[l.jsxs("div",{className:we.sbModalHeader,children:[l.jsx("span",{id:"review-confirm-title",className:we.sbModalTitle,children:r.confirmReviewModal.title}),l.jsx("button",{className:we.sbModalClose,onClick:t,"aria-label":r.confirmReviewModal.closeAriaLabel,type:"button",children:"×"})]}),l.jsx("div",{className:we.sbModalBody,children:f?l.jsxs(l.Fragment,{children:[l.jsx("p",{style:{margin:"0 0 8px",fontSize:13,fontWeight:600},children:r.learningPath.resolveBeforeSendingForReview}),l.jsx("ul",{style:{margin:0,paddingLeft:18,fontSize:13,lineHeight:1.6},children:u.map((m,g)=>l.jsx("li",{children:m.message},`${m.code}-${m.nodeId??g}`))})]}):l.jsxs("label",{style:{display:"flex",gap:8,alignItems:"flex-start",fontSize:13,lineHeight:1.55},children:[l.jsx("input",{type:"checkbox",checked:n,onChange:m=>o(m.target.checked),style:{marginTop:2}}),l.jsxs("span",{children:[r.confirmReviewModal.agreementTextPart1," ",l.jsx("a",{className:"sb-color-primary",style:{fontWeight:600},href:"https://creativecommons.org/licenses",target:"_blank",rel:"noreferrer",children:r.confirmReviewModal.creativeCommonsLinkText})," ",r.confirmReviewModal.agreementTextPart2," ",l.jsx("strong",{children:r.confirmReviewModal.contentPolicyText}),r.confirmReviewModal.agreementTextPart3]})]})}),l.jsxs("div",{className:we.sbModalFooter,children:[l.jsx($e,{variant:"ghost",onClick:t,children:r.confirmReviewModal.cancelButton}),!f&&l.jsx($e,{variant:"primary",onClick:e,disabled:!n,children:r.confirmReviewModal.submitButton})]})]})})},QS=({onConfirm:e,onCancel:t})=>{const r=ne(),[n,o]=p.useState(""),s=parseInt(n,10),a=!isNaN(s)&&s>=2&&s<=250;return l.jsx("div",{className:we.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":"genqr-title",children:l.jsxs("div",{className:we.sbModal,children:[l.jsxs("div",{className:we.sbModalHeader,children:[l.jsx("span",{id:"genqr-title",className:we.sbModalTitle,children:r.generateQRModal.title}),l.jsx("button",{className:we.sbModalClose,onClick:t,"aria-label":r.generateQRModal.closeAriaLabel,type:"button",children:"×"})]}),l.jsxs("div",{className:we.sbModalBody,children:[l.jsxs("label",{className:we.sbLabel,htmlFor:"qr-count",children:[r.generateQRModal.numberOfCodesLabel," ",l.jsx("span",{"aria-hidden":"true",style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),l.jsx("input",{id:"qr-count",type:"number",min:2,max:250,className:we.sbTextarea,style:{resize:"none",height:"40px"},placeholder:r.generateQRModal.countPlaceholder,value:n,onChange:i=>o(i.target.value)}),n&&!a&&l.jsx("p",{className:we.sbError,children:r.generateQRModal.countRangeError})]}),l.jsxs("div",{className:we.sbModalFooter,children:[l.jsx($e,{variant:"ghost",onClick:t,children:r.generateQRModal.cancelButton}),l.jsx($e,{variant:"primary",onClick:()=>e(s),disabled:!a,children:r.generateQRModal.generateButton})]})]})})},WS=({editorMode:e,isSaving:t,isDirty:r,lastSaved:n,isFormValid:o=!0,onToolbarEvent:s})=>{var be,ge;const a=ne(),c=ae(le=>le.treeData)[0],d=(c==null?void 0:c.name)??a.contextualEditor.untitledPlaceholder,u=zS(((be=c==null?void 0:c.metadata)==null?void 0:be.status)??(c==null?void 0:c.status),a.topbar.draftStatusFallback),f=K(le=>{var ve,Ae,Y,de;return((Ae=(ve=le.editorConfig)==null?void 0:ve.context)==null?void 0:Ae.contentId)??((de=(Y=le.editorConfig)==null?void 0:Y.context)==null?void 0:de.identifier)??""}),{activeModal:m,modalData:g,closeModal:b,openModal:h}=fr(),v=K(le=>le.buttonLoaders),y=K(le=>le.categoryMeta),C=K(le=>le.editorProfile),S=C.key==="learningPath",w=C.features.dialcodes&&(!y||y.schemaDefaults.generateDIALCodes!=="No"),[T,E]=p.useState(!1),[L,A]=p.useState(!1),[x,F]=p.useState(!1),P=p.useRef(null),[N,M]=p.useState(!1);p.useEffect(()=>{if(!x)return;const le=ve=>{var Ae;(Ae=P.current)!=null&&Ae.contains(ve.target)||F(!1)};return document.addEventListener("mousedown",le),()=>document.removeEventListener("mousedown",le)},[x]);const[B,U]=p.useState(!1),[ee,Q]=p.useState(!1),{updateNode:te}=ae(),ue=(ge=c==null?void 0:c.metadata)==null?void 0:ge.qrCodeProcessId,fe=p.useCallback(async le=>{if(f){M(!1),U(!0);try{const{processId:ve,reservedDialcodes:Ae}=await qS(f,le);ve&&c&&te(c.id,{qrCodeProcessId:ve,reservedDialcodes:Ae}),Se.success(a.topbar.qrGenerationStartedToast)}catch{Se.error(a.topbar.qrGenerationFailedToast)}finally{U(!1)}}},[f,c,te,a]),pe=p.useCallback(async()=>{if(!ue){Se.error(a.topbar.qrCodesNotGeneratedToast);return}Q(!0);try{const le=await jS(ue);if(le.status==="in-process"){Se(a.topbar.qrGenerationInProgressToast,{icon:l.jsx(In,{size:16})});return}const ve=le.url;if(!ve){Se.error(a.topbar.qrCodesNotReadyToast);return}const Ae=await fetch(ve).then(Ke=>Ke.blob()),Y=await new Promise(Ke=>{const ot=new FileReader;ot.onloadend=()=>Ke(ot.result),ot.readAsDataURL(Ae)}),de=(c==null?void 0:c.metadata)??{},W=Ke=>Array.isArray(Ke)?Ke.join("_"):typeof Ke=="string"?Ke:"",Ce=[f,W(de.medium),W(de.gradeLevel),W(de.subject)].filter(Boolean),Ve=new Date().toISOString().replace(/[:.]/g,"-"),nt=`${Ce.join("_")}_${Ve}.zip`,He=document.createElement("a");He.href=Y,He.download=nt,He.style.display="none",document.body.appendChild(He),He.click(),document.body.removeChild(He),Se.success(a.topbar.qrCodesDownloadedToast)}catch{Se.error(a.topbar.qrCodesDownloadFailedToast)}finally{Q(!1)}},[ue,c,f,a]),ie=e==="edit",Te=e==="review",ye=e==="sourcingreview",$=e==="read",q=p.useCallback((le,ve)=>{s({action:le,data:ve})},[s]),Z=p.useCallback(()=>{b(),q("publish")},[b,q]),he=p.useCallback((le,ve)=>{const Ae=g==null?void 0:g.action;b(),Ae==="approve"?q("sourcingApprove",{comment:le,score:ve}):q("reject",{comment:le})},[b,q,g]);return l.jsxs(l.Fragment,{children:[l.jsxs("header",{className:we.topbar,role:"banner",children:[l.jsxs("div",{className:we.left,children:[l.jsx("button",{className:we.backBtn,onClick:()=>q("back"),"aria-label":a.topbar.backAriaLabel,type:"button",children:l.jsx(ui,{size:18})}),l.jsx("h1",{className:we.title,title:d,children:d}),S&&l.jsxs("span",{className:we.profileBadge,children:[l.jsx(zu,{size:13,"aria-hidden":"true"}),a.learningPath.profileBadgeLabel]}),l.jsx("span",{className:`sbx-chip ${we.statusChip}`,"aria-label":`${a.topbar.statusAriaLabelPrefix} ${u}`,children:u})]}),l.jsxs("div",{className:we.right,children:[t?l.jsx("span",{className:we.savedIndicator,"aria-live":"polite",children:a.topbar.savingIndicator}):r&&ie?l.jsx("span",{className:`${we.savedIndicator} ${we.unsaved}`,"aria-live":"polite",children:a.topbar.unsavedIndicator}):n?l.jsxs("span",{className:we.savedIndicator,"aria-live":"polite",children:[l.jsx(Yr,{size:14,"aria-hidden":"true"}),a.topbar.savedIndicatorPrefix," ",US(n)]}):null,!$&&!Te&&!ye&&u!=="Review"&&l.jsx("span",{title:o?void 0:a.topbar.fillRequiredFieldsTooltip,children:l.jsx($e,{variant:"ghost",size:"sm",onClick:()=>q("saveCollection"),disabled:!o,children:a.topbar.saveAsDraftButton})}),ie&&l.jsxs(l.Fragment,{children:[l.jsxs($e,{variant:"primary",size:"sm",onClick:()=>A(!0),disabled:v.saveCollection,isLoading:v.saveCollection,children:[l.jsx(My,{size:14,"aria-hidden":"true"})," ",a.topbar.sendForReviewButton]}),C.features.collaborators&&l.jsx("button",{className:we.iconBtn,onClick:()=>h("manageCollaborators"),"aria-label":a.topbar.collaboratorsLabel,title:a.topbar.collaboratorsLabel,type:"button",children:l.jsx(Vy,{size:16,"aria-hidden":"true"})}),w&&l.jsxs("div",{className:we.qrDropdown,ref:P,children:[l.jsxs("button",{className:we.iconBtn,onClick:()=>F(le=>!le),"aria-label":a.topbar.qrCodesLabel,title:a.topbar.qrCodesLabel,type:"button","aria-haspopup":"true","aria-expanded":x,children:[l.jsx(_d,{size:16,"aria-hidden":"true"}),l.jsx("span",{className:we.iconBtnLabel,children:a.topbar.qrCodesLabel}),l.jsx(Zr,{size:14,style:{marginLeft:2},"aria-hidden":"true"})]}),x&&l.jsxs("div",{className:we.qrMenu,role:"menu",children:[l.jsxs("button",{role:"menuitem",type:"button",onClick:()=>{F(!1),M(!0)},disabled:B,children:[l.jsx(_d,{size:14}),B?a.topbar.generatingEllipsis:a.topbar.generateQrCodesMenuItem]}),l.jsxs("button",{role:"menuitem",type:"button",onClick:()=>{F(!1),pe()},disabled:ee||!ue,children:[l.jsx(wy,{size:14}),ee?a.topbar.downloadingEllipsis:a.topbar.downloadQrCodesMenuItem]})]})]})]}),Te&&l.jsxs("div",{className:we.reviewBtns,children:[l.jsxs($e,{variant:"primary",size:"sm",onClick:()=>h("publishChecklist"),disabled:v.publishCollection,isLoading:v.publishCollection,children:[l.jsx(gd,{size:14,"aria-hidden":"true"})," ",a.topbar.publishButton]}),l.jsxs($e,{variant:"primary",size:"sm",onClick:()=>E(!0),disabled:v.rejectCollection,isLoading:v.rejectCollection,children:[l.jsx(Td,{size:14,"aria-hidden":"true"})," ",a.topbar.requestForChangesButton]})]}),ye&&l.jsxs("div",{className:we.sourcingBtns,children:[l.jsxs($e,{variant:"primary",size:"sm",onClick:()=>h("qualityParams",{action:"approve"}),children:[l.jsx(By,{size:14,"aria-hidden":"true"})," ",a.topbar.approveButton]}),l.jsxs($e,{variant:"primary",size:"sm",onClick:()=>h("qualityParams",{action:"reject"}),children:[l.jsx(Td,{size:14,"aria-hidden":"true"})," ",a.topbar.requestForChangesButton]})]})]})]}),m==="publishChecklist"&&l.jsx(OS,{contentId:f,onConfirm:Z,onCancel:b}),m==="qualityParams"&&l.jsx(PS,{contentId:f,action:(g==null?void 0:g.action)??"reject",onConfirm:he,onCancel:b}),m==="manageCollaborators"&&l.jsx("div",{className:we.modalOverlay,role:"dialog","aria-modal":"true",children:l.jsx($S,{contentId:f,onClose:b})}),m==="confirmDelete"&&l.jsx(NS,{message:(g==null?void 0:g.message)??"",onConfirm:()=>{const le=g==null?void 0:g.onConfirm;b(),le==null||le()},onCancel:b}),L&&l.jsx(HS,{onConfirm:()=>{A(!1),q("sendForReview")},onCancel:()=>A(!1)}),T&&l.jsx(VS,{titleText:a.topbar.requestChangesTitle,labelText:a.topbar.changesRequestedLabel,placeholderText:a.topbar.describeChangesPlaceholder,submitLabel:a.topbar.requestForChangesButton,submitVariant:"primary",onConfirm:le=>{E(!1),q("reject",{comment:le})},onCancel:()=>E(!1)}),N&&l.jsx(QS,{onConfirm:fe,onCancel:()=>M(!1)})]})},RS=({onSave:e,onDiscard:t,onCancel:r,isSaving:n})=>{const o=ne();return Ue.createPortal(l.jsx("div",{className:Ie.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"unsaved-title",children:l.jsxs("div",{className:Ie.modal,children:[l.jsxs("div",{className:Ie.modalHeader,children:[l.jsx("span",{id:"unsaved-title",children:o.unsavedChangesModal.title}),l.jsx("button",{className:Ie.modalHeaderClose,onClick:r,"aria-label":o.unsavedChangesModal.closeAriaLabel,disabled:n,children:"×"})]}),l.jsx("div",{className:Ie.modalBody,children:l.jsx("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:o.unsavedChangesModal.bodyMessage})}),l.jsxs("div",{className:Ie.modalFooter,children:[l.jsx($e,{variant:"ghost",onClick:r,disabled:n,children:o.unsavedChangesModal.cancelButton}),l.jsx($e,{variant:"danger",onClick:t,disabled:n,children:o.unsavedChangesModal.discardButton}),l.jsx($e,{variant:"primary",onClick:e,isLoading:n,disabled:n,children:o.unsavedChangesModal.saveButton})]})]})}),document.body)};var GS=yi();const Wu=p.createContext(null);function $t(){const e=p.useContext(Wu);if(e===null)throw new Error("No Tree Api Provided");return e}const Ru=p.createContext(null);function KS(){const e=p.useContext(Ru);if(e===null)throw new Error("Provide a NodesContext");return e}const Gu=p.createContext(null);function YS(){const e=p.useContext(Gu);if(e===null)throw new Error("Provide a DnDContext");return e}const Ku=p.createContext(0);function Yu(){p.useContext(Ku)}function na(e,t,r){return Math.max(Math.min(e,r),t)}function Zu(e){return e&&e.isLeaf}function Xu(e){return e&&e.isInternal&&!e.isOpen}function Ju(e){var t;return e&&e.isOpen&&!(!((t=e.children)===null||t===void 0)&&t.length)}const ef=(e,t)=>{let r=e;for(;r;){if(r.id===t.id)return!0;r=r.parent}return!1},tf=e=>{if(!e.parent)throw Error("Node does not have a parent");return e.parent.children.findIndex(t=>t.id===e.id)};function Qi(e,t){if(!e)return null;if(e.id===t)return e;if(e.children)for(let r of e.children){const n=Qi(r,t);if(n)return n}return null}function oa(e,t){if(t(e),e.children)for(let r of e.children)oa(r,t)}function rf(e){const t=of(e);let r;for(let n=0;n<t.length;++n)if(t[n]===e){r=ZS(t,n);break}r==null||r.focus()}function nf(e){const t=of(e);let r;for(let n=0;n<t.length;++n)if(t[n]===e){r=XS(t,n);break}r==null||r.focus()}function ZS(e,t){return t+1<e.length?e[t+1]:e[0]}function XS(e,t){return t-1>=0?e[t-1]:e[e.length-1]}function of(e){return Array.from(document.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), details:not([disabled]), summary:not(:disabled)')).filter(t=>t===e||!e.contains(t))}function $o(e,t){return typeof t=="boolean"?t:typeof t=="string"?e[t]:t(e)}function Fn(e){return typeof e=="string"?e:e.id}function JS(e,...t){if(e)return e(...t)}function sf(e){return new Promise((t,r)=>{let n=0;function o(){n+=1,n===100&&r(),e()?t():setTimeout(o,10)}o()})}function af(e){var t,r;const n=e.focusedNode;return n?n.isOpen?0:n.parent?n.childIndex+1:0:(r=(t=e.root.children)===null||t===void 0?void 0:t.length)!==null&&r!==void 0?r:0}function lf(e){const t=e.focusedNode;return t?t.isOpen?t.id:t.parent&&!t.parent.isRoot?t.parent.id:null:null}const ew=Object.freeze(Object.defineProperty({__proto__:null,access:$o,bound:na,dfs:Qi,focusNextElement:rf,focusPrevElement:nf,getInsertIndex:af,getInsertParentId:lf,identify:Fn,indexOf:tf,isClosed:Xu,isDescendant:ef,isItem:Zu,isOpenWithEmptyChildren:Ju,safeRun:JS,waitFor:sf,walk:oa},Symbol.toStringTag,{value:"Module"})),tw={display:"flex",alignItems:"center",zIndex:1},rw={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},nw={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},ow=p.memo(function({top:t,left:r,indent:n}){const o={position:"absolute",pointerEvents:"none",top:t-2+"px",left:r+"px",right:n+"px"};return l.jsxs("div",{style:Object.assign(Object.assign({},tw),o),children:[l.jsx("div",{style:Object.assign({},nw)}),l.jsx("div",{style:Object.assign({},rw)})]})});function sw({node:e,attrs:t,innerRef:r,children:n}){return l.jsx("div",Object.assign({},t,{ref:r,onFocus:o=>o.stopPropagation(),onClick:e.handleClick,children:n}))}function aw(e){return l.jsxs("div",{ref:e.dragHandle,style:e.style,children:[l.jsx("span",{onClick:t=>{t.stopPropagation(),e.node.toggle()},children:e.node.isLeaf?"🌳":e.node.isOpen?"🗁":"🗀"})," ",e.node.isEditing?l.jsx(lw,Object.assign({},e)):l.jsx(iw,Object.assign({},e))]})}function iw(e){return l.jsx(l.Fragment,{children:l.jsx("span",{children:e.node.data.name})})}function lw({node:e}){const t=p.useRef();return p.useEffect(()=>{var r,n;(r=t.current)===null||r===void 0||r.focus(),(n=t.current)===null||n===void 0||n.select()},[]),l.jsx("input",{ref:t,defaultValue:e.data.name,onBlur:()=>e.reset(),onKeyDown:r=>{var n;r.key==="Escape"&&e.reset(),r.key==="Enter"&&e.submit(((n=t.current)===null||n===void 0?void 0:n.value)||"")}})}const Bo="__REACT_ARBORIST_INTERNAL_ROOT__";function cf(e){var t;function r(s,a,i){const c=e.accessId(s),d=new qo({tree:e,data:s,level:a,parent:i,id:c,children:null,isDraggable:e.isDraggable(s),rowIndex:null}),u=e.accessChildren(s);return u&&(d.children=u.map(f=>r(f,a+1,d))),d}const n=new qo({tree:e,id:Bo,data:{id:Bo},level:-1,parent:null,children:null,isDraggable:!0,rowIndex:null}),o=(t=e.props.data)!==null&&t!==void 0?t:[];return n.children=o.map(s=>r(s,0,n)),n}class qo{constructor(t){this.handleClick=r=>{(r.metaKey||r.ctrlKey)&&!this.tree.props.disableMultiSelection?this.isSelected?this.deselect():this.selectMulti():r.shiftKey&&!this.tree.props.disableMultiSelection?this.selectContiguous():(this.select(),this.activate())},this.tree=t.tree,this.id=t.id,this.data=t.data,this.level=t.level,this.children=t.children,this.parent=t.parent,this.isDraggable=t.isDraggable,this.rowIndex=t.rowIndex}get isRoot(){return this.id===Bo}get isLeaf(){return!Array.isArray(this.children)}get isInternal(){return!this.isLeaf}get isOpen(){return this.isLeaf?!1:this.tree.isOpen(this.id)}get isClosed(){return this.isLeaf?!1:!this.tree.isOpen(this.id)}get isEditable(){return this.tree.isEditable(this.data)}get isSelectable(){return this.tree.isSelectable(this.data)}get isEditing(){return this.tree.editingId===this.id}get isSelected(){return this.tree.isSelected(this.id)}get isOnlySelection(){return this.isSelected&&this.tree.hasOneSelection}get isSelectedStart(){var t;return this.isSelected&&!(!((t=this.prev)===null||t===void 0)&&t.isSelected)}get isSelectedEnd(){var t;return this.isSelected&&!(!((t=this.next)===null||t===void 0)&&t.isSelected)}get isFocused(){return this.tree.isFocused(this.id)}get isDragging(){return this.tree.isDragging(this.id)}get willReceiveDrop(){return this.tree.willReceiveDrop(this.id)}get state(){return{isClosed:this.isClosed,isDragging:this.isDragging,isEditing:this.isEditing,isFocused:this.isFocused,isInternal:this.isInternal,isLeaf:this.isLeaf,isOpen:this.isOpen,isSelected:this.isSelected,isSelectedEnd:this.isSelectedEnd,isSelectedStart:this.isSelectedStart,willReceiveDrop:this.willReceiveDrop}}get childIndex(){return this.parent&&this.parent.children?this.parent.children.findIndex(t=>t.id===this.id):-1}get next(){return this.rowIndex===null?null:this.tree.at(this.rowIndex+1)}get prev(){return this.rowIndex===null?null:this.tree.at(this.rowIndex-1)}get nextSibling(){var t,r;const n=this.childIndex;return(r=(t=this.parent)===null||t===void 0?void 0:t.children[n+1])!==null&&r!==void 0?r:null}isAncestorOf(t){if(!t)return!1;let r=t;for(;r;){if(r.id===this.id)return!0;r=r.parent}return!1}select(){this.tree.select(this)}deselect(){this.tree.deselect(this)}selectMulti(){this.tree.selectMulti(this)}selectContiguous(){this.tree.selectContiguous(this)}activate(){this.tree.activate(this)}focus(){this.tree.focus(this)}toggle(){this.tree.toggle(this)}open(){this.tree.open(this)}openParents(){this.tree.openParents(this)}close(){this.tree.close(this)}submit(t){this.tree.submit(this,t)}reset(){this.tree.reset()}clone(){return new qo(Object.assign({},this))}edit(){return this.tree.edit(this)}}function Wi(e){return{type:"EDIT",id:e}}function cw(e={id:null},t){return t.type==="EDIT"?Object.assign(Object.assign({},e),{id:t.id}):e}function Mn(e){return{type:"FOCUS",id:e}}function dw(){return{type:"TREE_BLUR"}}function uw(e={id:null,treeFocused:!1},t){return t.type==="FOCUS"?Object.assign(Object.assign({},e),{id:t.id,treeFocused:!0}):t.type==="TREE_BLUR"?Object.assign(Object.assign({},e),{treeFocused:!1}):e}const Ri={open(e,t){return{type:"VISIBILITY_OPEN",id:e,filtered:t}},close(e,t){return{type:"VISIBILITY_CLOSE",id:e,filtered:t}},toggle(e,t){return{type:"VISIBILITY_TOGGLE",id:e,filtered:t}},clear(e){return{type:"VISIBILITY_CLEAR",filtered:e}}};function df(e={},t){if(t.type==="VISIBILITY_OPEN")return Object.assign(Object.assign({},e),{[t.id]:!0});if(t.type==="VISIBILITY_CLOSE")return Object.assign(Object.assign({},e),{[t.id]:!1});if(t.type==="VISIBILITY_TOGGLE"){const r=e[t.id];return Object.assign(Object.assign({},e),{[t.id]:!r})}else return t.type==="VISIBILITY_CLEAR"?{}:e}function fw(e={filtered:{},unfiltered:{}},t){return t.type.startsWith("VISIBILITY")?t.filtered?Object.assign(Object.assign({},e),{filtered:df(e.filtered,t)}):Object.assign(Object.assign({},e),{unfiltered:df(e.unfiltered,t)}):e}const $n=e=>{var t;return{nodes:{open:{filtered:{},unfiltered:(t=e==null?void 0:e.initialOpenState)!==null&&t!==void 0?t:{}},focus:{id:null,treeFocused:!1},edit:{id:null},drag:{id:null,selectedIds:[],destinationParentId:null,destinationIndex:null},selection:{ids:new Set,anchor:null,mostRecent:null}},dnd:{cursor:{type:"none"},dragId:null,dragIds:[],parentId:null,index:-1}}},Fr={clear:()=>({type:"SELECTION_CLEAR"}),only:e=>({type:"SELECTION_ONLY",id:Fn(e)}),add:e=>({type:"SELECTION_ADD",ids:(Array.isArray(e)?e:[e]).map(Fn)}),remove:e=>({type:"SELECTION_REMOVE",ids:(Array.isArray(e)?e:[e]).map(Fn)}),set:e=>Object.assign({type:"SELECTION_SET"},e),mostRecent:e=>({type:"SELECTION_MOST_RECENT",id:e===null?null:Fn(e)}),anchor:e=>({type:"SELECTION_ANCHOR",id:e===null?null:Fn(e)})};function hw(e=$n().nodes.selection,t){const r=e.ids;switch(t.type){case"SELECTION_CLEAR":return Object.assign(Object.assign({},e),{ids:new Set});case"SELECTION_ONLY":return Object.assign(Object.assign({},e),{ids:new Set([t.id])});case"SELECTION_ADD":return t.ids.length===0?e:(t.ids.forEach(n=>r.add(n)),Object.assign(Object.assign({},e),{ids:new Set(r)}));case"SELECTION_REMOVE":return t.ids.length===0?e:(t.ids.forEach(n=>r.delete(n)),Object.assign(Object.assign({},e),{ids:new Set(r)}));case"SELECTION_SET":return Object.assign(Object.assign({},e),{ids:t.ids,mostRecent:t.mostRecent,anchor:t.anchor});case"SELECTION_MOST_RECENT":return Object.assign(Object.assign({},e),{mostRecent:t.id});case"SELECTION_ANCHOR":return Object.assign(Object.assign({},e),{anchor:t.id});default:return e}}const Bn={cursor(e){return{type:"DND_CURSOR",cursor:e}},dragStart(e,t){return{type:"DND_DRAG_START",id:e,dragIds:t}},dragEnd(){return{type:"DND_DRAG_END"}},hovering(e,t){return{type:"DND_HOVERING",parentId:e,index:t}}};function pw(e=$n().dnd,t){switch(t.type){case"DND_CURSOR":return Object.assign(Object.assign({},e),{cursor:t.cursor});case"DND_DRAG_START":return Object.assign(Object.assign({},e),{dragId:t.id,dragIds:t.dragIds});case"DND_DRAG_END":return $n().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},e),{parentId:t.parentId,index:t.index});default:return e}}const gw={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},mw=e=>{if(!e)return{display:"none"};const{x:t,y:r}=e;return{transform:`translate(${t}px, ${r}px)`}},vw=e=>{if(!e)return{display:"none"};const{x:t,y:r}=e;return{transform:`translate(${t+10}px, ${r+10}px)`}};function uf({offset:e,mouse:t,id:r,dragIds:n,isDragging:o}){return l.jsxs(yw,{isDragging:o,children:[l.jsx(bw,{offset:e,children:l.jsx(Sw,{id:r,dragIds:n})}),l.jsx(Cw,{mouse:t,count:n.length})]})}const yw=p.memo(function(t){return t.isDragging?l.jsx("div",{style:gw,children:t.children}):null});function bw(e){return l.jsx("div",{className:"row preview",style:mw(e.offset),children:e.children})}function Cw(e){const{count:t,mouse:r}=e;return t>1?l.jsx("div",{className:"selected-count",style:vw(r),children:t}):null}const Sw=p.memo(function(t){const r=$t(),n=r.get(t.id);return n?l.jsx(r.renderNode,{preview:!0,node:n,style:{paddingLeft:n.level*r.indent,opacity:.2,background:"transparent"},tree:r}):null});function Gi(){return Gi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Gi.apply(null,arguments)}function ff(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ki(e,t){return Ki=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Ki(e,t)}function ww(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ki(e,t)}var hf=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function _w(e,t){return!!(e===t||hf(e)&&hf(t))}function Tw(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!_w(e[r],t[r]))return!1;return!0}function Yi(e,t){t===void 0&&(t=Tw);var r,n=[],o,s=!1;function a(){for(var i=[],c=0;c<arguments.length;c++)i[c]=arguments[c];return s&&r===this&&t(i,n)||(o=e.apply(this,i),s=!0,r=this,n=i),o}return a}var Ew=typeof performance=="object"&&typeof performance.now=="function",pf=Ew?function(){return performance.now()}:function(){return Date.now()};function gf(e){cancelAnimationFrame(e.id)}function Aw(e,t){var r=pf();function n(){pf()-r>=t?e.call(null):o.id=requestAnimationFrame(n)}var o={id:requestAnimationFrame(n)};return o}var Zi=-1;function mf(e){if(e===void 0&&(e=!1),Zi===-1||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),Zi=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Zi}var qn=null;function vf(e){if(e===void 0&&(e=!1),qn===null||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var n=document.createElement("div"),o=n.style;return o.width="100px",o.height="100px",t.appendChild(n),document.body.appendChild(t),t.scrollLeft>0?qn="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?qn="negative":qn="positive-ascending"),document.body.removeChild(t),qn}return qn}process.env.NODE_ENV;var kw=150,Iw=function(t,r){return t},sa=null,aa=null;process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof window.WeakSet<"u"&&(sa=new WeakSet,aa=new WeakSet);function yf(e){var t,r=e.getItemOffset,n=e.getEstimatedTotalSize,o=e.getItemSize,s=e.getOffsetForIndexAndAlignment,a=e.getStartIndexForOffset,i=e.getStopIndexForStartIndex,c=e.initInstanceProps,d=e.shouldResetStyleCacheOnItemSizeChange,u=e.validateProps;return t=(function(f){ww(m,f);function m(b){var h;return h=f.call(this,b)||this,h._instanceProps=c(h.props,ff(h)),h._outerRef=void 0,h._resetIsScrollingTimeoutId=null,h.state={instance:ff(h),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof h.props.initialScrollOffset=="number"?h.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},h._callOnItemsRendered=void 0,h._callOnItemsRendered=Yi(function(v,y,C,S){return h.props.onItemsRendered({overscanStartIndex:v,overscanStopIndex:y,visibleStartIndex:C,visibleStopIndex:S})}),h._callOnScroll=void 0,h._callOnScroll=Yi(function(v,y,C){return h.props.onScroll({scrollDirection:v,scrollOffset:y,scrollUpdateWasRequested:C})}),h._getItemStyle=void 0,h._getItemStyle=function(v){var y=h.props,C=y.direction,S=y.itemSize,w=y.layout,T=h._getItemStyleCache(d&&S,d&&w,d&&C),E;if(T.hasOwnProperty(v))E=T[v];else{var L=r(h.props,v,h._instanceProps),A=o(h.props,v,h._instanceProps),x=C==="horizontal"||w==="horizontal",F=C==="rtl",P=x?L:0;T[v]=E={position:"absolute",left:F?void 0:P,right:F?P:void 0,top:x?0:L,height:x?"100%":A,width:x?A:"100%"}}return E},h._getItemStyleCache=void 0,h._getItemStyleCache=Yi(function(v,y,C){return{}}),h._onScrollHorizontal=function(v){var y=v.currentTarget,C=y.clientWidth,S=y.scrollLeft,w=y.scrollWidth;h.setState(function(T){if(T.scrollOffset===S)return null;var E=h.props.direction,L=S;if(E==="rtl")switch(vf()){case"negative":L=-S;break;case"positive-descending":L=w-C-S;break}return L=Math.max(0,Math.min(L,w-C)),{isScrolling:!0,scrollDirection:T.scrollOffset<L?"forward":"backward",scrollOffset:L,scrollUpdateWasRequested:!1}},h._resetIsScrollingDebounced)},h._onScrollVertical=function(v){var y=v.currentTarget,C=y.clientHeight,S=y.scrollHeight,w=y.scrollTop;h.setState(function(T){if(T.scrollOffset===w)return null;var E=Math.max(0,Math.min(w,S-C));return{isScrolling:!0,scrollDirection:T.scrollOffset<E?"forward":"backward",scrollOffset:E,scrollUpdateWasRequested:!1}},h._resetIsScrollingDebounced)},h._outerRefSetter=function(v){var y=h.props.outerRef;h._outerRef=v,typeof y=="function"?y(v):y!=null&&typeof y=="object"&&y.hasOwnProperty("current")&&(y.current=v)},h._resetIsScrollingDebounced=function(){h._resetIsScrollingTimeoutId!==null&&gf(h._resetIsScrollingTimeoutId),h._resetIsScrollingTimeoutId=Aw(h._resetIsScrolling,kw)},h._resetIsScrolling=function(){h._resetIsScrollingTimeoutId=null,h.setState({isScrolling:!1},function(){h._getItemStyleCache(-1,null)})},h}m.getDerivedStateFromProps=function(h,v){return Dw(h,v),u(h),null};var g=m.prototype;return g.scrollTo=function(h){h=Math.max(0,h),this.setState(function(v){return v.scrollOffset===h?null:{scrollDirection:v.scrollOffset<h?"forward":"backward",scrollOffset:h,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},g.scrollToItem=function(h,v){v===void 0&&(v="auto");var y=this.props,C=y.itemCount,S=y.layout,w=this.state.scrollOffset;h=Math.max(0,Math.min(h,C-1));var T=0;if(this._outerRef){var E=this._outerRef;S==="vertical"?T=E.scrollWidth>E.clientWidth?mf():0:T=E.scrollHeight>E.clientHeight?mf():0}this.scrollTo(s(this.props,h,v,w,this._instanceProps,T))},g.componentDidMount=function(){var h=this.props,v=h.direction,y=h.initialScrollOffset,C=h.layout;if(typeof y=="number"&&this._outerRef!=null){var S=this._outerRef;v==="horizontal"||C==="horizontal"?S.scrollLeft=y:S.scrollTop=y}this._callPropsCallbacks()},g.componentDidUpdate=function(){var h=this.props,v=h.direction,y=h.layout,C=this.state,S=C.scrollOffset,w=C.scrollUpdateWasRequested;if(w&&this._outerRef!=null){var T=this._outerRef;if(v==="horizontal"||y==="horizontal")if(v==="rtl")switch(vf()){case"negative":T.scrollLeft=-S;break;case"positive-ascending":T.scrollLeft=S;break;default:var E=T.clientWidth,L=T.scrollWidth;T.scrollLeft=L-E-S;break}else T.scrollLeft=S;else T.scrollTop=S}this._callPropsCallbacks()},g.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&gf(this._resetIsScrollingTimeoutId)},g.render=function(){var h=this.props,v=h.children,y=h.className,C=h.direction,S=h.height,w=h.innerRef,T=h.innerElementType,E=h.innerTagName,L=h.itemCount,A=h.itemData,x=h.itemKey,F=x===void 0?Iw:x,P=h.layout,N=h.outerElementType,M=h.outerTagName,B=h.style,U=h.useIsScrolling,ee=h.width,Q=this.state.isScrolling,te=C==="horizontal"||P==="horizontal",ue=te?this._onScrollHorizontal:this._onScrollVertical,fe=this._getRangeToRender(),pe=fe[0],ie=fe[1],Te=[];if(L>0)for(var ye=pe;ye<=ie;ye++)Te.push(p.createElement(v,{data:A,key:F(ye,A),index:ye,isScrolling:U?Q:void 0,style:this._getItemStyle(ye)}));var $=n(this.props,this._instanceProps);return p.createElement(N||M||"div",{className:y,onScroll:ue,ref:this._outerRefSetter,style:Gi({position:"relative",height:S,width:ee,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:C},B)},p.createElement(T||E||"div",{children:Te,ref:w,style:{height:te?"100%":$,pointerEvents:Q?"none":void 0,width:te?$:"100%"}}))},g._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var h=this.props.itemCount;if(h>0){var v=this._getRangeToRender(),y=v[0],C=v[1],S=v[2],w=v[3];this._callOnItemsRendered(y,C,S,w)}}if(typeof this.props.onScroll=="function"){var T=this.state,E=T.scrollDirection,L=T.scrollOffset,A=T.scrollUpdateWasRequested;this._callOnScroll(E,L,A)}},g._getRangeToRender=function(){var h=this.props,v=h.itemCount,y=h.overscanCount,C=this.state,S=C.isScrolling,w=C.scrollDirection,T=C.scrollOffset;if(v===0)return[0,0,0,0];var E=a(this.props,T,this._instanceProps),L=i(this.props,E,T,this._instanceProps),A=!S||w==="backward"?Math.max(1,y):1,x=!S||w==="forward"?Math.max(1,y):1;return[Math.max(0,E-A),Math.max(0,Math.min(v-1,L+x)),E,L]},m})(p.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var Dw=function(t,r){var n=t.children,o=t.direction,s=t.height,a=t.layout,i=t.innerTagName,c=t.outerTagName,d=t.width,u=r.instance;if(process.env.NODE_ENV!=="production"){(i!=null||c!=null)&&aa&&!aa.has(u)&&(aa.add(u),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var f=o==="horizontal"||a==="horizontal";switch(o){case"horizontal":case"vertical":sa&&!sa.has(u)&&(sa.add(u),console.warn('The direction prop should be either "ltr" (default) or "rtl". Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.'));break;case"ltr":case"rtl":break;default:throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". '+('"'+o+'" was specified.'))}switch(a){case"horizontal":case"vertical":break;default:throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". '+('"'+a+'" was specified.'))}if(n==null)throw Error('An invalid "children" prop has been specified. Value should be a React component. '+('"'+(n===null?"null":typeof n)+'" was specified.'));if(f&&typeof d!="number")throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. '+('"'+(d===null?"null":typeof d)+'" was specified.'));if(!f&&typeof s!="number")throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. '+('"'+(s===null?"null":typeof s)+'" was specified.'))}},Lw=50,jn=function(t,r,n){var o=t,s=o.itemSize,a=n.itemMetadataMap,i=n.lastMeasuredIndex;if(r>i){var c=0;if(i>=0){var d=a[i];c=d.offset+d.size}for(var u=i+1;u<=r;u++){var f=s(u);a[u]={offset:c,size:f},c+=f}n.lastMeasuredIndex=r}return a[r]},Ow=function(t,r,n){var o=r.itemMetadataMap,s=r.lastMeasuredIndex,a=s>0?o[s].offset:0;return a>=n?bf(t,r,s,0,n):Pw(t,r,Math.max(0,s),n)},bf=function(t,r,n,o,s){for(;o<=n;){var a=o+Math.floor((n-o)/2),i=jn(t,a,r).offset;if(i===s)return a;i<s?o=a+1:i>s&&(n=a-1)}return o>0?o-1:0},Pw=function(t,r,n,o){for(var s=t.itemCount,a=1;n<s&&jn(t,n,r).offset<o;)n+=a,a*=2;return bf(t,r,Math.min(n,s-1),Math.floor(n/2),o)},Cf=function(t,r){var n=t.itemCount,o=r.itemMetadataMap,s=r.estimatedItemSize,a=r.lastMeasuredIndex,i=0;if(a>=n&&(a=n-1),a>=0){var c=o[a];i=c.offset+c.size}var d=n-a-1,u=d*s;return i+u},Nw=yf({getItemOffset:function(t,r,n){return jn(t,r,n).offset},getItemSize:function(t,r,n){return n.itemMetadataMap[r].size},getEstimatedTotalSize:Cf,getOffsetForIndexAndAlignment:function(t,r,n,o,s,a){var i=t.direction,c=t.height,d=t.layout,u=t.width,f=i==="horizontal"||d==="horizontal",m=f?u:c,g=jn(t,r,s),b=Cf(t,s),h=Math.max(0,Math.min(b-m,g.offset)),v=Math.max(0,g.offset-m+g.size+a);switch(n==="smart"&&(o>=v-m&&o<=h+m?n="auto":n="center"),n){case"start":return h;case"end":return v;case"center":return Math.round(v+(h-v)/2);case"auto":default:return o>=v&&o<=h?o:o<v?v:h}},getStartIndexForOffset:function(t,r,n){return Ow(t,n,r)},getStopIndexForStartIndex:function(t,r,n,o){for(var s=t.direction,a=t.height,i=t.itemCount,c=t.layout,d=t.width,u=s==="horizontal"||c==="horizontal",f=u?d:a,m=jn(t,r,o),g=n+f,b=m.offset+m.size,h=r;h<i-1&&b<g;)h++,b+=jn(t,h,o).size;return h},initInstanceProps:function(t,r){var n=t,o=n.estimatedItemSize,s={itemMetadataMap:{},estimatedItemSize:o||Lw,lastMeasuredIndex:-1};return r.resetAfterIndex=function(a,i){i===void 0&&(i=!0),s.lastMeasuredIndex=Math.min(s.lastMeasuredIndex,a-1),r._getItemStyleCache(-1),i&&r.forceUpdate()},s},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(t){var r=t.itemSize;if(process.env.NODE_ENV!=="production"&&typeof r!="function")throw Error('An invalid "itemSize" prop has been specified. Value should be a function. '+('"'+(r===null?"null":typeof r)+'" was specified.'))}}),xw=yf({getItemOffset:function(t,r){var n=t.itemSize;return r*n},getItemSize:function(t,r){var n=t.itemSize;return n},getEstimatedTotalSize:function(t){var r=t.itemCount,n=t.itemSize;return n*r},getOffsetForIndexAndAlignment:function(t,r,n,o,s,a){var i=t.direction,c=t.height,d=t.itemCount,u=t.itemSize,f=t.layout,m=t.width,g=i==="horizontal"||f==="horizontal",b=g?m:c,h=Math.max(0,d*u-b),v=Math.min(h,r*u),y=Math.max(0,r*u-b+u+a);switch(n==="smart"&&(o>=y-b&&o<=v+b?n="auto":n="center"),n){case"start":return v;case"end":return y;case"center":{var C=Math.round(y+(v-y)/2);return C<Math.ceil(b/2)?0:C>h+Math.floor(b/2)?h:C}case"auto":default:return o>=y&&o<=v?o:o<y?y:v}},getStartIndexForOffset:function(t,r){var n=t.itemCount,o=t.itemSize;return Math.max(0,Math.min(n-1,Math.floor(r/o)))},getStopIndexForStartIndex:function(t,r,n){var o=t.direction,s=t.height,a=t.itemCount,i=t.itemSize,c=t.layout,d=t.width,u=o==="horizontal"||c==="horizontal",f=r*i,m=u?d:s,g=Math.ceil((m+n-f)/i);return Math.max(0,Math.min(a-1,r+g-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){var r=t.itemSize;if(process.env.NODE_ENV!=="production"&&typeof r!="number")throw Error('An invalid "itemSize" prop has been specified. Value should be a number. '+('"'+(r===null?"null":typeof r)+'" was specified.'))}});function Fw(){var e,t;const r=$t(),o=YS().cursor;if(!o||o.type!=="line")return null;const s=r.indent,a=r.rowTopPosition(o.index)+((t=(e=r.props.padding)!==null&&e!==void 0?e:r.props.paddingTop)!==null&&t!==void 0?t:0),i=s*o.level,c=r.renderCursor;return l.jsx(c,{top:a,left:i,indent:s})}var Mw=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};const $w=p.forwardRef(function(t,r){const{children:n}=t,o=Mw(t,["children"]),s=$t();return l.jsxs("div",Object.assign({ref:r},o,{onClick:a=>{a.currentTarget===a.target&&s.deselectAll()},children:[l.jsx(Bw,{}),n]}))}),Bw=()=>{const e=$t();return l.jsx("div",{style:{height:e.rowTopPosition(e.visibleNodes.length),width:"100%",position:"absolute",left:"0",right:"0"},children:l.jsx(Fw,{})})};var qw=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};const jw=p.forwardRef(function(t,r){var n,o,s,a,{style:i}=t,c=qw(t,["style"]);const d=$t(),u=(o=(n=d.props.padding)!==null&&n!==void 0?n:d.props.paddingTop)!==null&&o!==void 0?o:0,f=(a=(s=d.props.padding)!==null&&s!==void 0?s:d.props.paddingBottom)!==null&&a!==void 0?a:0;return l.jsx("div",Object.assign({ref:r,style:Object.assign(Object.assign({},i),{height:`${parseFloat(i.height)+u+f}px`})},c))});var Sf=p.createContext({dragDropManager:void 0}),Rt;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Rt||(Rt={}));function _e(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];if(process.env.NODE_ENV!=="production"&&t===void 0)throw new Error("invariant requires an error message argument");if(!e){var s;if(t===void 0)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=0;s=new Error(t.replace(/%s/g,function(){return n[a++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}var Xi="dnd-core/INIT_COORDS",ia="dnd-core/BEGIN_DRAG",Ji="dnd-core/PUBLISH_DRAG_SOURCE",la="dnd-core/HOVER",ca="dnd-core/DROP",da="dnd-core/END_DRAG";function wf(e,t){return{type:Xi,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}function ua(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ua=function(r){return typeof r}:ua=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ua(e)}function Uw(e,t,r){return t.split(".").reduce(function(n,o){return n&&n[o]?n[o]:r||null},e)}function zw(e,t){return e.filter(function(r){return r!==t})}function _f(e){return ua(e)==="object"}function Vw(e,t){var r=new Map,n=function(a){r.set(a,r.has(a)?r.get(a)+1:1)};e.forEach(n),t.forEach(n);var o=[];return r.forEach(function(s,a){s===1&&o.push(a)}),o}function Hw(e,t){return e.filter(function(r){return t.indexOf(r)>-1})}var Qw={type:Xi,payload:{clientOffset:null,sourceClientOffset:null}};function Ww(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{publishSource:!0},o=n.publishSource,s=o===void 0?!0:o,a=n.clientOffset,i=n.getSourceClientOffset,c=e.getMonitor(),d=e.getRegistry();e.dispatch(wf(a)),Rw(r,c,d);var u=Yw(r,c);if(u===null){e.dispatch(Qw);return}var f=null;if(a){if(!i)throw new Error("getSourceClientOffset must be defined");Gw(i),f=i(u)}e.dispatch(wf(a,f));var m=d.getSource(u),g=m.beginDrag(c,u);if(g!=null){Kw(g),d.pinSource(u);var b=d.getSourceType(u);return{type:ia,payload:{itemType:b,item:g,sourceId:u,clientOffset:a||null,sourceClientOffset:f||null,isSourcePublic:!!s}}}}}function Rw(e,t,r){_e(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(n){_e(r.getSource(n),"Expected sourceIds to be registered.")})}function Gw(e){_e(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function Kw(e){_e(_f(e),"Item must be an object.")}function Yw(e,t){for(var r=null,n=e.length-1;n>=0;n--)if(t.canDragSource(e[n])){r=e[n];break}return r}function Zw(e){return function(){var r=e.getMonitor();if(r.isDragging())return{type:Ji}}}function el(e,t){return t===null?e===null:Array.isArray(e)?e.some(function(r){return r===t}):e===t}function Xw(e){return function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=n.clientOffset;Jw(r);var s=r.slice(0),a=e.getMonitor(),i=e.getRegistry();e_(s,a,i);var c=a.getItemType();return t_(s,i,c),r_(s,a,i),{type:la,payload:{targetIds:s,clientOffset:o||null}}}}function Jw(e){_e(Array.isArray(e),"Expected targetIds to be an array.")}function e_(e,t,r){_e(t.isDragging(),"Cannot call hover while not dragging."),_e(!t.didDrop(),"Cannot call hover after drop.");for(var n=0;n<e.length;n++){var o=e[n];_e(e.lastIndexOf(o)===n,"Expected targetIds to be unique in the passed array.");var s=r.getTarget(o);_e(s,"Expected targetIds to be registered.")}}function t_(e,t,r){for(var n=e.length-1;n>=0;n--){var o=e[n],s=t.getTargetType(o);el(s,r)||e.splice(n,1)}}function r_(e,t,r){e.forEach(function(n){var o=r.getTarget(n);o.hover(t,n)})}function Tf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ef(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Tf(Object(r),!0).forEach(function(n){n_(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function n_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o_(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.getMonitor(),o=e.getRegistry();s_(n);var s=l_(n);s.forEach(function(a,i){var c=a_(a,i,o,n),d={type:ca,payload:{dropResult:Ef(Ef({},r),c)}};e.dispatch(d)})}}function s_(e){_e(e.isDragging(),"Cannot call drop while not dragging."),_e(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function a_(e,t,r,n){var o=r.getTarget(e),s=o?o.drop(n,e):void 0;return i_(s),typeof s>"u"&&(s=t===0?{}:n.getDropResult()),s}function i_(e){_e(typeof e>"u"||_f(e),"Drop result must either be an object or undefined.")}function l_(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function c_(e){return function(){var r=e.getMonitor(),n=e.getRegistry();d_(r);var o=r.getSourceId();if(o!=null){var s=n.getSource(o,!0);s.endDrag(r,o),n.unpinSource()}return{type:da}}}function d_(e){_e(e.isDragging(),"Cannot call endDrag while not dragging.")}function u_(e){return{beginDrag:Ww(e),publishDragSource:Zw(e),hover:Xw(e),drop:o_(e),endDrag:c_(e)}}function f_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h_(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function p_(e,t,r){return t&&h_(e.prototype,t),e}function jo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var g_=(function(){function e(t,r){var n=this;f_(this,e),jo(this,"store",void 0),jo(this,"monitor",void 0),jo(this,"backend",void 0),jo(this,"isSetUp",!1),jo(this,"handleRefCountChange",function(){var o=n.store.getState().refCount>0;n.backend&&(o&&!n.isSetUp?(n.backend.setup(),n.isSetUp=!0):!o&&n.isSetUp&&(n.backend.teardown(),n.isSetUp=!1))}),this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}return p_(e,[{key:"receiveBackend",value:function(r){this.backend=r}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var r=this,n=this.store.dispatch;function o(a){return function(){for(var i=arguments.length,c=new Array(i),d=0;d<i;d++)c[d]=arguments[d];var u=a.apply(r,c);typeof u<"u"&&n(u)}}var s=u_(this);return Object.keys(s).reduce(function(a,i){var c=s[i];return a[i]=o(c),a},{})}},{key:"dispatch",value:function(r){this.store.dispatch(r)}}]),e})();function Gt(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var Af=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),kf=function(){return Math.random().toString(36).substring(7).split("").join(".")},If={INIT:"@@redux/INIT"+kf(),REPLACE:"@@redux/REPLACE"+kf()};function m_(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function v_(e){if(e===void 0)return"undefined";if(e===null)return"null";var t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(C_(e))return"date";if(b_(e))return"error";var r=y_(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}function y_(e){return typeof e.constructor=="function"?e.constructor.name:null}function b_(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function C_(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Un(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=v_(e)),t}function Df(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?Gt(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?Gt(1):"Expected the enhancer to be a function. Instead, received: '"+Un(r)+"'");return r(Df)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?Gt(2):"Expected the root reducer to be a function. Instead, received: '"+Un(e)+"'");var o=e,s=t,a=[],i=a,c=!1;function d(){i===a&&(i=a.slice())}function u(){if(c)throw new Error(process.env.NODE_ENV==="production"?Gt(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return s}function f(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?Gt(4):"Expected the listener to be a function. Instead, received: '"+Un(h)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?Gt(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var v=!0;return d(),i.push(h),function(){if(v){if(c)throw new Error(process.env.NODE_ENV==="production"?Gt(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");v=!1,d();var C=i.indexOf(h);i.splice(C,1),a=null}}}function m(h){if(!m_(h))throw new Error(process.env.NODE_ENV==="production"?Gt(7):"Actions must be plain objects. Instead, the actual type was: '"+Un(h)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof h.type>"u")throw new Error(process.env.NODE_ENV==="production"?Gt(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(c)throw new Error(process.env.NODE_ENV==="production"?Gt(9):"Reducers may not dispatch actions.");try{c=!0,s=o(s,h)}finally{c=!1}for(var v=a=i,y=0;y<v.length;y++){var C=v[y];C()}return h}function g(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?Gt(10):"Expected the nextReducer to be a function. Instead, received: '"+Un(h));o=h,m({type:If.REPLACE})}function b(){var h,v=f;return h={subscribe:function(C){if(typeof C!="object"||C===null)throw new Error(process.env.NODE_ENV==="production"?Gt(11):"Expected the observer to be an object. Instead, received: '"+Un(C)+"'");function S(){C.next&&C.next(u())}S();var w=v(S);return{unsubscribe:w}}},h[Af]=function(){return this},h}return m({type:If.INIT}),n={dispatch:m,subscribe:f,getState:u,replaceReducer:g},n[Af]=b,n}var S_=function(t,r){return t===r};function w_(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function __(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:S_;if(e.length!==t.length)return!1;for(var n=0;n<e.length;++n)if(!r(e[n],t[n]))return!1;return!0}function Lf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Of(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Lf(Object(r),!0).forEach(function(n){T_(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function T_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Pf={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function E_(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Pf,t=arguments.length>1?arguments[1]:void 0,r=t.payload;switch(t.type){case Xi:case ia:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case la:return w_(e.clientOffset,r.clientOffset)?e:Of(Of({},e),{},{clientOffset:r.clientOffset});case da:case ca:return Pf;default:return e}}var tl="dnd-core/ADD_SOURCE",rl="dnd-core/ADD_TARGET",nl="dnd-core/REMOVE_SOURCE",fa="dnd-core/REMOVE_TARGET";function A_(e){return{type:tl,payload:{sourceId:e}}}function k_(e){return{type:rl,payload:{targetId:e}}}function I_(e){return{type:nl,payload:{sourceId:e}}}function D_(e){return{type:fa,payload:{targetId:e}}}function Nf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Kt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Nf(Object(r),!0).forEach(function(n){L_(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function L_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var O_={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function P_(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:O_,t=arguments.length>1?arguments[1]:void 0,r=t.payload;switch(t.type){case ia:return Kt(Kt({},e),{},{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case Ji:return Kt(Kt({},e),{},{isSourcePublic:!0});case la:return Kt(Kt({},e),{},{targetIds:r.targetIds});case fa:return e.targetIds.indexOf(r.targetId)===-1?e:Kt(Kt({},e),{},{targetIds:zw(e.targetIds,r.targetId)});case ca:return Kt(Kt({},e),{},{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case da:return Kt(Kt({},e),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function N_(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case tl:case rl:return e+1;case nl:case fa:return e-1;default:return e}}var ha=[],ol=[];ha.__IS_NONE__=!0,ol.__IS_ALL__=!0;function x_(e,t){if(e===ha)return!1;if(e===ol||typeof t>"u")return!0;var r=Hw(t,e);return r.length>0}function F_(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case la:break;case tl:case rl:case fa:case nl:return ha;case ia:case Ji:case da:case ca:default:return ol}var t=e.payload,r=t.targetIds,n=r===void 0?[]:r,o=t.prevTargetIds,s=o===void 0?[]:o,a=Vw(n,s),i=a.length>0||!__(n,s);if(!i)return ha;var c=s[s.length-1],d=n[n.length-1];return c!==d&&(c&&a.push(c),d&&a.push(d)),a}function M_(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e+1}function xf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ff(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?xf(Object(r),!0).forEach(function(n){$_(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function B_(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:F_(e.dirtyHandlerIds,{type:t.type,payload:Ff(Ff({},t.payload),{},{prevTargetIds:Uw(e,"dragOperation.targetIds",[])})}),dragOffset:E_(e.dragOffset,t),refCount:N_(e.refCount,t),dragOperation:P_(e.dragOperation,t),stateId:M_(e.stateId)}}function q_(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Mf(e,t){return{x:e.x-t.x,y:e.y-t.y}}function j_(e){var t=e.clientOffset,r=e.initialClientOffset,n=e.initialSourceClientOffset;return!t||!r||!n?null:Mf(q_(t,n),r)}function U_(e){var t=e.clientOffset,r=e.initialClientOffset;return!t||!r?null:Mf(t,r)}function z_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function V_(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function H_(e,t,r){return t&&V_(e.prototype,t),e}function $f(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Q_=(function(){function e(t,r){z_(this,e),$f(this,"store",void 0),$f(this,"registry",void 0),this.store=t,this.registry=r}return H_(e,[{key:"subscribeToStateChange",value:function(r){var n=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0},s=o.handlerIds;_e(typeof r=="function","listener must be a function."),_e(typeof s>"u"||Array.isArray(s),"handlerIds, when specified, must be an array of strings.");var a=this.store.getState().stateId,i=function(){var d=n.store.getState(),u=d.stateId;try{var f=u===a||u===a+1&&!x_(d.dirtyHandlerIds,s);f||r()}finally{a=u}};return this.store.subscribe(i)}},{key:"subscribeToOffsetChange",value:function(r){var n=this;_e(typeof r=="function","listener must be a function.");var o=this.store.getState().dragOffset,s=function(){var i=n.store.getState().dragOffset;i!==o&&(o=i,r())};return this.store.subscribe(s)}},{key:"canDragSource",value:function(r){if(!r)return!1;var n=this.registry.getSource(r);return _e(n,"Expected to find a valid source. sourceId=".concat(r)),this.isDragging()?!1:n.canDrag(this,r)}},{key:"canDropOnTarget",value:function(r){if(!r)return!1;var n=this.registry.getTarget(r);if(_e(n,"Expected to find a valid target. targetId=".concat(r)),!this.isDragging()||this.didDrop())return!1;var o=this.registry.getTargetType(r),s=this.getItemType();return el(o,s)&&n.canDrop(this,r)}},{key:"isDragging",value:function(){return!!this.getItemType()}},{key:"isDraggingSource",value:function(r){if(!r)return!1;var n=this.registry.getSource(r,!0);if(_e(n,"Expected to find a valid source. sourceId=".concat(r)),!this.isDragging()||!this.isSourcePublic())return!1;var o=this.registry.getSourceType(r),s=this.getItemType();return o!==s?!1:n.isDragging(this,r)}},{key:"isOverTarget",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shallow:!1};if(!r)return!1;var o=n.shallow;if(!this.isDragging())return!1;var s=this.registry.getTargetType(r),a=this.getItemType();if(a&&!el(s,a))return!1;var i=this.getTargetIds();if(!i.length)return!1;var c=i.indexOf(r);return o?c===i.length-1:c>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return!!this.store.getState().dragOperation.isSourcePublic}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return j_(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return U_(this.store.getState().dragOffset)}}]),e})(),W_=0;function R_(){return W_++}function pa(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?pa=function(r){return typeof r}:pa=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},pa(e)}function G_(e){_e(typeof e.canDrag=="function","Expected canDrag to be a function."),_e(typeof e.beginDrag=="function","Expected beginDrag to be a function."),_e(typeof e.endDrag=="function","Expected endDrag to be a function.")}function K_(e){_e(typeof e.canDrop=="function","Expected canDrop to be a function."),_e(typeof e.hover=="function","Expected hover to be a function."),_e(typeof e.drop=="function","Expected beginDrag to be a function.")}function sl(e,t){if(t&&Array.isArray(e)){e.forEach(function(r){return sl(r,!1)});return}_e(typeof e=="string"||pa(e)==="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}const Bf=typeof global<"u"?global:self,qf=Bf.MutationObserver||Bf.WebKitMutationObserver;function jf(e){return function(){const r=setTimeout(o,0),n=setInterval(o,50);function o(){clearTimeout(r),clearInterval(n),e()}}}function Y_(e){let t=1;const r=new qf(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const Z_=typeof qf=="function"?Y_:jf;class X_{enqueueTask(t){const{queue:r,requestFlush:n}=this;r.length||(n(),this.flushing=!0),r[r.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.index<t.length;){const r=this.index;if(this.index++,t[r].call(),this.index>this.capacity){for(let n=0,o=t.length-this.index;n<o;n++)t[n]=t[n+this.index];t.length-=this.index,this.index=0}}t.length=0,this.index=0,this.flushing=!1},this.registerPendingError=t=>{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=Z_(this.flush),this.requestErrorThrow=jf(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class J_{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,r){this.onError=t,this.release=r,this.task=null}}class e1{create(t){const r=this.freeTasks,n=r.length?r.pop():new J_(this.onError,o=>r[r.length]=o);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}const Uf=new X_,t1=new e1(Uf.registerPendingError);function r1(e){Uf.enqueueTask(t1.create(e))}function n1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s1(e,t,r){return t&&o1(e.prototype,t),e}function zn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a1(e,t){return d1(e)||c1(e,t)||l1(e,t)||i1()}function i1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
537
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function l1(e,t){if(e){if(typeof e=="string")return zf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zf(e,t)}}function zf(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function c1(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,s=!1,a,i;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(c){s=!0,i=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(s)throw i}}return n}}function d1(e){if(Array.isArray(e))return e}function u1(e){var t=R_().toString();switch(e){case Rt.SOURCE:return"S".concat(t);case Rt.TARGET:return"T".concat(t);default:throw new Error("Unknown Handler Role: ".concat(e))}}function Vf(e){switch(e[0]){case"S":return Rt.SOURCE;case"T":return Rt.TARGET;default:_e(!1,"Cannot parse handler ID: ".concat(e))}}function Hf(e,t){var r=e.entries(),n=!1;do{var o=r.next(),s=o.done,a=a1(o.value,2),i=a[1];if(i===t)return!0;n=!!s}while(!n);return!1}var f1=(function(){function e(t){n1(this,e),zn(this,"types",new Map),zn(this,"dragSources",new Map),zn(this,"dropTargets",new Map),zn(this,"pinnedSourceId",null),zn(this,"pinnedSource",null),zn(this,"store",void 0),this.store=t}return s1(e,[{key:"addSource",value:function(r,n){sl(r),G_(n);var o=this.addHandler(Rt.SOURCE,r,n);return this.store.dispatch(A_(o)),o}},{key:"addTarget",value:function(r,n){sl(r,!0),K_(n);var o=this.addHandler(Rt.TARGET,r,n);return this.store.dispatch(k_(o)),o}},{key:"containsHandler",value:function(r){return Hf(this.dragSources,r)||Hf(this.dropTargets,r)}},{key:"getSource",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;_e(this.isSourceId(r),"Expected a valid source ID.");var o=n&&r===this.pinnedSourceId,s=o?this.pinnedSource:this.dragSources.get(r);return s}},{key:"getTarget",value:function(r){return _e(this.isTargetId(r),"Expected a valid target ID."),this.dropTargets.get(r)}},{key:"getSourceType",value:function(r){return _e(this.isSourceId(r),"Expected a valid source ID."),this.types.get(r)}},{key:"getTargetType",value:function(r){return _e(this.isTargetId(r),"Expected a valid target ID."),this.types.get(r)}},{key:"isSourceId",value:function(r){var n=Vf(r);return n===Rt.SOURCE}},{key:"isTargetId",value:function(r){var n=Vf(r);return n===Rt.TARGET}},{key:"removeSource",value:function(r){var n=this;_e(this.getSource(r),"Expected an existing source."),this.store.dispatch(I_(r)),r1(function(){n.dragSources.delete(r),n.types.delete(r)})}},{key:"removeTarget",value:function(r){_e(this.getTarget(r),"Expected an existing target."),this.store.dispatch(D_(r)),this.dropTargets.delete(r),this.types.delete(r)}},{key:"pinSource",value:function(r){var n=this.getSource(r);_e(n,"Expected an existing source."),this.pinnedSourceId=r,this.pinnedSource=n}},{key:"unpinSource",value:function(){_e(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(r,n,o){var s=u1(r);return this.types.set(s,n),r===Rt.SOURCE?this.dragSources.set(s,o):r===Rt.TARGET&&this.dropTargets.set(s,o),s}}]),e})();function h1(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=p1(n),s=new Q_(o,new f1(o)),a=new g_(o,s),i=e(a,t,r);return a.receiveBackend(i),a}function p1(e){var t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Df(B_,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}var g1=["children"];function m1(e,t){return C1(e)||b1(e,t)||y1(e,t)||v1()}function v1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
538
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function y1(e,t){if(e){if(typeof e=="string")return Qf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Qf(e,t)}}function Qf(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function b1(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,s=!1,a,i;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(c){s=!0,i=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(s)throw i}}return n}}function C1(e){if(Array.isArray(e))return e}function S1(e,t){if(e==null)return{};var r=w1(e,t),n,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)n=s[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function w1(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,s;for(s=0;s<n.length;s++)o=n[s],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}var Wf=0,ga=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),_1=p.memo(function(t){var r=t.children,n=S1(t,g1),o=T1(n),s=m1(o,2),a=s[0],i=s[1];return p.useEffect(function(){if(i){var c=Rf();return++Wf,function(){--Wf===0&&(c[ga]=null)}}},[]),l.jsx(Sf.Provider,Object.assign({value:a},{children:r}),void 0)});function T1(e){if("manager"in e){var t={dragDropManager:e.manager};return[t,!1]}var r=E1(e.backend,e.context,e.options,e.debugMode),n=!e.context;return[r,n]}function E1(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Rf(),r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,o=t;return o[ga]||(o[ga]={dragDropManager:h1(e,t,r,n)}),o[ga]}function Rf(){return typeof global<"u"?global:window}function A1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function k1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function I1(e,t,r){return t&&k1(e.prototype,t),e}function Gf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var al=!1,il=!1,D1=(function(){function e(t){A1(this,e),Gf(this,"internalMonitor",void 0),Gf(this,"sourceId",null),this.internalMonitor=t.getMonitor()}return I1(e,[{key:"receiveHandlerId",value:function(r){this.sourceId=r}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){_e(!al,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return al=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{al=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;_e(!il,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return il=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{il=!1}}},{key:"subscribeToStateChange",value:function(r,n){return this.internalMonitor.subscribeToStateChange(r,n)}},{key:"isDraggingSource",value:function(r){return this.internalMonitor.isDraggingSource(r)}},{key:"isOverTarget",value:function(r,n){return this.internalMonitor.isOverTarget(r,n)}},{key:"getTargetIds",value:function(){return this.internalMonitor.getTargetIds()}},{key:"isSourcePublic",value:function(){return this.internalMonitor.isSourcePublic()}},{key:"getSourceId",value:function(){return this.internalMonitor.getSourceId()}},{key:"subscribeToOffsetChange",value:function(r){return this.internalMonitor.subscribeToOffsetChange(r)}},{key:"canDragSource",value:function(r){return this.internalMonitor.canDragSource(r)}},{key:"canDropOnTarget",value:function(r){return this.internalMonitor.canDropOnTarget(r)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),e})();function L1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function P1(e,t,r){return t&&O1(e.prototype,t),e}function Kf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ll=!1,N1=(function(){function e(t){L1(this,e),Kf(this,"internalMonitor",void 0),Kf(this,"targetId",null),this.internalMonitor=t.getMonitor()}return P1(e,[{key:"receiveHandlerId",value:function(r){this.targetId=r}},{key:"getHandlerId",value:function(){return this.targetId}},{key:"subscribeToStateChange",value:function(r,n){return this.internalMonitor.subscribeToStateChange(r,n)}},{key:"canDrop",value:function(){if(!this.targetId)return!1;_e(!ll,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return ll=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{ll=!1}}},{key:"isOver",value:function(r){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,r):!1}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),e})();function x1(e){if(typeof e.type!="string"){var t=e.type.displayName||e.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors."+"You can either wrap ".concat(t," into a <div>, or turn it into a ")+"drag source or a drop target itself.")}}function F1(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!p.isValidElement(t)){var n=t;return e(n,r),n}var o=t;x1(o);var s=r?function(a){return e(a,r)}:e;return M1(o,s)}}function Yf(e){var t={};return Object.keys(e).forEach(function(r){var n=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{var o=F1(n);t[r]=function(){return o}}}),t}function Zf(e,t){typeof e=="function"?e(t):e.current=t}function M1(e,t){var r=e.ref;return _e(typeof r!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?p.cloneElement(e,{ref:function(o){Zf(r,o),Zf(t,o)}}):p.cloneElement(e,{ref:t})}function ma(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ma=function(r){return typeof r}:ma=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ma(e)}function cl(e){return e!==null&&ma(e)==="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function dl(e,t,r,n){var o=void 0;if(o!==void 0)return!!o;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;var s=Object.keys(e),a=Object.keys(t);if(s.length!==a.length)return!1;for(var i=Object.prototype.hasOwnProperty.bind(t),c=0;c<s.length;c++){var d=s[c];if(!i(d))return!1;var u=e[d],f=t[d];if(o=void 0,o===!1||o===void 0&&u!==f)return!1}return!0}function $1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function B1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function q1(e,t,r){return t&&B1(e.prototype,t),e}function Tt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var j1=(function(){function e(t){var r=this;$1(this,e),Tt(this,"hooks",Yf({dragSource:function(o,s){r.clearDragSource(),r.dragSourceOptions=s||null,cl(o)?r.dragSourceRef=o:r.dragSourceNode=o,r.reconnectDragSource()},dragPreview:function(o,s){r.clearDragPreview(),r.dragPreviewOptions=s||null,cl(o)?r.dragPreviewRef=o:r.dragPreviewNode=o,r.reconnectDragPreview()}})),Tt(this,"handlerId",null),Tt(this,"dragSourceRef",null),Tt(this,"dragSourceNode",void 0),Tt(this,"dragSourceOptionsInternal",null),Tt(this,"dragSourceUnsubscribe",void 0),Tt(this,"dragPreviewRef",null),Tt(this,"dragPreviewNode",void 0),Tt(this,"dragPreviewOptionsInternal",null),Tt(this,"dragPreviewUnsubscribe",void 0),Tt(this,"lastConnectedHandlerId",null),Tt(this,"lastConnectedDragSource",null),Tt(this,"lastConnectedDragSourceOptions",null),Tt(this,"lastConnectedDragPreview",null),Tt(this,"lastConnectedDragPreviewOptions",null),Tt(this,"backend",void 0),this.backend=t}return q1(e,[{key:"receiveHandlerId",value:function(r){this.handlerId!==r&&(this.handlerId=r,this.reconnect())}},{key:"connectTarget",get:function(){return this.dragSource}},{key:"dragSourceOptions",get:function(){return this.dragSourceOptionsInternal},set:function(r){this.dragSourceOptionsInternal=r}},{key:"dragPreviewOptions",get:function(){return this.dragPreviewOptionsInternal},set:function(r){this.dragPreviewOptionsInternal=r}},{key:"reconnect",value:function(){this.reconnectDragSource(),this.reconnectDragPreview()}},{key:"reconnectDragSource",value:function(){var r=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();if(n&&this.disconnectDragSource(),!!this.handlerId){if(!r){this.lastConnectedDragSource=r;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=r,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,r,this.dragSourceOptions))}}},{key:"reconnectDragPreview",value:function(){var r=this.dragPreview,n=this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(n&&this.disconnectDragPreview(),!!this.handlerId){if(!r){this.lastConnectedDragPreview=r;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=r,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,r,this.dragPreviewOptions))}}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didConnectedDragSourceChange",value:function(){return this.lastConnectedDragSource!==this.dragSource}},{key:"didConnectedDragPreviewChange",value:function(){return this.lastConnectedDragPreview!==this.dragPreview}},{key:"didDragSourceOptionsChange",value:function(){return!dl(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!dl(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}},{key:"disconnectDragSource",value:function(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}},{key:"disconnectDragPreview",value:function(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}},{key:"dragSource",get:function(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}},{key:"dragPreview",get:function(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}},{key:"clearDragSource",value:function(){this.dragSourceNode=null,this.dragSourceRef=null}},{key:"clearDragPreview",value:function(){this.dragPreviewNode=null,this.dragPreviewRef=null}}]),e})();function U1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function z1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function V1(e,t,r){return t&&z1(e.prototype,t),e}function pr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var H1=(function(){function e(t){var r=this;U1(this,e),pr(this,"hooks",Yf({dropTarget:function(o,s){r.clearDropTarget(),r.dropTargetOptions=s,cl(o)?r.dropTargetRef=o:r.dropTargetNode=o,r.reconnect()}})),pr(this,"handlerId",null),pr(this,"dropTargetRef",null),pr(this,"dropTargetNode",void 0),pr(this,"dropTargetOptionsInternal",null),pr(this,"unsubscribeDropTarget",void 0),pr(this,"lastConnectedHandlerId",null),pr(this,"lastConnectedDropTarget",null),pr(this,"lastConnectedDropTargetOptions",null),pr(this,"backend",void 0),this.backend=t}return V1(e,[{key:"connectTarget",get:function(){return this.dropTarget}},{key:"reconnect",value:function(){var r=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();r&&this.disconnectDropTarget();var n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions))}}},{key:"receiveHandlerId",value:function(r){r!==this.handlerId&&(this.handlerId=r,this.reconnect())}},{key:"dropTargetOptions",get:function(){return this.dropTargetOptionsInternal},set:function(r){this.dropTargetOptionsInternal=r}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didDropTargetChange",value:function(){return this.lastConnectedDropTarget!==this.dropTarget}},{key:"didOptionsChange",value:function(){return!dl(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}},{key:"disconnectDropTarget",value:function(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}},{key:"dropTarget",get:function(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}},{key:"clearDropTarget",value:function(){this.dropTargetRef=null,this.dropTargetNode=null}}]),e})();function Q1(e,t,r){var n=r.getRegistry(),o=n.addTarget(e,t);return[o,function(){return n.removeTarget(o)}]}function W1(e,t,r){var n=r.getRegistry(),o=n.addSource(e,t);return[o,function(){return n.removeSource(o)}]}var nn=typeof window<"u"?p.useLayoutEffect:p.useEffect;function va(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?va=function(r){return typeof r}:va=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},va(e)}function R1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function G1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function K1(e,t,r){return t&&G1(e.prototype,t),e}function ul(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Y1=(function(){function e(t,r,n){R1(this,e),ul(this,"spec",void 0),ul(this,"monitor",void 0),ul(this,"connector",void 0),this.spec=t,this.monitor=r,this.connector=n}return K1(e,[{key:"beginDrag",value:function(){var r,n=this.spec,o=this.monitor,s=null;return va(n.item)==="object"?s=n.item:typeof n.item=="function"?s=n.item(o):s={},(r=s)!==null&&r!==void 0?r:null}},{key:"canDrag",value:function(){var r=this.spec,n=this.monitor;return typeof r.canDrag=="boolean"?r.canDrag:typeof r.canDrag=="function"?r.canDrag(n):!0}},{key:"isDragging",value:function(r,n){var o=this.spec,s=this.monitor,a=o.isDragging;return a?a(s):n===r.getSourceId()}},{key:"endDrag",value:function(){var r=this.spec,n=this.monitor,o=this.connector,s=r.end;s&&s(n.getItem(),n),o.reconnect()}}]),e})();function Z1(e,t,r){var n=p.useMemo(function(){return new Y1(e,t,r)},[t,r]);return p.useEffect(function(){n.spec=e},[e]),n}function on(){var e=p.useContext(Sf),t=e.dragDropManager;return _e(t!=null,"Expected drag drop context"),t}function X1(e){return p.useMemo(function(){var t=e.type;return _e(t!=null,"spec.type must be defined"),t},[e])}function J1(e,t){return n0(e)||r0(e,t)||t0(e,t)||e0()}function e0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
539
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function t0(e,t){if(e){if(typeof e=="string")return Xf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Xf(e,t)}}function Xf(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function r0(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,s=!1,a,i;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(c){s=!0,i=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(s)throw i}}return n}}function n0(e){if(Array.isArray(e))return e}function o0(e,t,r){var n=on(),o=Z1(e,t,r),s=X1(e);nn(function(){if(s!=null){var i=W1(s,o,n),c=J1(i,2),d=c[0],u=c[1];return t.receiveHandlerId(d),r.receiveHandlerId(d),u}},[n,t,r,o,s])}function s0(e){return c0(e)||l0(e)||i0(e)||a0()}function a0(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
540
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i0(e,t){if(e){if(typeof e=="string")return fl(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fl(e,t)}}function l0(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c0(e){if(Array.isArray(e))return fl(e)}function fl(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Jf(e,t){var r=s0(t||[]);return t==null&&typeof e!="function"&&r.push(e),p.useMemo(function(){return typeof e=="function"?e():e},r)}function d0(){var e=on();return p.useMemo(function(){return new D1(e)},[e])}function u0(e,t){var r=on(),n=p.useMemo(function(){return new j1(r.getBackend())},[r]);return nn(function(){return n.dragSourceOptions=e||null,n.reconnect(),function(){return n.disconnectDragSource()}},[n,e]),nn(function(){return n.dragPreviewOptions=t||null,n.reconnect(),function(){return n.disconnectDragPreview()}},[n,t]),n}var hl,eh;function f0(){return eh||(eh=1,hl=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,s;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(s=Object.keys(t),n=s.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[o]))return!1;for(o=n;o--!==0;){var a=s[o];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r}),hl}var h0=f0();const p0=pi(h0);function g0(e,t){return b0(e)||y0(e,t)||v0(e,t)||m0()}function m0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
541
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function v0(e,t){if(e){if(typeof e=="string")return th(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return th(e,t)}}function th(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function y0(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,s=!1,a,i;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(c){s=!0,i=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(s)throw i}}return n}}function b0(e){if(Array.isArray(e))return e}function rh(e,t,r){var n=p.useState(function(){return t(e)}),o=g0(n,2),s=o[0],a=o[1],i=p.useCallback(function(){var c=t(e);p0(s,c)||(a(c),r&&r())},[s,e,r]);return nn(i),[s,i]}function C0(e,t){return T0(e)||_0(e,t)||w0(e,t)||S0()}function S0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
542
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function w0(e,t){if(e){if(typeof e=="string")return nh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nh(e,t)}}function nh(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _0(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,s=!1,a,i;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(c){s=!0,i=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(s)throw i}}return n}}function T0(e){if(Array.isArray(e))return e}function E0(e,t,r){var n=rh(e,t,r),o=C0(n,2),s=o[0],a=o[1];return nn(function(){var c=e.getHandlerId();if(c!=null)return e.subscribeToStateChange(a,{handlerIds:[c]})},[e,a]),s}function oh(e,t,r){return E0(t,e||function(){return{}},function(){return r.reconnect()})}function A0(e){return p.useMemo(function(){return e.hooks.dragSource()},[e])}function k0(e){return p.useMemo(function(){return e.hooks.dragPreview()},[e])}function I0(e,t){var r=Jf(e,t);_e(!r.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");var n=d0(),o=u0(r.options,r.previewOptions);return o0(r,n,o),[oh(r.collect,n,o),A0(o),k0(o)]}function D0(e){var t=e.accept;return p.useMemo(function(){return _e(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]},[t])}function L0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O0(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function P0(e,t,r){return t&&O0(e.prototype,t),e}function sh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var N0=(function(){function e(t,r){L0(this,e),sh(this,"spec",void 0),sh(this,"monitor",void 0),this.spec=t,this.monitor=r}return P0(e,[{key:"canDrop",value:function(){var r=this.spec,n=this.monitor;return r.canDrop?r.canDrop(n.getItem(),n):!0}},{key:"hover",value:function(){var r=this.spec,n=this.monitor;r.hover&&r.hover(n.getItem(),n)}},{key:"drop",value:function(){var r=this.spec,n=this.monitor;if(r.drop)return r.drop(n.getItem(),n)}}]),e})();function x0(e,t){var r=p.useMemo(function(){return new N0(e,t)},[t]);return p.useEffect(function(){r.spec=e},[e]),r}function F0(e,t){return q0(e)||B0(e,t)||$0(e,t)||M0()}function M0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
543
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $0(e,t){if(e){if(typeof e=="string")return ah(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ah(e,t)}}function ah(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function B0(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,s=!1,a,i;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(c){s=!0,i=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(s)throw i}}return n}}function q0(e){if(Array.isArray(e))return e}function j0(e,t,r){var n=on(),o=x0(e,t),s=D0(e);nn(function(){var i=Q1(s,o,n),c=F0(i,2),d=c[0],u=c[1];return t.receiveHandlerId(d),r.receiveHandlerId(d),u},[n,t,o,r,s.map(function(a){return a.toString()}).join("|")])}function U0(){var e=on();return p.useMemo(function(){return new N1(e)},[e])}function z0(e){var t=on(),r=p.useMemo(function(){return new H1(t.getBackend())},[t]);return nn(function(){return r.dropTargetOptions=e||null,r.reconnect(),function(){return r.disconnectDropTarget()}},[e]),r}function V0(e){return p.useMemo(function(){return e.hooks.dropTarget()},[e])}function ih(e,t){var r=Jf(e,t),n=U0(),o=z0(r.options);return j0(r,n,o),[oh(r.collect,n,o),V0(o)]}function H0(e,t){return G0(e)||R0(e,t)||W0(e,t)||Q0()}function Q0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
544
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function W0(e,t){if(e){if(typeof e=="string")return lh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return lh(e,t)}}function lh(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function R0(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,s=!1,a,i;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(c){s=!0,i=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(s)throw i}}return n}}function G0(e){if(Array.isArray(e))return e}function K0(e){var t=on(),r=t.getMonitor(),n=rh(r,e),o=H0(n,2),s=o[0],a=o[1];return p.useEffect(function(){return r.subscribeToOffsetChange(a)}),p.useEffect(function(){return r.subscribeToStateChange(a)}),s}function ch(e){var t=null,r=function(){return t==null&&(t=e()),t};return r}function Y0(e,t){return e.filter(function(r){return r!==t})}function Z0(e,t){var r=new Set,n=function(a){return r.add(a)};e.forEach(n),t.forEach(n);var o=[];return r.forEach(function(s){return o.push(s)}),o}function X0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function J0(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function eT(e,t,r){return t&&J0(e.prototype,t),e}function dh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var tT=(function(){function e(t){X0(this,e),dh(this,"entered",[]),dh(this,"isNodeInDocument",void 0),this.isNodeInDocument=t}return eT(e,[{key:"enter",value:function(r){var n=this,o=this.entered.length,s=function(i){return n.isNodeInDocument(i)&&(!i.contains||i.contains(r))};return this.entered=Z0(this.entered.filter(s),[r]),o===0&&this.entered.length>0}},{key:"leave",value:function(r){var n=this.entered.length;return this.entered=Y0(this.entered.filter(this.isNodeInDocument),r),n>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),e})(),rT=ch(function(){return/firefox/i.test(navigator.userAgent)}),uh=ch(function(){return!!window.safari});function nT(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oT(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function sT(e,t,r){return t&&oT(e.prototype,t),e}function Uo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var fh=(function(){function e(t,r){nT(this,e),Uo(this,"xs",void 0),Uo(this,"ys",void 0),Uo(this,"c1s",void 0),Uo(this,"c2s",void 0),Uo(this,"c3s",void 0);for(var n=t.length,o=[],s=0;s<n;s++)o.push(s);o.sort(function(A,x){return t[A]<t[x]?-1:1});for(var a=[],i=[],c,d,u=0;u<n-1;u++)c=t[u+1]-t[u],d=r[u+1]-r[u],a.push(c),i.push(d/c);for(var f=[i[0]],m=0;m<a.length-1;m++){var g=i[m],b=i[m+1];if(g*b<=0)f.push(0);else{c=a[m];var h=a[m+1],v=c+h;f.push(3*v/((v+h)/g+(v+c)/b))}}f.push(i[i.length-1]);for(var y=[],C=[],S,w=0;w<f.length-1;w++){S=i[w];var T=f[w],E=1/a[w],L=T+f[w+1]-S-S;y.push((S-T-L)*E),C.push(L*E*E)}this.xs=t,this.ys=r,this.c1s=f,this.c2s=y,this.c3s=C}return sT(e,[{key:"interpolate",value:function(r){var n=this.xs,o=this.ys,s=this.c1s,a=this.c2s,i=this.c3s,c=n.length-1;if(r===n[c])return o[c];for(var d=0,u=i.length-1,f;d<=u;){f=Math.floor(.5*(d+u));var m=n[f];if(m<r)d=f+1;else if(m>r)u=f-1;else return o[f]}c=Math.max(0,u);var g=r-n[c],b=g*g;return o[c]+s[c]*g+a[c]*b+i[c]*g*b}}]),e})(),aT=1;function hh(e){var t=e.nodeType===aT?e:e.parentElement;if(!t)return null;var r=t.getBoundingClientRect(),n=r.top,o=r.left;return{x:o,y:n}}function ya(e){return{x:e.clientX,y:e.clientY}}function iT(e){var t;return e.nodeName==="IMG"&&(rT()||!((t=document.documentElement)!==null&&t!==void 0&&t.contains(e)))}function lT(e,t,r,n){var o=e?t.width:r,s=e?t.height:n;return uh()&&e&&(s/=window.devicePixelRatio,o/=window.devicePixelRatio),{dragPreviewWidth:o,dragPreviewHeight:s}}function cT(e,t,r,n,o){var s=iT(t),a=s?e:t,i=hh(a),c={x:r.x-i.x,y:r.y-i.y},d=e.offsetWidth,u=e.offsetHeight,f=n.anchorX,m=n.anchorY,g=lT(s,t,d,u),b=g.dragPreviewWidth,h=g.dragPreviewHeight,v=function(){var L=new fh([0,.5,1],[c.y,c.y/u*h,c.y+h-u]),A=L.interpolate(m);return uh()&&s&&(A+=(window.devicePixelRatio-1)*h),A},y=function(){var L=new fh([0,.5,1],[c.x,c.x/d*b,c.x+b-d]);return L.interpolate(f)},C=o.offsetX,S=o.offsetY,w=C===0||C,T=S===0||S;return{x:w?C:y(),y:T?S:v()}}var ph="__NATIVE_FILE__",gh="__NATIVE_URL__",mh="__NATIVE_TEXT__",vh="__NATIVE_HTML__";const yh=Object.freeze(Object.defineProperty({__proto__:null,FILE:ph,HTML:vh,TEXT:mh,URL:gh},Symbol.toStringTag,{value:"Module"}));function pl(e,t,r){var n=t.reduce(function(o,s){return o||e.getData(s)},"");return n??r}var Vn;function ba(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var gl=(Vn={},ba(Vn,ph,{exposeProperties:{files:function(t){return Array.prototype.slice.call(t.files)},items:function(t){return t.items},dataTransfer:function(t){return t}},matchesTypes:["Files"]}),ba(Vn,vh,{exposeProperties:{html:function(t,r){return pl(t,r,"")},dataTransfer:function(t){return t}},matchesTypes:["Html","text/html"]}),ba(Vn,gh,{exposeProperties:{urls:function(t,r){return pl(t,r,"").split(`
545
- `)},dataTransfer:function(t){return t}},matchesTypes:["Url","text/uri-list"]}),ba(Vn,mh,{exposeProperties:{text:function(t,r){return pl(t,r,"")},dataTransfer:function(t){return t}},matchesTypes:["Text","text/plain"]}),Vn);function dT(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uT(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function fT(e,t,r){return t&&uT(e.prototype,t),e}function bh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var hT=(function(){function e(t){dT(this,e),bh(this,"item",void 0),bh(this,"config",void 0),this.config=t,this.item={},this.initializeExposedProperties()}return fT(e,[{key:"initializeExposedProperties",value:function(){var r=this;Object.keys(this.config.exposeProperties).forEach(function(n){Object.defineProperty(r.item,n,{configurable:!0,enumerable:!0,get:function(){return console.warn(`Browser doesn't allow reading "`.concat(n,'" until the drop event.')),null}})})}},{key:"loadDataTransfer",value:function(r){var n=this;if(r){var o={};Object.keys(this.config.exposeProperties).forEach(function(s){o[s]={value:n.config.exposeProperties[s](r,n.config.matchesTypes),configurable:!0,enumerable:!0}}),Object.defineProperties(this.item,o)}}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(r,n){return n===r.getSourceId()}},{key:"endDrag",value:function(){}}]),e})();function pT(e,t){var r=new hT(gl[e]);return r.loadDataTransfer(t),r}function ml(e){if(!e)return null;var t=Array.prototype.slice.call(e.types||[]);return Object.keys(gl).filter(function(r){var n=gl[r].matchesTypes;return n.some(function(o){return t.indexOf(o)>-1})})[0]||null}function gT(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mT(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function vT(e,t,r){return t&&mT(e.prototype,t),e}function vl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var yT=(function(){function e(t,r){gT(this,e),vl(this,"ownerDocument",null),vl(this,"globalContext",void 0),vl(this,"optionsArgs",void 0),this.globalContext=t,this.optionsArgs=r}return vT(e,[{key:"window",get:function(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}},{key:"document",get:function(){var r;return(r=this.globalContext)!==null&&r!==void 0&&r.document?this.globalContext.document:this.window?this.window.document:void 0}},{key:"rootElement",get:function(){var r;return((r=this.optionsArgs)===null||r===void 0?void 0:r.rootElement)||this.window}}]),e})();function Ch(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Sh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ch(Object(r),!0).forEach(function(n){Le(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ch(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function bT(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function CT(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ST(e,t,r){return t&&CT(e.prototype,t),e}function Le(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var wT=(function(){function e(t,r,n){var o=this;bT(this,e),Le(this,"options",void 0),Le(this,"actions",void 0),Le(this,"monitor",void 0),Le(this,"registry",void 0),Le(this,"enterLeaveCounter",void 0),Le(this,"sourcePreviewNodes",new Map),Le(this,"sourcePreviewNodeOptions",new Map),Le(this,"sourceNodes",new Map),Le(this,"sourceNodeOptions",new Map),Le(this,"dragStartSourceIds",null),Le(this,"dropTargetIds",[]),Le(this,"dragEnterTargetIds",[]),Le(this,"currentNativeSource",null),Le(this,"currentNativeHandle",null),Le(this,"currentDragSourceNode",null),Le(this,"altKeyPressed",!1),Le(this,"mouseMoveTimeoutTimer",null),Le(this,"asyncEndDragFrameId",null),Le(this,"dragOverTargetIds",null),Le(this,"lastClientOffset",null),Le(this,"hoverRafId",null),Le(this,"getSourceClientOffset",function(s){var a=o.sourceNodes.get(s);return a&&hh(a)||null}),Le(this,"endDragNativeItem",function(){o.isDraggingNativeItem()&&(o.actions.endDrag(),o.currentNativeHandle&&o.registry.removeSource(o.currentNativeHandle),o.currentNativeHandle=null,o.currentNativeSource=null)}),Le(this,"isNodeInDocument",function(s){return!!(s&&o.document&&o.document.body&&o.document.body.contains(s))}),Le(this,"endDragIfSourceWasRemovedFromDOM",function(){var s=o.currentDragSourceNode;s==null||o.isNodeInDocument(s)||o.clearCurrentDragSourceNode()&&o.monitor.isDragging()&&o.actions.endDrag()}),Le(this,"handleTopDragStartCapture",function(){o.clearCurrentDragSourceNode(),o.dragStartSourceIds=[]}),Le(this,"handleTopDragStart",function(s){if(!s.defaultPrevented){var a=o.dragStartSourceIds;o.dragStartSourceIds=null;var i=ya(s);o.monitor.isDragging()&&o.actions.endDrag(),o.actions.beginDrag(a||[],{publishSource:!1,getSourceClientOffset:o.getSourceClientOffset,clientOffset:i});var c=s.dataTransfer,d=ml(c);if(o.monitor.isDragging()){if(c&&typeof c.setDragImage=="function"){var u=o.monitor.getSourceId(),f=o.sourceNodes.get(u),m=o.sourcePreviewNodes.get(u)||f;if(m){var g=o.getCurrentSourcePreviewNodeOptions(),b=g.anchorX,h=g.anchorY,v=g.offsetX,y=g.offsetY,C={anchorX:b,anchorY:h},S={offsetX:v,offsetY:y},w=cT(f,m,i,C,S);c.setDragImage(m,w.x,w.y)}}try{c==null||c.setData("application/json",{})}catch{}o.setCurrentDragSourceNode(s.target);var T=o.getCurrentSourcePreviewNodeOptions(),E=T.captureDraggingState;E?o.actions.publishDragSource():setTimeout(function(){return o.actions.publishDragSource()},0)}else if(d)o.beginDragNativeItem(d);else{if(c&&!c.types&&(s.target&&!s.target.hasAttribute||!s.target.hasAttribute("draggable")))return;s.preventDefault()}}}),Le(this,"handleTopDragEndCapture",function(){o.clearCurrentDragSourceNode()&&o.monitor.isDragging()&&o.actions.endDrag()}),Le(this,"handleTopDragEnterCapture",function(s){o.dragEnterTargetIds=[];var a=o.enterLeaveCounter.enter(s.target);if(!(!a||o.monitor.isDragging())){var i=s.dataTransfer,c=ml(i);c&&o.beginDragNativeItem(c,i)}}),Le(this,"handleTopDragEnter",function(s){var a=o.dragEnterTargetIds;if(o.dragEnterTargetIds=[],!!o.monitor.isDragging()){o.altKeyPressed=s.altKey,a.length>0&&o.actions.hover(a,{clientOffset:ya(s)});var i=a.some(function(c){return o.monitor.canDropOnTarget(c)});i&&(s.preventDefault(),s.dataTransfer&&(s.dataTransfer.dropEffect=o.getCurrentDropEffect()))}}),Le(this,"handleTopDragOverCapture",function(){o.dragOverTargetIds=[]}),Le(this,"handleTopDragOver",function(s){var a=o.dragOverTargetIds;if(o.dragOverTargetIds=[],!o.monitor.isDragging()){s.preventDefault(),s.dataTransfer&&(s.dataTransfer.dropEffect="none");return}o.altKeyPressed=s.altKey,o.lastClientOffset=ya(s),o.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(o.hoverRafId=requestAnimationFrame(function(){o.monitor.isDragging()&&o.actions.hover(a||[],{clientOffset:o.lastClientOffset}),o.hoverRafId=null}));var i=(a||[]).some(function(c){return o.monitor.canDropOnTarget(c)});i?(s.preventDefault(),s.dataTransfer&&(s.dataTransfer.dropEffect=o.getCurrentDropEffect())):o.isDraggingNativeItem()?s.preventDefault():(s.preventDefault(),s.dataTransfer&&(s.dataTransfer.dropEffect="none"))}),Le(this,"handleTopDragLeaveCapture",function(s){o.isDraggingNativeItem()&&s.preventDefault();var a=o.enterLeaveCounter.leave(s.target);a&&o.isDraggingNativeItem()&&setTimeout(function(){return o.endDragNativeItem()},0)}),Le(this,"handleTopDropCapture",function(s){if(o.dropTargetIds=[],o.isDraggingNativeItem()){var a;s.preventDefault(),(a=o.currentNativeSource)===null||a===void 0||a.loadDataTransfer(s.dataTransfer)}else ml(s.dataTransfer)&&s.preventDefault();o.enterLeaveCounter.reset()}),Le(this,"handleTopDrop",function(s){var a=o.dropTargetIds;o.dropTargetIds=[],o.actions.hover(a,{clientOffset:ya(s)}),o.actions.drop({dropEffect:o.getCurrentDropEffect()}),o.isDraggingNativeItem()?o.endDragNativeItem():o.monitor.isDragging()&&o.actions.endDrag()}),Le(this,"handleSelectStart",function(s){var a=s.target;typeof a.dragDrop=="function"&&(a.tagName==="INPUT"||a.tagName==="SELECT"||a.tagName==="TEXTAREA"||a.isContentEditable||(s.preventDefault(),a.dragDrop()))}),this.options=new yT(r,n),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new tT(this.isNodeInDocument)}return ST(e,[{key:"profile",value:function(){var r,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((r=this.dragStartSourceIds)===null||r===void 0?void 0:r.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}},{key:"window",get:function(){return this.options.window}},{key:"document",get:function(){return this.options.document}},{key:"rootElement",get:function(){return this.options.rootElement}},{key:"setup",value:function(){var r=this.rootElement;if(r!==void 0){if(r.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");r.__isReactDndBackendSetUp=!0,this.addEventListeners(r)}}},{key:"teardown",value:function(){var r=this.rootElement;if(r!==void 0&&(r.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}},{key:"connectDragPreview",value:function(r,n,o){var s=this;return this.sourcePreviewNodeOptions.set(r,o),this.sourcePreviewNodes.set(r,n),function(){s.sourcePreviewNodes.delete(r),s.sourcePreviewNodeOptions.delete(r)}}},{key:"connectDragSource",value:function(r,n,o){var s=this;this.sourceNodes.set(r,n),this.sourceNodeOptions.set(r,o);var a=function(d){return s.handleDragStart(d,r)},i=function(d){return s.handleSelectStart(d)};return n.setAttribute("draggable","true"),n.addEventListener("dragstart",a),n.addEventListener("selectstart",i),function(){s.sourceNodes.delete(r),s.sourceNodeOptions.delete(r),n.removeEventListener("dragstart",a),n.removeEventListener("selectstart",i),n.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(r,n){var o=this,s=function(d){return o.handleDragEnter(d,r)},a=function(d){return o.handleDragOver(d,r)},i=function(d){return o.handleDrop(d,r)};return n.addEventListener("dragenter",s),n.addEventListener("dragover",a),n.addEventListener("drop",i),function(){n.removeEventListener("dragenter",s),n.removeEventListener("dragover",a),n.removeEventListener("drop",i)}}},{key:"addEventListeners",value:function(r){r.addEventListener&&(r.addEventListener("dragstart",this.handleTopDragStart),r.addEventListener("dragstart",this.handleTopDragStartCapture,!0),r.addEventListener("dragend",this.handleTopDragEndCapture,!0),r.addEventListener("dragenter",this.handleTopDragEnter),r.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),r.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),r.addEventListener("dragover",this.handleTopDragOver),r.addEventListener("dragover",this.handleTopDragOverCapture,!0),r.addEventListener("drop",this.handleTopDrop),r.addEventListener("drop",this.handleTopDropCapture,!0))}},{key:"removeEventListeners",value:function(r){r.removeEventListener&&(r.removeEventListener("dragstart",this.handleTopDragStart),r.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),r.removeEventListener("dragend",this.handleTopDragEndCapture,!0),r.removeEventListener("dragenter",this.handleTopDragEnter),r.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),r.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),r.removeEventListener("dragover",this.handleTopDragOver),r.removeEventListener("dragover",this.handleTopDragOverCapture,!0),r.removeEventListener("drop",this.handleTopDrop),r.removeEventListener("drop",this.handleTopDropCapture,!0))}},{key:"getCurrentSourceNodeOptions",value:function(){var r=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(r);return Sh({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var r=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(r);return Sh({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}},{key:"isDraggingNativeItem",value:function(){var r=this.monitor.getItemType();return Object.keys(yh).some(function(n){return yh[n]===r})}},{key:"beginDragNativeItem",value:function(r,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=pT(r,n),this.currentNativeHandle=this.registry.addSource(r,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(r){var n=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=r;var o=1e3;this.mouseMoveTimeoutTimer=setTimeout(function(){var s;return(s=n.rootElement)===null||s===void 0?void 0:s.addEventListener("mousemove",n.endDragIfSourceWasRemovedFromDOM,!0)},o)}},{key:"clearCurrentDragSourceNode",value:function(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var r;(r=this.window)===null||r===void 0||r.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}},{key:"handleDragStart",value:function(r,n){r.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}},{key:"handleDragEnter",value:function(r,n){this.dragEnterTargetIds.unshift(n)}},{key:"handleDragOver",value:function(r,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}},{key:"handleDrop",value:function(r,n){this.dropTargetIds.unshift(n)}}]),e})(),Ca;function _T(){return Ca||(Ca=new Image,Ca.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),Ca}var TT=function(t,r,n){return new wT(t,r,n)};function ET(e,t){return typeof e=="function"?e(t):e??"NODE"}function AT(e){return e.isDraggable&&!e.isEditing}function kT(e){const t=$t(),r=t.selectedIds,[n,o,s]=I0(()=>({canDrag:()=>AT(e),type:ET(t.props.dragType,e),item:()=>{const a=t.isSelected(e.id)?Array.from(r):[e.id];return t.dispatch(Bn.dragStart(e.id,a)),{id:e.id,dragIds:a,data:e.data}},end:()=>{t.hideCursor(),t.redrawList(),t.dispatch(Bn.dragEnd())}}),[r,e,t.props.dragType]);return p.useEffect(()=>{s(_T())},[s]),o}function IT(e,t){const r=e.getBoundingClientRect(),n=t.x-Math.round(r.x),o=t.y-Math.round(r.y),s=r.height,a=o<s/2,i=!a,c=s/4,d=o>c&&o<s-c;return{x:n,inTopHalf:a,inBottomHalf:i,inMiddle:d,atTop:!d&&a,atBottom:!d&&i}}function DT(e,t,r,n){return e?e.isInternal?n.atTop?[t,e]:n.inMiddle?[e,e]:[e,r]:n.inTopHalf?[t,e]:[e,r]:[t,null]}function Sa(e,t){return{parentId:e||null,index:t}}function Hn(e,t){return{type:"line",index:e,level:t}}function LT(e){return{type:"highlight",id:e}}function yl(e,t){var r;let n=e;for(;n.parent&&n.level>t;)n=n.parent;const o=((r=n.parent)===null||r===void 0?void 0:r.id)||null,s=tf(n)+1;return{parentId:o,index:s}}function wh(e){var t;const r=IT(e.element,e.offset),n=e.indent,o=Math.round(Math.max(0,r.x-n)/n),{node:s,nextNode:a,prevNode:i}=e,[c,d]=DT(s,i,a,r);if(s&&s.isInternal&&r.inMiddle)return{drop:Sa(s.id,null),cursor:LT(s.id)};if(!c)return{drop:Sa((t=d==null?void 0:d.parent)===null||t===void 0?void 0:t.id,0),cursor:Hn(0,0)};if(Zu(c)){const u=na(o,(d==null?void 0:d.level)||0,c.level);return{drop:yl(c,u),cursor:Hn(c.rowIndex+1,u)}}if(Xu(c)){const u=na(o,(d==null?void 0:d.level)||0,c.level);return{drop:yl(c,u),cursor:Hn(c.rowIndex+1,u)}}if(Ju(c)){const u=na(o,0,c.level+1);return u>c.level?{drop:Sa(c.id,0),cursor:Hn(c.rowIndex+1,u)}:{drop:yl(c,u),cursor:Hn(c.rowIndex+1,u)}}return{drop:Sa(c==null?void 0:c.id,0),cursor:Hn(c.rowIndex+1,c.level+1)}}function OT(e,t){const r=$t(),[n,o]=ih(()=>({accept:"NODE",canDrop:()=>r.canDrop(),hover:(s,a)=>{const i=a.getClientOffset();if(!e.current||!i)return;const{cursor:c,drop:d}=wh({element:e.current,offset:i,indent:r.indent,node:t,prevNode:t.prev,nextNode:t.next});d&&r.dispatch(Bn.hovering(d.parentId,d.index)),a.canDrop()?c&&r.showCursor(c):r.hideCursor()},drop:(s,a)=>{if(!a.canDrop())return null;r.drop()}}),[t,e.current,r.props]);return o}function PT(e){const t=$t(),r=t.at(e);if(!r)throw new Error(`Could not find node for index: ${e}`);return p.useMemo(()=>{const n=r.clone();return t.visibleNodes[e]=n,n},[...Object.values(r.state),r])}const _h=p.memo(function({index:t,style:r}){Yu(),KS();const n=$t(),o=PT(t),s=p.useRef(null),a=kT(o),i=OT(s,o),c=p.useCallback(h=>{s.current=h,i(h)},[i]),d=n.indent*o.level,u=p.useMemo(()=>({paddingLeft:d}),[d]),f=p.useMemo(()=>{var h,v;return Object.assign(Object.assign({},r),{top:parseFloat(r.top)+((v=(h=n.props.padding)!==null&&h!==void 0?h:n.props.paddingTop)!==null&&v!==void 0?v:0),minWidth:"max-content"})},[r,n.props.padding,n.props.paddingTop]),m={role:"treeitem","aria-level":o.level+1,"aria-selected":o.isSelected,"aria-expanded":o.isOpen,style:f,tabIndex:-1,className:n.props.rowClassName};p.useEffect(()=>{var h;!o.isEditing&&o.isFocused&&((h=s.current)===null||h===void 0||h.focus({preventScroll:!0}))},[o.isEditing,o.isFocused,s.current]);const g=n.renderNode,b=n.renderRow;return l.jsx(b,{node:o,innerRef:c,attrs:m,children:l.jsx(g,{node:o,tree:n,style:u,dragHandle:a})})});let bl="",Th=null;function Eh(){Yu();const e=$t();return l.jsx("div",{role:"tree","aria-label":e.props["aria-label"],"aria-labelledby":e.props["aria-labelledby"],"aria-multiselectable":!e.props.disableMultiSelection||void 0,style:{height:e.height,width:e.width,minHeight:0,minWidth:0},onContextMenu:e.props.onContextMenu,onClick:e.props.onClick,tabIndex:0,onFocus:t=>{t.currentTarget.contains(t.relatedTarget)||e.onFocus()},onBlur:t=>{t.currentTarget.contains(t.relatedTarget)||e.onBlur()},onKeyDown:t=>{var r;if(e.isEditing)return;if(t.key==="Backspace"){if(!e.props.onDelete)return;const o=Array.from(e.selectedIds);if(o.length>1){let s=e.mostRecentNode;for(;s&&s.isSelected;)s=s.nextSibling;s||(s=e.lastNode),e.focus(s,{scroll:!1}),e.delete(Array.from(o))}else{const s=e.focusedNode;if(s){const a=s.nextSibling,i=s.parent;e.focus(a||i,{scroll:!1}),e.delete(s)}}return}if(t.key==="Tab"&&!t.shiftKey){t.preventDefault(),rf(t.currentTarget);return}if(t.key==="Tab"&&t.shiftKey){t.preventDefault(),nf(t.currentTarget);return}if(t.key==="ArrowDown"){t.preventDefault();const o=e.nextNode;if(t.metaKey){e.select(e.focusedNode),e.activate(e.focusedNode);return}else if(!t.shiftKey||e.props.disableMultiSelection){e.focus(o);return}else{if(!o)return;const s=e.focusedNode;s?s.isSelected?e.selectContiguous(o):e.selectMulti(o):e.focus(e.firstNode);return}}if(t.key==="ArrowUp"){t.preventDefault();const o=e.prevNode;if(!t.shiftKey||e.props.disableMultiSelection){e.focus(o);return}else{if(!o)return;const s=e.focusedNode;s?s.isSelected?e.selectContiguous(o):e.selectMulti(o):e.focus(e.lastNode);return}}if(t.key==="ArrowRight"){const o=e.focusedNode;if(!o)return;o.isInternal&&o.isOpen?e.focus(e.nextNode):o.isInternal&&e.open(o.id);return}if(t.key==="ArrowLeft"){const o=e.focusedNode;if(!o||o.isRoot)return;o.isInternal&&o.isOpen?e.close(o.id):!((r=o.parent)===null||r===void 0)&&r.isRoot||e.focus(o.parent);return}if(t.key==="a"&&(t.metaKey||t.ctrlKey)&&!e.props.disableMultiSelection){t.preventDefault(),e.selectAll();return}if(t.key==="a"&&!t.metaKey&&!t.ctrlKey&&e.props.onCreate){e.createLeaf();return}if(t.key==="A"&&!t.metaKey&&!t.ctrlKey){if(!e.props.onCreate)return;e.createInternal();return}if(t.key==="Home"){t.preventDefault(),e.focus(e.firstNode);return}if(t.key==="End"){t.preventDefault(),e.focus(e.lastNode);return}if(t.key==="Enter"){const o=e.focusedNode;if(!o||!o.isEditable||!e.props.onRename)return;setTimeout(()=>{o&&e.edit(o)});return}if(t.key===" "){t.preventDefault();const o=e.focusedNode;if(!o)return;o.isLeaf?(o.select(),o.activate()):o.toggle();return}if(t.key==="*"){const o=e.focusedNode;if(!o)return;e.openSiblings(o);return}if(t.key==="PageUp"){t.preventDefault(),e.pageUp();return}t.key==="PageDown"&&(t.preventDefault(),e.pageDown()),clearTimeout(Th),bl+=t.key,Th=setTimeout(()=>{bl=""},600);const n=e.visibleNodes.find(o=>{const s=o.data.name;return typeof s=="string"?s.toLowerCase().startsWith(bl):!1});n&&e.focus(n.id)},children:l.jsx(NT,{})})}function NT(){var e,t;const r=$t(),n={className:r.props.className,outerRef:r.listEl,itemCount:r.visibleNodes.length,height:r.height,width:r.width,overscanCount:r.overscanCount,itemKey:o=>{var s;return((s=r.visibleNodes[o])===null||s===void 0?void 0:s.id)||o},outerElementType:(e=r.props.outerElementType)!==null&&e!==void 0?e:$w,innerElementType:(t=r.props.innerElementType)!==null&&t!==void 0?t:jw,onScroll:r.props.onScroll,onItemsRendered:r.onItemsRendered.bind(r)};return typeof r.props.rowHeight=="function"?l.jsx(Nw,Object.assign({},n,{itemSize:r.rowHeightAt,ref:r.list,children:_h})):l.jsx(xw,Object.assign({},n,{itemSize:r.rowHeight,ref:r.list,children:_h}))}function Ah(e){return e.isFiltered?FT(e.root,e.isMatch.bind(e)):xT(e.root)}function xT(e){const t=[];function r(n){var o;n.level>=0&&t.push(n),n.isOpen&&((o=n.children)===null||o===void 0||o.forEach(r))}return r(e),t.forEach(kh),t}function FT(e,t){const r={},n=[];function o(a){if(!a.isRoot&&t(a)){r[a.id]=!0;let c=a.parent;for(;c;)r[c.id]=!0,c=c.parent}if(a.children)for(let c of a.children)o(c)}function s(a){var i;a.level>=0&&r[a.id]&&n.push(a),a.isOpen&&((i=a.children)===null||i===void 0||i.forEach(s))}return o(e),s(e),n.forEach(kh),n}function kh(e,t){e.rowIndex=t}const Ih=e=>e.reduce((t,r,n)=>(t[r.id]=n,t),{});var Cl=function(e,t,r,n){function o(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function i(u){try{d(n.next(u))}catch(f){a(f)}}function c(u){try{d(n.throw(u))}catch(f){a(f)}}function d(u){u.done?s(u.value):o(u.value).then(i,c)}d((n=n.apply(e,t||[])).next())})};const{safeRun:Et}=ew;class zo{constructor(t,r,n,o){this.store=t,this.props=r,this.list=n,this.listEl=o,this.visibleStartIndex=0,this.visibleStopIndex=0,this.rowOffsets=null,this.rowHeightAt=s=>{const a=this.props.rowHeight;if(typeof a=="function"){const i=this.at(s);return i?a(i):this.rowHeight}return a??24},this.rowTopPosition=s=>{if(typeof this.props.rowHeight!="function")return s*this.rowHeight;const a=this.getRowOffsets(),i=Math.max(0,Math.min(s,a.length-1));return a[i]},this.redrawList=(s=0)=>{this.rowOffsets=null;const a=this.list.current;a&&"resetAfterIndex"in a&&a.resetAfterIndex(Math.max(0,s))},this.root=cf(this),this.visibleNodes=Ah(this),this.idToIndex=Ih(this.visibleNodes)}update(t){this.props=t,this.root=cf(this),this.visibleNodes=Ah(this),this.idToIndex=Ih(this.visibleNodes),this.rowOffsets=null;const r=this.list.current;r&&"resetAfterIndex"in r&&r.resetAfterIndex(0,!1)}dispatch(t){return this.store.dispatch(t)}get state(){return this.store.getState()}get openState(){return this.state.nodes.open.unfiltered}get width(){var t;return(t=this.props.width)!==null&&t!==void 0?t:300}get height(){var t;return(t=this.props.height)!==null&&t!==void 0?t:500}get indent(){var t;return(t=this.props.indent)!==null&&t!==void 0?t:24}get rowHeight(){return typeof this.props.rowHeight=="number"?this.props.rowHeight:24}getRowOffsets(){if(this.rowOffsets)return this.rowOffsets;const t=[0];for(let r=0;r<this.visibleNodes.length;r++)t.push(t[r]+this.rowHeightAt(r));return this.rowOffsets=t,t}get overscanCount(){var t;return(t=this.props.overscanCount)!==null&&t!==void 0?t:1}get searchTerm(){return(this.props.searchTerm||"").trim()}get matchFn(){var t;const r=(t=this.props.searchMatch)!==null&&t!==void 0?t:((n,o)=>JSON.stringify(Object.values(n.data)).toLocaleLowerCase().includes(o.toLocaleLowerCase()));return n=>r(n,this.searchTerm)}accessChildren(t){var r;const n=this.props.childrenAccessor||"children";return(r=$o(t,n))!==null&&r!==void 0?r:null}accessId(t){const r=this.props.idAccessor||"id",n=$o(t,r);if(!n)throw new Error("Data must contain an 'id' property or props.idAccessor must return a string");return n}identify(t){if(typeof t=="string")return t;if(t instanceof qo)return t.id;const r=this.props.idAccessor||"id";return $o(t,r)}identifyNull(t){return t==null?null:this.identify(t)}get firstNode(){var t;return(t=this.visibleNodes[0])!==null&&t!==void 0?t:null}get lastNode(){var t;return(t=this.visibleNodes[this.visibleNodes.length-1])!==null&&t!==void 0?t:null}get focusedNode(){var t;return(t=this.get(this.state.nodes.focus.id))!==null&&t!==void 0?t:null}get mostRecentNode(){var t;return(t=this.get(this.state.nodes.selection.mostRecent))!==null&&t!==void 0?t:null}get nextNode(){const t=this.indexOf(this.focusedNode);return t===null?null:this.at(t+1)}get prevNode(){const t=this.indexOf(this.focusedNode);return t===null?null:this.at(t-1)}get(t){return t&&t in this.idToIndex&&this.visibleNodes[this.idToIndex[t]]||null}at(t){return this.visibleNodes[t]||null}nodesBetween(t,r){var n;if(t===null||r===null)return[];const o=(n=this.indexOf(t))!==null&&n!==void 0?n:0,s=this.indexOf(r);if(s===null)return[];const a=Math.min(o,s),i=Math.max(o,s);return this.visibleNodes.slice(a,i+1)}indexOf(t){const r=this.identifyNull(t);return r?this.idToIndex[r]:null}get editingId(){return this.state.nodes.edit.id}createInternal(){return this.create({type:"internal"})}createLeaf(){return this.create({type:"leaf"})}create(){return Cl(this,arguments,void 0,function*(t={}){var r,n;const o=t.parentId===void 0?lf(this):t.parentId,s=(r=t.index)!==null&&r!==void 0?r:af(this),a=(n=t.type)!==null&&n!==void 0?n:"leaf",i=yield Et(this.props.onCreate,{type:a,parentId:o,index:s,parentNode:this.get(o)});i&&(this.focus(i),setTimeout(()=>{this.edit(i).then(()=>{this.select(i),this.activate(i)})}))})}delete(t){return Cl(this,void 0,void 0,function*(){if(!t)return;const n=(Array.isArray(t)?t:[t]).map(a=>this.identify(a)),o=n.map(a=>this.get(a)).filter(a=>!!a),s=o.length?Math.min(...o.map(a=>{var i;return(i=a.rowIndex)!==null&&i!==void 0?i:0})):0;yield Et(this.props.onDelete,{nodes:o,ids:n}),this.redrawList(s)})}edit(t){var r,n;const o=this.identify(t);return this.resolveEdit({cancelled:!0}),this.scrollTo(o),this.dispatch(Wi(o)),this.redrawList((n=(r=this.get(o))===null||r===void 0?void 0:r.rowIndex)!==null&&n!==void 0?n:0),new Promise(s=>{zo.editPromise=s})}submit(t,r){return Cl(this,void 0,void 0,function*(){var n,o;if(!t)return;const s=this.identify(t);yield Et(this.props.onRename,{id:s,name:r,node:this.get(s)}),this.dispatch(Wi(null)),this.resolveEdit({cancelled:!1,value:r}),this.redrawList((o=(n=this.get(s))===null||n===void 0?void 0:n.rowIndex)!==null&&o!==void 0?o:0),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(Wi(null)),this.resolveEdit({cancelled:!0}),this.redrawList(),setTimeout(()=>this.onFocus())}activate(t){const r=this.get(this.identifyNull(t));r&&Et(this.props.onActivate,r)}resolveEdit(t){const r=zo.editPromise;r&&r(t),zo.editPromise=null}get selectedIds(){return this.state.nodes.selection.ids}get selectedNodes(){let t=[];for(let r of Array.from(this.selectedIds)){const n=this.get(r);n&&t.push(n)}return t}focus(t,r={}){t&&(this.props.selectionFollowsFocus?this.select(t):(this.dispatch(Mn(this.identify(t))),r.scroll!==!1&&this.scrollTo(t),this.focusedNode&&Et(this.props.onFocus,this.focusedNode)))}pageUp(){var t,r;const n=this.visibleStartIndex,s=this.visibleStopIndex-n;let a=(r=(t=this.focusedNode)===null||t===void 0?void 0:t.rowIndex)!==null&&r!==void 0?r:0;a>n?a=n:a=Math.max(n-s,0),this.focus(this.at(a))}pageDown(){var t,r;const n=this.visibleStartIndex,o=this.visibleStopIndex,s=o-n;let a=(r=(t=this.focusedNode)===null||t===void 0?void 0:t.rowIndex)!==null&&r!==void 0?r:0;a<o?a=o:a=Math.min(a+s,this.visibleNodes.length-1),this.focus(this.at(a))}select(t,r={}){var n;if(!t)return;const o=r.focus!==!1,s=this.identify(t);o&&this.dispatch(Mn(s)),!((n=this.get(s))===null||n===void 0)&&n.isSelectable&&this.setSelection({ids:[s],anchor:s,mostRecent:s}),this.scrollTo(s,r.align),this.focusedNode&&o&&Et(this.props.onFocus,this.focusedNode)}deselect(t){if(!t)return;const r=this.identify(t);this.dispatch(Fr.remove(r)),Et(this.props.onSelect,this.selectedNodes)}selectMulti(t,r={}){const n=this.get(this.identifyNull(t));if(!n)return;const o=r.focus!==!1;o&&this.dispatch(Mn(n.id)),n.isSelectable&&(this.dispatch(Fr.add(n.id)),this.dispatch(Fr.anchor(n.id)),this.dispatch(Fr.mostRecent(n.id))),this.scrollTo(n,r.align),this.focusedNode&&o&&Et(this.props.onFocus,this.focusedNode),Et(this.props.onSelect,this.selectedNodes)}selectContiguous(t){var r;if(!t)return;const n=this.identify(t);if(this.dispatch(Mn(n)),!((r=this.get(n))===null||r===void 0)&&r.isSelectable){const{anchor:o,mostRecent:s}=this.state.nodes.selection,a=this.filterSelectableNodes(this.nodesBetween(o,this.identifyNull(n)));this.dispatch(Fr.remove(this.nodesBetween(o,s))),this.dispatch(Fr.add(a)),this.dispatch(Fr.mostRecent(n))}this.scrollTo(n),this.focusedNode&&Et(this.props.onFocus,this.focusedNode),Et(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null})}selectAll(){var t,r,n;const o=this.filterSelectableNodes(Object.keys(this.idToIndex));this.setSelection({ids:o,anchor:(t=o[0])!==null&&t!==void 0?t:null,mostRecent:(r=o[o.length-1])!==null&&r!==void 0?r:null}),this.dispatch(Mn((n=this.lastNode)===null||n===void 0?void 0:n.id)),this.focusedNode&&Et(this.props.onFocus,this.focusedNode)}filterSelectableNodes(t){return t.map(r=>this.get(this.identify(r))).filter(r=>!!r&&r.isSelectable)}setSelection(t){var r;const n=new Set((r=t.ids)===null||r===void 0?void 0:r.map(a=>this.identify(a))),o=this.identifyNull(t.anchor),s=this.identifyNull(t.mostRecent);this.dispatch(Fr.set({ids:n,anchor:o,mostRecent:s})),Et(this.props.onSelect,this.selectedNodes)}get cursorParentId(){const{cursor:t}=this.state.dnd;switch(t.type){case"highlight":return t.id;default:return null}}get cursorOverFolder(){return this.state.dnd.cursor.type==="highlight"}get dragNodes(){return this.state.dnd.dragIds.map(t=>this.get(t)).filter(t=>!!t)}get dragNode(){return this.get(this.state.nodes.drag.id)}get dragDestinationParent(){return this.get(this.state.nodes.drag.destinationParentId)}get dragDestinationIndex(){return this.state.nodes.drag.destinationIndex}canDrop(){var t;if(this.isFiltered)return!1;const r=(t=this.get(this.state.dnd.parentId))!==null&&t!==void 0?t:this.root,n=this.dragNodes,o=this.props.disableDrop;for(const s of n)if(!s||!r||s.isInternal&&ef(r,s))return!1;return typeof o=="function"?!o({parentNode:r,dragNodes:this.dragNodes,index:this.state.dnd.index||0}):typeof o=="string"?!r.data[o]:typeof o=="boolean"?!o:!0}drop(){const{parentId:t,index:r,dragIds:n}=this.state.dnd;Et(this.props.onMove,{dragIds:n,parentId:t===Bo?null:t,index:r===null?0:r,dragNodes:this.dragNodes,parentNode:this.get(t)}),this.open(t)}hideCursor(){this.dispatch(Bn.cursor({type:"none"}))}showCursor(t){this.dispatch(Bn.cursor(t))}open(t,r=!0){var n,o;const s=this.identifyNull(t);s&&(this.isOpen(s)||(this.dispatch(Ri.open(s,this.isFiltered)),r&&this.redrawList((o=(n=this.get(s))===null||n===void 0?void 0:n.rowIndex)!==null&&o!==void 0?o:0),Et(this.props.onToggle,s)))}close(t,r=!0){var n,o;const s=this.identifyNull(t);s&&this.isOpen(s)&&(this.dispatch(Ri.close(s,this.isFiltered)),r&&this.redrawList((o=(n=this.get(s))===null||n===void 0?void 0:n.rowIndex)!==null&&o!==void 0?o:0),Et(this.props.onToggle,s))}toggle(t){const r=this.identifyNull(t);if(r)return this.isOpen(r)?this.close(r):this.open(r)}openParents(t){const r=this.identifyNull(t);if(!r)return;const n=Qi(this.root,r);let o=n==null?void 0:n.parent;for(;o;)this.open(o.id,!1),o=o.parent;this.redrawList()}openSiblings(t){const r=t.parent;if(!r)this.toggle(t.id);else if(r.children){const n=t.isOpen;for(let o of r.children)o.isInternal&&(n?this.close(o.id,!1):this.open(o.id,!1));this.redrawList(),this.scrollTo(this.focusedNode)}}openAll(){oa(this.root,t=>{t.isInternal&&this.open(t.id,!1)}),this.redrawList()}closeAll(){oa(this.root,t=>{t.isInternal&&this.close(t.id,!1)}),this.redrawList()}scrollTo(t,r="smart"){if(!t)return;const n=this.identify(t);return this.openParents(n),sf(()=>n in this.idToIndex).then(()=>{var o;const s=this.idToIndex[n];s!==void 0&&((o=this.list.current)===null||o===void 0||o.scrollToItem(s,r))}).catch(()=>{})}get isEditing(){return this.state.nodes.edit.id!==null}get isFiltered(){var t;return!!(!((t=this.props.searchTerm)===null||t===void 0)&&t.trim())}get hasFocus(){return this.state.nodes.focus.treeFocused}get hasNoSelection(){return this.state.nodes.selection.ids.size===0}get hasOneSelection(){return this.state.nodes.selection.ids.size===1}get hasMultipleSelections(){return this.state.nodes.selection.ids.size>1}isSelected(t){return t?this.state.nodes.selection.ids.has(t):!1}isOpen(t){var r,n,o;if(!t)return!1;if(t===Bo)return!0;const s=(r=this.props.openByDefault)!==null&&r!==void 0?r:!0;return this.isFiltered?(n=this.state.nodes.open.filtered[t])!==null&&n!==void 0?n:!0:(o=this.state.nodes.open.unfiltered[t])!==null&&o!==void 0?o:s}isEditable(t){return this.isActionPossible(t,this.props.disableEdit)}isDraggable(t){return this.isActionPossible(t,this.props.disableDrag)}isSelectable(t){return this.isActionPossible(t,this.props.disableSelect)}isActionPossible(t,r=()=>!1){return!$o(t,r)}isDragging(t){const r=this.identifyNull(t);return r?this.state.nodes.drag.id===r:!1}isFocused(t){return this.hasFocus&&this.state.nodes.focus.id===t}isMatch(t){return this.matchFn(t)}willReceiveDrop(t){const r=this.identifyNull(t);if(!r)return!1;const{destinationParentId:n,destinationIndex:o}=this.state.nodes.drag;return r===n&&o===null}onFocus(){const t=this.focusedNode||this.firstNode;t&&this.dispatch(Mn(t.id))}onBlur(){this.dispatch(dw())}onItemsRendered(t){this.visibleStartIndex=t.visibleStartIndex,this.visibleStopIndex=t.visibleStopIndex}get renderContainer(){return this.props.renderContainer||Eh}get renderRow(){return this.props.renderRow||sw}get renderNode(){return this.props.children||aw}get renderDragPreview(){return this.props.renderDragPreview||uf}get renderCursor(){return this.props.renderCursor||ow}}function At(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var MT=typeof Symbol=="function"&&Symbol.observable||"@@observable",Dh=MT,Sl=()=>Math.random().toString(36).substring(7).split("").join("."),$T={INIT:`@@redux/INIT${Sl()}`,REPLACE:`@@redux/REPLACE${Sl()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Sl()}`},sn=$T;function Lh(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function BT(e){if(e===void 0)return"undefined";if(e===null)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(UT(e))return"date";if(jT(e))return"error";const r=qT(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function qT(e){return typeof e.constructor=="function"?e.constructor.name:null}function jT(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function UT(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Mr(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=BT(e)),t}function Oh(e,t,r){if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?At(2):`Expected the root reducer to be a function. Instead, received: '${Mr(e)}'`);if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?At(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?At(1):`Expected the enhancer to be a function. Instead, received: '${Mr(r)}'`);return r(Oh)(e,t)}let n=e,o=t,s=new Map,a=s,i=0,c=!1;function d(){a===s&&(a=new Map,s.forEach((v,y)=>{a.set(y,v)}))}function u(){if(c)throw new Error(process.env.NODE_ENV==="production"?At(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return o}function f(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?At(4):`Expected the listener to be a function. Instead, received: '${Mr(v)}'`);if(c)throw new Error(process.env.NODE_ENV==="production"?At(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let y=!0;d();const C=i++;return a.set(C,v),function(){if(y){if(c)throw new Error(process.env.NODE_ENV==="production"?At(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");y=!1,d(),a.delete(C),s=null}}}function m(v){if(!Lh(v))throw new Error(process.env.NODE_ENV==="production"?At(7):`Actions must be plain objects. Instead, the actual type was: '${Mr(v)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(typeof v.type>"u")throw new Error(process.env.NODE_ENV==="production"?At(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(typeof v.type!="string")throw new Error(process.env.NODE_ENV==="production"?At(17):`Action "type" property must be a string. Instead, the actual type was: '${Mr(v.type)}'. Value was: '${v.type}' (stringified)`);if(c)throw new Error(process.env.NODE_ENV==="production"?At(9):"Reducers may not dispatch actions.");try{c=!0,o=n(o,v)}finally{c=!1}return(s=a).forEach(C=>{C()}),v}function g(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?At(10):`Expected the nextReducer to be a function. Instead, received: '${Mr(v)}`);n=v,m({type:sn.REPLACE})}function b(){const v=f;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(process.env.NODE_ENV==="production"?At(11):`Expected the observer to be an object. Instead, received: '${Mr(y)}'`);function C(){const w=y;w.next&&w.next(u())}return C(),{unsubscribe:v(C)}},[Dh](){return this}}}return m({type:sn.INIT}),{dispatch:m,subscribe:f,getState:u,replaceReducer:g,[Dh]:b}}function Ph(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function zT(e,t,r,n){const o=Object.keys(t),s=r&&r.type===sn.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(o.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!Lh(e))return`The ${s} has unexpected type of "${Mr(e)}". Expected argument to be an object with the following keys: "${o.join('", "')}"`;const a=Object.keys(e).filter(i=>!t.hasOwnProperty(i)&&!n[i]);if(a.forEach(i=>{n[i]=!0}),!(r&&r.type===sn.REPLACE)&&a.length>0)return`Unexpected ${a.length>1?"keys":"key"} "${a.join('", "')}" found in ${s}. Expected to find one of the known reducer keys instead: "${o.join('", "')}". Unexpected keys will be ignored.`}function VT(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:sn.INIT})>"u")throw new Error(process.env.NODE_ENV==="production"?At(12):`The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof r(void 0,{type:sn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?At(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${sn.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)})}function Nh(e){const t=Object.keys(e),r={};for(let a=0;a<t.length;a++){const i=t[a];process.env.NODE_ENV!=="production"&&typeof e[i]>"u"&&Ph(`No reducer provided for key "${i}"`),typeof e[i]=="function"&&(r[i]=e[i])}const n=Object.keys(r);let o;process.env.NODE_ENV!=="production"&&(o={});let s;try{VT(r)}catch(a){s=a}return function(i={},c){if(s)throw s;if(process.env.NODE_ENV!=="production"){const f=zT(i,r,c,o);f&&Ph(f)}let d=!1;const u={};for(let f=0;f<n.length;f++){const m=n[f],g=r[m],b=i[m],h=g(b,c);if(typeof h>"u"){const v=c&&c.type;throw new Error(process.env.NODE_ENV==="production"?At(14):`When called with an action of type ${v?`"${String(v)}"`:"(unknown type)"}, the slice reducer for key "${m}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}u[m]=h,d=d||h!==b}return d=d||n.length!==Object.keys(i).length,d?u:i}}function HT(e=$n().nodes.drag,t){switch(t.type){case"DND_DRAG_START":return Object.assign(Object.assign({},e),{id:t.id,selectedIds:t.dragIds});case"DND_DRAG_END":return Object.assign(Object.assign({},e),{id:null,destinationParentId:null,destinationIndex:null,selectedIds:[]});case"DND_HOVERING":return t.parentId!==e.destinationParentId||t.index!=e.destinationIndex?Object.assign(Object.assign({},e),{destinationParentId:t.parentId,destinationIndex:t.index}):e;default:return e}}const QT=Nh({nodes:Nh({focus:uw,edit:cw,open:fw,selection:hw,drag:HT}),dnd:pw}),WT=$n();function RT({treeProps:e,imperativeHandle:t,children:r}){const n=p.useRef(null),o=p.useRef(null),s=p.useRef(Oh(QT,$n(e))),a=GS.useSyncExternalStore(s.current.subscribe,s.current.getState,()=>WT),i=p.useMemo(()=>new zo(s.current,e,n,o),[]),c=p.useRef(0);return p.useMemo(()=>{c.current+=1,i.update(e)},Object.values(e)),p.useMemo(()=>{c.current+=1,i.update(i.props)},[a.nodes.open]),p.useImperativeHandle(t,()=>i),p.useEffect(()=>{i.props.selection?i.select(i.props.selection,{focus:!1}):i.deselectAll()},[i.props.selection]),p.useEffect(()=>{i.props.searchTerm||s.current.dispatch(Ri.clear(!0))},[i.props.searchTerm]),l.jsx(Wu.Provider,{value:i,children:l.jsx(Ku.Provider,{value:c.current,children:l.jsx(Ru.Provider,{value:a.nodes,children:l.jsx(Gu.Provider,{value:a.dnd,children:l.jsx(_1,Object.assign({},e.dndManager?{manager:e.dndManager}:{backend:e.dndBackend||TT,options:{rootElement:i.props.dndRootElement||void 0}},{children:r}))})})})})}function GT(){const e=$t(),[,t]=ih(()=>({accept:"NODE",canDrop:(r,n)=>n.isOver({shallow:!0})?e.canDrop():!1,hover:(r,n)=>{if(!n.isOver({shallow:!0}))return;const o=n.getClientOffset();if(!e.listEl.current||!o)return;const{cursor:s,drop:a}=wh({element:e.listEl.current,offset:o,indent:e.indent,node:null,prevNode:e.visibleNodes[e.visibleNodes.length-1],nextNode:null});a&&e.dispatch(Bn.hovering(a.parentId,a.index)),n.canDrop()?s&&e.showCursor(s):e.hideCursor()},drop:(r,n)=>{if(!n.isOver({shallow:!0})||!n.canDrop())return null;e.drop()}}),[e]);t(e.listEl)}function KT(e){return GT(),e.children}function YT(){const t=$t().props.renderContainer||Eh;return l.jsx(l.Fragment,{children:l.jsx(t,{})})}function ZT(){const e=$t(),{offset:t,mouse:r,item:n,isDragging:o}=K0(a=>({offset:a.getSourceClientOffset(),mouse:a.getClientOffset(),item:a.getItem(),isDragging:a.isDragging()})),s=e.props.renderDragPreview||uf;return l.jsx(s,{offset:t,mouse:r,id:(n==null?void 0:n.id)||null,dragIds:(n==null?void 0:n.dragIds)||[],isDragging:o})}function XT(e={}){var t,r;const n=(t=e.idAccessor)!==null&&t!==void 0?t:"id",o=(r=e.childrenAccessor)!==null&&r!==void 0?r:"children";return{getId:typeof n=="function"?n:s=>s[n],getChildren:typeof o=="function"?o:s=>s[o],childrenKey:typeof o=="string"?o:"children"}}class JT{constructor(t,r={}){this.accessors=XT(r),this.root=eE(t,this.accessors)}get data(){var t,r;return(r=(t=this.root.children)===null||t===void 0?void 0:t.map(n=>n.data))!==null&&r!==void 0?r:[]}create(t){const r=t.parentId?this.find(t.parentId):this.root;if(!r)return null;r.addChild(t.data,t.index)}move(t){const r=this.find(t.id),n=t.parentId?this.find(t.parentId):this.root;!r||!n||(n.addChild(r.data,t.index),r.drop())}update(t){const r=this.find(t.id);r&&r.update(t.changes)}drop(t){const r=this.find(t.id);r&&r.drop()}find(t,r=this.root){if(!r)return null;if(r.id===t)return r;if(r.children){for(let n of r.children){const o=this.find(t,n);if(o)return o}return null}return null}}function eE(e,t){const r=new xh({},null,t,"ROOT");return r.children=e.map(n=>wl(n,r,t)),r}function wl(e,t,r){const n=new xh(e,t,r),o=r.getChildren(e);return o&&(n.children=o.map(s=>wl(s,n,r))),n}class xh{constructor(t,r,n,o){this.data=t,this.parent=r,this.accessors=n,this.id=o??n.getId(t)}hasParent(){return!!this.parent}get childIndex(){return this.hasParent()?this.parent.children.indexOf(this):-1}addChild(t,r){var n,o;const s=wl(t,this,this.accessors);this.children=(n=this.children)!==null&&n!==void 0?n:[],this.children.splice(r,0,s);const a=this.accessors.childrenKey,i=this.data;i[a]=(o=i[a])!==null&&o!==void 0?o:[],i[a].splice(r,0,t)}removeChild(t){var r,n;(r=this.children)===null||r===void 0||r.splice(t,1),(n=this.data[this.accessors.childrenKey])===null||n===void 0||n.splice(t,1)}update(t){if(this.hasParent()){const r=this.childIndex;this.parent.addChild(Object.assign(Object.assign({},this.data),t),r),this.drop()}}drop(){this.hasParent()&&this.parent.removeChild(this.childIndex)}}let tE=0;function rE(e,t={}){const[r,n]=p.useState(e),o=t.idAccessor,s=t.childrenAccessor,a=p.useMemo(()=>new JT(r,{idAccessor:o,childrenAccessor:s}),[r,o,s]),i=b=>{for(const h of b.dragIds)a.move({id:h,parentId:b.parentId,index:b.index});n(a.data)},c=({name:b,id:h})=>{a.update({id:h,changes:{name:b}}),n(a.data)},d=typeof o=="string"?o:"id",u=typeof s=="string"?s:"children";return[r,{onMove:i,onRename:c,onCreate:({parentId:b,index:h,type:v})=>{if(typeof o=="function")throw new Error("React Arborist => initialData can't create nodes when idAccessor is a function: the generated id can't be written under a key the accessor reads. Use a string idAccessor, or the controlled `data` prop with your own onCreate.");if(v==="internal"&&typeof s=="function")throw new Error("React Arborist => initialData can't create folder nodes when childrenAccessor is a function: the new children array can't be written under a key the accessor reads. Use a string childrenAccessor, or the controlled `data` prop with your own onCreate.");const y={[d]:`simple-tree-id-${tE++}`,name:""};return v==="internal"&&(y[u]=[]),a.create({parentId:b,index:h,data:y}),n(a.data),y},onDelete:b=>{b.ids.forEach(h=>a.drop({id:h})),n(a.data)}}]}function nE(e){if(e.initialData&&e.data)throw new Error("React Arborist Tree => Provide either a data or initialData prop, but not both.");if(e.initialData&&(e.onCreate||e.onDelete||e.onMove||e.onRename))throw new Error(`React Arborist Tree => You passed the initialData prop along with a data handler.
546
- Use the data prop if you want to provide your own handlers.`);if(e.initialData){const[t,r]=rE(e.initialData,{idAccessor:e.idAccessor,childrenAccessor:e.childrenAccessor});return Object.assign(Object.assign(Object.assign({},e),r),{data:t})}else return e}function oE(e,t){const r=nE(e);return l.jsxs(RT,{treeProps:r,imperativeHandle:t,children:[l.jsx(KT,{children:l.jsx(YT,{})}),l.jsx(ZT,{})]})}const sE=p.forwardRef(oE);function _l(){return ae(e=>{var n;const t=e.treeData[0];return(((n=t==null?void 0:t.metadata)==null?void 0:n.status)??(t==null?void 0:t.status)??"Draft").toLowerCase()==="draft"})}function aE(){return ae(e=>{var o;if(!e.selectedNodeId)return!1;const t=(o=e.treeData[0])==null?void 0:o.id,r=s=>{var a;for(const i of s){if(i.id===e.selectedNodeId)return i;if((a=i.children)!=null&&a.length){const c=r(i.children);if(c)return c}}},n=r(e.treeData);return!!(n!=null&&n.isFolder)&&n.id!==t})}const Fh={video:"#EA580C",pdf:"#DC2626",h5p:"#0D9488",scorm:"#7C3AED",audio:"#DB2777",quiz:"#16A34A",course:"#A85236",default:"#6B7280"},Mh={video:"Video",pdf:"FileText",h5p:"Layers",scorm:"Package",audio:"Music",quiz:"HelpCircle",course:"BookOpen",default:"File"},$h=["Course Assessment","eTextbook","Exam Question","Explanation Content","Learning Resource","Practice Question Set","SCORM Content","Teacher Resource"],iE=[{label:"All",value:"all"},{label:"Course Assessment",value:"Course Assessment"},{label:"eTextbook",value:"eTextbook"},{label:"Exam Question",value:"Exam Question"},{label:"Explanation Content",value:"Explanation Content"},{label:"Learning Resource",value:"Learning Resource"},{label:"Practice Question Set",value:"Practice Question Set"},{label:"SCORM Content",value:"SCORM Content"},{label:"Teacher Resource",value:"Teacher Resource"}];function lE(e){var r;if((r=e.metadata)!=null&&r.isAssessmentCourse)return"quiz";const t=[e.mimeType??"",e.primaryCategory??"",e.contentType??""].join(" ").toLowerCase();return t.includes("video")?"video":t.includes("pdf")||t.includes("epub")?"pdf":t.includes("h5p")?"h5p":t.includes("scorm")?"scorm":t.includes("audio")||t.includes("mp3")?"audio":t.includes("quiz")||t.includes("question")||t.includes("ecml")?"quiz":e.primaryCategory==="Course"?"course":"default"}function Vo(e){const t=lE(e);return{key:t,color:Fh[t]??Fh.default,bgClass:`sbx-ct-sq--${t}`,badgeClass:`sbx-ct-badge--${t}`,tintClass:`sbx-ct-tint--${t}`,iconName:Mh[t]??Mh.default,label:t.charAt(0).toUpperCase()+t.slice(1)}}const ct={row:"_row_nm332_1",grip:"_grip_nm332_16",menuBtn:"_menuBtn_nm332_19",rowLp:"_rowLp_nm332_23",selected:"_selected_nm332_27",title:"_title_nm332_32",dropTarget:"_dropTarget_nm332_41",toggle:"_toggle_nm332_58",ctIcon:"_ctIcon_nm332_73",ctIconLp:"_ctIconLp_nm332_85",folderIcon:"_folderIcon_nm332_89",rootIcon:"_rootIcon_nm332_94",titleLp:"_titleLp_nm332_110",levelTitle:"_levelTitle_nm332_114",renameInput:"_renameInput_nm332_119",dropHere:"_dropHere_nm332_128",menuWrap:"_menuWrap_nm332_138",menu:"_menu_nm332_19",dangerItem:"_dangerItem_nm332_190"},cE={video:Us,pdf:Ao,h5p:Fs,scorm:Bs,audio:$s,quiz:xs,course:Nr,default:xr},dE=({node:e,style:t,dragHandle:r,editorMode:n})=>{const[o,s]=p.useState(!1),[a,i]=p.useState(!1),[c,d]=p.useState(e.data.name),u=p.useRef(null),f=ne(),m=K(N=>N.editorProfile),g=n==="edit",b=_l(),h=Vo(e.data),v=cE[h.key]??xr,y=e.isSelected,C=e.level===0,S=e.data.isFolder??(e.children&&e.children.length>0),w=m.key==="learningPath",T=C?w?zu:yy:S?w?Iy:bd:v,E=w&&S&&!C&&!lt(e.data),L=e.level+1<=m.maxDepth,A=w?f.learningPath.addLevelButton:f.treeNode.addSubunitMenuItem,x=w?f.learningPath.addLevelButton:f.treeNode.addSiblingMenuItem;p.useEffect(()=>{if(!o)return;const N=M=>{var B;(B=u.current)!=null&&B.contains(M.target)||s(!1)};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[o]);const F=p.useCallback(()=>{c.trim()&&e.submit(c.trim()),i(!1)},[c,e]),P=p.useCallback(N=>{N.key==="Enter"&&F(),N.key==="Escape"&&(d(e.data.name),i(!1))},[F,e.data.name]);return l.jsxs("div",{className:[ct.row,w?ct.rowLp:"",y?ct.selected:"",e.state.isOver&&S?ct.dropTarget:""].filter(Boolean).join(" "),style:t,onClick:()=>e.select(),"data-node-id":e.data.id,"data-droppable":S?"true":void 0,role:"treeitem","aria-selected":y,"aria-expanded":S?!e.isClosed:void 0,children:[g&&l.jsx("span",{ref:r,className:ct.grip,"aria-hidden":"true",children:l.jsx(Cd,{size:14})}),l.jsx("button",{className:ct.toggle,onClick:N=>{N.stopPropagation(),e.toggle()},"aria-label":e.isClosed?f.treeNode.expandAriaLabel:f.treeNode.collapseAriaLabel,style:{visibility:S?"visible":"hidden"},children:e.isClosed?l.jsx(fi,{size:14}):l.jsx(Zr,{size:14})}),l.jsx("span",{className:[ct.ctIcon,C||S?ct.folderIcon:h.bgClass,w?ct.ctIconLp:"",C&&w?ct.rootIcon:""].filter(Boolean).join(" "),"aria-hidden":"true",children:l.jsx(T,{size:C&&w?15:12})}),a?l.jsx("input",{className:ct.renameInput,value:c,autoFocus:!0,onChange:N=>d(N.target.value),onBlur:F,onKeyDown:P,onClick:N=>N.stopPropagation()}):l.jsx("span",{className:[ct.title,w?ct.titleLp:"",E?ct.levelTitle:""].filter(Boolean).join(" "),title:e.data.name,onDoubleClick:()=>g&&i(!0),children:e.data.name.length>25?`${e.data.name.slice(0,25)}...`:e.data.name}),e.state.isOver&&S&&l.jsx("span",{className:ct.dropHere,"aria-hidden":"true",children:f.treeNode.dropHereLabel}),g&&l.jsxs("div",{className:ct.menuWrap,ref:u,children:[l.jsx("button",{className:ct.menuBtn,onClick:N=>{N.stopPropagation(),s(M=>!M)},"aria-label":f.treeNode.nodeOptionsAriaLabel,children:l.jsx(md,{size:14})}),o&&l.jsxs("div",{className:ct.menu,role:"menu",children:[l.jsxs("button",{role:"menuitem",onClick:()=>{i(!0),s(!1)},children:[l.jsx(Py,{size:13})," ",f.treeNode.renameMenuItem]}),S&&b&&L&&l.jsxs("button",{role:"menuitem",onClick:()=>{e.tree.create({parentId:e.id}),s(!1)},children:[l.jsx(yd,{size:13})," ",A]}),e.data.parent&&b&&!w&&l.jsxs("button",{role:"menuitem",onClick:()=>{e.tree.create({parentId:e.data.parent}),s(!1)},children:[l.jsx(Xr,{size:13})," ",x]}),!C&&l.jsxs("button",{role:"menuitem",className:ct.dangerItem,onClick:()=>{e.tree.delete(e.id),s(!1)},children:[l.jsx(js,{size:13})," ",f.treeNode.deleteMenuItem]})]})]})]})};async function uE(e,t){var s,a;const n=((s=(await Me.post(`/action/content/v3/upload/url/${e}?type=hierarchy`,{request:{content:{fileName:t}}})).data)==null?void 0:s.result)??{},o=((a=n.content)==null?void 0:a.preSignedURL)??n.pre_signed_url??n.preSignedUrl;if(!o)throw new Error("Could not obtain an upload URL");return o}async function fE(e,t){const r=await fetch(e,{method:"PUT",headers:{"x-ms-blob-type":"BlockBlob","Content-Type":"text/csv"},body:t});if(!r.ok)throw new Error(`Blob upload failed (${r.status})`);return e.split("?")[0]}async function hE(e,t){var i;const r=await uE(e,t.name),n=await fE(r,t),o=new FormData;return o.append("fileUrl",n),o.append("mimeType",t.type||"text/csv"),{processId:(((i=(await Me.post(`/action/collection/v1/import/${e}`,o)).data)==null?void 0:i.result)??{}).processId??""}}async function pE(e){var r;return((r=(await Me.get(`/action/collection/v1/import/status/${e}`)).data)==null?void 0:r.result)??{status:"PENDING"}}async function Bh(e){var n,o,s;const r=(s=(o=(n=(await Me.get(`/action/collection/v1/export/${e}`)).data)==null?void 0:n.result)==null?void 0:o.collection)==null?void 0:s.tocUrl;if(!r)throw new Error("No export URL returned");return r}async function gE(e){return Bh(e)}const ze={container:"_container_jw2be_1",header:"_header_jw2be_13",title:"_title_jw2be_22",closeBtn:"_closeBtn_jw2be_29",body:"_body_jw2be_45",dropZone:"_dropZone_jw2be_54",dragOver:"_dragOver_jw2be_67",hasFile:"_hasFile_jw2be_72",hiddenInput:"_hiddenInput_jw2be_78",fileInfo:"_fileInfo_jw2be_82",fileIcon:"_fileIcon_jw2be_89",fileName:"_fileName_jw2be_93",fileSize:"_fileSize_jw2be_100",dropHint:"_dropHint_jw2be_105",dropIcon:"_dropIcon_jw2be_112",dropText:"_dropText_jw2be_117",dropSubtext:"_dropSubtext_jw2be_124",sampleLink:"_sampleLink_jw2be_130",statusBar:"_statusBar_jw2be_145",status_uploading:"_status_uploading_jw2be_154",status_processing:"_status_processing_jw2be_154",status_done:"_status_done_jw2be_159",status_error:"_status_error_jw2be_164",successDetail:"_successDetail_jw2be_170",spinner:"_spinner_jw2be_175",spin:"_spin_jw2be_175",errorMsg:"_errorMsg_jw2be_191",failedSection:"_failedSection_jw2be_197",failedTitle:"_failedTitle_jw2be_203",tableWrap:"_tableWrap_jw2be_213",failedTable:"_failedTable_jw2be_219",reasonCell:"_reasonCell_jw2be_244",footer:"_footer_jw2be_248"},mE=({contentId:e,onComplete:t,onClose:r,mode:n="create"})=>{const o=ne(),[s,a]=p.useState(null),[i,c]=p.useState(!1),[d,u]=p.useState("idle"),[f,m]=p.useState(""),[g,b]=p.useState([]),[h,v]=p.useState(null),y=p.useRef(null),C=p.useRef(null),S=p.useCallback(()=>{C.current!==null&&(clearInterval(C.current),C.current=null)},[]);p.useEffect(()=>()=>S(),[S]);const w=P=>P.name.toLowerCase().endsWith(".csv")?P.size>50*1024*1024?(m(o.csvUpload.fileTooLarge),!1):!0:(m(o.csvUpload.invalidFileType),!1),T=p.useCallback(P=>{m(""),b([]),v(null),u("idle"),w(P)&&a(P)},[]),E=p.useCallback(P=>{P.preventDefault(),c(!1);const N=P.dataTransfer.files[0];N&&T(N)},[T]),L=p.useCallback(P=>{var M;const N=(M=P.target.files)==null?void 0:M[0];N&&T(N),P.target.value=""},[T]),A=p.useCallback(async()=>{try{const P=await gE(e),N=document.createElement("a");N.href=P,N.download="sample_hierarchy.csv",N.target="_blank",N.click()}catch{m(o.csvUpload.downloadSampleFailed)}},[e,o.csvUpload.downloadSampleFailed]),x=p.useCallback(async()=>{if(s){u("uploading"),m(""),b([]);try{const{processId:P}=await hE(e,s);if(!P){u("done"),v(null),setTimeout(t,1500);return}u("processing"),C.current=setInterval(async()=>{try{const N=await pE(P);N.status==="COMPLETED"?(S(),u("done"),v(N.successCount??null),N.failedRecords&&N.failedRecords.length>0?b(N.failedRecords):setTimeout(t,1500)):N.status==="FAILED"&&(S(),u("error"),m(o.csvUpload.processingFailed),N.failedRecords&&b(N.failedRecords))}catch{S(),u("error"),m(o.csvUpload.connectionLost)}},2e3)}catch{u("error"),m(o.csvUpload.uploadFailed)}}},[e,s,t,S,o.csvUpload.processingFailed,o.csvUpload.connectionLost,o.csvUpload.uploadFailed]),F={idle:"",uploading:o.csvUpload.statusUploading,processing:o.csvUpload.statusProcessing,done:o.csvUpload.statusDone,error:o.csvUpload.statusError};return l.jsxs("div",{className:ze.container,children:[l.jsxs("div",{className:ze.header,children:[l.jsx("h2",{className:ze.title,children:n==="update"?o.csvUpload.titleUpdate:o.csvUpload.titleCreate}),l.jsx("button",{className:ze.closeBtn,onClick:r,"aria-label":o.csvUpload.closeAriaLabel,children:l.jsx(ur,{size:18})})]}),l.jsxs("div",{className:ze.body,children:[l.jsxs("div",{className:`${ze.dropZone} ${i?ze.dragOver:""} ${s?ze.hasFile:""}`,onDragEnter:P=>{P.preventDefault(),c(!0)},onDragOver:P=>{P.preventDefault(),c(!0)},onDragLeave:P=>{P.preventDefault(),c(!1)},onDrop:E,onClick:()=>{var P;return(P=y.current)==null?void 0:P.click()},role:"button",tabIndex:0,"aria-label":o.csvUpload.dropZoneAriaLabel,onKeyDown:P=>{var N;return P.key==="Enter"&&((N=y.current)==null?void 0:N.click())},children:[l.jsx("input",{ref:y,type:"file",accept:".csv",className:ze.hiddenInput,onChange:L,"aria-hidden":"true"}),s?l.jsxs("div",{className:ze.fileInfo,children:[l.jsx(Ao,{size:24,className:ze.fileIcon}),l.jsx("span",{className:ze.fileName,children:s.name}),l.jsxs("span",{className:ze.fileSize,children:["(",(s.size/1024).toFixed(1)," KB)"]})]}):l.jsxs("div",{className:ze.dropHint,children:[l.jsx(hi,{size:32,className:ze.dropIcon}),l.jsx("p",{className:ze.dropText,children:o.csvUpload.dropText}),l.jsx("p",{className:ze.dropSubtext,children:o.csvUpload.dropSubtext})]})]}),l.jsx("button",{className:ze.sampleLink,onClick:A,type:"button",children:o.csvUpload.downloadSample}),d!=="idle"&&l.jsxs("div",{className:`${ze.statusBar} ${ze[`status_${d}`]}`,role:"status","aria-live":"polite",children:[d==="processing"&&l.jsx("span",{className:ze.spinner,"aria-hidden":"true"}),F[d],d==="done"&&h!==null&&l.jsx("span",{className:ze.successDetail,children:o.csvUpload.itemsImportedSuffix.replace("{count}",String(h))})]}),f&&l.jsx("p",{className:ze.errorMsg,role:"alert",children:f}),g.length>0&&l.jsxs("div",{className:ze.failedSection,children:[l.jsx("h4",{className:ze.failedTitle,children:o.csvUpload.failedRowsTitle.replace("{count}",String(g.length))}),l.jsx("div",{className:ze.tableWrap,children:l.jsxs("table",{className:ze.failedTable,children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:o.csvUpload.rowHeader}),l.jsx("th",{children:o.csvUpload.nameHeader}),l.jsx("th",{children:o.csvUpload.reasonHeader})]})}),l.jsx("tbody",{children:g.map((P,N)=>l.jsxs("tr",{children:[l.jsx("td",{children:P.rowNumber??N+1}),l.jsx("td",{children:P.name??"—"}),l.jsx("td",{className:ze.reasonCell,children:P.reason??o.csvUpload.unknownError})]},N))})]})})]})]}),l.jsxs("div",{className:ze.footer,children:[l.jsx($e,{variant:"ghost",onClick:r,disabled:d==="uploading"||d==="processing",children:o.csvUpload.cancel}),l.jsx($e,{variant:"primary",isLoading:d==="uploading"||d==="processing",disabled:!s||d==="done",onClick:x,children:d==="done"?o.csvUpload.uploaded:o.csvUpload.upload})]})]})};function Tl(){var v,y,C,S,w,T,E;const e=ne(),t=ae(L=>L.treeData),r=ae(L=>L.treeCache),n=ae(L=>L.deleteNode),o=fr(L=>L.activeAssessmentSlot),s=fr(L=>L.setActiveAssessmentSlot),a=fr(L=>L.openModal),i=((v=t[0])==null?void 0:v.children)??[],c=i[0],d=i.length>1?i[i.length-1]:void 0,u=lt(c),f=lt(d),m=t[0],g=m?((y=r[m.id])==null?void 0:y.policy)??((C=m.metadata)==null?void 0:C.policy):void 0,b=!!g&&Mu.has(g),h=L=>{const A=L==="pre"?c:d;if(!A)return;const x=L==="pre"&&b?e.learningPath.deletePriorAssessmentConfirm:e.learningPath.deleteAssessmentSlotConfirm;a("confirmDelete",{message:x,onConfirm:()=>n(A.id)})};return{pre:{level:c,filled:u,courseName:u?(w=(S=c==null?void 0:c.children)==null?void 0:S[0])==null?void 0:w.name:void 0,required:b},post:{level:d,filled:f,courseName:f?(E=(T=d==null?void 0:d.children)==null?void 0:T[0])==null?void 0:E.name:void 0,required:!1},activeAssessmentSlot:o,setActiveAssessmentSlot:s,deleteSlot:h}}const sr={container:"_container_2qylm_1",header:"_header_2qylm_8",sectionLabel:"_sectionLabel_2qylm_18",headerActions:"_headerActions_2qylm_26",iconBtn:"_iconBtn_2qylm_33",menuWrap:"_menuWrap_2qylm_51",dropdownMenu:"_dropdownMenu_2qylm_55",treeWrapper:"_treeWrapper_2qylm_87",csvModal:"_csvModal_2qylm_103",footer:"_footer_2qylm_113"},vE=({editorMode:e,collapsed:t=!1,onToggleCollapse:r})=>{var Ae;const n=ne(),o=p.useRef(null),s=p.useRef(null),a=p.useRef(null),[i,c]=p.useState(400),[d,u]=p.useState(!1),[f,m]=p.useState(!1),[g,b]=p.useState("create"),{treeData:h,selectedNodeId:v,selectNode:y,addNode:C,deleteNode:S,getNodeById:w,reorderChildren:T,moveNode:E,setTreeData:L}=ae(),A=fr(Y=>Y.openModal),x=K(Y=>Y.editorProfile),F=x.key==="learningPath",P=e==="edit",N=_l(),M=P&&N,B=F?n.learningPath.addLevelButton:n.outlineTree.addUnitButton,U=x.maxDepth>1,ee=(((Ae=h[0])==null?void 0:Ae.children)??[]).some(Y=>Y.isFolder),{pre:Q,post:te,deleteSlot:ue}=Tl(),{level:fe}=Q,{level:pe}=te,ie=K(Y=>{var de,W,Ce,Ve;return((W=(de=Y.editorConfig)==null?void 0:de.context)==null?void 0:W.contentId)??((Ve=(Ce=Y.editorConfig)==null?void 0:Ce.context)==null?void 0:Ve.identifier)??""}),Te=K(Y=>{var W,Ce;const de=(Ce=(W=Y.categoryMeta)==null?void 0:W.sourcingSettings)==null?void 0:Ce.collection;return(de==null?void 0:de.enableBulkUpload)!==!1}),ye=x.features.csvUpload&&Te;p.useEffect(()=>{const Y=s.current;if(!Y)return;const de=new ResizeObserver(()=>{c(Y.clientHeight||400)});return de.observe(Y),c(Y.clientHeight||400),()=>de.disconnect()},[]),p.useEffect(()=>{if(!d)return;const Y=de=>{var W;(W=a.current)!=null&&W.contains(de.target)||u(!1)};return document.addEventListener("mousedown",Y),()=>document.removeEventListener("mousedown",Y)},[d]);const $=p.useCallback(Y=>{Y.length>0&&y(Y[0].data.id)},[y]),q=p.useCallback(({parentId:Y,index:de,dragIds:W})=>{if(!Y)return;const Ce=W[0],Ve=El(h,Ce);if(!Ve)return;const nt=Ve.parent;if(nt===Y){const He=El(h,Y);if(!(He!=null&&He.children))return;const Ke=He.children.findIndex(ot=>ot.id===Ce);if(Ke<0)return;T(Y,Ke,de>Ke?de-1:de)}else E(Ce,nt??"",Y)},[h,T,E]),Z=p.useCallback(({ids:Y})=>{if(!F){for(const W of Y)S(W);return}if(Y.length===1){const W=Y[0];if((fe==null?void 0:fe.id)===W){ue("pre");return}if((pe==null?void 0:pe.id)===W){ue("post");return}const Ce=w(W),Ve=Ce!=null&&Ce.isFolder?n.learningPath.deleteLevelConfirm.replace("{name}",Ce.name):n.learningPath.deleteCourseConfirm;A("confirmDelete",{message:Ve,onConfirm:()=>S(W)});return}const de=n.learningPath.deleteMultipleConfirm.replace("{count}",String(Y.length));A("confirmDelete",{message:de,onConfirm:()=>{for(const W of Y)S(W)}})},[S,ue,F,fe,pe,w,A,n]),he=p.useCallback(({parentId:Y})=>{var Ce;const de=Y??((Ce=h[0])==null?void 0:Ce.id)??"";if(!de)return{id:crypto.randomUUID()};const W=C(de,"unit");return W?{id:W}:(Se.error(n.outlineTree.maxDepthReachedToast),{id:crypto.randomUUID()})},[C,h,n]),be=p.useCallback(()=>{var de;const Y=(de=h[0])==null?void 0:de.id;Y&&(C(Y,"unit")||Se.error(n.outlineTree.maxDepthReachedToast))},[h,C,n]),ge=p.useCallback(()=>{v&&(C(v,"subunit")||Se.error(n.outlineTree.maxDepthReachedToast))},[v,C,n]),le=p.useCallback(async()=>{if(u(!1),!!ie)try{const Y=await Bh(ie),de=await fetch(Y).then(Ve=>Ve.blob()),W=URL.createObjectURL(de),Ce=document.createElement("a");Ce.href=W,Ce.download=`${ie}-folders.csv`,Ce.style.display="none",document.body.appendChild(Ce),Ce.click(),document.body.removeChild(Ce),URL.revokeObjectURL(W)}catch{Se.error(n.outlineTree.downloadCsvFailedToast)}},[ie,n]),ve=p.useCallback(async()=>{if(m(!1),!!ie)try{const{rootNode:Y}=await Au(ie);L([Y]),Se.success(n.outlineTree.outlineRefreshedToast)}catch{Se.error(n.outlineTree.outlineRefreshFailedToast)}},[ie,L,n]);return l.jsxs("div",{className:sr.container,children:[l.jsxs("div",{className:sr.header,children:[F&&l.jsx("span",{className:sr.sectionLabel,children:n.learningPath.pathStructureLabel}),l.jsxs("div",{className:sr.headerActions,children:[P&&ye&&l.jsxs("div",{className:sr.menuWrap,ref:a,children:[l.jsx("button",{type:"button",className:sr.iconBtn,onClick:()=>u(Y=>!Y),"aria-label":n.outlineTree.moreOptionsAriaLabel,title:n.outlineTree.moreOptionsTitle,"aria-haspopup":"true","aria-expanded":d,children:l.jsx(md,{size:15})}),d&&l.jsxs("div",{className:sr.dropdownMenu,role:"menu",children:[l.jsx("button",{role:"menuitem",type:"button",disabled:ee,title:ee?n.outlineTree.foldersExistTitle:void 0,onClick:()=>{u(!1),b("create"),m(!0)},children:n.outlineTree.createFoldersCsvButton}),l.jsx("button",{role:"menuitem",type:"button",disabled:!ee,title:ee?void 0:n.outlineTree.noFoldersYetTitle,onClick:le,children:n.outlineTree.downloadFoldersCsvButton}),l.jsx("button",{role:"menuitem",type:"button",disabled:!ee,title:ee?void 0:n.outlineTree.noFoldersYetTitle,onClick:()=>{u(!1),b("update"),m(!0)},children:n.outlineTree.updateFoldersCsvButton})]})]}),r&&l.jsx("button",{type:"button",className:sr.iconBtn,onClick:r,"aria-label":t?n.outlineTree.expandOutlineAriaLabel:n.outlineTree.collapseOutlineAriaLabel,title:t?n.outlineTree.expandOutlineAriaLabel:n.outlineTree.collapseOutlineAriaLabel,children:t?l.jsx(Ly,{size:15}):l.jsx(Dy,{size:15})})]})]}),l.jsx("div",{className:sr.treeWrapper,ref:s,children:l.jsx(sE,{ref:o,data:h,idAccessor:"id",childrenAccessor:"children",onSelect:$,onMove:P?q:void 0,onDelete:P?Z:void 0,onCreate:P?he:void 0,disableEdit:!P,disableDrop:!P,selection:v??void 0,rowHeight:40,indent:20,paddingBottom:16,height:i,width:"100%",children:Y=>l.jsx(dE,{...Y,editorMode:e})})}),P&&l.jsxs("div",{className:sr.footer,children:[l.jsxs($e,{variant:"ghost",size:"sm",onClick:be,disabled:!M,children:[l.jsx(Xr,{size:14})," ",B]}),U&&l.jsxs($e,{variant:"ghost",size:"sm",onClick:ge,disabled:!M||!v,children:[l.jsx(yd,{size:14})," ",n.outlineTree.addSubunitButton]})]}),f&&l.jsx("div",{className:sr.csvModal,children:l.jsx(mE,{contentId:ie,mode:g,onComplete:ve,onClose:()=>m(!1)})})]})};function El(e,t){for(const r of e){if(r.id===t)return r;if(r.children){const n=El(r.children,t);if(n)return n}}}const Ho={breadcrumb:"_breadcrumb_zd1aj_1",crumb:"_crumb_zd1aj_10",sep:"_sep_zd1aj_26",current:"_current_zd1aj_31"},yE=({crumbs:e})=>{const t=ae(n=>n.selectNode),r=ne();return e.length?l.jsxs("nav",{className:Ho.breadcrumb,"aria-label":r.breadcrumb.nodePathAriaLabel,children:[l.jsx("button",{className:Ho.crumb,onClick:()=>t(e[0].id),"aria-label":r.breadcrumb.homeAriaLabel,children:l.jsx(Ay,{size:13})}),e.map((n,o)=>l.jsxs(p.Fragment,{children:[l.jsx(fi,{size:13,className:Ho.sep}),o<e.length-1?l.jsx("button",{className:Ho.crumb,onClick:()=>t(n.id),children:n.name}):l.jsx("span",{className:Ho.current,children:n.name})]},n.id))]}):null},Qo={tabBar:"_tabBar_qhks1_1",tab:"_tab_qhks1_1",active:"_active_qhks1_29",error:"_error_qhks1_35",errorDot:"_errorDot_qhks1_39"},bE=({activeTab:e,onChange:t,errorTabs:r=[],visibleTabs:n})=>{const o=ne(),s=[{id:"details",label:o.tabBar.detailsTab},{id:"audience",label:o.tabBar.audienceCurriculumTab},{id:"licensing",label:o.tabBar.licensingTab}],a=n?s.filter(i=>n.includes(i.id)):s;return l.jsx("div",{className:Qo.tabBar,role:"tablist","aria-label":o.tabBar.metadataSectionsAriaLabel,children:a.map(i=>l.jsxs("button",{role:"tab","aria-selected":e===i.id,"aria-controls":`panel-${i.id}`,className:[Qo.tab,e===i.id?Qo.active:"",r.includes(i.id)?Qo.error:""].join(" "),onClick:()=>t(i.id),children:[i.label,r.includes(i.id)&&l.jsx("span",{className:Qo.errorDot,"aria-label":o.tabBar.hasErrorsAriaLabel})]},i.id))})};var Wo=e=>e.type==="checkbox",an=e=>e instanceof Date,bt=e=>e==null;const qh=e=>typeof e=="object";var Ye=e=>!bt(e)&&!Array.isArray(e)&&qh(e)&&!an(e),Al=e=>Ye(e)&&e.target?Wo(e.target)?e.target.checked:e.target.value:e,jh=(e,t)=>t.split(".").some((r,n,o)=>!isNaN(Number(r))&&e.has(o.slice(0,n).join("."))),Uh=e=>{const t=e.constructor&&e.constructor.prototype;return Ye(t)&&t.hasOwnProperty("isPrototypeOf")},wa=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function et(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(wa&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(Ye(e)&&Uh(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=et(e[o]));return n}const $r={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},ar={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ir={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},kl="form",zh="root",Vh=["__proto__","constructor","prototype"];var Ro=e=>/^\w*$/.test(e),Ge=e=>e===void 0,_a=e=>e.split(/[.[\]'"]/g).filter(Boolean),G=(e,t,r)=>{if(!t||!Ye(e))return r;const n=Ro(t)?[t]:_a(t);if(n.some(s=>Vh.includes(s)))return r;const o=n.reduce((s,a)=>bt(s)?void 0:s[a],e);return Ge(o)||o===e?Ge(e[t])?r:e[t]:o},Ut=e=>typeof e=="boolean",kt=e=>typeof e=="function",Qe=(e,t,r)=>{let n=-1;const o=Ro(t)?[t]:_a(t),s=o.length,a=s-1;for(;++n<s;){const i=o[n];let c=r;if(n!==a){const d=e[i];c=Ye(d)||Array.isArray(d)?d:isNaN(+o[n+1])?{}:[]}if(Vh.includes(i))return;e[i]=c,e=e[i]}};const Il=p.createContext(null);Il.displayName="HookFormControlContext";const Dl=()=>p.useContext(Il);var Hh=(e,t,r,n=!0)=>{const o={};for(const s in e)Object.defineProperty(o,s,{get:()=>{const a=s;return t._proxyFormState[a]!==ar.all&&(t._proxyFormState[a]=!n||ar.all),r&&(r[a]=!0),e[a]}});return o};const Ll=wa?p.useLayoutEffect:p.useEffect;function CE(e){const t=Dl(),{control:r=t,disabled:n,name:o,exact:s}=e||{},[a,i]=p.useState(()=>({...r._formState,defaultValues:r._defaultValues})),c=p.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Ll(()=>r._subscribe({name:o,formState:c.current,exact:s,callback:d=>{!n&&i({...r._formState,...d,defaultValues:r._defaultValues})}}),[o,n,s]),p.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),p.useMemo(()=>Hh(a,r,c.current,!1),[a,r])}var It=e=>typeof e=="string",Ol=(e,t,r,n,o)=>It(e)?(n&&t.watch.add(e),G(r,e,o)):Array.isArray(e)?e.map(s=>(n&&t.watch.add(s),G(r,s))):(n&&(t.watchAll=!0),r),Pl=e=>bt(e)||!qh(e);const Qh=(e,t)=>t.length===0&&!Array.isArray(e)&&!Uh(e);function zt(e,t,r=new WeakMap){if(e===t)return!0;if(Pl(e)||Pl(t))return Object.is(e,t);if(an(e)&&an(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;if(Qh(e,n)||Qh(t,o))return Object.is(e,t);const s=r.get(e);if(s&&s.has(t))return!0;s?s.add(t):r.set(e,new WeakSet([t]));for(const a of n){const i=e[a];if(!(a in t))return!1;if(a!=="ref"){const c=t[a];if(an(i)&&an(c)||(Ye(i)||Array.isArray(i))&&(Ye(c)||Array.isArray(c))?!zt(i,c,r):!Object.is(i,c))return!1}}return!0}function SE(e){const t=Dl(),{control:r=t,name:n,defaultValue:o,disabled:s,exact:a,compute:i}=e||{},c=p.useRef(o),d=p.useRef(i),u=p.useRef(void 0),f=p.useRef(r),m=p.useRef(n);d.current=i;const[g,b]=p.useState(()=>{const w=r._getWatch(n,c.current);return d.current?d.current(w):w}),h=p.useCallback(w=>{const T=Ol(n,r._names,w||r._formValues,!1,c.current);return d.current?d.current(T):T},[r._formValues,r._names,n]),v=p.useCallback(w=>{if(!s){const T=Ol(n,r._names,w||r._formValues,!1,c.current);if(d.current){const E=d.current(T);zt(E,u.current)||(b(E),u.current=E)}else b(T)}},[r._formValues,r._names,s,n]);Ll(()=>((f.current!==r||!zt(m.current,n))&&(f.current=r,m.current=n,v()),r._subscribe({name:n,formState:{values:!0},exact:a,callback:w=>{v(w.values)}})),[r,a,n,v]),p.useEffect(()=>r._removeUnmounted());const y=f.current!==r,C=m.current,S=p.useMemo(()=>{if(s)return null;const w=!y&&!zt(C,n);return y||w?h():null},[s,y,n,C,h]);return S!==null?S:g}function Go(e){const t=Dl(),{name:r,disabled:n,control:o=t,shouldUnregister:s,defaultValue:a,exact:i=!0}=e,c=jh(o._names.array,r),d=p.useMemo(()=>G(o._formValues,r,G(o._defaultValues,r,a)),[o,r,a]),u=SE({control:o,name:r,defaultValue:d,exact:i}),f=CE({control:o,name:r,exact:i}),m=p.useRef(e),g=p.useRef(null),b=p.useRef(o.register(r,{...e.rules,value:u,...Ut(e.disabled)?{disabled:e.disabled}:{}}));m.current=e;const h=p.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!G(f.errors,r)},isDirty:{enumerable:!0,get:()=>!!G(f.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!G(f.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!G(f.validatingFields,r)},error:{enumerable:!0,get:()=>G(f.errors,r)}}),[f,r]),v=p.useCallback(w=>{const T=Al(w);return G(o._fields,r)||(b.current=o.register(r,{...m.current.rules,value:T})),b.current.onChange({target:{value:Al(w),name:r},type:$r.CHANGE})},[r,o]),y=p.useCallback(()=>b.current.onBlur({target:{value:G(o._formValues,r),name:r},type:$r.BLUR}),[r,o._formValues]),C=p.useCallback(w=>{w&&(g.current={focus:()=>kt(w.focus)&&w.focus(),select:()=>kt(w.select)&&w.select(),setCustomValidity:E=>kt(w.setCustomValidity)&&w.setCustomValidity(E),reportValidity:()=>kt(w.reportValidity)&&w.reportValidity()});const T=G(o._fields,r);T&&T._f&&w&&(T._f.ref=g.current)},[o._fields,r]),S=p.useMemo(()=>({name:r,value:u,...Ut(n)||f.disabled?{disabled:f.disabled||n}:{},onChange:v,onBlur:y,ref:C}),[r,n,f.disabled,v,y,C,u]);return p.useEffect(()=>{const w=o._options.shouldUnregister||s;o.register(r,{...m.current.rules,...Ut(m.current.disabled)?{disabled:m.current.disabled}:{}});const T=(E,L)=>{const A=G(o._fields,E);A&&A._f&&(A._f.mount=L)};if(T(r,!0),w){const E=et(G(s?o._defaultValues:o._options.values||o._defaultValues,r,G(o._options.defaultValues,r,m.current.defaultValue)));Qe(o._defaultValues,r,E),Ge(G(o._formValues,r))&&Qe(o._formValues,r,E)}if(!c&&o.register(r),g.current){const E=G(o._fields,r);E&&E._f&&(E._f.ref=g.current)}return()=>{(c?w&&!o._state.action:w)?o.unregister(r):T(r,!1)}},[r,o,c,s]),p.useEffect(()=>{o._setDisabledField({disabled:n,name:r})},[n,r,o]),p.useMemo(()=>({field:S,formState:f,fieldState:h}),[S,f,h])}const wE=e=>e.render(Go(e)),Nl=p.createContext(null);Nl.displayName="HookFormContext";const Yt=()=>p.useContext(Nl),_E=({children:e,watch:t,getValues:r,getFieldState:n,setError:o,clearErrors:s,setValue:a,setValues:i,trigger:c,formState:d,resetField:u,reset:f,handleSubmit:m,unregister:g,control:b,register:h,setFocus:v,subscribe:y})=>{const C=p.useMemo(()=>({watch:t,getValues:r,getFieldState:n,setError:o,clearErrors:s,setValue:a,setValues:i,trigger:c,formState:d,resetField:u,reset:f,handleSubmit:m,unregister:g,control:b,register:h,setFocus:v,subscribe:y}),[s,b,d,n,r,m,h,f,u,o,v,a,i,y,c,g,t]);return p.createElement(Nl.Provider,{value:C},p.createElement(Il.Provider,{value:C.control},e))};var TE=(e,t,r,n,o)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:o||!0}}:{},Wh=e=>Array.isArray(e)?e.filter(Boolean):[],Ta=e=>Array.isArray(e)?e:[e],Rh=()=>{let e=[];return{get observers(){return e},next:o=>{for(const s of e)s.next&&s.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(s=>s!==o)}}),unsubscribe:()=>{e=[]}}};function Gh(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const o=e[n],s=t[n];if(o&&Ye(o)&&s){const a=Gh(o,s);Ye(a)&&(r[n]=a)}else e[n]&&(r[n]=s)}return r}var ft=e=>Ye(e)&&!Object.keys(e).length,xl=e=>e.type==="file",Ea=e=>{if(!wa)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Kh=e=>e.type==="select-multiple",Fl=e=>e.type==="radio",EE=e=>Fl(e)||Wo(e),Ml=e=>Ea(e)&&e.isConnected;function AE(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;){if(bt(e)){e=void 0;break}e=e[t[n]],n++}return e}function kE(e){for(const t in e)if(e.hasOwnProperty(t)&&!Ge(e[t]))return!1;return!0}function st(e,t){if(It(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;const r=Array.isArray(t)?t:Ro(t)?[t]:_a(t),n=r.length===1?e:AE(e,r),o=r.length-1,s=r[o];return n&&delete n[s],o!==0&&(Ye(n)&&ft(n)||Array.isArray(n)&&kE(n))&&st(e,r.slice(0,-1)),e}var IE=e=>{for(const t in e)if(kt(e[t]))return!0;return!1};function Yh(e){return Array.isArray(e)||Ye(e)&&!IE(e)}function $l(e,t={}){for(const r in e){const n=e[r];Yh(n)?(t[r]=Array.isArray(n)?[]:{},$l(n,t[r])):Ge(n)||(t[r]=!0)}return t}function Bl(e){if(e!==!1){if(e===!0)return!0;if(Array.isArray(e)){const t=e.map(r=>Bl(r));return t.some(r=>r!==void 0)?t:void 0}if(Ye(e)){const t={};for(const r in e){const n=Bl(e[r]);Ge(n)||(t[r]=n)}return Object.keys(t).length?t:void 0}}}function ln(e,t,r){r||(r=$l(t));for(const n in e){const o=e[n];if(Yh(o))Ge(t)||Pl(r[n])?r[n]=$l(o,Array.isArray(o)?[]:{}):ln(o,bt(t)?{}:t[n],r[n]);else{const s=t[n];r[n]=!zt(o,s)}}return Bl(r)||{}}const Zh={value:!1,isValid:!1},Xh={value:!0,isValid:!0};var Jh=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Ge(e[0].attributes.value)?Ge(e[0].value)||e[0].value===""?Xh:{value:e[0].value,isValid:!0}:Xh:Zh}return Zh},ep=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Ge(e)?e:t?e===""?NaN:e&&+e:r&&It(e)?new Date(e):n?n(e):e;const tp={isValid:!1,value:null};var rp=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,tp):tp;function np(e){const t=e.ref;return xl(t)?t.files:Fl(t)?rp(e.refs).value:Kh(t)?[...t.selectedOptions].map(({value:r})=>r):Wo(t)?Jh(e.refs).value:ep(Ge(t.value)?e.ref.value:t.value,e)}var DE=(e,t,r,n)=>{const o={};for(const s of e){const a=G(t,s);a&&Qe(o,s,a._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:n}},Aa=e=>e instanceof RegExp,Ko=e=>Ge(e)?e:Aa(e)?e.source:Ye(e)?Aa(e.value)?e.value.source:e.value:e,op=e=>({isOnSubmit:!e||e===ar.onSubmit,isOnBlur:e===ar.onBlur,isOnChange:e===ar.onChange,isOnAll:e===ar.all,isOnTouch:e===ar.onTouched});const sp="AsyncFunction";var LE=e=>!!e&&!!e.validate&&!!(kt(e.validate)&&e.validate.constructor.name===sp||Ye(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===sp)),OE=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),ql=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(`${n}.`)));const Yo=(e,t,r,n)=>{for(const o of r||Object.keys(e)){const s=G(e,o);if(s){const{_f:a,...i}=s;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],o)&&!n)return!0;if(a.ref&&t(a.ref,a.name)&&!n)return!0;if(Yo(i,t))break}else if(Ye(i)&&Yo(i,t))break}}};function ap(e,t,r){const n=G(e,r);if(n||Ro(r))return{error:n,name:r};const o=r.split(".");for(;o.length;){const s=o.join("."),a=G(t,s),i=G(e,s);if(a&&!Array.isArray(a)&&r!==s)return{name:r};if(i&&i.type)return{name:s,error:i};if(i&&i.root&&i.root.type)return{name:`${s}.root`,error:i.root};o.pop()}return{name:r}}var PE=(e,t,r,n)=>{r(e);const{name:o,...s}=e;return ft(s)||n&&Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(a=>t[a]===(!n||ar.all))},NE=(e,t,r)=>!e||!t||e===t||Ta(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),xE=(e,t,r,n,o)=>o.isOnAll?!1:!r&&o.isOnTouch?!(t||e):(r?n.isOnBlur:o.isOnBlur)?!e:(r?n.isOnChange:o.isOnChange)?e:!0,FE=(e,t)=>!Wh(G(e,t)).length&&st(e,t),ip=(e,t,r)=>{const n=G(e,r),o=Array.isArray(n)?n:[];return Qe(o,zh,t[r]),Qe(e,r,o),e};function lp(e,t,r="validate"){if(It(e)||Array.isArray(e)&&e.every(It)||Ut(e)&&!e)return{type:r,message:It(e)?e:"",ref:t}}var Qn=e=>Ye(e)&&!Aa(e)?e:{value:e,message:""},cp=async(e,t,r,n,o,s)=>{const{ref:a,refs:i,required:c,maxLength:d,minLength:u,min:f,max:m,pattern:g,validate:b,name:h,valueAsNumber:v,mount:y}=e._f,C=G(r,h);if(!y||t.has(h))return{};const S=i?i[0]:a,w=N=>{if(o&&S.reportValidity){const M=Ut(N)?"":N||"";i?i.forEach(B=>B.setCustomValidity(M)):S.setCustomValidity(M),S.reportValidity()}},T={},E=Fl(a),L=Wo(a),A=E||L,x=(v||xl(a))&&Ge(a.value)&&Ge(C)||Ea(a)&&a.value===""||C===""||Array.isArray(C)&&!C.length,F=TE.bind(null,h,n,T),P=(N,M,B,U=ir.maxLength,ee=ir.minLength)=>{const Q=N?M:B;T[h]={type:N?U:ee,message:Q,ref:a,...F(N?U:ee,Q)}};if(s?!Array.isArray(C)||!C.length:c&&(!A&&(x||bt(C))||Ut(C)&&!C||L&&!Jh(i).isValid||E&&!rp(i).isValid)){const{value:N,message:M}=It(c)?{value:!!c,message:c}:Qn(c);if(N&&(T[h]={type:ir.required,message:M,ref:S,...F(ir.required,M)},!n))return w(M),T}if(!x&&(!bt(f)||!bt(m))){let N,M;const B=Qn(m),U=Qn(f);if(!bt(C)&&!isNaN(C)){const ee=a.valueAsNumber||C&&+C;bt(B.value)||(N=ee>B.value),bt(U.value)||(M=ee<U.value)}else{const ee=a.valueAsDate||new Date(C),Q=fe=>new Date(new Date().toDateString()+" "+fe),te=a.type=="time",ue=a.type=="week";It(B.value)&&C&&(N=te?Q(C)>Q(B.value):ue?C>B.value:ee>new Date(B.value)),It(U.value)&&C&&(M=te?Q(C)<Q(U.value):ue?C<U.value:ee<new Date(U.value))}if((N||M)&&(P(!!N,B.message,U.message,ir.max,ir.min),!n))return w(T[h].message),T}if((d||u)&&!x&&(It(C)||s&&Array.isArray(C))){const N=Qn(d),M=Qn(u),B=!bt(N.value)&&C.length>+N.value,U=!bt(M.value)&&C.length<+M.value;if((B||U)&&(P(B,N.message,M.message),!n))return w(T[h].message),T}if(g&&!x&&It(C)){const{value:N,message:M}=Qn(g);if(Aa(N)&&!C.match(N)&&(T[h]={type:ir.pattern,message:M,ref:a,...F(ir.pattern,M)},!n))return w(M),T}if(b){if(kt(b)){const N=await b(C,r),M=lp(N,S);if(M&&(T[h]={...M,...F(ir.validate,M.message)},!n))return w(M.message),T}else if(Ye(b)){let N={};for(const M in b){if(!ft(N)&&!n)break;const B=lp(await b[M](C,r),S,M);B&&(N={...B,...F(M,B.message)},w(B.message),n&&(T[h]=N))}if(!ft(N)&&(T[h]={ref:S,...N},!n))return T}}return w(!0),T};const ME={mode:ar.onSubmit,reValidateMode:ar.onChange,shouldFocusError:!0},dp={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function $E(e={}){let t={...ME,...e},r={...et(dp),isLoading:kt(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},n={},o=Ye(t.defaultValues)||Ye(t.values)?et(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:et(o),a={action:!1,mount:!1,watch:!1,keepIsValid:!1},i={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},c,d=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={...u};let m={...f};const g={array:Rh(),state:Rh()},b=t.criteriaMode===ar.all,h=_=>k=>{clearTimeout(d),d=setTimeout(_,k)},v=async _=>{if(!a.keepIsValid&&!t.disabled&&(f.isValid||m.isValid||_)){let k;t.resolver?(k=ft((await F()).errors),y()):k=await M({fields:n,onlyCheckValid:!0,eventType:$r.VALID}),k!==r.isValid&&g.state.next({isValid:k})}},y=(_,k)=>{!t.disabled&&(f.isValidating||f.validatingFields||m.isValidating||m.validatingFields)&&((_||Array.from(i.mount)).forEach(D=>{D&&(k?Qe(r.validatingFields,D,k):st(r.validatingFields,D))}),g.state.next({validatingFields:r.validatingFields,isValidating:!ft(r.validatingFields)}))},C=()=>{r.dirtyFields=ln(o,s)},S=(_,k=[],D,z,V=!0,R=!0)=>{if(z&&D&&!t.disabled){if(a.action=!0,R&&Array.isArray(G(n,_))){const H=D(G(n,_),z.argA,z.argB);V&&Qe(n,_,H)}if(R&&Array.isArray(G(r.errors,_))){const H=D(G(r.errors,_),z.argA,z.argB);V&&Qe(r.errors,_,H),FE(r.errors,_)}if((f.touchedFields||m.touchedFields)&&R&&Array.isArray(G(r.touchedFields,_))){const H=D(G(r.touchedFields,_),z.argA,z.argB);V&&Qe(r.touchedFields,_,H)}(f.dirtyFields||m.dirtyFields)&&C(),g.state.next({name:_,isDirty:U(_,k),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Qe(s,_,k)},w=(_,k)=>{Qe(r.errors,_,k),r.errors={...r.errors},g.state.next({errors:r.errors})},T=_=>{r.errors=_,g.state.next({errors:r.errors,isValid:!1})},E=_=>{const k=Ro(_)?[_]:_a(_);let D=s,z=o;for(let V=0;V<k.length-1;V++){const R=k[V];if(D=bt(D)?D:D[R],z=bt(z)?z:z[R],D===null&&z!==null)return!0}return!1},L=(_,k,D,z)=>{const V=G(n,_);if(V){if(E(_))return;const R=Ge(G(s,_)),H=G(s,_,Ge(D)?G(o,_):D);Ge(H)||z&&z.defaultChecked||k?Qe(s,_,k?H:np(V._f)):te(_,H),a.mount&&!a.action&&(v(),R&&r.isDirty&&(f.isDirty||m.isDirty)&&(U()||(r.isDirty=!1,g.state.next({...r}))),e.shouldUnregister&&R&&!Ge(G(s,_))&&ql(_,i)&&(a.watch=!0))}},A=(_,k,D,z,V)=>{let R=!1,H=!1;const oe={name:_};if(!t.disabled){if(!D||z){(f.isDirty||m.isDirty)&&(H=r.isDirty,r.isDirty=oe.isDirty=U(),R=H!==oe.isDirty);const se=zt(G(o,_),k);H=!!G(r.dirtyFields,_),se!==r.isDirty?r.dirtyFields=ln(o,s):se?st(r.dirtyFields,_):Qe(r.dirtyFields,_,!0),oe.dirtyFields=r.dirtyFields,R=R||(f.dirtyFields||m.dirtyFields)&&H!==!se}if(D){const se=G(r.touchedFields,_);se||(Qe(r.touchedFields,_,D),oe.touchedFields=r.touchedFields,R=R||(f.touchedFields||m.touchedFields)&&se!==D)}R&&V&&g.state.next(oe)}return R?oe:{}},x=(_,k,D,z)=>{const V=G(r.errors,_),R=(f.isValid||m.isValid)&&Ut(k)&&r.isValid!==k;if(t.delayError&&D?(c=h(()=>w(_,D)),c(t.delayError)):(clearTimeout(d),c=null,D?Qe(r.errors,_,D):st(r.errors,_),r.errors={...r.errors}),(D?!zt(V,D):V)||!ft(z)||R){const H={...z,...R&&Ut(k)?{isValid:k}:{},errors:r.errors,name:_};r={...r,...H},g.state.next(H)}},F=async _=>(y(_,!0),await t.resolver(s,t.context,DE(_||i.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),P=async _=>{const{errors:k}=await F(_);if(y(_),_){for(const D of _){const z=G(k,D);z?i.array.has(D)&&Ye(z)&&!Object.keys(z).some(V=>!Number.isNaN(Number(V)))?ip(r.errors,{[D]:z},D):Qe(r.errors,D,z):st(r.errors,D)}r.errors={...r.errors}}else r.errors=k;return k},N=async({name:_,eventType:k})=>{if(e.validate){const D=await e.validate({formValues:s,formState:r,name:_,eventType:k});if(Ye(D))for(const z in D){const V=D[z];V&&be(`${kl}.${z}`,{message:It(V.message)?V.message:"",type:V.type||ir.validate})}else It(D)||!D?be(kl,{message:D||"",type:ir.validate}):he(kl);return D}return!0},M=async({fields:_,onlyCheckValid:k,name:D,eventType:z,context:V={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(V.runRootValidation=!0,!await N({name:D,eventType:z})&&(V.valid=!1,k)))return V.valid;for(const R in _){const H=_[R];if(H){const{_f:oe,...se}=H;if(oe){const Fe=i.array.has(oe.name),Je=H._f&&LE(H._f),dt=f.validatingFields||f.isValidating||m.validatingFields||m.isValidating;Je&&dt&&y([oe.name],!0);const er=await cp(H,i.disabled,s,b,t.shouldUseNativeValidation&&!k,Fe);if(Je&&dt&&y([oe.name]),er[oe.name]&&(V.valid=!1,k)||(!k&&(G(er,oe.name)?Fe?ip(r.errors,er,oe.name):Qe(r.errors,oe.name,er[oe.name]):st(r.errors,oe.name)),e.shouldUseNativeValidation&&er[oe.name]))break}!ft(se)&&await M({context:V,onlyCheckValid:k,fields:se,name:R,eventType:z})}}return V.valid},B=()=>{for(const _ of i.unMount){const k=G(n,_);k&&(k._f.refs?k._f.refs.every(D=>!Ml(D)):!Ml(k._f.ref))&&Ae(_)}i.unMount=new Set},U=(_,k)=>!t.disabled&&(_&&k&&Qe(s,_,k),!zt(q(),o)),ee=(_,k,D)=>Ol(_,i,{...a.mount?s:Ge(k)?o:It(_)?{[_]:k}:k},D,k),Q=_=>Wh(G(a.mount?s:o,_,t.shouldUnregister?G(o,_,[]):[])),te=(_,k,D={},z=!1)=>{const V=G(n,_);let R=k;if(V){const H=V._f;H&&(!H.disabled&&Qe(s,_,ep(k,H)),R=Ea(H.ref)&&bt(k)?"":k,Kh(H.ref)?[...H.ref.options].forEach(oe=>oe.selected=R.includes(oe.value)):H.refs?Wo(H.ref)?H.refs.forEach(oe=>{(!oe.defaultChecked||!oe.disabled)&&(Array.isArray(R)?oe.checked=!!R.find(se=>se===oe.value):oe.checked=R===oe.value||!!R)}):H.refs.forEach(oe=>oe.checked=oe.value===R):xl(H.ref)?H.ref.value="":(H.ref.value=R,H.ref.type||g.state.next({name:_,values:z?s:et(s)})))}(D.shouldDirty||D.shouldTouch)&&A(_,R,D.shouldTouch,D.shouldDirty,!0),D.shouldValidate&&$(_)},ue=(_,k,D,z=!1)=>{for(const V in k){if(!k.hasOwnProperty(V))return;const R=k[V],H=_+"."+V,oe=G(n,H);(i.array.has(_)||Ye(R)||oe&&!oe._f)&&!an(R)?ue(H,R,D,z):te(H,R,D,z)}},fe=(_,k,D,z)=>{const V=G(n,_),R=i.array.has(_),H=z?k:et(k),oe=G(s,_),se=zt(oe,H);if(se||Qe(s,_,H),R)g.array.next({name:_,values:z?s:et(s)}),(f.isDirty||f.dirtyFields||m.isDirty||m.dirtyFields)&&D.shouldDirty&&(C(),g.state.next({name:_,dirtyFields:r.dirtyFields,isDirty:U(_,H)}));else{const Fe=Array.isArray(H)&&!H.length||ft(H);!V||V._f||bt(H)||Fe?te(_,H,D,z):ue(_,H,D,z)}if(!se){const Fe=ql(_,i),Je=z?s:et(s);g.state.next({...Fe&&r,name:a.mount||Fe?_:void 0,values:Je})}},pe=(_,k,D={})=>fe(_,k,D,!1),ie=(_,k={})=>{const D=kt(_)?_(s):_;if(!zt(s,D)){s={...s,...D};for(const z of i.mount)fe(z,G(D,z),k,!0);g.state.next({...r,name:void 0,type:void 0,values:s}),k.shouldValidate&&v()}},Te=async _=>{a.mount=!0;const k=_.target;let D=k.name,z=!0;const V=G(n,D),R=se=>{z=Number.isNaN(se)||an(se)&&isNaN(se.getTime())||zt(se,G(s,D,se))},H=op(t.mode),oe=op(t.reValidateMode);if(V){let se,Fe;const Je=k.type?np(V._f):Al(_),dt=_.type===$r.BLUR||_.type===$r.FOCUS_OUT,er=!OE(V._f)&&!e.validate&&!t.resolver&&!G(r.errors,D)&&!V._f.deps||xE(dt,G(r.touchedFields,D),r.isSubmitted,oe,H),is=ql(D,i,dt);Qe(s,D,Je),dt?(!k||!k.readOnly)&&(V._f.onBlur&&V._f.onBlur(_),c&&c(0)):V._f.onChange&&V._f.onChange(_);const wn=A(D,Je,dt),mt=!ft(wn)||is;if(!dt&&g.state.next({name:D,type:_.type,values:et(s)}),er)return(f.isValid||m.isValid)&&(t.mode==="onBlur"?dt&&v():dt||v()),mt&&g.state.next({name:D,...is?{}:wn});if(!t.resolver&&e.validate&&await N({name:D,eventType:_.type}),!dt&&is&&g.state.next({...r}),t.resolver){const{errors:Lt}=await F([D]);if(y([D]),R(Je),!z){!ft(wn)&&g.state.next(wn);return}const Nt=ap(r.errors,n,D),cr=ap(Lt,n,Nt.name||D);se=cr.error,D=cr.name,Fe=ft(Lt)}else y([D],!0),se=(await cp(V,i.disabled,s,b,t.shouldUseNativeValidation))[D],y([D]),R(Je),z&&(se?Fe=!1:(f.isValid||m.isValid)&&(Fe=await M({fields:n,onlyCheckValid:!0,name:D,eventType:_.type})));z&&(V._f.deps&&(!Array.isArray(V._f.deps)||V._f.deps.length>0)&&$(V._f.deps),x(D,Fe,se,wn))}},ye=(_,k)=>{if(G(r.errors,k)&&_.focus)return _.focus(),1},$=async(_,k={})=>{let D,z;const V=Ta(_);if(t.resolver){const R=await P(Ge(_)?_:V);D=ft(R),z=_?!V.some(H=>G(R,H)):D}else _?(z=(await Promise.all(V.map(async R=>{const H=G(n,R);return await M({fields:H&&H._f?{[R]:H}:H,eventType:$r.TRIGGER})}))).every(Boolean),!(!z&&!r.isValid)&&v()):z=D=await M({fields:n,name:_,eventType:$r.TRIGGER});return g.state.next({...!It(_)||(f.isValid||m.isValid)&&D!==r.isValid?{}:{name:_},...t.resolver||!_?{isValid:D}:{},errors:r.errors}),k.shouldFocus&&!z&&Yo(n,ye,_?V:i.mount),z},q=(_,k)=>{let D={...a.mount?s:o};return k&&(D=Gh(k.dirtyFields?r.dirtyFields:r.touchedFields,D)),Ge(_)?D:It(_)?G(D,_):_.map(z=>G(D,z))},Z=(_,k)=>({invalid:!!G((k||r).errors,_),isDirty:!!G((k||r).dirtyFields,_),error:G((k||r).errors,_),isValidating:!!G(r.validatingFields,_),isTouched:!!G((k||r).touchedFields,_)}),he=_=>{const k=_?Ta(_):void 0;k==null||k.forEach(D=>st(r.errors,D)),k?k.forEach(D=>{g.state.next({name:D,errors:r.errors})}):g.state.next({errors:{}})},be=(_,k,D)=>{const z=(G(n,_,{_f:{}})._f||{}).ref,V=G(r.errors,_)||{},{ref:R,message:H,type:oe,...se}=V;Qe(r.errors,_,{...se,...k,ref:z}),g.state.next({name:_,errors:r.errors,isValid:!1}),D&&D.shouldFocus&&z&&z.focus&&z.focus()},ge=(_,k)=>kt(_)?g.state.subscribe({next:D=>"values"in D&&_(D.values||ee(void 0,k),D)}):ee(_,k,!0),le=_=>g.state.subscribe({next:k=>{if(NE(_.name,k.name,_.exact)&&PE(k,_.formState||f,Cn,_.reRenderRoot)){const D={...s};_.callback({values:D,...r,...k,defaultValues:o})}}}).unsubscribe,ve=_=>(a.mount=!0,m={...m,..._.formState},le({..._,formState:{...u,..._.formState}})),Ae=(_,k={})=>{for(const D of _?Ta(_):i.mount)i.mount.delete(D),i.array.delete(D),k.keepValue||(st(n,D),st(s,D)),!k.keepError&&st(r.errors,D),!k.keepDirty&&st(r.dirtyFields,D),!k.keepTouched&&st(r.touchedFields,D),!k.keepIsValidating&&st(r.validatingFields,D),!t.shouldUnregister&&!k.keepDefaultValue&&st(o,D);g.state.next({values:et(s)}),g.state.next({...r,...k.keepDirty?{isDirty:U()}:{}}),!k.keepIsValid&&v()},Y=({disabled:_,name:k})=>{if(Ut(_)&&a.mount||_||i.disabled.has(k)){const V=i.disabled.has(k)!==!!_;_?i.disabled.add(k):i.disabled.delete(k),V&&a.mount&&!a.action&&v()}},de=(_,k={})=>{let D=G(n,_);const z=Ut(k.disabled)||Ut(t.disabled),V=!i.registerName.has(_)&&D&&D._f&&!D._f.mount;return Qe(n,_,{...D||{},_f:{...D&&D._f?D._f:{ref:{name:_}},name:_,mount:!0,...k}}),i.mount.add(_),D&&!V?Y({disabled:Ut(k.disabled)?k.disabled:t.disabled,name:_}):L(_,!0,k.value),{...z?{disabled:k.disabled||t.disabled}:{},...t.progressive?{required:!!k.required,min:Ko(k.min),max:Ko(k.max),minLength:Ko(k.minLength),maxLength:Ko(k.maxLength),pattern:Ko(k.pattern)}:{},name:_,onChange:Te,onBlur:Te,ref:R=>{if(R){i.registerName.add(_),de(_,k),i.registerName.delete(_),D=G(n,_);const H=Ge(R.value)&&R.querySelectorAll&&R.querySelectorAll("input,select,textarea")[0]||R,oe=EE(H),se=D._f.refs||[];if(oe?se.find(Fe=>Fe===H):H===D._f.ref)return;Qe(n,_,{_f:{...D._f,...oe?{refs:[...se.filter(Ml),H,...Array.isArray(G(o,_))?[{}]:[]],ref:{type:H.type,name:_}}:{ref:H}}}),L(_,!1,void 0,H)}else D=G(n,_,{}),D._f&&(D._f.mount=!1),(t.shouldUnregister||k.shouldUnregister)&&!(jh(i.array,_)&&a.action)&&i.unMount.add(_)}}},W=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&Yo(n,ye,i.mount),Ce=_=>{Ut(_)&&(g.state.next({disabled:_}),Yo(n,(k,D)=>{const z=G(n,D);z&&(k.disabled=z._f.disabled||_,Array.isArray(z._f.refs)&&z._f.refs.forEach(V=>{V.disabled=z._f.disabled||_}))},0,!1))},Ve=(_,k)=>async D=>{let z;D&&(D.preventDefault&&D.preventDefault(),D.persist&&D.persist());let V=et(s);if(g.state.next({isSubmitting:!0}),t.resolver){const{errors:R,values:H}=await F();y(),r.errors=R,V=et(H)}else await M({fields:n,eventType:$r.SUBMIT});if(i.disabled.size)for(const R of i.disabled)st(V,R);if(st(r.errors,zh),ft(r.errors)){g.state.next({errors:{}});try{await _(V,D)}catch(R){z=R}}else k&&await k({...r.errors},D),W(),setTimeout(W);if(g.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ft(r.errors)&&!z,submitCount:r.submitCount+1,errors:r.errors}),z)throw z},nt=(_,k={})=>{G(n,_)&&(Ge(k.defaultValue)?pe(_,et(G(o,_))):(pe(_,k.defaultValue),Qe(o,_,et(k.defaultValue))),k.keepTouched||st(r.touchedFields,_),k.keepDirty||(st(r.dirtyFields,_),r.isDirty=k.defaultValue?U(_,et(G(o,_))):U()),k.keepError||(st(r.errors,_),f.isValid&&v()),g.state.next({...r}))},He=(_,k={})=>{const D=_?et(_):o,z=et(D),V=ft(_),R=z;if(k.keepDefaultValues||(o=D),!k.keepValues){if(k.keepDirtyValues){const H=new Set([...i.mount,...Object.keys(ln(o,s))]);for(const oe of Array.from(H)){const se=G(r.dirtyFields,oe),Fe=G(s,oe),Je=G(R,oe);se&&!Ge(Fe)?Qe(R,oe,Fe):!se&&!Ge(Je)&&pe(oe,Je)}}else{if(wa&&Ge(_))for(const H of i.mount){const oe=G(n,H);if(oe&&oe._f){const se=Array.isArray(oe._f.refs)?oe._f.refs[0]:oe._f.ref;if(Ea(se)){const Fe=se.closest("form");if(Fe){Fe.reset();break}}}}if(k.keepFieldsRef)for(const H of i.mount)pe(H,G(R,H));else n={}}if(t.shouldUnregister){if(s=k.keepDefaultValues?et(o):{},k.keepFieldsRef)for(const H of i.mount)Qe(s,H,G(R,H))}else s=et(R);g.array.next({values:{...R}}),g.state.next({values:{...R}})}i={mount:k.keepDirtyValues?i.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!f.isValid||!!k.keepIsValid||!!k.keepDirtyValues||!t.shouldUnregister&&!ft(R),a.watch=!!t.shouldUnregister,a.keepIsValid=!!k.keepIsValid,a.action=!1,k.keepErrors||(r.errors={}),g.state.next({submitCount:k.keepSubmitCount?r.submitCount:0,isDirty:V?!1:k.keepDirty?r.isDirty:k.keepValues?U():!!(k.keepDefaultValues&&!zt(_,o)),isSubmitted:k.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:V?{}:k.keepDirtyValues?k.keepDefaultValues&&s?ln(o,s):r.dirtyFields:k.keepDefaultValues&&_?ln(o,_):k.keepDirty?r.dirtyFields:{},touchedFields:k.keepTouched?r.touchedFields:{},errors:k.keepErrors?r.errors:{},isSubmitSuccessful:k.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},Ke=(_,k)=>He(kt(_)?_(s):_,{...t.resetOptions,...k}),ot=(_,k={})=>{const D=G(n,_),z=D&&D._f;if(z){const V=z.refs?z.refs[0]:z.ref;V.focus&&setTimeout(()=>{V.focus(),k.shouldSelect&&kt(V.select)&&V.select()})}},Cn=_=>{r={...r,..._}},Sn={control:{register:de,unregister:Ae,getFieldState:Z,handleSubmit:Ve,setError:be,_subscribe:le,_runSchema:F,_updateIsValidating:y,_focusError:W,_getWatch:ee,_getDirty:U,_setValid:v,_setFieldArray:S,_setDisabledField:Y,_setErrors:T,_getFieldArray:Q,_reset:He,_resetDefaultValues:()=>kt(t.defaultValues)&&t.defaultValues().then(_=>{Ke(_,t.resetOptions),g.state.next({isLoading:!1})}),_removeUnmounted:B,_disableForm:Ce,_subjects:g,_proxyFormState:f,get _fields(){return n},get _formValues(){return s},get _state(){return a},set _state(_){a=_},get _defaultValues(){return o},get _names(){return i},set _names(_){i=_},get _formState(){return r},get _options(){return t},set _options(_){t={...t,..._}}},subscribe:ve,trigger:$,register:de,handleSubmit:Ve,watch:ge,setValue:pe,setValues:ie,getValues:q,reset:Ke,resetField:nt,resetDefaultValues:(_,k={})=>{if(o=et(_),!k.keepDirty){const D=ln(o,s);r.dirtyFields=D,r.isDirty=!ft(D)}k.keepIsValid||v(),g.state.next({...r,defaultValues:o})},clearErrors:he,unregister:Ae,setError:be,setFocus:ot,getFieldState:Z};return{...Sn,formControl:Sn}}function BE(e={}){const t=p.useRef(void 0),r=p.useRef(void 0),n=p.useRef(e.formControl),[o,s]=p.useState(()=>({...et(dp),isLoading:kt(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:kt(e.defaultValues)?void 0:e.defaultValues}));if(!t.current||e.formControl&&n.current!==e.formControl)if(n.current=e.formControl,e.formControl)t.current={...e.formControl,formState:o},e.defaultValues&&!kt(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:i,...c}=$E(e);t.current={...c,formState:o}}const a=t.current.control;return a._options=e,Ll(()=>{const i=a._subscribe({formState:a._proxyFormState,callback:()=>s({...a._formState,defaultValues:a._defaultValues}),reRenderRoot:!0});return s(c=>({...c,isReady:!0})),a._formState.isReady=!0,i},[a]),p.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),p.useEffect(()=>{e.mode&&(a._options.mode=e.mode),e.reValidateMode&&(a._options.reValidateMode=e.reValidateMode)},[a,e.mode,e.reValidateMode]),p.useEffect(()=>{e.errors&&(a._setErrors(e.errors),a._focusError())},[a,e.errors]),p.useEffect(()=>{e.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,e.shouldUnregister]),p.useEffect(()=>{if(a._proxyFormState.isDirty){const i=a._getDirty();i!==o.isDirty&&a._subjects.state.next({isDirty:i})}},[a,o.isDirty]),p.useEffect(()=>{var i;e.values&&!zt(e.values,r.current)?(a._reset(e.values,{keepFieldsRef:!0,...a._options.resetOptions}),!((i=a._options.resetOptions)===null||i===void 0)&&i.keepIsValid||a._setValid(),r.current=e.values,s(c=>({...c}))):a._resetDefaultValues()},[a,e.values]),p.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=p.useMemo(()=>Hh(o,a),[a,o]),t.current}function qE(e,t,r){const n=e??[],o=new Set(n.map(u=>u.type).filter(Boolean)),s=(t??[]).filter(u=>!o.has(u)),{data:a}=_n({queryKey:["framework-search",s.sort().join(","),r],queryFn:()=>kS({type:s,systemDefault:"Yes"}),enabled:s.length>0,staleTime:600*1e3}),i=t&&t.length?n.filter(u=>u.type&&t.includes(u.type)):n,c=[...(a??[]).map(u=>({label:u.name,value:u.identifier})),...i.map(u=>({label:u.name,value:u.identifier}))],d=new Set;return c.filter(u=>d.has(u.value)?!1:(d.add(u.value),!0))}async function up(e){var r,n;return(n=(r=(await Me.get(`/action/channel/v1/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.channel}function jE(e){var r,n,o,s,a,i,c;const t=_n({queryKey:["channel",e],queryFn:()=>up(e),enabled:!!e,staleTime:6e5});return{identifier:((r=t.data)==null?void 0:r.identifier)??e??"",name:(n=t.data)==null?void 0:n.name,frameworks:(o=t.data)==null?void 0:o.frameworks,collectionAdditionalCategories:(s=t.data)==null?void 0:s.collectionAdditionalCategories,contentAdditionalCategories:(a=t.data)==null?void 0:a.contentAdditionalCategories,defaultLicense:(i=t.data)==null?void 0:i.defaultLicense,defaultFramework:(c=t.data)==null?void 0:c.defaultFramework,isLoading:t.isLoading}}function UE(e){const{data:t}=_n({queryKey:["user","read",e],enabled:!!e,staleTime:1/0,queryFn:()=>MS(e)});return t&&([t.firstName,t.lastName].filter(Boolean).join(" ").trim()||t.userName)||void 0}const fp=[{label:"Strict",value:"strict"},{label:"Adaptive",value:"adaptive"},{label:"Prior learning",value:"priorLearning"}],zE={"First Section":{title:"Basic Information",description:"Core details that define the content identity."},"Second Section":{title:"Categorisation",description:"Category and type classification for the content."},"Third Section":{title:"Categorisation",description:"Category and type classification for the content."},"Organisation Framework Terms":{title:"Curriculum",description:"Framework-aligned categorisation."},"Target Framework Terms":{title:"Target Audience",description:"Curriculum alignment for the intended learners."},"Fourth Section":{title:"Licensing & Attribution",description:"Copyright and usage rights information."},"Sixth Section":{title:"Licensing & Attribution",description:"Copyright and usage rights information."},"Consumption policy":{title:"Consumption policy",description:"How learners move through this path."}},VE=new Set(["review","read","sourcingreview","orgreview"]),ka={"First Section":"details","Second Section":"details","Third Section":"details","Organisation Framework Terms":"details","Target Framework Terms":"audience","Fourth Section":"licensing","Sixth Section":"licensing"},HE={Categorisation:"Second Section","Basic Information":"First Section","Licensing & Attribution":"Fourth Section",Curriculum:"Organisation Framework Terms","Target Audience":"Target Framework Terms"},QE={name:"details",description:"details",keywords:"details",appIcon:"details",primaryCategory:"details",additionalCategories:"details",board:"details",boardIds:"details",subject:"details",subjectIds:"details",medium:"details",framework:"details",topicsIds:"details",topic:"details",dialcodeRequired:"details",dialcodes:"details",audience:"audience",targetBoardIds:"audience",targetMediumIds:"audience",targetGradeLevelIds:"audience",targetSubjectIds:"audience",gradeLevel:"audience",creator:"licensing",author:"licensing",attributions:"licensing",license:"licensing",copyright:"licensing",copyrightYear:"licensing"},Zo={board:"board",boardIds:"board",medium:"medium",gradeLevel:"gradeLevel",subject:"subject",subjectIds:"subject",topicsIds:"topic",topic:"topic",targetBoardIds:"board",targetMediumIds:"medium",targetGradeLevelIds:"gradeLevel",targetSubjectIds:"subject"},jl=new Set(["targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds"]);function hp(e,t,r,n,o={}){if(!(e!=null&&e.length))return pp(dA(t,n,r,o),r,t,n,o);const s=new Map;for(const c of e){const d=c.code;d&&!s.has(d)&&s.set(d,c)}const a=new Set,i=e.filter(c=>{var u;if(n&&(c.code==="dialCode"||c.code==="dialcode")||((u=o.profile)==null?void 0:u.key)==="learningPath"&&jl.has(c.code)||c.visible===!1)return!1;const d=c.code;return a.has(d)?!1:(a.add(d),!0)}).map(c=>{const d=c.code??"",u=XE(c),f=JE(c,r,t,s,o),m=t[d],g=RE(d,gp(m,u),u,t,o),b={code:d,label:c.label??d,inputType:u,required:!!(c.required===!0||Array.isArray(c.validations)&&c.validations.some(h=>h.type==="required")),editable:WE(d,c.editable!==!1,o),placeholder:c.placeholder,maxLength:c.maxLength,options:YE(f,g,u,r),depends:c.depends,tab:ZE(c),section:c.section,sourceCategory:c.sourceCategory,defaultValue:c.defaultValue??c.default,currentValue:g};if(d==="dialcodes"){const h=t.dialcodeRequired==="Yes";return{...b,required:h,visible:h}}return b});return pp(i,r,t,n,o)}function pp(e,t,r,n,o){var s;return((s=o.profile)==null?void 0:s.key)==="learningPath"?cA(e,t,r,n):lA(e,t,r,n)}function WE(e,t,r){var s;const n=r.editorMode??"edit";if(!VE.has(n))return t!==!1;const o=(s=r.editableFields)==null?void 0:s[n];return!!(o&&o.includes(e))}function RE(e,t,r,n,o){const s=t==null||t===""||Array.isArray(t)&&t.length===0;switch(e){case"license":return s?o.defaultLicense??"":t;case"copyright":return s&&o.channelName?o.channelName:t;case"copyrightYear":return s?String(new Date().getFullYear()):t;case"author":case"creator":return s&&o.userFullName?o.userFullName:t;case"instructions":{const a=n.instructions;return a&&typeof a=="object"&&!Array.isArray(a)?a.default??"":typeof t=="object"&&t!==null?"":t}case"maxTime":case"warningTime":{if(!s)return t;const a=n.timeLimits,i=a==null?void 0:a[e];return i!=null&&i!==""?GE(Number(i)):t}default:return t}}function GE(e){if(!Number.isFinite(e)||e<0)return"";const t=Math.floor(e%60),r=Math.floor(e/60%60),n=Math.floor(e/3600),o=s=>String(s).padStart(2,"0");return n>0?`${o(n)}:${o(r)}:${o(t)}`:`${o(r)}:${o(t)}`}function KE(e){var n,o,s;const t=new Map,r=a=>a==null?void 0:a.forEach(i=>{i.identifier&&t.set(i.identifier,i.name),i.name&&t.set(i.name,i.name)});return(o=(n=e.organisationFramework)==null?void 0:n.categories)==null||o.forEach(a=>r(a.terms)),(s=e.targetFrameworks)==null||s.forEach(a=>{var i;return(i=a.categories)==null?void 0:i.forEach(c=>r(c.terms))}),t}function YE(e,t,r,n){if(r!=="select"&&r!=="multiselect"&&r!=="radio")return e;const o=Array.isArray(t)?t:t!=null&&t!==""?[t]:[];if(!o.length)return e;const s=e?[...e]:[],a=new Set(s.map(c=>c.value)),i=KE(n);for(const c of o){const d=String(c);a.has(d)||(s.push({label:i.get(d)??d,value:d}),a.add(d))}return s}function ZE(e){const t=e.section;if(t){if(ka[t])return ka[t];const n=HE[t];if(n&&ka[n])return ka[n]}const r=e.code??"";return QE[r]??"details"}function gp(e,t){const r=new Set(["multiselect","chips","keywords","tagsinput"]),n=new Set(["select","text","textarea","radio","datepicker","datetime","license"]);return r.has(t)?Array.isArray(e)?e:e!=null&&e!==""?[e]:[]:n.has(t)?Array.isArray(e)?e[0]??"":e??"":e}function XE(e){const t=(e.inputType??e.dataType??"").toLowerCase(),n=(e.dataType??"").toLowerCase()==="list";return t==="select"?"select":t==="framework"||t==="frameworkcategoryselect"?n?"multiselect":"select":t==="topicselector"?"chips":t==="multiselect"||t==="multi-select"?"multiselect":t==="keywords"||e.code==="keywords"||e.code==="topic"||e.code==="topicsIds"?"chips":t==="radio"?"radio":e.code==="appIcon"||t==="appicon"?"appIcon":t==="textarea"||e.code==="description"?"textarea":t==="datepicker"||t==="date"?"datepicker":t==="datetime"||t==="datetime-local"?"datetime":t==="tagsinput"?"tagsinput":t==="nestedselect"||t==="nested-select"?n?"multiselect":"select":t==="license"?"license":t==="dialcode"||t==="dial-code"?"dialcode":"text"}function JE(e,t,r,n,o){var d;const s=e.code??"";if(((d=o.profile)==null?void 0:d.key)==="learningPath"&&s==="policy")return fp;if(s==="maxQuestions"){const u=o.childCount??0;if(u>0)return Array.from({length:u},(f,m)=>({label:String(m+1),value:String(m+1)}))}const a=e.range;if(Array.isArray(a)&&a.length)return typeof a[0]=="string"?a.map(u=>({label:u,value:u})):a.map(u=>({label:u.name,value:u.identifier}));const i=e.enum;if(i!=null&&i.length)return i.map(u=>({label:u,value:u}));if(s==="framework")return t.orgFrameworks;if(s==="additionalCategories"){const f=(o.objectType??"")==="QuestionSet"?o.contentAdditionalCategories??o.collectionAdditionalCategories:o.collectionAdditionalCategories??o.contentAdditionalCategories,m=(f&&f.length?f:o.contextAdditionalCategories)??t.channelAdditionalCategories;return m!=null&&m.length?nA(m).map(g=>({label:g,value:g})):void 0}const c=e.sourceCategory??Zo[s];if(c)return mp(s,c,e,t,r,n)}function eA(e,t){return jl.has(e)||t.output==="identifier"||typeof t.section=="string"&&t.section.includes("Target")}function tA(e,t){return jl.has(e)||typeof t.section=="string"&&t.section.includes("Target")}function Ul(e,t,r){var s,a,i,c,d;const n=(a=(s=e.organisationFramework)==null?void 0:s.categories)==null?void 0:a.find(u=>u.code===t),o=(d=(c=(i=e.targetFrameworks)==null?void 0:i[0])==null?void 0:c.categories)==null?void 0:d.find(u=>u.code===t);return r?(o==null?void 0:o.terms)??(n==null?void 0:n.terms)??[]:(n==null?void 0:n.terms)??(o==null?void 0:o.terms)??[]}function rA(e){const t=new Set,r=[];for(const n of e){const o=n.identifier??n.name;o&&!t.has(o)&&(t.add(o),r.push(n))}return r}function nA(e){return Array.from(new Set(e))}function oA(e){return Array.isArray(e)?e:e!=null&&e!==""?[e]:[]}function mp(e,t,r,n,o,s){const a=eA(e,r),i=tA(e,r),c=h=>({label:h.name,value:a?h.identifier:h.name}),d=r.depends;if(!(d!=null&&d.length))return Ul(n,t,i).map(c);const u=d.flatMap(h=>oA(o[h])).map(String);if(!u.length)return[];const f=[];for(const h of d){const v=s.get(h),y=(v==null?void 0:v.sourceCategory)??Zo[h]??h;f.push(...Ul(n,y,i))}const g=f.filter(h=>u.includes(String(h.name))||u.includes(String(h.identifier))||u.includes(String(h.code))).flatMap(h=>h.associations??[]).filter(h=>String(h.category??"").toLowerCase()===t.toLowerCase()),b=rA(g);return b.length?b.map(c):Ul(n,t,i).map(c)}function Xo(e,t){const r=Zo[e];if(r)return mp(e,r,{},t,{},new Map)}function Ze(e,t,r){return gp(e[t],r)}const sA=["board","medium","gradeLevel","subject"];function aA(e){var r;const t=((r=e.organisationFramework)==null?void 0:r.categories)??[];return t.length?t.some(n=>sA.includes(n.code)):!0}function iA(e,t){var r,n,o;return!!((n=(r=e.organisationFramework)==null?void 0:r.categories)!=null&&n.some(s=>s.code===t)||(o=e.targetFrameworks)!=null&&o.some(s=>{var a;return(a=s.categories)==null?void 0:a.some(i=>i.code===t)}))}function lA(e,t,r,n){var c;if(!n||aA(t))return e;const o=e.filter(d=>{const u=d.sourceCategory??Zo[d.code];return!u||iA(t,u)}),s=new Set(o.map(d=>d.code)),a=[];for(const d of((c=t.organisationFramework)==null?void 0:c.categories)??[])s.has(d.code)||a.push({code:d.code,label:d.name,inputType:"multiselect",editable:!0,tab:"details",section:"Organisation Framework Terms",options:(d.terms??[]).map(u=>({label:u.name,value:u.name})),currentValue:Ze(r,d.code,"multiselect")});if(!a.length)return o;const i=o.findIndex(d=>d.code==="framework");return i>=0?[...o.slice(0,i+1),...a,...o.slice(i+1)]:[...o,...a]}const zl="Organisation Framework Terms";function cA(e,t,r,n){var m,g;if(!n)return e;const o=[...((m=t.organisationFramework)==null?void 0:m.categories)??[]].sort((b,h)=>(b.index??1/0)-(h.index??1/0));if(!o.length)return e;const s=(g=Hu(o))==null?void 0:g.code,a=b=>b.sourceCategory??Zo[b.code];let c=e.filter(b=>{const h=a(b);return h?h!==s&&o.some(v=>v.code===h):!0}).map(b=>a(b)?{...b,section:zl,required:!0,inputType:"select",currentValue:Ze(r,b.code,"select")}:b),d=c.findIndex(b=>b.code==="framework");if(d===-1){const b={code:"framework",label:"Curriculum",inputType:"select",required:!0,editable:!0,tab:"details",section:zl,options:t.orgFrameworks,currentValue:Ze(r,"framework","select")},h=c.findIndex(v=>!!a(v));d=h>=0?h:c.length,c=[...c.slice(0,d),b,...c.slice(d)]}const u=new Set(c.map(b=>b.code)),f=o.filter(b=>b.code!==s&&!u.has(b.code)).map(b=>({code:b.code,label:b.name,inputType:"select",required:!0,editable:!0,tab:"details",section:zl,options:(b.terms??[]).map(h=>({label:h.name,value:h.name})),currentValue:Ze(r,b.code,"select")}));return f.length?[...c.slice(0,d+1),...f,...c.slice(d+1)]:c}function dA(e,t,r,n={}){var s,a;const o=[{code:"name",label:"Title",inputType:"text",required:!0,editable:!0,tab:"details",section:"First Section",maxLength:200,currentValue:Ze(e,"name","text")},{code:"description",label:"Description",inputType:"textarea",editable:!0,tab:"details",section:"First Section",maxLength:2e3,currentValue:Ze(e,"description","textarea")},{code:"keywords",label:"Keywords",inputType:"chips",editable:!0,tab:"details",section:"First Section",currentValue:Ze(e,"keywords","chips")}];return t?((s=n.profile)==null?void 0:s.key)==="learningPath"?(o.push({code:"framework",label:"Curriculum",inputType:"select",required:!0,editable:!0,tab:"details",section:"Organisation Framework Terms",options:r.orgFrameworks,currentValue:Ze(e,"framework","select")},{code:"policy",label:"Consumption policy",inputType:"select",required:!0,editable:!0,tab:"details",section:"Consumption policy",options:fp,currentValue:Ze(e,"policy","select")||"strict"}),o):(o.push({code:"primaryCategory",label:"Category",inputType:"select",editable:!1,tab:"details",section:"Second Section",currentValue:Ze(e,"primaryCategory","select")},{code:"additionalCategories",label:"Additional Category",inputType:"multiselect",editable:!0,tab:"details",section:"Second Section",currentValue:Ze(e,"additionalCategories","multiselect"),options:(a=r.channelAdditionalCategories)==null?void 0:a.map(i=>({label:i,value:i}))},{code:"framework",label:"Course Type",inputType:"select",required:!0,editable:!0,tab:"details",section:"Organisation Framework Terms",options:r.orgFrameworks,currentValue:Ze(e,"framework","select")},{code:"subjectIds",label:"Subjects covered",inputType:"multiselect",required:!0,editable:!0,tab:"details",section:"Organisation Framework Terms",options:Xo("subjectIds",r),currentValue:Ze(e,"subjectIds","multiselect")}),o.push({code:"audience",label:"Audience Type",inputType:"multiselect",editable:!0,tab:"audience",section:"Target Framework Terms",currentValue:Ze(e,"audience","multiselect")},{code:"targetBoardIds",label:"Board/Syllabus of the audience",inputType:"select",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",options:Xo("targetBoardIds",r),currentValue:Ze(e,"targetBoardIds","select")},{code:"targetMediumIds",label:"Medium(s) of the audience",inputType:"multiselect",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",depends:["targetBoardIds"],options:Xo("targetMediumIds",r),currentValue:Ze(e,"targetMediumIds","multiselect")},{code:"targetGradeLevelIds",label:"Class(es) of the audience",inputType:"multiselect",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",depends:["targetMediumIds"],options:Xo("targetGradeLevelIds",r),currentValue:Ze(e,"targetGradeLevelIds","multiselect")},{code:"targetSubjectIds",label:"Subject(s) of the audience",inputType:"multiselect",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",depends:["targetGradeLevelIds"],options:Xo("targetSubjectIds",r),currentValue:Ze(e,"targetSubjectIds","multiselect")}),o.push({code:"creator",label:"Author",inputType:"text",editable:!0,tab:"licensing",section:"Fourth Section",currentValue:Ze(e,"creator","text")},{code:"attributions",label:"Attributions",inputType:"text",editable:!0,tab:"licensing",section:"Fourth Section",currentValue:Ze(e,"attributions","text")},{code:"copyright",label:"Copyright",inputType:"text",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:Ze(e,"copyright","text")},{code:"copyrightYear",label:"Copyright Year",inputType:"text",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:Ze(e,"copyrightYear","text")},{code:"license",label:"License",inputType:"select",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:Ze(e,"license","select")}),o):o}const uA=["allowECM","levels","setPeriod","instances"];function vp(e){const t={};return e.forEach((r,n)=>{t[`L${n+1}`]={label:r}}),t}function fA(e,t={}){const r={...e};for(const s of uA)delete r[s];const n=e.levels;Array.isArray(n)&&n.length&&(r.outcomeDeclaration={levels:vp(n)});const o=e.instances;return o!=null&&o!==""&&(r.instances={label:o}),t.isReview&&(r.name===void 0||r.name===null||r.name==="")&&t.nodeTitle&&(r.name=t.nodeTitle),r}function hA(e,t){return e==="allowECM"||e==="setPeriod"?null:e==="levels"?{outcomeDeclaration:{levels:Array.isArray(t)?vp(t):{}}}:e==="instances"?{instances:t!=null&&t!==""?{label:t}:""}:{[e]:t}}function pA(e,t){const{watch:r,setValue:n}=e,o=p.useRef(!1);p.useEffect(()=>{const s=r((a,{name:i})=>{var c;if(!(!i||o.current)){o.current=!0;try{const d=new Set([i]);let u=!0;for(;u;){u=!1;for(const f of t)d.has(f.code)||(c=f.depends)!=null&&c.some(m=>d.has(m))&&(n(f.code,f.inputType==="multiselect"||f.inputType==="chips"?[]:"",{shouldDirty:!0}),d.add(f.code),u=!0)}}finally{o.current=!1}}});return()=>s.unsubscribe()},[r,n,t])}const Wn={section:"_section_qa0tm_1",header:"_header_qa0tm_11",title:"_title_qa0tm_17",description:"_description_qa0tm_24",divider:"_divider_qa0tm_30",fields:"_fields_qa0tm_36"},gA=({title:e,description:t,children:r})=>l.jsxs("div",{className:Wn.section,children:[l.jsxs("div",{className:Wn.header,children:[l.jsx("h3",{className:Wn.title,children:e}),t&&l.jsx("p",{className:Wn.description,children:t})]}),l.jsx("hr",{className:Wn.divider}),l.jsx("div",{className:Wn.fields,children:r})]}),j={field:"_field_93co8_1",fullWidth:"_fullWidth_93co8_7",label:"_label_93co8_11",required:"_required_93co8_19",input:"_input_93co8_24",textarea:"_textarea_93co8_45",inputError:"_inputError_93co8_50",error:"_error_93co8_54",selectBtn:"_selectBtn_93co8_59",selectOpen:"_selectOpen_93co8_83",placeholder:"_placeholder_93co8_87",selectedVal:"_selectedVal_93co8_91",chevronUp:"_chevronUp_93co8_95",dropdown:"_dropdown_93co8_100",option:"_option_93co8_116",optionSelected:"_optionSelected_93co8_134",noOpts:"_noOpts_93co8_139",chipGroup:"_chipGroup_93co8_146",chipInput:"_chipInput_93co8_158",addChipBtn:"_addChipBtn_93co8_167",radioGroup:"_radioGroup_93co8_184",radioLabel:"_radioLabel_93co8_191",iconWrap:"_iconWrap_93co8_199",iconPreview:"_iconPreview_93co8_214",iconPlaceholder:"_iconPlaceholder_93co8_220",removeIconBtn:"_removeIconBtn_93co8_233",tagChip:"_tagChip_93co8_252",tagChipRemove:"_tagChipRemove_93co8_264",nestedSelectRow:"_nestedSelectRow_93co8_278",dialcodeRow:"_dialcodeRow_93co8_287",validateBtn:"_validateBtn_93co8_293",dialcodeValid:"_dialcodeValid_93co8_315",dialcodeSpinner:"_dialcodeSpinner_93co8_325"},yp=({name:e,label:t,required:r,disabled:n,multiline:o,maxLength:s,placeholder:a})=>{const i=ne(),{register:c,formState:{errors:d}}=Yt(),u=d[e],f={required:r?i.textField.requiredError.replace("{field}",t):!1,maxLength:s?{value:s,message:i.textField.maxLengthError.replace("{max}",String(s))}:void 0};return l.jsxs("div",{className:[j.field,o?j.fullWidth:""].join(" "),children:[l.jsxs("label",{className:j.label,htmlFor:e,children:[t,r&&l.jsx("span",{className:j.required,children:"*"})]}),o?l.jsx("textarea",{id:e,className:[j.input,j.textarea,u?j.inputError:""].join(" "),disabled:n,placeholder:a,rows:3,...c(e,f)}):l.jsx("input",{id:e,type:"text",className:[j.input,u?j.inputError:""].join(" "),disabled:n,placeholder:a,...c(e,f)}),u&&l.jsx("span",{className:j.error,children:String(u.message)})]})},mA=({name:e,label:t,options:r,required:n,disabled:o})=>{var v;const s=ne(),[a,i]=p.useState(!1),c=p.useRef(null),{register:d,watch:u,setValue:f,formState:{errors:m}}=Yt(),g=u(e),b=((v=r.find(y=>y.value===g))==null?void 0:v.label)??s.selectField.selectPlaceholder,h=m[e];return p.useEffect(()=>{if(!a)return;const y=C=>{var S;(S=c.current)!=null&&S.contains(C.target)||i(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[a]),l.jsxs("div",{className:j.field,ref:c,style:{position:"relative"},children:[l.jsxs("label",{className:j.label,children:[t,n&&l.jsx("span",{className:j.required,children:"*"})]}),l.jsx("input",{type:"hidden",...d(e,{required:n?s.selectField.requiredError.replace("{field}",t):!1})}),l.jsxs("button",{type:"button",disabled:o,className:[j.selectBtn,h?j.inputError:"",a?j.selectOpen:""].join(" "),onClick:()=>i(y=>!y),children:[l.jsx("span",{className:g?j.selectedVal:j.placeholder,children:b}),l.jsx(Zr,{size:14,className:a?j.chevronUp:""})]}),a&&l.jsxs("div",{className:j.dropdown,children:[r.map(y=>l.jsxs("button",{type:"button",className:[j.option,g===y.value?j.optionSelected:""].join(" "),onClick:()=>{f(e,y.value,{shouldDirty:!0,shouldValidate:!0}),i(!1)},children:[l.jsx("span",{children:y.label}),g===y.value&&l.jsx(Yr,{size:13})]},y.value)),!r.length&&l.jsx("span",{className:j.noOpts,children:s.selectField.noOptionsMessage})]}),h&&l.jsx("span",{className:j.error,children:String(h.message)})]})},vA=({name:e,label:t,options:r,required:n,disabled:o})=>{const s=ne(),[a,i]=p.useState(!1),c=p.useRef(null),{register:d,watch:u,setValue:f,formState:{errors:m}}=Yt(),g=u(e)??[],b=m[e],h=g.length?`${g.length} ${s.multiSelectField.selectedCountSuffix}`:s.multiSelectField.selectPlaceholder;p.useEffect(()=>{if(!a)return;const y=C=>{var S;(S=c.current)!=null&&S.contains(C.target)||i(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[a]);const v=y=>{const C=g.includes(y)?g.filter(S=>S!==y):[...g,y];f(e,C,{shouldDirty:!0,shouldValidate:!0})};return l.jsxs("div",{className:j.field,ref:c,style:{position:"relative"},children:[l.jsxs("label",{className:j.label,children:[t,n&&l.jsx("span",{className:j.required,children:"*"})]}),l.jsx("input",{type:"hidden",...d(e,{required:n?s.multiSelectField.requiredError.replace("{field}",t):!1})}),l.jsxs("button",{type:"button",disabled:o,className:[j.selectBtn,b?j.inputError:"",a?j.selectOpen:""].join(" "),onClick:()=>i(y=>!y),children:[l.jsx("span",{className:g.length?j.selectedVal:j.placeholder,children:h}),l.jsx(Zr,{size:14,className:a?j.chevronUp:""})]}),a&&l.jsxs("div",{className:j.dropdown,children:[r.map(y=>l.jsxs("button",{type:"button",className:[j.option,g.includes(y.value)?j.optionSelected:""].join(" "),onClick:()=>v(y.value),children:[l.jsx(Yr,{size:13,style:{opacity:g.includes(y.value)?1:0}}),l.jsx("span",{children:y.label})]},y.value)),!r.length&&l.jsx("span",{className:j.noOpts,children:s.multiSelectField.noOptionsMessage})]}),b&&l.jsx("span",{className:j.error,children:String(b.message)})]})},yA=({name:e,label:t,required:r,disabled:n,placeholder:o})=>{const s=ne(),a=o??s.chipGroupField.addPlaceholder,[i,c]=p.useState(""),[d,u]=p.useState(!1),f=p.useRef(null),{watch:m,setValue:g,formState:{errors:b}}=Yt(),h=m(e)??[],v=b[e],y=()=>{const S=i.trim();S&&!h.includes(S)&&g(e,[...h,S],{shouldDirty:!0}),c(""),u(!1)},C=S=>g(e,h.filter(w=>w!==S),{shouldDirty:!0});return l.jsxs("div",{className:[j.field,j.fullWidth].join(" "),children:[l.jsxs("label",{className:j.label,children:[t,r&&l.jsx("span",{className:j.required,children:"*"})]}),l.jsxs("div",{className:j.chipGroup,children:[h.map(S=>l.jsxs("span",{className:"sbx-chip filled",children:[S,!n&&l.jsx("button",{type:"button",className:"sbx-chip-remove",onClick:()=>C(S),"aria-label":`Remove ${S}`,children:"×"})]},S)),!n&&(d?l.jsx("input",{ref:f,autoFocus:!0,className:j.chipInput,value:i,onChange:S=>c(S.target.value),onKeyDown:S=>{S.key==="Enter"&&(S.preventDefault(),y()),S.key==="Escape"&&(c(""),u(!1))},onBlur:y,placeholder:a}):l.jsxs("button",{type:"button",className:j.addChipBtn,onClick:()=>{u(!0),setTimeout(()=>{var S;return(S=f.current)==null?void 0:S.focus()},50)},children:[l.jsx(Xr,{size:12})," ",s.chipGroupField.addButtonLabel]}))]}),v&&l.jsx("span",{className:j.error,children:String(v.message)})]})},bA=({name:e,label:t,options:r,required:n,disabled:o})=>{const s=ne(),{register:a,formState:{errors:i}}=Yt(),c=i[e];return l.jsxs("div",{className:j.field,children:[l.jsxs("label",{className:j.label,children:[t,n&&l.jsx("span",{className:j.required,children:"*"})]}),l.jsx("div",{className:j.radioGroup,children:r.map(d=>l.jsxs("label",{className:j.radioLabel,children:[l.jsx("input",{type:"radio",value:d.value,disabled:o,...a(e,{required:n?s.radioField.requiredError.replace("{field}",t):!1})}),d.label]},d.value))}),c&&l.jsx("span",{className:j.error,children:String(c.message)})]})};async function CA(e,t,r,n){var a,i;const s=(i=(a=(await Me.post("/action/asset/v1/create",{request:{asset:{primaryCategory:"asset",language:["English"],code:crypto.randomUUID(),name:e,mediaType:"image",mimeType:t,createdBy:r,creator:null,channel:n,keywords:""}}})).data)==null?void 0:a.result)==null?void 0:i.node_id;if(!s)throw new Error("Asset creation failed: no node_id returned");return s}async function SA(e,t){var o,s;const n=(s=(o=(await Me.post(`/action/content/v3/upload/url/${e}`,{request:{content:{fileName:t}}})).data)==null?void 0:o.result)==null?void 0:s.pre_signed_url;if(!n)throw new Error("Pre-signed URL fetch failed");return n}async function wA(e,t,r={}){const n=await fetch(e,{method:"PUT",body:t,headers:{"x-ms-blob-type":"BlockBlob","Content-Type":"application/octet-stream",...r}});if(!n.ok)throw new Error(`Blob upload failed: ${n.status} ${n.statusText}`)}async function _A(e,t,r){var a,i;const n=new FormData;n.append("fileUrl",t),n.append("mimeType",r);const s=(i=(a=(await Me.post(`/action/asset/v1/upload/${e}`,n,{params:{enctype:"multipart/form-data",processData:!1,contentType:!1,cache:!1}})).data)==null?void 0:a.result)==null?void 0:i.content_url;if(!s)throw new Error("Asset finalize failed: no content_url returned");return s}const Ee={overlay:"_overlay_1bq5u_1",modal:"_modal_1bq5u_12",header:"_header_1bq5u_24",title:"_title_1bq5u_33",closeBtn:"_closeBtn_1bq5u_39",tabs:"_tabs_1bq5u_57",tab:"_tab_1bq5u_57",activeTab:"_activeTab_1bq5u_83",body:"_body_1bq5u_88",searchWrap:"_searchWrap_1bq5u_99",searchIcon:"_searchIcon_1bq5u_104",searchInput:"_searchInput_1bq5u_113",grid:"_grid_1bq5u_132",imgCell:"_imgCell_1bq5u_148",imgCellSelected:"_imgCellSelected_1bq5u_166",thumb:"_thumb_1bq5u_171",noThumb:"_noThumb_1bq5u_177",checkBadge:"_checkBadge_1bq5u_183",loadMoreBtn:"_loadMoreBtn_1bq5u_198",loadingRow:"_loadingRow_1bq5u_220",empty:"_empty_1bq5u_230",spinner:"_spinner_1bq5u_237",uploadArea:"_uploadArea_1bq5u_247",dropZone:"_dropZone_1bq5u_256",uploadIcon:"_uploadIcon_1bq5u_277",dropText:"_dropText_1bq5u_281",dropSubtext:"_dropSubtext_1bq5u_288",uploadPreview:"_uploadPreview_1bq5u_294",hiddenInput:"_hiddenInput_1bq5u_301",fileName:"_fileName_1bq5u_305",errorText:"_errorText_1bq5u_311",footer:"_footer_1bq5u_318",cancelBtn:"_cancelBtn_1bq5u_328",confirmBtn:"_confirmBtn_1bq5u_345"},bp=18,Cp=({nodeId:e,currentValue:t,onSelect:r,onClose:n})=>{const o=ne(),[s,a]=p.useState("my"),[i,c]=p.useState(""),[d,u]=p.useState([]),[f,m]=p.useState(0),[g,b]=p.useState(!1),[h,v]=p.useState(null),[y,C]=p.useState(0),[S,w]=p.useState(null),[T,E]=p.useState(""),[L,A]=p.useState(!1),[x,F]=p.useState(""),P=p.useRef(null),N=K($=>{var q,Z;return((Z=(q=$.editorConfig)==null?void 0:q.context)==null?void 0:Z.channel)??""}),M=K($=>{var q,Z;return((Z=(q=$.editorConfig)==null?void 0:q.context)==null?void 0:Z.uid)??""}),B=K($=>{var q,Z,he;return((he=(Z=(q=$.editorConfig)==null?void 0:q.context)==null?void 0:Z.cloudStorage)==null?void 0:he.presigned_headers)??{}}),U=K($=>{var q,Z,he;return((he=(Z=(q=$.editorConfig)==null?void 0:q.config)==null?void 0:Z.assetConfig)==null?void 0:he.size)??1*1024*1024}),ee=K($=>{var q,Z,he;return((he=(Z=(q=$.editorConfig)==null?void 0:q.config)==null?void 0:Z.assetConfig)==null?void 0:he.accepted)??"image/png,image/jpeg"}),Q=p.useCallback(async($,q,Z=!1)=>{var he;b(!0);try{const be={status:["Live"],mediaType:["image"],mimeType:["image/png","image/jpeg","image/jpg","image/gif","image/svg+xml"]};s==="my"&&M&&(be.createdBy=M),N&&(be.channel=N);const le=((he=(await Me.post("/action/composite/v3/search",{request:{filters:be,query:$,limit:bp,offset:q,sort_by:{createdOn:"desc"},fields:["identifier","name","appIcon","artifactUrl","downloadUrl"]}},{headers:{"X-Source":"web"}})).data)==null?void 0:he.result)??{},ve=le.content??[];m(le.count??0),u(Ae=>Z?[...Ae,...ve]:ve)}catch{}finally{b(!1)}},[s,M,N]);p.useEffect(()=>{s!=="upload"&&(u([]),C(0),Q(i,0))},[s]);const te=p.useRef(),ue=$=>{c($),clearTimeout(te.current),te.current=setTimeout(()=>{u([]),C(0),Q($,0)},400)},fe=()=>{const $=y+bp;C($),Q(i,$,!0)},pe=()=>{const $=(h==null?void 0:h.artifactUrl)??(h==null?void 0:h.appIcon)??(h==null?void 0:h.downloadUrl)??"";$&&r($)};p.useEffect(()=>()=>{T&&URL.revokeObjectURL(T)},[T]);const ie=$=>{var he;const q=(he=$.target.files)==null?void 0:he[0];if($.target.value="",!q)return;const Z=ee.split(",").map(be=>be.trim());if(!Z.includes(q.type)){const be=Z.map(ge=>ge.replace("image/","").toUpperCase()).join(", ");F(o.appIconPickerModal.invalidFileTypeError.replace("{types}",be));return}if(q.size>U){const be=(U/1048576).toFixed(0);F(o.appIconPickerModal.fileTooLargeError.replace("{size}",be));return}T&&URL.revokeObjectURL(T),w(q),E(URL.createObjectURL(q)),F("")},Te=async()=>{if(S){A(!0),F("");try{const $=await CA(S.name.split(".").slice(0,-1).join(".")||S.name,S.type,M,N),q=await SA($,S.name);await wA(q,S,B);const Z=q.split("?")[0],he=await _A($,Z,S.type);r(he)}catch($){F($ instanceof Error?$.message:o.appIconPickerModal.uploadFailedError)}finally{A(!1)}}},ye=d.length<f;return l.jsx("div",{className:Ee.overlay,role:"dialog","aria-modal":"true","aria-label":o.appIconPickerModal.dialogAriaLabel,children:l.jsxs("div",{className:Ee.modal,children:[l.jsxs("div",{className:Ee.header,children:[l.jsx("span",{className:Ee.title,children:o.appIconPickerModal.title}),l.jsx("button",{className:Ee.closeBtn,onClick:n,"aria-label":o.appIconPickerModal.closeAriaLabel,children:l.jsx(ur,{size:18})})]}),l.jsxs("div",{className:Ee.tabs,role:"tablist",children:[l.jsx("button",{role:"tab","aria-selected":s==="my",className:`${Ee.tab} ${s==="my"?Ee.activeTab:""}`,onClick:()=>a("my"),children:o.appIconPickerModal.myImagesTab}),l.jsx("button",{role:"tab","aria-selected":s==="all",className:`${Ee.tab} ${s==="all"?Ee.activeTab:""}`,onClick:()=>a("all"),children:o.appIconPickerModal.allImagesTab}),l.jsxs("button",{role:"tab","aria-selected":s==="upload",className:`${Ee.tab} ${s==="upload"?Ee.activeTab:""}`,onClick:()=>a("upload"),children:[l.jsx(hi,{size:13,style:{marginRight:4}}),o.appIconPickerModal.uploadTab]})]}),l.jsx("div",{className:Ee.body,children:s!=="upload"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:Ee.searchWrap,children:[l.jsx(qs,{size:14,className:Ee.searchIcon}),l.jsx("input",{type:"search",className:Ee.searchInput,placeholder:o.appIconPickerModal.searchPlaceholder,value:i,onChange:$=>ue($.target.value)})]}),g&&d.length===0?l.jsxs("div",{className:Ee.loadingRow,children:[l.jsx(Ms,{size:20,className:Ee.spinner}),l.jsx("span",{children:o.appIconPickerModal.loadingText})]}):d.length===0?l.jsx("div",{className:Ee.empty,children:o.appIconPickerModal.noImagesFound}):l.jsx("div",{className:Ee.grid,children:d.map($=>{const q=$.appIcon??$.artifactUrl??$.downloadUrl??"",Z=(h==null?void 0:h.identifier)===$.identifier;return l.jsxs("button",{type:"button",className:`${Ee.imgCell} ${Z?Ee.imgCellSelected:""}`,onClick:()=>v($),title:$.name,children:[q?l.jsx("img",{src:q,alt:$.name,className:Ee.thumb}):l.jsx("div",{className:Ee.noThumb,children:o.appIconPickerModal.noThumbnailText}),Z&&l.jsx("div",{className:Ee.checkBadge,children:l.jsx(Yr,{size:12})})]},$.identifier)})}),ye&&!g&&l.jsx("button",{className:Ee.loadMoreBtn,onClick:fe,children:o.appIconPickerModal.loadMoreButton}),g&&d.length>0&&l.jsx("div",{className:Ee.loadingRow,children:l.jsx(Ms,{size:16,className:Ee.spinner})})]}):l.jsxs("div",{className:Ee.uploadArea,children:[l.jsx("div",{className:Ee.dropZone,onClick:()=>{var $;return($=P.current)==null?void 0:$.click()},onDragOver:$=>$.preventDefault(),onDrop:$=>{$.preventDefault();const q=$.dataTransfer.files[0];q&&ie({target:{files:[q],value:""}})},children:T?l.jsx("img",{src:T,alt:o.appIconPickerModal.previewAlt,className:Ee.uploadPreview}):l.jsxs(l.Fragment,{children:[l.jsx(hi,{size:32,className:Ee.uploadIcon}),l.jsx("p",{className:Ee.dropText,children:o.appIconPickerModal.dropZoneText}),l.jsx("p",{className:Ee.dropSubtext,children:o.appIconPickerModal.acceptedTypesInfo.replace("{types}",ee.split(",").map($=>$.replace("image/","").toUpperCase()).join(", ")).replace("{size}",(U/(1024*1024)).toFixed(0))})]})}),l.jsx("input",{ref:P,type:"file",accept:ee,className:Ee.hiddenInput,onChange:ie}),S&&l.jsx("p",{className:Ee.fileName,children:S.name}),x&&l.jsx("p",{className:Ee.errorText,children:x})]})}),l.jsxs("div",{className:Ee.footer,children:[l.jsx("button",{className:Ee.cancelBtn,onClick:n,children:o.appIconPickerModal.cancelButton}),s==="upload"?l.jsx("button",{className:Ee.confirmBtn,disabled:!S||L,onClick:Te,children:L?l.jsxs(l.Fragment,{children:[l.jsx(Ms,{size:14,className:Ee.spinner})," ",o.appIconPickerModal.uploadingText]}):o.appIconPickerModal.uploadAndUseButton}):l.jsx("button",{className:Ee.confirmBtn,disabled:!h,onClick:pe,children:o.appIconPickerModal.useSelectedButton})]})]})})},TA=({name:e,label:t,nodeId:r,required:n,disabled:o})=>{const s=ne(),[a,i]=p.useState(!1),{watch:c,setValue:d,register:u,formState:{errors:f}}=Yt(),m=c(e),g=f[e],b=v=>{d(e,v,{shouldDirty:!0,shouldValidate:!0}),i(!1)},h=()=>{d(e,"",{shouldDirty:!0,shouldValidate:!0})};return l.jsxs("div",{className:j.field,children:[l.jsxs("label",{className:j.label,children:[t,n&&l.jsx("span",{className:j.required,children:"*"})]}),l.jsx("input",{type:"hidden",...u(e,{required:n?s.appIconField.requiredError.replace("{field}",t):!1})}),l.jsx("div",{className:j.iconWrap,role:"button",tabIndex:o?-1:0,"aria-label":s.appIconField.selectIconAriaLabel,onClick:()=>!o&&i(!0),onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&!o&&i(!0)},children:m?l.jsx("img",{src:m,alt:s.appIconField.iconAlt,className:j.iconPreview}):l.jsxs("div",{className:j.iconPlaceholder,children:[l.jsx(Sd,{size:20}),l.jsx("span",{children:s.appIconField.selectIconLabel})]})}),m&&!o&&l.jsxs("button",{type:"button",className:j.removeIconBtn,onClick:h,"aria-label":s.appIconField.removeIconAriaLabel,children:[l.jsx(js,{size:13}),l.jsx("span",{children:s.appIconField.removeLabel})]}),g&&l.jsx("span",{className:j.error,children:String(g.message)}),a&&l.jsx(Cp,{nodeId:r,currentValue:m,onSelect:b,onClose:()=>i(!1)})]})},EA=({name:e,label:t,required:r,disabled:n})=>{const o=ne(),{control:s}=Yt(),{field:a,fieldState:{error:i}}=Go({name:e,control:s,rules:{required:r?o.dateTimeField.requiredError.replace("{field}",t):!1}});return l.jsxs("div",{className:j.field,children:[l.jsxs("label",{className:j.label,htmlFor:e,children:[t,r&&l.jsx("span",{className:j.required,children:"*"})]}),l.jsx("input",{id:e,type:"datetime-local",className:[j.input,i?j.inputError:""].join(" "),disabled:n,value:a.value??"",onChange:a.onChange,onBlur:a.onBlur,ref:a.ref}),i&&l.jsx("span",{className:j.error,children:String(i.message)})]})},AA=({name:e,label:t,required:r,disabled:n})=>{const o=ne(),{control:s}=Yt(),{field:a,fieldState:{error:i}}=Go({name:e,control:s,rules:{required:r?o.keywordSuggestField.requiredError.replace("{field}",t):!1},defaultValue:[]}),[c,d]=p.useState(""),u=p.useRef(null),f=a.value??[],m=v=>{const y=v.trim();!y||f.includes(y)||a.onChange([...f,y])},g=v=>{a.onChange(f.filter(y=>y!==v))},b=v=>{v.key==="Enter"||v.key===","?(v.preventDefault(),m(c),d("")):v.key==="Backspace"&&c===""&&f.length>0&&g(f[f.length-1])},h=()=>{c.trim()&&(m(c),d("")),a.onBlur()};return l.jsxs("div",{className:[j.field,j.fullWidth].join(" "),children:[l.jsxs("label",{className:j.label,children:[t,r&&l.jsx("span",{className:j.required,children:"*"})]}),l.jsxs("div",{className:[j.chipGroup,i?j.inputError:""].join(" "),onClick:()=>{var v;return!n&&((v=u.current)==null?void 0:v.focus())},style:{cursor:n?"not-allowed":"text"},children:[f.map(v=>l.jsxs("span",{className:j.tagChip,children:[v,!n&&l.jsx("button",{type:"button",className:j.tagChipRemove,onClick:y=>{y.stopPropagation(),g(v)},"aria-label":`Remove ${v}`,children:l.jsx(ur,{size:11})})]},v)),!n&&l.jsx("input",{ref:u,className:j.chipInput,value:c,onChange:v=>d(v.target.value),onKeyDown:b,onBlur:h,placeholder:f.length===0?o.keywordSuggestField.inputPlaceholder:"",style:{flexGrow:1,minWidth:120}})]}),i&&l.jsx("span",{className:j.error,children:String(i.message)})]})},kA=({name:e,label:t,levels:r,required:n,disabled:o})=>{const s=ne(),{control:a}=Yt(),{field:i,fieldState:{error:c}}=Go({name:e,control:a,rules:{required:n?s.nestedSelectField.requiredError.replace("{field}",t):!1},defaultValue:{}}),d=i.value??{},u=(f,m,g)=>{const b={};for(let h=0;h<m;h++)b[r[h].code]=d[r[h].code]??"";b[f]=g;for(let h=m+1;h<r.length;h++)b[r[h].code]="";i.onChange(b)};return l.jsxs("div",{className:[j.field,j.fullWidth].join(" "),children:[l.jsxs("label",{className:j.label,children:[t,n&&l.jsx("span",{className:j.required,children:"*"})]}),l.jsx("div",{className:j.nestedSelectRow,children:r.map((f,m)=>{const g=m>0&&!d[r[m-1].code];return l.jsxs("div",{className:j.field,style:{flex:1},children:[l.jsx("label",{className:j.label,htmlFor:`${e}_${f.code}`,children:f.label}),l.jsxs("select",{id:`${e}_${f.code}`,className:[j.input,c?j.inputError:""].join(" "),disabled:o||g,value:d[f.code]??"",onChange:b=>u(f.code,m,b.target.value),onBlur:i.onBlur,children:[l.jsx("option",{value:"",children:s.nestedSelectField.selectPlaceholder}),f.options.map(b=>l.jsx("option",{value:b.value,children:b.label},b.value))]})]},f.code)})}),c&&l.jsx("span",{className:j.error,children:String(c.message)})]})},Sp=[{label:"CC BY 4.0",value:"CC BY 4.0"},{label:"CC BY-SA 4.0",value:"CC BY-SA 4.0"},{label:"CC BY-NC 4.0",value:"CC BY-NC 4.0"},{label:"CC BY-NC-SA 4.0",value:"CC BY-NC-SA 4.0"},{label:"CC BY-ND 4.0",value:"CC BY-ND 4.0"},{label:"CC0 1.0 (Public Domain)",value:"CC0 1.0"}],IA=({name:e,label:t,required:r,disabled:n})=>{const o=ne(),[s,a]=p.useState(!1),i=p.useRef(null),{register:c,watch:d,setValue:u,formState:{errors:f}}=Yt(),m=d(e),g=Sp.find(v=>v.value===m),b=(g==null?void 0:g.label)??o.licenseSelectField.selectPlaceholder,h=f[e];return p.useEffect(()=>{if(!s)return;const v=y=>{var C;(C=i.current)!=null&&C.contains(y.target)||a(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[s]),l.jsxs("div",{className:j.field,ref:i,style:{position:"relative"},children:[l.jsxs("label",{className:j.label,children:[t,r&&l.jsx("span",{className:j.required,children:"*"})]}),l.jsx("input",{type:"hidden",...c(e,{required:r?o.licenseSelectField.requiredError.replace("{field}",t):!1})}),l.jsxs("button",{type:"button",disabled:n,className:[j.selectBtn,h?j.inputError:"",s?j.selectOpen:""].join(" "),onClick:()=>a(v=>!v),"aria-haspopup":"listbox","aria-expanded":s,children:[l.jsx("span",{className:m?j.selectedVal:j.placeholder,children:b}),l.jsx(Zr,{size:14,className:s?j.chevronUp:""})]}),s&&l.jsx("div",{className:j.dropdown,role:"listbox",children:Sp.map(v=>l.jsxs("button",{type:"button",role:"option","aria-selected":m===v.value,className:[j.option,m===v.value?j.optionSelected:""].join(" "),onClick:()=>{u(e,v.value,{shouldDirty:!0,shouldValidate:!0}),a(!1)},children:[l.jsx("span",{children:v.label}),m===v.value&&l.jsx(Yr,{size:13})]},v.value))}),h&&l.jsx("span",{className:j.error,children:String(h.message)})]})},DA=({name:e,label:t,required:r,disabled:n})=>{const o=ne(),{control:s}=Yt(),{field:a,fieldState:{error:i}}=Go({name:e,control:s,rules:{required:r?o.dialcodeInputField.requiredError.replace("{field}",t):!1},defaultValue:""}),[c,d]=p.useState("idle"),[u,f]=p.useState(""),m=async()=>{const b=(a.value??"").trim();if(!b){d("invalid"),f(o.dialcodeInputField.enterCodeMessage);return}d("loading"),f("");try{const h=await BS(b),v=h==null?void 0:h.result,y=v==null?void 0:v.dialcodes;Array.isArray(y)&&y.length>0?(d("valid"),f(o.dialcodeInputField.validMessage)):(d("invalid"),f(o.dialcodeInputField.notFoundMessage))}catch{d("invalid"),f(o.dialcodeInputField.validationFailedMessage)}},g=()=>c==="loading"?l.jsx(Ms,{size:16,className:j.dialcodeSpinner}):c==="valid"?l.jsx(gd,{size:16,color:"var(--sbx-success, #2e7d32)"}):c==="invalid"?l.jsx(Cy,{size:16,color:"var(--sbx-error)"}):null;return l.jsxs("div",{className:j.field,children:[l.jsxs("label",{className:j.label,htmlFor:e,children:[t,r&&l.jsx("span",{className:j.required,children:"*"})]}),l.jsxs("div",{className:j.dialcodeRow,children:[l.jsx("input",{id:e,type:"text",className:[j.input,i?j.inputError:""].join(" "),disabled:n,value:a.value??"",onChange:b=>{a.onChange(b),d("idle"),f("")},onBlur:a.onBlur,ref:a.ref,placeholder:o.dialcodeInputField.placeholderExample,style:{flex:1}}),l.jsx("button",{type:"button",className:j.validateBtn,onClick:m,disabled:n||c==="loading","aria-label":o.dialcodeInputField.validateAriaLabel,children:c==="loading"?o.dialcodeInputField.validatingLabel:o.dialcodeInputField.validateButtonLabel}),g()]}),i&&l.jsx("span",{className:j.error,children:String(i.message)}),!i&&u&&l.jsx("span",{className:c==="valid"?j.dialcodeValid:j.error,children:u})]})},Vt={cards:"_cards_1oc2m_1",card:"_card_1oc2m_1",cardActive:"_cardActive_1oc2m_30",cardIcon:"_cardIcon_1oc2m_35",cardIconPrimary:"_cardIconPrimary_1oc2m_46",cardIconHover:"_cardIconHover_1oc2m_50",radioDot:"_radioDot_1oc2m_54",radioDotActive:"_radioDotActive_1oc2m_65",cardTitle:"_cardTitle_1oc2m_70",cardTitleInk:"_cardTitleInk_1oc2m_76",cardDescription:"_cardDescription_1oc2m_80",cardDescriptionCharcoal:"_cardDescriptionCharcoal_1oc2m_86"},LA=({name:e,label:t,required:r,disabled:n})=>{const o=ne(),{control:s}=Yt(),a=[{value:"strict",Icon:wd,iconVariant:Vt.cardIconPrimary,title:o.learningPath.policyStrictLabel,titleVariant:"",description:l.jsx(l.Fragment,{children:o.learningPath.policyStrictDescription}),descriptionVariant:""},{value:"adaptive",Icon:Hy,iconVariant:Vt.cardIconPrimary,title:o.learningPath.policyAdaptiveLabel,titleVariant:Vt.cardTitleInk,description:l.jsxs(l.Fragment,{children:[o.learningPath.policyAdaptiveDescriptionPre,l.jsx("span",{className:j.required,children:"*"}),o.learningPath.policyAdaptiveDescriptionPost]}),descriptionVariant:Vt.cardDescriptionCharcoal},{value:"priorLearning",Icon:$y,iconVariant:Vt.cardIconHover,title:o.learningPath.policyPriorLearningLabel,titleVariant:"",description:l.jsx(l.Fragment,{children:o.learningPath.policyPriorLearningDescription}),descriptionVariant:""}];return l.jsxs("div",{className:j.field,children:[l.jsxs("label",{className:j.label,children:[t,r&&l.jsx("span",{className:j.required,children:"*"})]}),l.jsx(wE,{name:e,control:s,rules:{required:r?o.selectField.requiredError.replace("{field}",t):!1},render:({field:i})=>l.jsx("div",{className:Vt.cards,children:a.map(({value:c,Icon:d,iconVariant:u,title:f,titleVariant:m,description:g,descriptionVariant:b})=>{const h=i.value===c;return l.jsxs("button",{type:"button",disabled:n,className:[Vt.card,h?Vt.cardActive:""].join(" "),onClick:()=>i.onChange(c),children:[l.jsx("span",{className:[Vt.cardIcon,u].join(" "),children:l.jsx(d,{size:16})}),l.jsx("span",{className:[Vt.radioDot,h?Vt.radioDotActive:""].join(" ")}),l.jsx("span",{className:[Vt.cardTitle,m].join(" "),children:f}),l.jsx("span",{className:[Vt.cardDescription,b].join(" "),children:g})]},c)})})})]})},Rn={form:"_form_lktqh_1",formLp:"_formLp_lktqh_7",ungrouped:"_ungrouped_lktqh_12",ungroupedLp:"_ungroupedLp_lktqh_23",fullWidthField:"_fullWidthField_lktqh_27",noFields:"_noFields_lktqh_31"},OA=({nodeMetadata:e,activeTab:t,isRoot:r,isFolder:n,editorMode:o,onFormValueChange:s,onFormStatusChange:a})=>{var Ve,nt,He,Ke,ot,Cn,lo,as,Sn;const i=ne(),c=K(_=>_.editorConfig),d=K(_=>_.editorProfile),u=d.key==="learningPath",f=K(_=>_.rootFormConfig),m=K(_=>_.unitFormConfig),g=K(_=>_.categoryMeta),b=K(_=>_.contentFramework),h=K(_=>_.contentTargetFWIds),{organisationFramework:v,targetFrameworks:y,isLoading:C}=ra(b??((Ve=c==null?void 0:c.context)==null?void 0:Ve.framework),h??((nt=c==null?void 0:c.context)==null?void 0:nt.targetFWIds)),{frameworks:S,collectionAdditionalCategories:w,contentAdditionalCategories:T,defaultLicense:E,name:L}=jE((He=c==null?void 0:c.context)==null?void 0:He.channel),A=UE(((Ke=c==null?void 0:c.context)==null?void 0:Ke.userId)??((ot=c==null?void 0:c.context)==null?void 0:ot.uid)),x=qE(S,(Cn=g==null?void 0:g.frameworkMetadata)==null?void 0:Cn.orgFWType,(lo=c==null?void 0:c.context)==null?void 0:lo.channel),F={organisationFramework:v,targetFrameworks:y,orgFrameworks:x,channelAdditionalCategories:w},P=ae(_=>_.selectedNodeId),N=ae(_=>_.treeData),M=ae(_=>_.treeCache),B=P?M[P]??{}:{},U={...e,...B},ee=p.useMemo(()=>{var k;if(!P)return 0;const _=[...N];for(;_.length;){const D=_.shift();if(D.id===P)return((k=D.children)==null?void 0:k.length)??0;D.children&&_.push(...D.children)}return 0},[N,P]),Q=(c==null?void 0:c.config)??{},te=(c==null?void 0:c.context)??{},ue={editorMode:o,editableFields:Q.editableFields,objectType:Q.objectType,setDefaultCopyRight:Q.setDefaultCopyRight===!0,defaultLicense:te.defaultLicense??E,contextAdditionalCategories:te.additionalCategories,userFullName:((as=te.user)==null?void 0:as.fullName)??A,channelName:L,collectionAdditionalCategories:w,contentAdditionalCategories:T,childCount:ee,profile:d},fe=r?f:m,pe=fe||(((Sn=c==null?void 0:c.config.hierarchy)==null?void 0:Sn.formConfig)??[]),ie=hp(pe,U,F,r,ue),Te=ie.filter(_=>_.tab===t&&_.inputType!=="appIcon"&&_.visible!==!1),ye=BE({mode:"onChange",defaultValues:Object.fromEntries(ie.map(_=>{const k=["multiselect","chips","keywords","tagsinput"],D=["nestedselect"];return k.includes(_.inputType)?[_.code,_.currentValue??_.defaultValue??[]]:D.includes(_.inputType)?[_.code,_.currentValue??_.defaultValue??{}]:[_.code,_.currentValue??_.defaultValue??""]}))});pA(ye,ie);const{updateNode:$}=ae(),q=p.useRef(ie);q.current=ie;const Z=p.useRef(P);Z.current=P;const he=p.useRef(s);he.current=s;const be=p.useRef(a);be.current=a;const ge=p.useRef(typeof U.shuffle=="boolean"?U.shuffle:void 0),le=p.useRef(U.name??"");le.current=U.name??"";const ve=p.useRef(o);ve.current=o;const Ae=hr(),Y=p.useRef(Ae==null?void 0:Ae.code);Y.current=Ae==null?void 0:Ae.code;const de=["review","read","sourcingreview","orgreview"];p.useEffect(()=>{const _=Z.current;if(_){const k=Object.fromEntries(q.current.filter(D=>D.currentValue!==void 0&&D.currentValue!==null).map(D=>[D.code,D.currentValue]));Object.keys(k).length>0&&$(_,k)}ye.trigger().then(()=>{const k=ye.formState.errors,D=q.current,z=Array.from(new Set(Object.keys(k).map(V=>{var R;return(R=D.find(H=>H.code===V))==null?void 0:R.tab}).filter(Boolean)));be.current(Object.keys(k).length===0,z)})},[]),p.useEffect(()=>{const _=ye.watch((k,{name:D})=>{const z=Z.current;if(!z)return;const V=q.current,R=new Set(V.map(se=>se.code));if(D&&R.has(D)){let se=ye.getValues(D);if(D==="dialcodes"&&(se=Array.isArray(se)?se:se?[se]:[]),D==="shuffle"&&(se===!0&&ge.current===!1&&Se(i.sparkMetaForm.shuffleEnabledMessage,{icon:l.jsx(In,{size:16})}),ge.current=se),D==="framework"&&r&&typeof se=="string"&&se){const Je=K.getState();if(Je.setContentFramework(se,Je.contentTargetFWIds),u){const dt=ae.getState().pruneCoursesByFramework(se);dt>0&&Se(i.learningPath.coursesRemovedFrameworkChangeToast.replace("{count}",String(dt)),{icon:l.jsx(In,{size:16}),duration:5e3});const er=ae.getState().clearLevelSkills(Y.current);er>0&&Se(i.learningPath.levelSkillsResetFrameworkChangeToast.replace("{count}",String(er)),{icon:l.jsx(In,{size:16}),duration:5e3})}}const Fe=hA(D,se);Fe&&($(z,Fe),he.current(Fe))}else if(!D){const se=ye.getValues(),Fe=Object.fromEntries(Object.entries(se).filter(([dt])=>R.has(dt))),Je=fA(Fe,{isReview:de.includes(ve.current),nodeTitle:le.current});Object.keys(Je).length>0&&($(z,Je),he.current(Je))}const H=ye.formState.errors,oe=Array.from(new Set(Object.keys(H).map(se=>{var Fe;return(Fe=V.find(Je=>Je.code===se))==null?void 0:Fe.tab}).filter(Boolean)));be.current(Object.keys(H).length===0,oe)});return()=>_.unsubscribe()},[ye]),p.useEffect(()=>{for(const _ of["author","creator","copyright","copyrightYear","license"]){const k=q.current.find(z=>z.code===_);if(!k||k.currentValue===void 0||k.currentValue===null||k.currentValue==="")continue;const D=ye.getValues(_);(D==null||D==="")&&ye.setValue(_,k.currentValue,{shouldDirty:!1})}},[A,L,ye]);const W=Te.reduce((_,k)=>{const D=_[_.length-1];return D&&D.section===k.section?D.fields.push(k):_.push({section:k.section,fields:[k]}),_},[]),Ce=_=>{const k={key:_.code,name:_.code,label:_.label,required:_.required,disabled:_.editable===!1};if(u&&_.code==="policy")return l.jsx("div",{className:Rn.fullWidthField,children:l.jsx(LA,{...k})},_.code);switch(_.inputType){case"textarea":return l.jsx(yp,{...k,multiline:!0,maxLength:_.maxLength});case"select":return l.jsx(mA,{...k,options:_.options??[]});case"multiselect":return l.jsx(vA,{...k,options:_.options??[]});case"chips":return l.jsx(yA,{...k});case"radio":return l.jsx(bA,{...k,options:_.options??[]});case"appIcon":return l.jsx(TA,{...k,nodeId:P??""});case"datepicker":case"datetime":return l.jsx(EA,{...k});case"keywords":case"tagsinput":return l.jsx(AA,{...k});case"nestedselect":return l.jsx(kA,{...k,levels:_.levels??[]});case"license":return l.jsx(IA,{...k});case"dialcode":return l.jsx(DA,{...k});default:return l.jsx(yp,{...k,maxLength:_.maxLength})}};return l.jsx(_E,{...ye,children:l.jsxs("div",{className:[Rn.form,u?Rn.formLp:""].filter(Boolean).join(" "),children:[W.map((_,k)=>{const D=_.section?zE[_.section]:void 0;return D?l.jsx(gA,{title:D.title,description:D.description,children:_.fields.map(Ce)},_.section??k):l.jsx("div",{className:[Rn.ungrouped,u?Rn.ungroupedLp:""].filter(Boolean).join(" "),children:_.fields.map(Ce)},k)}),Te.length===0&&!C&&l.jsx("p",{className:Rn.noFields,children:i.sparkMetaForm.noFieldsMessage})]})})};function wp(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function PA(e,t){return e.reduce((r,n,o)=>{const s=t.get(n);return s&&(r[o]=s),r},Array(e.length))}function Ia(e){return e!==null&&e>=0}function NA(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function xA(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const _p=e=>{let{rects:t,activeIndex:r,overIndex:n,index:o}=e;const s=wp(t,n,r),a=t[o],i=s[o];return!i||!a?null:{x:i.left-a.left,y:i.top-a.top,scaleX:i.width/a.width,scaleY:i.height/a.height}},Da={scaleX:1,scaleY:1},FA=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:o,rects:s,overIndex:a}=e;const i=(t=s[r])!=null?t:n;if(!i)return null;if(o===r){const d=s[a];return d?{x:0,y:r<a?d.top+d.height-(i.top+i.height):d.top-i.top,...Da}:null}const c=MA(s,o,r);return o>r&&o<=a?{x:0,y:-i.height-c,...Da}:o<r&&o>=a?{x:0,y:i.height+c,...Da}:{x:0,y:0,...Da}};function MA(e,t,r){const n=e[t],o=e[t-1],s=e[t+1];return n?r<t?o?n.top-(o.top+o.height):s?s.top-(n.top+n.height):0:s?s.top-(n.top+n.height):o?n.top-(o.top+o.height):0:0}const Tp="Sortable",Ep=p.createContext({activeIndex:-1,containerId:Tp,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:_p,disabled:{draggable:!1,droppable:!1}});function $A(e){let{children:t,id:r,items:n,strategy:o=_p,disabled:s=!1}=e;const{active:a,dragOverlay:i,droppableRects:c,over:d,measureDroppableContainers:u}=fd(),f=bo(Tp,r),m=i.rect!==null,g=p.useMemo(()=>n.map(E=>typeof E=="object"&&"id"in E?E.id:E),[n]),b=a!=null,h=a?g.indexOf(a.id):-1,v=d?g.indexOf(d.id):-1,y=p.useRef(g),C=!NA(g,y.current),S=v!==-1&&h===-1||C,w=xA(s);rr(()=>{C&&b&&u(g)},[C,g,b,u]),p.useEffect(()=>{y.current=g},[g]);const T=p.useMemo(()=>({activeIndex:h,containerId:f,disabled:w,disableTransforms:S,items:g,overIndex:v,useDragOverlay:m,sortedRects:PA(g,c),strategy:o}),[h,f,w.draggable,w.droppable,S,g,v,c,m,o]);return p.createElement(Ep.Provider,{value:T},t)}const BA=e=>{let{id:t,items:r,activeIndex:n,overIndex:o}=e;return wp(r,n,o).indexOf(t)},qA=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:o,items:s,newIndex:a,previousItems:i,previousContainerId:c,transition:d}=e;return!d||!n||i!==s&&o===a?!1:r?!0:a!==o&&t===c},jA={duration:200,easing:"ease"},Ap="transform",UA=Or.Transition.toString({property:Ap,duration:0,easing:"linear"}),zA={roleDescription:"sortable"};function VA(e){let{disabled:t,index:r,node:n,rect:o}=e;const[s,a]=p.useState(null),i=p.useRef(r);return rr(()=>{if(!t&&r!==i.current&&n.current){const c=o.current;if(c){const d=kn(n.current,{ignoreTransform:!0}),u={x:c.left-d.left,y:c.top-d.top,scaleX:c.width/d.width,scaleY:c.height/d.height};(u.x||u.y)&&a(u)}}r!==i.current&&(i.current=r)},[t,r,n,o]),p.useEffect(()=>{s&&a(null)},[s]),s}function HA(e){let{animateLayoutChanges:t=qA,attributes:r,disabled:n,data:o,getNewIndex:s=BA,id:a,strategy:i,resizeObserverConfig:c,transition:d=jA}=e;const{items:u,containerId:f,activeIndex:m,disabled:g,disableTransforms:b,sortedRects:h,overIndex:v,useDragOverlay:y,strategy:C}=p.useContext(Ep),S=QA(n,g),w=u.indexOf(a),T=p.useMemo(()=>({sortable:{containerId:f,index:w,items:u},...o}),[f,o,w,u]),E=p.useMemo(()=>u.slice(u.indexOf(a)),[u,a]),{rect:L,node:A,isOver:x,setNodeRef:F}=ey({id:a,data:T,disabled:S.droppable,resizeObserverConfig:{updateMeasurementsFor:E,...c}}),{active:P,activatorEvent:N,activeNodeRect:M,attributes:B,setNodeRef:U,listeners:ee,isDragging:Q,over:te,setActivatorNodeRef:ue,transform:fe}=ud({id:a,data:T,attributes:{...zA,...r},disabled:S.draggable}),pe=qm(F,U),ie=!!P,Te=ie&&!b&&Ia(m)&&Ia(v),ye=!y&&Q,$=ye&&Te?fe:null,Z=Te?$??(i??C)({rects:h,activeNodeRect:M,activeIndex:m,overIndex:v,index:w}):null,he=Ia(m)&&Ia(v)?s({id:a,items:u,activeIndex:m,overIndex:v}):w,be=P==null?void 0:P.id,ge=p.useRef({activeId:be,items:u,newIndex:he,containerId:f}),le=u!==ge.current.items,ve=t({active:P,containerId:f,isDragging:Q,isSorting:ie,id:a,index:w,items:u,newIndex:ge.current.newIndex,previousItems:ge.current.items,previousContainerId:ge.current.containerId,transition:d,wasDragging:ge.current.activeId!=null}),Ae=VA({disabled:!ve,index:w,node:A,rect:L});return p.useEffect(()=>{ie&&ge.current.newIndex!==he&&(ge.current.newIndex=he),f!==ge.current.containerId&&(ge.current.containerId=f),u!==ge.current.items&&(ge.current.items=u)},[ie,he,f,u]),p.useEffect(()=>{if(be===ge.current.activeId)return;if(be&&!ge.current.activeId){ge.current.activeId=be;return}const de=setTimeout(()=>{ge.current.activeId=be},50);return()=>clearTimeout(de)},[be]),{active:P,activeIndex:m,attributes:B,data:T,rect:L,index:w,newIndex:he,items:u,isOver:x,isSorting:ie,isDragging:Q,listeners:ee,node:A,overIndex:v,over:te,setNodeRef:pe,setActivatorNodeRef:ue,setDroppableNodeRef:F,setDraggableNodeRef:U,transform:Ae??Z,transition:Y()};function Y(){if(Ae||le&&ge.current.newIndex===w)return UA;if(!(ye&&!Es(N)||!d)&&(ie||ve))return Or.Transition.toString({...d,property:Ap})}}function QA(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:t.draggable,droppable:(n=e==null?void 0:e.droppable)!=null?n:t.droppable}}function La(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const WA=[Pe.Down,Pe.Right,Pe.Up,Pe.Left],RA=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:o,droppableContainers:s,over:a,scrollableAncestors:i}}=t;if(WA.includes(e.code)){if(e.preventDefault(),!r||!n)return;const c=[];s.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const m=o.get(f.id);if(m)switch(e.code){case Pe.Down:n.top<m.top&&c.push(f);break;case Pe.Up:n.top>m.top&&c.push(f);break;case Pe.Left:n.left>m.left&&c.push(f);break;case Pe.Right:n.left<m.left&&c.push(f);break}});const d=rv({collisionRect:n,droppableRects:o,droppableContainers:c});let u=$c(d,"id");if(u===(a==null?void 0:a.id)&&d.length>1&&(u=d[1].id),u!=null){const f=s.get(r.id),m=s.get(u),g=m?o.get(m.id):null,b=m==null?void 0:m.node.current;if(b&&g&&f&&m){const v=Is(b).some((E,L)=>i[L]!==E),y=kp(f,m),C=GA(f,m),S=v||!y?{x:0,y:0}:{x:C?n.width-g.width:0,y:C?n.height-g.height:0},w={x:g.left,y:g.top};return S.x&&S.y?w:Co(w,S)}}}};function kp(e,t){return!La(e)||!La(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function GA(e,t){return!La(e)||!La(t)||!kp(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const cn={row:"_row_1m6cn_1",removeBtn:"_removeBtn_1m6cn_14",grip:"_grip_1m6cn_17",ctIcon:"_ctIcon_1m6cn_34",info:"_info_1m6cn_38",name:"_name_1m6cn_46",meta:"_meta_1m6cn_55"},KA={video:Us,pdf:Ao,h5p:Fs,scorm:Bs,audio:$s,quiz:xs,course:Nr,default:xr},YA=({item:e,onRemove:t,isEditable:r})=>{const n=ne(),o=Vo(e),s=KA[o.key]??xr,{attributes:a,listeners:i,setNodeRef:c,transform:d,transition:u,isDragging:f}=HA({id:e.id,disabled:!r}),m={transform:Or.Transform.toString(d),transition:u,opacity:f?.5:1};return l.jsxs("div",{ref:c,style:m,className:cn.row,role:"listitem",children:[r&&l.jsx("span",{className:cn.grip,...a,...i,"aria-label":n.contentRow.dragToReorderAriaLabel,children:l.jsx(Cd,{size:15})}),l.jsx("span",{className:[`sbx-ct-sq--${o.key}`,cn.ctIcon].join(" "),"aria-hidden":"true",children:l.jsx(s,{size:14})}),l.jsxs("div",{className:cn.info,children:[l.jsx("span",{className:cn.name,title:e.name,children:e.name}),l.jsx("span",{className:cn.meta,children:o.label})]}),l.jsx("span",{className:`sbx-ct-badge--${o.key}`,children:o.label}),r&&l.jsx("button",{type:"button",className:cn.removeBtn,onClick:()=>t(e.id),"aria-label":n.contentRow.removeAriaLabel.replace("{name}",e.name),children:l.jsx(ur,{size:14})})]})},ce={container:"_container_pi4q5_1",header:"_header_pi4q5_7",heading:"_heading_pi4q5_13",count:"_count_pi4q5_21",list:"_list_pi4q5_30",emptyState:"_emptyState_pi4q5_36",skillPicker:"_skillPicker_pi4q5_52",skillsCovered:"_skillsCovered_pi4q5_52",chips:"_chips_pi4q5_64",chip:"_chip_pi4q5_64",skillWarning:"_skillWarning_pi4q5_80",selectedSkills:"_selectedSkills_pi4q5_85",skillPill:"_skillPill_pi4q5_91",skillPillFlagged:"_skillPillFlagged_pi4q5_103",skillPillUncovered:"_skillPillUncovered_pi4q5_107",skillPillRemove:"_skillPillRemove_pi4q5_112",skillSearchBox:"_skillSearchBox_pi4q5_127",skillSearchWrap:"_skillSearchWrap_pi4q5_132",searchIcon:"_searchIcon_pi4q5_147",skillSearchInput:"_skillSearchInput_pi4q5_152",skillDropdown:"_skillDropdown_pi4q5_165",skillOption:"_skillOption_pi4q5_179",skillCheckbox:"_skillCheckbox_pi4q5_201",skillCheckboxChecked:"_skillCheckboxChecked_pi4q5_213",skillDropdownEmpty:"_skillDropdownEmpty_pi4q5_218",skillPickerNote:"_skillPickerNote_pi4q5_224",emptyHint:"_emptyHint_pi4q5_229",assessmentsCard:"_assessmentsCard_pi4q5_242",assessmentSlots:"_assessmentSlots_pi4q5_254",assessmentItemRow:"_assessmentItemRow_pi4q5_260",assessmentItemIcon:"_assessmentItemIcon_pi4q5_271",assessmentItemInfo:"_assessmentItemInfo_pi4q5_283",assessmentItemTitle:"_assessmentItemTitle_pi4q5_290",assessmentItemMeta:"_assessmentItemMeta_pi4q5_299",addRowIcon:"_addRowIcon_pi4q5_304",assessmentItemBadge:"_assessmentItemBadge_pi4q5_316",menuWrap:"_menuWrap_pi4q5_327",menuBtn:"_menuBtn_pi4q5_332",dropmenu:"_dropmenu_pi4q5_345",dangerItem:"_dangerItem_pi4q5_375",addRow:"_addRow_pi4q5_304",addRowAssessment:"_addRowAssessment_pi4q5_399",addRowText:"_addRowText_pi4q5_406",requiredBadge:"_requiredBadge_pi4q5_411"},ZA=({options:e,selected:t,outOfScope:r,uncovered:n,onChange:o,isEditable:s,description:a})=>{const i=ne(),[c,d]=p.useState(""),[u,f]=p.useState(!1),m=p.useRef(null);p.useEffect(()=>{if(!u)return;const v=y=>{var C;(C=m.current)!=null&&C.contains(y.target)||f(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[u]);const g=c?e.filter(v=>v.toLowerCase().includes(c.toLowerCase())):e,b=v=>{s&&o(t.includes(v)?t.filter(y=>y!==v):[...t,v])},h=v=>{s&&o(t.filter(y=>y!==v))};return l.jsxs("div",{className:ce.skillPicker,children:[l.jsxs("div",{className:ce.header,children:[l.jsx("span",{className:ce.heading,children:i.learningPath.skillsHeading}),l.jsx("span",{className:ce.count,children:t.length})]}),l.jsx("span",{className:ce.skillPickerNote,children:a}),r.length>0&&l.jsx("div",{className:ce.skillWarning,role:"alert",children:i.learningPath.skillsOutOfScopeWarning.replace("{skills}",r.join(", "))}),n.length>0&&l.jsx("div",{className:ce.skillWarning,role:"alert",children:i.learningPath.skillsUncoveredWarning.replace("{skills}",n.join(", "))}),t.length>0&&l.jsx("div",{className:ce.selectedSkills,children:t.map(v=>{const y=r.includes(v),C=n.includes(v);return l.jsxs("span",{className:[ce.skillPill,y?ce.skillPillFlagged:"",C?ce.skillPillUncovered:""].filter(Boolean).join(" "),title:C?i.learningPath.skillUncoveredPillTitle:void 0,children:[v,s&&l.jsx("button",{type:"button",className:ce.skillPillRemove,onClick:()=>h(v),"aria-label":i.learningPath.removeSkillAriaLabel.replace("{skill}",v),children:l.jsx(ur,{size:11})})]},v)})}),s?l.jsxs("div",{className:ce.skillSearchBox,ref:m,children:[l.jsxs("div",{className:ce.skillSearchWrap,onClick:()=>f(!0),children:[l.jsx("input",{type:"search",className:ce.skillSearchInput,placeholder:i.learningPath.searchSkillsPlaceholder,value:c,onChange:v=>d(v.target.value),onFocus:()=>f(!0),"aria-label":i.learningPath.searchSkillsPlaceholder}),l.jsx(qs,{size:14,className:ce.searchIcon})]}),u&&l.jsx("div",{className:ce.skillDropdown,role:"listbox",children:e.length===0?l.jsx("div",{className:ce.skillDropdownEmpty,children:i.learningPath.noSkillsAvailable}):g.length===0?l.jsx("div",{className:ce.skillDropdownEmpty,children:i.learningPath.noMatchingSkills}):g.map(v=>{const y=t.includes(v);return l.jsxs("button",{type:"button",role:"option","aria-selected":y,className:ce.skillOption,onClick:()=>b(v),children:[l.jsx("span",{className:[ce.skillCheckbox,y?ce.skillCheckboxChecked:""].join(" "),children:y&&l.jsx(Yr,{size:12})}),v]},v)})})]}):t.length===0&&l.jsx("span",{className:ce.emptyHint,children:i.learningPath.noSkillsSelectedYet})]})},Vl=({slot:e,isEditable:t})=>{const r=ne(),{pre:n,post:o,setActiveAssessmentSlot:s,deleteSlot:a}=Tl(),i=ae(h=>h.selectNode),[c,d]=p.useState(!1),u=p.useRef(null),f=e==="pre"?n:o,m=e==="pre"?r.learningPath.priorAssessmentLabel:r.learningPath.outcomeAssessmentLabel;if(p.useEffect(()=>{if(!c)return;const h=v=>{var y;(y=u.current)!=null&&y.contains(v.target)||d(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[c]),!f.filled)return l.jsxs("button",{type:"button",className:[ce.addRow,ce.addRowAssessment].join(" "),disabled:!t,onClick:()=>s(e),children:[l.jsx("span",{className:ce.addRowIcon,children:l.jsx(Xr,{size:16})}),l.jsx("span",{className:ce.addRowText,children:r.learningPath.addAssessmentSlotButton.replace("{label}",m)}),f.required&&l.jsx("span",{className:ce.requiredBadge,children:r.learningPath.requiredSlotBadge})]});const g=e==="pre"?r.learningPath.skillCheckBadge:r.learningPath.outcomeCheckBadge,b=()=>f.level&&i(f.level.id);return l.jsxs("div",{className:ce.assessmentItemRow,role:"button",tabIndex:0,onClick:b,onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),b())},children:[l.jsx("span",{className:ce.assessmentItemIcon,children:l.jsx(Nr,{size:16})}),l.jsxs("div",{className:ce.assessmentItemInfo,children:[l.jsx("span",{className:ce.assessmentItemTitle,children:f.courseName||r.learningPath.courseNameUnavailable}),l.jsxs("span",{className:ce.assessmentItemMeta,children:[m," · ",r.learningPath.assessmentCourseMeta]})]}),l.jsx("span",{className:ce.assessmentItemBadge,children:g}),t&&l.jsxs("div",{className:ce.menuWrap,ref:u,children:[l.jsx("button",{type:"button",className:ce.menuBtn,onClick:h=>{h.stopPropagation(),d(v=>!v)},"aria-label":r.treeNode.nodeOptionsAriaLabel,children:"⋮"}),c&&l.jsxs("div",{className:ce.dropmenu,onClick:h=>h.stopPropagation(),children:[l.jsxs("button",{type:"button",onClick:()=>{d(!1),f.level&&i(f.level.id)},children:[l.jsx(_y,{size:12})," ",r.learningPath.viewCourseMenuItem]}),l.jsxs("button",{type:"button",className:ce.dangerItem,onClick:()=>{d(!1),a(e)},children:[l.jsx(js,{size:12})," ",r.treeNode.deleteMenuItem]})]})]})]})},XA=({editorMode:e,isRoot:t=!1})=>{const r=ne(),{selectedNodeId:n,getChildrenOf:o,getNodeById:s,reorderChildren:a,deleteNode:i,activeNodeMeta:c,updateNode:d,treeData:u}=ae(),f=K(M=>M.editorProfile),m=n?o(n):[],g=e==="edit",b=n?s(n):void 0,h=f.competencyScoped,v=h&&!t&&!lt(b),y=h&&t,{scope:C,source:S}=Mo(),w=hr(),T=w&&Array.isArray(c[w.code])?c[w.code]:[],E=S==="prior"?T.filter(M=>!C.includes(M)):[],L=y?CS(u[0],w==null?void 0:w.code):[],A=v?Fu(b,T,w==null?void 0:w.code):[],x=p.useCallback(M=>{!n||!(w!=null&&w.code)||d(n,{[w.code]:M},[w.code])},[n,w==null?void 0:w.code,d]),F=Nc(ei(Ds,{activationConstraint:{distance:5}}),ei(si,{coordinateGetter:RA})),P=p.useCallback(M=>{const{active:B,over:U}=M;if(!U||B.id===U.id||!n)return;const ee=ae.getState().getChildrenOf(n),Q=ee.findIndex(ue=>ue.id===B.id),te=ee.findIndex(ue=>ue.id===U.id);Q<0||te<0||a(n,Q,te)},[n,a]),N=p.useCallback(M=>{window.confirm(r.unitContentList.removeConfirm)&&i(M)},[i,r.unitContentList.removeConfirm]);return n?l.jsxs("div",{className:ce.container,children:[y&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:ce.skillsCovered,children:[l.jsx("span",{className:ce.heading,children:r.learningPath.skillsCoveredHeading}),l.jsx("span",{className:ce.emptyHint,children:r.learningPath.skillsCoveredDescription}),L.length>0&&l.jsx("div",{className:ce.chips,children:L.map(M=>l.jsx("span",{className:ce.chip,children:M},M))}),L.length===0&&l.jsx("span",{className:ce.emptyHint,children:r.learningPath.noSkillsYet})]}),l.jsxs("div",{className:ce.assessmentsCard,children:[l.jsx("span",{className:ce.heading,children:r.learningPath.assessmentsCardHeading}),l.jsx("span",{className:ce.emptyHint,children:r.learningPath.assessmentsCardDescription}),l.jsxs("div",{className:ce.assessmentSlots,children:[l.jsx(Vl,{slot:"pre",isEditable:g}),l.jsx(Vl,{slot:"post",isEditable:g})]})]})]}),v&&l.jsx(ZA,{options:C,selected:T,outOfScope:E,uncovered:A,onChange:x,isEditable:g,description:S==="prior"?r.learningPath.skillScopeFromPriorNote:r.learningPath.skillScopeManualNote}),!h&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:ce.header,children:[l.jsx("span",{className:ce.heading,children:r.unitContentList.heading}),l.jsx("span",{className:ce.count,children:m.length})]}),m.length>0?l.jsx(cd,{sensors:F,collisionDetection:tv,onDragEnd:P,children:l.jsx($A,{items:m.map(M=>M.id),strategy:FA,children:l.jsx("div",{className:ce.list,role:"list",children:m.map(M=>l.jsx(YA,{item:M,onRemove:N,isEditable:g},M.id))})})}):l.jsxs("div",{className:ce.emptyState,children:[l.jsx("p",{children:r.unitContentList.emptyTitle}),l.jsx("span",{children:r.unitContentList.emptyHint})]}),g&&!lt(b)&&l.jsxs("button",{className:ce.addRow,type:"button","aria-label":r.unitContentList.addContentAriaLabel,children:[l.jsx(Xr,{size:14})," ",r.unitContentList.addContent]})]})]}):null},Ip={dropZone:"_dropZone_ijo5w_1",active:"_active_ijo5w_14"},JA=({isActive:e,label:t,nodeId:r,className:n})=>{const o=ne(),s=t??o.dropZone.dropHere;return l.jsx("div",{className:`${Ip.dropZone} ${e?Ip.active:""} ${n??""}`,"data-droppable":e?"true":void 0,"data-node-id":r,"aria-label":s,role:"region",children:l.jsx("span",{children:s})})},Dp=["identifier","name","mimeType","contentType","primaryCategory","appIcon","channel","organisation","pkgVersion"];async function ek(e){var a;const t={status:["Live"],...e.filters??{}};e.channel&&(t.channel=e.channel);const n=((a=(await Me.post("/action/composite/v3/search",{request:{filters:t,query:e.query??"",limit:e.limit??20,offset:e.offset??0,sort_by:e.sortBy??{lastUpdatedOn:"desc"},fields:e.fields??Dp}},{headers:{"X-Source":"web","X-msgid":Math.random().toString(36).slice(2)}})).data)==null?void 0:a.result)??{},o=new Set(["count","facets"]);return{content:Object.entries(n).filter(([i])=>!o.has(i)).flatMap(([,i])=>Array.isArray(i)?i:[]),count:n.count??0}}async function tk(e){var r,n;return(n=(r=(await Me.get(`/action/content/v3/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.content}const Lp="application/vnd.sunbird.question";function Op(e){return{cardinality:"single",type:"integer",defaultValue:e.maxScore??1}}function Pp(e,t,r){if(!e)return null;if(e.identifier===t)return{question:e,parent:r};for(const n of e.children??[]){const o=Pp(n,t,e);if(o)return o}return null}function rk(e,t){const r=Pp(e,t);if(!r)return null;const{question:n,parent:o}=r,s={...e,children:[n],childNodes:[t],shuffle:o==null?void 0:o.shuffle,showSolutions:(o==null?void 0:o.showSolutions)??"No",showFeedback:(o==null?void 0:o.showFeedback)??"No"};return(o==null?void 0:o.shuffle)===!0?s.maxScore=1:n.qType==="SA"?delete s.maxScore:n.maxScore!=null&&(s.maxScore=n.maxScore),s}function nk(e,t){const r=((t==null?void 0:t.enabled)??!0)&&!!e;return _n({queryKey:["quml","questionset",e],enabled:r,queryFn:async()=>{const n=await Eu(e),o=u=>{if(!u)return[];const f=u.mimeType===Lp&&u.identifier?[u.identifier]:[],m=(u.children??[]).flatMap(o);return[...f,...m]},s=o(n),a=new Map;s.length&&(await aS(s)).forEach(f=>{const m=f.identifier;m&&a.set(m,f)});const i=u=>{if(!u)return u;if(u.mimeType===Lp&&u.identifier){const f=a.get(u.identifier)??u,m=f.outcomeDeclaration;return m!=null&&m.maxScore||(f.outcomeDeclaration={...m??{},maxScore:Op(f)}),f}return Array.isArray(u.children)&&(u.children=u.children.map(f=>i(f))),u},c=i(n),d=c.outcomeDeclaration;return d!=null&&d.maxScore||(c.outcomeDeclaration={...d??{},maxScore:Op(c)}),c}})}const Np="/assets/quml-player/sunbird-quml-player.js",ok="/assets/quml-player/styles.css",xp="sunbird-quml-player";function sk(e){const t=e.children??[];return t.length?t.every(n=>n.objectType==="Question")?[e]:t:[]}const gt=class gt{constructor(){us(this,"eventHandlers",new WeakMap)}loadScript(){return gt.scriptLoaded||customElements.get(xp)?(gt.scriptLoaded=!0,Promise.resolve()):(gt.scriptLoading||(gt.scriptLoading=new Promise((t,r)=>{const n=document.createElement("script");n.src=Np,n.setAttribute("data-quml-player-script","true"),n.onload=()=>{gt.scriptLoaded=!0,gt.scriptLoading=void 0,t()},n.onerror=()=>{gt.scriptLoading=void 0,r(new Error(`Failed to load QuML player script: ${Np}`))},document.body.appendChild(n)})),gt.scriptLoading)}loadStyles(){if(gt.stylesLoaded||document.querySelector('[data-quml-player-styles="true"]')){gt.stylesLoaded=!0;return}const t=document.createElement("link");t.rel="stylesheet",t.href=ok,t.setAttribute("data-quml-player-styles","true"),document.head.appendChild(t),gt.stylesLoaded=!0}static unloadStyles(){var t;(t=document.querySelector('[data-quml-player-styles="true"]'))==null||t.remove(),gt.stylesLoaded=!1}async createConfig(t,r,n){var s,a,i;return await this.loadScript(),{context:{mode:(n==null?void 0:n.mode)??"play",host:"",pdata:{id:((s=r==null?void 0:r.pdata)==null?void 0:s.id)??"sunbird.portal",ver:((a=r==null?void 0:r.pdata)==null?void 0:a.ver)??"1.0",pid:((i=r==null?void 0:r.pdata)==null?void 0:i.pid)??"sunbird-portal"},contentId:t.identifier??"",sid:(r==null?void 0:r.sid)??"",uid:(r==null?void 0:r.uid)??(r==null?void 0:r.userId)??"",channel:(r==null?void 0:r.channel)??"",did:(r==null?void 0:r.did)??"",tags:(r==null?void 0:r.tags)??[],contextRollup:(n==null?void 0:n.contextRollup)??(r==null?void 0:r.rollup)??{},objectRollup:(n==null?void 0:n.objectRollup)??{},...n!=null&&n.cdata?{cdata:n.cdata}:{}},config:{language:"en"},data:{sections:sk(t),identifier:t.identifier??""},metadata:t}}createElement(t){this.loadStyles();const r=document.createElement(xp);return r.setAttribute("player-config",JSON.stringify(t)),r.setAttribute("data-player-id",t.metadata.identifier??"quml"),r}attachEventListeners(t,r,n){this.removeEventListeners(t);const o=a=>r==null?void 0:r(a),s=a=>n==null?void 0:n(a.detail);t.addEventListener("playerEvent",o),t.addEventListener("telemetryEvent",s),this.eventHandlers.set(t,{player:o,telemetry:s})}removeEventListeners(t){const r=this.eventHandlers.get(t);r&&(t.removeEventListener("playerEvent",r.player),t.removeEventListener("telemetryEvent",r.telemetry),this.eventHandlers.delete(t))}};us(gt,"scriptLoaded",!1),us(gt,"scriptLoading"),us(gt,"stylesLoaded",!1);let Oa=gt;const Pa=new Oa,We={contentPlayerRoot:"_contentPlayerRoot_1rdfn_1",flowLayout:"_flowLayout_1rdfn_9",stage:"_stage_1rdfn_13",aspectRatio:"_aspectRatio_1rdfn_16",playerHeader:"_playerHeader_1rdfn_32",playerHeaderThumb:"_playerHeaderThumb_1rdfn_46",playerHeaderTitle:"_playerHeaderTitle_1rdfn_56",typeBadge:"_typeBadge_1rdfn_66",typeDot:"_typeDot_1rdfn_105",playerFrame:"_playerFrame_1rdfn_125",coverOverlay:"_coverOverlay_1rdfn_133",coverHidden:"_coverHidden_1rdfn_145",coverThumb:"_coverThumb_1rdfn_150",coverPlayRing:"_coverPlayRing_1rdfn_159",coverPlayIcon:"_coverPlayIcon_1rdfn_172",coverLabel:"_coverLabel_1rdfn_181",coverSkeleton:"_coverSkeleton_1rdfn_187",playerWrapper:"_playerWrapper_1rdfn_213",infoStrip:"_infoStrip_1rdfn_223",infoChip:"_infoChip_1rdfn_239",infoChipLabel:"_infoChipLabel_1rdfn_258",infoChipIcon:"_infoChipIcon_1rdfn_267",playerError:"_playerError_1rdfn_273",playerErrorIcon:"_playerErrorIcon_1rdfn_287",playerErrorMsg:"_playerErrorMsg_1rdfn_292",qumlRoot:"_qumlRoot_1rdfn_299"},ak="application/vnd.sunbird.questionset";function ik(e,t){const r=new Map,n=s=>{for(const a of s)r.set(a.id,a),a.children&&n(a.children)};n(e);let o=r.get(t);for(;o;){if(o.mimeType===ak)return o.identifier;o=o.parent?r.get(o.parent):void 0}return null}const lk=[{key:"video",mimes:["video/mp4","video/webm","video/ogg"]},{key:"audio",mimes:["audio/mp3","audio/mpeg","audio/ogg","audio/wav"]},{key:"pdf",mimes:["application/pdf"]},{key:"epub",mimes:["application/epub"]},{key:"ecml",mimes:["application/vnd.ekstep.ecml-archive"]},{key:"h5p",mimes:["application/vnd.ekstep.h5p-archive"]},{key:"scorm",mimes:["application/vnd.ekstep.content-collection"]}];function ck(e){return lk.find(t=>t.mimes.includes(e))??{key:"other"}}function dk(e,t){switch(e){case"video":return t.contentPlayer.mimeLabelVideo;case"audio":return t.contentPlayer.mimeLabelAudio;case"pdf":return t.contentPlayer.mimeLabelPdf;case"epub":return t.contentPlayer.mimeLabelEpub;case"ecml":return t.contentPlayer.mimeLabelEcml;case"h5p":return t.contentPlayer.mimeLabelH5p;case"scorm":return t.contentPlayer.mimeLabelScorm;default:return t.contentPlayer.mimeLabelOther}}const uk={"pdf-player":["application/pdf"],"video-player":["video/mp4","video/webm"],"epub-player":["application/epub"]},fk={"pdf-player":"/assets/sunbird-pdf-player.js","video-player":"/assets/sunbird-video-player.js","epub-player":"/assets/sunbird-epub-player.js"},hk={"pdf-player":"sunbird-pdf-player","video-player":"sunbird-video-player","epub-player":"sunbird-epub-player"},pk="/content/preview/preview.html?webview=true&build_number=2.8.0.e552fcd";function Hl(e){for(const[t,r]of Object.entries(uk))if(r.includes(e))return t;return"default-player"}function gk(e,t,r){var s;const n=r==null?void 0:r.context,o=t.mimeType??e.mimeType??"";return{context:{mode:"play",partner:[],pdata:{id:((s=n==null?void 0:n.pdata)==null?void 0:s.id)??"sunbird.portal",ver:1,pid:"sunbird-portal"},contentId:e.identifier,sid:(n==null?void 0:n.sid)??"",uid:(n==null?void 0:n.uid)??"",channel:(n==null?void 0:n.channel)??"",did:(n==null?void 0:n.did)??"",timeDiff:0,contextRollup:{},tags:[],app:[(n==null?void 0:n.channel)??""],dims:""},config:{showEndPage:!1,showStartPage:!0,host:"",overlay:{showUser:!1},splash:{text:"",icon:"",bgImage:"",webLink:""},sideMenu:{showDownload:!0,showExit:!1,showShare:!0},apislug:"/action",repos:["/sunbird-plugins/renderer"],plugins:[{id:"org.sunbird.iframeEvent",ver:1,type:"plugin"},{id:"org.sunbird.player.endpage",ver:1.1,type:"plugin"}],enableTelemetryValidation:!1},metadata:t,data:o==="application/vnd.ekstep.ecml-archive"?t.body??{}:{}}}function mk(e){return document.querySelector(`script[src="${e}"]`)?Promise.resolve():new Promise((t,r)=>{const n=document.createElement("script");n.src=e,n.onload=()=>t(),n.onerror=()=>r(new Error(`Failed to load ${e}`)),document.head.appendChild(n)})}async function vk(e,t,r=100){await mk(fk[t]??""),!customElements.get(e)&&await new Promise((n,o)=>{let s=0;const a=setInterval(()=>{s++,customElements.get(e)?(clearInterval(a),n()):s>=r&&(clearInterval(a),o(new Error(`Custom element <${e}> did not register`)))},100)})}const yk=[{key:"author",icon:zy},{key:"license",icon:xy},{key:"language",icon:Ey},{key:"gradeLevel",icon:Fy},{key:"subject",icon:Nr},{key:"contentType",icon:jy}];function bk(e,t){switch(e){case"author":return t.contentPlayer.infoFieldAuthor;case"license":return t.contentPlayer.infoFieldLicense;case"language":return t.contentPlayer.infoFieldLanguage;case"gradeLevel":return t.contentPlayer.infoFieldClass;case"subject":return t.contentPlayer.infoFieldSubject;case"contentType":return t.contentPlayer.infoFieldType;default:return e}}function Ck({node:e}){const t=ne(),r=e.metadata??{},n=yk.flatMap(o=>{const s=r[o.key];if(!s)return[];const a=Array.isArray(s)?s.join(", "):String(s);return a?[{...o,label:bk(o.key,t),val:a}]:[]});return n.length?l.jsx("div",{className:We.infoStrip,children:n.map(o=>l.jsxs("div",{className:We.infoChip,children:[o.icon&&l.jsx(o.icon,{size:13,className:We.infoChipIcon}),l.jsx("span",{className:We.infoChipLabel,children:o.label}),o.val]},o.key))}):null}function Fp({node:e,hidden:t}){var o;const r=ne(),n=e.appIcon??((o=e.metadata)==null?void 0:o.appIcon);return l.jsx("div",{className:`${We.coverOverlay} ${t?We.coverHidden:""}`,children:n?l.jsxs(l.Fragment,{children:[l.jsx("img",{src:n,alt:e.name,className:We.coverThumb}),l.jsx("div",{className:We.coverPlayRing,children:l.jsx("div",{className:We.coverPlayIcon})}),l.jsx("span",{className:We.coverLabel,children:r.contentPlayer.loadingPreview})]}):l.jsx("div",{className:We.coverSkeleton})})}function Mp({message:e}){return l.jsxs("div",{className:We.playerError,children:[l.jsx(Uy,{size:28,className:We.playerErrorIcon}),l.jsx("span",{className:We.playerErrorMsg,children:e})]})}function Sk({mimeType:e}){const t=ne(),r=ck(e);return l.jsxs("span",{className:We.typeBadge,"data-type":r.key,children:[l.jsx("span",{className:We.typeDot}),dk(r.key,t)]})}const Ql=({node:e,editorMode:t,type:r,singleQuestion:n,layout:o="fill"})=>{var a;if(r==="quml")return l.jsx(_k,{node:e,editorMode:t,singleQuestion:!!n});const s=e.appIcon??((a=e.metadata)==null?void 0:a.appIcon);return l.jsxs("div",{className:`${We.contentPlayerRoot} ${o==="flow"?We.flowLayout:""}`,children:[l.jsxs("div",{className:We.stage,children:[l.jsxs("div",{className:We.playerHeader,children:[s&&l.jsx("img",{src:s,alt:"",className:We.playerHeaderThumb}),l.jsx("span",{className:We.playerHeaderTitle,children:e.name}),l.jsx(Sk,{mimeType:e.mimeType??""})]}),l.jsx(wk,{node:e})]}),l.jsx(Ck,{node:e})]})};function wk({node:e}){var y;const t=ne(),r=K(C=>C.editorConfig),[n,o]=p.useState(()=>Hl(e.mimeType??"")),[s,a]=p.useState(!1),[i,c]=p.useState(null),[d,u]=p.useState(e.metadata??{}),[f,m]=p.useState(!1),g=p.useRef(null),b=p.useRef(null),h=((y=r==null?void 0:r.config)==null?void 0:y.previewCdnUrl)??pk;p.useEffect(()=>{let C=!1;return m(!1),a(!1),c(null),u(e.metadata??{}),o(Hl(e.mimeType??"")),tk(e.identifier).then(S=>{if(C)return;const w={...e.metadata??{},...S};u(w);const T=S.mimeType??e.mimeType??"";o(Hl(T)),m(!0)}).catch(()=>{C||m(!0)}),()=>{C=!0}},[e.identifier]);const v=gk(e,d,r);return p.useEffect(()=>{if(!f||n!=="default-player")return;const C=g.current;if(!C)return;C.src=h;const S=()=>{try{const T=C.contentWindow;if(typeof(T==null?void 0:T.initializePreview)!="function"){c(t.contentPlayer.previewPlayerUnavailable);return}T.initializePreview(v),setTimeout(()=>a(!0),300)}catch(T){console.error("[ContentPlayer] initializePreview failed",T),c(t.contentPlayer.failedToInitializePlayer)}},w=()=>c(t.contentPlayer.previewPlayerLoadFailed);return C.addEventListener("load",S),C.addEventListener("error",w),()=>{C.removeEventListener("load",S),C.removeEventListener("error",w),C.src=""}},[e.identifier,n,h,f,t]),p.useEffect(()=>{if(!f||n==="default-player")return;const C=b.current;if(!C)return;const S=hk[n];if(!S)return;const w=v;vk(S,n).then(()=>{if(!b.current)return;if(!customElements.get(S)){o("default-player");return}const T=document.createElement(S);T.setAttribute("player-config",JSON.stringify(w)),T.addEventListener("playerEvent",()=>{}),T.addEventListener("telemetryEvent",()=>{}),C.innerHTML="",C.appendChild(T),setTimeout(()=>{try{T.playerConfig=w}catch{}a(!0)},200)}).catch(()=>{console.warn(`[ContentPlayer] ${n} script unavailable, falling back to iframe`),o("default-player")})},[e.identifier,n,f]),l.jsxs("div",{className:We.aspectRatio,children:[i?l.jsx(Mp,{message:i}):l.jsx(Fp,{node:e,hidden:s}),n==="default-player"?l.jsx("iframe",{ref:g,id:"contentPlayer",title:e.name,className:We.playerFrame,name:"contentPlayer",allowFullScreen:!0}):l.jsx("div",{ref:b,className:We.playerFrame})]})}function _k({node:e,editorMode:t,singleQuestion:r}){const n=ne(),o=K(g=>g.editorConfig),s=ae(g=>g.treeData),a=p.useRef(null),i=r?ik(s,e.id):e.identifier,{data:c,isLoading:d,error:u}=nk(i??"",{enabled:!!i}),f=p.useMemo(()=>c?r?rk(c,e.identifier):c:null,[c,r,e.identifier]);p.useEffect(()=>{const g=a.current;if(!g||!f)return;let b=null,h=!1;return(async()=>{try{const v=await Pa.createConfig(f,o==null?void 0:o.context,{mode:t==="edit"?"edit":"play"});if(h||!a.current)return;const y=Pa.createElement(v);b=y,Pa.attachEventListeners(y,C=>console.debug("[QumlPlayer] playerEvent",C.detail),C=>console.debug("[QumlPlayer] telemetryEvent",C)),g.innerHTML="",g.appendChild(y)}catch(v){console.error("[QumlPlayer] failed to initialize",v)}})(),()=>{h=!0,b&&(Pa.removeEventListeners(b),b.remove()),Oa.unloadStyles()}},[f,o,t,r]);const m=u?`${n.contentPlayer.unableToLoadQuestionset} ${u.message}`:r&&!i?n.contentPlayer.parentQuestionsetNotResolved:r&&c&&!f?n.contentPlayer.questionNotFoundInQuestionset:null;return l.jsxs("div",{className:We.qumlRoot,children:[m?l.jsx(Mp,{message:m}):d||!f?l.jsx(Fp,{node:e,hidden:!1}):null,l.jsx("div",{ref:a,className:We.playerWrapper})]})}const Zt={overlay:"_overlay_1b1xq_1",modal:"_modal_1b1xq_11",header:"_header_1b1xq_21",body:"_body_1b1xq_37",hint:"_hint_1b1xq_43",list:"_list_1b1xq_49",item:"_item_1b1xq_55",selected:"_selected_1b1xq_68",empty:"_empty_1b1xq_73",footer:"_footer_1b1xq_79",cancelBtn:"_cancelBtn_1b1xq_87",moveBtn:"_moveBtn_1b1xq_95"};function Tk(e,t,r){const n=[],o=s=>{var a;for(const i of s)i.isFolder&&i.id!==r&&i.id!==t&&n.push(i),(a=i.children)!=null&&a.length&&o(i.children)};return o(e),n}const Ek=({resourceId:e,resourceName:t,currentUnitId:r,onClose:n})=>{var f;const o=ne(),{treeData:s,moveNode:a}=ae(),i=Tk(s,((f=s[0])==null?void 0:f.id)??"",r),[c,d]=p.useState(null),u=()=>{c&&(a(e,r,c),n())};return l.jsx("div",{className:Zt.overlay,role:"dialog","aria-label":o.resourceReorderDialog.dialogAriaLabel,children:l.jsxs("div",{className:Zt.modal,children:[l.jsxs("div",{className:Zt.header,children:[l.jsxs("span",{children:[o.resourceReorderDialog.moveHeaderPrefix,' "',t,'"']}),l.jsx("button",{onClick:n,"aria-label":o.resourceReorderDialog.closeAriaLabel,children:l.jsx(ur,{size:16})})]}),l.jsxs("div",{className:Zt.body,children:[l.jsx("p",{className:Zt.hint,children:o.resourceReorderDialog.selectUnitHint}),l.jsxs("ul",{className:Zt.list,children:[i.map(m=>l.jsxs("li",{className:`${Zt.item} ${c===m.id?Zt.selected:""}`,onClick:()=>d(m.id),children:[l.jsx(Ty,{size:14}),l.jsx("span",{children:m.name})]},m.id)),i.length===0&&l.jsx("li",{className:Zt.empty,children:o.resourceReorderDialog.noUnitsAvailable})]})]}),l.jsxs("div",{className:Zt.footer,children:[l.jsx("button",{className:Zt.cancelBtn,onClick:n,children:o.resourceReorderDialog.cancelButton}),l.jsx("button",{className:Zt.moveBtn,onClick:u,disabled:!c,children:o.resourceReorderDialog.moveButton})]})]})})},gr={overlay:"_overlay_1d56g_1",modal:"_modal_1d56g_11",header:"_header_1d56g_21",body:"_body_1d56g_37",table:"_table_1d56g_43",pageInput:"_pageInput_1d56g_61",empty:"_empty_1d56g_68",footer:"_footer_1d56g_74",cancelBtn:"_cancelBtn_1d56g_82",saveBtn:"_saveBtn_1d56g_90"};function Ak(e){const t=[],r=n=>{var o;for(const s of n)!s.isFolder&&(!s.children||s.children.length===0)?t.push(s):(o=s.children)!=null&&o.length&&r(s.children)};return r(e),t}const kk=({onClose:e})=>{const t=ne(),{treeData:r,updateNode:n}=ae(),o=Ak(r),[s,a]=p.useState(()=>Object.fromEntries(o.map(c=>{var d;return[c.id,String(((d=c.metadata)==null?void 0:d.pageNumber)??"")]}))),i=p.useCallback(()=>{for(const[c,d]of Object.entries(s))d!==""&&n(c,{pageNumber:parseInt(d,10)||void 0});e()},[s,n,e]);return l.jsx("div",{className:gr.overlay,role:"dialog","aria-label":t.assignPageNumber.dialogAriaLabel,children:l.jsxs("div",{className:gr.modal,children:[l.jsxs("div",{className:gr.header,children:[l.jsx("span",{children:t.assignPageNumber.title}),l.jsx("button",{onClick:e,"aria-label":t.assignPageNumber.closeAriaLabel,children:l.jsx(ur,{size:16})})]}),l.jsx("div",{className:gr.body,children:o.length===0?l.jsx("p",{className:gr.empty,children:t.assignPageNumber.emptyState}):l.jsxs("table",{className:gr.table,children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:t.assignPageNumber.contentColumnHeader}),l.jsx("th",{children:t.assignPageNumber.pageNumberColumnHeader})]})}),l.jsx("tbody",{children:o.map(c=>l.jsxs("tr",{children:[l.jsx("td",{children:c.name}),l.jsx("td",{children:l.jsx("input",{type:"number",min:1,value:s[c.id]??"",onChange:d=>a(u=>({...u,[c.id]:d.target.value})),className:gr.pageInput})})]},c.id))})]})}),l.jsxs("div",{className:gr.footer,children:[l.jsx("button",{className:gr.cancelBtn,onClick:e,children:t.assignPageNumber.cancelButton}),l.jsxs("button",{className:gr.saveBtn,onClick:i,children:[l.jsx(Ny,{size:14})," ",t.assignPageNumber.saveButton]})]})]})})},Xe={container:"_container_p2feh_1",panelHeader:"_panelHeader_p2feh_10",panelHeaderLeft:"_panelHeaderLeft_p2feh_19",panelCollapseBtn:"_panelCollapseBtn_p2feh_27",titleRow:"_titleRow_p2feh_46",field:"_field_p2feh_47",moveBtn:"_moveBtn_p2feh_64",icon:"_icon_p2feh_84",nameInput:"_nameInput_p2feh_93",fieldHeader:"_fieldHeader_p2feh_118",label:"_label_p2feh_124",fieldCount:"_fieldCount_p2feh_133",chips:"_chips_p2feh_170",chip:"_chip_p2feh_170",chipRemove:"_chipRemove_p2feh_188",keywordInput:"_keywordInput_p2feh_202",input:"_input_p2feh_207",addBtn:"_addBtn_p2feh_220",radioGroup:"_radioGroup_p2feh_234",radioLabel:"_radioLabel_p2feh_239"},Ik=({node:e,editorMode:t,onMoveClick:r,reorderDialog:n})=>{var N,M;const{updateNode:o,markDirty:s}=ae(),a=t==="edit",i=Vo(e),c=ne(),d=K(B=>B.relationalFormConfig),u=B=>d==null?void 0:d.find(U=>U.code===B),f=B=>!d||!!u(B),m=(B,U)=>{var ee;return((ee=u(B))==null?void 0:ee.label)||U},[g,b]=p.useState(!0),h=((N=e.metadata)==null?void 0:N.relationalMetadata)??{},[v,y]=p.useState(h.name??e.name??""),[C,S]=p.useState(""),[w,T]=p.useState(Array.isArray(h.keywords)?h.keywords:Array.isArray((M=e.metadata)==null?void 0:M.keywords)?e.metadata.keywords:[]),[E,L]=p.useState(!!h.optional);p.useEffect(()=>{var U,ee;const B=((U=e.metadata)==null?void 0:U.relationalMetadata)??{};y(B.name??e.name??""),T(Array.isArray(B.keywords)?B.keywords:Array.isArray((ee=e.metadata)==null?void 0:ee.keywords)?e.metadata.keywords:[]),L(!!B.optional)},[e.id]);const A=()=>{v.trim()&&v!==e.name&&(o(e.id,{name:v.trim()}),s())},x=()=>{const B=C.trim();if(B&&!w.includes(B)){const U=[...w,B];T(U),o(e.id,{keywords:U}),s()}S("")},F=B=>{const U=w.filter(ee=>ee!==B);T(U),o(e.id,{keywords:U}),s()},P=B=>{L(B),o(e.id,{optional:B}),s()};return l.jsxs("div",{className:Xe.container,children:[l.jsxs("div",{className:Xe.panelHeader,children:[l.jsxs("div",{className:Xe.panelHeaderLeft,children:[l.jsx("span",{className:`sbx-ct-badge--${i.key}`,children:i.label}),a&&l.jsx("button",{type:"button",className:Xe.moveBtn,onClick:r,children:c.contentEditForm.moveToAnotherUnitButton})]}),l.jsx("button",{type:"button",className:Xe.panelCollapseBtn,onClick:()=>b(B=>!B),"aria-expanded":g,"aria-label":g?c.contentEditForm.collapseMetadataPanelAriaLabel:c.contentEditForm.expandMetadataPanelAriaLabel,title:g?c.contentEditForm.collapseTitle:c.contentEditForm.expandTitle,children:g?l.jsx(Zr,{size:15}):l.jsx(by,{size:15})})]}),g&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:Xe.titleRow,children:[e.appIcon&&l.jsx("img",{src:e.appIcon,alt:c.contentEditForm.iconAlt,className:Xe.icon}),l.jsx("input",{type:"text",className:Xe.nameInput,value:v,disabled:!a,onChange:B=>y(B.target.value),onBlur:A,placeholder:c.contentEditForm.contentNamePlaceholder})]}),f("keywords")&&l.jsxs("div",{className:Xe.field,children:[l.jsx("div",{className:Xe.fieldHeader,children:l.jsxs("label",{className:Xe.label,children:[m("keywords",c.contentEditForm.keywordsLabel),w.length>0&&l.jsx("span",{className:Xe.fieldCount,children:w.length})]})}),w.length>0&&l.jsx("div",{className:Xe.chips,children:w.map(B=>l.jsxs("span",{className:Xe.chip,children:[B,a&&l.jsx("button",{type:"button",className:Xe.chipRemove,onClick:()=>F(B),children:"×"})]},B))}),a&&l.jsxs("div",{className:Xe.keywordInput,children:[l.jsx("input",{type:"text",className:Xe.input,value:C,placeholder:c.contentEditForm.addKeywordPlaceholder,onChange:B=>S(B.target.value),onKeyDown:B=>{B.key==="Enter"&&(B.preventDefault(),x())}}),l.jsx("button",{type:"button",className:Xe.addBtn,onClick:x,children:c.contentEditForm.addButton})]})]}),f("optional")&&l.jsxs("div",{className:Xe.field,children:[l.jsx("label",{className:Xe.label,children:m("optional",c.contentEditForm.optionalInCollectionLabel)}),l.jsxs("div",{className:Xe.radioGroup,children:[l.jsxs("label",{className:Xe.radioLabel,children:[l.jsx("input",{type:"radio",name:`optional-${e.id}`,checked:E===!0,onChange:()=>P(!0),disabled:!a}),c.contentEditForm.yesOption]}),l.jsxs("label",{className:Xe.radioLabel,children:[l.jsx("input",{type:"radio",name:`optional-${e.id}`,checked:E===!1,onChange:()=>P(!1),disabled:!a}),c.contentEditForm.noOption]})]})]})]}),n]})},Jo={iconBtn:"_iconBtn_gliz0_1",editable:"_editable_gliz0_14",iconImg:"_iconImg_gliz0_26",placeholder:"_placeholder_gliz0_34",removeBtn:"_removeBtn_gliz0_41"},Dk=({nodeId:e,value:t,editable:r})=>{const[n,o]=p.useState(!1),{updateNode:s,markDirty:a}=ae(),i=ne(),c=u=>{s(e,{appIcon:u}),a(),o(!1)},d=u=>{u.stopPropagation(),s(e,{appIcon:""}),a()};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:[Jo.iconBtn,r?Jo.editable:""].filter(Boolean).join(" "),role:r?"button":void 0,tabIndex:r?0:-1,"aria-label":r?i.titleAppIcon.selectAppIconAriaLabel:i.titleAppIcon.appIconAriaLabel,onClick:()=>r&&o(!0),onKeyDown:u=>{r&&(u.key==="Enter"||u.key===" ")&&o(!0)},children:[t?l.jsx("img",{src:t,alt:i.titleAppIcon.appIconAlt,className:Jo.iconImg}):l.jsx("div",{className:Jo.placeholder,children:l.jsx(Sd,{size:24})}),t&&r&&l.jsx("button",{type:"button",className:Jo.removeBtn,onClick:d,"aria-label":i.titleAppIcon.removeIconAriaLabel,children:l.jsx(js,{size:11})})]}),n&&l.jsx(Cp,{nodeId:e,currentValue:t,onSelect:c,onClose:()=>o(!1)})]})},xe={courseDetails:"_courseDetails_1eby7_1",courseDetailsLoading:"_courseDetailsLoading_1eby7_7",courseDetailsError:"_courseDetailsError_1eby7_7",detailsCard:"_detailsCard_1eby7_12",unitsCard:"_unitsCard_1eby7_12",cardTitle:"_cardTitle_1eby7_22",fieldGroup:"_fieldGroup_1eby7_29",fieldGroupLast:"_fieldGroupLast_1eby7_33",fieldLabel:"_fieldLabel_1eby7_37",fieldValue:"_fieldValue_1eby7_47",fieldValueMultiline:"_fieldValueMultiline_1eby7_52",unitsLabel:"_unitsLabel_1eby7_58",unitsDescription:"_unitsDescription_1eby7_68",unitList:"_unitList_1eby7_74",unitCard:"_unitCard_1eby7_80",unitHeader:"_unitHeader_1eby7_86",unitIcon:"_unitIcon_1eby7_99",unitTitle:"_unitTitle_1eby7_111",unitCount:"_unitCount_1eby7_120",unitBody:"_unitBody_1eby7_126",unitDescription:"_unitDescription_1eby7_131",unitKeywords:"_unitKeywords_1eby7_138",keywordPill:"_keywordPill_1eby7_145",unitTopicsRow:"_unitTopicsRow_1eby7_155",unitContents:"_unitContents_1eby7_167",contentRow:"_contentRow_1eby7_174",contentIcon:"_contentIcon_1eby7_180",contentTitle:"_contentTitle_1eby7_185",contentSkills:"_contentSkills_1eby7_193",skillPill:"_skillPill_1eby7_200"},Lk={video:Us,pdf:Ao,h5p:Fs,scorm:Bs,audio:$s,quiz:xs,course:Nr,default:xr};function Wl(e){return Array.isArray(e)?e.map(String):e?[String(e)]:[]}const $p=({courseId:e,variant:t="compact",title:r,onLoaded:n})=>{const o=ne(),s=hr(),[a,i]=p.useState(null),[c,d]=p.useState(""),[u,f]=p.useState(null),[m,g]=p.useState({}),b=t==="full";p.useEffect(()=>{let C=!1;return i(null),d(""),f(null),ku(e).then(S=>{if(C)return;const T=(S.children??[]).map(E=>ea(E));i(T),d(S.description??""),g(Object.fromEntries(T.map(E=>[E.id,!0]))),n==null||n({totalContents:T.reduce((E,L)=>{var A;return E+(((A=L.children)==null?void 0:A.length)??0)},0)})}).catch(()=>{C||f(o.learningPath.courseDetailsError)}),()=>{C=!0}},[e,o.learningPath.courseDetailsError]);const h=C=>g(S=>({...S,[C]:!S[C]})),v=C=>{var S;return s?Wl((S=C.metadata)==null?void 0:S[s.code]):[]},y=C=>(C===1?o.learningPath.contentCountLabel:o.learningPath.contentCountLabelPlural).replace("{count}",String(C));return l.jsx("div",{className:xe.courseDetails,children:u?l.jsx("p",{className:xe.courseDetailsError,children:u}):a===null?l.jsx("p",{className:xe.courseDetailsLoading,children:o.learningPath.courseDetailsLoading}):l.jsxs(l.Fragment,{children:[b&&l.jsxs("div",{className:xe.detailsCard,children:[l.jsx("h3",{className:xe.cardTitle,children:o.learningPath.courseDetailsCardTitle}),l.jsxs("div",{className:xe.fieldGroup,children:[l.jsx("span",{className:xe.fieldLabel,children:o.learningPath.courseTitleFieldLabel}),l.jsx("div",{className:xe.fieldValue,children:r})]}),l.jsxs("div",{className:xe.fieldGroupLast,children:[l.jsx("span",{className:xe.fieldLabel,children:o.learningPath.courseDescriptionFieldLabel}),l.jsx("div",{className:xe.fieldValueMultiline,children:c||o.learningPath.noCourseDescriptionPlaceholder})]})]}),a.length===0?l.jsx("p",{className:xe.courseDetailsLoading,children:o.learningPath.courseDetailsEmpty}):l.jsxs("div",{className:b?xe.unitsCard:void 0,children:[l.jsx("span",{className:xe.unitsLabel,children:o.learningPath.unitsSectionLabel}),b&&l.jsx("p",{className:xe.unitsDescription,children:o.learningPath.unitsSectionDescription}),l.jsx("div",{className:xe.unitList,children:a.map(C=>{var L,A;const S=!!m[C.id],w=(C.children??[]).length,T=Wl((L=C.metadata)==null?void 0:L.keywords),E=Wl((A=C.metadata)==null?void 0:A.topic);return l.jsxs("div",{className:xe.unitCard,children:[l.jsxs("button",{type:"button",className:xe.unitHeader,onClick:()=>h(C.id),"aria-expanded":S,children:[S?l.jsx(Zr,{size:17}):l.jsx(fi,{size:17}),l.jsx("span",{className:xe.unitIcon,children:l.jsx(bd,{size:16})}),l.jsx("span",{className:xe.unitTitle,children:C.name}),b&&l.jsx("span",{className:xe.unitCount,children:y(w)})]}),S&&l.jsxs("div",{className:xe.unitBody,children:[b&&C.description&&l.jsx("p",{className:xe.unitDescription,children:C.description}),b&&T.length>0&&l.jsx("div",{className:xe.unitKeywords,children:T.map(x=>l.jsx("span",{className:xe.keywordPill,children:x},x))}),b&&E.length>0&&l.jsxs("div",{className:xe.unitTopicsRow,children:[l.jsx("span",{className:xe.fieldLabel,children:o.learningPath.unitTopicsFieldLabel}),l.jsx("span",{children:E.join(", ")})]}),l.jsx("div",{className:xe.unitContents,children:(C.children??[]).map(x=>{const F=Vo(x),P=Lk[F.key]??xr,N=v(x);return l.jsxs("div",{className:xe.contentRow,children:[l.jsx(P,{size:16,className:xe.contentIcon}),l.jsx("span",{className:xe.contentTitle,children:x.name}),N.length>0&&l.jsx("div",{className:xe.contentSkills,children:N.map(M=>l.jsx("span",{className:xe.skillPill,children:M},M))})]},x.id)})})]})]},C.id)})})]})]})})},De={backToPathButton:"_backToPathButton_42cuj_1",assessmentTitle:"_assessmentTitle_42cuj_15",slotPills:"_slotPills_42cuj_22",slotPill:"_slotPill_42cuj_22",slotPillHint:"_slotPillHint_42cuj_40",slotPillPurpose:"_slotPillPurpose_42cuj_45",slotPillWarning:"_slotPillWarning_42cuj_51",slotPillPrimary:"_slotPillPrimary_42cuj_56",courseCard:"_courseCard_42cuj_62",courseCardHeading:"_courseCardHeading_42cuj_72",courseCardDescription:"_courseCardDescription_42cuj_79",courseNotAdded:"_courseNotAdded_42cuj_85",assessmentExplainer:"_assessmentExplainer_42cuj_93",assessmentExplainerHeading:"_assessmentExplainerHeading_42cuj_107",leafContentLayout:"_leafContentLayout_42cuj_117",container:"_container_42cuj_131",emptyState:"_emptyState_42cuj_140",titleRow:"_titleRow_42cuj_150",titleRowLp:"_titleRowLp_42cuj_157",nodeTitle:"_nodeTitle_42cuj_171",nodeTitleLpRoot:"_nodeTitleLpRoot_42cuj_193",nodeTitleSub:"_nodeTitleSub_42cuj_198",courseDetailHeader:"_courseDetailHeader_42cuj_203",courseDetailIcon:"_courseDetailIcon_42cuj_210",courseDetailTitle:"_courseDetailTitle_42cuj_222",courseDetailMeta:"_courseDetailMeta_42cuj_229",formArea:"_formArea_42cuj_234",contentListArea:"_contentListArea_42cuj_238",contentListAreaLp:"_contentListAreaLp_42cuj_242",dropZone:"_dropZone_42cuj_246",reviewComment:"_reviewComment_42cuj_253",reviewCommentLabel:"_reviewCommentLabel_42cuj_266",reviewCommentText:"_reviewCommentText_42cuj_272"},Ok=({slot:e,isEditable:t})=>{var g;const r=ne(),n=ae(b=>b.treeData),o=ae(b=>b.selectNode),s=(g=n[0])==null?void 0:g.id,{pre:a,post:i}=Tl(),c=(e==="pre"?a:i).filled,d=e==="pre"?r.learningPath.priorAssessmentLabel:r.learningPath.outcomeAssessmentLabel,u=e==="pre"?In:vy,f=e==="pre"?r.learningPath.priorAssessmentExplainerTitle:r.learningPath.outcomeAssessmentExplainerTitle,m=e==="pre"?r.learningPath.priorAssessmentExplainerBody:r.learningPath.outcomeAssessmentExplainerBody;return l.jsxs("div",{className:De.container,children:[l.jsxs("button",{type:"button",className:De.backToPathButton,onClick:()=>s&&o(s),children:[l.jsx(ui,{size:14})," ",r.learningPath.backToPathButton]}),l.jsx("div",{className:De.assessmentTitle,children:d}),l.jsx("div",{className:De.slotPills,children:e==="pre"?l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:`${De.slotPill} ${De.slotPillHint}`,children:[l.jsx(vd,{size:12})," ",r.learningPath.priorAssessmentHint]}),l.jsxs("span",{className:`${De.slotPill} ${De.slotPillPurpose}`,children:[l.jsx(gy,{size:12})," ",r.learningPath.priorAssessmentPurposeLabel]})]}):l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:`${De.slotPill} ${De.slotPillWarning}`,children:[l.jsx(wd,{size:12})," ",r.learningPath.outcomeUnlocksHint]}),l.jsxs("span",{className:`${De.slotPill} ${De.slotPillPrimary}`,children:[l.jsx(vd,{size:12})," ",r.learningPath.outcomeAssessmentHint]})]})}),l.jsxs("div",{className:De.formArea,children:[l.jsxs("div",{className:De.courseCard,children:[l.jsx("div",{className:De.courseCardHeading,children:r.learningPath.assessmentCourseSectionTitle}),l.jsx("p",{className:De.courseCardDescription,children:r.learningPath.assessmentCourseSectionDescription}),c?l.jsx(Vl,{slot:e,isEditable:t}):l.jsx("div",{className:De.courseNotAdded,children:r.learningPath.assessmentNotAddedYet})]}),l.jsxs("div",{className:De.assessmentExplainer,children:[l.jsxs("div",{className:De.assessmentExplainerHeading,children:[l.jsx(u,{size:16}),l.jsx("span",{children:f})]}),l.jsx("p",{children:m})]})]})]})},Pk="application/vnd.sunbird.questionset",Bp="application/vnd.sunbird.question",Nk=[Pk,Bp];function qp(e){var t,r;if(!(!e||e.status!=="Draft"||((t=e.metadata)==null?void 0:t.prevStatus)!=="Review"))return(r=e.metadata)==null?void 0:r.rejectComment}const xk=({editorMode:e,onToolbarEvent:t})=>{var fe,pe,ie,Te,ye;const r=ne(),[n,o]=p.useState("details"),[s,a]=p.useState([]),[i,c]=p.useState(null),[d,u]=p.useState(!1),[f,m]=p.useState(null),g=p.useRef(null),b=p.useRef(),{selectedNodeId:h,breadcrumb:v,activeNodeMeta:y,updateNode:C,treeData:S,selectNode:w}=ae(),T=fr($=>$.activeAssessmentSlot),E=K($=>{var q,Z,he,be;return((Z=(q=$.editorConfig)==null?void 0:q.context)==null?void 0:Z.contentId)??((be=(he=$.editorConfig)==null?void 0:he.context)==null?void 0:be.identifier)??""}),L=K($=>$.editorProfile.competencyScoped),A=h?jp(S,h):null;p.useEffect(()=>{m(null)},[A==null?void 0:A.identifier]);const x=!!A&&!A.parent,F=!!(A!=null&&A.isFolder),P=A&&Nk.includes(A.mimeType??""),N=(A==null?void 0:A.mimeType)===Bp,M=A&&!A.isFolder&&!P&&!x,U=L&&F&&lt(A??void 0)?((ie=(pe=(fe=S[0])==null?void 0:fe.children)==null?void 0:pe[0])==null?void 0:ie.id)===(A==null?void 0:A.id)?"pre":"post":L?T:null,ee=qp(A)??(x?qp(S[0]):void 0),Q=p.useCallback(()=>{const $=g.current;if(!$||!h)return;const q=$.innerText.trim();clearTimeout(b.current),b.current=setTimeout(()=>{C(h,{name:q})},600)},[h,C]),te=p.useCallback($=>{t({action:"onFormValueChange",data:$})},[t]),ue=p.useCallback(($,q)=>{a(q),t({action:"onFormStatusChange",data:{isValid:$,nodeId:h}})},[t,h]);if(!A)return l.jsx("div",{className:De.emptyState,children:l.jsx("p",{children:r.contextualEditor.emptyStateMessage})});if(P)return l.jsx(Ql,{node:A,editorMode:e,type:"quml",singleQuestion:N});if(L&&M&&A.primaryCategory==="Course"){const $=A.parent?vS(((Te=S[0])==null?void 0:Te.children)??[],A.parent):null,q=($==null?void 0:$.role)==="pre"?r.learningPath.priorAssessmentLabel:($==null?void 0:$.role)==="post"?r.learningPath.outcomeAssessmentLabel:($==null?void 0:$.role)==="level"?r.learningPath.levelNumberPrefix.replace("{n}",String($.levelNumber)):null,Z=f===null?"":` · ${(f===1?r.learningPath.contentCountLabel:r.learningPath.contentCountLabelPlural).replace("{count}",String(f))}`;return l.jsxs("div",{className:De.container,children:[l.jsxs("button",{type:"button",className:De.backToPathButton,onClick:()=>A.parent&&w(A.parent),children:[l.jsx(ui,{size:14}),q?r.learningPath.backToLevelButton.replace("{label}",q):r.learningPath.backToPathButton]}),l.jsxs("div",{className:De.courseDetailHeader,children:[l.jsx("span",{className:De.courseDetailIcon,children:l.jsx(Nr,{size:26})}),l.jsxs("div",{children:[l.jsx("h2",{className:De.courseDetailTitle,children:A.name}),l.jsxs("span",{className:De.courseDetailMeta,children:[A.primaryCategory,Z]})]})]}),l.jsx($p,{courseId:A.identifier,variant:"full",title:A.name,onLoaded:({totalContents:he})=>m(he)},A.identifier)]})}return U?l.jsx(Ok,{slot:U,isEditable:e==="edit"}):M?l.jsxs("div",{className:De.leafContentLayout,children:[l.jsx(Ql,{node:A,editorMode:e,type:"content",layout:"flow"}),l.jsx(Ik,{node:A,editorMode:e,onMoveClick:()=>c(A.identifier),reorderDialog:i?l.jsx(Ek,{resourceId:i,resourceName:A.name,currentUnitId:A.parent??"",onClose:()=>c(null)}):null})]}):l.jsxs("div",{className:De.container,children:[l.jsx(yE,{crumbs:v}),ee&&l.jsxs("div",{className:De.reviewComment,role:"alert",children:[l.jsx("span",{className:De.reviewCommentLabel,children:r.contextualEditor.reviewCommentLabel}),l.jsx("span",{className:De.reviewCommentText,children:ee})]}),l.jsxs("div",{className:[De.titleRow,L?De.titleRowLp:""].filter(Boolean).join(" "),children:[x&&h&&l.jsx(Dk,{nodeId:h,value:String(A.appIcon??((ye=A.metadata)==null?void 0:ye.appIcon)??""),editable:e==="edit"}),l.jsx("div",{ref:g,className:[De.nodeTitle,L&&x?De.nodeTitleLpRoot:"",L&&!x?De.nodeTitleSub:""].filter(Boolean).join(" "),contentEditable:e==="edit",suppressContentEditableWarning:!0,onInput:Q,onBlur:Q,"data-placeholder":r.contextualEditor.untitledPlaceholder,"aria-label":r.contextualEditor.nodeTitleAriaLabel,children:A.name})]}),l.jsx(bE,{activeTab:n,onChange:$=>o($),errorTabs:s,visibleTabs:x&&!L?void 0:["details"]}),l.jsx("div",{className:De.formArea,children:l.jsx(OA,{nodeMetadata:y,activeTab:n,isRoot:x,isFolder:F,editorMode:e,onFormValueChange:te,onFormStatusChange:ue},`${h??"none"}:${x?"root":"node"}`)}),(F||x)&&n==="details"&&l.jsx("div",{className:[De.contentListArea,L?De.contentListAreaLp:""].filter(Boolean).join(" "),children:l.jsx(XA,{editorMode:e,isRoot:x})}),l.jsx(JA,{isActive:!1,label:r.contextualEditor.dropZoneLabel,nodeId:h??void 0,className:De.dropZone}),d&&l.jsx(kk,{contentId:E,onClose:()=>u(!1)})]})};function jp(e,t){for(const r of e){if(r.id===t)return r;if(r.children){const n=jp(r.children,t);if(n)return n}}}const Up=ko((e,t)=>({allContent:[],filteredContent:[],searchQuery:"",activeFilter:"all",advancedFilters:{},isLoading:!1,totalCount:0,offset:0,sortAZ:!1,setContent:(r,n)=>{e({allContent:r,totalCount:n,offset:r.length}),t().applyFilter()},appendContent:(r,n)=>{const s=[...t().allContent,...r];e({allContent:s,totalCount:n,offset:s.length}),t().applyFilter()},setFilter:r=>{e({activeFilter:r}),t().applyFilter()},setSearch:r=>{e({searchQuery:r}),t().applyFilter()},setLoading:r=>e({isLoading:r}),setAdvancedFilters:r=>e({advancedFilters:r}),setOffset:r=>e({offset:r}),setSortAZ:r=>e({sortAZ:r}),applyFilter:()=>{const{allContent:r,activeFilter:n,searchQuery:o}=t();let s=r;if(n&&n!=="all"){const a=n.toLowerCase();s=s.filter(i=>[i.mimeType??"",i.primaryCategory??"",i.contentType??""].join(" ").toLowerCase().includes(a))}if(o&&o.trim()!==""){const a=o.toLowerCase().trim();s=s.filter(i=>(i.name??"").toLowerCase().includes(a))}e({filteredContent:s})}}));function Fk(e,t,r,n){const o={primaryCategory:["Course"]};return n&&(o.framework=[n]),!e&&t.length&&r&&(o[r]=t),o}function Mk(e,t){if(!(!e||!t))return[...Dp,t,"framework"]}function $k(e,t,r,n,o){return e?t?r&&!n&&o.length===0?"noSkills":null:"noCurriculum":null}const Bk=20,qk=[];function zp(){var d;const e=K(u=>u.editorConfig),t=ae(u=>u.selectedNodeId),r=ae(u=>u.treeData),n=p.useCallback(()=>{if(!t||!r.length)return 0;function u(f,m,g=0){var b;for(const h of f){if(h.id===m)return g;if((b=h.children)!=null&&b.length){const v=u(h.children,m,g+1);if(v>=0)return v}}return-1}return Math.max(0,u(r,t))},[t,r])(),o=(d=e==null?void 0:e.config)==null?void 0:d.hierarchy;if(!o)return[...$h];const s=`level${n}`,a=o[s],i=a==null?void 0:a.children,c=i==null?void 0:i.Content;return c!=null&&c.length?c:[...$h]}function jk(){const e=Up(),t=K(A=>{var x,F;return((F=(x=A.editorConfig)==null?void 0:x.context)==null?void 0:F.channel)??""}),r=zp(),n=K(A=>A.editorProfile),o=fr(A=>A.activeAssessmentSlot),s=ae(A=>A.activeNodeMeta),a=ae(A=>A.treeData),i=ae(A=>A.treeCache),c=ae(A=>A.selectedNodeId),d=ae(A=>A.getNodeById),u=hr(),f=n.competencyScoped?Nu(a[0],i):void 0,m=p.useRef(),g=u&&Array.isArray(s[u.code])?s[u.code]:qk,b=c?d(c):void 0,h=n.competencyScoped&&!!(b!=null&&b.isFolder)&&!!b.parent&&!lt(b),v=$k(n.competencyScoped,f,h,o,g),y=p.useCallback(async(A="",x="all",F={},P=!0,N=!1)=>{var M,B,U,ee,Q;e.setLoading(!0);try{if(v){e.setContent([],0);return}let te;if(n.competencyScoped){const ie=Fk(o,g,u==null?void 0:u.code,f);te={status:["Live"],...ie}}else te={status:["Live"],primaryCategory:x&&x!=="all"?[x]:r},(M=F==null?void 0:F.board)!=null&&M.length&&(te.board=F.board),(B=F==null?void 0:F.medium)!=null&&B.length&&(te.medium=F.medium),(U=F==null?void 0:F.gradeLevel)!=null&&U.length&&(te.gradeLevel=F.gradeLevel),(ee=F==null?void 0:F.subject)!=null&&ee.length&&(te.subject=F.subject),(Q=F==null?void 0:F.primaryCategory)!=null&&Q.length&&(te.primaryCategory=F.primaryCategory);const ue=P?0:e.offset,{content:fe,count:pe}=await ek({filters:te,query:A,limit:A?50:Bk,offset:ue,channel:t||void 0,sortBy:N?{name:"asc"}:{lastUpdatedOn:"desc"},fields:Mk(n.competencyScoped,u==null?void 0:u.code)});P?e.setContent(fe,pe):e.appendContent(fe,pe)}catch(te){console.error("[useLibrary] load error:",te)}finally{e.setLoading(!1)}},[r,t,n,o,g,u,f,v]);p.useEffect(()=>{clearTimeout(m.current),e.setSearch("")},[f]),p.useEffect(()=>{y()},[t]),p.useEffect(()=>{n.competencyScoped&&y()},[n.competencyScoped,o,g.join("|"),f,c]);const C=p.useCallback(A=>{e.setSearch(A),clearTimeout(m.current),m.current=setTimeout(()=>y(A,e.activeFilter,e.advancedFilters,!0,e.sortAZ),300)},[e.activeFilter,e.advancedFilters,e.sortAZ,y]),S=p.useCallback(A=>{e.setFilter(A),y(e.searchQuery,A,e.advancedFilters,!0,e.sortAZ)},[e.searchQuery,e.advancedFilters,e.sortAZ,y]),w=p.useCallback(A=>{e.setAdvancedFilters(A),y(e.searchQuery,e.activeFilter,A,!0,e.sortAZ)},[e.searchQuery,e.activeFilter,e.sortAZ,y]),T=p.useCallback(()=>{const A=!e.sortAZ;e.setSortAZ(A),y(e.searchQuery,e.activeFilter,e.advancedFilters,!0,A)},[e.sortAZ,e.searchQuery,e.activeFilter,e.advancedFilters,y]),E=p.useCallback(()=>{e.isLoading||y(e.searchQuery,e.activeFilter,e.advancedFilters,!1,e.sortAZ)},[e.isLoading,e.searchQuery,e.activeFilter,e.advancedFilters,e.sortAZ,y]),L=e.allContent.length<e.totalCount;return{content:e.filteredContent,isLoading:e.isLoading,totalCount:e.totalCount,activeFilter:e.activeFilter,advancedFilters:e.advancedFilters,searchQuery:e.searchQuery,sortAZ:e.sortAZ,hasMore:L,search:C,setFilter:S,applyAdvancedFilters:w,toggleSort:T,loadMore:E,refetch:()=>y(e.searchQuery,e.activeFilter,e.advancedFilters,!0,e.sortAZ),activeAssessmentSlot:o,emptyReason:v}}function Vp(){var i;const e=ne(),t=K(c=>c.editorProfile.competencyScoped),r=fr(c=>c.activeAssessmentSlot),n=ae(c=>c.selectedNodeId),o=ae(c=>c.treeData),s=ae(c=>c.getNodeById),a=(i=o[0])==null?void 0:i.id;if(!t)return null;if(r==="pre")return e.learningPath.libraryAddPriorAssessmentCourse;if(r==="post")return e.learningPath.libraryAddOutcomeAssessmentCourse;if(n&&n!==a){const c=s(n);if(c!=null&&c.isFolder)return e.learningPath.libraryAddToLevel.replace("{level}",c.name??"")}return e.learningPath.libraryOpenLevelToAdd}const Xt={card:"_card_1cmpg_1",addBtn:"_addBtn_1cmpg_17",dragging:"_dragging_1cmpg_24",ctIcon:"_ctIcon_1cmpg_29",info:"_info_1cmpg_33",name:"_name_1cmpg_41",meta:"_meta_1cmpg_50",skillTags:"_skillTags_1cmpg_58",skillTag:"_skillTag_1cmpg_58",addBtnMuted:"_addBtnMuted_1cmpg_93",added:"_added_1cmpg_102",addedBadge:"_addedBadge_1cmpg_111"},Uk={video:Us,pdf:Ao,h5p:Fs,scorm:Bs,audio:$s,quiz:xs,course:Nr,default:xr},zk=({item:e,onAdd:t,onPreview:r,isDraggable:n,isAdded:o})=>{var S,w;const s=ne(),a=Vo(e),i=Uk[a.key]??xr,c=_l(),d=aE(),u=c&&!o&&d,f=K(T=>T.editorProfile.competencyScoped),m=hr(),g=f&&m?(()=>{const T=e[m.code];return Array.isArray(T)?T:T?[String(T)]:[]})():[],{attributes:b,listeners:h,setNodeRef:v,isDragging:y}=ud({id:e.identifier,disabled:!n||!c||!d,data:{type:"library-item",item:e}}),C=()=>{r&&r(e)};return l.jsxs("div",{ref:v,className:[Xt.card,y?Xt.dragging:"",o?Xt.added:""].join(" "),"aria-label":e.name,...n?{...b,...h}:{},role:"listitem",onClick:C,children:[l.jsx("span",{className:[`sbx-ct-sq--${a.key}`,Xt.ctIcon].join(" "),"aria-hidden":"true",children:l.jsx(i,{size:14})}),l.jsxs("div",{className:Xt.info,children:[l.jsx("span",{className:Xt.name,title:e.name,children:e.name}),l.jsxs("span",{className:Xt.meta,children:[((S=e.organisation)==null?void 0:S[0])??e.channel??"",(w=e.organisation)!=null&&w[0]&&e.primaryCategory?" · ":"",e.primaryCategory??""]}),g.length>0&&l.jsx("span",{className:Xt.skillTags,children:g.slice(0,3).map(T=>l.jsx("span",{className:Xt.skillTag,children:T},T))})]}),o&&l.jsx("span",{className:Xt.addedBadge,"aria-label":s.libraryCard.alreadyAddedAriaLabel,title:s.libraryCard.alreadyAddedTitle,children:l.jsx(Yr,{size:12})}),!o&&n&&l.jsx("button",{type:"button",className:[Xt.addBtn,!u&&c?Xt.addBtnMuted:""].join(" "),onClick:T=>{T.stopPropagation(),t(e)},disabled:!c,"aria-disabled":!u,"aria-label":s.libraryCard.addItemAriaLabel.replace("{name}",e.name),title:c?d?s.libraryCard.addToUnitTitle:s.libraryCard.selectUnitToAddTitle:s.libraryCard.draftOnlyTitle,children:l.jsx(Xr,{size:14})})]})},Hp={chips:"_chips_xhhaq_1",chip:"_chip_xhhaq_1"},Vk=({filters:e,active:t,onChange:r})=>{const n=ne();return l.jsx("div",{className:Hp.chips,role:"group","aria-label":n.filterChips.contentTypeFiltersAriaLabel,children:e.map(o=>l.jsx("button",{type:"button",role:"radio","aria-checked":t===o.value,className:["sbx-chip",t===o.value?"filled":"outline",Hp.chip].join(" "),onClick:()=>r(o.value),children:o.label},o.value))})},ht={panel:"_panel_uame3_1",header:"_header_uame3_10",headerTitle:"_headerTitle_uame3_19",closeBtn:"_closeBtn_uame3_25",body:"_body_uame3_43",section:"_section_uame3_59",sectionLabel:"_sectionLabel_uame3_65",chips:"_chips_uame3_73",chip:"_chip_uame3_73",active:"_active_uame3_96",footer:"_footer_uame3_102",resetBtn:"_resetBtn_uame3_112",applyBtn:"_applyBtn_uame3_129"},Hk=e=>[{key:"board",label:e.libraryFilterPanel.boardLabel},{key:"medium",label:e.libraryFilterPanel.mediumLabel},{key:"gradeLevel",label:e.libraryFilterPanel.classLabel},{key:"subject",label:e.libraryFilterPanel.subjectLabel}],Qk=new Set(["board","medium","gradeLevel","subject","topic"]),Wk=({local:e,toggle:t})=>{const r=ne(),n=zp();return n.length?l.jsxs("div",{className:ht.section,children:[l.jsx("div",{className:ht.sectionLabel,children:r.libraryFilterPanel.primaryCategoryLabel}),l.jsx("div",{className:ht.chips,children:n.map(o=>l.jsx("button",{type:"button",className:[ht.chip,(e.primaryCategory??[]).includes(o)?ht.active:""].join(" "),onClick:()=>t("primaryCategory",o),children:o},o))})]}):null},Rk=({isOpen:e,filters:t,onApply:r,onClose:n})=>{var v,y;const o=ne(),s=K(C=>C.editorConfig),a=K(C=>C.searchFormConfig),i=K(C=>C.contentFramework),c=K(C=>C.contentTargetFWIds),{organisationFramework:d}=ra(i??((v=s==null?void 0:s.context)==null?void 0:v.framework),c??((y=s==null?void 0:s.context)==null?void 0:y.targetFWIds)),[u,f]=p.useState(t),m=a!=null&&a.length?a.filter(C=>Qk.has(C.code)).map(C=>({key:C.code,label:C.label||C.code})):Hk(o);p.useEffect(()=>{f(t)},[t]);const g=(C,S)=>{f(w=>{const T=w[C]??[],E=T.includes(S)?T.filter(L=>L!==S):[...T,S];return{...w,[C]:E}})},b=(d==null?void 0:d.categories)??[],h=C=>{var S;return((S=b.find(w=>w.code===C))==null?void 0:S.terms)??[]};return e?l.jsxs("div",{className:ht.panel,role:"dialog","aria-label":o.libraryFilterPanel.filterLibraryAriaLabel,"aria-modal":"true",children:[l.jsxs("div",{className:ht.header,children:[l.jsx("span",{className:ht.headerTitle,children:o.libraryFilterPanel.filtersHeaderTitle}),l.jsx("button",{type:"button",className:ht.closeBtn,onClick:n,"aria-label":o.libraryFilterPanel.closeFiltersAriaLabel,children:l.jsx(ur,{size:16})})]}),l.jsxs("div",{className:ht.body,children:[m.map(({key:C,label:S})=>{const w=h(C);return w.length?l.jsxs("div",{className:ht.section,children:[l.jsx("div",{className:ht.sectionLabel,children:S}),l.jsx("div",{className:ht.chips,children:w.slice(0,20).map(T=>l.jsx("button",{type:"button",className:[ht.chip,(u[C]??[]).includes(T.name)?ht.active:""].join(" "),onClick:()=>g(C,T.name),children:T.name},T.identifier))})]},C):null}),l.jsx(Wk,{local:u,toggle:g})]}),l.jsxs("div",{className:ht.footer,children:[l.jsx("button",{type:"button",className:ht.resetBtn,onClick:()=>f({}),children:o.libraryFilterPanel.resetButton}),l.jsx("button",{type:"button",className:ht.applyBtn,onClick:()=>{r(u),n()},children:o.libraryFilterPanel.applyButton})]})]}):null},Ct={header:"_header_1tvk1_10",headerCourse:"_headerCourse_1tvk1_20",courseIcon:"_courseIcon_1tvk1_25",titleGroup:"_titleGroup_1tvk1_37",courseMeta:"_courseMeta_1tvk1_45",title:"_title_1tvk1_37",headerActions:"_headerActions_1tvk1_67",iconBtn:"_iconBtn_1tvk1_74",playerArea:"_playerArea_1tvk1_92",footer:"_footer_1tvk1_100",footerCourse:"_footerCourse_1tvk1_109",addBtn:"_addBtn_1tvk1_115",addBtnCourse:"_addBtnCourse_1tvk1_134",modalOverlay:"_modalOverlay_1tvk1_159",modalOverlayCourse:"_modalOverlayCourse_1tvk1_174",modalPanel:"_modalPanel_1tvk1_178",modalPanelCourse:"_modalPanelCourse_1tvk1_190"},Gk="application/vnd.sunbird.questionset",Kk=({content:e,editorMode:t,onAdd:r,onClose:n})=>{var f;const o=ne(),s=t==="edit",a=K(m=>m.editorProfile.competencyScoped),i=Vp();if(!e)return null;const c=a&&e.primaryCategory==="Course",d=[((f=e.organisation)==null?void 0:f[0])??e.channel??"",e.primaryCategory??""].filter(Boolean).join(" • "),u={id:e.identifier,identifier:e.identifier,name:e.name??"",mimeType:e.mimeType,primaryCategory:e.primaryCategory,contentType:e.contentType,appIcon:e.appIcon,status:e.status,isFolder:!1,children:[],metadata:e};return Ue.createPortal(l.jsx("div",{className:[Ct.modalOverlay,c?Ct.modalOverlayCourse:""].filter(Boolean).join(" "),role:"dialog","aria-modal":"true","aria-label":o.libraryPreviewPanel.contentPreviewAriaLabel,onClick:n,children:l.jsxs("div",{className:[Ct.modalPanel,c?Ct.modalPanelCourse:""].filter(Boolean).join(" "),onClick:m=>m.stopPropagation(),children:[l.jsxs("div",{className:[Ct.header,c?Ct.headerCourse:""].filter(Boolean).join(" "),children:[c&&l.jsx("span",{className:Ct.courseIcon,children:l.jsx(Nr,{size:20})}),l.jsxs("div",{className:Ct.titleGroup,children:[l.jsx("span",{className:Ct.title,title:e.name,children:e.name}),c&&d&&l.jsx("span",{className:Ct.courseMeta,children:d})]}),l.jsx("div",{className:Ct.headerActions,children:l.jsx("button",{type:"button",className:Ct.iconBtn,onClick:n,"aria-label":o.libraryPreviewPanel.closePreviewAriaLabel,children:l.jsx(ur,{size:16})})})]}),l.jsx("div",{className:Ct.playerArea,children:c?l.jsx($p,{courseId:e.identifier}):l.jsx(Ql,{node:u,editorMode:"read",type:e.mimeType===Gk?"quml":"content"})}),s&&l.jsx("div",{className:[Ct.footer,c?Ct.footerCourse:""].filter(Boolean).join(" "),children:c?l.jsxs("button",{type:"button",className:Ct.addBtnCourse,onClick:()=>r(e),children:[l.jsx(Xr,{size:15})," ",i??o.libraryPreviewPanel.addToUnitButton]}):l.jsx("button",{type:"button",className:Ct.addBtn,onClick:()=>r(e),children:o.libraryPreviewPanel.addToUnitButton})})]})}),document.body)},Re={dock:"_dock_2k0x7_1",header:"_header_2k0x7_8",libraryTargetLabel:"_libraryTargetLabel_2k0x7_18",headerLeft:"_headerLeft_2k0x7_28",headerTitle:"_headerTitle_2k0x7_36",count:"_count_2k0x7_42",searchRow:"_searchRow_2k0x7_51",searchWrap:"_searchWrap_2k0x7_59",searchIcon:"_searchIcon_2k0x7_65",searchInput:"_searchInput_2k0x7_74",filterToggleBtn:"_filterToggleBtn_2k0x7_92",filterToggleBtnActive:"_filterToggleBtnActive_2k0x7_111",filterBadge:"_filterBadge_2k0x7_117",filters:"_filters_2k0x7_136",mainArea:"_mainArea_2k0x7_146",sidePanelOverlay:"_sidePanelOverlay_2k0x7_155",cardList:"_cardList_2k0x7_164",skeleton:"_skeleton_2k0x7_180",skeletonIcon:"_skeletonIcon_2k0x7_190",skeletonText:"_skeletonText_2k0x7_198",skeletonLine:"_skeletonLine_2k0x7_205",skeletonLineSm:"_skeletonLineSm_2k0x7_212",loadMoreBtn:"_loadMoreBtn_2k0x7_227",emptyState:"_emptyState_2k0x7_252",collapseBtn:"_collapseBtn_2k0x7_272"},Yk=[{label:"Courses",value:"all"}];function Zk(e){const t=new Set,r=[...e];for(;r.length>0;){const n=r.shift();n.isFolder||t.add(n.identifier),n.children&&r.push(...n.children)}return t}const Xk=({editorMode:e,collapsed:t=!1,onToggleCollapse:r})=>{const n=ne(),{content:o,isLoading:s,totalCount:a,activeFilter:i,searchQuery:c,sortAZ:d,hasMore:u,search:f,setFilter:m,applyAdvancedFilters:g,toggleSort:b,loadMore:h,activeAssessmentSlot:v,emptyReason:y}=jk(),{addResource:C,selectedNodeId:S,treeData:w,treeCache:T}=ae(),E=fr($=>$.setActiveAssessmentSlot),L=K($=>$.editorProfile.competencyScoped),A=e==="edit",x=Vp(),[F,P]=p.useState(!1),[N,M]=p.useState({}),[B,U]=p.useState(null),[ee,Q]=p.useState(null),te=p.useMemo(()=>Zk(w),[w]),ue=p.useCallback(async($,q)=>{var he,be;const Z=(he=w[0])==null?void 0:he.id;if(!(!Z||ee)){if(xo(((be=w[0])==null?void 0:be.children)??[],q)){Se.error(q==="pre"?n.learningPath.priorSlotFilledToast:n.learningPath.outcomeSlotFilledToast);return}Q($.identifier);try{const{qualifies:ge,meta:le}=await Lu($.identifier);if(!ge){Se.error(n.learningPath.notAssessmentCourseToast.replace("{name}",$.name));return}const ve={...$,...le};if(C(ve,Z,{isAssessmentCourse:!0,slot:q})===!1){Se.error(n.learningPath.bothSlotsFilledToast);return}Se.success(n.libraryDock.itemAddedToast.replace("{name}",$.name)),E(null)}catch(ge){console.error("[LibraryDock] assessment-course check failed:",ge),Se.error(n.learningPath.assessmentCheckFailedToast)}finally{Q(null)}}},[w,C,E,ee,n]),fe=p.useCallback($=>{var be,ge,le;if(L&&!xu(w[0],T)){Se.error(n.learningPath.selectCurriculumFirstToast);return}if(v){ue($,v);return}if(!S){Se.error(L?n.learningPath.selectLevelFirstToast:n.libraryDock.selectUnitFirstToast);return}const q=(be=w[0])==null?void 0:be.id,Z=ae.getState().getNodeById(S);if(L){const ve=((ge=w[0])==null?void 0:ge.children)??[],Ae=Z!=null&&Z.isFolder?Z:Z!=null&&Z.parent?ae.getState().getNodeById(Z.parent):void 0;if(Ae&&Ui(ve,Ae)){const Y=(le=ve[0])==null?void 0:le.id;Se.error(Ae.id===Y?n.learningPath.priorSlotFilledToast:n.learningPath.outcomeSlotFilledToast);return}}if(S===q||!(Z!=null&&Z.isFolder)){Se(L?n.learningPath.selectLevelFromOutlineToast:n.libraryDock.selectUnitFromOutlineToast,{icon:l.jsx(In,{size:16}),duration:4e3});return}if(C($,S)===!1){Se.error((L?n.learningPath.itemAlreadyInPathToast:n.libraryDock.itemAlreadyAddedToast).replace("{name}",$.name));return}Se.success(n.libraryDock.itemAddedToast.replace("{name}",$.name))},[v,ue,S,C,w,T,n,L]),pe=p.useCallback($=>{M($),g($)},[g]),ie=p.useCallback($=>{U($)},[]),Te=p.useCallback($=>{fe($),U(null)},[fe]),ye=p.useMemo(()=>Object.values(N).reduce(($,q)=>$+((q==null?void 0:q.length)??0),0),[N]);return l.jsxs("div",{className:Re.dock,children:[l.jsxs("div",{className:Re.header,children:[l.jsxs("div",{className:Re.headerLeft,children:[l.jsx("button",{type:"button",className:Re.collapseBtn,onClick:r,"aria-label":n.libraryDock.collapseLibraryPanelAriaLabel,title:n.libraryDock.collapseLibraryTitle,children:l.jsx(Oy,{size:15})}),l.jsx(ky,{size:16}),l.jsx("span",{className:Re.headerTitle,children:n.libraryDock.headerTitle}),a>0&&l.jsx("span",{className:Re.count,children:a})]}),x&&l.jsx("span",{className:Re.libraryTargetLabel,children:x})]}),l.jsxs("div",{className:Re.searchRow,children:[l.jsxs("div",{className:Re.searchWrap,children:[l.jsx(qs,{size:14,className:Re.searchIcon}),l.jsx("input",{type:"search",className:Re.searchInput,placeholder:n.libraryDock.searchPlaceholder,value:c,onChange:$=>f($.target.value),"aria-label":n.libraryDock.searchAriaLabel})]}),l.jsx("button",{type:"button",className:[Re.filterToggleBtn,d?Re.filterToggleBtnActive:""].join(" "),onClick:b,"aria-label":d?n.libraryDock.sortAZAriaLabel:n.libraryDock.sortRecentAriaLabel,title:d?n.libraryDock.sortAZTitle:n.libraryDock.sortRecentTitle,children:d?l.jsx(my,{size:15}):l.jsx(Sy,{size:15})}),!L&&l.jsxs("button",{type:"button",className:[Re.filterToggleBtn,F?Re.filterToggleBtnActive:""].join(" "),onClick:()=>P($=>!$),"aria-label":n.libraryDock.toggleAdvancedFiltersAriaLabel,"aria-pressed":F,title:n.libraryDock.advancedFiltersTitle,children:[l.jsx(qy,{size:15}),ye>0&&l.jsx("span",{className:Re.filterBadge,children:ye})]})]}),l.jsx("div",{className:Re.filters,children:l.jsx(Vk,{filters:L?Yk:iE,active:i,onChange:m})}),l.jsxs("div",{className:Re.mainArea,children:[l.jsx("div",{className:Re.cardList,role:"list","aria-label":n.libraryDock.libraryContentAriaLabel,children:s&&o.length===0?Array.from({length:4}).map(($,q)=>l.jsxs("div",{className:Re.skeleton,"aria-hidden":"true",children:[l.jsx("div",{className:Re.skeletonIcon}),l.jsxs("div",{className:Re.skeletonText,children:[l.jsx("div",{className:Re.skeletonLine}),l.jsx("div",{className:Re.skeletonLineSm})]})]},q)):o.length>0?l.jsxs(l.Fragment,{children:[o.map($=>l.jsx(zk,{item:$,onAdd:fe,onPreview:ie,isDraggable:A,isAdded:te.has($.identifier)},$.identifier)),u&&l.jsx("button",{type:"button",className:Re.loadMoreBtn,onClick:h,disabled:s,"aria-label":n.libraryDock.loadMoreAriaLabel,children:s?n.libraryDock.loadingText:n.libraryDock.loadMoreText})]}):l.jsxs("div",{className:Re.emptyState,children:[l.jsx(qs,{size:24}),y==="noCurriculum"?l.jsxs(l.Fragment,{children:[l.jsx("p",{children:n.learningPath.noCurriculumEmptyTitle}),l.jsx("span",{children:n.learningPath.noCurriculumEmptyHint})]}):y==="noSkills"?l.jsxs(l.Fragment,{children:[l.jsx("p",{children:n.learningPath.noSkillsEmptyTitle}),l.jsx("span",{children:n.learningPath.noSkillsEmptyHint})]}):l.jsxs(l.Fragment,{children:[l.jsx("p",{children:n.libraryDock.noContentFound}),l.jsx("span",{children:n.libraryDock.tryDifferentSearch})]})]})}),F&&l.jsx("div",{className:Re.sidePanelOverlay,children:l.jsx(Rk,{isOpen:F,filters:N,onApply:pe,onClose:()=>P(!1)})}),B&&l.jsx(Kk,{content:B,editorMode:e,onAdd:Te,onClose:()=>U(null)})]})]})};function Jk(e,t,r,n=Ci){const o={},s={},a=new Set(["id","isFolder","children","parent","isNew","breadcrumb","title","relationalMetadata","optional","metadata","isAssessmentCourse"]),i=new Set(["targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds","targetFWIds","targetTopicIds","topic","topicsIds"]),c=new Set(["audience","attributions","keywords","language","additionalCategories","medium","gradeLevel","subject","boardIds","mediumIds","gradeLevelIds","subjectIds","targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds","dialcodes"]),d=new Set(["copyrightYear","compatibilityLevel","version"]);function u(g,b=!1){const h={};for(const[v,y]of Object.entries(g))if(!a.has(v)&&!(b&&i.has(v)))if(c.has(v))Array.isArray(y)?h[v]=y:y!=null&&y!==""?h[v]=[y]:h[v]=[];else if(d.has(v)){const C=Number(y);isNaN(C)||(h[v]=C)}else h[v]=y;return h}function f(g){var h;const b={};for(const v of g.children??[]){if(v.isFolder)continue;const y=t[v.identifier];if(!y)continue;const{isNew:C,...S}=y;if(Object.keys(S).length===0)continue;const w=((h=v.metadata)==null?void 0:h.relationalMetadata)??{};b[v.identifier]={name:v.name,...w,...S}}return b}function m(g,b){var w,T;const h=g.identifier,v=t[h],y=h.startsWith("temp-")||!!(v!=null&&v.isNew),C=!g.isFolder&&!b;if(b||y||v&&!C){let E;if(y)E={mimeType:"application/vnd.ekstep.content-collection",code:h,contentType:((w=g.metadata)==null?void 0:w.contentType)??n.unitContentType,primaryCategory:((T=g.metadata)==null?void 0:T.primaryCategory)??n.unitPrimaryCategory,name:g.name,visibility:"Parent",channel:r,...u(g.metadata??{})};else if(b){const{isNew:L,...A}=v??{};E={...u(g.metadata??{},!0),...u(A,!1),name:g.name}}else{const{isNew:L,...A}=v??{};E={name:g.name,visibility:"Parent",...u(A,!0)}}o[h]={metadata:E,objectType:g.objectType||(g.isFolder?"Collection":"Content"),root:b,isNew:y}}const S=g.isFolder?f(g):{};s[h]={name:g.name,children:(g.children??[]).map(E=>E.identifier),...Object.keys(S).length>0?{relationalMetadata:S}:{},root:b},(g.children??[]).forEach(E=>m(E,!1))}return e.forEach((g,b)=>m(g,b===0)),{nodesModified:o,hierarchy:s}}function eI(){const[e,t]=p.useState(!1),r=ae(u=>u.treeCache),n=ae(u=>u.treeData),o=K(u=>u.isDirty),s=K(u=>u.lastSaved),{setIsDirty:a,setLastSaved:i}=K(),c=K(u=>u.editorConfig);return{save:p.useCallback(async()=>{if(!c||e)return;const u=c.context.contentId??c.context.identifier??"";if(!u)return;if(n.length===0){Se.error("Collection is empty. Please reload before saving.");return}const f=c.context.channel??"",m=c.context.userId??c.context.uid??"";t(!0);try{const g=K.getState().editorProfile,{nodesModified:b,hierarchy:h}=Jk(n,r,f,g),{identifiers:v}=await lS(u,b,h,m);v&&Object.keys(v).length>0&&ae.getState().replaceNodeIds(v);const y=new Date().toISOString();i(y),a(!1)}catch(g){console.error("[useSaveHierarchy] save failed:",g),Se.error("Failed to save. Please try again.")}finally{t(!1)}},[c,e,n,r,a,i]),isSaving:e,isDirty:o,lastSaved:s}}const tI={};function rI(e){return e==null||e===""||Array.isArray(e)&&e.length===0}function nI(e,t,r,n,o,s=tI){const a=[],i=(c,d)=>{var u;for(const f of c){const m=d&&!f.parent,g=m?r:f.isFolder?n:null;if(g&&g.length>0){const b={...f.metadata??{},...t[f.id]??{}},v=hp(g,b,s,m,o).filter(y=>y.required&&y.visible!==!1&&y.inputType!=="appIcon"&&rI(y.currentValue)).map(y=>y.label);v.length>0&&a.push({nodeId:f.id,nodeName:f.name||"Untitled",missing:v})}(u=f.children)!=null&&u.length&&i(f.children,!1)}};return i(e,!0),a}function oI(e){var S,w;const t=K(T=>T.editorConfig),r=K(T=>T.editorProfile),n=K(T=>T.setButtonLoader),o=K(T=>T.validateAllForms),s=K(T=>T.rootFormConfig),a=K(T=>T.unitFormConfig),i=ae(T=>T.treeData),c=ae(T=>T.treeCache),d=ae(T=>T.selectNode),u=hr(),{scope:f}=Mo(),m=K(T=>T.contentFramework),g=K(T=>T.contentTargetFWIds),{organisationFramework:b,targetFrameworks:h}=ra(m??((S=t==null?void 0:t.context)==null?void 0:S.framework),g??((w=t==null?void 0:t.context)==null?void 0:w.targetFWIds)),v=p.useCallback(()=>{var x,F,P;const T={editorMode:"edit",objectType:(x=t==null?void 0:t.config)==null?void 0:x.objectType,userFullName:(P=(F=t==null?void 0:t.context)==null?void 0:F.user)==null?void 0:P.fullName},E=nI(i,c,s,a,T,{organisationFramework:b,targetFrameworks:h});if(E.length===0)return!0;const L=E[0];Se.error(`"${L.nodeName}": please fill required field${L.missing.length>1?"s":""} — ${L.missing.join(", ")}`);const{setFormStatus:A}=K.getState();return E.forEach(N=>A(N.nodeId,!1)),d(L.nodeId),!1},[i,c,s,a,t,d,b,h]),y=p.useCallback(()=>{if(r.key!=="learningPath")return!0;const T=zi(i[0],u==null?void 0:u.code,f,c);return T.length===0?!0:(Se.error(T[0].message),!1)},[r.key,i,c,u,f]);return{runAction:p.useCallback(async(T,E)=>{var x,F,P,N;const L=((x=t==null?void 0:t.context)==null?void 0:x.contentId)??((F=t==null?void 0:t.context)==null?void 0:F.identifier)??"";if(!L)return Se.error("No content identifier found."),!1;const A=((P=t==null?void 0:t.context)==null?void 0:P.userId)??((N=t==null?void 0:t.context)==null?void 0:N.uid)??"";try{switch(T){case"sendForReview":return v()?o(i)?y()?(n("saveCollection",!0),await e(),await uS(L),Se.success("Content sent for review"),!0):!1:(Se.error("Some units have missing required fields. Please fill them before sending for review."),!1):!1;case"reject":{n("rejectCollection",!0);const M=(E==null?void 0:E.comment)??"";return await fS(L,M),Se.success("Content rejected and sent back to the author"),!0}case"publish":return v()?o(i)?y()?(n("publishCollection",!0),await e(),await cS(L,A),Se.success("Content published successfully"),!0):!1:(Se.error("Some units have missing required fields. Please fill them before publishing."),!1):!1;default:return!1}}catch(M){console.error(`[useToolbarActions] ${T} failed`,M);const B=T==="sendForReview"?"send for review":T==="reject"?"reject":"publish";return Se.error(`Failed to ${B}. Please try again.`),!1}finally{n("saveCollection",!1),n("rejectCollection",!1),n("publishCollection",!1)}},[t,e,n,v,y,o,i]),checkRequiredFields:v}}function sI(){const e=ne(),t=K(c=>c.editorProfile.key==="learningPath"),r=ae(c=>c.treeData),n=hr(),{scope:o,source:s}=Mo(),a=p.useRef(!1),i=p.useRef("");p.useEffect(()=>{if(!t||s!=="prior"||!n)return;const c=SS(r[0],n.code,o),d=c.map(u=>u.id).sort().join(",");a.current?c.length>0&&d!==i.current&&Se.error(e.learningPath.priorAssessmentNarrowedScopeToast.replace("{count}",String(c.length))):a.current=!0,i.current=d},[t,s,o.join("|"),n==null?void 0:n.code,r])}const Bt={shell:"_shell_fu72l_1",workspace:"_workspace_fu72l_8",sidebarCollapsed:"_sidebarCollapsed_fu72l_16",dockCollapsed:"_dockCollapsed_fu72l_19",dock:"_dock_fu72l_19",outline:"_outline_fu72l_40",reopenTab:"_reopenTab_fu72l_45",outlineHidden:"_outlineHidden_fu72l_79",editor:"_editor_fu72l_86",editorLp:"_editorLp_fu72l_92",dockHidden:"_dockHidden_fu72l_105",dockReopenTab:"_dockReopenTab_fu72l_112",dragChip:"_dragChip_fu72l_137",dragChipLabel:"_dragChipLabel_fu72l_152"},aI=({editorMode:e,onToolbarEvent:t,onContentAdded:r,onHierarchySaved:n})=>{const o=ne(),[s,a]=p.useState(null),[i,c]=p.useState(!1),[d,u]=p.useState(!1),[f,m]=p.useState(!1);sI();const{addResource:g,treeData:b,treeCache:h}=ae(),v=K(Q=>Q.setFormStatus),y=K(Q=>Q.editorProfile.key==="learningPath"),[C,S]=p.useState(!0),w=ae(Q=>Q.selectedNodeId),{save:T,isSaving:E,isDirty:L,lastSaved:A}=eI(),{runAction:x,checkRequiredFields:F}=oI(T);p.useEffect(()=>{if(!L)return;const Q=te=>{te.preventDefault(),te.returnValue=""};return window.addEventListener("beforeunload",Q),()=>window.removeEventListener("beforeunload",Q)},[L]);const P=Nc(ei(Ds,{activationConstraint:{distance:8}})),N=p.useCallback(Q=>{var ue;const te=(ue=Q.active.data.current)==null?void 0:ue.item;te&&a(te)},[]),M=p.useCallback(Q=>{var $,q,Z,he,be;a(null);const te=($=Q.active.data.current)==null?void 0:$.item;if(!te)return;if(y&&!xu(b[0],h)){Se.error(o.learningPath.selectCurriculumFirstToast);return}const ue=Q.over,fe=(ue==null?void 0:ue.id)??w??void 0,pe=y?o.learningPath.dropOntoLevelError:o.splitBuilderShell.dropOntoUnitError;if(!fe){Se.error(pe);return}const ie=(q=b[0])==null?void 0:q.id;if(fe===ie){Se.error(y?o.learningPath.dropOntoPathError:o.splitBuilderShell.dropOntoCourseError);return}const Te=ae.getState().getNodeById(fe);if(!(Te!=null&&Te.isFolder)){Se.error(pe);return}if(y&&lt(Te)){const ge=(be=(he=(Z=b[0])==null?void 0:Z.children)==null?void 0:he[0])==null?void 0:be.id;Se.error(Te.id===ge?o.learningPath.priorSlotFilledToast:o.learningPath.outcomeSlotFilledToast);return}if(!g(te,fe)){Se.error((y?o.learningPath.itemAlreadyInPathToast:o.splitBuilderShell.alreadyInCollectionError).replace("{name}",te.name));return}r==null||r(te,fe),Se.success((y?o.learningPath.addedToLevelSuccess:o.splitBuilderShell.addedToUnitSuccess).replace("{name}",te.name))},[w,g,b,h,r,o,y]),B=p.useCallback(async Q=>{if(Q.action==="onFormStatusChange"){const{isValid:te,nodeId:ue}=Q.data??{},fe=te!==!1;S(fe),ue&&v(ue,fe);return}if(Q.action==="back"&&L&&e==="edit"){m(!0);return}if(Q.action==="saveCollection"){if(!C){Se.error(o.splitBuilderShell.fillRequiredMetadataError);return}if(!F())return;await T(),n==null||n(b),t==null||t(Q);return}if(Q.action==="sendForReview"||Q.action==="reject"||Q.action==="publish"){await x(Q.action,Q.data)&&(t==null||t(Q));return}t==null||t(Q)},[T,x,F,t,n,b,L,C,e,o]),U=p.useCallback(async()=>{if(!F()){m(!1);return}await T(),m(!1),n==null||n(b),t==null||t({action:"back"})},[T,F,n,t,b]),ee=p.useCallback(()=>{m(!1),t==null||t({action:"back"})},[t]);return l.jsxs(cd,{sensors:P,onDragStart:N,onDragEnd:M,children:[l.jsxs("div",{className:Bt.shell,children:[l.jsx(WS,{editorMode:e,isSaving:E,isDirty:L,lastSaved:A,isFormValid:C,onToolbarEvent:B}),l.jsxs("div",{className:[Bt.workspace,i?Bt.sidebarCollapsed:"",d?Bt.dockCollapsed:""].filter(Boolean).join(" "),children:[l.jsx("aside",{className:[Bt.outline,i?Bt.outlineHidden:""].join(" "),"aria-label":o.splitBuilderShell.outlineAriaLabel,"aria-hidden":i,children:l.jsx(vE,{editorMode:e,collapsed:i,onToggleCollapse:()=>c(Q=>!Q)})}),i&&l.jsx("button",{className:Bt.reopenTab,onClick:()=>c(!1),title:o.splitBuilderShell.showOutlineTitle,type:"button",children:"›"}),l.jsx("main",{className:[Bt.editor,y?Bt.editorLp:""].filter(Boolean).join(" "),role:"main","aria-label":o.splitBuilderShell.editorAriaLabel,children:l.jsx(xk,{editorMode:e,onToolbarEvent:B})}),l.jsx("aside",{className:[Bt.dock,d?Bt.dockHidden:""].filter(Boolean).join(" "),"aria-label":o.splitBuilderShell.libraryAriaLabel,"aria-hidden":d,children:l.jsx(Xk,{editorMode:e,collapsed:d,onToggleCollapse:()=>u(Q=>!Q)})}),d&&l.jsx("button",{className:Bt.dockReopenTab,onClick:()=>u(!1),title:o.splitBuilderShell.showLibraryTitle,type:"button",children:"‹"})]})]}),l.jsx(uy,{dropAnimation:null,children:s?l.jsx("div",{className:Bt.dragChip,children:l.jsx("span",{className:Bt.dragChipLabel,children:s.name})}):null}),f&&l.jsx(RS,{onSave:U,onDiscard:ee,onCancel:()=>m(!1),isSaving:E})]})},iI="v1";function lI(e){const t=e.validations,r=t==null?void 0:t.find(o=>o.type==="maxlength"||o.type==="maxLength");if(!r)return e.maxLength;const n=Number(r.value);return Number.isFinite(n)?n:void 0}function Qp(e,t){var r;return{code:e.code??"",label:e.label??e.name??e.code??"",name:e.name,inputType:e.inputType,dataType:e.dataType,required:e.required===!0||Array.isArray(e.validations)&&e.validations.some(n=>n.type==="required")||String(((r=e.renderingHints)==null?void 0:r.class)??"").includes("required"),editable:e.editable!==!1,visible:e.visible!==!1,placeholder:e.placeholder,maxLength:lI(e),depends:e.depends,sourceCategory:e.sourceCategory,range:e.range,enum:e.enum,default:e.default,defaultValue:e.defaultValue,index:e.index,section:t,output:e.output}}function Br(e){const t=e==null?void 0:e.properties;if(!Array.isArray(t))return[];const r=[];for(const n of t)if(Array.isArray(n.fields)){const o=n.name??void 0,s=n.fields.filter(a=>!!a.code).sort((a,i)=>(a.index??0)-(i.index??0));for(const a of s)r.push(Qp(a,o))}else n.code&&r.push(Qp(n));return r}function cI(e){const t=e==null?void 0:e.properties;if(!t)return{};const r={};for(const[n,o]of Object.entries(t))o&&"default"in o&&(r[n]=o.default);return r}async function dI(e,t,r="Collection",n=iI){var d,u;const s=(u=(d=(await Me.post(`/action/object/category/definition/${n}/read?fields=objectMetadata,forms,name,label`,{request:{objectCategoryDefinition:{objectType:r,name:e,...t?{channel:t}:{}}}})).data)==null?void 0:d.result)==null?void 0:u.objectCategoryDefinition,a=(s==null?void 0:s.forms)??{},i=(s==null?void 0:s.objectMetadata)??{},c=i.config??{};return{rootForm:Br(a.create),unitForm:Br(a.unitMetadata),childForm:Br(a.childMetadata),searchForm:Br(a.search??a.searchConfig),relationalForm:Br(a.relationalMetadata),publishChecklist:Br(a.publishchecklist),reviewChecklist:Br(a.review),rfcChecklist:Br(a.requestforchangeschecklist),schemaDefaults:cI(i.schema),frameworkMetadata:c.frameworkMetadata??{},sourcingSettings:c.sourcingSettings??{}}}function Wp(e,t,r){return{framework:e.framework??t??r.framework??null,targetFWIds:e.targetFWIds??r.targetFWIds??null}}function uI({config:e,onError:t}){const[r,n]=p.useState(!0),[o,s]=p.useState(null),[a,i]=p.useState(!1),{setEditorConfig:c,setEditorMode:d,setCategoryDefinition:u,setContentFramework:f,setEditorProfile:m}=K(),{setTreeData:g,selectNode:b}=ae();return p.useEffect(()=>{let h=!1;async function v(){var y,C,S;try{n(!0),s(null),e.apiBaseUrl&&_u(e.apiBaseUrl),c(e),d(e.config.mode),m(sb(e));const w=e.context.contentId??e.context.identifier??"",T=e.context.channel??"";let E;if(T)try{E=(y=await up(T))==null?void 0:y.defaultFramework}catch{}let L=!1;if(w){const A=e.config.objectType==="QuestionSet";let{rootNode:x}=A?await iS(w):await Au(w);if(x&&e.config.primaryCategory==="Learning Path"&&(x=await gS(x)),!h&&(g(x?[x]:[]),x)){b(x.id);const{framework:B,targetFWIds:U}=Wp(x.metadata??{},E,e.context);f(B,U),L=!0}const F=e.config.primaryCategory??"Course",P=e.context.channel??"",N=e.config.categoryDefinitionApiVersion??"v1";try{const M=await dI(F,P,e.config.objectType??"Collection",N);if(!h){u(M);const B=((C=M.sourcingSettings)==null?void 0:C.collection)??{},U={};B.maxDepth&&!e.config.maxDepth&&(U.maxDepth=B.maxDepth),B.children&&!e.config.children&&(U.children=B.children),B.hierarchy&&!((S=e.config.hierarchy)!=null&&S.level1)&&(U.hierarchy={...e.config.hierarchy??{},...B.hierarchy}),Object.keys(U).length>0&&c({...e,config:{...e.config,...U}})}}catch{}}if(!h&&!L){const{framework:A,targetFWIds:x}=Wp({},E,e.context);f(A,x)}h||i(!0)}catch(w){if(!h){const T=w instanceof Error?w:new Error(String(w));s(T),t==null||t(T)}}finally{h||n(!1)}}return v(),()=>{h=!0}},[e.context.contentId,e.context.identifier]),{isLoading:r,error:o,isReady:a}}function fI(){const e=Ti(t=>t.setLanguage);p.useEffect(()=>{e(localStorage.getItem(wi)||"en",{broadcast:!1});const t=n=>{n.key===wi&&n.newValue&&e(n.newValue,{broadcast:!1})},r=n=>{var s;const o=(s=n.detail)==null?void 0:s.lang;o&&e(o,{broadcast:!1})};return window.addEventListener("storage",t),window.addEventListener(_i,r),()=>{window.removeEventListener("storage",t),window.removeEventListener(_i,r)}},[e])}const es={root:"_root_1itrv_1",loadingState:"_loadingState_1itrv_10",loadingSpinner:"_loadingSpinner_1itrv_20",errorState:"_errorState_1itrv_34"},hI=new $g({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});function pI({error:e,onRetry:t}){const r=ne();return l.jsxs("div",{className:es.errorState,children:[l.jsx("h3",{children:r.collectionEditor.errorBoundaryTitle}),l.jsx("p",{children:e.message}),l.jsx("button",{onClick:t,children:r.collectionEditor.retryButton})]})}class gI extends p.Component{constructor(t){super(t),this.state={error:null}}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t){var r,n;(n=(r=this.props).onError)==null||n.call(r,t)}render(){return this.state.error?l.jsx(pI,{error:this.state.error,onRetry:()=>this.setState({error:null})}):this.props.children}}function mI(e){fI();const t=ne(),{isLoading:r,error:n}=uI({config:e,onError:e.onError}),o=K(a=>a.editorMode),s=K(a=>a.editorProfile);return r?l.jsxs("div",{className:es.loadingState,children:[l.jsx("div",{className:es.loadingSpinner}),l.jsx("p",{children:t.collectionEditor.loadingMessage})]}):n?l.jsxs("div",{className:es.errorState,children:[l.jsx("h3",{children:t.collectionEditor.loadErrorTitle}),l.jsx("p",{children:n.message})]}):l.jsx("div",{className:["sb-split-builder",es.root,s.key==="learningPath"?"sbx-lp-profile":""].filter(Boolean).join(" "),children:l.jsx(aI,{editorMode:o,onToolbarEvent:e.onToolbarEvent,onContentAdded:e.onContentAdded,onHierarchySaved:e.onHierarchySaved})})}const Rp=e=>l.jsx(gI,{onError:e.onError,children:l.jsxs(qg,{client:hI,children:[l.jsx(mI,{...e}),l.jsx(Bm,{position:"top-right",toastOptions:{duration:3e3,style:{fontFamily:"var(--sbx-font)"}}})]})}),Na=Symbol.for("r2wc.reactRender"),Gp=Symbol.for("r2wc.shouldRender"),xa=Symbol.for("r2wc.root");function vI(e=""){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function yI(e=""){return e.replace(/-([a-z0-9])/g,function(t){return t[1].toUpperCase()})}var Kp={expando:function(e,t,r){Object.defineProperty(e,t,{enumerable:!0,get:function(){return r},set:function(n){r=n,this[Na]()}}),e[Na]()}};function bI(e,t,r,n={}){var o={isConnected:"isConnected"in HTMLElement.prototype},s=!1,a=function(){var d=Reflect.construct(HTMLElement,arguments,this.constructor);return typeof n.shadow=="string"?d.attachShadow({mode:n.shadow}):n.shadow&&(console.warn('Specifying the "shadow" option as a boolean is deprecated and will be removed in a future version.'),d.attachShadow({mode:"open"})),d},i=Object.create(HTMLElement.prototype);i.constructor=a;var c=new Proxy(i,{has:function(d,u){return u in e.propTypes||u in i},set:function(d,u,f,m){return s&&(o[u]=!0),typeof u=="symbol"||o[u]||u in d?(e.propTypes&&u in e.propTypes&&Kp.expando(m,u,f),Reflect.set(d,u,f,m)):(Kp.expando(m,u,f),!0)},getOwnPropertyDescriptor:function(d,u){var f=Reflect.getOwnPropertyDescriptor(d,u);if(f)return f;if(u in e.propTypes)return{configurable:!0,enumerable:!0,writable:!0,value:void 0}}});return a.prototype=c,i.connectedCallback=function(){this[Gp]=!0,this[Na]()},i.disconnectedCallback=function(){typeof r.createRoot=="function"?this[xa].unmount():r.unmountComponentAtNode(this)},i[Na]=function(){if(this[Gp]===!0){var d={};Object.keys(this).forEach(function(m){o[m]!==!1&&(d[m]=this[m])},this),s=!0;const u=n.shadow?this.shadowRoot:this,f=t.createElement(e,d);typeof r.createRoot=="function"?(this[xa]||(this[xa]=r.createRoot(u)),this[xa].render(f)):r.render(f,u),s=!1}},e.propTypes&&(a.observedAttributes=n.dashStyleAttributes?Object.keys(e.propTypes).map(function(d){return vI(d)}):Object.keys(e.propTypes),i.attributeChangedCallback=function(d,u,f){var m=n.dashStyleAttributes?yI(d):d;this[m]=f}),a}var Gn={},Yp;function CI(){if(Yp)return Gn;Yp=1;var e=Ue;if(process.env.NODE_ENV==="production")Gn.createRoot=e.createRoot,Gn.hydrateRoot=e.hydrateRoot;else{var t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Gn.createRoot=function(r,n){t.usingClientEntryPoint=!0;try{return e.createRoot(r,n)}finally{t.usingClientEntryPoint=!1}},Gn.hydrateRoot=function(r,n,o){t.usingClientEntryPoint=!0;try{return e.hydrateRoot(r,n,o)}finally{t.usingClientEntryPoint=!1}}}return Gn}var SI=CI();const wI=pi(SI);function _I(){if(document.getElementById("sb-ce-react-styles"))return;const e=document.createElement("style");e.id="sb-ce-react-styles",e.textContent="@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;600;700&display=swap');",document.head.insertBefore(e,document.head.firstChild)}function TI(e="sb-collection-editor"){if(_I(),typeof customElements>"u"||customElements.get(e))return;const t=bI(Rp,p,wI,{});customElements.define(e,t)}ke.CollectionEditor=Rp,ke.registerCollectionEditor=TI,ke.setApiBaseUrl=_u,ke.useEditorStore=K,ke.useLibraryStore=Up,ke.useTreeStore=ae,Object.defineProperty(ke,Symbol.toStringTag,{value:"Module"})}));
536
+ `+s)}}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=tn(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:s}=r;n!==void 0&&Js.assertOptions(n,{silentJSONParsing:_t.transitional(_t.boolean),forcedJSONParsing:_t.transitional(_t.boolean),clarifyTimeoutError:_t.transitional(_t.boolean),legacyInterceptorReqResOrdering:_t.transitional(_t.boolean),advertiseZstdAcceptEncoding:_t.transitional(_t.boolean),validateStatusUndefinedResolves:_t.transitional(_t.boolean)},!1),o!=null&&(O.isFunction(o)?r.paramsSerializer={serialize:o}:Js.assertOptions(o,{encode:_t.function,serialize:_t.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Js.assertOptions(r,{baseUrl:_t.spelling("baseURL"),withXsrfToken:_t.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let a=s&&O.merge(s.common,s[r.method]);s&&O.forEach(["delete","get","head","post","put","patch","query","common"],b=>{delete s[b]}),r.headers=wt.concat(a,s);const i=[];let c=!0;this.interceptors.request.forEach(function(h){if(typeof h.runWhen=="function"&&h.runWhen(r)===!1)return;c=c&&h.synchronous;const v=r.transitional||Pi;v&&v.legacyInterceptorReqResOrdering?i.unshift(h.fulfilled,h.rejected):i.push(h.fulfilled,h.rejected)});const d=[];this.interceptors.response.forEach(function(h){d.push(h.fulfilled,h.rejected)});let u,f=0,m;if(!c){const b=[Cu.bind(this),void 0];for(b.unshift(...i),b.push(...d),m=b.length,u=Promise.resolve(r);f<m;)u=u.then(b[f++],b[f++]);return u}m=i.length;let g=r;for(;f<m;){const b=i[f++],h=i[f++];try{g=b(g)}catch(v){h.call(this,v);break}}try{u=Cu.call(this,g)}catch(b){return Promise.reject(b)}for(f=0,m=d.length;f<m;)u=u.then(d[f++],d[f++]);return u}getUri(t){t=tn(this.defaults,t);const r=du(t.baseURL,t.url,t.allowAbsoluteUrls,t);return eu(r,t.params,t.paramsSerializer)}};O.forEach(["delete","get","head","options"],function(t){rn.prototype[t]=function(r,n){return this.request(tn(n||{},{method:t,url:r,data:n&&O.hasOwnProp(n,"data")?n.data:void 0}))}}),O.forEach(["post","put","patch","query"],function(t){function r(n){return function(s,a,i){return this.request(tn(i||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}rn.prototype[t]=r(),t!=="query"&&(rn.prototype[t+"Form"]=r(!0))});let nS=class fg{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(s){r=s});const n=this;this.promise.then(o=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](o);n._listeners=null}),this.promise.then=o=>{let s;const a=new Promise(i=>{n.subscribe(i),s=i}).then(o);return a.cancel=function(){n.unsubscribe(s)},a},t(function(s,a,i){n.reason||(n.reason=new No(s,a,i),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new fg(function(o){t=o}),cancel:t}}};function oS(e){return function(r){return e.apply(null,r)}}function sS(e){return O.isObject(e)&&e.isAxiosError===!0}const qi={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(qi).forEach(([e,t])=>{qi[t]=e});function wu(e){const t=new rn(e),r=$d(rn.prototype.request,t);return O.extend(r,rn.prototype,t,{allOwnKeys:!0}),O.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return wu(tn(e,o))},r}const rt=wu(Po);rt.Axios=rn,rt.CanceledError=No,rt.CancelToken=nS,rt.isCancel=su,rt.VERSION=Mi,rt.toFormData=Gs,rt.AxiosError=J,rt.Cancel=rt.CanceledError,rt.all=function(t){return Promise.all(t)},rt.spread=oS,rt.isAxiosError=sS,rt.mergeConfig=tn,rt.AxiosHeaders=wt,rt.formToJSON=e=>ou(O.isHTMLForm(e)?new FormData(e):e),rt.getAdapter=bu.getAdapter,rt.HttpStatusCode=qi,rt.default=rt;const{Axios:SP,AxiosError:wP,CanceledError:_P,isCancel:TP,CancelToken:EP,VERSION:AP,all:kP,Cancel:IP,isAxiosError:DP,spread:LP,toFormData:OP,AxiosHeaders:PP,HttpStatusCode:NP,formToJSON:xP,getAdapter:FP,mergeConfig:MP,create:$P}=rt;let ji="";function _u(e){ji=e}const Me=rt.create({timeout:3e4});function aS(e,t){if(!e||typeof t!="string"||!t.trim())return e;const r=t.trim().replace(/\/+$/,""),n=r.startsWith("/")?r:`/${r}`;return e.replace(/^\/(action|api|portal)(?=\/|$)/,n)}Me.interceptors.request.use(async e=>{var o,s,a;const{useEditorStore:t}=await Promise.resolve().then(()=>ib),r=t.getState(),n=(o=r.editorConfig)==null?void 0:o.context;return e.headers=e.headers??{},n!=null&&n.authToken&&(e.headers.Authorization=`Bearer ${n.authToken}`),n!=null&&n.userToken&&(e.headers["X-Authenticated-User-Token"]=n.userToken),n!=null&&n.channel&&(e.headers["X-Channel-Id"]=n.channel),e.url=aS(e.url,(a=(s=r.editorConfig)==null?void 0:s.config)==null?void 0:a.apiSlug),ji&&(e.baseURL=ji),e});const Tu="/portal";async function Eu(e){var n,o,s,a,i,c,d;const t=await Me.get(`${Tu}/questionset/v2/hierarchy/${e}`,{params:{mode:"edit"}}),r=(o=(n=t.data)==null?void 0:n.result)==null?void 0:o.questionset;if(!r||!r.identifier){const u=((a=(s=t.data)==null?void 0:s.params)==null?void 0:a.errmsg)||((c=(i=t.data)==null?void 0:i.params)==null?void 0:c.err)||((d=t.data)==null?void 0:d.responseCode)||`No questionset returned for "${e}"`;throw new Error(`Unable to load questionset hierarchy: ${u}`)}return r}async function iS(e){var r,n;return e.length?((n=(r=(await Me.post(`${Tu}/question/v2/list`,{request:{search:{identifier:e}}})).data)==null?void 0:r.result)==null?void 0:n.questions)??[]:[]}function ea(e,t){const r=e??{},n=r.identifier??"",o=r.objectType??"",s=r.mimeType??"",a=r.children,i=Array.isArray(a)?a.map(d=>ea(d,n)):[],c=s==="application/vnd.ekstep.content-collection"||o.toLowerCase().includes("unit")||o.toLowerCase().includes("textbook")||o.toLowerCase().includes("collection")||o.toLowerCase().includes("course")||o.toLowerCase().includes("lesson")||r.visibility==="Parent"||s==="application/vnd.sunbird.questionset"&&i.length>0;return{id:n,identifier:n,name:r.name??"Untitled",title:r.name??"Untitled",description:r.description,primaryCategory:r.primaryCategory,mimeType:r.mimeType,objectType:o,contentType:r.contentType,visibility:r.visibility,status:r.status,appIcon:r.appIcon,isFolder:c,children:i,metadata:r,parent:t}}async function Au(e){var o,s,a,i,c,d,u;const t=await Me.get(`/action/collection/v1/hierarchy/${e}`,{params:{mode:"edit"}}),r=(s=(o=t.data)==null?void 0:o.result)==null?void 0:s.content;if(!r||!r.identifier){const f=((i=(a=t.data)==null?void 0:a.params)==null?void 0:i.errmsg)||((d=(c=t.data)==null?void 0:c.params)==null?void 0:d.err)||((u=t.data)==null?void 0:u.responseCode)||`No content returned for "${e}"`;throw new Error(`Unable to load hierarchy: ${f}`)}const n=ea(r);return{content:r,rootNode:n}}async function lS(e){const t=await Eu(e),r=ea(t);return{content:t,rootNode:r}}async function cS(e,t,r,n){var s;return((s=(await Me.patch("/action/collection/v1/hierarchy/update",{request:{data:{nodesModified:t,hierarchy:r,...n?{lastUpdatedBy:n}:{}}}})).data)==null?void 0:s.result)??{}}async function dS(e,t=""){await Me.post(`/action/content/v3/publish/${e}`,{request:{content:{lastPublishedBy:t}}})}async function ku(e){var n,o,s,a,i,c,d;const t=await Me.get(`/action/course/v1/hierarchy/${e}`,{params:{mode:"edit"}}),r=(o=(n=t.data)==null?void 0:n.result)==null?void 0:o.content;if(!r||!r.identifier){const u=((a=(s=t.data)==null?void 0:s.params)==null?void 0:a.errmsg)||((c=(i=t.data)==null?void 0:i.params)==null?void 0:c.err)||((d=t.data)==null?void 0:d.responseCode)||`No course returned for "${e}"`;throw new Error(`Unable to load course hierarchy: ${u}`)}return r}async function uS(e){var r,n;return(n=(r=(await Me.get(`/action/content/v3/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.content}async function fS(e){await Me.post(`/action/content/v3/review/${e}`,{request:{content:{}}})}async function hS(e,t){await Me.post(`/action/content/v3/reject/${e}`,{request:{content:{rejectComment:t}}})}async function pS(e,t){await Me.patch(`/action/content/v1/collaborator/update/${e}`,{request:{content:{collaborators:t}}})}const gS="application/vnd.sunbird.questionset";function Iu(e){let t=!1,r=!0;function n(o){for(const s of o){const a=s.children??[];if(a.length>0){n(a);continue}t=!0,s.objectType==="QuestionSet"&&s.mimeType===gS||(r=!1)}}return n(e.children??[]),t&&r}const Du=new Map;async function Lu(e){const t=Du.get(e);if(t)return t;const r=await ku(e),{children:n,...o}=r??{},s={qualifies:Iu(r),meta:o};return Du.set(e,s),s}async function Ou(e){return(await Lu(e)).qualifies}async function mS(e){var n;const t=e.children??[],r=[];for(let o=0;o<t.length;o++){const s=t[o],a=s.children??[],i=[];for(const c of a){let d=!!((n=c.metadata)!=null&&n.isAssessmentCourse);if(!d){if((c.children??[]).length>0)d=Iu(c);else if(a.length===1&&(o===0||o===t.length-1))try{d=await Ou(c.identifier)}catch(u){console.error("[lpStructure] assessment-course check failed on load:",u)}}i.push({...c,isFolder:!1,children:[],metadata:{...c.metadata??{},...d?{isAssessmentCourse:!0}:{}}})}r.push({...s,children:i})}return{...e,children:r}}function lt(e){var r,n;const t=(e==null?void 0:e.children)??[];return t.length===1&&!!((n=(r=t[0])==null?void 0:r.metadata)!=null&&n.isAssessmentCourse)}function vS(e,t,r){return r?e===0?"pre":e===t-1?"post":"levelAssessment":"content"}function yS(e,t){const r=e.findIndex(o=>o.id===t);return r===-1?null:Fo(e,r)?{role:r===0?"pre":"post",levelNumber:null}:{role:"level",levelNumber:e.slice(0,r+1).filter((o,s)=>!Fo(e,s)).length}}function xo(e,t){return t==="pre"?e.length>0&&lt(e[0]):e.length>1&&lt(e[e.length-1])}function Fo(e,t){const r=vS(t,e.length,lt(e[t]));return r==="pre"||r==="post"}function Ui(e,t){const r=t?e.findIndex(n=>n.id===t.id):-1;return r!==-1&&Fo(e,r)}function bS(e){return xo(e,"pre")?xo(e,"post")?null:"post":"pre"}function CS(e,t,r){if(t<0||t>=e.length)return!1;const n=lt(e[0])?e[0]:null,o=e.length>1&&lt(e[e.length-1])?e[e.length-1]:null;if(!n&&!o)return!0;const s=[...e],[a]=s.splice(t,1);return s.splice(r,0,a),!(n&&s[0]!==n||o&&s[s.length-1]!==o)}function Pu(e,t,r){return r?!1:t?!((e==null?void 0:e.children)??[]).some(o=>{var s;return!!((s=o.metadata)!=null&&s.isAssessmentCourse)}):!0}function nn(e){return Array.isArray(e)?e.map(String):e?[String(e)]:[]}function Nu(e,t){var n,o;return e?((n=t[e.id])==null?void 0:n.framework)??((o=e.metadata)==null?void 0:o.framework):void 0}function xu(e,t){return!!Nu(e,t)}function Fu(e,t){if(!e||!t)return[];const r=new Set,n=e.children??[];return n.forEach((o,s)=>{var a,i;Fo(n,s)?nn((a=o.children[0].metadata)==null?void 0:a[t]).forEach(c=>r.add(c)):nn((i=o.metadata)==null?void 0:i[t]).forEach(c=>r.add(c))}),Array.from(r)}function SS(e,t,r){var d,u;if(!e||!t)return null;const n=Fu(e,t),o=((d=r[e.id])==null?void 0:d[t])??((u=e.metadata)==null?void 0:u[t]),s=nn(o),a=[...n].sort(),i=[...s].sort();return a.length===i.length&&a.every((f,m)=>f===i[m])?null:n}function wS(e,t,r){if(!e||!t||r.length===0)return[];const n=e.children??[];return n.filter((o,s)=>{var i;return Fo(n,s)?!1:nn((i=o.metadata)==null?void 0:i[t]).some(c=>!r.includes(c))})}function Mu(e,t,r){var o;if(!e||!r||t.length===0)return[];const n=new Set;for(const s of e.children??[])nn((o=s.metadata)==null?void 0:o[r]).forEach(a=>n.add(a));return t.filter(s=>!n.has(s))}const $u=new Set(["adaptive"]);function zi(e,t,r,n={}){var b,h,v,y;const o=[];if(!e)return o;const s=((b=n[e.id])==null?void 0:b.policy)??((h=e.metadata)==null?void 0:h.policy);s||o.push({code:"policyMissing",message:"Set a consumption policy for this path."});const a=e.children??[],i=a[0],c=a.length>1?a[a.length-1]:void 0,d=lt(i),u=lt(c);!d&&s&&$u.has(s)&&o.push({code:"priorAssessmentRequired",message:"A Prior Assessment is required for the Adaptive policy."}),[[i,"Prior Assessment"],[c,"Outcome Assessment"]].forEach(([C,S])=>{var T,E;if(!C)return;const w=C.children??[];(w.length!==1||!((E=(T=w[0])==null?void 0:T.metadata)!=null&&E.isAssessmentCourse))&&o.push({code:"slotNotPure",nodeId:C.id,message:`${S} must contain exactly one question-set-only course.`})});const f=new Set,m=(C,S)=>{f.has(C)&&o.push({code:"duplicateCourse",nodeId:S,message:"A course appears more than once in this path."}),f.add(C)},g=a.slice(d?1:0,a.length-(u?1:0));d&&m(i.children[0].id,i.id),u&&m(c.children[0].id,c.id);for(const C of g){const S=C.children??[],w=S.length===0;w&&o.push({code:"emptyLevel",nodeId:C.id,message:`"${C.name}" has no courses yet.`});const T=t?nn((v=C.metadata)==null?void 0:v[t]):[];if(T.length===0)w||o.push({code:"levelMissingSkills",nodeId:C.id,message:`"${C.name}" needs at least one skill selected.`});else{if(r.length>0){const L=T.filter(A=>!r.includes(A));L.length>0&&o.push({code:"levelSkillsOutOfScope",nodeId:C.id,message:`"${C.name}" has skills outside the current scope: ${L.join(", ")}.`})}const E=Mu(C,T,t);E.length>0&&o.push({code:"levelSkillsUncovered",nodeId:C.id,message:`"${C.name}" has no course covering: ${E.join(", ")}.`})}for(const E of S)m(E.id,C.id),(t?nn((y=E.metadata)==null?void 0:y[t]):[]).length===0&&o.push({code:"courseMissingSkillTag",nodeId:E.id,message:`"${E.name}" has no skill tag.`})}return o}async function _S(e){const t=[],r=(e==null?void 0:e.children)??[],n=r[0],o=r.length>1?r[r.length-1]:void 0;for(const[s,a]of[[n,"Prior Assessment"],[o,"Outcome Assessment"]]){if(!s||!lt(s))continue;const i=s.children[0].id;await Ou(i)||t.push({code:"slotCourseChanged",nodeId:s.id,message:`${a}'s course is no longer question-set-only — pick a different course.`})}return t}function Mt(e,t){const r=[...e];for(;r.length>0;){const n=r.shift();if(n.id===t)return n;n.children&&r.push(...n.children)}}function Bu(e,t,r=0){var n;for(const o of e){if(o.id===t)return r;if((n=o.children)!=null&&n.length){const s=Bu(o.children,t,r+1);if(s>=0)return s}}return-1}const qu=new Set(["name","appIcon","description","keywords","trackable","qrCodeProcessId","reservedDialcodes"]);function ju(e,t,r,n){return e.map(o=>{if(o.id===t){const s=r.metadata??{},a=n!=null&&n.length?new Set([...qu,...n]):qu,i={};for(const c of a)c in r&&(i[c]=r[c]);return{...o,...r,metadata:{...o.metadata??{},...i,...s}}}return o.children&&o.children.length>0?{...o,children:ju(o.children,t,r,n)}:o})}function ta(e,t,r){return e.map(n=>n.id===t?{...n,children:[...n.children??[],r]}:n.children&&n.children.length>0?{...n,children:ta(n.children,t,r)}:n)}function Uu(e,t,r,n){return e.map(o=>{if(o.id===t){const s=[...o.children??[]];return s.splice(n,0,r),{...o,children:s}}return o.children&&o.children.length>0?{...o,children:Uu(o.children,t,r,n)}:o})}function Vi(e,t){return e.filter(r=>r.id!==t).map(r=>({...r,children:r.children?Vi(r.children,t):[]}))}function Hi(e,t,r,n){return e.map(o=>{if(o.id===t){const s=[...o.children??[]],[a]=s.splice(r,1);return s.splice(n,0,a),{...o,children:s}}return o.children&&o.children.length>0?{...o,children:Hi(o.children,t,r,n)}:o})}function zu(e,t){return e.map(r=>{const n=t[r.id]??r.id,o=r.parent?t[r.parent]??r.parent:r.parent;return{...r,id:n,identifier:n,parent:o,children:r.children?zu(r.children,t):[]}})}function TS(e){let t=0;const r=[...e];for(;r.length>0;){const n=r.shift();n.isFolder||t++,n.children&&r.push(...n.children)}return t}function ES(e,t){const r=Mt(e,t);if(!r)return[];const n=[];let o=r;for(;o;)n.unshift({id:o.id,name:o.name}),o=o.parent?Mt(e,o.parent):void 0;return n}const re=ko((e,t)=>({treeData:[],selectedNodeId:null,treeCache:{},breadcrumb:[],activeNodeMeta:{},setTreeData:r=>{var o;const n=((o=r[0])==null?void 0:o.id)??null;e({treeData:r,selectedNodeId:n}),n&&setTimeout(()=>t().selectNode(n),0)},selectNode:r=>{const{treeData:n,treeCache:o,getBreadcrumb:s}=t(),a=Mt(n,r),i=s(r),c={...(a==null?void 0:a.metadata)??{},...o[r]??{}};K.getState().setNodeFlags({isFolder:(a==null?void 0:a.isFolder)??!1,isRoot:!(a!=null&&a.parent),isQuml:!1}),hr.getState().setActiveAssessmentSlot(null),e({selectedNodeId:r,breadcrumb:i,activeNodeMeta:c})},updateNode:(r,n,o)=>{if(e(s=>({treeData:ju(s.treeData,r,n,o),treeCache:{...s.treeCache,[r]:{...s.treeCache[r]??{},...n}}})),t().selectedNodeId===r){const s=Mt(t().treeData,r);e(a=>({activeNodeMeta:{...(s==null?void 0:s.metadata)??{},...a.treeCache[r]??{}}}))}t().markDirty()},addNode:(r,n)=>{var m,g,b;const o=t(),s=K.getState().editorProfile,a=((g=(m=K.getState().editorConfig)==null?void 0:m.config)==null?void 0:g.maxDepth)??s.maxDepth,i=Bu(o.treeData,r);if(i>=a)return console.warn(`[tree.store] addNode: depth would exceed maxDepth (${a}). parentDepth=${i}`),"";const c="temp-"+Math.random().toString(36).slice(2),d={id:c,identifier:c,name:s.defaultUnitName,isFolder:!0,children:[],parent:r,metadata:{mimeType:"application/vnd.ekstep.content-collection",code:c,name:s.defaultUnitName,contentType:s.unitContentType,primaryCategory:s.unitPrimaryCategory,visibility:"Parent"}},u=((b=Mt(o.treeData,r))==null?void 0:b.children)??[],f=s.derivedRoles&&xo(u,"post");return e(h=>({treeData:f?Uu(h.treeData,r,d,u.length-1):ta(h.treeData,r,d),treeCache:{...h.treeCache,[c]:{...d.metadata,isNew:!0}}})),setTimeout(()=>t().selectNode(c),0),c},deleteNode:r=>{var o;const n=(o=t().treeData[0])==null?void 0:o.id;r!==n&&e(s=>({treeData:Vi(s.treeData,r),selectedNodeId:s.selectedNodeId===r?null:s.selectedNodeId}))},reorderChildren:(r,n,o)=>{var i;const s=K.getState().editorProfile,a=(i=t().treeData[0])==null?void 0:i.id;if(s.derivedRoles&&r===a){const c=Mt(t().treeData,r);if(c!=null&&c.children&&!CS(c.children,n,o))return}e(c=>({treeData:Hi(c.treeData,r,n,o)}))},moveNode:(r,n,o)=>{var d,u,f;const s=K.getState().editorProfile,a=Mt(t().treeData,r),i=Mt(t().treeData,o);if(!(i!=null&&i.isFolder))return;const c=(d=t().treeData[0])==null?void 0:d.id;if(!(s.derivedRoles&&(a!=null&&a.isFolder)&&o!==c)){if(s.derivedRoles&&a&&!a.isFolder){const m=!!((u=a.metadata)!=null&&u.isAssessmentCourse),g=((f=t().treeData[0])==null?void 0:f.children)??[];if(!Pu(i,m,Ui(g,i)))return}e(m=>{const g=Mt(m.treeData,r);if(!g)return m;let b=Vi(m.treeData,r);return b=ta(b,o,{...g,parent:o}),{treeData:b}}),t().markDirty()}},addResource:(r,n,o)=>{var b,h,v,y,C,S;const s=K.getState().editorConfig,a=K.getState().editorProfile,i=(b=t().treeData[0])==null?void 0:b.id,c=!!(o!=null&&o.isAssessmentCourse);if(a.derivedRoles&&n===i){if(!c||Mt(t().treeData,r.identifier))return!1;const w=t().treeData[0],T=(w==null?void 0:w.children)??[],E=(o==null?void 0:o.slot)??bS(T);if(!E||xo(T,E))return!1;const L=t().addNode(i,"unit");if(!L)return!1;const{learningPath:A}=Ti.getState().labelConfig;if(t().updateNode(L,{name:E==="pre"?A.priorAssessmentLabel:A.outcomeAssessmentLabel}),E==="pre"){const x=(((v=(h=t().treeData[0])==null?void 0:h.children)==null?void 0:v.length)??1)-1;e(F=>({treeData:Hi(F.treeData,i,x,0)}))}return t().addResource(r,L,o)}if(!(((y=s==null?void 0:s.config)==null?void 0:y.allowContentUnderRoot)??!1)&&n===i||Mt(t().treeData,r.identifier))return!1;const u=Mt(t().treeData,n);if(!(u!=null&&u.isFolder))return!1;if(a.derivedRoles){const w=((C=t().treeData[0])==null?void 0:C.children)??[];if(!Pu(u,c,Ui(w,u)))return!1}const f=((S=s==null?void 0:s.config)==null?void 0:S.maxContentsLimit)??1200;if(TS(t().treeData)>=f)return!1;const g={id:r.identifier,identifier:r.identifier,name:r.name,isFolder:!1,children:[],parent:n,mimeType:r.mimeType,primaryCategory:r.primaryCategory,contentType:r.contentType,appIcon:r.appIcon,status:r.status,metadata:{...r,...c?{isAssessmentCourse:!0}:{}}};return e(w=>({treeData:ta(w.treeData,n,g)})),t().markDirty(),!0},markDirty:()=>{const{editorMode:r,setIsDirty:n}=K.getState();r==="edit"&&n(!0)},pruneCoursesByFramework:r=>{let n=0;return e(o=>{const s=o.treeData[0];if(!s)return o;const a=[];for(const i of s.children??[]){const c=lt(i),d=(i.children??[]).filter(u=>{var g;if(u.isFolder)return!0;const f=(g=u.metadata)==null?void 0:g.framework,m=!f||(Array.isArray(f)?f.includes(r):f===r);return m||n++,m});c&&d.length===0||a.push(d.length===(i.children??[]).length?i:{...i,children:d})}return n===0?o:{treeData:[{...s,children:a}]}}),n>0&&t().markDirty(),n},clearLevelSkills:r=>{if(!r)return 0;let n=0;return e(o=>{const s=o.treeData[0];if(!s)return o;const a={...o.treeCache},i=(s.children??[]).map(c=>{var m,g;if(!(((m=c.metadata)==null?void 0:m[r])!==void 0||((g=a[c.id])==null?void 0:g[r])!==void 0))return c;n++;const{[r]:u,...f}=c.metadata??{};if(a[c.id]){const{[r]:b,...h}=a[c.id];a[c.id]=h}return{...c,metadata:f}});return n===0?o:{treeData:[{...s,children:i}],treeCache:a}}),n>0&&t().markDirty(),n},replaceNodeIds:r=>{!r||Object.keys(r).length===0||e(n=>{const o=zu(n.treeData,r),s={};for(const[i,c]of Object.entries(n.treeCache)){const d=r[i]??i,{isNew:u,...f}=c;s[d]=f}const a=n.selectedNodeId?r[n.selectedNodeId]??n.selectedNodeId:null;return{treeData:o,treeCache:s,selectedNodeId:a}})},getNodeById:r=>Mt(t().treeData,r),getChildrenOf:r=>{const n=Mt(t().treeData,r);return(n==null?void 0:n.children)??[]},getBreadcrumb:r=>ES(t().treeData,r)})),AS={spin:"_spin_1ah4d_9"};function oe(){return Ti(e=>e.labelConfig)}const kS=({size:e=16,color:t="currentColor"})=>{const r=oe();return l.jsx("svg",{className:AS.spin,width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-label":r.spinner.loading,role:"status",children:l.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:t,strokeWidth:"3",strokeDasharray:"31.4",strokeDashoffset:"10",strokeLinecap:"round"})})},$e=({variant:e="ghost",size:t="md",isLoading:r,disabled:n,onClick:o,children:s,className:a,type:i="button"})=>l.jsxs("button",{type:i,className:`sbx-btn-${e} ${t==="sm"?"sbx-btn-sm":""} ${a??""}`,onClick:o,disabled:r||n,"aria-busy":r?!0:void 0,children:[r?l.jsx(kS,{size:14}):null,s]}),Vu=({size:e=16,...t})=>l.jsxs("svg",{width:e,height:e,viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[l.jsx("circle",{cx:"58",cy:"12",r:"4",stroke:"currentColor",strokeWidth:"4"}),l.jsx("circle",{cx:"8",cy:"58",r:"4",stroke:"currentColor",strokeWidth:"4"}),l.jsx("path",{d:"M52 12 H24 A12 12 0 0 0 24 36 H40 A12 12 0 0 1 40 60 H12",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]});async function Hu(e){var r,n;return(n=(r=(await Me.get(`/action/framework/v1/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.framework}async function IS(e){var r,n;return((n=(r=(await Me.post("/action/composite/v3/search",{request:{filters:{objectType:"Framework",status:["Live"],...e.type?{type:e.type}:{},...e.identifier?{identifier:e.identifier}:{},...e.channel?{channel:e.channel}:{},...e.systemDefault?{systemDefault:e.systemDefault}:{}}}})).data)==null?void 0:r.result)==null?void 0:n.Framework)??[]}function ra(e,t){const r=Tn({queryKey:["framework",e],queryFn:()=>Hu(e),enabled:!!e,staleTime:3e5}),n=t==null?void 0:t[0],o=Tn({queryKey:["framework",n],queryFn:()=>Hu(n),enabled:!!n,staleTime:300*1e3}),s=o.data?[o.data]:[];return{organisationFramework:r.data,targetFrameworks:s,isLoading:r.isLoading||o.isLoading}}function Qu(e){if(!(e!=null&&e.length))return null;const t=e.reduce((r,n)=>(n.index??-1/0)>(r.index??-1/0)?n:r);return{code:t.code,terms:t.terms??[]}}function DS(e){var n,o,s,a;const t=(n=e==null?void 0:e.children)==null?void 0:n[0];if(!lt(t))return;const r=(a=(s=(o=t==null?void 0:t.children)==null?void 0:o[0])==null?void 0:s.metadata)==null?void 0:a.framework;return Array.isArray(r)?r[0]:r}function sr(){var s;const e=K(a=>a.editorConfig),t=K(a=>a.contentFramework),r=re(a=>a.treeData),n=DS(r[0])??t??((s=e==null?void 0:e.context)==null?void 0:s.framework),{organisationFramework:o}=ra(n);return Qu(o==null?void 0:o.categories)}function LS(e,t,r){var d,u,f,m;const n={scope:((t==null?void 0:t.terms)??[]).map(g=>g.name),source:"manual"};if(!t)return n;const o=(d=e==null?void 0:e.children)==null?void 0:d[0];if(!lt(o))return n;const s=(u=o==null?void 0:o.children)==null?void 0:u[0];if(!s)return n;const i=((f=r[s.id])==null?void 0:f[t.code])??((m=s.metadata)==null?void 0:m[t.code]);return{scope:Array.isArray(i)?i:i?[i]:[],source:"prior"}}function Mo(){const e=sr(),t=re(n=>n.treeData),r=re(n=>n.treeCache);return p.useMemo(()=>LS(t[0],e,r),[t,e,r])}const Ie={overlay:"_overlay_kdzmi_1",modal:"_modal_kdzmi_15",modalHeader:"_modalHeader_kdzmi_27",modalHeaderClose:"_modalHeaderClose_kdzmi_37",modalBody:"_modalBody_kdzmi_55",modalFooter:"_modalFooter_kdzmi_62",checkRow:"_checkRow_kdzmi_69",formGroup:"_formGroup_kdzmi_112",textarea:"_textarea_kdzmi_123",sliderGroup:"_sliderGroup_kdzmi_144",sliderValue:"_sliderValue_kdzmi_156",sliderLabels:"_sliderLabels_kdzmi_164",sectionTitle:"_sectionTitle_kdzmi_172"},OS=({objectType:e,onConfirm:t,onCancel:r})=>{const n=oe(),o=re(b=>b.treeData[0]),s=re(b=>b.treeCache),a=sr(),{scope:i}=Mo(),[c,d]=p.useState(null),u=zi(o,a==null?void 0:a.code,i,s);p.useEffect(()=>{let b=!1;return d(null),_S(o).then(h=>{b||d(h)}),()=>{b=!0}},[o]);const f=c===null,m=[...u,...c??[]],g=!f&&m.length===0;return l.jsx("div",{className:Ie.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"publish-modal-title",children:l.jsxs("div",{className:Ie.modal,children:[l.jsxs("div",{className:Ie.modalHeader,children:[l.jsxs("span",{id:"publish-modal-title",children:[n.publishChecklist.publishTitlePrefix," ",e]}),l.jsx("button",{className:Ie.modalHeaderClose,onClick:r,"aria-label":n.publishChecklist.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:Ie.modalBody,children:m.length===0?l.jsx("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:f?n.learningPath.verifyingAssessmentCourses:`${n.publishChecklist.confirmPublishPrefix} ${e}?`}):l.jsxs(l.Fragment,{children:[l.jsx("p",{className:Ie.sectionTitle,children:n.learningPath.resolveBeforePublishing}),l.jsx("ul",{style:{margin:0,paddingLeft:18,fontSize:13,lineHeight:1.6},children:m.map((b,h)=>l.jsx("li",{children:b.message},`${b.code}-${b.nodeId??h}`))})]})}),l.jsxs("div",{className:Ie.modalFooter,children:[l.jsx($e,{variant:"ghost",onClick:r,children:n.publishChecklist.noButton}),l.jsx($e,{variant:"primary",onClick:t,disabled:!g,children:n.publishChecklist.yesButton})]})]})})},PS=({contentId:e,onConfirm:t,onCancel:r})=>{const n=oe(),o=K(m=>{var g,b;return(b=(g=m.editorConfig)==null?void 0:g.config)==null?void 0:b.objectType})||"Content",s=K(m=>m.editorProfile.key==="learningPath"),a=K(m=>m.publishChecklist)??[],[i,c]=p.useState({}),d=a.every(m=>i[m.code]),u=a.length===0||d,f=()=>{t()};return s?l.jsx(OS,{objectType:o,onConfirm:t,onCancel:r}):l.jsx("div",{className:Ie.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"publish-modal-title",children:l.jsxs("div",{className:Ie.modal,children:[l.jsxs("div",{className:Ie.modalHeader,children:[l.jsxs("span",{id:"publish-modal-title",children:[n.publishChecklist.publishTitlePrefix," ",o]}),l.jsx("button",{className:Ie.modalHeaderClose,onClick:r,"aria-label":n.publishChecklist.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:Ie.modalBody,children:a.length===0?l.jsxs("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:[n.publishChecklist.confirmPublishPrefix," ",o,"?"]}):l.jsxs(l.Fragment,{children:[l.jsx("p",{className:Ie.sectionTitle,children:n.publishChecklist.checklistInstructions}),a.map(m=>l.jsxs("label",{className:Ie.checkRow,children:[l.jsx("input",{type:"checkbox",checked:!!i[m.code],onChange:g=>c(b=>({...b,[m.code]:g.target.checked}))}),l.jsx("span",{children:m.label})]},m.code))]})}),l.jsxs("div",{className:Ie.modalFooter,children:[l.jsx($e,{variant:"ghost",onClick:r,children:n.publishChecklist.noButton}),l.jsx($e,{variant:"primary",onClick:f,disabled:!u,children:n.publishChecklist.yesButton})]})]})})},NS=({contentId:e,action:t,onConfirm:r,onCancel:n})=>{const o=oe(),[s,a]=p.useState(""),[i,c]=p.useState(7),d=t==="approve",u=d?o.qualityParamsModal.reviewQualityTitle:o.qualityParamsModal.rejectContentTitle,f=!d&&s.trim().length===0,m=()=>{d?r(s.trim(),i):r(s.trim())};return l.jsx("div",{className:Ie.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"quality-modal-title",children:l.jsxs("div",{className:Ie.modal,children:[l.jsxs("div",{className:Ie.modalHeader,children:[l.jsx("span",{id:"quality-modal-title",children:u}),l.jsx("button",{className:Ie.modalHeaderClose,onClick:n,"aria-label":o.qualityParamsModal.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:Ie.modalBody,children:d?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:Ie.formGroup,children:[l.jsx("label",{htmlFor:"quality-score",children:o.qualityParamsModal.qualityScoreLabel}),l.jsxs("div",{className:Ie.sliderGroup,children:[l.jsx("input",{id:"quality-score",type:"range",min:0,max:10,step:1,value:i,onChange:g=>c(Number(g.target.value)),"aria-valuemin":0,"aria-valuemax":10,"aria-valuenow":i}),l.jsx("span",{className:Ie.sliderValue,children:i})]}),l.jsxs("div",{className:Ie.sliderLabels,children:[l.jsx("span",{children:o.qualityParamsModal.scorePoorLabel}),l.jsx("span",{children:o.qualityParamsModal.scoreExcellentLabel})]})]}),l.jsxs("div",{className:Ie.formGroup,children:[l.jsxs("label",{htmlFor:"quality-comment",children:[o.qualityParamsModal.commentLabel," ",l.jsx("span",{style:{fontWeight:400,color:"var(--sbx-gray-400, #9CA3AF)"},children:o.qualityParamsModal.optionalLabel})]}),l.jsx("textarea",{id:"quality-comment",className:Ie.textarea,placeholder:o.qualityParamsModal.commentPlaceholder,value:s,onChange:g=>a(g.target.value),rows:4})]})]}):l.jsxs("div",{className:Ie.formGroup,children:[l.jsxs("label",{htmlFor:"reject-reason",children:[o.qualityParamsModal.rejectionReasonLabel," ",l.jsx("span",{style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),l.jsx("textarea",{id:"reject-reason",className:Ie.textarea,placeholder:o.qualityParamsModal.rejectReasonPlaceholder,value:s,onChange:g=>a(g.target.value),rows:5,required:!0,"aria-required":"true"}),s.trim().length===0&&l.jsx("p",{style:{fontSize:12,color:"var(--sbx-error, #DC2626)",marginTop:4},children:o.qualityParamsModal.rejectionRequiredMessage})]})}),l.jsxs("div",{className:Ie.modalFooter,children:[l.jsx($e,{variant:"ghost",onClick:n,children:o.qualityParamsModal.cancelButton}),l.jsx($e,{variant:d?"primary":"danger",onClick:m,disabled:f,children:d?o.qualityParamsModal.approveButton:o.qualityParamsModal.rejectButton})]})]})})},xS=({message:e,onConfirm:t,onCancel:r})=>{const n=oe();return Ue.createPortal(l.jsx("div",{className:Ie.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"confirm-dialog-title",children:l.jsxs("div",{className:Ie.modal,children:[l.jsxs("div",{className:Ie.modalHeader,children:[l.jsx("span",{id:"confirm-dialog-title",children:n.confirmDialog.title}),l.jsx("button",{className:Ie.modalHeaderClose,onClick:r,"aria-label":n.confirmDialog.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:Ie.modalBody,children:l.jsx("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:e})}),l.jsxs("div",{className:Ie.modalFooter,children:[l.jsx($e,{variant:"ghost",onClick:r,children:n.confirmDialog.cancelButton}),l.jsx($e,{variant:"danger",onClick:t,children:n.confirmDialog.confirmButton})]})]})}),document.body)},Wu=["email","firstName","lastName","identifier","organisations","rootOrgName","phone"];async function FS(e,t={}){var c,d,u,f;const n={"organisations.roles":[((c=t.objectType)==null?void 0:c.toLowerCase())==="textbook"?"BOOK_CREATOR":"CONTENT_CREATOR"]};t.rootOrgId&&(n.rootOrgId=[t.rootOrgId]);const o=e.includes("@"),s=/^\d{10,}$/.test(e.trim()),a={filters:n,fields:Wu,offset:0,limit:t.limit??200};return o?n.email=e.trim():s?n.phone=e.trim():a.query=e,((f=(u=(d=(await Me.post("/action/user/v1/search",{request:a},{params:{fields:"orgName"},headers:{"X-Source":"web","X-msgid":Math.random().toString(36).slice(2)}})).data)==null?void 0:d.result)==null?void 0:u.response)==null?void 0:f.content)??[]}async function MS(e){var r,n,o;return e.length?((o=(n=(r=(await Me.post("/action/user/v1/search",{request:{filters:{userId:e},fields:Wu,limit:e.length}},{headers:{"X-Source":"web","X-msgid":Math.random().toString(36).slice(2)}})).data)==null?void 0:r.result)==null?void 0:n.response)==null?void 0:o.content)??[]:[]}async function $S(e){var r,n;return((n=(r=(await Me.get(`/portal/user/v5/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.response)??{}}const Be={container:"_container_1hnn8_1",header:"_header_1hnn8_13",title:"_title_1hnn8_22",closeBtn:"_closeBtn_1hnn8_29",body:"_body_1hnn8_45",label:"_label_1hnn8_54",searchSection:"_searchSection_1hnn8_62",searchRow:"_searchRow_1hnn8_68",searchInput:"_searchInput_1hnn8_74",searchSpinner:"_searchSpinner_1hnn8_89",resultsList:"_resultsList_1hnn8_105",resultItem:"_resultItem_1hnn8_118",userInfo:"_userInfo_1hnn8_133",userName:"_userName_1hnn8_141",userEmail:"_userEmail_1hnn8_150",userOrg:"_userOrg_1hnn8_158",noResults:"_noResults_1hnn8_167",collabSection:"_collabSection_1hnn8_174",sectionTitle:"_sectionTitle_1hnn8_179",badge:"_badge_1hnn8_189",emptyCollab:"_emptyCollab_1hnn8_203",collabList:"_collabList_1hnn8_214",collabItem:"_collabItem_1hnn8_223",userAvatar:"_userAvatar_1hnn8_237",error:"_error_1hnn8_251",success:"_success_1hnn8_257",footer:"_footer_1hnn8_263"},BS=({contentId:e,onClose:t})=>{var x,F;const r=oe(),n=K(P=>P.editorConfig),o=(x=n==null?void 0:n.context)==null?void 0:x.channel,s=(F=n==null?void 0:n.config)==null?void 0:F.objectType,[a,i]=p.useState(""),[c,d]=p.useState([]),[u,f]=p.useState(!1),[m,g]=p.useState([]),[b,h]=p.useState(!1),[v,y]=p.useState(""),[C,S]=p.useState(!1),w=p.useRef(null);p.useEffect(()=>{let P=!1;return(async()=>{try{const N=await uS(e),M=(N==null?void 0:N.collaborators)??[];if(!M.length)return;const B=await MS(M);if(P)return;const U=M.map(ee=>B.find(Q=>Q.identifier===ee)??{identifier:ee,firstName:ee});g(U)}catch{}})(),()=>{P=!0}},[e]),p.useEffect(()=>{w.current&&clearTimeout(w.current);const P=a.trim();if(P.length<2){d([]);return}return w.current=setTimeout(async()=>{f(!0);try{const N=await FS(P,{rootOrgId:o,objectType:s}),M=new Set(m.map(B=>B.identifier));d(N.filter(B=>!M.has(B.identifier)))}catch{d([])}finally{f(!1)}},300),()=>{w.current&&clearTimeout(w.current)}},[a,m,o,s]);const T=p.useCallback(P=>{g(N=>N.find(M=>M.identifier===P.identifier)?N:[...N,P]),d(N=>N.filter(M=>M.identifier!==P.identifier)),S(!1)},[]),E=p.useCallback(P=>{g(N=>N.filter(M=>M.identifier!==P)),S(!1)},[]),L=p.useCallback(async()=>{h(!0),y(""),S(!1);try{await pS(e,m.map(P=>P.identifier)),S(!0)}catch{y(r.manageCollaborators.saveFailed)}finally{h(!1)}},[e,m,r.manageCollaborators.saveFailed]),A=P=>`${P.firstName}${P.lastName?` ${P.lastName}`:""}`;return l.jsxs("div",{className:Be.container,children:[l.jsxs("div",{className:Be.header,children:[l.jsx("h2",{className:Be.title,children:r.manageCollaborators.title}),l.jsx("button",{className:Be.closeBtn,onClick:t,"aria-label":r.manageCollaborators.closeAriaLabel,children:l.jsx(fr,{size:18})})]}),l.jsxs("div",{className:Be.body,children:[l.jsxs("div",{className:Be.searchSection,children:[l.jsx("label",{className:Be.label,htmlFor:"collab-search",children:r.manageCollaborators.searchUsersLabel}),l.jsxs("div",{className:Be.searchRow,children:[l.jsx("input",{id:"collab-search",type:"text",className:Be.searchInput,placeholder:r.manageCollaborators.searchPlaceholder,value:a,onChange:P=>i(P.target.value)}),u&&l.jsx("span",{className:Be.searchSpinner,"aria-label":r.manageCollaborators.searchingAriaLabel})]}),c.length>0&&l.jsx("ul",{className:Be.resultsList,role:"listbox","aria-label":r.manageCollaborators.searchResultsAriaLabel,children:c.map(P=>{var N,M,B,U;return l.jsxs("li",{className:Be.resultItem,role:"option","aria-selected":"false",children:[l.jsxs("div",{className:Be.userInfo,children:[l.jsx("span",{className:Be.userName,children:A(P)}),P.email&&l.jsx("span",{className:Be.userEmail,children:P.email}),(((M=(N=P.organisations)==null?void 0:N[0])==null?void 0:M.orgName)??P.rootOrgName)&&l.jsx("span",{className:Be.userOrg,children:((U=(B=P.organisations)==null?void 0:B[0])==null?void 0:U.orgName)??P.rootOrgName})]}),l.jsx($e,{variant:"primary",size:"sm",onClick:()=>T(P),children:r.manageCollaborators.add})]},P.identifier)})}),a.trim().length>=2&&!u&&c.length===0&&l.jsx("p",{className:Be.noResults,children:r.manageCollaborators.noUsersFound})]}),l.jsxs("div",{className:Be.collabSection,children:[l.jsxs("h3",{className:Be.sectionTitle,children:[r.manageCollaborators.currentCollaborators,m.length>0&&l.jsx("span",{className:Be.badge,children:m.length})]}),m.length===0?l.jsx("p",{className:Be.emptyCollab,children:r.manageCollaborators.noCollaboratorsYet}):l.jsx("ul",{className:Be.collabList,children:m.map(P=>{var N,M,B,U;return l.jsxs("li",{className:Be.collabItem,children:[l.jsx("div",{className:Be.userAvatar,"aria-hidden":"true",children:A(P).charAt(0).toUpperCase()}),l.jsxs("div",{className:Be.userInfo,children:[l.jsx("span",{className:Be.userName,children:A(P)}),P.email&&l.jsx("span",{className:Be.userEmail,children:P.email}),(((M=(N=P.organisations)==null?void 0:N[0])==null?void 0:M.orgName)??P.rootOrgName)&&l.jsx("span",{className:Be.userOrg,children:((U=(B=P.organisations)==null?void 0:B[0])==null?void 0:U.orgName)??P.rootOrgName})]}),l.jsx($e,{variant:"danger",size:"sm",onClick:()=>E(P.identifier),children:r.manageCollaborators.remove})]},P.identifier)})})]}),v&&l.jsx("p",{className:Be.error,role:"alert",children:v}),C&&l.jsx("p",{className:Be.success,role:"status",children:r.manageCollaborators.saveSuccess})]}),l.jsxs("div",{className:Be.footer,children:[l.jsx($e,{variant:"ghost",onClick:t,disabled:b,children:r.manageCollaborators.cancel}),l.jsx($e,{variant:"primary",isLoading:b,onClick:L,children:r.manageCollaborators.save})]})]})};async function qS(e){return(await Me.post("/api/dialcode/v1/read",{request:{dialcodes:[e]}})).data}async function jS(e,t){var o;const n=((o=(await Me.post(`/action/dialcode/v1/reserve/${e}`,{request:{dialcodes:{count:t,qrCodeSpec:{errorCorrectionLevel:"H"}}}})).data)==null?void 0:o.result)??{};return{processId:n.processId??"",reservedDialcodes:n.reservedDialcodes??{}}}async function US(e){var n;const r=((n=(await Me.get(`/action/dialcode/v1/process/status/${e}`)).data)==null?void 0:n.result)??{status:"PENDING"};return{...r,status:r.status==="PENDING"?"in-process":r.status}}const we={topbar:"_topbar_c3y0z_1",left:"_left_c3y0z_15",right:"_right_c3y0z_23",backBtn:"_backBtn_c3y0z_30",title:"_title_c3y0z_49",profileBadge:"_profileBadge_c3y0z_61",statusChip:"_statusChip_c3y0z_76",savedIndicator:"_savedIndicator_c3y0z_88",unsaved:"_unsaved_c3y0z_98",iconBtn:"_iconBtn_c3y0z_103",iconBtnLabel:"_iconBtnLabel_c3y0z_130",qrDropdown:"_qrDropdown_c3y0z_134",qrMenu:"_qrMenu_c3y0z_138",reviewBtns:"_reviewBtns_c3y0z_173",sourcingBtns:"_sourcingBtns_c3y0z_182",modalOverlay:"_modalOverlay_c3y0z_191",sbOverlay:"_sbOverlay_c3y0z_201",sbModal:"_sbModal_c3y0z_211",sbModalHeader:"_sbModalHeader_c3y0z_222",sbModalTitle:"_sbModalTitle_c3y0z_230",sbModalClose:"_sbModalClose_c3y0z_237",sbModalBody:"_sbModalBody_c3y0z_250",sbLabel:"_sbLabel_c3y0z_257",sbTextarea:"_sbTextarea_c3y0z_264",sbError:"_sbError_c3y0z_281",sbModalFooter:"_sbModalFooter_c3y0z_288"};function zS(e){return e?new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):""}function VS(e,t){return typeof e=="string"&&e.trim().length>0?e.trim():t}const HS=({titleText:e,labelText:t,placeholderText:r,submitLabel:n,submitVariant:o="primary",onConfirm:s,onCancel:a})=>{const i=oe(),[c,d]=p.useState(""),u=e.toLowerCase().replace(/\s+/g,"-");return l.jsx("div",{className:we.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":`${u}-title`,children:l.jsxs("div",{className:we.sbModal,children:[l.jsxs("div",{className:we.sbModalHeader,children:[l.jsx("span",{id:`${u}-title`,className:we.sbModalTitle,children:e}),l.jsx("button",{className:we.sbModalClose,onClick:a,"aria-label":i.reviewCommentModal.closeAriaLabel,type:"button",children:"×"})]}),l.jsxs("div",{className:we.sbModalBody,children:[l.jsxs("label",{className:we.sbLabel,htmlFor:`${u}-comment`,children:[t," ",l.jsx("span",{"aria-hidden":"true",style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),l.jsx("textarea",{id:`${u}-comment`,className:we.sbTextarea,placeholder:r,value:c,onChange:f=>d(f.target.value),rows:4,required:!0,"aria-required":"true"}),c.trim().length===0&&l.jsx("p",{className:we.sbError,children:i.reviewCommentModal.fillCommentsError})]}),l.jsxs("div",{className:we.sbModalFooter,children:[l.jsx($e,{variant:"ghost",onClick:a,children:i.reviewCommentModal.cancelButton}),l.jsx($e,{variant:o,onClick:()=>s(c.trim()),disabled:c.trim().length===0,children:n})]})]})})},QS=({onConfirm:e,onCancel:t})=>{const r=oe(),[n,o]=p.useState(!1),s=K(m=>m.editorProfile.key==="learningPath"),a=re(m=>m.treeData[0]),i=re(m=>m.treeCache),c=sr(),{scope:d}=Mo(),u=s?zi(a,c==null?void 0:c.code,d,i):[],f=u.length>0;return l.jsx("div",{className:we.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":"review-confirm-title",children:l.jsxs("div",{className:we.sbModal,children:[l.jsxs("div",{className:we.sbModalHeader,children:[l.jsx("span",{id:"review-confirm-title",className:we.sbModalTitle,children:r.confirmReviewModal.title}),l.jsx("button",{className:we.sbModalClose,onClick:t,"aria-label":r.confirmReviewModal.closeAriaLabel,type:"button",children:"×"})]}),l.jsx("div",{className:we.sbModalBody,children:f?l.jsxs(l.Fragment,{children:[l.jsx("p",{style:{margin:"0 0 8px",fontSize:13,fontWeight:600},children:r.learningPath.resolveBeforeSendingForReview}),l.jsx("ul",{style:{margin:0,paddingLeft:18,fontSize:13,lineHeight:1.6},children:u.map((m,g)=>l.jsx("li",{children:m.message},`${m.code}-${m.nodeId??g}`))})]}):l.jsxs("label",{style:{display:"flex",gap:8,alignItems:"flex-start",fontSize:13,lineHeight:1.55},children:[l.jsx("input",{type:"checkbox",checked:n,onChange:m=>o(m.target.checked),style:{marginTop:2}}),l.jsxs("span",{children:[r.confirmReviewModal.agreementTextPart1," ",l.jsx("a",{className:"sb-color-primary",style:{fontWeight:600},href:"https://creativecommons.org/licenses",target:"_blank",rel:"noreferrer",children:r.confirmReviewModal.creativeCommonsLinkText})," ",r.confirmReviewModal.agreementTextPart2," ",l.jsx("strong",{children:r.confirmReviewModal.contentPolicyText}),r.confirmReviewModal.agreementTextPart3]})]})}),l.jsxs("div",{className:we.sbModalFooter,children:[l.jsx($e,{variant:"ghost",onClick:t,children:r.confirmReviewModal.cancelButton}),!f&&l.jsx($e,{variant:"primary",onClick:e,disabled:!n,children:r.confirmReviewModal.submitButton})]})]})})},WS=({onConfirm:e,onCancel:t})=>{const r=oe(),[n,o]=p.useState(""),s=parseInt(n,10),a=!isNaN(s)&&s>=2&&s<=250;return l.jsx("div",{className:we.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":"genqr-title",children:l.jsxs("div",{className:we.sbModal,children:[l.jsxs("div",{className:we.sbModalHeader,children:[l.jsx("span",{id:"genqr-title",className:we.sbModalTitle,children:r.generateQRModal.title}),l.jsx("button",{className:we.sbModalClose,onClick:t,"aria-label":r.generateQRModal.closeAriaLabel,type:"button",children:"×"})]}),l.jsxs("div",{className:we.sbModalBody,children:[l.jsxs("label",{className:we.sbLabel,htmlFor:"qr-count",children:[r.generateQRModal.numberOfCodesLabel," ",l.jsx("span",{"aria-hidden":"true",style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),l.jsx("input",{id:"qr-count",type:"number",min:2,max:250,className:we.sbTextarea,style:{resize:"none",height:"40px"},placeholder:r.generateQRModal.countPlaceholder,value:n,onChange:i=>o(i.target.value)}),n&&!a&&l.jsx("p",{className:we.sbError,children:r.generateQRModal.countRangeError})]}),l.jsxs("div",{className:we.sbModalFooter,children:[l.jsx($e,{variant:"ghost",onClick:t,children:r.generateQRModal.cancelButton}),l.jsx($e,{variant:"primary",onClick:()=>e(s),disabled:!a,children:r.generateQRModal.generateButton})]})]})})},RS=({editorMode:e,isSaving:t,isDirty:r,lastSaved:n,isFormValid:o=!0,onToolbarEvent:s})=>{var be,ge;const a=oe(),c=re(le=>le.treeData)[0],d=(c==null?void 0:c.name)??a.contextualEditor.untitledPlaceholder,u=VS(((be=c==null?void 0:c.metadata)==null?void 0:be.status)??(c==null?void 0:c.status),a.topbar.draftStatusFallback),f=K(le=>{var ve,Ae,Y,de;return((Ae=(ve=le.editorConfig)==null?void 0:ve.context)==null?void 0:Ae.contentId)??((de=(Y=le.editorConfig)==null?void 0:Y.context)==null?void 0:de.identifier)??""}),{activeModal:m,modalData:g,closeModal:b,openModal:h}=hr(),v=K(le=>le.buttonLoaders),y=K(le=>le.categoryMeta),C=K(le=>le.editorProfile),S=C.key==="learningPath",w=C.features.dialcodes&&(!y||y.schemaDefaults.generateDIALCodes!=="No"),[T,E]=p.useState(!1),[L,A]=p.useState(!1),[x,F]=p.useState(!1),P=p.useRef(null),[N,M]=p.useState(!1);p.useEffect(()=>{if(!x)return;const le=ve=>{var Ae;(Ae=P.current)!=null&&Ae.contains(ve.target)||F(!1)};return document.addEventListener("mousedown",le),()=>document.removeEventListener("mousedown",le)},[x]);const[B,U]=p.useState(!1),[ee,Q]=p.useState(!1),{updateNode:te}=re(),ue=(ge=c==null?void 0:c.metadata)==null?void 0:ge.qrCodeProcessId,fe=p.useCallback(async le=>{if(f){M(!1),U(!0);try{const{processId:ve,reservedDialcodes:Ae}=await jS(f,le);ve&&c&&te(c.id,{qrCodeProcessId:ve,reservedDialcodes:Ae}),Se.success(a.topbar.qrGenerationStartedToast)}catch{Se.error(a.topbar.qrGenerationFailedToast)}finally{U(!1)}}},[f,c,te,a]),pe=p.useCallback(async()=>{if(!ue){Se.error(a.topbar.qrCodesNotGeneratedToast);return}Q(!0);try{const le=await US(ue);if(le.status==="in-process"){Se(a.topbar.qrGenerationInProgressToast,{icon:l.jsx(Dn,{size:16})});return}const ve=le.url;if(!ve){Se.error(a.topbar.qrCodesNotReadyToast);return}const Ae=await fetch(ve).then(Ke=>Ke.blob()),Y=await new Promise(Ke=>{const ot=new FileReader;ot.onloadend=()=>Ke(ot.result),ot.readAsDataURL(Ae)}),de=(c==null?void 0:c.metadata)??{},W=Ke=>Array.isArray(Ke)?Ke.join("_"):typeof Ke=="string"?Ke:"",Ce=[f,W(de.medium),W(de.gradeLevel),W(de.subject)].filter(Boolean),Ve=new Date().toISOString().replace(/[:.]/g,"-"),nt=`${Ce.join("_")}_${Ve}.zip`,He=document.createElement("a");He.href=Y,He.download=nt,He.style.display="none",document.body.appendChild(He),He.click(),document.body.removeChild(He),Se.success(a.topbar.qrCodesDownloadedToast)}catch{Se.error(a.topbar.qrCodesDownloadFailedToast)}finally{Q(!1)}},[ue,c,f,a]),ie=e==="edit",Te=e==="review",ye=e==="sourcingreview",$=e==="read",q=p.useCallback((le,ve)=>{s({action:le,data:ve})},[s]),Z=p.useCallback(()=>{b(),q("publish")},[b,q]),he=p.useCallback((le,ve)=>{const Ae=g==null?void 0:g.action;b(),Ae==="approve"?q("sourcingApprove",{comment:le,score:ve}):q("reject",{comment:le})},[b,q,g]);return l.jsxs(l.Fragment,{children:[l.jsxs("header",{className:we.topbar,role:"banner",children:[l.jsxs("div",{className:we.left,children:[l.jsx("button",{className:we.backBtn,onClick:()=>q("back"),"aria-label":a.topbar.backAriaLabel,type:"button",children:l.jsx(ui,{size:18})}),l.jsx("h1",{className:we.title,title:d,children:d}),S&&l.jsxs("span",{className:we.profileBadge,children:[l.jsx(Vu,{size:13,"aria-hidden":"true"}),a.learningPath.profileBadgeLabel]}),l.jsx("span",{className:`sbx-chip ${we.statusChip}`,"aria-label":`${a.topbar.statusAriaLabelPrefix} ${u}`,children:u})]}),l.jsxs("div",{className:we.right,children:[t?l.jsx("span",{className:we.savedIndicator,"aria-live":"polite",children:a.topbar.savingIndicator}):r&&ie?l.jsx("span",{className:`${we.savedIndicator} ${we.unsaved}`,"aria-live":"polite",children:a.topbar.unsavedIndicator}):n?l.jsxs("span",{className:we.savedIndicator,"aria-live":"polite",children:[l.jsx(Yr,{size:14,"aria-hidden":"true"}),a.topbar.savedIndicatorPrefix," ",zS(n)]}):null,!$&&!Te&&!ye&&u!=="Review"&&l.jsx("span",{title:o?void 0:a.topbar.fillRequiredFieldsTooltip,children:l.jsx($e,{variant:"ghost",size:"sm",onClick:()=>q("saveCollection"),disabled:!o,children:a.topbar.saveAsDraftButton})}),ie&&l.jsxs(l.Fragment,{children:[l.jsxs($e,{variant:"primary",size:"sm",onClick:()=>A(!0),disabled:v.saveCollection,isLoading:v.saveCollection,children:[l.jsx($y,{size:14,"aria-hidden":"true"})," ",a.topbar.sendForReviewButton]}),C.features.collaborators&&l.jsx("button",{className:we.iconBtn,onClick:()=>h("manageCollaborators"),"aria-label":a.topbar.collaboratorsLabel,title:a.topbar.collaboratorsLabel,type:"button",children:l.jsx(Hy,{size:16,"aria-hidden":"true"})}),w&&l.jsxs("div",{className:we.qrDropdown,ref:P,children:[l.jsxs("button",{className:we.iconBtn,onClick:()=>F(le=>!le),"aria-label":a.topbar.qrCodesLabel,title:a.topbar.qrCodesLabel,type:"button","aria-haspopup":"true","aria-expanded":x,children:[l.jsx(_d,{size:16,"aria-hidden":"true"}),l.jsx("span",{className:we.iconBtnLabel,children:a.topbar.qrCodesLabel}),l.jsx(Zr,{size:14,style:{marginLeft:2},"aria-hidden":"true"})]}),x&&l.jsxs("div",{className:we.qrMenu,role:"menu",children:[l.jsxs("button",{role:"menuitem",type:"button",onClick:()=>{F(!1),M(!0)},disabled:B,children:[l.jsx(_d,{size:14}),B?a.topbar.generatingEllipsis:a.topbar.generateQrCodesMenuItem]}),l.jsxs("button",{role:"menuitem",type:"button",onClick:()=>{F(!1),pe()},disabled:ee||!ue,children:[l.jsx(_y,{size:14}),ee?a.topbar.downloadingEllipsis:a.topbar.downloadQrCodesMenuItem]})]})]})]}),Te&&l.jsxs("div",{className:we.reviewBtns,children:[l.jsxs($e,{variant:"primary",size:"sm",onClick:()=>h("publishChecklist"),disabled:v.publishCollection,isLoading:v.publishCollection,children:[l.jsx(gd,{size:14,"aria-hidden":"true"})," ",a.topbar.publishButton]}),l.jsxs($e,{variant:"primary",size:"sm",onClick:()=>E(!0),disabled:v.rejectCollection,isLoading:v.rejectCollection,children:[l.jsx(Td,{size:14,"aria-hidden":"true"})," ",a.topbar.requestForChangesButton]})]}),ye&&l.jsxs("div",{className:we.sourcingBtns,children:[l.jsxs($e,{variant:"primary",size:"sm",onClick:()=>h("qualityParams",{action:"approve"}),children:[l.jsx(qy,{size:14,"aria-hidden":"true"})," ",a.topbar.approveButton]}),l.jsxs($e,{variant:"primary",size:"sm",onClick:()=>h("qualityParams",{action:"reject"}),children:[l.jsx(Td,{size:14,"aria-hidden":"true"})," ",a.topbar.requestForChangesButton]})]})]})]}),m==="publishChecklist"&&l.jsx(PS,{contentId:f,onConfirm:Z,onCancel:b}),m==="qualityParams"&&l.jsx(NS,{contentId:f,action:(g==null?void 0:g.action)??"reject",onConfirm:he,onCancel:b}),m==="manageCollaborators"&&l.jsx("div",{className:we.modalOverlay,role:"dialog","aria-modal":"true",children:l.jsx(BS,{contentId:f,onClose:b})}),m==="confirmDelete"&&l.jsx(xS,{message:(g==null?void 0:g.message)??"",onConfirm:()=>{const le=g==null?void 0:g.onConfirm;b(),le==null||le()},onCancel:b}),L&&l.jsx(QS,{onConfirm:()=>{A(!1),q("sendForReview")},onCancel:()=>A(!1)}),T&&l.jsx(HS,{titleText:a.topbar.requestChangesTitle,labelText:a.topbar.changesRequestedLabel,placeholderText:a.topbar.describeChangesPlaceholder,submitLabel:a.topbar.requestForChangesButton,submitVariant:"primary",onConfirm:le=>{E(!1),q("reject",{comment:le})},onCancel:()=>E(!1)}),N&&l.jsx(WS,{onConfirm:fe,onCancel:()=>M(!1)})]})},GS=({onSave:e,onDiscard:t,onCancel:r,isSaving:n})=>{const o=oe();return Ue.createPortal(l.jsx("div",{className:Ie.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"unsaved-title",children:l.jsxs("div",{className:Ie.modal,children:[l.jsxs("div",{className:Ie.modalHeader,children:[l.jsx("span",{id:"unsaved-title",children:o.unsavedChangesModal.title}),l.jsx("button",{className:Ie.modalHeaderClose,onClick:r,"aria-label":o.unsavedChangesModal.closeAriaLabel,disabled:n,children:"×"})]}),l.jsx("div",{className:Ie.modalBody,children:l.jsx("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:o.unsavedChangesModal.bodyMessage})}),l.jsxs("div",{className:Ie.modalFooter,children:[l.jsx($e,{variant:"ghost",onClick:r,disabled:n,children:o.unsavedChangesModal.cancelButton}),l.jsx($e,{variant:"danger",onClick:t,disabled:n,children:o.unsavedChangesModal.discardButton}),l.jsx($e,{variant:"primary",onClick:e,isLoading:n,disabled:n,children:o.unsavedChangesModal.saveButton})]})]})}),document.body)};var KS=yi();const Ru=p.createContext(null);function $t(){const e=p.useContext(Ru);if(e===null)throw new Error("No Tree Api Provided");return e}const Gu=p.createContext(null);function YS(){const e=p.useContext(Gu);if(e===null)throw new Error("Provide a NodesContext");return e}const Ku=p.createContext(null);function ZS(){const e=p.useContext(Ku);if(e===null)throw new Error("Provide a DnDContext");return e}const Yu=p.createContext(0);function Zu(){p.useContext(Yu)}function na(e,t,r){return Math.max(Math.min(e,r),t)}function Xu(e){return e&&e.isLeaf}function Ju(e){return e&&e.isInternal&&!e.isOpen}function ef(e){var t;return e&&e.isOpen&&!(!((t=e.children)===null||t===void 0)&&t.length)}const tf=(e,t)=>{let r=e;for(;r;){if(r.id===t.id)return!0;r=r.parent}return!1},rf=e=>{if(!e.parent)throw Error("Node does not have a parent");return e.parent.children.findIndex(t=>t.id===e.id)};function Qi(e,t){if(!e)return null;if(e.id===t)return e;if(e.children)for(let r of e.children){const n=Qi(r,t);if(n)return n}return null}function oa(e,t){if(t(e),e.children)for(let r of e.children)oa(r,t)}function nf(e){const t=sf(e);let r;for(let n=0;n<t.length;++n)if(t[n]===e){r=XS(t,n);break}r==null||r.focus()}function of(e){const t=sf(e);let r;for(let n=0;n<t.length;++n)if(t[n]===e){r=JS(t,n);break}r==null||r.focus()}function XS(e,t){return t+1<e.length?e[t+1]:e[0]}function JS(e,t){return t-1>=0?e[t-1]:e[e.length-1]}function sf(e){return Array.from(document.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), details:not([disabled]), summary:not(:disabled)')).filter(t=>t===e||!e.contains(t))}function $o(e,t){return typeof t=="boolean"?t:typeof t=="string"?e[t]:t(e)}function Fn(e){return typeof e=="string"?e:e.id}function ew(e,...t){if(e)return e(...t)}function af(e){return new Promise((t,r)=>{let n=0;function o(){n+=1,n===100&&r(),e()?t():setTimeout(o,10)}o()})}function lf(e){var t,r;const n=e.focusedNode;return n?n.isOpen?0:n.parent?n.childIndex+1:0:(r=(t=e.root.children)===null||t===void 0?void 0:t.length)!==null&&r!==void 0?r:0}function cf(e){const t=e.focusedNode;return t?t.isOpen?t.id:t.parent&&!t.parent.isRoot?t.parent.id:null:null}const tw=Object.freeze(Object.defineProperty({__proto__:null,access:$o,bound:na,dfs:Qi,focusNextElement:nf,focusPrevElement:of,getInsertIndex:lf,getInsertParentId:cf,identify:Fn,indexOf:rf,isClosed:Ju,isDescendant:tf,isItem:Xu,isOpenWithEmptyChildren:ef,safeRun:ew,waitFor:af,walk:oa},Symbol.toStringTag,{value:"Module"})),rw={display:"flex",alignItems:"center",zIndex:1},nw={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},ow={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},sw=p.memo(function({top:t,left:r,indent:n}){const o={position:"absolute",pointerEvents:"none",top:t-2+"px",left:r+"px",right:n+"px"};return l.jsxs("div",{style:Object.assign(Object.assign({},rw),o),children:[l.jsx("div",{style:Object.assign({},ow)}),l.jsx("div",{style:Object.assign({},nw)})]})});function aw({node:e,attrs:t,innerRef:r,children:n}){return l.jsx("div",Object.assign({},t,{ref:r,onFocus:o=>o.stopPropagation(),onClick:e.handleClick,children:n}))}function iw(e){return l.jsxs("div",{ref:e.dragHandle,style:e.style,children:[l.jsx("span",{onClick:t=>{t.stopPropagation(),e.node.toggle()},children:e.node.isLeaf?"🌳":e.node.isOpen?"🗁":"🗀"})," ",e.node.isEditing?l.jsx(cw,Object.assign({},e)):l.jsx(lw,Object.assign({},e))]})}function lw(e){return l.jsx(l.Fragment,{children:l.jsx("span",{children:e.node.data.name})})}function cw({node:e}){const t=p.useRef();return p.useEffect(()=>{var r,n;(r=t.current)===null||r===void 0||r.focus(),(n=t.current)===null||n===void 0||n.select()},[]),l.jsx("input",{ref:t,defaultValue:e.data.name,onBlur:()=>e.reset(),onKeyDown:r=>{var n;r.key==="Escape"&&e.reset(),r.key==="Enter"&&e.submit(((n=t.current)===null||n===void 0?void 0:n.value)||"")}})}const Bo="__REACT_ARBORIST_INTERNAL_ROOT__";function df(e){var t;function r(s,a,i){const c=e.accessId(s),d=new qo({tree:e,data:s,level:a,parent:i,id:c,children:null,isDraggable:e.isDraggable(s),rowIndex:null}),u=e.accessChildren(s);return u&&(d.children=u.map(f=>r(f,a+1,d))),d}const n=new qo({tree:e,id:Bo,data:{id:Bo},level:-1,parent:null,children:null,isDraggable:!0,rowIndex:null}),o=(t=e.props.data)!==null&&t!==void 0?t:[];return n.children=o.map(s=>r(s,0,n)),n}class qo{constructor(t){this.handleClick=r=>{(r.metaKey||r.ctrlKey)&&!this.tree.props.disableMultiSelection?this.isSelected?this.deselect():this.selectMulti():r.shiftKey&&!this.tree.props.disableMultiSelection?this.selectContiguous():(this.select(),this.activate())},this.tree=t.tree,this.id=t.id,this.data=t.data,this.level=t.level,this.children=t.children,this.parent=t.parent,this.isDraggable=t.isDraggable,this.rowIndex=t.rowIndex}get isRoot(){return this.id===Bo}get isLeaf(){return!Array.isArray(this.children)}get isInternal(){return!this.isLeaf}get isOpen(){return this.isLeaf?!1:this.tree.isOpen(this.id)}get isClosed(){return this.isLeaf?!1:!this.tree.isOpen(this.id)}get isEditable(){return this.tree.isEditable(this.data)}get isSelectable(){return this.tree.isSelectable(this.data)}get isEditing(){return this.tree.editingId===this.id}get isSelected(){return this.tree.isSelected(this.id)}get isOnlySelection(){return this.isSelected&&this.tree.hasOneSelection}get isSelectedStart(){var t;return this.isSelected&&!(!((t=this.prev)===null||t===void 0)&&t.isSelected)}get isSelectedEnd(){var t;return this.isSelected&&!(!((t=this.next)===null||t===void 0)&&t.isSelected)}get isFocused(){return this.tree.isFocused(this.id)}get isDragging(){return this.tree.isDragging(this.id)}get willReceiveDrop(){return this.tree.willReceiveDrop(this.id)}get state(){return{isClosed:this.isClosed,isDragging:this.isDragging,isEditing:this.isEditing,isFocused:this.isFocused,isInternal:this.isInternal,isLeaf:this.isLeaf,isOpen:this.isOpen,isSelected:this.isSelected,isSelectedEnd:this.isSelectedEnd,isSelectedStart:this.isSelectedStart,willReceiveDrop:this.willReceiveDrop}}get childIndex(){return this.parent&&this.parent.children?this.parent.children.findIndex(t=>t.id===this.id):-1}get next(){return this.rowIndex===null?null:this.tree.at(this.rowIndex+1)}get prev(){return this.rowIndex===null?null:this.tree.at(this.rowIndex-1)}get nextSibling(){var t,r;const n=this.childIndex;return(r=(t=this.parent)===null||t===void 0?void 0:t.children[n+1])!==null&&r!==void 0?r:null}isAncestorOf(t){if(!t)return!1;let r=t;for(;r;){if(r.id===this.id)return!0;r=r.parent}return!1}select(){this.tree.select(this)}deselect(){this.tree.deselect(this)}selectMulti(){this.tree.selectMulti(this)}selectContiguous(){this.tree.selectContiguous(this)}activate(){this.tree.activate(this)}focus(){this.tree.focus(this)}toggle(){this.tree.toggle(this)}open(){this.tree.open(this)}openParents(){this.tree.openParents(this)}close(){this.tree.close(this)}submit(t){this.tree.submit(this,t)}reset(){this.tree.reset()}clone(){return new qo(Object.assign({},this))}edit(){return this.tree.edit(this)}}function Wi(e){return{type:"EDIT",id:e}}function dw(e={id:null},t){return t.type==="EDIT"?Object.assign(Object.assign({},e),{id:t.id}):e}function Mn(e){return{type:"FOCUS",id:e}}function uw(){return{type:"TREE_BLUR"}}function fw(e={id:null,treeFocused:!1},t){return t.type==="FOCUS"?Object.assign(Object.assign({},e),{id:t.id,treeFocused:!0}):t.type==="TREE_BLUR"?Object.assign(Object.assign({},e),{treeFocused:!1}):e}const Ri={open(e,t){return{type:"VISIBILITY_OPEN",id:e,filtered:t}},close(e,t){return{type:"VISIBILITY_CLOSE",id:e,filtered:t}},toggle(e,t){return{type:"VISIBILITY_TOGGLE",id:e,filtered:t}},clear(e){return{type:"VISIBILITY_CLEAR",filtered:e}}};function uf(e={},t){if(t.type==="VISIBILITY_OPEN")return Object.assign(Object.assign({},e),{[t.id]:!0});if(t.type==="VISIBILITY_CLOSE")return Object.assign(Object.assign({},e),{[t.id]:!1});if(t.type==="VISIBILITY_TOGGLE"){const r=e[t.id];return Object.assign(Object.assign({},e),{[t.id]:!r})}else return t.type==="VISIBILITY_CLEAR"?{}:e}function hw(e={filtered:{},unfiltered:{}},t){return t.type.startsWith("VISIBILITY")?t.filtered?Object.assign(Object.assign({},e),{filtered:uf(e.filtered,t)}):Object.assign(Object.assign({},e),{unfiltered:uf(e.unfiltered,t)}):e}const $n=e=>{var t;return{nodes:{open:{filtered:{},unfiltered:(t=e==null?void 0:e.initialOpenState)!==null&&t!==void 0?t:{}},focus:{id:null,treeFocused:!1},edit:{id:null},drag:{id:null,selectedIds:[],destinationParentId:null,destinationIndex:null},selection:{ids:new Set,anchor:null,mostRecent:null}},dnd:{cursor:{type:"none"},dragId:null,dragIds:[],parentId:null,index:-1}}},Fr={clear:()=>({type:"SELECTION_CLEAR"}),only:e=>({type:"SELECTION_ONLY",id:Fn(e)}),add:e=>({type:"SELECTION_ADD",ids:(Array.isArray(e)?e:[e]).map(Fn)}),remove:e=>({type:"SELECTION_REMOVE",ids:(Array.isArray(e)?e:[e]).map(Fn)}),set:e=>Object.assign({type:"SELECTION_SET"},e),mostRecent:e=>({type:"SELECTION_MOST_RECENT",id:e===null?null:Fn(e)}),anchor:e=>({type:"SELECTION_ANCHOR",id:e===null?null:Fn(e)})};function pw(e=$n().nodes.selection,t){const r=e.ids;switch(t.type){case"SELECTION_CLEAR":return Object.assign(Object.assign({},e),{ids:new Set});case"SELECTION_ONLY":return Object.assign(Object.assign({},e),{ids:new Set([t.id])});case"SELECTION_ADD":return t.ids.length===0?e:(t.ids.forEach(n=>r.add(n)),Object.assign(Object.assign({},e),{ids:new Set(r)}));case"SELECTION_REMOVE":return t.ids.length===0?e:(t.ids.forEach(n=>r.delete(n)),Object.assign(Object.assign({},e),{ids:new Set(r)}));case"SELECTION_SET":return Object.assign(Object.assign({},e),{ids:t.ids,mostRecent:t.mostRecent,anchor:t.anchor});case"SELECTION_MOST_RECENT":return Object.assign(Object.assign({},e),{mostRecent:t.id});case"SELECTION_ANCHOR":return Object.assign(Object.assign({},e),{anchor:t.id});default:return e}}const Bn={cursor(e){return{type:"DND_CURSOR",cursor:e}},dragStart(e,t){return{type:"DND_DRAG_START",id:e,dragIds:t}},dragEnd(){return{type:"DND_DRAG_END"}},hovering(e,t){return{type:"DND_HOVERING",parentId:e,index:t}}};function gw(e=$n().dnd,t){switch(t.type){case"DND_CURSOR":return Object.assign(Object.assign({},e),{cursor:t.cursor});case"DND_DRAG_START":return Object.assign(Object.assign({},e),{dragId:t.id,dragIds:t.dragIds});case"DND_DRAG_END":return $n().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},e),{parentId:t.parentId,index:t.index});default:return e}}const mw={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},vw=e=>{if(!e)return{display:"none"};const{x:t,y:r}=e;return{transform:`translate(${t}px, ${r}px)`}},yw=e=>{if(!e)return{display:"none"};const{x:t,y:r}=e;return{transform:`translate(${t+10}px, ${r+10}px)`}};function ff({offset:e,mouse:t,id:r,dragIds:n,isDragging:o}){return l.jsxs(bw,{isDragging:o,children:[l.jsx(Cw,{offset:e,children:l.jsx(ww,{id:r,dragIds:n})}),l.jsx(Sw,{mouse:t,count:n.length})]})}const bw=p.memo(function(t){return t.isDragging?l.jsx("div",{style:mw,children:t.children}):null});function Cw(e){return l.jsx("div",{className:"row preview",style:vw(e.offset),children:e.children})}function Sw(e){const{count:t,mouse:r}=e;return t>1?l.jsx("div",{className:"selected-count",style:yw(r),children:t}):null}const ww=p.memo(function(t){const r=$t(),n=r.get(t.id);return n?l.jsx(r.renderNode,{preview:!0,node:n,style:{paddingLeft:n.level*r.indent,opacity:.2,background:"transparent"},tree:r}):null});function Gi(){return Gi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Gi.apply(null,arguments)}function hf(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ki(e,t){return Ki=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Ki(e,t)}function _w(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ki(e,t)}var pf=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Tw(e,t){return!!(e===t||pf(e)&&pf(t))}function Ew(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!Tw(e[r],t[r]))return!1;return!0}function Yi(e,t){t===void 0&&(t=Ew);var r,n=[],o,s=!1;function a(){for(var i=[],c=0;c<arguments.length;c++)i[c]=arguments[c];return s&&r===this&&t(i,n)||(o=e.apply(this,i),s=!0,r=this,n=i),o}return a}var Aw=typeof performance=="object"&&typeof performance.now=="function",gf=Aw?function(){return performance.now()}:function(){return Date.now()};function mf(e){cancelAnimationFrame(e.id)}function kw(e,t){var r=gf();function n(){gf()-r>=t?e.call(null):o.id=requestAnimationFrame(n)}var o={id:requestAnimationFrame(n)};return o}var Zi=-1;function vf(e){if(e===void 0&&(e=!1),Zi===-1||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),Zi=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Zi}var qn=null;function yf(e){if(e===void 0&&(e=!1),qn===null||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var n=document.createElement("div"),o=n.style;return o.width="100px",o.height="100px",t.appendChild(n),document.body.appendChild(t),t.scrollLeft>0?qn="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?qn="negative":qn="positive-ascending"),document.body.removeChild(t),qn}return qn}process.env.NODE_ENV;var Iw=150,Dw=function(t,r){return t},sa=null,aa=null;process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof window.WeakSet<"u"&&(sa=new WeakSet,aa=new WeakSet);function bf(e){var t,r=e.getItemOffset,n=e.getEstimatedTotalSize,o=e.getItemSize,s=e.getOffsetForIndexAndAlignment,a=e.getStartIndexForOffset,i=e.getStopIndexForStartIndex,c=e.initInstanceProps,d=e.shouldResetStyleCacheOnItemSizeChange,u=e.validateProps;return t=(function(f){_w(m,f);function m(b){var h;return h=f.call(this,b)||this,h._instanceProps=c(h.props,hf(h)),h._outerRef=void 0,h._resetIsScrollingTimeoutId=null,h.state={instance:hf(h),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof h.props.initialScrollOffset=="number"?h.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},h._callOnItemsRendered=void 0,h._callOnItemsRendered=Yi(function(v,y,C,S){return h.props.onItemsRendered({overscanStartIndex:v,overscanStopIndex:y,visibleStartIndex:C,visibleStopIndex:S})}),h._callOnScroll=void 0,h._callOnScroll=Yi(function(v,y,C){return h.props.onScroll({scrollDirection:v,scrollOffset:y,scrollUpdateWasRequested:C})}),h._getItemStyle=void 0,h._getItemStyle=function(v){var y=h.props,C=y.direction,S=y.itemSize,w=y.layout,T=h._getItemStyleCache(d&&S,d&&w,d&&C),E;if(T.hasOwnProperty(v))E=T[v];else{var L=r(h.props,v,h._instanceProps),A=o(h.props,v,h._instanceProps),x=C==="horizontal"||w==="horizontal",F=C==="rtl",P=x?L:0;T[v]=E={position:"absolute",left:F?void 0:P,right:F?P:void 0,top:x?0:L,height:x?"100%":A,width:x?A:"100%"}}return E},h._getItemStyleCache=void 0,h._getItemStyleCache=Yi(function(v,y,C){return{}}),h._onScrollHorizontal=function(v){var y=v.currentTarget,C=y.clientWidth,S=y.scrollLeft,w=y.scrollWidth;h.setState(function(T){if(T.scrollOffset===S)return null;var E=h.props.direction,L=S;if(E==="rtl")switch(yf()){case"negative":L=-S;break;case"positive-descending":L=w-C-S;break}return L=Math.max(0,Math.min(L,w-C)),{isScrolling:!0,scrollDirection:T.scrollOffset<L?"forward":"backward",scrollOffset:L,scrollUpdateWasRequested:!1}},h._resetIsScrollingDebounced)},h._onScrollVertical=function(v){var y=v.currentTarget,C=y.clientHeight,S=y.scrollHeight,w=y.scrollTop;h.setState(function(T){if(T.scrollOffset===w)return null;var E=Math.max(0,Math.min(w,S-C));return{isScrolling:!0,scrollDirection:T.scrollOffset<E?"forward":"backward",scrollOffset:E,scrollUpdateWasRequested:!1}},h._resetIsScrollingDebounced)},h._outerRefSetter=function(v){var y=h.props.outerRef;h._outerRef=v,typeof y=="function"?y(v):y!=null&&typeof y=="object"&&y.hasOwnProperty("current")&&(y.current=v)},h._resetIsScrollingDebounced=function(){h._resetIsScrollingTimeoutId!==null&&mf(h._resetIsScrollingTimeoutId),h._resetIsScrollingTimeoutId=kw(h._resetIsScrolling,Iw)},h._resetIsScrolling=function(){h._resetIsScrollingTimeoutId=null,h.setState({isScrolling:!1},function(){h._getItemStyleCache(-1,null)})},h}m.getDerivedStateFromProps=function(h,v){return Lw(h,v),u(h),null};var g=m.prototype;return g.scrollTo=function(h){h=Math.max(0,h),this.setState(function(v){return v.scrollOffset===h?null:{scrollDirection:v.scrollOffset<h?"forward":"backward",scrollOffset:h,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},g.scrollToItem=function(h,v){v===void 0&&(v="auto");var y=this.props,C=y.itemCount,S=y.layout,w=this.state.scrollOffset;h=Math.max(0,Math.min(h,C-1));var T=0;if(this._outerRef){var E=this._outerRef;S==="vertical"?T=E.scrollWidth>E.clientWidth?vf():0:T=E.scrollHeight>E.clientHeight?vf():0}this.scrollTo(s(this.props,h,v,w,this._instanceProps,T))},g.componentDidMount=function(){var h=this.props,v=h.direction,y=h.initialScrollOffset,C=h.layout;if(typeof y=="number"&&this._outerRef!=null){var S=this._outerRef;v==="horizontal"||C==="horizontal"?S.scrollLeft=y:S.scrollTop=y}this._callPropsCallbacks()},g.componentDidUpdate=function(){var h=this.props,v=h.direction,y=h.layout,C=this.state,S=C.scrollOffset,w=C.scrollUpdateWasRequested;if(w&&this._outerRef!=null){var T=this._outerRef;if(v==="horizontal"||y==="horizontal")if(v==="rtl")switch(yf()){case"negative":T.scrollLeft=-S;break;case"positive-ascending":T.scrollLeft=S;break;default:var E=T.clientWidth,L=T.scrollWidth;T.scrollLeft=L-E-S;break}else T.scrollLeft=S;else T.scrollTop=S}this._callPropsCallbacks()},g.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&mf(this._resetIsScrollingTimeoutId)},g.render=function(){var h=this.props,v=h.children,y=h.className,C=h.direction,S=h.height,w=h.innerRef,T=h.innerElementType,E=h.innerTagName,L=h.itemCount,A=h.itemData,x=h.itemKey,F=x===void 0?Dw:x,P=h.layout,N=h.outerElementType,M=h.outerTagName,B=h.style,U=h.useIsScrolling,ee=h.width,Q=this.state.isScrolling,te=C==="horizontal"||P==="horizontal",ue=te?this._onScrollHorizontal:this._onScrollVertical,fe=this._getRangeToRender(),pe=fe[0],ie=fe[1],Te=[];if(L>0)for(var ye=pe;ye<=ie;ye++)Te.push(p.createElement(v,{data:A,key:F(ye,A),index:ye,isScrolling:U?Q:void 0,style:this._getItemStyle(ye)}));var $=n(this.props,this._instanceProps);return p.createElement(N||M||"div",{className:y,onScroll:ue,ref:this._outerRefSetter,style:Gi({position:"relative",height:S,width:ee,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:C},B)},p.createElement(T||E||"div",{children:Te,ref:w,style:{height:te?"100%":$,pointerEvents:Q?"none":void 0,width:te?$:"100%"}}))},g._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var h=this.props.itemCount;if(h>0){var v=this._getRangeToRender(),y=v[0],C=v[1],S=v[2],w=v[3];this._callOnItemsRendered(y,C,S,w)}}if(typeof this.props.onScroll=="function"){var T=this.state,E=T.scrollDirection,L=T.scrollOffset,A=T.scrollUpdateWasRequested;this._callOnScroll(E,L,A)}},g._getRangeToRender=function(){var h=this.props,v=h.itemCount,y=h.overscanCount,C=this.state,S=C.isScrolling,w=C.scrollDirection,T=C.scrollOffset;if(v===0)return[0,0,0,0];var E=a(this.props,T,this._instanceProps),L=i(this.props,E,T,this._instanceProps),A=!S||w==="backward"?Math.max(1,y):1,x=!S||w==="forward"?Math.max(1,y):1;return[Math.max(0,E-A),Math.max(0,Math.min(v-1,L+x)),E,L]},m})(p.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var Lw=function(t,r){var n=t.children,o=t.direction,s=t.height,a=t.layout,i=t.innerTagName,c=t.outerTagName,d=t.width,u=r.instance;if(process.env.NODE_ENV!=="production"){(i!=null||c!=null)&&aa&&!aa.has(u)&&(aa.add(u),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var f=o==="horizontal"||a==="horizontal";switch(o){case"horizontal":case"vertical":sa&&!sa.has(u)&&(sa.add(u),console.warn('The direction prop should be either "ltr" (default) or "rtl". Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.'));break;case"ltr":case"rtl":break;default:throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". '+('"'+o+'" was specified.'))}switch(a){case"horizontal":case"vertical":break;default:throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". '+('"'+a+'" was specified.'))}if(n==null)throw Error('An invalid "children" prop has been specified. Value should be a React component. '+('"'+(n===null?"null":typeof n)+'" was specified.'));if(f&&typeof d!="number")throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. '+('"'+(d===null?"null":typeof d)+'" was specified.'));if(!f&&typeof s!="number")throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. '+('"'+(s===null?"null":typeof s)+'" was specified.'))}},Ow=50,jn=function(t,r,n){var o=t,s=o.itemSize,a=n.itemMetadataMap,i=n.lastMeasuredIndex;if(r>i){var c=0;if(i>=0){var d=a[i];c=d.offset+d.size}for(var u=i+1;u<=r;u++){var f=s(u);a[u]={offset:c,size:f},c+=f}n.lastMeasuredIndex=r}return a[r]},Pw=function(t,r,n){var o=r.itemMetadataMap,s=r.lastMeasuredIndex,a=s>0?o[s].offset:0;return a>=n?Cf(t,r,s,0,n):Nw(t,r,Math.max(0,s),n)},Cf=function(t,r,n,o,s){for(;o<=n;){var a=o+Math.floor((n-o)/2),i=jn(t,a,r).offset;if(i===s)return a;i<s?o=a+1:i>s&&(n=a-1)}return o>0?o-1:0},Nw=function(t,r,n,o){for(var s=t.itemCount,a=1;n<s&&jn(t,n,r).offset<o;)n+=a,a*=2;return Cf(t,r,Math.min(n,s-1),Math.floor(n/2),o)},Sf=function(t,r){var n=t.itemCount,o=r.itemMetadataMap,s=r.estimatedItemSize,a=r.lastMeasuredIndex,i=0;if(a>=n&&(a=n-1),a>=0){var c=o[a];i=c.offset+c.size}var d=n-a-1,u=d*s;return i+u},xw=bf({getItemOffset:function(t,r,n){return jn(t,r,n).offset},getItemSize:function(t,r,n){return n.itemMetadataMap[r].size},getEstimatedTotalSize:Sf,getOffsetForIndexAndAlignment:function(t,r,n,o,s,a){var i=t.direction,c=t.height,d=t.layout,u=t.width,f=i==="horizontal"||d==="horizontal",m=f?u:c,g=jn(t,r,s),b=Sf(t,s),h=Math.max(0,Math.min(b-m,g.offset)),v=Math.max(0,g.offset-m+g.size+a);switch(n==="smart"&&(o>=v-m&&o<=h+m?n="auto":n="center"),n){case"start":return h;case"end":return v;case"center":return Math.round(v+(h-v)/2);case"auto":default:return o>=v&&o<=h?o:o<v?v:h}},getStartIndexForOffset:function(t,r,n){return Pw(t,n,r)},getStopIndexForStartIndex:function(t,r,n,o){for(var s=t.direction,a=t.height,i=t.itemCount,c=t.layout,d=t.width,u=s==="horizontal"||c==="horizontal",f=u?d:a,m=jn(t,r,o),g=n+f,b=m.offset+m.size,h=r;h<i-1&&b<g;)h++,b+=jn(t,h,o).size;return h},initInstanceProps:function(t,r){var n=t,o=n.estimatedItemSize,s={itemMetadataMap:{},estimatedItemSize:o||Ow,lastMeasuredIndex:-1};return r.resetAfterIndex=function(a,i){i===void 0&&(i=!0),s.lastMeasuredIndex=Math.min(s.lastMeasuredIndex,a-1),r._getItemStyleCache(-1),i&&r.forceUpdate()},s},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(t){var r=t.itemSize;if(process.env.NODE_ENV!=="production"&&typeof r!="function")throw Error('An invalid "itemSize" prop has been specified. Value should be a function. '+('"'+(r===null?"null":typeof r)+'" was specified.'))}}),Fw=bf({getItemOffset:function(t,r){var n=t.itemSize;return r*n},getItemSize:function(t,r){var n=t.itemSize;return n},getEstimatedTotalSize:function(t){var r=t.itemCount,n=t.itemSize;return n*r},getOffsetForIndexAndAlignment:function(t,r,n,o,s,a){var i=t.direction,c=t.height,d=t.itemCount,u=t.itemSize,f=t.layout,m=t.width,g=i==="horizontal"||f==="horizontal",b=g?m:c,h=Math.max(0,d*u-b),v=Math.min(h,r*u),y=Math.max(0,r*u-b+u+a);switch(n==="smart"&&(o>=y-b&&o<=v+b?n="auto":n="center"),n){case"start":return v;case"end":return y;case"center":{var C=Math.round(y+(v-y)/2);return C<Math.ceil(b/2)?0:C>h+Math.floor(b/2)?h:C}case"auto":default:return o>=y&&o<=v?o:o<y?y:v}},getStartIndexForOffset:function(t,r){var n=t.itemCount,o=t.itemSize;return Math.max(0,Math.min(n-1,Math.floor(r/o)))},getStopIndexForStartIndex:function(t,r,n){var o=t.direction,s=t.height,a=t.itemCount,i=t.itemSize,c=t.layout,d=t.width,u=o==="horizontal"||c==="horizontal",f=r*i,m=u?d:s,g=Math.ceil((m+n-f)/i);return Math.max(0,Math.min(a-1,r+g-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){var r=t.itemSize;if(process.env.NODE_ENV!=="production"&&typeof r!="number")throw Error('An invalid "itemSize" prop has been specified. Value should be a number. '+('"'+(r===null?"null":typeof r)+'" was specified.'))}});function Mw(){var e,t;const r=$t(),o=ZS().cursor;if(!o||o.type!=="line")return null;const s=r.indent,a=r.rowTopPosition(o.index)+((t=(e=r.props.padding)!==null&&e!==void 0?e:r.props.paddingTop)!==null&&t!==void 0?t:0),i=s*o.level,c=r.renderCursor;return l.jsx(c,{top:a,left:i,indent:s})}var $w=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};const Bw=p.forwardRef(function(t,r){const{children:n}=t,o=$w(t,["children"]),s=$t();return l.jsxs("div",Object.assign({ref:r},o,{onClick:a=>{a.currentTarget===a.target&&s.deselectAll()},children:[l.jsx(qw,{}),n]}))}),qw=()=>{const e=$t();return l.jsx("div",{style:{height:e.rowTopPosition(e.visibleNodes.length),width:"100%",position:"absolute",left:"0",right:"0"},children:l.jsx(Mw,{})})};var jw=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};const Uw=p.forwardRef(function(t,r){var n,o,s,a,{style:i}=t,c=jw(t,["style"]);const d=$t(),u=(o=(n=d.props.padding)!==null&&n!==void 0?n:d.props.paddingTop)!==null&&o!==void 0?o:0,f=(a=(s=d.props.padding)!==null&&s!==void 0?s:d.props.paddingBottom)!==null&&a!==void 0?a:0;return l.jsx("div",Object.assign({ref:r,style:Object.assign(Object.assign({},i),{height:`${parseFloat(i.height)+u+f}px`})},c))});var wf=p.createContext({dragDropManager:void 0}),Rt;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Rt||(Rt={}));function _e(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];if(process.env.NODE_ENV!=="production"&&t===void 0)throw new Error("invariant requires an error message argument");if(!e){var s;if(t===void 0)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=0;s=new Error(t.replace(/%s/g,function(){return n[a++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}var Xi="dnd-core/INIT_COORDS",ia="dnd-core/BEGIN_DRAG",Ji="dnd-core/PUBLISH_DRAG_SOURCE",la="dnd-core/HOVER",ca="dnd-core/DROP",da="dnd-core/END_DRAG";function _f(e,t){return{type:Xi,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}function ua(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ua=function(r){return typeof r}:ua=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ua(e)}function zw(e,t,r){return t.split(".").reduce(function(n,o){return n&&n[o]?n[o]:r||null},e)}function Vw(e,t){return e.filter(function(r){return r!==t})}function Tf(e){return ua(e)==="object"}function Hw(e,t){var r=new Map,n=function(a){r.set(a,r.has(a)?r.get(a)+1:1)};e.forEach(n),t.forEach(n);var o=[];return r.forEach(function(s,a){s===1&&o.push(a)}),o}function Qw(e,t){return e.filter(function(r){return t.indexOf(r)>-1})}var Ww={type:Xi,payload:{clientOffset:null,sourceClientOffset:null}};function Rw(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{publishSource:!0},o=n.publishSource,s=o===void 0?!0:o,a=n.clientOffset,i=n.getSourceClientOffset,c=e.getMonitor(),d=e.getRegistry();e.dispatch(_f(a)),Gw(r,c,d);var u=Zw(r,c);if(u===null){e.dispatch(Ww);return}var f=null;if(a){if(!i)throw new Error("getSourceClientOffset must be defined");Kw(i),f=i(u)}e.dispatch(_f(a,f));var m=d.getSource(u),g=m.beginDrag(c,u);if(g!=null){Yw(g),d.pinSource(u);var b=d.getSourceType(u);return{type:ia,payload:{itemType:b,item:g,sourceId:u,clientOffset:a||null,sourceClientOffset:f||null,isSourcePublic:!!s}}}}}function Gw(e,t,r){_e(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(n){_e(r.getSource(n),"Expected sourceIds to be registered.")})}function Kw(e){_e(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function Yw(e){_e(Tf(e),"Item must be an object.")}function Zw(e,t){for(var r=null,n=e.length-1;n>=0;n--)if(t.canDragSource(e[n])){r=e[n];break}return r}function Xw(e){return function(){var r=e.getMonitor();if(r.isDragging())return{type:Ji}}}function el(e,t){return t===null?e===null:Array.isArray(e)?e.some(function(r){return r===t}):e===t}function Jw(e){return function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=n.clientOffset;e_(r);var s=r.slice(0),a=e.getMonitor(),i=e.getRegistry();t_(s,a,i);var c=a.getItemType();return r_(s,i,c),n_(s,a,i),{type:la,payload:{targetIds:s,clientOffset:o||null}}}}function e_(e){_e(Array.isArray(e),"Expected targetIds to be an array.")}function t_(e,t,r){_e(t.isDragging(),"Cannot call hover while not dragging."),_e(!t.didDrop(),"Cannot call hover after drop.");for(var n=0;n<e.length;n++){var o=e[n];_e(e.lastIndexOf(o)===n,"Expected targetIds to be unique in the passed array.");var s=r.getTarget(o);_e(s,"Expected targetIds to be registered.")}}function r_(e,t,r){for(var n=e.length-1;n>=0;n--){var o=e[n],s=t.getTargetType(o);el(s,r)||e.splice(n,1)}}function n_(e,t,r){e.forEach(function(n){var o=r.getTarget(n);o.hover(t,n)})}function Ef(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Af(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ef(Object(r),!0).forEach(function(n){o_(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ef(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function o_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s_(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.getMonitor(),o=e.getRegistry();a_(n);var s=c_(n);s.forEach(function(a,i){var c=i_(a,i,o,n),d={type:ca,payload:{dropResult:Af(Af({},r),c)}};e.dispatch(d)})}}function a_(e){_e(e.isDragging(),"Cannot call drop while not dragging."),_e(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function i_(e,t,r,n){var o=r.getTarget(e),s=o?o.drop(n,e):void 0;return l_(s),typeof s>"u"&&(s=t===0?{}:n.getDropResult()),s}function l_(e){_e(typeof e>"u"||Tf(e),"Drop result must either be an object or undefined.")}function c_(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function d_(e){return function(){var r=e.getMonitor(),n=e.getRegistry();u_(r);var o=r.getSourceId();if(o!=null){var s=n.getSource(o,!0);s.endDrag(r,o),n.unpinSource()}return{type:da}}}function u_(e){_e(e.isDragging(),"Cannot call endDrag while not dragging.")}function f_(e){return{beginDrag:Rw(e),publishDragSource:Xw(e),hover:Jw(e),drop:s_(e),endDrag:d_(e)}}function h_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p_(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function g_(e,t,r){return t&&p_(e.prototype,t),e}function jo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var m_=(function(){function e(t,r){var n=this;h_(this,e),jo(this,"store",void 0),jo(this,"monitor",void 0),jo(this,"backend",void 0),jo(this,"isSetUp",!1),jo(this,"handleRefCountChange",function(){var o=n.store.getState().refCount>0;n.backend&&(o&&!n.isSetUp?(n.backend.setup(),n.isSetUp=!0):!o&&n.isSetUp&&(n.backend.teardown(),n.isSetUp=!1))}),this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}return g_(e,[{key:"receiveBackend",value:function(r){this.backend=r}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var r=this,n=this.store.dispatch;function o(a){return function(){for(var i=arguments.length,c=new Array(i),d=0;d<i;d++)c[d]=arguments[d];var u=a.apply(r,c);typeof u<"u"&&n(u)}}var s=f_(this);return Object.keys(s).reduce(function(a,i){var c=s[i];return a[i]=o(c),a},{})}},{key:"dispatch",value:function(r){this.store.dispatch(r)}}]),e})();function Gt(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var kf=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),If=function(){return Math.random().toString(36).substring(7).split("").join(".")},Df={INIT:"@@redux/INIT"+If(),REPLACE:"@@redux/REPLACE"+If()};function v_(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function y_(e){if(e===void 0)return"undefined";if(e===null)return"null";var t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(S_(e))return"date";if(C_(e))return"error";var r=b_(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}function b_(e){return typeof e.constructor=="function"?e.constructor.name:null}function C_(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function S_(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Un(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=y_(e)),t}function Lf(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?Gt(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?Gt(1):"Expected the enhancer to be a function. Instead, received: '"+Un(r)+"'");return r(Lf)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?Gt(2):"Expected the root reducer to be a function. Instead, received: '"+Un(e)+"'");var o=e,s=t,a=[],i=a,c=!1;function d(){i===a&&(i=a.slice())}function u(){if(c)throw new Error(process.env.NODE_ENV==="production"?Gt(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return s}function f(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?Gt(4):"Expected the listener to be a function. Instead, received: '"+Un(h)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?Gt(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var v=!0;return d(),i.push(h),function(){if(v){if(c)throw new Error(process.env.NODE_ENV==="production"?Gt(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");v=!1,d();var C=i.indexOf(h);i.splice(C,1),a=null}}}function m(h){if(!v_(h))throw new Error(process.env.NODE_ENV==="production"?Gt(7):"Actions must be plain objects. Instead, the actual type was: '"+Un(h)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof h.type>"u")throw new Error(process.env.NODE_ENV==="production"?Gt(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(c)throw new Error(process.env.NODE_ENV==="production"?Gt(9):"Reducers may not dispatch actions.");try{c=!0,s=o(s,h)}finally{c=!1}for(var v=a=i,y=0;y<v.length;y++){var C=v[y];C()}return h}function g(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?Gt(10):"Expected the nextReducer to be a function. Instead, received: '"+Un(h));o=h,m({type:Df.REPLACE})}function b(){var h,v=f;return h={subscribe:function(C){if(typeof C!="object"||C===null)throw new Error(process.env.NODE_ENV==="production"?Gt(11):"Expected the observer to be an object. Instead, received: '"+Un(C)+"'");function S(){C.next&&C.next(u())}S();var w=v(S);return{unsubscribe:w}}},h[kf]=function(){return this},h}return m({type:Df.INIT}),n={dispatch:m,subscribe:f,getState:u,replaceReducer:g},n[kf]=b,n}var w_=function(t,r){return t===r};function __(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function T_(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:w_;if(e.length!==t.length)return!1;for(var n=0;n<e.length;++n)if(!r(e[n],t[n]))return!1;return!0}function Of(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Pf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Of(Object(r),!0).forEach(function(n){E_(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Of(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function E_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Nf={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function A_(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Nf,t=arguments.length>1?arguments[1]:void 0,r=t.payload;switch(t.type){case Xi:case ia:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case la:return __(e.clientOffset,r.clientOffset)?e:Pf(Pf({},e),{},{clientOffset:r.clientOffset});case da:case ca:return Nf;default:return e}}var tl="dnd-core/ADD_SOURCE",rl="dnd-core/ADD_TARGET",nl="dnd-core/REMOVE_SOURCE",fa="dnd-core/REMOVE_TARGET";function k_(e){return{type:tl,payload:{sourceId:e}}}function I_(e){return{type:rl,payload:{targetId:e}}}function D_(e){return{type:nl,payload:{sourceId:e}}}function L_(e){return{type:fa,payload:{targetId:e}}}function xf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Kt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?xf(Object(r),!0).forEach(function(n){O_(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function O_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var P_={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function N_(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:P_,t=arguments.length>1?arguments[1]:void 0,r=t.payload;switch(t.type){case ia:return Kt(Kt({},e),{},{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case Ji:return Kt(Kt({},e),{},{isSourcePublic:!0});case la:return Kt(Kt({},e),{},{targetIds:r.targetIds});case fa:return e.targetIds.indexOf(r.targetId)===-1?e:Kt(Kt({},e),{},{targetIds:Vw(e.targetIds,r.targetId)});case ca:return Kt(Kt({},e),{},{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case da:return Kt(Kt({},e),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function x_(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case tl:case rl:return e+1;case nl:case fa:return e-1;default:return e}}var ha=[],ol=[];ha.__IS_NONE__=!0,ol.__IS_ALL__=!0;function F_(e,t){if(e===ha)return!1;if(e===ol||typeof t>"u")return!0;var r=Qw(t,e);return r.length>0}function M_(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case la:break;case tl:case rl:case fa:case nl:return ha;case ia:case Ji:case da:case ca:default:return ol}var t=e.payload,r=t.targetIds,n=r===void 0?[]:r,o=t.prevTargetIds,s=o===void 0?[]:o,a=Hw(n,s),i=a.length>0||!T_(n,s);if(!i)return ha;var c=s[s.length-1],d=n[n.length-1];return c!==d&&(c&&a.push(c),d&&a.push(d)),a}function $_(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e+1}function Ff(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Mf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ff(Object(r),!0).forEach(function(n){B_(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ff(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function B_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function q_(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:M_(e.dirtyHandlerIds,{type:t.type,payload:Mf(Mf({},t.payload),{},{prevTargetIds:zw(e,"dragOperation.targetIds",[])})}),dragOffset:A_(e.dragOffset,t),refCount:x_(e.refCount,t),dragOperation:N_(e.dragOperation,t),stateId:$_(e.stateId)}}function j_(e,t){return{x:e.x+t.x,y:e.y+t.y}}function $f(e,t){return{x:e.x-t.x,y:e.y-t.y}}function U_(e){var t=e.clientOffset,r=e.initialClientOffset,n=e.initialSourceClientOffset;return!t||!r||!n?null:$f(j_(t,n),r)}function z_(e){var t=e.clientOffset,r=e.initialClientOffset;return!t||!r?null:$f(t,r)}function V_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function H_(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Q_(e,t,r){return t&&H_(e.prototype,t),e}function Bf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var W_=(function(){function e(t,r){V_(this,e),Bf(this,"store",void 0),Bf(this,"registry",void 0),this.store=t,this.registry=r}return Q_(e,[{key:"subscribeToStateChange",value:function(r){var n=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0},s=o.handlerIds;_e(typeof r=="function","listener must be a function."),_e(typeof s>"u"||Array.isArray(s),"handlerIds, when specified, must be an array of strings.");var a=this.store.getState().stateId,i=function(){var d=n.store.getState(),u=d.stateId;try{var f=u===a||u===a+1&&!F_(d.dirtyHandlerIds,s);f||r()}finally{a=u}};return this.store.subscribe(i)}},{key:"subscribeToOffsetChange",value:function(r){var n=this;_e(typeof r=="function","listener must be a function.");var o=this.store.getState().dragOffset,s=function(){var i=n.store.getState().dragOffset;i!==o&&(o=i,r())};return this.store.subscribe(s)}},{key:"canDragSource",value:function(r){if(!r)return!1;var n=this.registry.getSource(r);return _e(n,"Expected to find a valid source. sourceId=".concat(r)),this.isDragging()?!1:n.canDrag(this,r)}},{key:"canDropOnTarget",value:function(r){if(!r)return!1;var n=this.registry.getTarget(r);if(_e(n,"Expected to find a valid target. targetId=".concat(r)),!this.isDragging()||this.didDrop())return!1;var o=this.registry.getTargetType(r),s=this.getItemType();return el(o,s)&&n.canDrop(this,r)}},{key:"isDragging",value:function(){return!!this.getItemType()}},{key:"isDraggingSource",value:function(r){if(!r)return!1;var n=this.registry.getSource(r,!0);if(_e(n,"Expected to find a valid source. sourceId=".concat(r)),!this.isDragging()||!this.isSourcePublic())return!1;var o=this.registry.getSourceType(r),s=this.getItemType();return o!==s?!1:n.isDragging(this,r)}},{key:"isOverTarget",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shallow:!1};if(!r)return!1;var o=n.shallow;if(!this.isDragging())return!1;var s=this.registry.getTargetType(r),a=this.getItemType();if(a&&!el(s,a))return!1;var i=this.getTargetIds();if(!i.length)return!1;var c=i.indexOf(r);return o?c===i.length-1:c>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return!!this.store.getState().dragOperation.isSourcePublic}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return U_(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return z_(this.store.getState().dragOffset)}}]),e})(),R_=0;function G_(){return R_++}function pa(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?pa=function(r){return typeof r}:pa=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},pa(e)}function K_(e){_e(typeof e.canDrag=="function","Expected canDrag to be a function."),_e(typeof e.beginDrag=="function","Expected beginDrag to be a function."),_e(typeof e.endDrag=="function","Expected endDrag to be a function.")}function Y_(e){_e(typeof e.canDrop=="function","Expected canDrop to be a function."),_e(typeof e.hover=="function","Expected hover to be a function."),_e(typeof e.drop=="function","Expected beginDrag to be a function.")}function sl(e,t){if(t&&Array.isArray(e)){e.forEach(function(r){return sl(r,!1)});return}_e(typeof e=="string"||pa(e)==="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}const qf=typeof global<"u"?global:self,jf=qf.MutationObserver||qf.WebKitMutationObserver;function Uf(e){return function(){const r=setTimeout(o,0),n=setInterval(o,50);function o(){clearTimeout(r),clearInterval(n),e()}}}function Z_(e){let t=1;const r=new jf(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const X_=typeof jf=="function"?Z_:Uf;class J_{enqueueTask(t){const{queue:r,requestFlush:n}=this;r.length||(n(),this.flushing=!0),r[r.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.index<t.length;){const r=this.index;if(this.index++,t[r].call(),this.index>this.capacity){for(let n=0,o=t.length-this.index;n<o;n++)t[n]=t[n+this.index];t.length-=this.index,this.index=0}}t.length=0,this.index=0,this.flushing=!1},this.registerPendingError=t=>{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=X_(this.flush),this.requestErrorThrow=Uf(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class e1{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,r){this.onError=t,this.release=r,this.task=null}}class t1{create(t){const r=this.freeTasks,n=r.length?r.pop():new e1(this.onError,o=>r[r.length]=o);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}const zf=new J_,r1=new t1(zf.registerPendingError);function n1(e){zf.enqueueTask(r1.create(e))}function o1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function a1(e,t,r){return t&&s1(e.prototype,t),e}function zn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i1(e,t){return u1(e)||d1(e,t)||c1(e,t)||l1()}function l1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
537
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function c1(e,t){if(e){if(typeof e=="string")return Vf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Vf(e,t)}}function Vf(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function d1(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,s=!1,a,i;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(c){s=!0,i=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(s)throw i}}return n}}function u1(e){if(Array.isArray(e))return e}function f1(e){var t=G_().toString();switch(e){case Rt.SOURCE:return"S".concat(t);case Rt.TARGET:return"T".concat(t);default:throw new Error("Unknown Handler Role: ".concat(e))}}function Hf(e){switch(e[0]){case"S":return Rt.SOURCE;case"T":return Rt.TARGET;default:_e(!1,"Cannot parse handler ID: ".concat(e))}}function Qf(e,t){var r=e.entries(),n=!1;do{var o=r.next(),s=o.done,a=i1(o.value,2),i=a[1];if(i===t)return!0;n=!!s}while(!n);return!1}var h1=(function(){function e(t){o1(this,e),zn(this,"types",new Map),zn(this,"dragSources",new Map),zn(this,"dropTargets",new Map),zn(this,"pinnedSourceId",null),zn(this,"pinnedSource",null),zn(this,"store",void 0),this.store=t}return a1(e,[{key:"addSource",value:function(r,n){sl(r),K_(n);var o=this.addHandler(Rt.SOURCE,r,n);return this.store.dispatch(k_(o)),o}},{key:"addTarget",value:function(r,n){sl(r,!0),Y_(n);var o=this.addHandler(Rt.TARGET,r,n);return this.store.dispatch(I_(o)),o}},{key:"containsHandler",value:function(r){return Qf(this.dragSources,r)||Qf(this.dropTargets,r)}},{key:"getSource",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;_e(this.isSourceId(r),"Expected a valid source ID.");var o=n&&r===this.pinnedSourceId,s=o?this.pinnedSource:this.dragSources.get(r);return s}},{key:"getTarget",value:function(r){return _e(this.isTargetId(r),"Expected a valid target ID."),this.dropTargets.get(r)}},{key:"getSourceType",value:function(r){return _e(this.isSourceId(r),"Expected a valid source ID."),this.types.get(r)}},{key:"getTargetType",value:function(r){return _e(this.isTargetId(r),"Expected a valid target ID."),this.types.get(r)}},{key:"isSourceId",value:function(r){var n=Hf(r);return n===Rt.SOURCE}},{key:"isTargetId",value:function(r){var n=Hf(r);return n===Rt.TARGET}},{key:"removeSource",value:function(r){var n=this;_e(this.getSource(r),"Expected an existing source."),this.store.dispatch(D_(r)),n1(function(){n.dragSources.delete(r),n.types.delete(r)})}},{key:"removeTarget",value:function(r){_e(this.getTarget(r),"Expected an existing target."),this.store.dispatch(L_(r)),this.dropTargets.delete(r),this.types.delete(r)}},{key:"pinSource",value:function(r){var n=this.getSource(r);_e(n,"Expected an existing source."),this.pinnedSourceId=r,this.pinnedSource=n}},{key:"unpinSource",value:function(){_e(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(r,n,o){var s=f1(r);return this.types.set(s,n),r===Rt.SOURCE?this.dragSources.set(s,o):r===Rt.TARGET&&this.dropTargets.set(s,o),s}}]),e})();function p1(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=g1(n),s=new W_(o,new h1(o)),a=new m_(o,s),i=e(a,t,r);return a.receiveBackend(i),a}function g1(e){var t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Lf(q_,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}var m1=["children"];function v1(e,t){return S1(e)||C1(e,t)||b1(e,t)||y1()}function y1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
538
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function b1(e,t){if(e){if(typeof e=="string")return Wf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Wf(e,t)}}function Wf(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function C1(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,s=!1,a,i;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(c){s=!0,i=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(s)throw i}}return n}}function S1(e){if(Array.isArray(e))return e}function w1(e,t){if(e==null)return{};var r=_1(e,t),n,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)n=s[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _1(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,s;for(s=0;s<n.length;s++)o=n[s],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}var Rf=0,ga=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),T1=p.memo(function(t){var r=t.children,n=w1(t,m1),o=E1(n),s=v1(o,2),a=s[0],i=s[1];return p.useEffect(function(){if(i){var c=Gf();return++Rf,function(){--Rf===0&&(c[ga]=null)}}},[]),l.jsx(wf.Provider,Object.assign({value:a},{children:r}),void 0)});function E1(e){if("manager"in e){var t={dragDropManager:e.manager};return[t,!1]}var r=A1(e.backend,e.context,e.options,e.debugMode),n=!e.context;return[r,n]}function A1(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Gf(),r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,o=t;return o[ga]||(o[ga]={dragDropManager:p1(e,t,r,n)}),o[ga]}function Gf(){return typeof global<"u"?global:window}function k1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function I1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function D1(e,t,r){return t&&I1(e.prototype,t),e}function Kf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var al=!1,il=!1,L1=(function(){function e(t){k1(this,e),Kf(this,"internalMonitor",void 0),Kf(this,"sourceId",null),this.internalMonitor=t.getMonitor()}return D1(e,[{key:"receiveHandlerId",value:function(r){this.sourceId=r}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){_e(!al,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return al=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{al=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;_e(!il,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return il=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{il=!1}}},{key:"subscribeToStateChange",value:function(r,n){return this.internalMonitor.subscribeToStateChange(r,n)}},{key:"isDraggingSource",value:function(r){return this.internalMonitor.isDraggingSource(r)}},{key:"isOverTarget",value:function(r,n){return this.internalMonitor.isOverTarget(r,n)}},{key:"getTargetIds",value:function(){return this.internalMonitor.getTargetIds()}},{key:"isSourcePublic",value:function(){return this.internalMonitor.isSourcePublic()}},{key:"getSourceId",value:function(){return this.internalMonitor.getSourceId()}},{key:"subscribeToOffsetChange",value:function(r){return this.internalMonitor.subscribeToOffsetChange(r)}},{key:"canDragSource",value:function(r){return this.internalMonitor.canDragSource(r)}},{key:"canDropOnTarget",value:function(r){return this.internalMonitor.canDropOnTarget(r)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),e})();function O1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function P1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function N1(e,t,r){return t&&P1(e.prototype,t),e}function Yf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ll=!1,x1=(function(){function e(t){O1(this,e),Yf(this,"internalMonitor",void 0),Yf(this,"targetId",null),this.internalMonitor=t.getMonitor()}return N1(e,[{key:"receiveHandlerId",value:function(r){this.targetId=r}},{key:"getHandlerId",value:function(){return this.targetId}},{key:"subscribeToStateChange",value:function(r,n){return this.internalMonitor.subscribeToStateChange(r,n)}},{key:"canDrop",value:function(){if(!this.targetId)return!1;_e(!ll,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return ll=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{ll=!1}}},{key:"isOver",value:function(r){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,r):!1}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),e})();function F1(e){if(typeof e.type!="string"){var t=e.type.displayName||e.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors."+"You can either wrap ".concat(t," into a <div>, or turn it into a ")+"drag source or a drop target itself.")}}function M1(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!p.isValidElement(t)){var n=t;return e(n,r),n}var o=t;F1(o);var s=r?function(a){return e(a,r)}:e;return $1(o,s)}}function Zf(e){var t={};return Object.keys(e).forEach(function(r){var n=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{var o=M1(n);t[r]=function(){return o}}}),t}function Xf(e,t){typeof e=="function"?e(t):e.current=t}function $1(e,t){var r=e.ref;return _e(typeof r!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?p.cloneElement(e,{ref:function(o){Xf(r,o),Xf(t,o)}}):p.cloneElement(e,{ref:t})}function ma(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ma=function(r){return typeof r}:ma=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ma(e)}function cl(e){return e!==null&&ma(e)==="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function dl(e,t,r,n){var o=void 0;if(o!==void 0)return!!o;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;var s=Object.keys(e),a=Object.keys(t);if(s.length!==a.length)return!1;for(var i=Object.prototype.hasOwnProperty.bind(t),c=0;c<s.length;c++){var d=s[c];if(!i(d))return!1;var u=e[d],f=t[d];if(o=void 0,o===!1||o===void 0&&u!==f)return!1}return!0}function B1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function q1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function j1(e,t,r){return t&&q1(e.prototype,t),e}function Tt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var U1=(function(){function e(t){var r=this;B1(this,e),Tt(this,"hooks",Zf({dragSource:function(o,s){r.clearDragSource(),r.dragSourceOptions=s||null,cl(o)?r.dragSourceRef=o:r.dragSourceNode=o,r.reconnectDragSource()},dragPreview:function(o,s){r.clearDragPreview(),r.dragPreviewOptions=s||null,cl(o)?r.dragPreviewRef=o:r.dragPreviewNode=o,r.reconnectDragPreview()}})),Tt(this,"handlerId",null),Tt(this,"dragSourceRef",null),Tt(this,"dragSourceNode",void 0),Tt(this,"dragSourceOptionsInternal",null),Tt(this,"dragSourceUnsubscribe",void 0),Tt(this,"dragPreviewRef",null),Tt(this,"dragPreviewNode",void 0),Tt(this,"dragPreviewOptionsInternal",null),Tt(this,"dragPreviewUnsubscribe",void 0),Tt(this,"lastConnectedHandlerId",null),Tt(this,"lastConnectedDragSource",null),Tt(this,"lastConnectedDragSourceOptions",null),Tt(this,"lastConnectedDragPreview",null),Tt(this,"lastConnectedDragPreviewOptions",null),Tt(this,"backend",void 0),this.backend=t}return j1(e,[{key:"receiveHandlerId",value:function(r){this.handlerId!==r&&(this.handlerId=r,this.reconnect())}},{key:"connectTarget",get:function(){return this.dragSource}},{key:"dragSourceOptions",get:function(){return this.dragSourceOptionsInternal},set:function(r){this.dragSourceOptionsInternal=r}},{key:"dragPreviewOptions",get:function(){return this.dragPreviewOptionsInternal},set:function(r){this.dragPreviewOptionsInternal=r}},{key:"reconnect",value:function(){this.reconnectDragSource(),this.reconnectDragPreview()}},{key:"reconnectDragSource",value:function(){var r=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();if(n&&this.disconnectDragSource(),!!this.handlerId){if(!r){this.lastConnectedDragSource=r;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=r,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,r,this.dragSourceOptions))}}},{key:"reconnectDragPreview",value:function(){var r=this.dragPreview,n=this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(n&&this.disconnectDragPreview(),!!this.handlerId){if(!r){this.lastConnectedDragPreview=r;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=r,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,r,this.dragPreviewOptions))}}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didConnectedDragSourceChange",value:function(){return this.lastConnectedDragSource!==this.dragSource}},{key:"didConnectedDragPreviewChange",value:function(){return this.lastConnectedDragPreview!==this.dragPreview}},{key:"didDragSourceOptionsChange",value:function(){return!dl(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!dl(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}},{key:"disconnectDragSource",value:function(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}},{key:"disconnectDragPreview",value:function(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}},{key:"dragSource",get:function(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}},{key:"dragPreview",get:function(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}},{key:"clearDragSource",value:function(){this.dragSourceNode=null,this.dragSourceRef=null}},{key:"clearDragPreview",value:function(){this.dragPreviewNode=null,this.dragPreviewRef=null}}]),e})();function z1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function V1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function H1(e,t,r){return t&&V1(e.prototype,t),e}function pr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Q1=(function(){function e(t){var r=this;z1(this,e),pr(this,"hooks",Zf({dropTarget:function(o,s){r.clearDropTarget(),r.dropTargetOptions=s,cl(o)?r.dropTargetRef=o:r.dropTargetNode=o,r.reconnect()}})),pr(this,"handlerId",null),pr(this,"dropTargetRef",null),pr(this,"dropTargetNode",void 0),pr(this,"dropTargetOptionsInternal",null),pr(this,"unsubscribeDropTarget",void 0),pr(this,"lastConnectedHandlerId",null),pr(this,"lastConnectedDropTarget",null),pr(this,"lastConnectedDropTargetOptions",null),pr(this,"backend",void 0),this.backend=t}return H1(e,[{key:"connectTarget",get:function(){return this.dropTarget}},{key:"reconnect",value:function(){var r=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();r&&this.disconnectDropTarget();var n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions))}}},{key:"receiveHandlerId",value:function(r){r!==this.handlerId&&(this.handlerId=r,this.reconnect())}},{key:"dropTargetOptions",get:function(){return this.dropTargetOptionsInternal},set:function(r){this.dropTargetOptionsInternal=r}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didDropTargetChange",value:function(){return this.lastConnectedDropTarget!==this.dropTarget}},{key:"didOptionsChange",value:function(){return!dl(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}},{key:"disconnectDropTarget",value:function(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}},{key:"dropTarget",get:function(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}},{key:"clearDropTarget",value:function(){this.dropTargetRef=null,this.dropTargetNode=null}}]),e})();function W1(e,t,r){var n=r.getRegistry(),o=n.addTarget(e,t);return[o,function(){return n.removeTarget(o)}]}function R1(e,t,r){var n=r.getRegistry(),o=n.addSource(e,t);return[o,function(){return n.removeSource(o)}]}var on=typeof window<"u"?p.useLayoutEffect:p.useEffect;function va(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?va=function(r){return typeof r}:va=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},va(e)}function G1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function K1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Y1(e,t,r){return t&&K1(e.prototype,t),e}function ul(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Z1=(function(){function e(t,r,n){G1(this,e),ul(this,"spec",void 0),ul(this,"monitor",void 0),ul(this,"connector",void 0),this.spec=t,this.monitor=r,this.connector=n}return Y1(e,[{key:"beginDrag",value:function(){var r,n=this.spec,o=this.monitor,s=null;return va(n.item)==="object"?s=n.item:typeof n.item=="function"?s=n.item(o):s={},(r=s)!==null&&r!==void 0?r:null}},{key:"canDrag",value:function(){var r=this.spec,n=this.monitor;return typeof r.canDrag=="boolean"?r.canDrag:typeof r.canDrag=="function"?r.canDrag(n):!0}},{key:"isDragging",value:function(r,n){var o=this.spec,s=this.monitor,a=o.isDragging;return a?a(s):n===r.getSourceId()}},{key:"endDrag",value:function(){var r=this.spec,n=this.monitor,o=this.connector,s=r.end;s&&s(n.getItem(),n),o.reconnect()}}]),e})();function X1(e,t,r){var n=p.useMemo(function(){return new Z1(e,t,r)},[t,r]);return p.useEffect(function(){n.spec=e},[e]),n}function sn(){var e=p.useContext(wf),t=e.dragDropManager;return _e(t!=null,"Expected drag drop context"),t}function J1(e){return p.useMemo(function(){var t=e.type;return _e(t!=null,"spec.type must be defined"),t},[e])}function e0(e,t){return o0(e)||n0(e,t)||r0(e,t)||t0()}function t0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
539
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function r0(e,t){if(e){if(typeof e=="string")return Jf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Jf(e,t)}}function Jf(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function n0(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,s=!1,a,i;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(c){s=!0,i=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(s)throw i}}return n}}function o0(e){if(Array.isArray(e))return e}function s0(e,t,r){var n=sn(),o=X1(e,t,r),s=J1(e);on(function(){if(s!=null){var i=R1(s,o,n),c=e0(i,2),d=c[0],u=c[1];return t.receiveHandlerId(d),r.receiveHandlerId(d),u}},[n,t,r,o,s])}function a0(e){return d0(e)||c0(e)||l0(e)||i0()}function i0(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
540
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function l0(e,t){if(e){if(typeof e=="string")return fl(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fl(e,t)}}function c0(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function d0(e){if(Array.isArray(e))return fl(e)}function fl(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function eh(e,t){var r=a0(t||[]);return t==null&&typeof e!="function"&&r.push(e),p.useMemo(function(){return typeof e=="function"?e():e},r)}function u0(){var e=sn();return p.useMemo(function(){return new L1(e)},[e])}function f0(e,t){var r=sn(),n=p.useMemo(function(){return new U1(r.getBackend())},[r]);return on(function(){return n.dragSourceOptions=e||null,n.reconnect(),function(){return n.disconnectDragSource()}},[n,e]),on(function(){return n.dragPreviewOptions=t||null,n.reconnect(),function(){return n.disconnectDragPreview()}},[n,t]),n}var hl,th;function h0(){return th||(th=1,hl=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,s;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(s=Object.keys(t),n=s.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[o]))return!1;for(o=n;o--!==0;){var a=s[o];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r}),hl}var p0=h0();const g0=pi(p0);function m0(e,t){return C0(e)||b0(e,t)||y0(e,t)||v0()}function v0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
541
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function y0(e,t){if(e){if(typeof e=="string")return rh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return rh(e,t)}}function rh(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function b0(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,s=!1,a,i;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(c){s=!0,i=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(s)throw i}}return n}}function C0(e){if(Array.isArray(e))return e}function nh(e,t,r){var n=p.useState(function(){return t(e)}),o=m0(n,2),s=o[0],a=o[1],i=p.useCallback(function(){var c=t(e);g0(s,c)||(a(c),r&&r())},[s,e,r]);return on(i),[s,i]}function S0(e,t){return E0(e)||T0(e,t)||_0(e,t)||w0()}function w0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
542
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _0(e,t){if(e){if(typeof e=="string")return oh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return oh(e,t)}}function oh(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function T0(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,s=!1,a,i;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(c){s=!0,i=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(s)throw i}}return n}}function E0(e){if(Array.isArray(e))return e}function A0(e,t,r){var n=nh(e,t,r),o=S0(n,2),s=o[0],a=o[1];return on(function(){var c=e.getHandlerId();if(c!=null)return e.subscribeToStateChange(a,{handlerIds:[c]})},[e,a]),s}function sh(e,t,r){return A0(t,e||function(){return{}},function(){return r.reconnect()})}function k0(e){return p.useMemo(function(){return e.hooks.dragSource()},[e])}function I0(e){return p.useMemo(function(){return e.hooks.dragPreview()},[e])}function D0(e,t){var r=eh(e,t);_e(!r.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");var n=u0(),o=f0(r.options,r.previewOptions);return s0(r,n,o),[sh(r.collect,n,o),k0(o),I0(o)]}function L0(e){var t=e.accept;return p.useMemo(function(){return _e(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]},[t])}function O0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function P0(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function N0(e,t,r){return t&&P0(e.prototype,t),e}function ah(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var x0=(function(){function e(t,r){O0(this,e),ah(this,"spec",void 0),ah(this,"monitor",void 0),this.spec=t,this.monitor=r}return N0(e,[{key:"canDrop",value:function(){var r=this.spec,n=this.monitor;return r.canDrop?r.canDrop(n.getItem(),n):!0}},{key:"hover",value:function(){var r=this.spec,n=this.monitor;r.hover&&r.hover(n.getItem(),n)}},{key:"drop",value:function(){var r=this.spec,n=this.monitor;if(r.drop)return r.drop(n.getItem(),n)}}]),e})();function F0(e,t){var r=p.useMemo(function(){return new x0(e,t)},[t]);return p.useEffect(function(){r.spec=e},[e]),r}function M0(e,t){return j0(e)||q0(e,t)||B0(e,t)||$0()}function $0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
543
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function B0(e,t){if(e){if(typeof e=="string")return ih(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ih(e,t)}}function ih(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function q0(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,s=!1,a,i;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(c){s=!0,i=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(s)throw i}}return n}}function j0(e){if(Array.isArray(e))return e}function U0(e,t,r){var n=sn(),o=F0(e,t),s=L0(e);on(function(){var i=W1(s,o,n),c=M0(i,2),d=c[0],u=c[1];return t.receiveHandlerId(d),r.receiveHandlerId(d),u},[n,t,o,r,s.map(function(a){return a.toString()}).join("|")])}function z0(){var e=sn();return p.useMemo(function(){return new x1(e)},[e])}function V0(e){var t=sn(),r=p.useMemo(function(){return new Q1(t.getBackend())},[t]);return on(function(){return r.dropTargetOptions=e||null,r.reconnect(),function(){return r.disconnectDropTarget()}},[e]),r}function H0(e){return p.useMemo(function(){return e.hooks.dropTarget()},[e])}function lh(e,t){var r=eh(e,t),n=z0(),o=V0(r.options);return U0(r,n,o),[sh(r.collect,n,o),H0(o)]}function Q0(e,t){return K0(e)||G0(e,t)||R0(e,t)||W0()}function W0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
544
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function R0(e,t){if(e){if(typeof e=="string")return ch(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ch(e,t)}}function ch(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function G0(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,s=!1,a,i;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(c){s=!0,i=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(s)throw i}}return n}}function K0(e){if(Array.isArray(e))return e}function Y0(e){var t=sn(),r=t.getMonitor(),n=nh(r,e),o=Q0(n,2),s=o[0],a=o[1];return p.useEffect(function(){return r.subscribeToOffsetChange(a)}),p.useEffect(function(){return r.subscribeToStateChange(a)}),s}function dh(e){var t=null,r=function(){return t==null&&(t=e()),t};return r}function Z0(e,t){return e.filter(function(r){return r!==t})}function X0(e,t){var r=new Set,n=function(a){return r.add(a)};e.forEach(n),t.forEach(n);var o=[];return r.forEach(function(s){return o.push(s)}),o}function J0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function eT(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function tT(e,t,r){return t&&eT(e.prototype,t),e}function uh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var rT=(function(){function e(t){J0(this,e),uh(this,"entered",[]),uh(this,"isNodeInDocument",void 0),this.isNodeInDocument=t}return tT(e,[{key:"enter",value:function(r){var n=this,o=this.entered.length,s=function(i){return n.isNodeInDocument(i)&&(!i.contains||i.contains(r))};return this.entered=X0(this.entered.filter(s),[r]),o===0&&this.entered.length>0}},{key:"leave",value:function(r){var n=this.entered.length;return this.entered=Z0(this.entered.filter(this.isNodeInDocument),r),n>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),e})(),nT=dh(function(){return/firefox/i.test(navigator.userAgent)}),fh=dh(function(){return!!window.safari});function oT(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sT(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function aT(e,t,r){return t&&sT(e.prototype,t),e}function Uo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var hh=(function(){function e(t,r){oT(this,e),Uo(this,"xs",void 0),Uo(this,"ys",void 0),Uo(this,"c1s",void 0),Uo(this,"c2s",void 0),Uo(this,"c3s",void 0);for(var n=t.length,o=[],s=0;s<n;s++)o.push(s);o.sort(function(A,x){return t[A]<t[x]?-1:1});for(var a=[],i=[],c,d,u=0;u<n-1;u++)c=t[u+1]-t[u],d=r[u+1]-r[u],a.push(c),i.push(d/c);for(var f=[i[0]],m=0;m<a.length-1;m++){var g=i[m],b=i[m+1];if(g*b<=0)f.push(0);else{c=a[m];var h=a[m+1],v=c+h;f.push(3*v/((v+h)/g+(v+c)/b))}}f.push(i[i.length-1]);for(var y=[],C=[],S,w=0;w<f.length-1;w++){S=i[w];var T=f[w],E=1/a[w],L=T+f[w+1]-S-S;y.push((S-T-L)*E),C.push(L*E*E)}this.xs=t,this.ys=r,this.c1s=f,this.c2s=y,this.c3s=C}return aT(e,[{key:"interpolate",value:function(r){var n=this.xs,o=this.ys,s=this.c1s,a=this.c2s,i=this.c3s,c=n.length-1;if(r===n[c])return o[c];for(var d=0,u=i.length-1,f;d<=u;){f=Math.floor(.5*(d+u));var m=n[f];if(m<r)d=f+1;else if(m>r)u=f-1;else return o[f]}c=Math.max(0,u);var g=r-n[c],b=g*g;return o[c]+s[c]*g+a[c]*b+i[c]*g*b}}]),e})(),iT=1;function ph(e){var t=e.nodeType===iT?e:e.parentElement;if(!t)return null;var r=t.getBoundingClientRect(),n=r.top,o=r.left;return{x:o,y:n}}function ya(e){return{x:e.clientX,y:e.clientY}}function lT(e){var t;return e.nodeName==="IMG"&&(nT()||!((t=document.documentElement)!==null&&t!==void 0&&t.contains(e)))}function cT(e,t,r,n){var o=e?t.width:r,s=e?t.height:n;return fh()&&e&&(s/=window.devicePixelRatio,o/=window.devicePixelRatio),{dragPreviewWidth:o,dragPreviewHeight:s}}function dT(e,t,r,n,o){var s=lT(t),a=s?e:t,i=ph(a),c={x:r.x-i.x,y:r.y-i.y},d=e.offsetWidth,u=e.offsetHeight,f=n.anchorX,m=n.anchorY,g=cT(s,t,d,u),b=g.dragPreviewWidth,h=g.dragPreviewHeight,v=function(){var L=new hh([0,.5,1],[c.y,c.y/u*h,c.y+h-u]),A=L.interpolate(m);return fh()&&s&&(A+=(window.devicePixelRatio-1)*h),A},y=function(){var L=new hh([0,.5,1],[c.x,c.x/d*b,c.x+b-d]);return L.interpolate(f)},C=o.offsetX,S=o.offsetY,w=C===0||C,T=S===0||S;return{x:w?C:y(),y:T?S:v()}}var gh="__NATIVE_FILE__",mh="__NATIVE_URL__",vh="__NATIVE_TEXT__",yh="__NATIVE_HTML__";const bh=Object.freeze(Object.defineProperty({__proto__:null,FILE:gh,HTML:yh,TEXT:vh,URL:mh},Symbol.toStringTag,{value:"Module"}));function pl(e,t,r){var n=t.reduce(function(o,s){return o||e.getData(s)},"");return n??r}var Vn;function ba(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var gl=(Vn={},ba(Vn,gh,{exposeProperties:{files:function(t){return Array.prototype.slice.call(t.files)},items:function(t){return t.items},dataTransfer:function(t){return t}},matchesTypes:["Files"]}),ba(Vn,yh,{exposeProperties:{html:function(t,r){return pl(t,r,"")},dataTransfer:function(t){return t}},matchesTypes:["Html","text/html"]}),ba(Vn,mh,{exposeProperties:{urls:function(t,r){return pl(t,r,"").split(`
545
+ `)},dataTransfer:function(t){return t}},matchesTypes:["Url","text/uri-list"]}),ba(Vn,vh,{exposeProperties:{text:function(t,r){return pl(t,r,"")},dataTransfer:function(t){return t}},matchesTypes:["Text","text/plain"]}),Vn);function uT(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fT(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function hT(e,t,r){return t&&fT(e.prototype,t),e}function Ch(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var pT=(function(){function e(t){uT(this,e),Ch(this,"item",void 0),Ch(this,"config",void 0),this.config=t,this.item={},this.initializeExposedProperties()}return hT(e,[{key:"initializeExposedProperties",value:function(){var r=this;Object.keys(this.config.exposeProperties).forEach(function(n){Object.defineProperty(r.item,n,{configurable:!0,enumerable:!0,get:function(){return console.warn(`Browser doesn't allow reading "`.concat(n,'" until the drop event.')),null}})})}},{key:"loadDataTransfer",value:function(r){var n=this;if(r){var o={};Object.keys(this.config.exposeProperties).forEach(function(s){o[s]={value:n.config.exposeProperties[s](r,n.config.matchesTypes),configurable:!0,enumerable:!0}}),Object.defineProperties(this.item,o)}}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(r,n){return n===r.getSourceId()}},{key:"endDrag",value:function(){}}]),e})();function gT(e,t){var r=new pT(gl[e]);return r.loadDataTransfer(t),r}function ml(e){if(!e)return null;var t=Array.prototype.slice.call(e.types||[]);return Object.keys(gl).filter(function(r){var n=gl[r].matchesTypes;return n.some(function(o){return t.indexOf(o)>-1})})[0]||null}function mT(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vT(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function yT(e,t,r){return t&&vT(e.prototype,t),e}function vl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var bT=(function(){function e(t,r){mT(this,e),vl(this,"ownerDocument",null),vl(this,"globalContext",void 0),vl(this,"optionsArgs",void 0),this.globalContext=t,this.optionsArgs=r}return yT(e,[{key:"window",get:function(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}},{key:"document",get:function(){var r;return(r=this.globalContext)!==null&&r!==void 0&&r.document?this.globalContext.document:this.window?this.window.document:void 0}},{key:"rootElement",get:function(){var r;return((r=this.optionsArgs)===null||r===void 0?void 0:r.rootElement)||this.window}}]),e})();function Sh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function wh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Sh(Object(r),!0).forEach(function(n){Le(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Sh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function CT(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ST(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function wT(e,t,r){return t&&ST(e.prototype,t),e}function Le(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var _T=(function(){function e(t,r,n){var o=this;CT(this,e),Le(this,"options",void 0),Le(this,"actions",void 0),Le(this,"monitor",void 0),Le(this,"registry",void 0),Le(this,"enterLeaveCounter",void 0),Le(this,"sourcePreviewNodes",new Map),Le(this,"sourcePreviewNodeOptions",new Map),Le(this,"sourceNodes",new Map),Le(this,"sourceNodeOptions",new Map),Le(this,"dragStartSourceIds",null),Le(this,"dropTargetIds",[]),Le(this,"dragEnterTargetIds",[]),Le(this,"currentNativeSource",null),Le(this,"currentNativeHandle",null),Le(this,"currentDragSourceNode",null),Le(this,"altKeyPressed",!1),Le(this,"mouseMoveTimeoutTimer",null),Le(this,"asyncEndDragFrameId",null),Le(this,"dragOverTargetIds",null),Le(this,"lastClientOffset",null),Le(this,"hoverRafId",null),Le(this,"getSourceClientOffset",function(s){var a=o.sourceNodes.get(s);return a&&ph(a)||null}),Le(this,"endDragNativeItem",function(){o.isDraggingNativeItem()&&(o.actions.endDrag(),o.currentNativeHandle&&o.registry.removeSource(o.currentNativeHandle),o.currentNativeHandle=null,o.currentNativeSource=null)}),Le(this,"isNodeInDocument",function(s){return!!(s&&o.document&&o.document.body&&o.document.body.contains(s))}),Le(this,"endDragIfSourceWasRemovedFromDOM",function(){var s=o.currentDragSourceNode;s==null||o.isNodeInDocument(s)||o.clearCurrentDragSourceNode()&&o.monitor.isDragging()&&o.actions.endDrag()}),Le(this,"handleTopDragStartCapture",function(){o.clearCurrentDragSourceNode(),o.dragStartSourceIds=[]}),Le(this,"handleTopDragStart",function(s){if(!s.defaultPrevented){var a=o.dragStartSourceIds;o.dragStartSourceIds=null;var i=ya(s);o.monitor.isDragging()&&o.actions.endDrag(),o.actions.beginDrag(a||[],{publishSource:!1,getSourceClientOffset:o.getSourceClientOffset,clientOffset:i});var c=s.dataTransfer,d=ml(c);if(o.monitor.isDragging()){if(c&&typeof c.setDragImage=="function"){var u=o.monitor.getSourceId(),f=o.sourceNodes.get(u),m=o.sourcePreviewNodes.get(u)||f;if(m){var g=o.getCurrentSourcePreviewNodeOptions(),b=g.anchorX,h=g.anchorY,v=g.offsetX,y=g.offsetY,C={anchorX:b,anchorY:h},S={offsetX:v,offsetY:y},w=dT(f,m,i,C,S);c.setDragImage(m,w.x,w.y)}}try{c==null||c.setData("application/json",{})}catch{}o.setCurrentDragSourceNode(s.target);var T=o.getCurrentSourcePreviewNodeOptions(),E=T.captureDraggingState;E?o.actions.publishDragSource():setTimeout(function(){return o.actions.publishDragSource()},0)}else if(d)o.beginDragNativeItem(d);else{if(c&&!c.types&&(s.target&&!s.target.hasAttribute||!s.target.hasAttribute("draggable")))return;s.preventDefault()}}}),Le(this,"handleTopDragEndCapture",function(){o.clearCurrentDragSourceNode()&&o.monitor.isDragging()&&o.actions.endDrag()}),Le(this,"handleTopDragEnterCapture",function(s){o.dragEnterTargetIds=[];var a=o.enterLeaveCounter.enter(s.target);if(!(!a||o.monitor.isDragging())){var i=s.dataTransfer,c=ml(i);c&&o.beginDragNativeItem(c,i)}}),Le(this,"handleTopDragEnter",function(s){var a=o.dragEnterTargetIds;if(o.dragEnterTargetIds=[],!!o.monitor.isDragging()){o.altKeyPressed=s.altKey,a.length>0&&o.actions.hover(a,{clientOffset:ya(s)});var i=a.some(function(c){return o.monitor.canDropOnTarget(c)});i&&(s.preventDefault(),s.dataTransfer&&(s.dataTransfer.dropEffect=o.getCurrentDropEffect()))}}),Le(this,"handleTopDragOverCapture",function(){o.dragOverTargetIds=[]}),Le(this,"handleTopDragOver",function(s){var a=o.dragOverTargetIds;if(o.dragOverTargetIds=[],!o.monitor.isDragging()){s.preventDefault(),s.dataTransfer&&(s.dataTransfer.dropEffect="none");return}o.altKeyPressed=s.altKey,o.lastClientOffset=ya(s),o.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(o.hoverRafId=requestAnimationFrame(function(){o.monitor.isDragging()&&o.actions.hover(a||[],{clientOffset:o.lastClientOffset}),o.hoverRafId=null}));var i=(a||[]).some(function(c){return o.monitor.canDropOnTarget(c)});i?(s.preventDefault(),s.dataTransfer&&(s.dataTransfer.dropEffect=o.getCurrentDropEffect())):o.isDraggingNativeItem()?s.preventDefault():(s.preventDefault(),s.dataTransfer&&(s.dataTransfer.dropEffect="none"))}),Le(this,"handleTopDragLeaveCapture",function(s){o.isDraggingNativeItem()&&s.preventDefault();var a=o.enterLeaveCounter.leave(s.target);a&&o.isDraggingNativeItem()&&setTimeout(function(){return o.endDragNativeItem()},0)}),Le(this,"handleTopDropCapture",function(s){if(o.dropTargetIds=[],o.isDraggingNativeItem()){var a;s.preventDefault(),(a=o.currentNativeSource)===null||a===void 0||a.loadDataTransfer(s.dataTransfer)}else ml(s.dataTransfer)&&s.preventDefault();o.enterLeaveCounter.reset()}),Le(this,"handleTopDrop",function(s){var a=o.dropTargetIds;o.dropTargetIds=[],o.actions.hover(a,{clientOffset:ya(s)}),o.actions.drop({dropEffect:o.getCurrentDropEffect()}),o.isDraggingNativeItem()?o.endDragNativeItem():o.monitor.isDragging()&&o.actions.endDrag()}),Le(this,"handleSelectStart",function(s){var a=s.target;typeof a.dragDrop=="function"&&(a.tagName==="INPUT"||a.tagName==="SELECT"||a.tagName==="TEXTAREA"||a.isContentEditable||(s.preventDefault(),a.dragDrop()))}),this.options=new bT(r,n),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new rT(this.isNodeInDocument)}return wT(e,[{key:"profile",value:function(){var r,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((r=this.dragStartSourceIds)===null||r===void 0?void 0:r.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}},{key:"window",get:function(){return this.options.window}},{key:"document",get:function(){return this.options.document}},{key:"rootElement",get:function(){return this.options.rootElement}},{key:"setup",value:function(){var r=this.rootElement;if(r!==void 0){if(r.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");r.__isReactDndBackendSetUp=!0,this.addEventListeners(r)}}},{key:"teardown",value:function(){var r=this.rootElement;if(r!==void 0&&(r.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}},{key:"connectDragPreview",value:function(r,n,o){var s=this;return this.sourcePreviewNodeOptions.set(r,o),this.sourcePreviewNodes.set(r,n),function(){s.sourcePreviewNodes.delete(r),s.sourcePreviewNodeOptions.delete(r)}}},{key:"connectDragSource",value:function(r,n,o){var s=this;this.sourceNodes.set(r,n),this.sourceNodeOptions.set(r,o);var a=function(d){return s.handleDragStart(d,r)},i=function(d){return s.handleSelectStart(d)};return n.setAttribute("draggable","true"),n.addEventListener("dragstart",a),n.addEventListener("selectstart",i),function(){s.sourceNodes.delete(r),s.sourceNodeOptions.delete(r),n.removeEventListener("dragstart",a),n.removeEventListener("selectstart",i),n.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(r,n){var o=this,s=function(d){return o.handleDragEnter(d,r)},a=function(d){return o.handleDragOver(d,r)},i=function(d){return o.handleDrop(d,r)};return n.addEventListener("dragenter",s),n.addEventListener("dragover",a),n.addEventListener("drop",i),function(){n.removeEventListener("dragenter",s),n.removeEventListener("dragover",a),n.removeEventListener("drop",i)}}},{key:"addEventListeners",value:function(r){r.addEventListener&&(r.addEventListener("dragstart",this.handleTopDragStart),r.addEventListener("dragstart",this.handleTopDragStartCapture,!0),r.addEventListener("dragend",this.handleTopDragEndCapture,!0),r.addEventListener("dragenter",this.handleTopDragEnter),r.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),r.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),r.addEventListener("dragover",this.handleTopDragOver),r.addEventListener("dragover",this.handleTopDragOverCapture,!0),r.addEventListener("drop",this.handleTopDrop),r.addEventListener("drop",this.handleTopDropCapture,!0))}},{key:"removeEventListeners",value:function(r){r.removeEventListener&&(r.removeEventListener("dragstart",this.handleTopDragStart),r.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),r.removeEventListener("dragend",this.handleTopDragEndCapture,!0),r.removeEventListener("dragenter",this.handleTopDragEnter),r.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),r.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),r.removeEventListener("dragover",this.handleTopDragOver),r.removeEventListener("dragover",this.handleTopDragOverCapture,!0),r.removeEventListener("drop",this.handleTopDrop),r.removeEventListener("drop",this.handleTopDropCapture,!0))}},{key:"getCurrentSourceNodeOptions",value:function(){var r=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(r);return wh({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var r=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(r);return wh({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}},{key:"isDraggingNativeItem",value:function(){var r=this.monitor.getItemType();return Object.keys(bh).some(function(n){return bh[n]===r})}},{key:"beginDragNativeItem",value:function(r,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=gT(r,n),this.currentNativeHandle=this.registry.addSource(r,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(r){var n=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=r;var o=1e3;this.mouseMoveTimeoutTimer=setTimeout(function(){var s;return(s=n.rootElement)===null||s===void 0?void 0:s.addEventListener("mousemove",n.endDragIfSourceWasRemovedFromDOM,!0)},o)}},{key:"clearCurrentDragSourceNode",value:function(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var r;(r=this.window)===null||r===void 0||r.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}},{key:"handleDragStart",value:function(r,n){r.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}},{key:"handleDragEnter",value:function(r,n){this.dragEnterTargetIds.unshift(n)}},{key:"handleDragOver",value:function(r,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}},{key:"handleDrop",value:function(r,n){this.dropTargetIds.unshift(n)}}]),e})(),Ca;function TT(){return Ca||(Ca=new Image,Ca.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),Ca}var ET=function(t,r,n){return new _T(t,r,n)};function AT(e,t){return typeof e=="function"?e(t):e??"NODE"}function kT(e){return e.isDraggable&&!e.isEditing}function IT(e){const t=$t(),r=t.selectedIds,[n,o,s]=D0(()=>({canDrag:()=>kT(e),type:AT(t.props.dragType,e),item:()=>{const a=t.isSelected(e.id)?Array.from(r):[e.id];return t.dispatch(Bn.dragStart(e.id,a)),{id:e.id,dragIds:a,data:e.data}},end:()=>{t.hideCursor(),t.redrawList(),t.dispatch(Bn.dragEnd())}}),[r,e,t.props.dragType]);return p.useEffect(()=>{s(TT())},[s]),o}function DT(e,t){const r=e.getBoundingClientRect(),n=t.x-Math.round(r.x),o=t.y-Math.round(r.y),s=r.height,a=o<s/2,i=!a,c=s/4,d=o>c&&o<s-c;return{x:n,inTopHalf:a,inBottomHalf:i,inMiddle:d,atTop:!d&&a,atBottom:!d&&i}}function LT(e,t,r,n){return e?e.isInternal?n.atTop?[t,e]:n.inMiddle?[e,e]:[e,r]:n.inTopHalf?[t,e]:[e,r]:[t,null]}function Sa(e,t){return{parentId:e||null,index:t}}function Hn(e,t){return{type:"line",index:e,level:t}}function OT(e){return{type:"highlight",id:e}}function yl(e,t){var r;let n=e;for(;n.parent&&n.level>t;)n=n.parent;const o=((r=n.parent)===null||r===void 0?void 0:r.id)||null,s=rf(n)+1;return{parentId:o,index:s}}function _h(e){var t;const r=DT(e.element,e.offset),n=e.indent,o=Math.round(Math.max(0,r.x-n)/n),{node:s,nextNode:a,prevNode:i}=e,[c,d]=LT(s,i,a,r);if(s&&s.isInternal&&r.inMiddle)return{drop:Sa(s.id,null),cursor:OT(s.id)};if(!c)return{drop:Sa((t=d==null?void 0:d.parent)===null||t===void 0?void 0:t.id,0),cursor:Hn(0,0)};if(Xu(c)){const u=na(o,(d==null?void 0:d.level)||0,c.level);return{drop:yl(c,u),cursor:Hn(c.rowIndex+1,u)}}if(Ju(c)){const u=na(o,(d==null?void 0:d.level)||0,c.level);return{drop:yl(c,u),cursor:Hn(c.rowIndex+1,u)}}if(ef(c)){const u=na(o,0,c.level+1);return u>c.level?{drop:Sa(c.id,0),cursor:Hn(c.rowIndex+1,u)}:{drop:yl(c,u),cursor:Hn(c.rowIndex+1,u)}}return{drop:Sa(c==null?void 0:c.id,0),cursor:Hn(c.rowIndex+1,c.level+1)}}function PT(e,t){const r=$t(),[n,o]=lh(()=>({accept:"NODE",canDrop:()=>r.canDrop(),hover:(s,a)=>{const i=a.getClientOffset();if(!e.current||!i)return;const{cursor:c,drop:d}=_h({element:e.current,offset:i,indent:r.indent,node:t,prevNode:t.prev,nextNode:t.next});d&&r.dispatch(Bn.hovering(d.parentId,d.index)),a.canDrop()?c&&r.showCursor(c):r.hideCursor()},drop:(s,a)=>{if(!a.canDrop())return null;r.drop()}}),[t,e.current,r.props]);return o}function NT(e){const t=$t(),r=t.at(e);if(!r)throw new Error(`Could not find node for index: ${e}`);return p.useMemo(()=>{const n=r.clone();return t.visibleNodes[e]=n,n},[...Object.values(r.state),r])}const Th=p.memo(function({index:t,style:r}){Zu(),YS();const n=$t(),o=NT(t),s=p.useRef(null),a=IT(o),i=PT(s,o),c=p.useCallback(h=>{s.current=h,i(h)},[i]),d=n.indent*o.level,u=p.useMemo(()=>({paddingLeft:d}),[d]),f=p.useMemo(()=>{var h,v;return Object.assign(Object.assign({},r),{top:parseFloat(r.top)+((v=(h=n.props.padding)!==null&&h!==void 0?h:n.props.paddingTop)!==null&&v!==void 0?v:0),minWidth:"max-content"})},[r,n.props.padding,n.props.paddingTop]),m={role:"treeitem","aria-level":o.level+1,"aria-selected":o.isSelected,"aria-expanded":o.isOpen,style:f,tabIndex:-1,className:n.props.rowClassName};p.useEffect(()=>{var h;!o.isEditing&&o.isFocused&&((h=s.current)===null||h===void 0||h.focus({preventScroll:!0}))},[o.isEditing,o.isFocused,s.current]);const g=n.renderNode,b=n.renderRow;return l.jsx(b,{node:o,innerRef:c,attrs:m,children:l.jsx(g,{node:o,tree:n,style:u,dragHandle:a})})});let bl="",Eh=null;function Ah(){Zu();const e=$t();return l.jsx("div",{role:"tree","aria-label":e.props["aria-label"],"aria-labelledby":e.props["aria-labelledby"],"aria-multiselectable":!e.props.disableMultiSelection||void 0,style:{height:e.height,width:e.width,minHeight:0,minWidth:0},onContextMenu:e.props.onContextMenu,onClick:e.props.onClick,tabIndex:0,onFocus:t=>{t.currentTarget.contains(t.relatedTarget)||e.onFocus()},onBlur:t=>{t.currentTarget.contains(t.relatedTarget)||e.onBlur()},onKeyDown:t=>{var r;if(e.isEditing)return;if(t.key==="Backspace"){if(!e.props.onDelete)return;const o=Array.from(e.selectedIds);if(o.length>1){let s=e.mostRecentNode;for(;s&&s.isSelected;)s=s.nextSibling;s||(s=e.lastNode),e.focus(s,{scroll:!1}),e.delete(Array.from(o))}else{const s=e.focusedNode;if(s){const a=s.nextSibling,i=s.parent;e.focus(a||i,{scroll:!1}),e.delete(s)}}return}if(t.key==="Tab"&&!t.shiftKey){t.preventDefault(),nf(t.currentTarget);return}if(t.key==="Tab"&&t.shiftKey){t.preventDefault(),of(t.currentTarget);return}if(t.key==="ArrowDown"){t.preventDefault();const o=e.nextNode;if(t.metaKey){e.select(e.focusedNode),e.activate(e.focusedNode);return}else if(!t.shiftKey||e.props.disableMultiSelection){e.focus(o);return}else{if(!o)return;const s=e.focusedNode;s?s.isSelected?e.selectContiguous(o):e.selectMulti(o):e.focus(e.firstNode);return}}if(t.key==="ArrowUp"){t.preventDefault();const o=e.prevNode;if(!t.shiftKey||e.props.disableMultiSelection){e.focus(o);return}else{if(!o)return;const s=e.focusedNode;s?s.isSelected?e.selectContiguous(o):e.selectMulti(o):e.focus(e.lastNode);return}}if(t.key==="ArrowRight"){const o=e.focusedNode;if(!o)return;o.isInternal&&o.isOpen?e.focus(e.nextNode):o.isInternal&&e.open(o.id);return}if(t.key==="ArrowLeft"){const o=e.focusedNode;if(!o||o.isRoot)return;o.isInternal&&o.isOpen?e.close(o.id):!((r=o.parent)===null||r===void 0)&&r.isRoot||e.focus(o.parent);return}if(t.key==="a"&&(t.metaKey||t.ctrlKey)&&!e.props.disableMultiSelection){t.preventDefault(),e.selectAll();return}if(t.key==="a"&&!t.metaKey&&!t.ctrlKey&&e.props.onCreate){e.createLeaf();return}if(t.key==="A"&&!t.metaKey&&!t.ctrlKey){if(!e.props.onCreate)return;e.createInternal();return}if(t.key==="Home"){t.preventDefault(),e.focus(e.firstNode);return}if(t.key==="End"){t.preventDefault(),e.focus(e.lastNode);return}if(t.key==="Enter"){const o=e.focusedNode;if(!o||!o.isEditable||!e.props.onRename)return;setTimeout(()=>{o&&e.edit(o)});return}if(t.key===" "){t.preventDefault();const o=e.focusedNode;if(!o)return;o.isLeaf?(o.select(),o.activate()):o.toggle();return}if(t.key==="*"){const o=e.focusedNode;if(!o)return;e.openSiblings(o);return}if(t.key==="PageUp"){t.preventDefault(),e.pageUp();return}t.key==="PageDown"&&(t.preventDefault(),e.pageDown()),clearTimeout(Eh),bl+=t.key,Eh=setTimeout(()=>{bl=""},600);const n=e.visibleNodes.find(o=>{const s=o.data.name;return typeof s=="string"?s.toLowerCase().startsWith(bl):!1});n&&e.focus(n.id)},children:l.jsx(xT,{})})}function xT(){var e,t;const r=$t(),n={className:r.props.className,outerRef:r.listEl,itemCount:r.visibleNodes.length,height:r.height,width:r.width,overscanCount:r.overscanCount,itemKey:o=>{var s;return((s=r.visibleNodes[o])===null||s===void 0?void 0:s.id)||o},outerElementType:(e=r.props.outerElementType)!==null&&e!==void 0?e:Bw,innerElementType:(t=r.props.innerElementType)!==null&&t!==void 0?t:Uw,onScroll:r.props.onScroll,onItemsRendered:r.onItemsRendered.bind(r)};return typeof r.props.rowHeight=="function"?l.jsx(xw,Object.assign({},n,{itemSize:r.rowHeightAt,ref:r.list,children:Th})):l.jsx(Fw,Object.assign({},n,{itemSize:r.rowHeight,ref:r.list,children:Th}))}function kh(e){return e.isFiltered?MT(e.root,e.isMatch.bind(e)):FT(e.root)}function FT(e){const t=[];function r(n){var o;n.level>=0&&t.push(n),n.isOpen&&((o=n.children)===null||o===void 0||o.forEach(r))}return r(e),t.forEach(Ih),t}function MT(e,t){const r={},n=[];function o(a){if(!a.isRoot&&t(a)){r[a.id]=!0;let c=a.parent;for(;c;)r[c.id]=!0,c=c.parent}if(a.children)for(let c of a.children)o(c)}function s(a){var i;a.level>=0&&r[a.id]&&n.push(a),a.isOpen&&((i=a.children)===null||i===void 0||i.forEach(s))}return o(e),s(e),n.forEach(Ih),n}function Ih(e,t){e.rowIndex=t}const Dh=e=>e.reduce((t,r,n)=>(t[r.id]=n,t),{});var Cl=function(e,t,r,n){function o(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function i(u){try{d(n.next(u))}catch(f){a(f)}}function c(u){try{d(n.throw(u))}catch(f){a(f)}}function d(u){u.done?s(u.value):o(u.value).then(i,c)}d((n=n.apply(e,t||[])).next())})};const{safeRun:Et}=tw;class zo{constructor(t,r,n,o){this.store=t,this.props=r,this.list=n,this.listEl=o,this.visibleStartIndex=0,this.visibleStopIndex=0,this.rowOffsets=null,this.rowHeightAt=s=>{const a=this.props.rowHeight;if(typeof a=="function"){const i=this.at(s);return i?a(i):this.rowHeight}return a??24},this.rowTopPosition=s=>{if(typeof this.props.rowHeight!="function")return s*this.rowHeight;const a=this.getRowOffsets(),i=Math.max(0,Math.min(s,a.length-1));return a[i]},this.redrawList=(s=0)=>{this.rowOffsets=null;const a=this.list.current;a&&"resetAfterIndex"in a&&a.resetAfterIndex(Math.max(0,s))},this.root=df(this),this.visibleNodes=kh(this),this.idToIndex=Dh(this.visibleNodes)}update(t){this.props=t,this.root=df(this),this.visibleNodes=kh(this),this.idToIndex=Dh(this.visibleNodes),this.rowOffsets=null;const r=this.list.current;r&&"resetAfterIndex"in r&&r.resetAfterIndex(0,!1)}dispatch(t){return this.store.dispatch(t)}get state(){return this.store.getState()}get openState(){return this.state.nodes.open.unfiltered}get width(){var t;return(t=this.props.width)!==null&&t!==void 0?t:300}get height(){var t;return(t=this.props.height)!==null&&t!==void 0?t:500}get indent(){var t;return(t=this.props.indent)!==null&&t!==void 0?t:24}get rowHeight(){return typeof this.props.rowHeight=="number"?this.props.rowHeight:24}getRowOffsets(){if(this.rowOffsets)return this.rowOffsets;const t=[0];for(let r=0;r<this.visibleNodes.length;r++)t.push(t[r]+this.rowHeightAt(r));return this.rowOffsets=t,t}get overscanCount(){var t;return(t=this.props.overscanCount)!==null&&t!==void 0?t:1}get searchTerm(){return(this.props.searchTerm||"").trim()}get matchFn(){var t;const r=(t=this.props.searchMatch)!==null&&t!==void 0?t:((n,o)=>JSON.stringify(Object.values(n.data)).toLocaleLowerCase().includes(o.toLocaleLowerCase()));return n=>r(n,this.searchTerm)}accessChildren(t){var r;const n=this.props.childrenAccessor||"children";return(r=$o(t,n))!==null&&r!==void 0?r:null}accessId(t){const r=this.props.idAccessor||"id",n=$o(t,r);if(!n)throw new Error("Data must contain an 'id' property or props.idAccessor must return a string");return n}identify(t){if(typeof t=="string")return t;if(t instanceof qo)return t.id;const r=this.props.idAccessor||"id";return $o(t,r)}identifyNull(t){return t==null?null:this.identify(t)}get firstNode(){var t;return(t=this.visibleNodes[0])!==null&&t!==void 0?t:null}get lastNode(){var t;return(t=this.visibleNodes[this.visibleNodes.length-1])!==null&&t!==void 0?t:null}get focusedNode(){var t;return(t=this.get(this.state.nodes.focus.id))!==null&&t!==void 0?t:null}get mostRecentNode(){var t;return(t=this.get(this.state.nodes.selection.mostRecent))!==null&&t!==void 0?t:null}get nextNode(){const t=this.indexOf(this.focusedNode);return t===null?null:this.at(t+1)}get prevNode(){const t=this.indexOf(this.focusedNode);return t===null?null:this.at(t-1)}get(t){return t&&t in this.idToIndex&&this.visibleNodes[this.idToIndex[t]]||null}at(t){return this.visibleNodes[t]||null}nodesBetween(t,r){var n;if(t===null||r===null)return[];const o=(n=this.indexOf(t))!==null&&n!==void 0?n:0,s=this.indexOf(r);if(s===null)return[];const a=Math.min(o,s),i=Math.max(o,s);return this.visibleNodes.slice(a,i+1)}indexOf(t){const r=this.identifyNull(t);return r?this.idToIndex[r]:null}get editingId(){return this.state.nodes.edit.id}createInternal(){return this.create({type:"internal"})}createLeaf(){return this.create({type:"leaf"})}create(){return Cl(this,arguments,void 0,function*(t={}){var r,n;const o=t.parentId===void 0?cf(this):t.parentId,s=(r=t.index)!==null&&r!==void 0?r:lf(this),a=(n=t.type)!==null&&n!==void 0?n:"leaf",i=yield Et(this.props.onCreate,{type:a,parentId:o,index:s,parentNode:this.get(o)});i&&(this.focus(i),setTimeout(()=>{this.edit(i).then(()=>{this.select(i),this.activate(i)})}))})}delete(t){return Cl(this,void 0,void 0,function*(){if(!t)return;const n=(Array.isArray(t)?t:[t]).map(a=>this.identify(a)),o=n.map(a=>this.get(a)).filter(a=>!!a),s=o.length?Math.min(...o.map(a=>{var i;return(i=a.rowIndex)!==null&&i!==void 0?i:0})):0;yield Et(this.props.onDelete,{nodes:o,ids:n}),this.redrawList(s)})}edit(t){var r,n;const o=this.identify(t);return this.resolveEdit({cancelled:!0}),this.scrollTo(o),this.dispatch(Wi(o)),this.redrawList((n=(r=this.get(o))===null||r===void 0?void 0:r.rowIndex)!==null&&n!==void 0?n:0),new Promise(s=>{zo.editPromise=s})}submit(t,r){return Cl(this,void 0,void 0,function*(){var n,o;if(!t)return;const s=this.identify(t);yield Et(this.props.onRename,{id:s,name:r,node:this.get(s)}),this.dispatch(Wi(null)),this.resolveEdit({cancelled:!1,value:r}),this.redrawList((o=(n=this.get(s))===null||n===void 0?void 0:n.rowIndex)!==null&&o!==void 0?o:0),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(Wi(null)),this.resolveEdit({cancelled:!0}),this.redrawList(),setTimeout(()=>this.onFocus())}activate(t){const r=this.get(this.identifyNull(t));r&&Et(this.props.onActivate,r)}resolveEdit(t){const r=zo.editPromise;r&&r(t),zo.editPromise=null}get selectedIds(){return this.state.nodes.selection.ids}get selectedNodes(){let t=[];for(let r of Array.from(this.selectedIds)){const n=this.get(r);n&&t.push(n)}return t}focus(t,r={}){t&&(this.props.selectionFollowsFocus?this.select(t):(this.dispatch(Mn(this.identify(t))),r.scroll!==!1&&this.scrollTo(t),this.focusedNode&&Et(this.props.onFocus,this.focusedNode)))}pageUp(){var t,r;const n=this.visibleStartIndex,s=this.visibleStopIndex-n;let a=(r=(t=this.focusedNode)===null||t===void 0?void 0:t.rowIndex)!==null&&r!==void 0?r:0;a>n?a=n:a=Math.max(n-s,0),this.focus(this.at(a))}pageDown(){var t,r;const n=this.visibleStartIndex,o=this.visibleStopIndex,s=o-n;let a=(r=(t=this.focusedNode)===null||t===void 0?void 0:t.rowIndex)!==null&&r!==void 0?r:0;a<o?a=o:a=Math.min(a+s,this.visibleNodes.length-1),this.focus(this.at(a))}select(t,r={}){var n;if(!t)return;const o=r.focus!==!1,s=this.identify(t);o&&this.dispatch(Mn(s)),!((n=this.get(s))===null||n===void 0)&&n.isSelectable&&this.setSelection({ids:[s],anchor:s,mostRecent:s}),this.scrollTo(s,r.align),this.focusedNode&&o&&Et(this.props.onFocus,this.focusedNode)}deselect(t){if(!t)return;const r=this.identify(t);this.dispatch(Fr.remove(r)),Et(this.props.onSelect,this.selectedNodes)}selectMulti(t,r={}){const n=this.get(this.identifyNull(t));if(!n)return;const o=r.focus!==!1;o&&this.dispatch(Mn(n.id)),n.isSelectable&&(this.dispatch(Fr.add(n.id)),this.dispatch(Fr.anchor(n.id)),this.dispatch(Fr.mostRecent(n.id))),this.scrollTo(n,r.align),this.focusedNode&&o&&Et(this.props.onFocus,this.focusedNode),Et(this.props.onSelect,this.selectedNodes)}selectContiguous(t){var r;if(!t)return;const n=this.identify(t);if(this.dispatch(Mn(n)),!((r=this.get(n))===null||r===void 0)&&r.isSelectable){const{anchor:o,mostRecent:s}=this.state.nodes.selection,a=this.filterSelectableNodes(this.nodesBetween(o,this.identifyNull(n)));this.dispatch(Fr.remove(this.nodesBetween(o,s))),this.dispatch(Fr.add(a)),this.dispatch(Fr.mostRecent(n))}this.scrollTo(n),this.focusedNode&&Et(this.props.onFocus,this.focusedNode),Et(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null})}selectAll(){var t,r,n;const o=this.filterSelectableNodes(Object.keys(this.idToIndex));this.setSelection({ids:o,anchor:(t=o[0])!==null&&t!==void 0?t:null,mostRecent:(r=o[o.length-1])!==null&&r!==void 0?r:null}),this.dispatch(Mn((n=this.lastNode)===null||n===void 0?void 0:n.id)),this.focusedNode&&Et(this.props.onFocus,this.focusedNode)}filterSelectableNodes(t){return t.map(r=>this.get(this.identify(r))).filter(r=>!!r&&r.isSelectable)}setSelection(t){var r;const n=new Set((r=t.ids)===null||r===void 0?void 0:r.map(a=>this.identify(a))),o=this.identifyNull(t.anchor),s=this.identifyNull(t.mostRecent);this.dispatch(Fr.set({ids:n,anchor:o,mostRecent:s})),Et(this.props.onSelect,this.selectedNodes)}get cursorParentId(){const{cursor:t}=this.state.dnd;switch(t.type){case"highlight":return t.id;default:return null}}get cursorOverFolder(){return this.state.dnd.cursor.type==="highlight"}get dragNodes(){return this.state.dnd.dragIds.map(t=>this.get(t)).filter(t=>!!t)}get dragNode(){return this.get(this.state.nodes.drag.id)}get dragDestinationParent(){return this.get(this.state.nodes.drag.destinationParentId)}get dragDestinationIndex(){return this.state.nodes.drag.destinationIndex}canDrop(){var t;if(this.isFiltered)return!1;const r=(t=this.get(this.state.dnd.parentId))!==null&&t!==void 0?t:this.root,n=this.dragNodes,o=this.props.disableDrop;for(const s of n)if(!s||!r||s.isInternal&&tf(r,s))return!1;return typeof o=="function"?!o({parentNode:r,dragNodes:this.dragNodes,index:this.state.dnd.index||0}):typeof o=="string"?!r.data[o]:typeof o=="boolean"?!o:!0}drop(){const{parentId:t,index:r,dragIds:n}=this.state.dnd;Et(this.props.onMove,{dragIds:n,parentId:t===Bo?null:t,index:r===null?0:r,dragNodes:this.dragNodes,parentNode:this.get(t)}),this.open(t)}hideCursor(){this.dispatch(Bn.cursor({type:"none"}))}showCursor(t){this.dispatch(Bn.cursor(t))}open(t,r=!0){var n,o;const s=this.identifyNull(t);s&&(this.isOpen(s)||(this.dispatch(Ri.open(s,this.isFiltered)),r&&this.redrawList((o=(n=this.get(s))===null||n===void 0?void 0:n.rowIndex)!==null&&o!==void 0?o:0),Et(this.props.onToggle,s)))}close(t,r=!0){var n,o;const s=this.identifyNull(t);s&&this.isOpen(s)&&(this.dispatch(Ri.close(s,this.isFiltered)),r&&this.redrawList((o=(n=this.get(s))===null||n===void 0?void 0:n.rowIndex)!==null&&o!==void 0?o:0),Et(this.props.onToggle,s))}toggle(t){const r=this.identifyNull(t);if(r)return this.isOpen(r)?this.close(r):this.open(r)}openParents(t){const r=this.identifyNull(t);if(!r)return;const n=Qi(this.root,r);let o=n==null?void 0:n.parent;for(;o;)this.open(o.id,!1),o=o.parent;this.redrawList()}openSiblings(t){const r=t.parent;if(!r)this.toggle(t.id);else if(r.children){const n=t.isOpen;for(let o of r.children)o.isInternal&&(n?this.close(o.id,!1):this.open(o.id,!1));this.redrawList(),this.scrollTo(this.focusedNode)}}openAll(){oa(this.root,t=>{t.isInternal&&this.open(t.id,!1)}),this.redrawList()}closeAll(){oa(this.root,t=>{t.isInternal&&this.close(t.id,!1)}),this.redrawList()}scrollTo(t,r="smart"){if(!t)return;const n=this.identify(t);return this.openParents(n),af(()=>n in this.idToIndex).then(()=>{var o;const s=this.idToIndex[n];s!==void 0&&((o=this.list.current)===null||o===void 0||o.scrollToItem(s,r))}).catch(()=>{})}get isEditing(){return this.state.nodes.edit.id!==null}get isFiltered(){var t;return!!(!((t=this.props.searchTerm)===null||t===void 0)&&t.trim())}get hasFocus(){return this.state.nodes.focus.treeFocused}get hasNoSelection(){return this.state.nodes.selection.ids.size===0}get hasOneSelection(){return this.state.nodes.selection.ids.size===1}get hasMultipleSelections(){return this.state.nodes.selection.ids.size>1}isSelected(t){return t?this.state.nodes.selection.ids.has(t):!1}isOpen(t){var r,n,o;if(!t)return!1;if(t===Bo)return!0;const s=(r=this.props.openByDefault)!==null&&r!==void 0?r:!0;return this.isFiltered?(n=this.state.nodes.open.filtered[t])!==null&&n!==void 0?n:!0:(o=this.state.nodes.open.unfiltered[t])!==null&&o!==void 0?o:s}isEditable(t){return this.isActionPossible(t,this.props.disableEdit)}isDraggable(t){return this.isActionPossible(t,this.props.disableDrag)}isSelectable(t){return this.isActionPossible(t,this.props.disableSelect)}isActionPossible(t,r=()=>!1){return!$o(t,r)}isDragging(t){const r=this.identifyNull(t);return r?this.state.nodes.drag.id===r:!1}isFocused(t){return this.hasFocus&&this.state.nodes.focus.id===t}isMatch(t){return this.matchFn(t)}willReceiveDrop(t){const r=this.identifyNull(t);if(!r)return!1;const{destinationParentId:n,destinationIndex:o}=this.state.nodes.drag;return r===n&&o===null}onFocus(){const t=this.focusedNode||this.firstNode;t&&this.dispatch(Mn(t.id))}onBlur(){this.dispatch(uw())}onItemsRendered(t){this.visibleStartIndex=t.visibleStartIndex,this.visibleStopIndex=t.visibleStopIndex}get renderContainer(){return this.props.renderContainer||Ah}get renderRow(){return this.props.renderRow||aw}get renderNode(){return this.props.children||iw}get renderDragPreview(){return this.props.renderDragPreview||ff}get renderCursor(){return this.props.renderCursor||sw}}function At(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var $T=typeof Symbol=="function"&&Symbol.observable||"@@observable",Lh=$T,Sl=()=>Math.random().toString(36).substring(7).split("").join("."),BT={INIT:`@@redux/INIT${Sl()}`,REPLACE:`@@redux/REPLACE${Sl()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Sl()}`},an=BT;function Oh(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function qT(e){if(e===void 0)return"undefined";if(e===null)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(zT(e))return"date";if(UT(e))return"error";const r=jT(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function jT(e){return typeof e.constructor=="function"?e.constructor.name:null}function UT(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function zT(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Mr(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=qT(e)),t}function Ph(e,t,r){if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?At(2):`Expected the root reducer to be a function. Instead, received: '${Mr(e)}'`);if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?At(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?At(1):`Expected the enhancer to be a function. Instead, received: '${Mr(r)}'`);return r(Ph)(e,t)}let n=e,o=t,s=new Map,a=s,i=0,c=!1;function d(){a===s&&(a=new Map,s.forEach((v,y)=>{a.set(y,v)}))}function u(){if(c)throw new Error(process.env.NODE_ENV==="production"?At(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return o}function f(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?At(4):`Expected the listener to be a function. Instead, received: '${Mr(v)}'`);if(c)throw new Error(process.env.NODE_ENV==="production"?At(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let y=!0;d();const C=i++;return a.set(C,v),function(){if(y){if(c)throw new Error(process.env.NODE_ENV==="production"?At(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");y=!1,d(),a.delete(C),s=null}}}function m(v){if(!Oh(v))throw new Error(process.env.NODE_ENV==="production"?At(7):`Actions must be plain objects. Instead, the actual type was: '${Mr(v)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(typeof v.type>"u")throw new Error(process.env.NODE_ENV==="production"?At(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(typeof v.type!="string")throw new Error(process.env.NODE_ENV==="production"?At(17):`Action "type" property must be a string. Instead, the actual type was: '${Mr(v.type)}'. Value was: '${v.type}' (stringified)`);if(c)throw new Error(process.env.NODE_ENV==="production"?At(9):"Reducers may not dispatch actions.");try{c=!0,o=n(o,v)}finally{c=!1}return(s=a).forEach(C=>{C()}),v}function g(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?At(10):`Expected the nextReducer to be a function. Instead, received: '${Mr(v)}`);n=v,m({type:an.REPLACE})}function b(){const v=f;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(process.env.NODE_ENV==="production"?At(11):`Expected the observer to be an object. Instead, received: '${Mr(y)}'`);function C(){const w=y;w.next&&w.next(u())}return C(),{unsubscribe:v(C)}},[Lh](){return this}}}return m({type:an.INIT}),{dispatch:m,subscribe:f,getState:u,replaceReducer:g,[Lh]:b}}function Nh(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function VT(e,t,r,n){const o=Object.keys(t),s=r&&r.type===an.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(o.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!Oh(e))return`The ${s} has unexpected type of "${Mr(e)}". Expected argument to be an object with the following keys: "${o.join('", "')}"`;const a=Object.keys(e).filter(i=>!t.hasOwnProperty(i)&&!n[i]);if(a.forEach(i=>{n[i]=!0}),!(r&&r.type===an.REPLACE)&&a.length>0)return`Unexpected ${a.length>1?"keys":"key"} "${a.join('", "')}" found in ${s}. Expected to find one of the known reducer keys instead: "${o.join('", "')}". Unexpected keys will be ignored.`}function HT(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:an.INIT})>"u")throw new Error(process.env.NODE_ENV==="production"?At(12):`The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof r(void 0,{type:an.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?At(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${an.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)})}function xh(e){const t=Object.keys(e),r={};for(let a=0;a<t.length;a++){const i=t[a];process.env.NODE_ENV!=="production"&&typeof e[i]>"u"&&Nh(`No reducer provided for key "${i}"`),typeof e[i]=="function"&&(r[i]=e[i])}const n=Object.keys(r);let o;process.env.NODE_ENV!=="production"&&(o={});let s;try{HT(r)}catch(a){s=a}return function(i={},c){if(s)throw s;if(process.env.NODE_ENV!=="production"){const f=VT(i,r,c,o);f&&Nh(f)}let d=!1;const u={};for(let f=0;f<n.length;f++){const m=n[f],g=r[m],b=i[m],h=g(b,c);if(typeof h>"u"){const v=c&&c.type;throw new Error(process.env.NODE_ENV==="production"?At(14):`When called with an action of type ${v?`"${String(v)}"`:"(unknown type)"}, the slice reducer for key "${m}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}u[m]=h,d=d||h!==b}return d=d||n.length!==Object.keys(i).length,d?u:i}}function QT(e=$n().nodes.drag,t){switch(t.type){case"DND_DRAG_START":return Object.assign(Object.assign({},e),{id:t.id,selectedIds:t.dragIds});case"DND_DRAG_END":return Object.assign(Object.assign({},e),{id:null,destinationParentId:null,destinationIndex:null,selectedIds:[]});case"DND_HOVERING":return t.parentId!==e.destinationParentId||t.index!=e.destinationIndex?Object.assign(Object.assign({},e),{destinationParentId:t.parentId,destinationIndex:t.index}):e;default:return e}}const WT=xh({nodes:xh({focus:fw,edit:dw,open:hw,selection:pw,drag:QT}),dnd:gw}),RT=$n();function GT({treeProps:e,imperativeHandle:t,children:r}){const n=p.useRef(null),o=p.useRef(null),s=p.useRef(Ph(WT,$n(e))),a=KS.useSyncExternalStore(s.current.subscribe,s.current.getState,()=>RT),i=p.useMemo(()=>new zo(s.current,e,n,o),[]),c=p.useRef(0);return p.useMemo(()=>{c.current+=1,i.update(e)},Object.values(e)),p.useMemo(()=>{c.current+=1,i.update(i.props)},[a.nodes.open]),p.useImperativeHandle(t,()=>i),p.useEffect(()=>{i.props.selection?i.select(i.props.selection,{focus:!1}):i.deselectAll()},[i.props.selection]),p.useEffect(()=>{i.props.searchTerm||s.current.dispatch(Ri.clear(!0))},[i.props.searchTerm]),l.jsx(Ru.Provider,{value:i,children:l.jsx(Yu.Provider,{value:c.current,children:l.jsx(Gu.Provider,{value:a.nodes,children:l.jsx(Ku.Provider,{value:a.dnd,children:l.jsx(T1,Object.assign({},e.dndManager?{manager:e.dndManager}:{backend:e.dndBackend||ET,options:{rootElement:i.props.dndRootElement||void 0}},{children:r}))})})})})}function KT(){const e=$t(),[,t]=lh(()=>({accept:"NODE",canDrop:(r,n)=>n.isOver({shallow:!0})?e.canDrop():!1,hover:(r,n)=>{if(!n.isOver({shallow:!0}))return;const o=n.getClientOffset();if(!e.listEl.current||!o)return;const{cursor:s,drop:a}=_h({element:e.listEl.current,offset:o,indent:e.indent,node:null,prevNode:e.visibleNodes[e.visibleNodes.length-1],nextNode:null});a&&e.dispatch(Bn.hovering(a.parentId,a.index)),n.canDrop()?s&&e.showCursor(s):e.hideCursor()},drop:(r,n)=>{if(!n.isOver({shallow:!0})||!n.canDrop())return null;e.drop()}}),[e]);t(e.listEl)}function YT(e){return KT(),e.children}function ZT(){const t=$t().props.renderContainer||Ah;return l.jsx(l.Fragment,{children:l.jsx(t,{})})}function XT(){const e=$t(),{offset:t,mouse:r,item:n,isDragging:o}=Y0(a=>({offset:a.getSourceClientOffset(),mouse:a.getClientOffset(),item:a.getItem(),isDragging:a.isDragging()})),s=e.props.renderDragPreview||ff;return l.jsx(s,{offset:t,mouse:r,id:(n==null?void 0:n.id)||null,dragIds:(n==null?void 0:n.dragIds)||[],isDragging:o})}function JT(e={}){var t,r;const n=(t=e.idAccessor)!==null&&t!==void 0?t:"id",o=(r=e.childrenAccessor)!==null&&r!==void 0?r:"children";return{getId:typeof n=="function"?n:s=>s[n],getChildren:typeof o=="function"?o:s=>s[o],childrenKey:typeof o=="string"?o:"children"}}class eE{constructor(t,r={}){this.accessors=JT(r),this.root=tE(t,this.accessors)}get data(){var t,r;return(r=(t=this.root.children)===null||t===void 0?void 0:t.map(n=>n.data))!==null&&r!==void 0?r:[]}create(t){const r=t.parentId?this.find(t.parentId):this.root;if(!r)return null;r.addChild(t.data,t.index)}move(t){const r=this.find(t.id),n=t.parentId?this.find(t.parentId):this.root;!r||!n||(n.addChild(r.data,t.index),r.drop())}update(t){const r=this.find(t.id);r&&r.update(t.changes)}drop(t){const r=this.find(t.id);r&&r.drop()}find(t,r=this.root){if(!r)return null;if(r.id===t)return r;if(r.children){for(let n of r.children){const o=this.find(t,n);if(o)return o}return null}return null}}function tE(e,t){const r=new Fh({},null,t,"ROOT");return r.children=e.map(n=>wl(n,r,t)),r}function wl(e,t,r){const n=new Fh(e,t,r),o=r.getChildren(e);return o&&(n.children=o.map(s=>wl(s,n,r))),n}class Fh{constructor(t,r,n,o){this.data=t,this.parent=r,this.accessors=n,this.id=o??n.getId(t)}hasParent(){return!!this.parent}get childIndex(){return this.hasParent()?this.parent.children.indexOf(this):-1}addChild(t,r){var n,o;const s=wl(t,this,this.accessors);this.children=(n=this.children)!==null&&n!==void 0?n:[],this.children.splice(r,0,s);const a=this.accessors.childrenKey,i=this.data;i[a]=(o=i[a])!==null&&o!==void 0?o:[],i[a].splice(r,0,t)}removeChild(t){var r,n;(r=this.children)===null||r===void 0||r.splice(t,1),(n=this.data[this.accessors.childrenKey])===null||n===void 0||n.splice(t,1)}update(t){if(this.hasParent()){const r=this.childIndex;this.parent.addChild(Object.assign(Object.assign({},this.data),t),r),this.drop()}}drop(){this.hasParent()&&this.parent.removeChild(this.childIndex)}}let rE=0;function nE(e,t={}){const[r,n]=p.useState(e),o=t.idAccessor,s=t.childrenAccessor,a=p.useMemo(()=>new eE(r,{idAccessor:o,childrenAccessor:s}),[r,o,s]),i=b=>{for(const h of b.dragIds)a.move({id:h,parentId:b.parentId,index:b.index});n(a.data)},c=({name:b,id:h})=>{a.update({id:h,changes:{name:b}}),n(a.data)},d=typeof o=="string"?o:"id",u=typeof s=="string"?s:"children";return[r,{onMove:i,onRename:c,onCreate:({parentId:b,index:h,type:v})=>{if(typeof o=="function")throw new Error("React Arborist => initialData can't create nodes when idAccessor is a function: the generated id can't be written under a key the accessor reads. Use a string idAccessor, or the controlled `data` prop with your own onCreate.");if(v==="internal"&&typeof s=="function")throw new Error("React Arborist => initialData can't create folder nodes when childrenAccessor is a function: the new children array can't be written under a key the accessor reads. Use a string childrenAccessor, or the controlled `data` prop with your own onCreate.");const y={[d]:`simple-tree-id-${rE++}`,name:""};return v==="internal"&&(y[u]=[]),a.create({parentId:b,index:h,data:y}),n(a.data),y},onDelete:b=>{b.ids.forEach(h=>a.drop({id:h})),n(a.data)}}]}function oE(e){if(e.initialData&&e.data)throw new Error("React Arborist Tree => Provide either a data or initialData prop, but not both.");if(e.initialData&&(e.onCreate||e.onDelete||e.onMove||e.onRename))throw new Error(`React Arborist Tree => You passed the initialData prop along with a data handler.
546
+ Use the data prop if you want to provide your own handlers.`);if(e.initialData){const[t,r]=nE(e.initialData,{idAccessor:e.idAccessor,childrenAccessor:e.childrenAccessor});return Object.assign(Object.assign(Object.assign({},e),r),{data:t})}else return e}function sE(e,t){const r=oE(e);return l.jsxs(GT,{treeProps:r,imperativeHandle:t,children:[l.jsx(YT,{children:l.jsx(ZT,{})}),l.jsx(XT,{})]})}const aE=p.forwardRef(sE);function _l(){return re(e=>{var n;const t=e.treeData[0];return(((n=t==null?void 0:t.metadata)==null?void 0:n.status)??(t==null?void 0:t.status)??"Draft").toLowerCase()==="draft"})}function iE(){return re(e=>{var o;if(!e.selectedNodeId)return!1;const t=(o=e.treeData[0])==null?void 0:o.id,r=s=>{var a;for(const i of s){if(i.id===e.selectedNodeId)return i;if((a=i.children)!=null&&a.length){const c=r(i.children);if(c)return c}}},n=r(e.treeData);return!!(n!=null&&n.isFolder)&&n.id!==t})}const Mh={video:"#EA580C",pdf:"#DC2626",h5p:"#0D9488",scorm:"#7C3AED",audio:"#DB2777",quiz:"#16A34A",course:"#A85236",default:"#6B7280"},$h={video:"Video",pdf:"FileText",h5p:"Layers",scorm:"Package",audio:"Music",quiz:"HelpCircle",course:"BookOpen",default:"File"},Bh=["Course Assessment","eTextbook","Exam Question","Explanation Content","Learning Resource","Practice Question Set","SCORM Content","Teacher Resource"],lE=[{label:"All",value:"all"},{label:"Course Assessment",value:"Course Assessment"},{label:"eTextbook",value:"eTextbook"},{label:"Exam Question",value:"Exam Question"},{label:"Explanation Content",value:"Explanation Content"},{label:"Learning Resource",value:"Learning Resource"},{label:"Practice Question Set",value:"Practice Question Set"},{label:"SCORM Content",value:"SCORM Content"},{label:"Teacher Resource",value:"Teacher Resource"}];function cE(e){var r;if((r=e.metadata)!=null&&r.isAssessmentCourse)return"quiz";const t=[e.mimeType??"",e.primaryCategory??"",e.contentType??""].join(" ").toLowerCase();return t.includes("video")?"video":t.includes("pdf")||t.includes("epub")?"pdf":t.includes("h5p")?"h5p":t.includes("scorm")?"scorm":t.includes("audio")||t.includes("mp3")?"audio":t.includes("quiz")||t.includes("question")||t.includes("ecml")?"quiz":e.primaryCategory==="Course"?"course":"default"}function Vo(e){const t=cE(e);return{key:t,color:Mh[t]??Mh.default,bgClass:`sbx-ct-sq--${t}`,badgeClass:`sbx-ct-badge--${t}`,tintClass:`sbx-ct-tint--${t}`,iconName:$h[t]??$h.default,label:t.charAt(0).toUpperCase()+t.slice(1)}}const ct={row:"_row_nm332_1",grip:"_grip_nm332_16",menuBtn:"_menuBtn_nm332_19",rowLp:"_rowLp_nm332_23",selected:"_selected_nm332_27",title:"_title_nm332_32",dropTarget:"_dropTarget_nm332_41",toggle:"_toggle_nm332_58",ctIcon:"_ctIcon_nm332_73",ctIconLp:"_ctIconLp_nm332_85",folderIcon:"_folderIcon_nm332_89",rootIcon:"_rootIcon_nm332_94",titleLp:"_titleLp_nm332_110",levelTitle:"_levelTitle_nm332_114",renameInput:"_renameInput_nm332_119",dropHere:"_dropHere_nm332_128",menuWrap:"_menuWrap_nm332_138",menu:"_menu_nm332_19",dangerItem:"_dangerItem_nm332_190"},dE={video:Us,pdf:Ao,h5p:Fs,scorm:Bs,audio:$s,quiz:xs,course:Nr,default:xr},uE=({node:e,style:t,dragHandle:r,editorMode:n})=>{const[o,s]=p.useState(!1),[a,i]=p.useState(!1),[c,d]=p.useState(e.data.name),u=p.useRef(null),f=oe(),m=K(N=>N.editorProfile),g=n==="edit",b=_l(),h=Vo(e.data),v=dE[h.key]??xr,y=e.isSelected,C=e.level===0,S=e.data.isFolder??(e.children&&e.children.length>0),w=m.key==="learningPath",T=C?w?Vu:by:S?w?Dy:bd:v,E=w&&S&&!C&&!lt(e.data),L=e.level+1<=m.maxDepth,A=w?f.learningPath.addLevelButton:f.treeNode.addSubunitMenuItem,x=w?f.learningPath.addLevelButton:f.treeNode.addSiblingMenuItem;p.useEffect(()=>{if(!o)return;const N=M=>{var B;(B=u.current)!=null&&B.contains(M.target)||s(!1)};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[o]);const F=p.useCallback(()=>{c.trim()&&e.submit(c.trim()),i(!1)},[c,e]),P=p.useCallback(N=>{N.key==="Enter"&&F(),N.key==="Escape"&&(d(e.data.name),i(!1))},[F,e.data.name]);return l.jsxs("div",{className:[ct.row,w?ct.rowLp:"",y?ct.selected:"",e.state.isOver&&S?ct.dropTarget:""].filter(Boolean).join(" "),style:t,onClick:()=>e.select(),"data-node-id":e.data.id,"data-droppable":S?"true":void 0,role:"treeitem","aria-selected":y,"aria-expanded":S?!e.isClosed:void 0,children:[g&&l.jsx("span",{ref:r,className:ct.grip,"aria-hidden":"true",children:l.jsx(Cd,{size:14})}),l.jsx("button",{className:ct.toggle,onClick:N=>{N.stopPropagation(),e.toggle()},"aria-label":e.isClosed?f.treeNode.expandAriaLabel:f.treeNode.collapseAriaLabel,style:{visibility:S?"visible":"hidden"},children:e.isClosed?l.jsx(fi,{size:14}):l.jsx(Zr,{size:14})}),l.jsx("span",{className:[ct.ctIcon,C||S?ct.folderIcon:h.bgClass,w?ct.ctIconLp:"",C&&w?ct.rootIcon:""].filter(Boolean).join(" "),"aria-hidden":"true",children:l.jsx(T,{size:C&&w?15:12})}),a?l.jsx("input",{className:ct.renameInput,value:c,autoFocus:!0,onChange:N=>d(N.target.value),onBlur:F,onKeyDown:P,onClick:N=>N.stopPropagation()}):l.jsx("span",{className:[ct.title,w?ct.titleLp:"",E?ct.levelTitle:""].filter(Boolean).join(" "),title:e.data.name,onDoubleClick:()=>g&&i(!0),children:e.data.name.length>25?`${e.data.name.slice(0,25)}...`:e.data.name}),e.state.isOver&&S&&l.jsx("span",{className:ct.dropHere,"aria-hidden":"true",children:f.treeNode.dropHereLabel}),g&&l.jsxs("div",{className:ct.menuWrap,ref:u,children:[l.jsx("button",{className:ct.menuBtn,onClick:N=>{N.stopPropagation(),s(M=>!M)},"aria-label":f.treeNode.nodeOptionsAriaLabel,children:l.jsx(md,{size:14})}),o&&l.jsxs("div",{className:ct.menu,role:"menu",children:[l.jsxs("button",{role:"menuitem",onClick:()=>{i(!0),s(!1)},children:[l.jsx(Ny,{size:13})," ",f.treeNode.renameMenuItem]}),S&&b&&L&&l.jsxs("button",{role:"menuitem",onClick:()=>{e.tree.create({parentId:e.id}),s(!1)},children:[l.jsx(yd,{size:13})," ",A]}),e.data.parent&&b&&!w&&l.jsxs("button",{role:"menuitem",onClick:()=>{e.tree.create({parentId:e.data.parent}),s(!1)},children:[l.jsx(Xr,{size:13})," ",x]}),!C&&l.jsxs("button",{role:"menuitem",className:ct.dangerItem,onClick:()=>{e.tree.delete(e.id),s(!1)},children:[l.jsx(js,{size:13})," ",f.treeNode.deleteMenuItem]})]})]})]})};async function fE(e,t){var s,a;const n=((s=(await Me.post(`/action/content/v3/upload/url/${e}?type=hierarchy`,{request:{content:{fileName:t}}})).data)==null?void 0:s.result)??{},o=((a=n.content)==null?void 0:a.preSignedURL)??n.pre_signed_url??n.preSignedUrl;if(!o)throw new Error("Could not obtain an upload URL");return o}async function hE(e,t){const r=await fetch(e,{method:"PUT",headers:{"x-ms-blob-type":"BlockBlob","Content-Type":"text/csv"},body:t});if(!r.ok)throw new Error(`Blob upload failed (${r.status})`);return e.split("?")[0]}async function pE(e,t){var i;const r=await fE(e,t.name),n=await hE(r,t),o=new FormData;return o.append("fileUrl",n),o.append("mimeType",t.type||"text/csv"),{processId:(((i=(await Me.post(`/action/collection/v1/import/${e}`,o)).data)==null?void 0:i.result)??{}).processId??""}}async function gE(e){var r;return((r=(await Me.get(`/action/collection/v1/import/status/${e}`)).data)==null?void 0:r.result)??{status:"PENDING"}}async function qh(e){var n,o,s;const r=(s=(o=(n=(await Me.get(`/action/collection/v1/export/${e}`)).data)==null?void 0:n.result)==null?void 0:o.collection)==null?void 0:s.tocUrl;if(!r)throw new Error("No export URL returned");return r}async function mE(e){return qh(e)}const ze={container:"_container_jw2be_1",header:"_header_jw2be_13",title:"_title_jw2be_22",closeBtn:"_closeBtn_jw2be_29",body:"_body_jw2be_45",dropZone:"_dropZone_jw2be_54",dragOver:"_dragOver_jw2be_67",hasFile:"_hasFile_jw2be_72",hiddenInput:"_hiddenInput_jw2be_78",fileInfo:"_fileInfo_jw2be_82",fileIcon:"_fileIcon_jw2be_89",fileName:"_fileName_jw2be_93",fileSize:"_fileSize_jw2be_100",dropHint:"_dropHint_jw2be_105",dropIcon:"_dropIcon_jw2be_112",dropText:"_dropText_jw2be_117",dropSubtext:"_dropSubtext_jw2be_124",sampleLink:"_sampleLink_jw2be_130",statusBar:"_statusBar_jw2be_145",status_uploading:"_status_uploading_jw2be_154",status_processing:"_status_processing_jw2be_154",status_done:"_status_done_jw2be_159",status_error:"_status_error_jw2be_164",successDetail:"_successDetail_jw2be_170",spinner:"_spinner_jw2be_175",spin:"_spin_jw2be_175",errorMsg:"_errorMsg_jw2be_191",failedSection:"_failedSection_jw2be_197",failedTitle:"_failedTitle_jw2be_203",tableWrap:"_tableWrap_jw2be_213",failedTable:"_failedTable_jw2be_219",reasonCell:"_reasonCell_jw2be_244",footer:"_footer_jw2be_248"},vE=({contentId:e,onComplete:t,onClose:r,mode:n="create"})=>{const o=oe(),[s,a]=p.useState(null),[i,c]=p.useState(!1),[d,u]=p.useState("idle"),[f,m]=p.useState(""),[g,b]=p.useState([]),[h,v]=p.useState(null),y=p.useRef(null),C=p.useRef(null),S=p.useCallback(()=>{C.current!==null&&(clearInterval(C.current),C.current=null)},[]);p.useEffect(()=>()=>S(),[S]);const w=P=>P.name.toLowerCase().endsWith(".csv")?P.size>50*1024*1024?(m(o.csvUpload.fileTooLarge),!1):!0:(m(o.csvUpload.invalidFileType),!1),T=p.useCallback(P=>{m(""),b([]),v(null),u("idle"),w(P)&&a(P)},[]),E=p.useCallback(P=>{P.preventDefault(),c(!1);const N=P.dataTransfer.files[0];N&&T(N)},[T]),L=p.useCallback(P=>{var M;const N=(M=P.target.files)==null?void 0:M[0];N&&T(N),P.target.value=""},[T]),A=p.useCallback(async()=>{try{const P=await mE(e),N=document.createElement("a");N.href=P,N.download="sample_hierarchy.csv",N.target="_blank",N.click()}catch{m(o.csvUpload.downloadSampleFailed)}},[e,o.csvUpload.downloadSampleFailed]),x=p.useCallback(async()=>{if(s){u("uploading"),m(""),b([]);try{const{processId:P}=await pE(e,s);if(!P){u("done"),v(null),setTimeout(t,1500);return}u("processing"),C.current=setInterval(async()=>{try{const N=await gE(P);N.status==="COMPLETED"?(S(),u("done"),v(N.successCount??null),N.failedRecords&&N.failedRecords.length>0?b(N.failedRecords):setTimeout(t,1500)):N.status==="FAILED"&&(S(),u("error"),m(o.csvUpload.processingFailed),N.failedRecords&&b(N.failedRecords))}catch{S(),u("error"),m(o.csvUpload.connectionLost)}},2e3)}catch{u("error"),m(o.csvUpload.uploadFailed)}}},[e,s,t,S,o.csvUpload.processingFailed,o.csvUpload.connectionLost,o.csvUpload.uploadFailed]),F={idle:"",uploading:o.csvUpload.statusUploading,processing:o.csvUpload.statusProcessing,done:o.csvUpload.statusDone,error:o.csvUpload.statusError};return l.jsxs("div",{className:ze.container,children:[l.jsxs("div",{className:ze.header,children:[l.jsx("h2",{className:ze.title,children:n==="update"?o.csvUpload.titleUpdate:o.csvUpload.titleCreate}),l.jsx("button",{className:ze.closeBtn,onClick:r,"aria-label":o.csvUpload.closeAriaLabel,children:l.jsx(fr,{size:18})})]}),l.jsxs("div",{className:ze.body,children:[l.jsxs("div",{className:`${ze.dropZone} ${i?ze.dragOver:""} ${s?ze.hasFile:""}`,onDragEnter:P=>{P.preventDefault(),c(!0)},onDragOver:P=>{P.preventDefault(),c(!0)},onDragLeave:P=>{P.preventDefault(),c(!1)},onDrop:E,onClick:()=>{var P;return(P=y.current)==null?void 0:P.click()},role:"button",tabIndex:0,"aria-label":o.csvUpload.dropZoneAriaLabel,onKeyDown:P=>{var N;return P.key==="Enter"&&((N=y.current)==null?void 0:N.click())},children:[l.jsx("input",{ref:y,type:"file",accept:".csv",className:ze.hiddenInput,onChange:L,"aria-hidden":"true"}),s?l.jsxs("div",{className:ze.fileInfo,children:[l.jsx(Ao,{size:24,className:ze.fileIcon}),l.jsx("span",{className:ze.fileName,children:s.name}),l.jsxs("span",{className:ze.fileSize,children:["(",(s.size/1024).toFixed(1)," KB)"]})]}):l.jsxs("div",{className:ze.dropHint,children:[l.jsx(hi,{size:32,className:ze.dropIcon}),l.jsx("p",{className:ze.dropText,children:o.csvUpload.dropText}),l.jsx("p",{className:ze.dropSubtext,children:o.csvUpload.dropSubtext})]})]}),l.jsx("button",{className:ze.sampleLink,onClick:A,type:"button",children:o.csvUpload.downloadSample}),d!=="idle"&&l.jsxs("div",{className:`${ze.statusBar} ${ze[`status_${d}`]}`,role:"status","aria-live":"polite",children:[d==="processing"&&l.jsx("span",{className:ze.spinner,"aria-hidden":"true"}),F[d],d==="done"&&h!==null&&l.jsx("span",{className:ze.successDetail,children:o.csvUpload.itemsImportedSuffix.replace("{count}",String(h))})]}),f&&l.jsx("p",{className:ze.errorMsg,role:"alert",children:f}),g.length>0&&l.jsxs("div",{className:ze.failedSection,children:[l.jsx("h4",{className:ze.failedTitle,children:o.csvUpload.failedRowsTitle.replace("{count}",String(g.length))}),l.jsx("div",{className:ze.tableWrap,children:l.jsxs("table",{className:ze.failedTable,children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:o.csvUpload.rowHeader}),l.jsx("th",{children:o.csvUpload.nameHeader}),l.jsx("th",{children:o.csvUpload.reasonHeader})]})}),l.jsx("tbody",{children:g.map((P,N)=>l.jsxs("tr",{children:[l.jsx("td",{children:P.rowNumber??N+1}),l.jsx("td",{children:P.name??"—"}),l.jsx("td",{className:ze.reasonCell,children:P.reason??o.csvUpload.unknownError})]},N))})]})})]})]}),l.jsxs("div",{className:ze.footer,children:[l.jsx($e,{variant:"ghost",onClick:r,disabled:d==="uploading"||d==="processing",children:o.csvUpload.cancel}),l.jsx($e,{variant:"primary",isLoading:d==="uploading"||d==="processing",disabled:!s||d==="done",onClick:x,children:d==="done"?o.csvUpload.uploaded:o.csvUpload.upload})]})]})};function Tl(){var v,y,C,S,w,T,E;const e=oe(),t=re(L=>L.treeData),r=re(L=>L.treeCache),n=re(L=>L.deleteNode),o=hr(L=>L.activeAssessmentSlot),s=hr(L=>L.setActiveAssessmentSlot),a=hr(L=>L.openModal),i=((v=t[0])==null?void 0:v.children)??[],c=i[0],d=i.length>1?i[i.length-1]:void 0,u=lt(c),f=lt(d),m=t[0],g=m?((y=r[m.id])==null?void 0:y.policy)??((C=m.metadata)==null?void 0:C.policy):void 0,b=!!g&&$u.has(g),h=L=>{const A=L==="pre"?c:d;if(!A)return;const x=L==="pre"&&b?e.learningPath.deletePriorAssessmentConfirm:e.learningPath.deleteAssessmentSlotConfirm;a("confirmDelete",{message:x,onConfirm:()=>n(A.id)})};return{pre:{level:c,filled:u,courseName:u?(w=(S=c==null?void 0:c.children)==null?void 0:S[0])==null?void 0:w.name:void 0,required:b},post:{level:d,filled:f,courseName:f?(E=(T=d==null?void 0:d.children)==null?void 0:T[0])==null?void 0:E.name:void 0,required:!1},activeAssessmentSlot:o,setActiveAssessmentSlot:s,deleteSlot:h}}const ar={container:"_container_2qylm_1",header:"_header_2qylm_8",sectionLabel:"_sectionLabel_2qylm_18",headerActions:"_headerActions_2qylm_26",iconBtn:"_iconBtn_2qylm_33",menuWrap:"_menuWrap_2qylm_51",dropdownMenu:"_dropdownMenu_2qylm_55",treeWrapper:"_treeWrapper_2qylm_87",csvModal:"_csvModal_2qylm_103",footer:"_footer_2qylm_113"},yE=({editorMode:e,collapsed:t=!1,onToggleCollapse:r})=>{var Ae;const n=oe(),o=p.useRef(null),s=p.useRef(null),a=p.useRef(null),[i,c]=p.useState(400),[d,u]=p.useState(!1),[f,m]=p.useState(!1),[g,b]=p.useState("create"),{treeData:h,selectedNodeId:v,selectNode:y,addNode:C,deleteNode:S,getNodeById:w,reorderChildren:T,moveNode:E,setTreeData:L}=re(),A=hr(Y=>Y.openModal),x=K(Y=>Y.editorProfile),F=x.key==="learningPath",P=e==="edit",N=_l(),M=P&&N,B=F?n.learningPath.addLevelButton:n.outlineTree.addUnitButton,U=x.maxDepth>1,ee=(((Ae=h[0])==null?void 0:Ae.children)??[]).some(Y=>Y.isFolder),{pre:Q,post:te,deleteSlot:ue}=Tl(),{level:fe}=Q,{level:pe}=te,ie=K(Y=>{var de,W,Ce,Ve;return((W=(de=Y.editorConfig)==null?void 0:de.context)==null?void 0:W.contentId)??((Ve=(Ce=Y.editorConfig)==null?void 0:Ce.context)==null?void 0:Ve.identifier)??""}),Te=K(Y=>{var W,Ce;const de=(Ce=(W=Y.categoryMeta)==null?void 0:W.sourcingSettings)==null?void 0:Ce.collection;return(de==null?void 0:de.enableBulkUpload)!==!1}),ye=x.features.csvUpload&&Te;p.useEffect(()=>{const Y=s.current;if(!Y)return;const de=new ResizeObserver(()=>{c(Y.clientHeight||400)});return de.observe(Y),c(Y.clientHeight||400),()=>de.disconnect()},[]),p.useEffect(()=>{if(!d)return;const Y=de=>{var W;(W=a.current)!=null&&W.contains(de.target)||u(!1)};return document.addEventListener("mousedown",Y),()=>document.removeEventListener("mousedown",Y)},[d]);const $=p.useCallback(Y=>{Y.length>0&&y(Y[0].data.id)},[y]),q=p.useCallback(({parentId:Y,index:de,dragIds:W})=>{if(!Y)return;const Ce=W[0],Ve=El(h,Ce);if(!Ve)return;const nt=Ve.parent;if(nt===Y){const He=El(h,Y);if(!(He!=null&&He.children))return;const Ke=He.children.findIndex(ot=>ot.id===Ce);if(Ke<0)return;T(Y,Ke,de>Ke?de-1:de)}else E(Ce,nt??"",Y)},[h,T,E]),Z=p.useCallback(({ids:Y})=>{if(!F){for(const W of Y)S(W);return}if(Y.length===1){const W=Y[0];if((fe==null?void 0:fe.id)===W){ue("pre");return}if((pe==null?void 0:pe.id)===W){ue("post");return}const Ce=w(W),Ve=Ce!=null&&Ce.isFolder?n.learningPath.deleteLevelConfirm.replace("{name}",Ce.name):n.learningPath.deleteCourseConfirm;A("confirmDelete",{message:Ve,onConfirm:()=>S(W)});return}const de=n.learningPath.deleteMultipleConfirm.replace("{count}",String(Y.length));A("confirmDelete",{message:de,onConfirm:()=>{for(const W of Y)S(W)}})},[S,ue,F,fe,pe,w,A,n]),he=p.useCallback(({parentId:Y})=>{var Ce;const de=Y??((Ce=h[0])==null?void 0:Ce.id)??"";if(!de)return{id:crypto.randomUUID()};const W=C(de,"unit");return W?{id:W}:(Se.error(n.outlineTree.maxDepthReachedToast),{id:crypto.randomUUID()})},[C,h,n]),be=p.useCallback(()=>{var de;const Y=(de=h[0])==null?void 0:de.id;Y&&(C(Y,"unit")||Se.error(n.outlineTree.maxDepthReachedToast))},[h,C,n]),ge=p.useCallback(()=>{v&&(C(v,"subunit")||Se.error(n.outlineTree.maxDepthReachedToast))},[v,C,n]),le=p.useCallback(async()=>{if(u(!1),!!ie)try{const Y=await qh(ie),de=await fetch(Y).then(Ve=>Ve.blob()),W=URL.createObjectURL(de),Ce=document.createElement("a");Ce.href=W,Ce.download=`${ie}-folders.csv`,Ce.style.display="none",document.body.appendChild(Ce),Ce.click(),document.body.removeChild(Ce),URL.revokeObjectURL(W)}catch{Se.error(n.outlineTree.downloadCsvFailedToast)}},[ie,n]),ve=p.useCallback(async()=>{if(m(!1),!!ie)try{const{rootNode:Y}=await Au(ie);L([Y]),Se.success(n.outlineTree.outlineRefreshedToast)}catch{Se.error(n.outlineTree.outlineRefreshFailedToast)}},[ie,L,n]);return l.jsxs("div",{className:ar.container,children:[l.jsxs("div",{className:ar.header,children:[F&&l.jsx("span",{className:ar.sectionLabel,children:n.learningPath.pathStructureLabel}),l.jsxs("div",{className:ar.headerActions,children:[P&&ye&&l.jsxs("div",{className:ar.menuWrap,ref:a,children:[l.jsx("button",{type:"button",className:ar.iconBtn,onClick:()=>u(Y=>!Y),"aria-label":n.outlineTree.moreOptionsAriaLabel,title:n.outlineTree.moreOptionsTitle,"aria-haspopup":"true","aria-expanded":d,children:l.jsx(md,{size:15})}),d&&l.jsxs("div",{className:ar.dropdownMenu,role:"menu",children:[l.jsx("button",{role:"menuitem",type:"button",disabled:ee,title:ee?n.outlineTree.foldersExistTitle:void 0,onClick:()=>{u(!1),b("create"),m(!0)},children:n.outlineTree.createFoldersCsvButton}),l.jsx("button",{role:"menuitem",type:"button",disabled:!ee,title:ee?void 0:n.outlineTree.noFoldersYetTitle,onClick:le,children:n.outlineTree.downloadFoldersCsvButton}),l.jsx("button",{role:"menuitem",type:"button",disabled:!ee,title:ee?void 0:n.outlineTree.noFoldersYetTitle,onClick:()=>{u(!1),b("update"),m(!0)},children:n.outlineTree.updateFoldersCsvButton})]})]}),r&&l.jsx("button",{type:"button",className:ar.iconBtn,onClick:r,"aria-label":t?n.outlineTree.expandOutlineAriaLabel:n.outlineTree.collapseOutlineAriaLabel,title:t?n.outlineTree.expandOutlineAriaLabel:n.outlineTree.collapseOutlineAriaLabel,children:t?l.jsx(Oy,{size:15}):l.jsx(Ly,{size:15})})]})]}),l.jsx("div",{className:ar.treeWrapper,ref:s,children:l.jsx(aE,{ref:o,data:h,idAccessor:"id",childrenAccessor:"children",onSelect:$,onMove:P?q:void 0,onDelete:P?Z:void 0,onCreate:P?he:void 0,disableEdit:!P,disableDrop:!P,selection:v??void 0,rowHeight:40,indent:20,paddingBottom:16,height:i,width:"100%",children:Y=>l.jsx(uE,{...Y,editorMode:e})})}),P&&l.jsxs("div",{className:ar.footer,children:[l.jsxs($e,{variant:"ghost",size:"sm",onClick:be,disabled:!M,children:[l.jsx(Xr,{size:14})," ",B]}),U&&l.jsxs($e,{variant:"ghost",size:"sm",onClick:ge,disabled:!M||!v,children:[l.jsx(yd,{size:14})," ",n.outlineTree.addSubunitButton]})]}),f&&l.jsx("div",{className:ar.csvModal,children:l.jsx(vE,{contentId:ie,mode:g,onComplete:ve,onClose:()=>m(!1)})})]})};function El(e,t){for(const r of e){if(r.id===t)return r;if(r.children){const n=El(r.children,t);if(n)return n}}}const Ho={breadcrumb:"_breadcrumb_zd1aj_1",crumb:"_crumb_zd1aj_10",sep:"_sep_zd1aj_26",current:"_current_zd1aj_31"},bE=({crumbs:e})=>{const t=re(n=>n.selectNode),r=oe();return e.length?l.jsxs("nav",{className:Ho.breadcrumb,"aria-label":r.breadcrumb.nodePathAriaLabel,children:[l.jsx("button",{className:Ho.crumb,onClick:()=>t(e[0].id),"aria-label":r.breadcrumb.homeAriaLabel,children:l.jsx(ky,{size:13})}),e.map((n,o)=>l.jsxs(p.Fragment,{children:[l.jsx(fi,{size:13,className:Ho.sep}),o<e.length-1?l.jsx("button",{className:Ho.crumb,onClick:()=>t(n.id),children:n.name}):l.jsx("span",{className:Ho.current,children:n.name})]},n.id))]}):null},Qo={tabBar:"_tabBar_qhks1_1",tab:"_tab_qhks1_1",active:"_active_qhks1_29",error:"_error_qhks1_35",errorDot:"_errorDot_qhks1_39"},CE=({activeTab:e,onChange:t,errorTabs:r=[],visibleTabs:n})=>{const o=oe(),s=[{id:"details",label:o.tabBar.detailsTab},{id:"audience",label:o.tabBar.audienceCurriculumTab},{id:"licensing",label:o.tabBar.licensingTab}],a=n?s.filter(i=>n.includes(i.id)):s;return l.jsx("div",{className:Qo.tabBar,role:"tablist","aria-label":o.tabBar.metadataSectionsAriaLabel,children:a.map(i=>l.jsxs("button",{role:"tab","aria-selected":e===i.id,"aria-controls":`panel-${i.id}`,className:[Qo.tab,e===i.id?Qo.active:"",r.includes(i.id)?Qo.error:""].join(" "),onClick:()=>t(i.id),children:[i.label,r.includes(i.id)&&l.jsx("span",{className:Qo.errorDot,"aria-label":o.tabBar.hasErrorsAriaLabel})]},i.id))})};var Wo=e=>e.type==="checkbox",ln=e=>e instanceof Date,bt=e=>e==null;const jh=e=>typeof e=="object";var Ye=e=>!bt(e)&&!Array.isArray(e)&&jh(e)&&!ln(e),Al=e=>Ye(e)&&e.target?Wo(e.target)?e.target.checked:e.target.value:e,Uh=(e,t)=>t.split(".").some((r,n,o)=>!isNaN(Number(r))&&e.has(o.slice(0,n).join("."))),zh=e=>{const t=e.constructor&&e.constructor.prototype;return Ye(t)&&t.hasOwnProperty("isPrototypeOf")},wa=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function et(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(wa&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(Ye(e)&&zh(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=et(e[o]));return n}const $r={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},ir={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},lr={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},kl="form",Vh="root",Hh=["__proto__","constructor","prototype"];var Ro=e=>/^\w*$/.test(e),Ge=e=>e===void 0,_a=e=>e.split(/[.[\]'"]/g).filter(Boolean),G=(e,t,r)=>{if(!t||!Ye(e))return r;const n=Ro(t)?[t]:_a(t);if(n.some(s=>Hh.includes(s)))return r;const o=n.reduce((s,a)=>bt(s)?void 0:s[a],e);return Ge(o)||o===e?Ge(e[t])?r:e[t]:o},Ut=e=>typeof e=="boolean",kt=e=>typeof e=="function",Qe=(e,t,r)=>{let n=-1;const o=Ro(t)?[t]:_a(t),s=o.length,a=s-1;for(;++n<s;){const i=o[n];let c=r;if(n!==a){const d=e[i];c=Ye(d)||Array.isArray(d)?d:isNaN(+o[n+1])?{}:[]}if(Hh.includes(i))return;e[i]=c,e=e[i]}};const Il=p.createContext(null);Il.displayName="HookFormControlContext";const Dl=()=>p.useContext(Il);var Qh=(e,t,r,n=!0)=>{const o={};for(const s in e)Object.defineProperty(o,s,{get:()=>{const a=s;return t._proxyFormState[a]!==ir.all&&(t._proxyFormState[a]=!n||ir.all),r&&(r[a]=!0),e[a]}});return o};const Ll=wa?p.useLayoutEffect:p.useEffect;function SE(e){const t=Dl(),{control:r=t,disabled:n,name:o,exact:s}=e||{},[a,i]=p.useState(()=>({...r._formState,defaultValues:r._defaultValues})),c=p.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Ll(()=>r._subscribe({name:o,formState:c.current,exact:s,callback:d=>{!n&&i({...r._formState,...d,defaultValues:r._defaultValues})}}),[o,n,s]),p.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),p.useMemo(()=>Qh(a,r,c.current,!1),[a,r])}var It=e=>typeof e=="string",Ol=(e,t,r,n,o)=>It(e)?(n&&t.watch.add(e),G(r,e,o)):Array.isArray(e)?e.map(s=>(n&&t.watch.add(s),G(r,s))):(n&&(t.watchAll=!0),r),Pl=e=>bt(e)||!jh(e);const Wh=(e,t)=>t.length===0&&!Array.isArray(e)&&!zh(e);function zt(e,t,r=new WeakMap){if(e===t)return!0;if(Pl(e)||Pl(t))return Object.is(e,t);if(ln(e)&&ln(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;if(Wh(e,n)||Wh(t,o))return Object.is(e,t);const s=r.get(e);if(s&&s.has(t))return!0;s?s.add(t):r.set(e,new WeakSet([t]));for(const a of n){const i=e[a];if(!(a in t))return!1;if(a!=="ref"){const c=t[a];if(ln(i)&&ln(c)||(Ye(i)||Array.isArray(i))&&(Ye(c)||Array.isArray(c))?!zt(i,c,r):!Object.is(i,c))return!1}}return!0}function wE(e){const t=Dl(),{control:r=t,name:n,defaultValue:o,disabled:s,exact:a,compute:i}=e||{},c=p.useRef(o),d=p.useRef(i),u=p.useRef(void 0),f=p.useRef(r),m=p.useRef(n);d.current=i;const[g,b]=p.useState(()=>{const w=r._getWatch(n,c.current);return d.current?d.current(w):w}),h=p.useCallback(w=>{const T=Ol(n,r._names,w||r._formValues,!1,c.current);return d.current?d.current(T):T},[r._formValues,r._names,n]),v=p.useCallback(w=>{if(!s){const T=Ol(n,r._names,w||r._formValues,!1,c.current);if(d.current){const E=d.current(T);zt(E,u.current)||(b(E),u.current=E)}else b(T)}},[r._formValues,r._names,s,n]);Ll(()=>((f.current!==r||!zt(m.current,n))&&(f.current=r,m.current=n,v()),r._subscribe({name:n,formState:{values:!0},exact:a,callback:w=>{v(w.values)}})),[r,a,n,v]),p.useEffect(()=>r._removeUnmounted());const y=f.current!==r,C=m.current,S=p.useMemo(()=>{if(s)return null;const w=!y&&!zt(C,n);return y||w?h():null},[s,y,n,C,h]);return S!==null?S:g}function Go(e){const t=Dl(),{name:r,disabled:n,control:o=t,shouldUnregister:s,defaultValue:a,exact:i=!0}=e,c=Uh(o._names.array,r),d=p.useMemo(()=>G(o._formValues,r,G(o._defaultValues,r,a)),[o,r,a]),u=wE({control:o,name:r,defaultValue:d,exact:i}),f=SE({control:o,name:r,exact:i}),m=p.useRef(e),g=p.useRef(null),b=p.useRef(o.register(r,{...e.rules,value:u,...Ut(e.disabled)?{disabled:e.disabled}:{}}));m.current=e;const h=p.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!G(f.errors,r)},isDirty:{enumerable:!0,get:()=>!!G(f.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!G(f.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!G(f.validatingFields,r)},error:{enumerable:!0,get:()=>G(f.errors,r)}}),[f,r]),v=p.useCallback(w=>{const T=Al(w);return G(o._fields,r)||(b.current=o.register(r,{...m.current.rules,value:T})),b.current.onChange({target:{value:Al(w),name:r},type:$r.CHANGE})},[r,o]),y=p.useCallback(()=>b.current.onBlur({target:{value:G(o._formValues,r),name:r},type:$r.BLUR}),[r,o._formValues]),C=p.useCallback(w=>{w&&(g.current={focus:()=>kt(w.focus)&&w.focus(),select:()=>kt(w.select)&&w.select(),setCustomValidity:E=>kt(w.setCustomValidity)&&w.setCustomValidity(E),reportValidity:()=>kt(w.reportValidity)&&w.reportValidity()});const T=G(o._fields,r);T&&T._f&&w&&(T._f.ref=g.current)},[o._fields,r]),S=p.useMemo(()=>({name:r,value:u,...Ut(n)||f.disabled?{disabled:f.disabled||n}:{},onChange:v,onBlur:y,ref:C}),[r,n,f.disabled,v,y,C,u]);return p.useEffect(()=>{const w=o._options.shouldUnregister||s;o.register(r,{...m.current.rules,...Ut(m.current.disabled)?{disabled:m.current.disabled}:{}});const T=(E,L)=>{const A=G(o._fields,E);A&&A._f&&(A._f.mount=L)};if(T(r,!0),w){const E=et(G(s?o._defaultValues:o._options.values||o._defaultValues,r,G(o._options.defaultValues,r,m.current.defaultValue)));Qe(o._defaultValues,r,E),Ge(G(o._formValues,r))&&Qe(o._formValues,r,E)}if(!c&&o.register(r),g.current){const E=G(o._fields,r);E&&E._f&&(E._f.ref=g.current)}return()=>{(c?w&&!o._state.action:w)?o.unregister(r):T(r,!1)}},[r,o,c,s]),p.useEffect(()=>{o._setDisabledField({disabled:n,name:r})},[n,r,o]),p.useMemo(()=>({field:S,formState:f,fieldState:h}),[S,f,h])}const _E=e=>e.render(Go(e)),Nl=p.createContext(null);Nl.displayName="HookFormContext";const Yt=()=>p.useContext(Nl),TE=({children:e,watch:t,getValues:r,getFieldState:n,setError:o,clearErrors:s,setValue:a,setValues:i,trigger:c,formState:d,resetField:u,reset:f,handleSubmit:m,unregister:g,control:b,register:h,setFocus:v,subscribe:y})=>{const C=p.useMemo(()=>({watch:t,getValues:r,getFieldState:n,setError:o,clearErrors:s,setValue:a,setValues:i,trigger:c,formState:d,resetField:u,reset:f,handleSubmit:m,unregister:g,control:b,register:h,setFocus:v,subscribe:y}),[s,b,d,n,r,m,h,f,u,o,v,a,i,y,c,g,t]);return p.createElement(Nl.Provider,{value:C},p.createElement(Il.Provider,{value:C.control},e))};var EE=(e,t,r,n,o)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:o||!0}}:{},Rh=e=>Array.isArray(e)?e.filter(Boolean):[],Ta=e=>Array.isArray(e)?e:[e],Gh=()=>{let e=[];return{get observers(){return e},next:o=>{for(const s of e)s.next&&s.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(s=>s!==o)}}),unsubscribe:()=>{e=[]}}};function Kh(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const o=e[n],s=t[n];if(o&&Ye(o)&&s){const a=Kh(o,s);Ye(a)&&(r[n]=a)}else e[n]&&(r[n]=s)}return r}var ft=e=>Ye(e)&&!Object.keys(e).length,xl=e=>e.type==="file",Ea=e=>{if(!wa)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Yh=e=>e.type==="select-multiple",Fl=e=>e.type==="radio",AE=e=>Fl(e)||Wo(e),Ml=e=>Ea(e)&&e.isConnected;function kE(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;){if(bt(e)){e=void 0;break}e=e[t[n]],n++}return e}function IE(e){for(const t in e)if(e.hasOwnProperty(t)&&!Ge(e[t]))return!1;return!0}function st(e,t){if(It(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;const r=Array.isArray(t)?t:Ro(t)?[t]:_a(t),n=r.length===1?e:kE(e,r),o=r.length-1,s=r[o];return n&&delete n[s],o!==0&&(Ye(n)&&ft(n)||Array.isArray(n)&&IE(n))&&st(e,r.slice(0,-1)),e}var DE=e=>{for(const t in e)if(kt(e[t]))return!0;return!1};function Zh(e){return Array.isArray(e)||Ye(e)&&!DE(e)}function $l(e,t={}){for(const r in e){const n=e[r];Zh(n)?(t[r]=Array.isArray(n)?[]:{},$l(n,t[r])):Ge(n)||(t[r]=!0)}return t}function Bl(e){if(e!==!1){if(e===!0)return!0;if(Array.isArray(e)){const t=e.map(r=>Bl(r));return t.some(r=>r!==void 0)?t:void 0}if(Ye(e)){const t={};for(const r in e){const n=Bl(e[r]);Ge(n)||(t[r]=n)}return Object.keys(t).length?t:void 0}}}function cn(e,t,r){r||(r=$l(t));for(const n in e){const o=e[n];if(Zh(o))Ge(t)||Pl(r[n])?r[n]=$l(o,Array.isArray(o)?[]:{}):cn(o,bt(t)?{}:t[n],r[n]);else{const s=t[n];r[n]=!zt(o,s)}}return Bl(r)||{}}const Xh={value:!1,isValid:!1},Jh={value:!0,isValid:!0};var ep=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Ge(e[0].attributes.value)?Ge(e[0].value)||e[0].value===""?Jh:{value:e[0].value,isValid:!0}:Jh:Xh}return Xh},tp=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Ge(e)?e:t?e===""?NaN:e&&+e:r&&It(e)?new Date(e):n?n(e):e;const rp={isValid:!1,value:null};var np=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,rp):rp;function op(e){const t=e.ref;return xl(t)?t.files:Fl(t)?np(e.refs).value:Yh(t)?[...t.selectedOptions].map(({value:r})=>r):Wo(t)?ep(e.refs).value:tp(Ge(t.value)?e.ref.value:t.value,e)}var LE=(e,t,r,n)=>{const o={};for(const s of e){const a=G(t,s);a&&Qe(o,s,a._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:n}},Aa=e=>e instanceof RegExp,Ko=e=>Ge(e)?e:Aa(e)?e.source:Ye(e)?Aa(e.value)?e.value.source:e.value:e,sp=e=>({isOnSubmit:!e||e===ir.onSubmit,isOnBlur:e===ir.onBlur,isOnChange:e===ir.onChange,isOnAll:e===ir.all,isOnTouch:e===ir.onTouched});const ap="AsyncFunction";var OE=e=>!!e&&!!e.validate&&!!(kt(e.validate)&&e.validate.constructor.name===ap||Ye(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===ap)),PE=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),ql=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(`${n}.`)));const Yo=(e,t,r,n)=>{for(const o of r||Object.keys(e)){const s=G(e,o);if(s){const{_f:a,...i}=s;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],o)&&!n)return!0;if(a.ref&&t(a.ref,a.name)&&!n)return!0;if(Yo(i,t))break}else if(Ye(i)&&Yo(i,t))break}}};function ip(e,t,r){const n=G(e,r);if(n||Ro(r))return{error:n,name:r};const o=r.split(".");for(;o.length;){const s=o.join("."),a=G(t,s),i=G(e,s);if(a&&!Array.isArray(a)&&r!==s)return{name:r};if(i&&i.type)return{name:s,error:i};if(i&&i.root&&i.root.type)return{name:`${s}.root`,error:i.root};o.pop()}return{name:r}}var NE=(e,t,r,n)=>{r(e);const{name:o,...s}=e;return ft(s)||n&&Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(a=>t[a]===(!n||ir.all))},xE=(e,t,r)=>!e||!t||e===t||Ta(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),FE=(e,t,r,n,o)=>o.isOnAll?!1:!r&&o.isOnTouch?!(t||e):(r?n.isOnBlur:o.isOnBlur)?!e:(r?n.isOnChange:o.isOnChange)?e:!0,ME=(e,t)=>!Rh(G(e,t)).length&&st(e,t),lp=(e,t,r)=>{const n=G(e,r),o=Array.isArray(n)?n:[];return Qe(o,Vh,t[r]),Qe(e,r,o),e};function cp(e,t,r="validate"){if(It(e)||Array.isArray(e)&&e.every(It)||Ut(e)&&!e)return{type:r,message:It(e)?e:"",ref:t}}var Qn=e=>Ye(e)&&!Aa(e)?e:{value:e,message:""},dp=async(e,t,r,n,o,s)=>{const{ref:a,refs:i,required:c,maxLength:d,minLength:u,min:f,max:m,pattern:g,validate:b,name:h,valueAsNumber:v,mount:y}=e._f,C=G(r,h);if(!y||t.has(h))return{};const S=i?i[0]:a,w=N=>{if(o&&S.reportValidity){const M=Ut(N)?"":N||"";i?i.forEach(B=>B.setCustomValidity(M)):S.setCustomValidity(M),S.reportValidity()}},T={},E=Fl(a),L=Wo(a),A=E||L,x=(v||xl(a))&&Ge(a.value)&&Ge(C)||Ea(a)&&a.value===""||C===""||Array.isArray(C)&&!C.length,F=EE.bind(null,h,n,T),P=(N,M,B,U=lr.maxLength,ee=lr.minLength)=>{const Q=N?M:B;T[h]={type:N?U:ee,message:Q,ref:a,...F(N?U:ee,Q)}};if(s?!Array.isArray(C)||!C.length:c&&(!A&&(x||bt(C))||Ut(C)&&!C||L&&!ep(i).isValid||E&&!np(i).isValid)){const{value:N,message:M}=It(c)?{value:!!c,message:c}:Qn(c);if(N&&(T[h]={type:lr.required,message:M,ref:S,...F(lr.required,M)},!n))return w(M),T}if(!x&&(!bt(f)||!bt(m))){let N,M;const B=Qn(m),U=Qn(f);if(!bt(C)&&!isNaN(C)){const ee=a.valueAsNumber||C&&+C;bt(B.value)||(N=ee>B.value),bt(U.value)||(M=ee<U.value)}else{const ee=a.valueAsDate||new Date(C),Q=fe=>new Date(new Date().toDateString()+" "+fe),te=a.type=="time",ue=a.type=="week";It(B.value)&&C&&(N=te?Q(C)>Q(B.value):ue?C>B.value:ee>new Date(B.value)),It(U.value)&&C&&(M=te?Q(C)<Q(U.value):ue?C<U.value:ee<new Date(U.value))}if((N||M)&&(P(!!N,B.message,U.message,lr.max,lr.min),!n))return w(T[h].message),T}if((d||u)&&!x&&(It(C)||s&&Array.isArray(C))){const N=Qn(d),M=Qn(u),B=!bt(N.value)&&C.length>+N.value,U=!bt(M.value)&&C.length<+M.value;if((B||U)&&(P(B,N.message,M.message),!n))return w(T[h].message),T}if(g&&!x&&It(C)){const{value:N,message:M}=Qn(g);if(Aa(N)&&!C.match(N)&&(T[h]={type:lr.pattern,message:M,ref:a,...F(lr.pattern,M)},!n))return w(M),T}if(b){if(kt(b)){const N=await b(C,r),M=cp(N,S);if(M&&(T[h]={...M,...F(lr.validate,M.message)},!n))return w(M.message),T}else if(Ye(b)){let N={};for(const M in b){if(!ft(N)&&!n)break;const B=cp(await b[M](C,r),S,M);B&&(N={...B,...F(M,B.message)},w(B.message),n&&(T[h]=N))}if(!ft(N)&&(T[h]={ref:S,...N},!n))return T}}return w(!0),T};const $E={mode:ir.onSubmit,reValidateMode:ir.onChange,shouldFocusError:!0},up={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function BE(e={}){let t={...$E,...e},r={...et(up),isLoading:kt(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},n={},o=Ye(t.defaultValues)||Ye(t.values)?et(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:et(o),a={action:!1,mount:!1,watch:!1,keepIsValid:!1},i={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},c,d=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={...u};let m={...f};const g={array:Gh(),state:Gh()},b=t.criteriaMode===ir.all,h=_=>k=>{clearTimeout(d),d=setTimeout(_,k)},v=async _=>{if(!a.keepIsValid&&!t.disabled&&(f.isValid||m.isValid||_)){let k;t.resolver?(k=ft((await F()).errors),y()):k=await M({fields:n,onlyCheckValid:!0,eventType:$r.VALID}),k!==r.isValid&&g.state.next({isValid:k})}},y=(_,k)=>{!t.disabled&&(f.isValidating||f.validatingFields||m.isValidating||m.validatingFields)&&((_||Array.from(i.mount)).forEach(D=>{D&&(k?Qe(r.validatingFields,D,k):st(r.validatingFields,D))}),g.state.next({validatingFields:r.validatingFields,isValidating:!ft(r.validatingFields)}))},C=()=>{r.dirtyFields=cn(o,s)},S=(_,k=[],D,z,V=!0,R=!0)=>{if(z&&D&&!t.disabled){if(a.action=!0,R&&Array.isArray(G(n,_))){const H=D(G(n,_),z.argA,z.argB);V&&Qe(n,_,H)}if(R&&Array.isArray(G(r.errors,_))){const H=D(G(r.errors,_),z.argA,z.argB);V&&Qe(r.errors,_,H),ME(r.errors,_)}if((f.touchedFields||m.touchedFields)&&R&&Array.isArray(G(r.touchedFields,_))){const H=D(G(r.touchedFields,_),z.argA,z.argB);V&&Qe(r.touchedFields,_,H)}(f.dirtyFields||m.dirtyFields)&&C(),g.state.next({name:_,isDirty:U(_,k),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Qe(s,_,k)},w=(_,k)=>{Qe(r.errors,_,k),r.errors={...r.errors},g.state.next({errors:r.errors})},T=_=>{r.errors=_,g.state.next({errors:r.errors,isValid:!1})},E=_=>{const k=Ro(_)?[_]:_a(_);let D=s,z=o;for(let V=0;V<k.length-1;V++){const R=k[V];if(D=bt(D)?D:D[R],z=bt(z)?z:z[R],D===null&&z!==null)return!0}return!1},L=(_,k,D,z)=>{const V=G(n,_);if(V){if(E(_))return;const R=Ge(G(s,_)),H=G(s,_,Ge(D)?G(o,_):D);Ge(H)||z&&z.defaultChecked||k?Qe(s,_,k?H:op(V._f)):te(_,H),a.mount&&!a.action&&(v(),R&&r.isDirty&&(f.isDirty||m.isDirty)&&(U()||(r.isDirty=!1,g.state.next({...r}))),e.shouldUnregister&&R&&!Ge(G(s,_))&&ql(_,i)&&(a.watch=!0))}},A=(_,k,D,z,V)=>{let R=!1,H=!1;const se={name:_};if(!t.disabled){if(!D||z){(f.isDirty||m.isDirty)&&(H=r.isDirty,r.isDirty=se.isDirty=U(),R=H!==se.isDirty);const ae=zt(G(o,_),k);H=!!G(r.dirtyFields,_),ae!==r.isDirty?r.dirtyFields=cn(o,s):ae?st(r.dirtyFields,_):Qe(r.dirtyFields,_,!0),se.dirtyFields=r.dirtyFields,R=R||(f.dirtyFields||m.dirtyFields)&&H!==!ae}if(D){const ae=G(r.touchedFields,_);ae||(Qe(r.touchedFields,_,D),se.touchedFields=r.touchedFields,R=R||(f.touchedFields||m.touchedFields)&&ae!==D)}R&&V&&g.state.next(se)}return R?se:{}},x=(_,k,D,z)=>{const V=G(r.errors,_),R=(f.isValid||m.isValid)&&Ut(k)&&r.isValid!==k;if(t.delayError&&D?(c=h(()=>w(_,D)),c(t.delayError)):(clearTimeout(d),c=null,D?Qe(r.errors,_,D):st(r.errors,_),r.errors={...r.errors}),(D?!zt(V,D):V)||!ft(z)||R){const H={...z,...R&&Ut(k)?{isValid:k}:{},errors:r.errors,name:_};r={...r,...H},g.state.next(H)}},F=async _=>(y(_,!0),await t.resolver(s,t.context,LE(_||i.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),P=async _=>{const{errors:k}=await F(_);if(y(_),_){for(const D of _){const z=G(k,D);z?i.array.has(D)&&Ye(z)&&!Object.keys(z).some(V=>!Number.isNaN(Number(V)))?lp(r.errors,{[D]:z},D):Qe(r.errors,D,z):st(r.errors,D)}r.errors={...r.errors}}else r.errors=k;return k},N=async({name:_,eventType:k})=>{if(e.validate){const D=await e.validate({formValues:s,formState:r,name:_,eventType:k});if(Ye(D))for(const z in D){const V=D[z];V&&be(`${kl}.${z}`,{message:It(V.message)?V.message:"",type:V.type||lr.validate})}else It(D)||!D?be(kl,{message:D||"",type:lr.validate}):he(kl);return D}return!0},M=async({fields:_,onlyCheckValid:k,name:D,eventType:z,context:V={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(V.runRootValidation=!0,!await N({name:D,eventType:z})&&(V.valid=!1,k)))return V.valid;for(const R in _){const H=_[R];if(H){const{_f:se,...ae}=H;if(se){const Fe=i.array.has(se.name),Je=H._f&&OE(H._f),dt=f.validatingFields||f.isValidating||m.validatingFields||m.isValidating;Je&&dt&&y([se.name],!0);const er=await dp(H,i.disabled,s,b,t.shouldUseNativeValidation&&!k,Fe);if(Je&&dt&&y([se.name]),er[se.name]&&(V.valid=!1,k)||(!k&&(G(er,se.name)?Fe?lp(r.errors,er,se.name):Qe(r.errors,se.name,er[se.name]):st(r.errors,se.name)),e.shouldUseNativeValidation&&er[se.name]))break}!ft(ae)&&await M({context:V,onlyCheckValid:k,fields:ae,name:R,eventType:z})}}return V.valid},B=()=>{for(const _ of i.unMount){const k=G(n,_);k&&(k._f.refs?k._f.refs.every(D=>!Ml(D)):!Ml(k._f.ref))&&Ae(_)}i.unMount=new Set},U=(_,k)=>!t.disabled&&(_&&k&&Qe(s,_,k),!zt(q(),o)),ee=(_,k,D)=>Ol(_,i,{...a.mount?s:Ge(k)?o:It(_)?{[_]:k}:k},D,k),Q=_=>Rh(G(a.mount?s:o,_,t.shouldUnregister?G(o,_,[]):[])),te=(_,k,D={},z=!1)=>{const V=G(n,_);let R=k;if(V){const H=V._f;H&&(!H.disabled&&Qe(s,_,tp(k,H)),R=Ea(H.ref)&&bt(k)?"":k,Yh(H.ref)?[...H.ref.options].forEach(se=>se.selected=R.includes(se.value)):H.refs?Wo(H.ref)?H.refs.forEach(se=>{(!se.defaultChecked||!se.disabled)&&(Array.isArray(R)?se.checked=!!R.find(ae=>ae===se.value):se.checked=R===se.value||!!R)}):H.refs.forEach(se=>se.checked=se.value===R):xl(H.ref)?H.ref.value="":(H.ref.value=R,H.ref.type||g.state.next({name:_,values:z?s:et(s)})))}(D.shouldDirty||D.shouldTouch)&&A(_,R,D.shouldTouch,D.shouldDirty,!0),D.shouldValidate&&$(_)},ue=(_,k,D,z=!1)=>{for(const V in k){if(!k.hasOwnProperty(V))return;const R=k[V],H=_+"."+V,se=G(n,H);(i.array.has(_)||Ye(R)||se&&!se._f)&&!ln(R)?ue(H,R,D,z):te(H,R,D,z)}},fe=(_,k,D,z)=>{const V=G(n,_),R=i.array.has(_),H=z?k:et(k),se=G(s,_),ae=zt(se,H);if(ae||Qe(s,_,H),R)g.array.next({name:_,values:z?s:et(s)}),(f.isDirty||f.dirtyFields||m.isDirty||m.dirtyFields)&&D.shouldDirty&&(C(),g.state.next({name:_,dirtyFields:r.dirtyFields,isDirty:U(_,H)}));else{const Fe=Array.isArray(H)&&!H.length||ft(H);!V||V._f||bt(H)||Fe?te(_,H,D,z):ue(_,H,D,z)}if(!ae){const Fe=ql(_,i),Je=z?s:et(s);g.state.next({...Fe&&r,name:a.mount||Fe?_:void 0,values:Je})}},pe=(_,k,D={})=>fe(_,k,D,!1),ie=(_,k={})=>{const D=kt(_)?_(s):_;if(!zt(s,D)){s={...s,...D};for(const z of i.mount)fe(z,G(D,z),k,!0);g.state.next({...r,name:void 0,type:void 0,values:s}),k.shouldValidate&&v()}},Te=async _=>{a.mount=!0;const k=_.target;let D=k.name,z=!0;const V=G(n,D),R=ae=>{z=Number.isNaN(ae)||ln(ae)&&isNaN(ae.getTime())||zt(ae,G(s,D,ae))},H=sp(t.mode),se=sp(t.reValidateMode);if(V){let ae,Fe;const Je=k.type?op(V._f):Al(_),dt=_.type===$r.BLUR||_.type===$r.FOCUS_OUT,er=!PE(V._f)&&!e.validate&&!t.resolver&&!G(r.errors,D)&&!V._f.deps||FE(dt,G(r.touchedFields,D),r.isSubmitted,se,H),is=ql(D,i,dt);Qe(s,D,Je),dt?(!k||!k.readOnly)&&(V._f.onBlur&&V._f.onBlur(_),c&&c(0)):V._f.onChange&&V._f.onChange(_);const _n=A(D,Je,dt),mt=!ft(_n)||is;if(!dt&&g.state.next({name:D,type:_.type,values:et(s)}),er)return(f.isValid||m.isValid)&&(t.mode==="onBlur"?dt&&v():dt||v()),mt&&g.state.next({name:D,...is?{}:_n});if(!t.resolver&&e.validate&&await N({name:D,eventType:_.type}),!dt&&is&&g.state.next({...r}),t.resolver){const{errors:Lt}=await F([D]);if(y([D]),R(Je),!z){!ft(_n)&&g.state.next(_n);return}const Nt=ip(r.errors,n,D),dr=ip(Lt,n,Nt.name||D);ae=dr.error,D=dr.name,Fe=ft(Lt)}else y([D],!0),ae=(await dp(V,i.disabled,s,b,t.shouldUseNativeValidation))[D],y([D]),R(Je),z&&(ae?Fe=!1:(f.isValid||m.isValid)&&(Fe=await M({fields:n,onlyCheckValid:!0,name:D,eventType:_.type})));z&&(V._f.deps&&(!Array.isArray(V._f.deps)||V._f.deps.length>0)&&$(V._f.deps),x(D,Fe,ae,_n))}},ye=(_,k)=>{if(G(r.errors,k)&&_.focus)return _.focus(),1},$=async(_,k={})=>{let D,z;const V=Ta(_);if(t.resolver){const R=await P(Ge(_)?_:V);D=ft(R),z=_?!V.some(H=>G(R,H)):D}else _?(z=(await Promise.all(V.map(async R=>{const H=G(n,R);return await M({fields:H&&H._f?{[R]:H}:H,eventType:$r.TRIGGER})}))).every(Boolean),!(!z&&!r.isValid)&&v()):z=D=await M({fields:n,name:_,eventType:$r.TRIGGER});return g.state.next({...!It(_)||(f.isValid||m.isValid)&&D!==r.isValid?{}:{name:_},...t.resolver||!_?{isValid:D}:{},errors:r.errors}),k.shouldFocus&&!z&&Yo(n,ye,_?V:i.mount),z},q=(_,k)=>{let D={...a.mount?s:o};return k&&(D=Kh(k.dirtyFields?r.dirtyFields:r.touchedFields,D)),Ge(_)?D:It(_)?G(D,_):_.map(z=>G(D,z))},Z=(_,k)=>({invalid:!!G((k||r).errors,_),isDirty:!!G((k||r).dirtyFields,_),error:G((k||r).errors,_),isValidating:!!G(r.validatingFields,_),isTouched:!!G((k||r).touchedFields,_)}),he=_=>{const k=_?Ta(_):void 0;k==null||k.forEach(D=>st(r.errors,D)),k?k.forEach(D=>{g.state.next({name:D,errors:r.errors})}):g.state.next({errors:{}})},be=(_,k,D)=>{const z=(G(n,_,{_f:{}})._f||{}).ref,V=G(r.errors,_)||{},{ref:R,message:H,type:se,...ae}=V;Qe(r.errors,_,{...ae,...k,ref:z}),g.state.next({name:_,errors:r.errors,isValid:!1}),D&&D.shouldFocus&&z&&z.focus&&z.focus()},ge=(_,k)=>kt(_)?g.state.subscribe({next:D=>"values"in D&&_(D.values||ee(void 0,k),D)}):ee(_,k,!0),le=_=>g.state.subscribe({next:k=>{if(xE(_.name,k.name,_.exact)&&NE(k,_.formState||f,Sn,_.reRenderRoot)){const D={...s};_.callback({values:D,...r,...k,defaultValues:o})}}}).unsubscribe,ve=_=>(a.mount=!0,m={...m,..._.formState},le({..._,formState:{...u,..._.formState}})),Ae=(_,k={})=>{for(const D of _?Ta(_):i.mount)i.mount.delete(D),i.array.delete(D),k.keepValue||(st(n,D),st(s,D)),!k.keepError&&st(r.errors,D),!k.keepDirty&&st(r.dirtyFields,D),!k.keepTouched&&st(r.touchedFields,D),!k.keepIsValidating&&st(r.validatingFields,D),!t.shouldUnregister&&!k.keepDefaultValue&&st(o,D);g.state.next({values:et(s)}),g.state.next({...r,...k.keepDirty?{isDirty:U()}:{}}),!k.keepIsValid&&v()},Y=({disabled:_,name:k})=>{if(Ut(_)&&a.mount||_||i.disabled.has(k)){const V=i.disabled.has(k)!==!!_;_?i.disabled.add(k):i.disabled.delete(k),V&&a.mount&&!a.action&&v()}},de=(_,k={})=>{let D=G(n,_);const z=Ut(k.disabled)||Ut(t.disabled),V=!i.registerName.has(_)&&D&&D._f&&!D._f.mount;return Qe(n,_,{...D||{},_f:{...D&&D._f?D._f:{ref:{name:_}},name:_,mount:!0,...k}}),i.mount.add(_),D&&!V?Y({disabled:Ut(k.disabled)?k.disabled:t.disabled,name:_}):L(_,!0,k.value),{...z?{disabled:k.disabled||t.disabled}:{},...t.progressive?{required:!!k.required,min:Ko(k.min),max:Ko(k.max),minLength:Ko(k.minLength),maxLength:Ko(k.maxLength),pattern:Ko(k.pattern)}:{},name:_,onChange:Te,onBlur:Te,ref:R=>{if(R){i.registerName.add(_),de(_,k),i.registerName.delete(_),D=G(n,_);const H=Ge(R.value)&&R.querySelectorAll&&R.querySelectorAll("input,select,textarea")[0]||R,se=AE(H),ae=D._f.refs||[];if(se?ae.find(Fe=>Fe===H):H===D._f.ref)return;Qe(n,_,{_f:{...D._f,...se?{refs:[...ae.filter(Ml),H,...Array.isArray(G(o,_))?[{}]:[]],ref:{type:H.type,name:_}}:{ref:H}}}),L(_,!1,void 0,H)}else D=G(n,_,{}),D._f&&(D._f.mount=!1),(t.shouldUnregister||k.shouldUnregister)&&!(Uh(i.array,_)&&a.action)&&i.unMount.add(_)}}},W=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&Yo(n,ye,i.mount),Ce=_=>{Ut(_)&&(g.state.next({disabled:_}),Yo(n,(k,D)=>{const z=G(n,D);z&&(k.disabled=z._f.disabled||_,Array.isArray(z._f.refs)&&z._f.refs.forEach(V=>{V.disabled=z._f.disabled||_}))},0,!1))},Ve=(_,k)=>async D=>{let z;D&&(D.preventDefault&&D.preventDefault(),D.persist&&D.persist());let V=et(s);if(g.state.next({isSubmitting:!0}),t.resolver){const{errors:R,values:H}=await F();y(),r.errors=R,V=et(H)}else await M({fields:n,eventType:$r.SUBMIT});if(i.disabled.size)for(const R of i.disabled)st(V,R);if(st(r.errors,Vh),ft(r.errors)){g.state.next({errors:{}});try{await _(V,D)}catch(R){z=R}}else k&&await k({...r.errors},D),W(),setTimeout(W);if(g.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ft(r.errors)&&!z,submitCount:r.submitCount+1,errors:r.errors}),z)throw z},nt=(_,k={})=>{G(n,_)&&(Ge(k.defaultValue)?pe(_,et(G(o,_))):(pe(_,k.defaultValue),Qe(o,_,et(k.defaultValue))),k.keepTouched||st(r.touchedFields,_),k.keepDirty||(st(r.dirtyFields,_),r.isDirty=k.defaultValue?U(_,et(G(o,_))):U()),k.keepError||(st(r.errors,_),f.isValid&&v()),g.state.next({...r}))},He=(_,k={})=>{const D=_?et(_):o,z=et(D),V=ft(_),R=z;if(k.keepDefaultValues||(o=D),!k.keepValues){if(k.keepDirtyValues){const H=new Set([...i.mount,...Object.keys(cn(o,s))]);for(const se of Array.from(H)){const ae=G(r.dirtyFields,se),Fe=G(s,se),Je=G(R,se);ae&&!Ge(Fe)?Qe(R,se,Fe):!ae&&!Ge(Je)&&pe(se,Je)}}else{if(wa&&Ge(_))for(const H of i.mount){const se=G(n,H);if(se&&se._f){const ae=Array.isArray(se._f.refs)?se._f.refs[0]:se._f.ref;if(Ea(ae)){const Fe=ae.closest("form");if(Fe){Fe.reset();break}}}}if(k.keepFieldsRef)for(const H of i.mount)pe(H,G(R,H));else n={}}if(t.shouldUnregister){if(s=k.keepDefaultValues?et(o):{},k.keepFieldsRef)for(const H of i.mount)Qe(s,H,G(R,H))}else s=et(R);g.array.next({values:{...R}}),g.state.next({values:{...R}})}i={mount:k.keepDirtyValues?i.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!f.isValid||!!k.keepIsValid||!!k.keepDirtyValues||!t.shouldUnregister&&!ft(R),a.watch=!!t.shouldUnregister,a.keepIsValid=!!k.keepIsValid,a.action=!1,k.keepErrors||(r.errors={}),g.state.next({submitCount:k.keepSubmitCount?r.submitCount:0,isDirty:V?!1:k.keepDirty?r.isDirty:k.keepValues?U():!!(k.keepDefaultValues&&!zt(_,o)),isSubmitted:k.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:V?{}:k.keepDirtyValues?k.keepDefaultValues&&s?cn(o,s):r.dirtyFields:k.keepDefaultValues&&_?cn(o,_):k.keepDirty?r.dirtyFields:{},touchedFields:k.keepTouched?r.touchedFields:{},errors:k.keepErrors?r.errors:{},isSubmitSuccessful:k.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},Ke=(_,k)=>He(kt(_)?_(s):_,{...t.resetOptions,...k}),ot=(_,k={})=>{const D=G(n,_),z=D&&D._f;if(z){const V=z.refs?z.refs[0]:z.ref;V.focus&&setTimeout(()=>{V.focus(),k.shouldSelect&&kt(V.select)&&V.select()})}},Sn=_=>{r={...r,..._}},wn={control:{register:de,unregister:Ae,getFieldState:Z,handleSubmit:Ve,setError:be,_subscribe:le,_runSchema:F,_updateIsValidating:y,_focusError:W,_getWatch:ee,_getDirty:U,_setValid:v,_setFieldArray:S,_setDisabledField:Y,_setErrors:T,_getFieldArray:Q,_reset:He,_resetDefaultValues:()=>kt(t.defaultValues)&&t.defaultValues().then(_=>{Ke(_,t.resetOptions),g.state.next({isLoading:!1})}),_removeUnmounted:B,_disableForm:Ce,_subjects:g,_proxyFormState:f,get _fields(){return n},get _formValues(){return s},get _state(){return a},set _state(_){a=_},get _defaultValues(){return o},get _names(){return i},set _names(_){i=_},get _formState(){return r},get _options(){return t},set _options(_){t={...t,..._}}},subscribe:ve,trigger:$,register:de,handleSubmit:Ve,watch:ge,setValue:pe,setValues:ie,getValues:q,reset:Ke,resetField:nt,resetDefaultValues:(_,k={})=>{if(o=et(_),!k.keepDirty){const D=cn(o,s);r.dirtyFields=D,r.isDirty=!ft(D)}k.keepIsValid||v(),g.state.next({...r,defaultValues:o})},clearErrors:he,unregister:Ae,setError:be,setFocus:ot,getFieldState:Z};return{...wn,formControl:wn}}function qE(e={}){const t=p.useRef(void 0),r=p.useRef(void 0),n=p.useRef(e.formControl),[o,s]=p.useState(()=>({...et(up),isLoading:kt(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:kt(e.defaultValues)?void 0:e.defaultValues}));if(!t.current||e.formControl&&n.current!==e.formControl)if(n.current=e.formControl,e.formControl)t.current={...e.formControl,formState:o},e.defaultValues&&!kt(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:i,...c}=BE(e);t.current={...c,formState:o}}const a=t.current.control;return a._options=e,Ll(()=>{const i=a._subscribe({formState:a._proxyFormState,callback:()=>s({...a._formState,defaultValues:a._defaultValues}),reRenderRoot:!0});return s(c=>({...c,isReady:!0})),a._formState.isReady=!0,i},[a]),p.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),p.useEffect(()=>{e.mode&&(a._options.mode=e.mode),e.reValidateMode&&(a._options.reValidateMode=e.reValidateMode)},[a,e.mode,e.reValidateMode]),p.useEffect(()=>{e.errors&&(a._setErrors(e.errors),a._focusError())},[a,e.errors]),p.useEffect(()=>{e.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,e.shouldUnregister]),p.useEffect(()=>{if(a._proxyFormState.isDirty){const i=a._getDirty();i!==o.isDirty&&a._subjects.state.next({isDirty:i})}},[a,o.isDirty]),p.useEffect(()=>{var i;e.values&&!zt(e.values,r.current)?(a._reset(e.values,{keepFieldsRef:!0,...a._options.resetOptions}),!((i=a._options.resetOptions)===null||i===void 0)&&i.keepIsValid||a._setValid(),r.current=e.values,s(c=>({...c}))):a._resetDefaultValues()},[a,e.values]),p.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=p.useMemo(()=>Qh(o,a),[a,o]),t.current}function jE(e,t,r){const n=e??[],o=new Set(n.map(u=>u.type).filter(Boolean)),s=(t??[]).filter(u=>!o.has(u)),{data:a}=Tn({queryKey:["framework-search",s.sort().join(","),r],queryFn:()=>IS({type:s,systemDefault:"Yes"}),enabled:s.length>0,staleTime:600*1e3}),i=t&&t.length?n.filter(u=>u.type&&t.includes(u.type)):n,c=[...(a??[]).map(u=>({label:u.name,value:u.identifier})),...i.map(u=>({label:u.name,value:u.identifier}))],d=new Set;return c.filter(u=>d.has(u.value)?!1:(d.add(u.value),!0))}async function fp(e){var r,n;return(n=(r=(await Me.get(`/action/channel/v1/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.channel}function UE(e){var r,n,o,s,a,i,c;const t=Tn({queryKey:["channel",e],queryFn:()=>fp(e),enabled:!!e,staleTime:6e5});return{identifier:((r=t.data)==null?void 0:r.identifier)??e??"",name:(n=t.data)==null?void 0:n.name,frameworks:(o=t.data)==null?void 0:o.frameworks,collectionAdditionalCategories:(s=t.data)==null?void 0:s.collectionAdditionalCategories,contentAdditionalCategories:(a=t.data)==null?void 0:a.contentAdditionalCategories,defaultLicense:(i=t.data)==null?void 0:i.defaultLicense,defaultFramework:(c=t.data)==null?void 0:c.defaultFramework,isLoading:t.isLoading}}function zE(e){const{data:t}=Tn({queryKey:["user","read",e],enabled:!!e,staleTime:1/0,queryFn:()=>$S(e)});return t&&([t.firstName,t.lastName].filter(Boolean).join(" ").trim()||t.userName)||void 0}const hp=[{label:"Strict",value:"strict"},{label:"Adaptive",value:"adaptive"},{label:"Prior learning",value:"priorLearning"}],VE={"First Section":{title:"Basic Information",description:"Core details that define the content identity."},"Second Section":{title:"Categorisation",description:"Category and type classification for the content."},"Third Section":{title:"Categorisation",description:"Category and type classification for the content."},"Organisation Framework Terms":{title:"Curriculum",description:"Framework-aligned categorisation."},"Target Framework Terms":{title:"Target Audience",description:"Curriculum alignment for the intended learners."},"Fourth Section":{title:"Licensing & Attribution",description:"Copyright and usage rights information."},"Sixth Section":{title:"Licensing & Attribution",description:"Copyright and usage rights information."},"Consumption policy":{title:"Consumption policy",description:"How learners move through this path."}},HE=new Set(["review","read","sourcingreview","orgreview"]),ka={"First Section":"details","Second Section":"details","Third Section":"details","Organisation Framework Terms":"details","Target Framework Terms":"audience","Fourth Section":"licensing","Sixth Section":"licensing"},QE={Categorisation:"Second Section","Basic Information":"First Section","Licensing & Attribution":"Fourth Section",Curriculum:"Organisation Framework Terms","Target Audience":"Target Framework Terms"},WE={name:"details",description:"details",keywords:"details",appIcon:"details",primaryCategory:"details",additionalCategories:"details",board:"details",boardIds:"details",subject:"details",subjectIds:"details",medium:"details",framework:"details",topicsIds:"details",topic:"details",dialcodeRequired:"details",dialcodes:"details",audience:"audience",targetBoardIds:"audience",targetMediumIds:"audience",targetGradeLevelIds:"audience",targetSubjectIds:"audience",gradeLevel:"audience",creator:"licensing",author:"licensing",attributions:"licensing",license:"licensing",copyright:"licensing",copyrightYear:"licensing"},Zo={board:"board",boardIds:"board",medium:"medium",gradeLevel:"gradeLevel",subject:"subject",subjectIds:"subject",topicsIds:"topic",topic:"topic",targetBoardIds:"board",targetMediumIds:"medium",targetGradeLevelIds:"gradeLevel",targetSubjectIds:"subject"},jl=new Set(["targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds"]);function pp(e,t,r,n,o={}){if(!(e!=null&&e.length))return gp(uA(t,n,r,o),r,t,n,o);const s=new Map;for(const c of e){const d=c.code;d&&!s.has(d)&&s.set(d,c)}const a=new Set,i=e.filter(c=>{var u;if(n&&(c.code==="dialCode"||c.code==="dialcode")||((u=o.profile)==null?void 0:u.key)==="learningPath"&&jl.has(c.code)||c.visible===!1)return!1;const d=c.code;return a.has(d)?!1:(a.add(d),!0)}).map(c=>{const d=c.code??"",u=JE(c),f=eA(c,r,t,s,o),m=t[d],g=GE(d,mp(m,u),u,t,o),b={code:d,label:c.label??d,inputType:u,required:!!(c.required===!0||Array.isArray(c.validations)&&c.validations.some(h=>h.type==="required")),editable:RE(d,c.editable!==!1,o),placeholder:c.placeholder,maxLength:c.maxLength,options:ZE(f,g,u,r),depends:c.depends,tab:XE(c),section:c.section,sourceCategory:c.sourceCategory,defaultValue:c.defaultValue??c.default,currentValue:g};if(d==="dialcodes"){const h=t.dialcodeRequired==="Yes";return{...b,required:h,visible:h}}return b});return gp(i,r,t,n,o)}function gp(e,t,r,n,o){var s;return((s=o.profile)==null?void 0:s.key)==="learningPath"?dA(e,t,r,n):cA(e,t,r,n)}function RE(e,t,r){var s;const n=r.editorMode??"edit";if(!HE.has(n))return t!==!1;const o=(s=r.editableFields)==null?void 0:s[n];return!!(o&&o.includes(e))}function GE(e,t,r,n,o){const s=t==null||t===""||Array.isArray(t)&&t.length===0;switch(e){case"license":return s?o.defaultLicense??"":t;case"copyright":return s&&o.channelName?o.channelName:t;case"copyrightYear":return s?String(new Date().getFullYear()):t;case"author":case"creator":return s&&o.userFullName?o.userFullName:t;case"instructions":{const a=n.instructions;return a&&typeof a=="object"&&!Array.isArray(a)?a.default??"":typeof t=="object"&&t!==null?"":t}case"maxTime":case"warningTime":{if(!s)return t;const a=n.timeLimits,i=a==null?void 0:a[e];return i!=null&&i!==""?KE(Number(i)):t}default:return t}}function KE(e){if(!Number.isFinite(e)||e<0)return"";const t=Math.floor(e%60),r=Math.floor(e/60%60),n=Math.floor(e/3600),o=s=>String(s).padStart(2,"0");return n>0?`${o(n)}:${o(r)}:${o(t)}`:`${o(r)}:${o(t)}`}function YE(e){var n,o,s;const t=new Map,r=a=>a==null?void 0:a.forEach(i=>{i.identifier&&t.set(i.identifier,i.name),i.name&&t.set(i.name,i.name)});return(o=(n=e.organisationFramework)==null?void 0:n.categories)==null||o.forEach(a=>r(a.terms)),(s=e.targetFrameworks)==null||s.forEach(a=>{var i;return(i=a.categories)==null?void 0:i.forEach(c=>r(c.terms))}),t}function ZE(e,t,r,n){if(r!=="select"&&r!=="multiselect"&&r!=="radio")return e;const o=Array.isArray(t)?t:t!=null&&t!==""?[t]:[];if(!o.length)return e;const s=e?[...e]:[],a=new Set(s.map(c=>c.value)),i=YE(n);for(const c of o){const d=String(c);a.has(d)||(s.push({label:i.get(d)??d,value:d}),a.add(d))}return s}function XE(e){const t=e.section;if(t){if(ka[t])return ka[t];const n=QE[t];if(n&&ka[n])return ka[n]}const r=e.code??"";return WE[r]??"details"}function mp(e,t){const r=new Set(["multiselect","chips","keywords","tagsinput"]),n=new Set(["select","text","textarea","radio","datepicker","datetime","license"]);return r.has(t)?Array.isArray(e)?e:e!=null&&e!==""?[e]:[]:n.has(t)?Array.isArray(e)?e[0]??"":e??"":e}function JE(e){const t=(e.inputType??e.dataType??"").toLowerCase(),n=(e.dataType??"").toLowerCase()==="list";return t==="select"?"select":t==="framework"||t==="frameworkcategoryselect"?n?"multiselect":"select":t==="topicselector"?"chips":t==="multiselect"||t==="multi-select"?"multiselect":t==="keywords"||e.code==="keywords"||e.code==="topic"||e.code==="topicsIds"?"chips":t==="radio"?"radio":e.code==="appIcon"||t==="appicon"?"appIcon":t==="textarea"||e.code==="description"?"textarea":t==="datepicker"||t==="date"?"datepicker":t==="datetime"||t==="datetime-local"?"datetime":t==="tagsinput"?"tagsinput":t==="nestedselect"||t==="nested-select"?n?"multiselect":"select":t==="license"?"license":t==="dialcode"||t==="dial-code"?"dialcode":"text"}function eA(e,t,r,n,o){var d;const s=e.code??"";if(((d=o.profile)==null?void 0:d.key)==="learningPath"&&s==="policy")return hp;if(s==="maxQuestions"){const u=o.childCount??0;if(u>0)return Array.from({length:u},(f,m)=>({label:String(m+1),value:String(m+1)}))}const a=e.range;if(Array.isArray(a)&&a.length)return typeof a[0]=="string"?a.map(u=>({label:u,value:u})):a.map(u=>({label:u.name,value:u.identifier}));const i=e.enum;if(i!=null&&i.length)return i.map(u=>({label:u,value:u}));if(s==="framework")return t.orgFrameworks;if(s==="additionalCategories"){const f=(o.objectType??"")==="QuestionSet"?o.contentAdditionalCategories??o.collectionAdditionalCategories:o.collectionAdditionalCategories??o.contentAdditionalCategories,m=(f&&f.length?f:o.contextAdditionalCategories)??t.channelAdditionalCategories;return m!=null&&m.length?oA(m).map(g=>({label:g,value:g})):void 0}const c=e.sourceCategory??Zo[s];if(c)return vp(s,c,e,t,r,n)}function tA(e,t){return jl.has(e)||t.output==="identifier"||typeof t.section=="string"&&t.section.includes("Target")}function rA(e,t){return jl.has(e)||typeof t.section=="string"&&t.section.includes("Target")}function Ul(e,t,r){var s,a,i,c,d;const n=(a=(s=e.organisationFramework)==null?void 0:s.categories)==null?void 0:a.find(u=>u.code===t),o=(d=(c=(i=e.targetFrameworks)==null?void 0:i[0])==null?void 0:c.categories)==null?void 0:d.find(u=>u.code===t);return r?(o==null?void 0:o.terms)??(n==null?void 0:n.terms)??[]:(n==null?void 0:n.terms)??(o==null?void 0:o.terms)??[]}function nA(e){const t=new Set,r=[];for(const n of e){const o=n.identifier??n.name;o&&!t.has(o)&&(t.add(o),r.push(n))}return r}function oA(e){return Array.from(new Set(e))}function sA(e){return Array.isArray(e)?e:e!=null&&e!==""?[e]:[]}function vp(e,t,r,n,o,s){const a=tA(e,r),i=rA(e,r),c=h=>({label:h.name,value:a?h.identifier:h.name}),d=r.depends;if(!(d!=null&&d.length))return Ul(n,t,i).map(c);const u=d.flatMap(h=>sA(o[h])).map(String);if(!u.length)return[];const f=[];for(const h of d){const v=s.get(h),y=(v==null?void 0:v.sourceCategory)??Zo[h]??h;f.push(...Ul(n,y,i))}const g=f.filter(h=>u.includes(String(h.name))||u.includes(String(h.identifier))||u.includes(String(h.code))).flatMap(h=>h.associations??[]).filter(h=>String(h.category??"").toLowerCase()===t.toLowerCase()),b=nA(g);return b.length?b.map(c):Ul(n,t,i).map(c)}function Xo(e,t){const r=Zo[e];if(r)return vp(e,r,{},t,{},new Map)}function Ze(e,t,r){return mp(e[t],r)}const aA=["board","medium","gradeLevel","subject"];function iA(e){var r;const t=((r=e.organisationFramework)==null?void 0:r.categories)??[];return t.length?t.some(n=>aA.includes(n.code)):!0}function lA(e,t){var r,n,o;return!!((n=(r=e.organisationFramework)==null?void 0:r.categories)!=null&&n.some(s=>s.code===t)||(o=e.targetFrameworks)!=null&&o.some(s=>{var a;return(a=s.categories)==null?void 0:a.some(i=>i.code===t)}))}function cA(e,t,r,n){var c;if(!n||iA(t))return e;const o=e.filter(d=>{const u=d.sourceCategory??Zo[d.code];return!u||lA(t,u)}),s=new Set(o.map(d=>d.code)),a=[];for(const d of((c=t.organisationFramework)==null?void 0:c.categories)??[])s.has(d.code)||a.push({code:d.code,label:d.name,inputType:"multiselect",editable:!0,tab:"details",section:"Organisation Framework Terms",options:(d.terms??[]).map(u=>({label:u.name,value:u.name})),currentValue:Ze(r,d.code,"multiselect")});if(!a.length)return o;const i=o.findIndex(d=>d.code==="framework");return i>=0?[...o.slice(0,i+1),...a,...o.slice(i+1)]:[...o,...a]}const zl="Organisation Framework Terms";function dA(e,t,r,n){var m,g;if(!n)return e;const o=[...((m=t.organisationFramework)==null?void 0:m.categories)??[]].sort((b,h)=>(b.index??1/0)-(h.index??1/0));if(!o.length)return e;const s=(g=Qu(o))==null?void 0:g.code,a=b=>b.sourceCategory??Zo[b.code];let c=e.filter(b=>{const h=a(b);return h?h!==s&&o.some(v=>v.code===h):!0}).map(b=>a(b)?{...b,section:zl,required:!0,inputType:"select",currentValue:Ze(r,b.code,"select")}:b),d=c.findIndex(b=>b.code==="framework");if(d===-1){const b={code:"framework",label:"Curriculum",inputType:"select",required:!0,editable:!0,tab:"details",section:zl,options:t.orgFrameworks,currentValue:Ze(r,"framework","select")},h=c.findIndex(v=>!!a(v));d=h>=0?h:c.length,c=[...c.slice(0,d),b,...c.slice(d)]}const u=new Set(c.map(b=>b.code)),f=o.filter(b=>b.code!==s&&!u.has(b.code)).map(b=>({code:b.code,label:b.name,inputType:"select",required:!0,editable:!0,tab:"details",section:zl,options:(b.terms??[]).map(h=>({label:h.name,value:h.name})),currentValue:Ze(r,b.code,"select")}));return f.length?[...c.slice(0,d+1),...f,...c.slice(d+1)]:c}function uA(e,t,r,n={}){var s,a;const o=[{code:"name",label:"Title",inputType:"text",required:!0,editable:!0,tab:"details",section:"First Section",maxLength:200,currentValue:Ze(e,"name","text")},{code:"description",label:"Description",inputType:"textarea",editable:!0,tab:"details",section:"First Section",maxLength:2e3,currentValue:Ze(e,"description","textarea")},{code:"keywords",label:"Keywords",inputType:"chips",editable:!0,tab:"details",section:"First Section",currentValue:Ze(e,"keywords","chips")}];return t?((s=n.profile)==null?void 0:s.key)==="learningPath"?(o.push({code:"framework",label:"Curriculum",inputType:"select",required:!0,editable:!0,tab:"details",section:"Organisation Framework Terms",options:r.orgFrameworks,currentValue:Ze(e,"framework","select")},{code:"policy",label:"Consumption policy",inputType:"select",required:!0,editable:!0,tab:"details",section:"Consumption policy",options:hp,currentValue:Ze(e,"policy","select")||"strict"}),o):(o.push({code:"primaryCategory",label:"Category",inputType:"select",editable:!1,tab:"details",section:"Second Section",currentValue:Ze(e,"primaryCategory","select")},{code:"additionalCategories",label:"Additional Category",inputType:"multiselect",editable:!0,tab:"details",section:"Second Section",currentValue:Ze(e,"additionalCategories","multiselect"),options:(a=r.channelAdditionalCategories)==null?void 0:a.map(i=>({label:i,value:i}))},{code:"framework",label:"Course Type",inputType:"select",required:!0,editable:!0,tab:"details",section:"Organisation Framework Terms",options:r.orgFrameworks,currentValue:Ze(e,"framework","select")},{code:"subjectIds",label:"Subjects covered",inputType:"multiselect",required:!0,editable:!0,tab:"details",section:"Organisation Framework Terms",options:Xo("subjectIds",r),currentValue:Ze(e,"subjectIds","multiselect")}),o.push({code:"audience",label:"Audience Type",inputType:"multiselect",editable:!0,tab:"audience",section:"Target Framework Terms",currentValue:Ze(e,"audience","multiselect")},{code:"targetBoardIds",label:"Board/Syllabus of the audience",inputType:"select",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",options:Xo("targetBoardIds",r),currentValue:Ze(e,"targetBoardIds","select")},{code:"targetMediumIds",label:"Medium(s) of the audience",inputType:"multiselect",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",depends:["targetBoardIds"],options:Xo("targetMediumIds",r),currentValue:Ze(e,"targetMediumIds","multiselect")},{code:"targetGradeLevelIds",label:"Class(es) of the audience",inputType:"multiselect",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",depends:["targetMediumIds"],options:Xo("targetGradeLevelIds",r),currentValue:Ze(e,"targetGradeLevelIds","multiselect")},{code:"targetSubjectIds",label:"Subject(s) of the audience",inputType:"multiselect",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",depends:["targetGradeLevelIds"],options:Xo("targetSubjectIds",r),currentValue:Ze(e,"targetSubjectIds","multiselect")}),o.push({code:"creator",label:"Author",inputType:"text",editable:!0,tab:"licensing",section:"Fourth Section",currentValue:Ze(e,"creator","text")},{code:"attributions",label:"Attributions",inputType:"text",editable:!0,tab:"licensing",section:"Fourth Section",currentValue:Ze(e,"attributions","text")},{code:"copyright",label:"Copyright",inputType:"text",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:Ze(e,"copyright","text")},{code:"copyrightYear",label:"Copyright Year",inputType:"text",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:Ze(e,"copyrightYear","text")},{code:"license",label:"License",inputType:"select",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:Ze(e,"license","select")}),o):o}const fA=["allowECM","levels","setPeriod","instances"];function yp(e){const t={};return e.forEach((r,n)=>{t[`L${n+1}`]={label:r}}),t}function hA(e,t={}){const r={...e};for(const s of fA)delete r[s];const n=e.levels;Array.isArray(n)&&n.length&&(r.outcomeDeclaration={levels:yp(n)});const o=e.instances;return o!=null&&o!==""&&(r.instances={label:o}),t.isReview&&(r.name===void 0||r.name===null||r.name==="")&&t.nodeTitle&&(r.name=t.nodeTitle),r}function pA(e,t){return e==="allowECM"||e==="setPeriod"?null:e==="levels"?{outcomeDeclaration:{levels:Array.isArray(t)?yp(t):{}}}:e==="instances"?{instances:t!=null&&t!==""?{label:t}:""}:{[e]:t}}function gA(e,t){const{watch:r,setValue:n}=e,o=p.useRef(!1);p.useEffect(()=>{const s=r((a,{name:i})=>{var c;if(!(!i||o.current)){o.current=!0;try{const d=new Set([i]);let u=!0;for(;u;){u=!1;for(const f of t)d.has(f.code)||(c=f.depends)!=null&&c.some(m=>d.has(m))&&(n(f.code,f.inputType==="multiselect"||f.inputType==="chips"?[]:"",{shouldDirty:!0}),d.add(f.code),u=!0)}}finally{o.current=!1}}});return()=>s.unsubscribe()},[r,n,t])}const Wn={section:"_section_qa0tm_1",header:"_header_qa0tm_11",title:"_title_qa0tm_17",description:"_description_qa0tm_24",divider:"_divider_qa0tm_30",fields:"_fields_qa0tm_36"},mA=({title:e,description:t,children:r})=>l.jsxs("div",{className:Wn.section,children:[l.jsxs("div",{className:Wn.header,children:[l.jsx("h3",{className:Wn.title,children:e}),t&&l.jsx("p",{className:Wn.description,children:t})]}),l.jsx("hr",{className:Wn.divider}),l.jsx("div",{className:Wn.fields,children:r})]}),j={field:"_field_93co8_1",fullWidth:"_fullWidth_93co8_7",label:"_label_93co8_11",required:"_required_93co8_19",input:"_input_93co8_24",textarea:"_textarea_93co8_45",inputError:"_inputError_93co8_50",error:"_error_93co8_54",selectBtn:"_selectBtn_93co8_59",selectOpen:"_selectOpen_93co8_83",placeholder:"_placeholder_93co8_87",selectedVal:"_selectedVal_93co8_91",chevronUp:"_chevronUp_93co8_95",dropdown:"_dropdown_93co8_100",option:"_option_93co8_116",optionSelected:"_optionSelected_93co8_134",noOpts:"_noOpts_93co8_139",chipGroup:"_chipGroup_93co8_146",chipInput:"_chipInput_93co8_158",addChipBtn:"_addChipBtn_93co8_167",radioGroup:"_radioGroup_93co8_184",radioLabel:"_radioLabel_93co8_191",iconWrap:"_iconWrap_93co8_199",iconPreview:"_iconPreview_93co8_214",iconPlaceholder:"_iconPlaceholder_93co8_220",removeIconBtn:"_removeIconBtn_93co8_233",tagChip:"_tagChip_93co8_252",tagChipRemove:"_tagChipRemove_93co8_264",nestedSelectRow:"_nestedSelectRow_93co8_278",dialcodeRow:"_dialcodeRow_93co8_287",validateBtn:"_validateBtn_93co8_293",dialcodeValid:"_dialcodeValid_93co8_315",dialcodeSpinner:"_dialcodeSpinner_93co8_325"},bp=({name:e,label:t,required:r,disabled:n,multiline:o,maxLength:s,placeholder:a})=>{const i=oe(),{register:c,formState:{errors:d}}=Yt(),u=d[e],f={required:r?i.textField.requiredError.replace("{field}",t):!1,maxLength:s?{value:s,message:i.textField.maxLengthError.replace("{max}",String(s))}:void 0};return l.jsxs("div",{className:[j.field,o?j.fullWidth:""].join(" "),children:[l.jsxs("label",{className:j.label,htmlFor:e,children:[t,r&&l.jsx("span",{className:j.required,children:"*"})]}),o?l.jsx("textarea",{id:e,className:[j.input,j.textarea,u?j.inputError:""].join(" "),disabled:n,placeholder:a,rows:3,...c(e,f)}):l.jsx("input",{id:e,type:"text",className:[j.input,u?j.inputError:""].join(" "),disabled:n,placeholder:a,...c(e,f)}),u&&l.jsx("span",{className:j.error,children:String(u.message)})]})},vA=({name:e,label:t,options:r,required:n,disabled:o})=>{var v;const s=oe(),[a,i]=p.useState(!1),c=p.useRef(null),{register:d,watch:u,setValue:f,formState:{errors:m}}=Yt(),g=u(e),b=((v=r.find(y=>y.value===g))==null?void 0:v.label)??s.selectField.selectPlaceholder,h=m[e];return p.useEffect(()=>{if(!a)return;const y=C=>{var S;(S=c.current)!=null&&S.contains(C.target)||i(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[a]),l.jsxs("div",{className:j.field,ref:c,style:{position:"relative"},children:[l.jsxs("label",{className:j.label,children:[t,n&&l.jsx("span",{className:j.required,children:"*"})]}),l.jsx("input",{type:"hidden",...d(e,{required:n?s.selectField.requiredError.replace("{field}",t):!1})}),l.jsxs("button",{type:"button",disabled:o,className:[j.selectBtn,h?j.inputError:"",a?j.selectOpen:""].join(" "),onClick:()=>i(y=>!y),children:[l.jsx("span",{className:g?j.selectedVal:j.placeholder,children:b}),l.jsx(Zr,{size:14,className:a?j.chevronUp:""})]}),a&&l.jsxs("div",{className:j.dropdown,children:[r.map(y=>l.jsxs("button",{type:"button",className:[j.option,g===y.value?j.optionSelected:""].join(" "),onClick:()=>{f(e,y.value,{shouldDirty:!0,shouldValidate:!0}),i(!1)},children:[l.jsx("span",{children:y.label}),g===y.value&&l.jsx(Yr,{size:13})]},y.value)),!r.length&&l.jsx("span",{className:j.noOpts,children:s.selectField.noOptionsMessage})]}),h&&l.jsx("span",{className:j.error,children:String(h.message)})]})},yA=({name:e,label:t,options:r,required:n,disabled:o})=>{const s=oe(),[a,i]=p.useState(!1),c=p.useRef(null),{register:d,watch:u,setValue:f,formState:{errors:m}}=Yt(),g=u(e)??[],b=m[e],h=g.length?`${g.length} ${s.multiSelectField.selectedCountSuffix}`:s.multiSelectField.selectPlaceholder;p.useEffect(()=>{if(!a)return;const y=C=>{var S;(S=c.current)!=null&&S.contains(C.target)||i(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[a]);const v=y=>{const C=g.includes(y)?g.filter(S=>S!==y):[...g,y];f(e,C,{shouldDirty:!0,shouldValidate:!0})};return l.jsxs("div",{className:j.field,ref:c,style:{position:"relative"},children:[l.jsxs("label",{className:j.label,children:[t,n&&l.jsx("span",{className:j.required,children:"*"})]}),l.jsx("input",{type:"hidden",...d(e,{required:n?s.multiSelectField.requiredError.replace("{field}",t):!1})}),l.jsxs("button",{type:"button",disabled:o,className:[j.selectBtn,b?j.inputError:"",a?j.selectOpen:""].join(" "),onClick:()=>i(y=>!y),children:[l.jsx("span",{className:g.length?j.selectedVal:j.placeholder,children:h}),l.jsx(Zr,{size:14,className:a?j.chevronUp:""})]}),a&&l.jsxs("div",{className:j.dropdown,children:[r.map(y=>l.jsxs("button",{type:"button",className:[j.option,g.includes(y.value)?j.optionSelected:""].join(" "),onClick:()=>v(y.value),children:[l.jsx(Yr,{size:13,style:{opacity:g.includes(y.value)?1:0}}),l.jsx("span",{children:y.label})]},y.value)),!r.length&&l.jsx("span",{className:j.noOpts,children:s.multiSelectField.noOptionsMessage})]}),b&&l.jsx("span",{className:j.error,children:String(b.message)})]})},bA=({name:e,label:t,required:r,disabled:n,placeholder:o})=>{const s=oe(),a=o??s.chipGroupField.addPlaceholder,[i,c]=p.useState(""),[d,u]=p.useState(!1),f=p.useRef(null),{watch:m,setValue:g,formState:{errors:b}}=Yt(),h=m(e)??[],v=b[e],y=()=>{const S=i.trim();S&&!h.includes(S)&&g(e,[...h,S],{shouldDirty:!0}),c(""),u(!1)},C=S=>g(e,h.filter(w=>w!==S),{shouldDirty:!0});return l.jsxs("div",{className:[j.field,j.fullWidth].join(" "),children:[l.jsxs("label",{className:j.label,children:[t,r&&l.jsx("span",{className:j.required,children:"*"})]}),l.jsxs("div",{className:j.chipGroup,children:[h.map(S=>l.jsxs("span",{className:"sbx-chip filled",children:[S,!n&&l.jsx("button",{type:"button",className:"sbx-chip-remove",onClick:()=>C(S),"aria-label":`Remove ${S}`,children:"×"})]},S)),!n&&(d?l.jsx("input",{ref:f,autoFocus:!0,className:j.chipInput,value:i,onChange:S=>c(S.target.value),onKeyDown:S=>{S.key==="Enter"&&(S.preventDefault(),y()),S.key==="Escape"&&(c(""),u(!1))},onBlur:y,placeholder:a}):l.jsxs("button",{type:"button",className:j.addChipBtn,onClick:()=>{u(!0),setTimeout(()=>{var S;return(S=f.current)==null?void 0:S.focus()},50)},children:[l.jsx(Xr,{size:12})," ",s.chipGroupField.addButtonLabel]}))]}),v&&l.jsx("span",{className:j.error,children:String(v.message)})]})},CA=({name:e,label:t,options:r,required:n,disabled:o})=>{const s=oe(),{register:a,formState:{errors:i}}=Yt(),c=i[e];return l.jsxs("div",{className:j.field,children:[l.jsxs("label",{className:j.label,children:[t,n&&l.jsx("span",{className:j.required,children:"*"})]}),l.jsx("div",{className:j.radioGroup,children:r.map(d=>l.jsxs("label",{className:j.radioLabel,children:[l.jsx("input",{type:"radio",value:d.value,disabled:o,...a(e,{required:n?s.radioField.requiredError.replace("{field}",t):!1})}),d.label]},d.value))}),c&&l.jsx("span",{className:j.error,children:String(c.message)})]})};async function SA(e,t,r,n){var a,i;const s=(i=(a=(await Me.post("/action/asset/v1/create",{request:{asset:{primaryCategory:"asset",language:["English"],code:crypto.randomUUID(),name:e,mediaType:"image",mimeType:t,createdBy:r,creator:null,channel:n,keywords:""}}})).data)==null?void 0:a.result)==null?void 0:i.node_id;if(!s)throw new Error("Asset creation failed: no node_id returned");return s}async function wA(e,t){var o,s;const n=(s=(o=(await Me.post(`/action/content/v3/upload/url/${e}`,{request:{content:{fileName:t}}})).data)==null?void 0:o.result)==null?void 0:s.pre_signed_url;if(!n)throw new Error("Pre-signed URL fetch failed");return n}async function _A(e,t,r={}){const n=await fetch(e,{method:"PUT",body:t,headers:{"x-ms-blob-type":"BlockBlob","Content-Type":"application/octet-stream",...r}});if(!n.ok)throw new Error(`Blob upload failed: ${n.status} ${n.statusText}`)}async function TA(e,t,r){var a,i;const n=new FormData;n.append("fileUrl",t),n.append("mimeType",r);const s=(i=(a=(await Me.post(`/action/asset/v1/upload/${e}`,n,{params:{enctype:"multipart/form-data",processData:!1,contentType:!1,cache:!1}})).data)==null?void 0:a.result)==null?void 0:i.content_url;if(!s)throw new Error("Asset finalize failed: no content_url returned");return s}const Ee={overlay:"_overlay_1bq5u_1",modal:"_modal_1bq5u_12",header:"_header_1bq5u_24",title:"_title_1bq5u_33",closeBtn:"_closeBtn_1bq5u_39",tabs:"_tabs_1bq5u_57",tab:"_tab_1bq5u_57",activeTab:"_activeTab_1bq5u_83",body:"_body_1bq5u_88",searchWrap:"_searchWrap_1bq5u_99",searchIcon:"_searchIcon_1bq5u_104",searchInput:"_searchInput_1bq5u_113",grid:"_grid_1bq5u_132",imgCell:"_imgCell_1bq5u_148",imgCellSelected:"_imgCellSelected_1bq5u_166",thumb:"_thumb_1bq5u_171",noThumb:"_noThumb_1bq5u_177",checkBadge:"_checkBadge_1bq5u_183",loadMoreBtn:"_loadMoreBtn_1bq5u_198",loadingRow:"_loadingRow_1bq5u_220",empty:"_empty_1bq5u_230",spinner:"_spinner_1bq5u_237",uploadArea:"_uploadArea_1bq5u_247",dropZone:"_dropZone_1bq5u_256",uploadIcon:"_uploadIcon_1bq5u_277",dropText:"_dropText_1bq5u_281",dropSubtext:"_dropSubtext_1bq5u_288",uploadPreview:"_uploadPreview_1bq5u_294",hiddenInput:"_hiddenInput_1bq5u_301",fileName:"_fileName_1bq5u_305",errorText:"_errorText_1bq5u_311",footer:"_footer_1bq5u_318",cancelBtn:"_cancelBtn_1bq5u_328",confirmBtn:"_confirmBtn_1bq5u_345"},Cp=18,Sp=({nodeId:e,currentValue:t,onSelect:r,onClose:n})=>{const o=oe(),[s,a]=p.useState("my"),[i,c]=p.useState(""),[d,u]=p.useState([]),[f,m]=p.useState(0),[g,b]=p.useState(!1),[h,v]=p.useState(null),[y,C]=p.useState(0),[S,w]=p.useState(null),[T,E]=p.useState(""),[L,A]=p.useState(!1),[x,F]=p.useState(""),P=p.useRef(null),N=K($=>{var q,Z;return((Z=(q=$.editorConfig)==null?void 0:q.context)==null?void 0:Z.channel)??""}),M=K($=>{var q,Z;return((Z=(q=$.editorConfig)==null?void 0:q.context)==null?void 0:Z.uid)??""}),B=K($=>{var q,Z,he;return((he=(Z=(q=$.editorConfig)==null?void 0:q.context)==null?void 0:Z.cloudStorage)==null?void 0:he.presigned_headers)??{}}),U=K($=>{var q,Z,he;return((he=(Z=(q=$.editorConfig)==null?void 0:q.config)==null?void 0:Z.assetConfig)==null?void 0:he.size)??1*1024*1024}),ee=K($=>{var q,Z,he;return((he=(Z=(q=$.editorConfig)==null?void 0:q.config)==null?void 0:Z.assetConfig)==null?void 0:he.accepted)??"image/png,image/jpeg"}),Q=p.useCallback(async($,q,Z=!1)=>{var he;b(!0);try{const be={status:["Live"],mediaType:["image"],mimeType:["image/png","image/jpeg","image/jpg","image/gif","image/svg+xml"]};s==="my"&&M&&(be.createdBy=M),N&&(be.channel=N);const le=((he=(await Me.post("/action/composite/v3/search",{request:{filters:be,query:$,limit:Cp,offset:q,sort_by:{createdOn:"desc"},fields:["identifier","name","appIcon","artifactUrl","downloadUrl"]}},{headers:{"X-Source":"web"}})).data)==null?void 0:he.result)??{},ve=le.content??[];m(le.count??0),u(Ae=>Z?[...Ae,...ve]:ve)}catch{}finally{b(!1)}},[s,M,N]);p.useEffect(()=>{s!=="upload"&&(u([]),C(0),Q(i,0))},[s]);const te=p.useRef(),ue=$=>{c($),clearTimeout(te.current),te.current=setTimeout(()=>{u([]),C(0),Q($,0)},400)},fe=()=>{const $=y+Cp;C($),Q(i,$,!0)},pe=()=>{const $=(h==null?void 0:h.artifactUrl)??(h==null?void 0:h.appIcon)??(h==null?void 0:h.downloadUrl)??"";$&&r($)};p.useEffect(()=>()=>{T&&URL.revokeObjectURL(T)},[T]);const ie=$=>{var he;const q=(he=$.target.files)==null?void 0:he[0];if($.target.value="",!q)return;const Z=ee.split(",").map(be=>be.trim());if(!Z.includes(q.type)){const be=Z.map(ge=>ge.replace("image/","").toUpperCase()).join(", ");F(o.appIconPickerModal.invalidFileTypeError.replace("{types}",be));return}if(q.size>U){const be=(U/1048576).toFixed(0);F(o.appIconPickerModal.fileTooLargeError.replace("{size}",be));return}T&&URL.revokeObjectURL(T),w(q),E(URL.createObjectURL(q)),F("")},Te=async()=>{if(S){A(!0),F("");try{const $=await SA(S.name.split(".").slice(0,-1).join(".")||S.name,S.type,M,N),q=await wA($,S.name);await _A(q,S,B);const Z=q.split("?")[0],he=await TA($,Z,S.type);r(he)}catch($){F($ instanceof Error?$.message:o.appIconPickerModal.uploadFailedError)}finally{A(!1)}}},ye=d.length<f;return l.jsx("div",{className:Ee.overlay,role:"dialog","aria-modal":"true","aria-label":o.appIconPickerModal.dialogAriaLabel,children:l.jsxs("div",{className:Ee.modal,children:[l.jsxs("div",{className:Ee.header,children:[l.jsx("span",{className:Ee.title,children:o.appIconPickerModal.title}),l.jsx("button",{className:Ee.closeBtn,onClick:n,"aria-label":o.appIconPickerModal.closeAriaLabel,children:l.jsx(fr,{size:18})})]}),l.jsxs("div",{className:Ee.tabs,role:"tablist",children:[l.jsx("button",{role:"tab","aria-selected":s==="my",className:`${Ee.tab} ${s==="my"?Ee.activeTab:""}`,onClick:()=>a("my"),children:o.appIconPickerModal.myImagesTab}),l.jsx("button",{role:"tab","aria-selected":s==="all",className:`${Ee.tab} ${s==="all"?Ee.activeTab:""}`,onClick:()=>a("all"),children:o.appIconPickerModal.allImagesTab}),l.jsxs("button",{role:"tab","aria-selected":s==="upload",className:`${Ee.tab} ${s==="upload"?Ee.activeTab:""}`,onClick:()=>a("upload"),children:[l.jsx(hi,{size:13,style:{marginRight:4}}),o.appIconPickerModal.uploadTab]})]}),l.jsx("div",{className:Ee.body,children:s!=="upload"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:Ee.searchWrap,children:[l.jsx(qs,{size:14,className:Ee.searchIcon}),l.jsx("input",{type:"search",className:Ee.searchInput,placeholder:o.appIconPickerModal.searchPlaceholder,value:i,onChange:$=>ue($.target.value)})]}),g&&d.length===0?l.jsxs("div",{className:Ee.loadingRow,children:[l.jsx(Ms,{size:20,className:Ee.spinner}),l.jsx("span",{children:o.appIconPickerModal.loadingText})]}):d.length===0?l.jsx("div",{className:Ee.empty,children:o.appIconPickerModal.noImagesFound}):l.jsx("div",{className:Ee.grid,children:d.map($=>{const q=$.appIcon??$.artifactUrl??$.downloadUrl??"",Z=(h==null?void 0:h.identifier)===$.identifier;return l.jsxs("button",{type:"button",className:`${Ee.imgCell} ${Z?Ee.imgCellSelected:""}`,onClick:()=>v($),title:$.name,children:[q?l.jsx("img",{src:q,alt:$.name,className:Ee.thumb}):l.jsx("div",{className:Ee.noThumb,children:o.appIconPickerModal.noThumbnailText}),Z&&l.jsx("div",{className:Ee.checkBadge,children:l.jsx(Yr,{size:12})})]},$.identifier)})}),ye&&!g&&l.jsx("button",{className:Ee.loadMoreBtn,onClick:fe,children:o.appIconPickerModal.loadMoreButton}),g&&d.length>0&&l.jsx("div",{className:Ee.loadingRow,children:l.jsx(Ms,{size:16,className:Ee.spinner})})]}):l.jsxs("div",{className:Ee.uploadArea,children:[l.jsx("div",{className:Ee.dropZone,onClick:()=>{var $;return($=P.current)==null?void 0:$.click()},onDragOver:$=>$.preventDefault(),onDrop:$=>{$.preventDefault();const q=$.dataTransfer.files[0];q&&ie({target:{files:[q],value:""}})},children:T?l.jsx("img",{src:T,alt:o.appIconPickerModal.previewAlt,className:Ee.uploadPreview}):l.jsxs(l.Fragment,{children:[l.jsx(hi,{size:32,className:Ee.uploadIcon}),l.jsx("p",{className:Ee.dropText,children:o.appIconPickerModal.dropZoneText}),l.jsx("p",{className:Ee.dropSubtext,children:o.appIconPickerModal.acceptedTypesInfo.replace("{types}",ee.split(",").map($=>$.replace("image/","").toUpperCase()).join(", ")).replace("{size}",(U/(1024*1024)).toFixed(0))})]})}),l.jsx("input",{ref:P,type:"file",accept:ee,className:Ee.hiddenInput,onChange:ie}),S&&l.jsx("p",{className:Ee.fileName,children:S.name}),x&&l.jsx("p",{className:Ee.errorText,children:x})]})}),l.jsxs("div",{className:Ee.footer,children:[l.jsx("button",{className:Ee.cancelBtn,onClick:n,children:o.appIconPickerModal.cancelButton}),s==="upload"?l.jsx("button",{className:Ee.confirmBtn,disabled:!S||L,onClick:Te,children:L?l.jsxs(l.Fragment,{children:[l.jsx(Ms,{size:14,className:Ee.spinner})," ",o.appIconPickerModal.uploadingText]}):o.appIconPickerModal.uploadAndUseButton}):l.jsx("button",{className:Ee.confirmBtn,disabled:!h,onClick:pe,children:o.appIconPickerModal.useSelectedButton})]})]})})},EA=({name:e,label:t,nodeId:r,required:n,disabled:o})=>{const s=oe(),[a,i]=p.useState(!1),{watch:c,setValue:d,register:u,formState:{errors:f}}=Yt(),m=c(e),g=f[e],b=v=>{d(e,v,{shouldDirty:!0,shouldValidate:!0}),i(!1)},h=()=>{d(e,"",{shouldDirty:!0,shouldValidate:!0})};return l.jsxs("div",{className:j.field,children:[l.jsxs("label",{className:j.label,children:[t,n&&l.jsx("span",{className:j.required,children:"*"})]}),l.jsx("input",{type:"hidden",...u(e,{required:n?s.appIconField.requiredError.replace("{field}",t):!1})}),l.jsx("div",{className:j.iconWrap,role:"button",tabIndex:o?-1:0,"aria-label":s.appIconField.selectIconAriaLabel,onClick:()=>!o&&i(!0),onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&!o&&i(!0)},children:m?l.jsx("img",{src:m,alt:s.appIconField.iconAlt,className:j.iconPreview}):l.jsxs("div",{className:j.iconPlaceholder,children:[l.jsx(Sd,{size:20}),l.jsx("span",{children:s.appIconField.selectIconLabel})]})}),m&&!o&&l.jsxs("button",{type:"button",className:j.removeIconBtn,onClick:h,"aria-label":s.appIconField.removeIconAriaLabel,children:[l.jsx(js,{size:13}),l.jsx("span",{children:s.appIconField.removeLabel})]}),g&&l.jsx("span",{className:j.error,children:String(g.message)}),a&&l.jsx(Sp,{nodeId:r,currentValue:m,onSelect:b,onClose:()=>i(!1)})]})},AA=({name:e,label:t,required:r,disabled:n})=>{const o=oe(),{control:s}=Yt(),{field:a,fieldState:{error:i}}=Go({name:e,control:s,rules:{required:r?o.dateTimeField.requiredError.replace("{field}",t):!1}});return l.jsxs("div",{className:j.field,children:[l.jsxs("label",{className:j.label,htmlFor:e,children:[t,r&&l.jsx("span",{className:j.required,children:"*"})]}),l.jsx("input",{id:e,type:"datetime-local",className:[j.input,i?j.inputError:""].join(" "),disabled:n,value:a.value??"",onChange:a.onChange,onBlur:a.onBlur,ref:a.ref}),i&&l.jsx("span",{className:j.error,children:String(i.message)})]})},kA=({name:e,label:t,required:r,disabled:n})=>{const o=oe(),{control:s}=Yt(),{field:a,fieldState:{error:i}}=Go({name:e,control:s,rules:{required:r?o.keywordSuggestField.requiredError.replace("{field}",t):!1},defaultValue:[]}),[c,d]=p.useState(""),u=p.useRef(null),f=a.value??[],m=v=>{const y=v.trim();!y||f.includes(y)||a.onChange([...f,y])},g=v=>{a.onChange(f.filter(y=>y!==v))},b=v=>{v.key==="Enter"||v.key===","?(v.preventDefault(),m(c),d("")):v.key==="Backspace"&&c===""&&f.length>0&&g(f[f.length-1])},h=()=>{c.trim()&&(m(c),d("")),a.onBlur()};return l.jsxs("div",{className:[j.field,j.fullWidth].join(" "),children:[l.jsxs("label",{className:j.label,children:[t,r&&l.jsx("span",{className:j.required,children:"*"})]}),l.jsxs("div",{className:[j.chipGroup,i?j.inputError:""].join(" "),onClick:()=>{var v;return!n&&((v=u.current)==null?void 0:v.focus())},style:{cursor:n?"not-allowed":"text"},children:[f.map(v=>l.jsxs("span",{className:j.tagChip,children:[v,!n&&l.jsx("button",{type:"button",className:j.tagChipRemove,onClick:y=>{y.stopPropagation(),g(v)},"aria-label":`Remove ${v}`,children:l.jsx(fr,{size:11})})]},v)),!n&&l.jsx("input",{ref:u,className:j.chipInput,value:c,onChange:v=>d(v.target.value),onKeyDown:b,onBlur:h,placeholder:f.length===0?o.keywordSuggestField.inputPlaceholder:"",style:{flexGrow:1,minWidth:120}})]}),i&&l.jsx("span",{className:j.error,children:String(i.message)})]})},IA=({name:e,label:t,levels:r,required:n,disabled:o})=>{const s=oe(),{control:a}=Yt(),{field:i,fieldState:{error:c}}=Go({name:e,control:a,rules:{required:n?s.nestedSelectField.requiredError.replace("{field}",t):!1},defaultValue:{}}),d=i.value??{},u=(f,m,g)=>{const b={};for(let h=0;h<m;h++)b[r[h].code]=d[r[h].code]??"";b[f]=g;for(let h=m+1;h<r.length;h++)b[r[h].code]="";i.onChange(b)};return l.jsxs("div",{className:[j.field,j.fullWidth].join(" "),children:[l.jsxs("label",{className:j.label,children:[t,n&&l.jsx("span",{className:j.required,children:"*"})]}),l.jsx("div",{className:j.nestedSelectRow,children:r.map((f,m)=>{const g=m>0&&!d[r[m-1].code];return l.jsxs("div",{className:j.field,style:{flex:1},children:[l.jsx("label",{className:j.label,htmlFor:`${e}_${f.code}`,children:f.label}),l.jsxs("select",{id:`${e}_${f.code}`,className:[j.input,c?j.inputError:""].join(" "),disabled:o||g,value:d[f.code]??"",onChange:b=>u(f.code,m,b.target.value),onBlur:i.onBlur,children:[l.jsx("option",{value:"",children:s.nestedSelectField.selectPlaceholder}),f.options.map(b=>l.jsx("option",{value:b.value,children:b.label},b.value))]})]},f.code)})}),c&&l.jsx("span",{className:j.error,children:String(c.message)})]})},wp=[{label:"CC BY 4.0",value:"CC BY 4.0"},{label:"CC BY-SA 4.0",value:"CC BY-SA 4.0"},{label:"CC BY-NC 4.0",value:"CC BY-NC 4.0"},{label:"CC BY-NC-SA 4.0",value:"CC BY-NC-SA 4.0"},{label:"CC BY-ND 4.0",value:"CC BY-ND 4.0"},{label:"CC0 1.0 (Public Domain)",value:"CC0 1.0"}],DA=({name:e,label:t,required:r,disabled:n})=>{const o=oe(),[s,a]=p.useState(!1),i=p.useRef(null),{register:c,watch:d,setValue:u,formState:{errors:f}}=Yt(),m=d(e),g=wp.find(v=>v.value===m),b=(g==null?void 0:g.label)??o.licenseSelectField.selectPlaceholder,h=f[e];return p.useEffect(()=>{if(!s)return;const v=y=>{var C;(C=i.current)!=null&&C.contains(y.target)||a(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[s]),l.jsxs("div",{className:j.field,ref:i,style:{position:"relative"},children:[l.jsxs("label",{className:j.label,children:[t,r&&l.jsx("span",{className:j.required,children:"*"})]}),l.jsx("input",{type:"hidden",...c(e,{required:r?o.licenseSelectField.requiredError.replace("{field}",t):!1})}),l.jsxs("button",{type:"button",disabled:n,className:[j.selectBtn,h?j.inputError:"",s?j.selectOpen:""].join(" "),onClick:()=>a(v=>!v),"aria-haspopup":"listbox","aria-expanded":s,children:[l.jsx("span",{className:m?j.selectedVal:j.placeholder,children:b}),l.jsx(Zr,{size:14,className:s?j.chevronUp:""})]}),s&&l.jsx("div",{className:j.dropdown,role:"listbox",children:wp.map(v=>l.jsxs("button",{type:"button",role:"option","aria-selected":m===v.value,className:[j.option,m===v.value?j.optionSelected:""].join(" "),onClick:()=>{u(e,v.value,{shouldDirty:!0,shouldValidate:!0}),a(!1)},children:[l.jsx("span",{children:v.label}),m===v.value&&l.jsx(Yr,{size:13})]},v.value))}),h&&l.jsx("span",{className:j.error,children:String(h.message)})]})},LA=({name:e,label:t,required:r,disabled:n})=>{const o=oe(),{control:s}=Yt(),{field:a,fieldState:{error:i}}=Go({name:e,control:s,rules:{required:r?o.dialcodeInputField.requiredError.replace("{field}",t):!1},defaultValue:""}),[c,d]=p.useState("idle"),[u,f]=p.useState(""),m=async()=>{const b=(a.value??"").trim();if(!b){d("invalid"),f(o.dialcodeInputField.enterCodeMessage);return}d("loading"),f("");try{const h=await qS(b),v=h==null?void 0:h.result,y=v==null?void 0:v.dialcodes;Array.isArray(y)&&y.length>0?(d("valid"),f(o.dialcodeInputField.validMessage)):(d("invalid"),f(o.dialcodeInputField.notFoundMessage))}catch{d("invalid"),f(o.dialcodeInputField.validationFailedMessage)}},g=()=>c==="loading"?l.jsx(Ms,{size:16,className:j.dialcodeSpinner}):c==="valid"?l.jsx(gd,{size:16,color:"var(--sbx-success, #2e7d32)"}):c==="invalid"?l.jsx(Sy,{size:16,color:"var(--sbx-error)"}):null;return l.jsxs("div",{className:j.field,children:[l.jsxs("label",{className:j.label,htmlFor:e,children:[t,r&&l.jsx("span",{className:j.required,children:"*"})]}),l.jsxs("div",{className:j.dialcodeRow,children:[l.jsx("input",{id:e,type:"text",className:[j.input,i?j.inputError:""].join(" "),disabled:n,value:a.value??"",onChange:b=>{a.onChange(b),d("idle"),f("")},onBlur:a.onBlur,ref:a.ref,placeholder:o.dialcodeInputField.placeholderExample,style:{flex:1}}),l.jsx("button",{type:"button",className:j.validateBtn,onClick:m,disabled:n||c==="loading","aria-label":o.dialcodeInputField.validateAriaLabel,children:c==="loading"?o.dialcodeInputField.validatingLabel:o.dialcodeInputField.validateButtonLabel}),g()]}),i&&l.jsx("span",{className:j.error,children:String(i.message)}),!i&&u&&l.jsx("span",{className:c==="valid"?j.dialcodeValid:j.error,children:u})]})},Vt={cards:"_cards_1oc2m_1",card:"_card_1oc2m_1",cardActive:"_cardActive_1oc2m_30",cardIcon:"_cardIcon_1oc2m_35",cardIconPrimary:"_cardIconPrimary_1oc2m_46",cardIconHover:"_cardIconHover_1oc2m_50",radioDot:"_radioDot_1oc2m_54",radioDotActive:"_radioDotActive_1oc2m_65",cardTitle:"_cardTitle_1oc2m_70",cardTitleInk:"_cardTitleInk_1oc2m_76",cardDescription:"_cardDescription_1oc2m_80",cardDescriptionCharcoal:"_cardDescriptionCharcoal_1oc2m_86"},OA=({name:e,label:t,required:r,disabled:n})=>{const o=oe(),{control:s}=Yt(),a=[{value:"strict",Icon:wd,iconVariant:Vt.cardIconPrimary,title:o.learningPath.policyStrictLabel,titleVariant:"",description:l.jsx(l.Fragment,{children:o.learningPath.policyStrictDescription}),descriptionVariant:""},{value:"adaptive",Icon:Qy,iconVariant:Vt.cardIconPrimary,title:o.learningPath.policyAdaptiveLabel,titleVariant:Vt.cardTitleInk,description:l.jsxs(l.Fragment,{children:[o.learningPath.policyAdaptiveDescriptionPre,l.jsx("span",{className:j.required,children:"*"}),o.learningPath.policyAdaptiveDescriptionPost]}),descriptionVariant:Vt.cardDescriptionCharcoal},{value:"priorLearning",Icon:By,iconVariant:Vt.cardIconHover,title:o.learningPath.policyPriorLearningLabel,titleVariant:"",description:l.jsx(l.Fragment,{children:o.learningPath.policyPriorLearningDescription}),descriptionVariant:""}];return l.jsxs("div",{className:j.field,children:[l.jsxs("label",{className:j.label,children:[t,r&&l.jsx("span",{className:j.required,children:"*"})]}),l.jsx(_E,{name:e,control:s,rules:{required:r?o.selectField.requiredError.replace("{field}",t):!1},render:({field:i})=>l.jsx("div",{className:Vt.cards,children:a.map(({value:c,Icon:d,iconVariant:u,title:f,titleVariant:m,description:g,descriptionVariant:b})=>{const h=i.value===c;return l.jsxs("button",{type:"button",disabled:n,className:[Vt.card,h?Vt.cardActive:""].join(" "),onClick:()=>i.onChange(c),children:[l.jsx("span",{className:[Vt.cardIcon,u].join(" "),children:l.jsx(d,{size:16})}),l.jsx("span",{className:[Vt.radioDot,h?Vt.radioDotActive:""].join(" ")}),l.jsx("span",{className:[Vt.cardTitle,m].join(" "),children:f}),l.jsx("span",{className:[Vt.cardDescription,b].join(" "),children:g})]},c)})})})]})},Rn={form:"_form_lktqh_1",formLp:"_formLp_lktqh_7",ungrouped:"_ungrouped_lktqh_12",ungroupedLp:"_ungroupedLp_lktqh_23",fullWidthField:"_fullWidthField_lktqh_27",noFields:"_noFields_lktqh_31"},PA=({nodeMetadata:e,activeTab:t,isRoot:r,isFolder:n,editorMode:o,onFormValueChange:s,onFormStatusChange:a})=>{var Ve,nt,He,Ke,ot,Sn,lo,as,wn;const i=oe(),c=K(_=>_.editorConfig),d=K(_=>_.editorProfile),u=d.key==="learningPath",f=K(_=>_.rootFormConfig),m=K(_=>_.unitFormConfig),g=K(_=>_.categoryMeta),b=K(_=>_.contentFramework),h=K(_=>_.contentTargetFWIds),{organisationFramework:v,targetFrameworks:y,isLoading:C}=ra(b??((Ve=c==null?void 0:c.context)==null?void 0:Ve.framework),h??((nt=c==null?void 0:c.context)==null?void 0:nt.targetFWIds)),{frameworks:S,collectionAdditionalCategories:w,contentAdditionalCategories:T,defaultLicense:E,name:L}=UE((He=c==null?void 0:c.context)==null?void 0:He.channel),A=zE(((Ke=c==null?void 0:c.context)==null?void 0:Ke.userId)??((ot=c==null?void 0:c.context)==null?void 0:ot.uid)),x=jE(S,(Sn=g==null?void 0:g.frameworkMetadata)==null?void 0:Sn.orgFWType,(lo=c==null?void 0:c.context)==null?void 0:lo.channel),F={organisationFramework:v,targetFrameworks:y,orgFrameworks:x,channelAdditionalCategories:w},P=re(_=>_.selectedNodeId),N=re(_=>_.treeData),M=re(_=>_.treeCache),B=P?M[P]??{}:{},U={...e,...B},ee=p.useMemo(()=>{var k;if(!P)return 0;const _=[...N];for(;_.length;){const D=_.shift();if(D.id===P)return((k=D.children)==null?void 0:k.length)??0;D.children&&_.push(...D.children)}return 0},[N,P]),Q=(c==null?void 0:c.config)??{},te=(c==null?void 0:c.context)??{},ue={editorMode:o,editableFields:Q.editableFields,objectType:Q.objectType,setDefaultCopyRight:Q.setDefaultCopyRight===!0,defaultLicense:te.defaultLicense??E,contextAdditionalCategories:te.additionalCategories,userFullName:((as=te.user)==null?void 0:as.fullName)??A,channelName:L,collectionAdditionalCategories:w,contentAdditionalCategories:T,childCount:ee,profile:d},fe=r?f:m,pe=fe||(((wn=c==null?void 0:c.config.hierarchy)==null?void 0:wn.formConfig)??[]),ie=pp(pe,U,F,r,ue),Te=ie.filter(_=>_.tab===t&&_.inputType!=="appIcon"&&_.visible!==!1),ye=qE({mode:"onChange",defaultValues:Object.fromEntries(ie.map(_=>{const k=["multiselect","chips","keywords","tagsinput"],D=["nestedselect"];return k.includes(_.inputType)?[_.code,_.currentValue??_.defaultValue??[]]:D.includes(_.inputType)?[_.code,_.currentValue??_.defaultValue??{}]:[_.code,_.currentValue??_.defaultValue??""]}))});gA(ye,ie);const{updateNode:$}=re(),q=p.useRef(ie);q.current=ie;const Z=p.useRef(P);Z.current=P;const he=p.useRef(s);he.current=s;const be=p.useRef(a);be.current=a;const ge=p.useRef(typeof U.shuffle=="boolean"?U.shuffle:void 0),le=p.useRef(U.name??"");le.current=U.name??"";const ve=p.useRef(o);ve.current=o;const Ae=sr(),Y=p.useRef(Ae==null?void 0:Ae.code);Y.current=Ae==null?void 0:Ae.code;const de=["review","read","sourcingreview","orgreview"];p.useEffect(()=>{const _=Z.current;if(_){const k=Object.fromEntries(q.current.filter(D=>D.currentValue!==void 0&&D.currentValue!==null).map(D=>[D.code,D.currentValue]));Object.keys(k).length>0&&$(_,k)}ye.trigger().then(()=>{const k=ye.formState.errors,D=q.current,z=Array.from(new Set(Object.keys(k).map(V=>{var R;return(R=D.find(H=>H.code===V))==null?void 0:R.tab}).filter(Boolean)));be.current(Object.keys(k).length===0,z)})},[]),p.useEffect(()=>{const _=ye.watch((k,{name:D})=>{const z=Z.current;if(!z)return;const V=q.current,R=new Set(V.map(ae=>ae.code));if(D&&R.has(D)){let ae=ye.getValues(D);if(D==="dialcodes"&&(ae=Array.isArray(ae)?ae:ae?[ae]:[]),D==="shuffle"&&(ae===!0&&ge.current===!1&&Se(i.sparkMetaForm.shuffleEnabledMessage,{icon:l.jsx(Dn,{size:16})}),ge.current=ae),D==="framework"&&r&&typeof ae=="string"&&ae){const Je=K.getState();if(Je.setContentFramework(ae,Je.contentTargetFWIds),u){const dt=re.getState().pruneCoursesByFramework(ae);dt>0&&Se(i.learningPath.coursesRemovedFrameworkChangeToast.replace("{count}",String(dt)),{icon:l.jsx(Dn,{size:16}),duration:5e3});const er=re.getState().clearLevelSkills(Y.current);er>0&&Se(i.learningPath.levelSkillsResetFrameworkChangeToast.replace("{count}",String(er)),{icon:l.jsx(Dn,{size:16}),duration:5e3})}}const Fe=pA(D,ae);Fe&&($(z,Fe),he.current(Fe))}else if(!D){const ae=ye.getValues(),Fe=Object.fromEntries(Object.entries(ae).filter(([dt])=>R.has(dt))),Je=hA(Fe,{isReview:de.includes(ve.current),nodeTitle:le.current});Object.keys(Je).length>0&&($(z,Je),he.current(Je))}const H=ye.formState.errors,se=Array.from(new Set(Object.keys(H).map(ae=>{var Fe;return(Fe=V.find(Je=>Je.code===ae))==null?void 0:Fe.tab}).filter(Boolean)));be.current(Object.keys(H).length===0,se)});return()=>_.unsubscribe()},[ye]),p.useEffect(()=>{for(const _ of["author","creator","copyright","copyrightYear","license"]){const k=q.current.find(z=>z.code===_);if(!k||k.currentValue===void 0||k.currentValue===null||k.currentValue==="")continue;const D=ye.getValues(_);(D==null||D==="")&&ye.setValue(_,k.currentValue,{shouldDirty:!1})}},[A,L,ye]);const W=Te.reduce((_,k)=>{const D=_[_.length-1];return D&&D.section===k.section?D.fields.push(k):_.push({section:k.section,fields:[k]}),_},[]),Ce=_=>{const k={key:_.code,name:_.code,label:_.label,required:_.required,disabled:_.editable===!1};if(u&&_.code==="policy")return l.jsx("div",{className:Rn.fullWidthField,children:l.jsx(OA,{...k})},_.code);switch(_.inputType){case"textarea":return l.jsx(bp,{...k,multiline:!0,maxLength:_.maxLength});case"select":return l.jsx(vA,{...k,options:_.options??[]});case"multiselect":return l.jsx(yA,{...k,options:_.options??[]});case"chips":return l.jsx(bA,{...k});case"radio":return l.jsx(CA,{...k,options:_.options??[]});case"appIcon":return l.jsx(EA,{...k,nodeId:P??""});case"datepicker":case"datetime":return l.jsx(AA,{...k});case"keywords":case"tagsinput":return l.jsx(kA,{...k});case"nestedselect":return l.jsx(IA,{...k,levels:_.levels??[]});case"license":return l.jsx(DA,{...k});case"dialcode":return l.jsx(LA,{...k});default:return l.jsx(bp,{...k,maxLength:_.maxLength})}};return l.jsx(TE,{...ye,children:l.jsxs("div",{className:[Rn.form,u?Rn.formLp:""].filter(Boolean).join(" "),children:[W.map((_,k)=>{const D=_.section?VE[_.section]:void 0;return D?l.jsx(mA,{title:D.title,description:D.description,children:_.fields.map(Ce)},_.section??k):l.jsx("div",{className:[Rn.ungrouped,u?Rn.ungroupedLp:""].filter(Boolean).join(" "),children:_.fields.map(Ce)},k)}),Te.length===0&&!C&&l.jsx("p",{className:Rn.noFields,children:i.sparkMetaForm.noFieldsMessage})]})})};function _p(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function NA(e,t){return e.reduce((r,n,o)=>{const s=t.get(n);return s&&(r[o]=s),r},Array(e.length))}function Ia(e){return e!==null&&e>=0}function xA(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function FA(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Tp=e=>{let{rects:t,activeIndex:r,overIndex:n,index:o}=e;const s=_p(t,n,r),a=t[o],i=s[o];return!i||!a?null:{x:i.left-a.left,y:i.top-a.top,scaleX:i.width/a.width,scaleY:i.height/a.height}},Da={scaleX:1,scaleY:1},MA=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:o,rects:s,overIndex:a}=e;const i=(t=s[r])!=null?t:n;if(!i)return null;if(o===r){const d=s[a];return d?{x:0,y:r<a?d.top+d.height-(i.top+i.height):d.top-i.top,...Da}:null}const c=$A(s,o,r);return o>r&&o<=a?{x:0,y:-i.height-c,...Da}:o<r&&o>=a?{x:0,y:i.height+c,...Da}:{x:0,y:0,...Da}};function $A(e,t,r){const n=e[t],o=e[t-1],s=e[t+1];return n?r<t?o?n.top-(o.top+o.height):s?s.top-(n.top+n.height):0:s?s.top-(n.top+n.height):o?n.top-(o.top+o.height):0:0}const Ep="Sortable",Ap=p.createContext({activeIndex:-1,containerId:Ep,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Tp,disabled:{draggable:!1,droppable:!1}});function BA(e){let{children:t,id:r,items:n,strategy:o=Tp,disabled:s=!1}=e;const{active:a,dragOverlay:i,droppableRects:c,over:d,measureDroppableContainers:u}=fd(),f=bo(Ep,r),m=i.rect!==null,g=p.useMemo(()=>n.map(E=>typeof E=="object"&&"id"in E?E.id:E),[n]),b=a!=null,h=a?g.indexOf(a.id):-1,v=d?g.indexOf(d.id):-1,y=p.useRef(g),C=!xA(g,y.current),S=v!==-1&&h===-1||C,w=FA(s);rr(()=>{C&&b&&u(g)},[C,g,b,u]),p.useEffect(()=>{y.current=g},[g]);const T=p.useMemo(()=>({activeIndex:h,containerId:f,disabled:w,disableTransforms:S,items:g,overIndex:v,useDragOverlay:m,sortedRects:NA(g,c),strategy:o}),[h,f,w.draggable,w.droppable,S,g,v,c,m,o]);return p.createElement(Ap.Provider,{value:T},t)}const qA=e=>{let{id:t,items:r,activeIndex:n,overIndex:o}=e;return _p(r,n,o).indexOf(t)},jA=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:o,items:s,newIndex:a,previousItems:i,previousContainerId:c,transition:d}=e;return!d||!n||i!==s&&o===a?!1:r?!0:a!==o&&t===c},UA={duration:200,easing:"ease"},kp="transform",zA=Or.Transition.toString({property:kp,duration:0,easing:"linear"}),VA={roleDescription:"sortable"};function HA(e){let{disabled:t,index:r,node:n,rect:o}=e;const[s,a]=p.useState(null),i=p.useRef(r);return rr(()=>{if(!t&&r!==i.current&&n.current){const c=o.current;if(c){const d=In(n.current,{ignoreTransform:!0}),u={x:c.left-d.left,y:c.top-d.top,scaleX:c.width/d.width,scaleY:c.height/d.height};(u.x||u.y)&&a(u)}}r!==i.current&&(i.current=r)},[t,r,n,o]),p.useEffect(()=>{s&&a(null)},[s]),s}function QA(e){let{animateLayoutChanges:t=jA,attributes:r,disabled:n,data:o,getNewIndex:s=qA,id:a,strategy:i,resizeObserverConfig:c,transition:d=UA}=e;const{items:u,containerId:f,activeIndex:m,disabled:g,disableTransforms:b,sortedRects:h,overIndex:v,useDragOverlay:y,strategy:C}=p.useContext(Ap),S=WA(n,g),w=u.indexOf(a),T=p.useMemo(()=>({sortable:{containerId:f,index:w,items:u},...o}),[f,o,w,u]),E=p.useMemo(()=>u.slice(u.indexOf(a)),[u,a]),{rect:L,node:A,isOver:x,setNodeRef:F}=ty({id:a,data:T,disabled:S.droppable,resizeObserverConfig:{updateMeasurementsFor:E,...c}}),{active:P,activatorEvent:N,activeNodeRect:M,attributes:B,setNodeRef:U,listeners:ee,isDragging:Q,over:te,setActivatorNodeRef:ue,transform:fe}=ud({id:a,data:T,attributes:{...VA,...r},disabled:S.draggable}),pe=jm(F,U),ie=!!P,Te=ie&&!b&&Ia(m)&&Ia(v),ye=!y&&Q,$=ye&&Te?fe:null,Z=Te?$??(i??C)({rects:h,activeNodeRect:M,activeIndex:m,overIndex:v,index:w}):null,he=Ia(m)&&Ia(v)?s({id:a,items:u,activeIndex:m,overIndex:v}):w,be=P==null?void 0:P.id,ge=p.useRef({activeId:be,items:u,newIndex:he,containerId:f}),le=u!==ge.current.items,ve=t({active:P,containerId:f,isDragging:Q,isSorting:ie,id:a,index:w,items:u,newIndex:ge.current.newIndex,previousItems:ge.current.items,previousContainerId:ge.current.containerId,transition:d,wasDragging:ge.current.activeId!=null}),Ae=HA({disabled:!ve,index:w,node:A,rect:L});return p.useEffect(()=>{ie&&ge.current.newIndex!==he&&(ge.current.newIndex=he),f!==ge.current.containerId&&(ge.current.containerId=f),u!==ge.current.items&&(ge.current.items=u)},[ie,he,f,u]),p.useEffect(()=>{if(be===ge.current.activeId)return;if(be&&!ge.current.activeId){ge.current.activeId=be;return}const de=setTimeout(()=>{ge.current.activeId=be},50);return()=>clearTimeout(de)},[be]),{active:P,activeIndex:m,attributes:B,data:T,rect:L,index:w,newIndex:he,items:u,isOver:x,isSorting:ie,isDragging:Q,listeners:ee,node:A,overIndex:v,over:te,setNodeRef:pe,setActivatorNodeRef:ue,setDroppableNodeRef:F,setDraggableNodeRef:U,transform:Ae??Z,transition:Y()};function Y(){if(Ae||le&&ge.current.newIndex===w)return zA;if(!(ye&&!Es(N)||!d)&&(ie||ve))return Or.Transition.toString({...d,property:kp})}}function WA(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:t.draggable,droppable:(n=e==null?void 0:e.droppable)!=null?n:t.droppable}}function La(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const RA=[Pe.Down,Pe.Right,Pe.Up,Pe.Left],GA=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:o,droppableContainers:s,over:a,scrollableAncestors:i}}=t;if(RA.includes(e.code)){if(e.preventDefault(),!r||!n)return;const c=[];s.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const m=o.get(f.id);if(m)switch(e.code){case Pe.Down:n.top<m.top&&c.push(f);break;case Pe.Up:n.top>m.top&&c.push(f);break;case Pe.Left:n.left>m.left&&c.push(f);break;case Pe.Right:n.left<m.left&&c.push(f);break}});const d=nv({collisionRect:n,droppableRects:o,droppableContainers:c});let u=$c(d,"id");if(u===(a==null?void 0:a.id)&&d.length>1&&(u=d[1].id),u!=null){const f=s.get(r.id),m=s.get(u),g=m?o.get(m.id):null,b=m==null?void 0:m.node.current;if(b&&g&&f&&m){const v=Is(b).some((E,L)=>i[L]!==E),y=Ip(f,m),C=KA(f,m),S=v||!y?{x:0,y:0}:{x:C?n.width-g.width:0,y:C?n.height-g.height:0},w={x:g.left,y:g.top};return S.x&&S.y?w:Co(w,S)}}}};function Ip(e,t){return!La(e)||!La(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function KA(e,t){return!La(e)||!La(t)||!Ip(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const dn={row:"_row_1m6cn_1",removeBtn:"_removeBtn_1m6cn_14",grip:"_grip_1m6cn_17",ctIcon:"_ctIcon_1m6cn_34",info:"_info_1m6cn_38",name:"_name_1m6cn_46",meta:"_meta_1m6cn_55"},YA={video:Us,pdf:Ao,h5p:Fs,scorm:Bs,audio:$s,quiz:xs,course:Nr,default:xr},ZA=({item:e,onRemove:t,isEditable:r})=>{const n=oe(),o=Vo(e),s=YA[o.key]??xr,{attributes:a,listeners:i,setNodeRef:c,transform:d,transition:u,isDragging:f}=QA({id:e.id,disabled:!r}),m={transform:Or.Transform.toString(d),transition:u,opacity:f?.5:1};return l.jsxs("div",{ref:c,style:m,className:dn.row,role:"listitem",children:[r&&l.jsx("span",{className:dn.grip,...a,...i,"aria-label":n.contentRow.dragToReorderAriaLabel,children:l.jsx(Cd,{size:15})}),l.jsx("span",{className:[`sbx-ct-sq--${o.key}`,dn.ctIcon].join(" "),"aria-hidden":"true",children:l.jsx(s,{size:14})}),l.jsxs("div",{className:dn.info,children:[l.jsx("span",{className:dn.name,title:e.name,children:e.name}),l.jsx("span",{className:dn.meta,children:o.label})]}),l.jsx("span",{className:`sbx-ct-badge--${o.key}`,children:o.label}),r&&l.jsx("button",{type:"button",className:dn.removeBtn,onClick:()=>t(e.id),"aria-label":n.contentRow.removeAriaLabel.replace("{name}",e.name),children:l.jsx(fr,{size:14})})]})},ce={container:"_container_pi4q5_1",header:"_header_pi4q5_7",heading:"_heading_pi4q5_13",count:"_count_pi4q5_21",list:"_list_pi4q5_30",emptyState:"_emptyState_pi4q5_36",skillPicker:"_skillPicker_pi4q5_52",skillsCovered:"_skillsCovered_pi4q5_52",chips:"_chips_pi4q5_64",chip:"_chip_pi4q5_64",skillWarning:"_skillWarning_pi4q5_80",selectedSkills:"_selectedSkills_pi4q5_85",skillPill:"_skillPill_pi4q5_91",skillPillFlagged:"_skillPillFlagged_pi4q5_103",skillPillUncovered:"_skillPillUncovered_pi4q5_107",skillPillRemove:"_skillPillRemove_pi4q5_112",skillSearchBox:"_skillSearchBox_pi4q5_127",skillSearchWrap:"_skillSearchWrap_pi4q5_132",searchIcon:"_searchIcon_pi4q5_147",skillSearchInput:"_skillSearchInput_pi4q5_152",skillDropdown:"_skillDropdown_pi4q5_165",skillOption:"_skillOption_pi4q5_179",skillCheckbox:"_skillCheckbox_pi4q5_201",skillCheckboxChecked:"_skillCheckboxChecked_pi4q5_213",skillDropdownEmpty:"_skillDropdownEmpty_pi4q5_218",skillPickerNote:"_skillPickerNote_pi4q5_224",emptyHint:"_emptyHint_pi4q5_229",assessmentsCard:"_assessmentsCard_pi4q5_242",assessmentSlots:"_assessmentSlots_pi4q5_254",assessmentItemRow:"_assessmentItemRow_pi4q5_260",assessmentItemIcon:"_assessmentItemIcon_pi4q5_271",assessmentItemInfo:"_assessmentItemInfo_pi4q5_283",assessmentItemTitle:"_assessmentItemTitle_pi4q5_290",assessmentItemMeta:"_assessmentItemMeta_pi4q5_299",addRowIcon:"_addRowIcon_pi4q5_304",assessmentItemBadge:"_assessmentItemBadge_pi4q5_316",menuWrap:"_menuWrap_pi4q5_327",menuBtn:"_menuBtn_pi4q5_332",dropmenu:"_dropmenu_pi4q5_345",dangerItem:"_dangerItem_pi4q5_375",addRow:"_addRow_pi4q5_304",addRowAssessment:"_addRowAssessment_pi4q5_399",addRowText:"_addRowText_pi4q5_406",requiredBadge:"_requiredBadge_pi4q5_411"},XA=({options:e,selected:t,outOfScope:r,uncovered:n,onChange:o,isEditable:s,description:a})=>{const i=oe(),[c,d]=p.useState(""),[u,f]=p.useState(!1),m=p.useRef(null);p.useEffect(()=>{if(!u)return;const v=y=>{var C;(C=m.current)!=null&&C.contains(y.target)||f(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[u]);const g=c?e.filter(v=>v.toLowerCase().includes(c.toLowerCase())):e,b=v=>{s&&o(t.includes(v)?t.filter(y=>y!==v):[...t,v])},h=v=>{s&&o(t.filter(y=>y!==v))};return l.jsxs("div",{className:ce.skillPicker,children:[l.jsxs("div",{className:ce.header,children:[l.jsx("span",{className:ce.heading,children:i.learningPath.skillsHeading}),l.jsx("span",{className:ce.count,children:t.length})]}),l.jsx("span",{className:ce.skillPickerNote,children:a}),r.length>0&&l.jsx("div",{className:ce.skillWarning,role:"alert",children:i.learningPath.skillsOutOfScopeWarning.replace("{skills}",r.join(", "))}),n.length>0&&l.jsx("div",{className:ce.skillWarning,role:"alert",children:i.learningPath.skillsUncoveredWarning.replace("{skills}",n.join(", "))}),t.length>0&&l.jsx("div",{className:ce.selectedSkills,children:t.map(v=>{const y=r.includes(v),C=n.includes(v);return l.jsxs("span",{className:[ce.skillPill,y?ce.skillPillFlagged:"",C?ce.skillPillUncovered:""].filter(Boolean).join(" "),title:C?i.learningPath.skillUncoveredPillTitle:void 0,children:[v,s&&l.jsx("button",{type:"button",className:ce.skillPillRemove,onClick:()=>h(v),"aria-label":i.learningPath.removeSkillAriaLabel.replace("{skill}",v),children:l.jsx(fr,{size:11})})]},v)})}),s?l.jsxs("div",{className:ce.skillSearchBox,ref:m,children:[l.jsxs("div",{className:ce.skillSearchWrap,onClick:()=>f(!0),children:[l.jsx("input",{type:"search",className:ce.skillSearchInput,placeholder:i.learningPath.searchSkillsPlaceholder,value:c,onChange:v=>d(v.target.value),onFocus:()=>f(!0),"aria-label":i.learningPath.searchSkillsPlaceholder}),l.jsx(qs,{size:14,className:ce.searchIcon})]}),u&&l.jsx("div",{className:ce.skillDropdown,role:"listbox",children:e.length===0?l.jsx("div",{className:ce.skillDropdownEmpty,children:i.learningPath.noSkillsAvailable}):g.length===0?l.jsx("div",{className:ce.skillDropdownEmpty,children:i.learningPath.noMatchingSkills}):g.map(v=>{const y=t.includes(v);return l.jsxs("button",{type:"button",role:"option","aria-selected":y,className:ce.skillOption,onClick:()=>b(v),children:[l.jsx("span",{className:[ce.skillCheckbox,y?ce.skillCheckboxChecked:""].join(" "),children:y&&l.jsx(Yr,{size:12})}),v]},v)})})]}):t.length===0&&l.jsx("span",{className:ce.emptyHint,children:i.learningPath.noSkillsSelectedYet})]})},Vl=({slot:e,isEditable:t})=>{const r=oe(),{pre:n,post:o,setActiveAssessmentSlot:s,deleteSlot:a}=Tl(),i=re(h=>h.selectNode),[c,d]=p.useState(!1),u=p.useRef(null),f=e==="pre"?n:o,m=e==="pre"?r.learningPath.priorAssessmentLabel:r.learningPath.outcomeAssessmentLabel;if(p.useEffect(()=>{if(!c)return;const h=v=>{var y;(y=u.current)!=null&&y.contains(v.target)||d(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[c]),!f.filled)return l.jsxs("button",{type:"button",className:[ce.addRow,ce.addRowAssessment].join(" "),disabled:!t,onClick:()=>s(e),children:[l.jsx("span",{className:ce.addRowIcon,children:l.jsx(Xr,{size:16})}),l.jsx("span",{className:ce.addRowText,children:r.learningPath.addAssessmentSlotButton.replace("{label}",m)}),f.required&&l.jsx("span",{className:ce.requiredBadge,children:r.learningPath.requiredSlotBadge})]});const g=e==="pre"?r.learningPath.skillCheckBadge:r.learningPath.outcomeCheckBadge,b=()=>f.level&&i(f.level.id);return l.jsxs("div",{className:ce.assessmentItemRow,role:"button",tabIndex:0,onClick:b,onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),b())},children:[l.jsx("span",{className:ce.assessmentItemIcon,children:l.jsx(Nr,{size:16})}),l.jsxs("div",{className:ce.assessmentItemInfo,children:[l.jsx("span",{className:ce.assessmentItemTitle,children:f.courseName||r.learningPath.courseNameUnavailable}),l.jsxs("span",{className:ce.assessmentItemMeta,children:[m," · ",r.learningPath.assessmentCourseMeta]})]}),l.jsx("span",{className:ce.assessmentItemBadge,children:g}),t&&l.jsxs("div",{className:ce.menuWrap,ref:u,children:[l.jsx("button",{type:"button",className:ce.menuBtn,onClick:h=>{h.stopPropagation(),d(v=>!v)},"aria-label":r.treeNode.nodeOptionsAriaLabel,children:"⋮"}),c&&l.jsxs("div",{className:ce.dropmenu,onClick:h=>h.stopPropagation(),children:[l.jsxs("button",{type:"button",onClick:()=>{d(!1),f.level&&i(f.level.id)},children:[l.jsx(Ty,{size:12})," ",r.learningPath.viewCourseMenuItem]}),l.jsxs("button",{type:"button",className:ce.dangerItem,onClick:()=>{d(!1),a(e)},children:[l.jsx(js,{size:12})," ",r.treeNode.deleteMenuItem]})]})]})]})},JA=({editorMode:e,isRoot:t=!1})=>{const r=oe(),{selectedNodeId:n,getChildrenOf:o,getNodeById:s,reorderChildren:a,deleteNode:i,activeNodeMeta:c,updateNode:d,treeData:u}=re(),f=K(M=>M.editorProfile),m=n?o(n):[],g=e==="edit",b=n?s(n):void 0,h=f.competencyScoped,v=h&&!t&&!lt(b),y=h&&t,{scope:C,source:S}=Mo(),w=sr(),T=w&&Array.isArray(c[w.code])?c[w.code]:[],E=S==="prior"?T.filter(M=>!C.includes(M)):[],L=y?Fu(u[0],w==null?void 0:w.code):[],A=v?Mu(b,T,w==null?void 0:w.code):[],x=p.useCallback(M=>{!n||!(w!=null&&w.code)||d(n,{[w.code]:M},[w.code])},[n,w==null?void 0:w.code,d]),F=Nc(ei(Ds,{activationConstraint:{distance:5}}),ei(si,{coordinateGetter:GA})),P=p.useCallback(M=>{const{active:B,over:U}=M;if(!U||B.id===U.id||!n)return;const ee=re.getState().getChildrenOf(n),Q=ee.findIndex(ue=>ue.id===B.id),te=ee.findIndex(ue=>ue.id===U.id);Q<0||te<0||a(n,Q,te)},[n,a]),N=p.useCallback(M=>{window.confirm(r.unitContentList.removeConfirm)&&i(M)},[i,r.unitContentList.removeConfirm]);return n?l.jsxs("div",{className:ce.container,children:[y&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:ce.skillsCovered,children:[l.jsx("span",{className:ce.heading,children:r.learningPath.skillsCoveredHeading}),l.jsx("span",{className:ce.emptyHint,children:r.learningPath.skillsCoveredDescription}),L.length>0&&l.jsx("div",{className:ce.chips,children:L.map(M=>l.jsx("span",{className:ce.chip,children:M},M))}),L.length===0&&l.jsx("span",{className:ce.emptyHint,children:r.learningPath.noSkillsYet})]}),l.jsxs("div",{className:ce.assessmentsCard,children:[l.jsx("span",{className:ce.heading,children:r.learningPath.assessmentsCardHeading}),l.jsx("span",{className:ce.emptyHint,children:r.learningPath.assessmentsCardDescription}),l.jsxs("div",{className:ce.assessmentSlots,children:[l.jsx(Vl,{slot:"pre",isEditable:g}),l.jsx(Vl,{slot:"post",isEditable:g})]})]})]}),v&&l.jsx(XA,{options:C,selected:T,outOfScope:E,uncovered:A,onChange:x,isEditable:g,description:S==="prior"?r.learningPath.skillScopeFromPriorNote:r.learningPath.skillScopeManualNote}),!h&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:ce.header,children:[l.jsx("span",{className:ce.heading,children:r.unitContentList.heading}),l.jsx("span",{className:ce.count,children:m.length})]}),m.length>0?l.jsx(cd,{sensors:F,collisionDetection:rv,onDragEnd:P,children:l.jsx(BA,{items:m.map(M=>M.id),strategy:MA,children:l.jsx("div",{className:ce.list,role:"list",children:m.map(M=>l.jsx(ZA,{item:M,onRemove:N,isEditable:g},M.id))})})}):l.jsxs("div",{className:ce.emptyState,children:[l.jsx("p",{children:r.unitContentList.emptyTitle}),l.jsx("span",{children:r.unitContentList.emptyHint})]}),g&&!lt(b)&&l.jsxs("button",{className:ce.addRow,type:"button","aria-label":r.unitContentList.addContentAriaLabel,children:[l.jsx(Xr,{size:14})," ",r.unitContentList.addContent]})]})]}):null},Dp={dropZone:"_dropZone_ijo5w_1",active:"_active_ijo5w_14"},ek=({isActive:e,label:t,nodeId:r,className:n})=>{const o=oe(),s=t??o.dropZone.dropHere;return l.jsx("div",{className:`${Dp.dropZone} ${e?Dp.active:""} ${n??""}`,"data-droppable":e?"true":void 0,"data-node-id":r,"aria-label":s,role:"region",children:l.jsx("span",{children:s})})},Lp=["identifier","name","mimeType","contentType","primaryCategory","appIcon","channel","organisation","pkgVersion"];async function tk(e){var a;const t={status:["Live"],...e.filters??{}};e.channel&&(t.channel=e.channel);const n=((a=(await Me.post("/action/composite/v3/search",{request:{filters:t,query:e.query??"",limit:e.limit??20,offset:e.offset??0,sort_by:e.sortBy??{lastUpdatedOn:"desc"},fields:e.fields??Lp}},{headers:{"X-Source":"web","X-msgid":Math.random().toString(36).slice(2)}})).data)==null?void 0:a.result)??{},o=new Set(["count","facets"]);return{content:Object.entries(n).filter(([i])=>!o.has(i)).flatMap(([,i])=>Array.isArray(i)?i:[]),count:n.count??0}}async function rk(e){var r,n;return(n=(r=(await Me.get(`/action/content/v3/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.content}const Op="application/vnd.sunbird.question";function Pp(e){return{cardinality:"single",type:"integer",defaultValue:e.maxScore??1}}function Np(e,t,r){if(!e)return null;if(e.identifier===t)return{question:e,parent:r};for(const n of e.children??[]){const o=Np(n,t,e);if(o)return o}return null}function nk(e,t){const r=Np(e,t);if(!r)return null;const{question:n,parent:o}=r,s={...e,children:[n],childNodes:[t],shuffle:o==null?void 0:o.shuffle,showSolutions:(o==null?void 0:o.showSolutions)??"No",showFeedback:(o==null?void 0:o.showFeedback)??"No"};return(o==null?void 0:o.shuffle)===!0?s.maxScore=1:n.qType==="SA"?delete s.maxScore:n.maxScore!=null&&(s.maxScore=n.maxScore),s}function ok(e,t){const r=((t==null?void 0:t.enabled)??!0)&&!!e;return Tn({queryKey:["quml","questionset",e],enabled:r,queryFn:async()=>{const n=await Eu(e),o=u=>{if(!u)return[];const f=u.mimeType===Op&&u.identifier?[u.identifier]:[],m=(u.children??[]).flatMap(o);return[...f,...m]},s=o(n),a=new Map;s.length&&(await iS(s)).forEach(f=>{const m=f.identifier;m&&a.set(m,f)});const i=u=>{if(!u)return u;if(u.mimeType===Op&&u.identifier){const f=a.get(u.identifier)??u,m=f.outcomeDeclaration;return m!=null&&m.maxScore||(f.outcomeDeclaration={...m??{},maxScore:Pp(f)}),f}return Array.isArray(u.children)&&(u.children=u.children.map(f=>i(f))),u},c=i(n),d=c.outcomeDeclaration;return d!=null&&d.maxScore||(c.outcomeDeclaration={...d??{},maxScore:Pp(c)}),c}})}const xp="/assets/quml-player/sunbird-quml-player.js",sk="/assets/quml-player/styles.css",Fp="sunbird-quml-player";function ak(e){const t=e.children??[];return t.length?t.every(n=>n.objectType==="Question")?[e]:t:[]}const gt=class gt{constructor(){us(this,"eventHandlers",new WeakMap)}loadScript(){return gt.scriptLoaded||customElements.get(Fp)?(gt.scriptLoaded=!0,Promise.resolve()):(gt.scriptLoading||(gt.scriptLoading=new Promise((t,r)=>{const n=document.createElement("script");n.src=xp,n.setAttribute("data-quml-player-script","true"),n.onload=()=>{gt.scriptLoaded=!0,gt.scriptLoading=void 0,t()},n.onerror=()=>{gt.scriptLoading=void 0,r(new Error(`Failed to load QuML player script: ${xp}`))},document.body.appendChild(n)})),gt.scriptLoading)}loadStyles(){if(gt.stylesLoaded||document.querySelector('[data-quml-player-styles="true"]')){gt.stylesLoaded=!0;return}const t=document.createElement("link");t.rel="stylesheet",t.href=sk,t.setAttribute("data-quml-player-styles","true"),document.head.appendChild(t),gt.stylesLoaded=!0}static unloadStyles(){var t;(t=document.querySelector('[data-quml-player-styles="true"]'))==null||t.remove(),gt.stylesLoaded=!1}async createConfig(t,r,n){var s,a,i;return await this.loadScript(),{context:{mode:(n==null?void 0:n.mode)??"play",host:"",pdata:{id:((s=r==null?void 0:r.pdata)==null?void 0:s.id)??"sunbird.portal",ver:((a=r==null?void 0:r.pdata)==null?void 0:a.ver)??"1.0",pid:((i=r==null?void 0:r.pdata)==null?void 0:i.pid)??"sunbird-portal"},contentId:t.identifier??"",sid:(r==null?void 0:r.sid)??"",uid:(r==null?void 0:r.uid)??(r==null?void 0:r.userId)??"",channel:(r==null?void 0:r.channel)??"",did:(r==null?void 0:r.did)??"",tags:(r==null?void 0:r.tags)??[],contextRollup:(n==null?void 0:n.contextRollup)??(r==null?void 0:r.rollup)??{},objectRollup:(n==null?void 0:n.objectRollup)??{},...n!=null&&n.cdata?{cdata:n.cdata}:{}},config:{language:"en"},data:{sections:ak(t),identifier:t.identifier??""},metadata:t}}createElement(t){this.loadStyles();const r=document.createElement(Fp);return r.setAttribute("player-config",JSON.stringify(t)),r.setAttribute("data-player-id",t.metadata.identifier??"quml"),r}attachEventListeners(t,r,n){this.removeEventListeners(t);const o=a=>r==null?void 0:r(a),s=a=>n==null?void 0:n(a.detail);t.addEventListener("playerEvent",o),t.addEventListener("telemetryEvent",s),this.eventHandlers.set(t,{player:o,telemetry:s})}removeEventListeners(t){const r=this.eventHandlers.get(t);r&&(t.removeEventListener("playerEvent",r.player),t.removeEventListener("telemetryEvent",r.telemetry),this.eventHandlers.delete(t))}};us(gt,"scriptLoaded",!1),us(gt,"scriptLoading"),us(gt,"stylesLoaded",!1);let Oa=gt;const Pa=new Oa,We={contentPlayerRoot:"_contentPlayerRoot_1rdfn_1",flowLayout:"_flowLayout_1rdfn_9",stage:"_stage_1rdfn_13",aspectRatio:"_aspectRatio_1rdfn_16",playerHeader:"_playerHeader_1rdfn_32",playerHeaderThumb:"_playerHeaderThumb_1rdfn_46",playerHeaderTitle:"_playerHeaderTitle_1rdfn_56",typeBadge:"_typeBadge_1rdfn_66",typeDot:"_typeDot_1rdfn_105",playerFrame:"_playerFrame_1rdfn_125",coverOverlay:"_coverOverlay_1rdfn_133",coverHidden:"_coverHidden_1rdfn_145",coverThumb:"_coverThumb_1rdfn_150",coverPlayRing:"_coverPlayRing_1rdfn_159",coverPlayIcon:"_coverPlayIcon_1rdfn_172",coverLabel:"_coverLabel_1rdfn_181",coverSkeleton:"_coverSkeleton_1rdfn_187",playerWrapper:"_playerWrapper_1rdfn_213",infoStrip:"_infoStrip_1rdfn_223",infoChip:"_infoChip_1rdfn_239",infoChipLabel:"_infoChipLabel_1rdfn_258",infoChipIcon:"_infoChipIcon_1rdfn_267",playerError:"_playerError_1rdfn_273",playerErrorIcon:"_playerErrorIcon_1rdfn_287",playerErrorMsg:"_playerErrorMsg_1rdfn_292",qumlRoot:"_qumlRoot_1rdfn_299"},ik="application/vnd.sunbird.questionset";function lk(e,t){const r=new Map,n=s=>{for(const a of s)r.set(a.id,a),a.children&&n(a.children)};n(e);let o=r.get(t);for(;o;){if(o.mimeType===ik)return o.identifier;o=o.parent?r.get(o.parent):void 0}return null}const ck=[{key:"video",mimes:["video/mp4","video/webm","video/ogg"]},{key:"audio",mimes:["audio/mp3","audio/mpeg","audio/ogg","audio/wav"]},{key:"pdf",mimes:["application/pdf"]},{key:"epub",mimes:["application/epub"]},{key:"ecml",mimes:["application/vnd.ekstep.ecml-archive"]},{key:"h5p",mimes:["application/vnd.ekstep.h5p-archive"]},{key:"scorm",mimes:["application/vnd.ekstep.content-collection"]}];function dk(e){return ck.find(t=>t.mimes.includes(e))??{key:"other"}}function uk(e,t){switch(e){case"video":return t.contentPlayer.mimeLabelVideo;case"audio":return t.contentPlayer.mimeLabelAudio;case"pdf":return t.contentPlayer.mimeLabelPdf;case"epub":return t.contentPlayer.mimeLabelEpub;case"ecml":return t.contentPlayer.mimeLabelEcml;case"h5p":return t.contentPlayer.mimeLabelH5p;case"scorm":return t.contentPlayer.mimeLabelScorm;default:return t.contentPlayer.mimeLabelOther}}const fk={"pdf-player":["application/pdf"],"video-player":["video/mp4","video/webm"],"epub-player":["application/epub"]},hk={"pdf-player":"/assets/sunbird-pdf-player.js","video-player":"/assets/sunbird-video-player.js","epub-player":"/assets/sunbird-epub-player.js"},pk={"pdf-player":"sunbird-pdf-player","video-player":"sunbird-video-player","epub-player":"sunbird-epub-player"},gk="/content/preview/preview.html?webview=true&build_number=2.8.0.e552fcd";function Hl(e){for(const[t,r]of Object.entries(fk))if(r.includes(e))return t;return"default-player"}function mk(e,t,r){var s;const n=r==null?void 0:r.context,o=t.mimeType??e.mimeType??"";return{context:{mode:"play",partner:[],pdata:{id:((s=n==null?void 0:n.pdata)==null?void 0:s.id)??"sunbird.portal",ver:1,pid:"sunbird-portal"},contentId:e.identifier,sid:(n==null?void 0:n.sid)??"",uid:(n==null?void 0:n.uid)??"",channel:(n==null?void 0:n.channel)??"",did:(n==null?void 0:n.did)??"",timeDiff:0,contextRollup:{},tags:[],app:[(n==null?void 0:n.channel)??""],dims:""},config:{showEndPage:!1,showStartPage:!0,host:"",overlay:{showUser:!1},splash:{text:"",icon:"",bgImage:"",webLink:""},sideMenu:{showDownload:!0,showExit:!1,showShare:!0},apislug:"/action",repos:["/sunbird-plugins/renderer"],plugins:[{id:"org.sunbird.iframeEvent",ver:1,type:"plugin"},{id:"org.sunbird.player.endpage",ver:1.1,type:"plugin"}],enableTelemetryValidation:!1},metadata:t,data:o==="application/vnd.ekstep.ecml-archive"?t.body??{}:{}}}function vk(e){return document.querySelector(`script[src="${e}"]`)?Promise.resolve():new Promise((t,r)=>{const n=document.createElement("script");n.src=e,n.onload=()=>t(),n.onerror=()=>r(new Error(`Failed to load ${e}`)),document.head.appendChild(n)})}async function yk(e,t,r=100){await vk(hk[t]??""),!customElements.get(e)&&await new Promise((n,o)=>{let s=0;const a=setInterval(()=>{s++,customElements.get(e)?(clearInterval(a),n()):s>=r&&(clearInterval(a),o(new Error(`Custom element <${e}> did not register`)))},100)})}const bk=[{key:"author",icon:Vy},{key:"license",icon:Fy},{key:"language",icon:Ay},{key:"gradeLevel",icon:My},{key:"subject",icon:Nr},{key:"contentType",icon:Uy}];function Ck(e,t){switch(e){case"author":return t.contentPlayer.infoFieldAuthor;case"license":return t.contentPlayer.infoFieldLicense;case"language":return t.contentPlayer.infoFieldLanguage;case"gradeLevel":return t.contentPlayer.infoFieldClass;case"subject":return t.contentPlayer.infoFieldSubject;case"contentType":return t.contentPlayer.infoFieldType;default:return e}}function Sk({node:e}){const t=oe(),r=e.metadata??{},n=bk.flatMap(o=>{const s=r[o.key];if(!s)return[];const a=Array.isArray(s)?s.join(", "):String(s);return a?[{...o,label:Ck(o.key,t),val:a}]:[]});return n.length?l.jsx("div",{className:We.infoStrip,children:n.map(o=>l.jsxs("div",{className:We.infoChip,children:[o.icon&&l.jsx(o.icon,{size:13,className:We.infoChipIcon}),l.jsx("span",{className:We.infoChipLabel,children:o.label}),o.val]},o.key))}):null}function Mp({node:e,hidden:t}){var o;const r=oe(),n=e.appIcon??((o=e.metadata)==null?void 0:o.appIcon);return l.jsx("div",{className:`${We.coverOverlay} ${t?We.coverHidden:""}`,children:n?l.jsxs(l.Fragment,{children:[l.jsx("img",{src:n,alt:e.name,className:We.coverThumb}),l.jsx("div",{className:We.coverPlayRing,children:l.jsx("div",{className:We.coverPlayIcon})}),l.jsx("span",{className:We.coverLabel,children:r.contentPlayer.loadingPreview})]}):l.jsx("div",{className:We.coverSkeleton})})}function $p({message:e}){return l.jsxs("div",{className:We.playerError,children:[l.jsx(zy,{size:28,className:We.playerErrorIcon}),l.jsx("span",{className:We.playerErrorMsg,children:e})]})}function wk({mimeType:e}){const t=oe(),r=dk(e);return l.jsxs("span",{className:We.typeBadge,"data-type":r.key,children:[l.jsx("span",{className:We.typeDot}),uk(r.key,t)]})}const Ql=({node:e,editorMode:t,type:r,singleQuestion:n,layout:o="fill"})=>{var a;if(r==="quml")return l.jsx(Tk,{node:e,editorMode:t,singleQuestion:!!n});const s=e.appIcon??((a=e.metadata)==null?void 0:a.appIcon);return l.jsxs("div",{className:`${We.contentPlayerRoot} ${o==="flow"?We.flowLayout:""}`,children:[l.jsxs("div",{className:We.stage,children:[l.jsxs("div",{className:We.playerHeader,children:[s&&l.jsx("img",{src:s,alt:"",className:We.playerHeaderThumb}),l.jsx("span",{className:We.playerHeaderTitle,children:e.name}),l.jsx(wk,{mimeType:e.mimeType??""})]}),l.jsx(_k,{node:e})]}),l.jsx(Sk,{node:e})]})};function _k({node:e}){var y;const t=oe(),r=K(C=>C.editorConfig),[n,o]=p.useState(()=>Hl(e.mimeType??"")),[s,a]=p.useState(!1),[i,c]=p.useState(null),[d,u]=p.useState(e.metadata??{}),[f,m]=p.useState(!1),g=p.useRef(null),b=p.useRef(null),h=((y=r==null?void 0:r.config)==null?void 0:y.previewCdnUrl)??gk;p.useEffect(()=>{let C=!1;return m(!1),a(!1),c(null),u(e.metadata??{}),o(Hl(e.mimeType??"")),rk(e.identifier).then(S=>{if(C)return;const w={...e.metadata??{},...S};u(w);const T=S.mimeType??e.mimeType??"";o(Hl(T)),m(!0)}).catch(()=>{C||m(!0)}),()=>{C=!0}},[e.identifier]);const v=mk(e,d,r);return p.useEffect(()=>{if(!f||n!=="default-player")return;const C=g.current;if(!C)return;C.src=h;const S=()=>{try{const T=C.contentWindow;if(typeof(T==null?void 0:T.initializePreview)!="function"){c(t.contentPlayer.previewPlayerUnavailable);return}T.initializePreview(v),setTimeout(()=>a(!0),300)}catch(T){console.error("[ContentPlayer] initializePreview failed",T),c(t.contentPlayer.failedToInitializePlayer)}},w=()=>c(t.contentPlayer.previewPlayerLoadFailed);return C.addEventListener("load",S),C.addEventListener("error",w),()=>{C.removeEventListener("load",S),C.removeEventListener("error",w),C.src=""}},[e.identifier,n,h,f,t]),p.useEffect(()=>{if(!f||n==="default-player")return;const C=b.current;if(!C)return;const S=pk[n];if(!S)return;const w=v;yk(S,n).then(()=>{if(!b.current)return;if(!customElements.get(S)){o("default-player");return}const T=document.createElement(S);T.setAttribute("player-config",JSON.stringify(w)),T.addEventListener("playerEvent",()=>{}),T.addEventListener("telemetryEvent",()=>{}),C.innerHTML="",C.appendChild(T),setTimeout(()=>{try{T.playerConfig=w}catch{}a(!0)},200)}).catch(()=>{console.warn(`[ContentPlayer] ${n} script unavailable, falling back to iframe`),o("default-player")})},[e.identifier,n,f]),l.jsxs("div",{className:We.aspectRatio,children:[i?l.jsx($p,{message:i}):l.jsx(Mp,{node:e,hidden:s}),n==="default-player"?l.jsx("iframe",{ref:g,id:"contentPlayer",title:e.name,className:We.playerFrame,name:"contentPlayer",allowFullScreen:!0}):l.jsx("div",{ref:b,className:We.playerFrame})]})}function Tk({node:e,editorMode:t,singleQuestion:r}){const n=oe(),o=K(g=>g.editorConfig),s=re(g=>g.treeData),a=p.useRef(null),i=r?lk(s,e.id):e.identifier,{data:c,isLoading:d,error:u}=ok(i??"",{enabled:!!i}),f=p.useMemo(()=>c?r?nk(c,e.identifier):c:null,[c,r,e.identifier]);p.useEffect(()=>{const g=a.current;if(!g||!f)return;let b=null,h=!1;return(async()=>{try{const v=await Pa.createConfig(f,o==null?void 0:o.context,{mode:t==="edit"?"edit":"play"});if(h||!a.current)return;const y=Pa.createElement(v);b=y,Pa.attachEventListeners(y,C=>console.debug("[QumlPlayer] playerEvent",C.detail),C=>console.debug("[QumlPlayer] telemetryEvent",C)),g.innerHTML="",g.appendChild(y)}catch(v){console.error("[QumlPlayer] failed to initialize",v)}})(),()=>{h=!0,b&&(Pa.removeEventListeners(b),b.remove()),Oa.unloadStyles()}},[f,o,t,r]);const m=u?`${n.contentPlayer.unableToLoadQuestionset} ${u.message}`:r&&!i?n.contentPlayer.parentQuestionsetNotResolved:r&&c&&!f?n.contentPlayer.questionNotFoundInQuestionset:null;return l.jsxs("div",{className:We.qumlRoot,children:[m?l.jsx($p,{message:m}):d||!f?l.jsx(Mp,{node:e,hidden:!1}):null,l.jsx("div",{ref:a,className:We.playerWrapper})]})}const Zt={overlay:"_overlay_1b1xq_1",modal:"_modal_1b1xq_11",header:"_header_1b1xq_21",body:"_body_1b1xq_37",hint:"_hint_1b1xq_43",list:"_list_1b1xq_49",item:"_item_1b1xq_55",selected:"_selected_1b1xq_68",empty:"_empty_1b1xq_73",footer:"_footer_1b1xq_79",cancelBtn:"_cancelBtn_1b1xq_87",moveBtn:"_moveBtn_1b1xq_95"};function Ek(e,t,r){const n=[],o=s=>{var a;for(const i of s)i.isFolder&&i.id!==r&&i.id!==t&&n.push(i),(a=i.children)!=null&&a.length&&o(i.children)};return o(e),n}const Ak=({resourceId:e,resourceName:t,currentUnitId:r,onClose:n})=>{var f;const o=oe(),{treeData:s,moveNode:a}=re(),i=Ek(s,((f=s[0])==null?void 0:f.id)??"",r),[c,d]=p.useState(null),u=()=>{c&&(a(e,r,c),n())};return l.jsx("div",{className:Zt.overlay,role:"dialog","aria-label":o.resourceReorderDialog.dialogAriaLabel,children:l.jsxs("div",{className:Zt.modal,children:[l.jsxs("div",{className:Zt.header,children:[l.jsxs("span",{children:[o.resourceReorderDialog.moveHeaderPrefix,' "',t,'"']}),l.jsx("button",{onClick:n,"aria-label":o.resourceReorderDialog.closeAriaLabel,children:l.jsx(fr,{size:16})})]}),l.jsxs("div",{className:Zt.body,children:[l.jsx("p",{className:Zt.hint,children:o.resourceReorderDialog.selectUnitHint}),l.jsxs("ul",{className:Zt.list,children:[i.map(m=>l.jsxs("li",{className:`${Zt.item} ${c===m.id?Zt.selected:""}`,onClick:()=>d(m.id),children:[l.jsx(Ey,{size:14}),l.jsx("span",{children:m.name})]},m.id)),i.length===0&&l.jsx("li",{className:Zt.empty,children:o.resourceReorderDialog.noUnitsAvailable})]})]}),l.jsxs("div",{className:Zt.footer,children:[l.jsx("button",{className:Zt.cancelBtn,onClick:n,children:o.resourceReorderDialog.cancelButton}),l.jsx("button",{className:Zt.moveBtn,onClick:u,disabled:!c,children:o.resourceReorderDialog.moveButton})]})]})})},gr={overlay:"_overlay_1d56g_1",modal:"_modal_1d56g_11",header:"_header_1d56g_21",body:"_body_1d56g_37",table:"_table_1d56g_43",pageInput:"_pageInput_1d56g_61",empty:"_empty_1d56g_68",footer:"_footer_1d56g_74",cancelBtn:"_cancelBtn_1d56g_82",saveBtn:"_saveBtn_1d56g_90"};function kk(e){const t=[],r=n=>{var o;for(const s of n)!s.isFolder&&(!s.children||s.children.length===0)?t.push(s):(o=s.children)!=null&&o.length&&r(s.children)};return r(e),t}const Ik=({onClose:e})=>{const t=oe(),{treeData:r,updateNode:n}=re(),o=kk(r),[s,a]=p.useState(()=>Object.fromEntries(o.map(c=>{var d;return[c.id,String(((d=c.metadata)==null?void 0:d.pageNumber)??"")]}))),i=p.useCallback(()=>{for(const[c,d]of Object.entries(s))d!==""&&n(c,{pageNumber:parseInt(d,10)||void 0});e()},[s,n,e]);return l.jsx("div",{className:gr.overlay,role:"dialog","aria-label":t.assignPageNumber.dialogAriaLabel,children:l.jsxs("div",{className:gr.modal,children:[l.jsxs("div",{className:gr.header,children:[l.jsx("span",{children:t.assignPageNumber.title}),l.jsx("button",{onClick:e,"aria-label":t.assignPageNumber.closeAriaLabel,children:l.jsx(fr,{size:16})})]}),l.jsx("div",{className:gr.body,children:o.length===0?l.jsx("p",{className:gr.empty,children:t.assignPageNumber.emptyState}):l.jsxs("table",{className:gr.table,children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:t.assignPageNumber.contentColumnHeader}),l.jsx("th",{children:t.assignPageNumber.pageNumberColumnHeader})]})}),l.jsx("tbody",{children:o.map(c=>l.jsxs("tr",{children:[l.jsx("td",{children:c.name}),l.jsx("td",{children:l.jsx("input",{type:"number",min:1,value:s[c.id]??"",onChange:d=>a(u=>({...u,[c.id]:d.target.value})),className:gr.pageInput})})]},c.id))})]})}),l.jsxs("div",{className:gr.footer,children:[l.jsx("button",{className:gr.cancelBtn,onClick:e,children:t.assignPageNumber.cancelButton}),l.jsxs("button",{className:gr.saveBtn,onClick:i,children:[l.jsx(xy,{size:14})," ",t.assignPageNumber.saveButton]})]})]})})},Xe={container:"_container_p2feh_1",panelHeader:"_panelHeader_p2feh_10",panelHeaderLeft:"_panelHeaderLeft_p2feh_19",panelCollapseBtn:"_panelCollapseBtn_p2feh_27",titleRow:"_titleRow_p2feh_46",field:"_field_p2feh_47",moveBtn:"_moveBtn_p2feh_64",icon:"_icon_p2feh_84",nameInput:"_nameInput_p2feh_93",fieldHeader:"_fieldHeader_p2feh_118",label:"_label_p2feh_124",fieldCount:"_fieldCount_p2feh_133",chips:"_chips_p2feh_170",chip:"_chip_p2feh_170",chipRemove:"_chipRemove_p2feh_188",keywordInput:"_keywordInput_p2feh_202",input:"_input_p2feh_207",addBtn:"_addBtn_p2feh_220",radioGroup:"_radioGroup_p2feh_234",radioLabel:"_radioLabel_p2feh_239"},Dk=({node:e,editorMode:t,onMoveClick:r,reorderDialog:n})=>{var N,M;const{updateNode:o,markDirty:s}=re(),a=t==="edit",i=Vo(e),c=oe(),d=K(B=>B.relationalFormConfig),u=B=>d==null?void 0:d.find(U=>U.code===B),f=B=>!d||!!u(B),m=(B,U)=>{var ee;return((ee=u(B))==null?void 0:ee.label)||U},[g,b]=p.useState(!0),h=((N=e.metadata)==null?void 0:N.relationalMetadata)??{},[v,y]=p.useState(h.name??e.name??""),[C,S]=p.useState(""),[w,T]=p.useState(Array.isArray(h.keywords)?h.keywords:Array.isArray((M=e.metadata)==null?void 0:M.keywords)?e.metadata.keywords:[]),[E,L]=p.useState(!!h.optional);p.useEffect(()=>{var U,ee;const B=((U=e.metadata)==null?void 0:U.relationalMetadata)??{};y(B.name??e.name??""),T(Array.isArray(B.keywords)?B.keywords:Array.isArray((ee=e.metadata)==null?void 0:ee.keywords)?e.metadata.keywords:[]),L(!!B.optional)},[e.id]);const A=()=>{v.trim()&&v!==e.name&&(o(e.id,{name:v.trim()}),s())},x=()=>{const B=C.trim();if(B&&!w.includes(B)){const U=[...w,B];T(U),o(e.id,{keywords:U}),s()}S("")},F=B=>{const U=w.filter(ee=>ee!==B);T(U),o(e.id,{keywords:U}),s()},P=B=>{L(B),o(e.id,{optional:B}),s()};return l.jsxs("div",{className:Xe.container,children:[l.jsxs("div",{className:Xe.panelHeader,children:[l.jsxs("div",{className:Xe.panelHeaderLeft,children:[l.jsx("span",{className:`sbx-ct-badge--${i.key}`,children:i.label}),a&&l.jsx("button",{type:"button",className:Xe.moveBtn,onClick:r,children:c.contentEditForm.moveToAnotherUnitButton})]}),l.jsx("button",{type:"button",className:Xe.panelCollapseBtn,onClick:()=>b(B=>!B),"aria-expanded":g,"aria-label":g?c.contentEditForm.collapseMetadataPanelAriaLabel:c.contentEditForm.expandMetadataPanelAriaLabel,title:g?c.contentEditForm.collapseTitle:c.contentEditForm.expandTitle,children:g?l.jsx(Zr,{size:15}):l.jsx(Cy,{size:15})})]}),g&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:Xe.titleRow,children:[e.appIcon&&l.jsx("img",{src:e.appIcon,alt:c.contentEditForm.iconAlt,className:Xe.icon}),l.jsx("input",{type:"text",className:Xe.nameInput,value:v,disabled:!a,onChange:B=>y(B.target.value),onBlur:A,placeholder:c.contentEditForm.contentNamePlaceholder})]}),f("keywords")&&l.jsxs("div",{className:Xe.field,children:[l.jsx("div",{className:Xe.fieldHeader,children:l.jsxs("label",{className:Xe.label,children:[m("keywords",c.contentEditForm.keywordsLabel),w.length>0&&l.jsx("span",{className:Xe.fieldCount,children:w.length})]})}),w.length>0&&l.jsx("div",{className:Xe.chips,children:w.map(B=>l.jsxs("span",{className:Xe.chip,children:[B,a&&l.jsx("button",{type:"button",className:Xe.chipRemove,onClick:()=>F(B),children:"×"})]},B))}),a&&l.jsxs("div",{className:Xe.keywordInput,children:[l.jsx("input",{type:"text",className:Xe.input,value:C,placeholder:c.contentEditForm.addKeywordPlaceholder,onChange:B=>S(B.target.value),onKeyDown:B=>{B.key==="Enter"&&(B.preventDefault(),x())}}),l.jsx("button",{type:"button",className:Xe.addBtn,onClick:x,children:c.contentEditForm.addButton})]})]}),f("optional")&&l.jsxs("div",{className:Xe.field,children:[l.jsx("label",{className:Xe.label,children:m("optional",c.contentEditForm.optionalInCollectionLabel)}),l.jsxs("div",{className:Xe.radioGroup,children:[l.jsxs("label",{className:Xe.radioLabel,children:[l.jsx("input",{type:"radio",name:`optional-${e.id}`,checked:E===!0,onChange:()=>P(!0),disabled:!a}),c.contentEditForm.yesOption]}),l.jsxs("label",{className:Xe.radioLabel,children:[l.jsx("input",{type:"radio",name:`optional-${e.id}`,checked:E===!1,onChange:()=>P(!1),disabled:!a}),c.contentEditForm.noOption]})]})]})]}),n]})},Jo={iconBtn:"_iconBtn_gliz0_1",editable:"_editable_gliz0_14",iconImg:"_iconImg_gliz0_26",placeholder:"_placeholder_gliz0_34",removeBtn:"_removeBtn_gliz0_41"},Lk=({nodeId:e,value:t,editable:r})=>{const[n,o]=p.useState(!1),{updateNode:s,markDirty:a}=re(),i=oe(),c=u=>{s(e,{appIcon:u}),a(),o(!1)},d=u=>{u.stopPropagation(),s(e,{appIcon:""}),a()};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:[Jo.iconBtn,r?Jo.editable:""].filter(Boolean).join(" "),role:r?"button":void 0,tabIndex:r?0:-1,"aria-label":r?i.titleAppIcon.selectAppIconAriaLabel:i.titleAppIcon.appIconAriaLabel,onClick:()=>r&&o(!0),onKeyDown:u=>{r&&(u.key==="Enter"||u.key===" ")&&o(!0)},children:[t?l.jsx("img",{src:t,alt:i.titleAppIcon.appIconAlt,className:Jo.iconImg}):l.jsx("div",{className:Jo.placeholder,children:l.jsx(Sd,{size:24})}),t&&r&&l.jsx("button",{type:"button",className:Jo.removeBtn,onClick:d,"aria-label":i.titleAppIcon.removeIconAriaLabel,children:l.jsx(js,{size:11})})]}),n&&l.jsx(Sp,{nodeId:e,currentValue:t,onSelect:c,onClose:()=>o(!1)})]})},xe={courseDetails:"_courseDetails_1eby7_1",courseDetailsLoading:"_courseDetailsLoading_1eby7_7",courseDetailsError:"_courseDetailsError_1eby7_7",detailsCard:"_detailsCard_1eby7_12",unitsCard:"_unitsCard_1eby7_12",cardTitle:"_cardTitle_1eby7_22",fieldGroup:"_fieldGroup_1eby7_29",fieldGroupLast:"_fieldGroupLast_1eby7_33",fieldLabel:"_fieldLabel_1eby7_37",fieldValue:"_fieldValue_1eby7_47",fieldValueMultiline:"_fieldValueMultiline_1eby7_52",unitsLabel:"_unitsLabel_1eby7_58",unitsDescription:"_unitsDescription_1eby7_68",unitList:"_unitList_1eby7_74",unitCard:"_unitCard_1eby7_80",unitHeader:"_unitHeader_1eby7_86",unitIcon:"_unitIcon_1eby7_99",unitTitle:"_unitTitle_1eby7_111",unitCount:"_unitCount_1eby7_120",unitBody:"_unitBody_1eby7_126",unitDescription:"_unitDescription_1eby7_131",unitKeywords:"_unitKeywords_1eby7_138",keywordPill:"_keywordPill_1eby7_145",unitTopicsRow:"_unitTopicsRow_1eby7_155",unitContents:"_unitContents_1eby7_167",contentRow:"_contentRow_1eby7_174",contentIcon:"_contentIcon_1eby7_180",contentTitle:"_contentTitle_1eby7_185",contentSkills:"_contentSkills_1eby7_193",skillPill:"_skillPill_1eby7_200"},Ok={video:Us,pdf:Ao,h5p:Fs,scorm:Bs,audio:$s,quiz:xs,course:Nr,default:xr};function Wl(e){return Array.isArray(e)?e.map(String):e?[String(e)]:[]}const Bp=({courseId:e,variant:t="compact",title:r,onLoaded:n})=>{const o=oe(),s=sr(),[a,i]=p.useState(null),[c,d]=p.useState(""),[u,f]=p.useState(null),[m,g]=p.useState({}),b=t==="full";p.useEffect(()=>{let C=!1;return i(null),d(""),f(null),ku(e).then(S=>{if(C)return;const T=(S.children??[]).map(E=>ea(E));i(T),d(S.description??""),g(Object.fromEntries(T.map(E=>[E.id,!0]))),n==null||n({totalContents:T.reduce((E,L)=>{var A;return E+(((A=L.children)==null?void 0:A.length)??0)},0)})}).catch(()=>{C||f(o.learningPath.courseDetailsError)}),()=>{C=!0}},[e,o.learningPath.courseDetailsError]);const h=C=>g(S=>({...S,[C]:!S[C]})),v=C=>{var S;return s?Wl((S=C.metadata)==null?void 0:S[s.code]):[]},y=C=>(C===1?o.learningPath.contentCountLabel:o.learningPath.contentCountLabelPlural).replace("{count}",String(C));return l.jsx("div",{className:xe.courseDetails,children:u?l.jsx("p",{className:xe.courseDetailsError,children:u}):a===null?l.jsx("p",{className:xe.courseDetailsLoading,children:o.learningPath.courseDetailsLoading}):l.jsxs(l.Fragment,{children:[b&&l.jsxs("div",{className:xe.detailsCard,children:[l.jsx("h3",{className:xe.cardTitle,children:o.learningPath.courseDetailsCardTitle}),l.jsxs("div",{className:xe.fieldGroup,children:[l.jsx("span",{className:xe.fieldLabel,children:o.learningPath.courseTitleFieldLabel}),l.jsx("div",{className:xe.fieldValue,children:r})]}),l.jsxs("div",{className:xe.fieldGroupLast,children:[l.jsx("span",{className:xe.fieldLabel,children:o.learningPath.courseDescriptionFieldLabel}),l.jsx("div",{className:xe.fieldValueMultiline,children:c||o.learningPath.noCourseDescriptionPlaceholder})]})]}),a.length===0?l.jsx("p",{className:xe.courseDetailsLoading,children:o.learningPath.courseDetailsEmpty}):l.jsxs("div",{className:b?xe.unitsCard:void 0,children:[l.jsx("span",{className:xe.unitsLabel,children:o.learningPath.unitsSectionLabel}),b&&l.jsx("p",{className:xe.unitsDescription,children:o.learningPath.unitsSectionDescription}),l.jsx("div",{className:xe.unitList,children:a.map(C=>{var L,A;const S=!!m[C.id],w=(C.children??[]).length,T=Wl((L=C.metadata)==null?void 0:L.keywords),E=Wl((A=C.metadata)==null?void 0:A.topic);return l.jsxs("div",{className:xe.unitCard,children:[l.jsxs("button",{type:"button",className:xe.unitHeader,onClick:()=>h(C.id),"aria-expanded":S,children:[S?l.jsx(Zr,{size:17}):l.jsx(fi,{size:17}),l.jsx("span",{className:xe.unitIcon,children:l.jsx(bd,{size:16})}),l.jsx("span",{className:xe.unitTitle,children:C.name}),b&&l.jsx("span",{className:xe.unitCount,children:y(w)})]}),S&&l.jsxs("div",{className:xe.unitBody,children:[b&&C.description&&l.jsx("p",{className:xe.unitDescription,children:C.description}),b&&T.length>0&&l.jsx("div",{className:xe.unitKeywords,children:T.map(x=>l.jsx("span",{className:xe.keywordPill,children:x},x))}),b&&E.length>0&&l.jsxs("div",{className:xe.unitTopicsRow,children:[l.jsx("span",{className:xe.fieldLabel,children:o.learningPath.unitTopicsFieldLabel}),l.jsx("span",{children:E.join(", ")})]}),l.jsx("div",{className:xe.unitContents,children:(C.children??[]).map(x=>{const F=Vo(x),P=Ok[F.key]??xr,N=v(x);return l.jsxs("div",{className:xe.contentRow,children:[l.jsx(P,{size:16,className:xe.contentIcon}),l.jsx("span",{className:xe.contentTitle,children:x.name}),N.length>0&&l.jsx("div",{className:xe.contentSkills,children:N.map(M=>l.jsx("span",{className:xe.skillPill,children:M},M))})]},x.id)})})]})]},C.id)})})]})]})})},De={backToPathButton:"_backToPathButton_42cuj_1",assessmentTitle:"_assessmentTitle_42cuj_15",slotPills:"_slotPills_42cuj_22",slotPill:"_slotPill_42cuj_22",slotPillHint:"_slotPillHint_42cuj_40",slotPillPurpose:"_slotPillPurpose_42cuj_45",slotPillWarning:"_slotPillWarning_42cuj_51",slotPillPrimary:"_slotPillPrimary_42cuj_56",courseCard:"_courseCard_42cuj_62",courseCardHeading:"_courseCardHeading_42cuj_72",courseCardDescription:"_courseCardDescription_42cuj_79",courseNotAdded:"_courseNotAdded_42cuj_85",assessmentExplainer:"_assessmentExplainer_42cuj_93",assessmentExplainerHeading:"_assessmentExplainerHeading_42cuj_107",leafContentLayout:"_leafContentLayout_42cuj_117",container:"_container_42cuj_131",emptyState:"_emptyState_42cuj_140",titleRow:"_titleRow_42cuj_150",titleRowLp:"_titleRowLp_42cuj_157",nodeTitle:"_nodeTitle_42cuj_171",nodeTitleLpRoot:"_nodeTitleLpRoot_42cuj_193",nodeTitleSub:"_nodeTitleSub_42cuj_198",courseDetailHeader:"_courseDetailHeader_42cuj_203",courseDetailIcon:"_courseDetailIcon_42cuj_210",courseDetailTitle:"_courseDetailTitle_42cuj_222",courseDetailMeta:"_courseDetailMeta_42cuj_229",formArea:"_formArea_42cuj_234",contentListArea:"_contentListArea_42cuj_238",contentListAreaLp:"_contentListAreaLp_42cuj_242",dropZone:"_dropZone_42cuj_246",reviewComment:"_reviewComment_42cuj_253",reviewCommentLabel:"_reviewCommentLabel_42cuj_266",reviewCommentText:"_reviewCommentText_42cuj_272"},Pk=({slot:e,isEditable:t})=>{var g;const r=oe(),n=re(b=>b.treeData),o=re(b=>b.selectNode),s=(g=n[0])==null?void 0:g.id,{pre:a,post:i}=Tl(),c=(e==="pre"?a:i).filled,d=e==="pre"?r.learningPath.priorAssessmentLabel:r.learningPath.outcomeAssessmentLabel,u=e==="pre"?Dn:yy,f=e==="pre"?r.learningPath.priorAssessmentExplainerTitle:r.learningPath.outcomeAssessmentExplainerTitle,m=e==="pre"?r.learningPath.priorAssessmentExplainerBody:r.learningPath.outcomeAssessmentExplainerBody;return l.jsxs("div",{className:De.container,children:[l.jsxs("button",{type:"button",className:De.backToPathButton,onClick:()=>s&&o(s),children:[l.jsx(ui,{size:14})," ",r.learningPath.backToPathButton]}),l.jsx("div",{className:De.assessmentTitle,children:d}),l.jsx("div",{className:De.slotPills,children:e==="pre"?l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:`${De.slotPill} ${De.slotPillHint}`,children:[l.jsx(vd,{size:12})," ",r.learningPath.priorAssessmentHint]}),l.jsxs("span",{className:`${De.slotPill} ${De.slotPillPurpose}`,children:[l.jsx(my,{size:12})," ",r.learningPath.priorAssessmentPurposeLabel]})]}):l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:`${De.slotPill} ${De.slotPillWarning}`,children:[l.jsx(wd,{size:12})," ",r.learningPath.outcomeUnlocksHint]}),l.jsxs("span",{className:`${De.slotPill} ${De.slotPillPrimary}`,children:[l.jsx(vd,{size:12})," ",r.learningPath.outcomeAssessmentHint]})]})}),l.jsxs("div",{className:De.formArea,children:[l.jsxs("div",{className:De.courseCard,children:[l.jsx("div",{className:De.courseCardHeading,children:r.learningPath.assessmentCourseSectionTitle}),l.jsx("p",{className:De.courseCardDescription,children:r.learningPath.assessmentCourseSectionDescription}),c?l.jsx(Vl,{slot:e,isEditable:t}):l.jsx("div",{className:De.courseNotAdded,children:r.learningPath.assessmentNotAddedYet})]}),l.jsxs("div",{className:De.assessmentExplainer,children:[l.jsxs("div",{className:De.assessmentExplainerHeading,children:[l.jsx(u,{size:16}),l.jsx("span",{children:f})]}),l.jsx("p",{children:m})]})]})]})},Nk="application/vnd.sunbird.questionset",qp="application/vnd.sunbird.question",xk=[Nk,qp];function jp(e){var t,r;if(!(!e||e.status!=="Draft"||((t=e.metadata)==null?void 0:t.prevStatus)!=="Review"))return(r=e.metadata)==null?void 0:r.rejectComment}const Fk=({editorMode:e,onToolbarEvent:t})=>{var fe,pe,ie,Te,ye;const r=oe(),[n,o]=p.useState("details"),[s,a]=p.useState([]),[i,c]=p.useState(null),[d,u]=p.useState(!1),[f,m]=p.useState(null),g=p.useRef(null),b=p.useRef(),{selectedNodeId:h,breadcrumb:v,activeNodeMeta:y,updateNode:C,treeData:S,selectNode:w}=re(),T=hr($=>$.activeAssessmentSlot),E=K($=>{var q,Z,he,be;return((Z=(q=$.editorConfig)==null?void 0:q.context)==null?void 0:Z.contentId)??((be=(he=$.editorConfig)==null?void 0:he.context)==null?void 0:be.identifier)??""}),L=K($=>$.editorProfile.competencyScoped),A=h?Up(S,h):null;p.useEffect(()=>{m(null)},[A==null?void 0:A.identifier]);const x=!!A&&!A.parent,F=!!(A!=null&&A.isFolder),P=A&&xk.includes(A.mimeType??""),N=(A==null?void 0:A.mimeType)===qp,M=A&&!A.isFolder&&!P&&!x,U=L&&F&&lt(A??void 0)?((ie=(pe=(fe=S[0])==null?void 0:fe.children)==null?void 0:pe[0])==null?void 0:ie.id)===(A==null?void 0:A.id)?"pre":"post":L?T:null,ee=jp(A)??(x?jp(S[0]):void 0),Q=p.useCallback(()=>{const $=g.current;if(!$||!h)return;const q=$.innerText.trim();clearTimeout(b.current),b.current=setTimeout(()=>{C(h,{name:q})},600)},[h,C]),te=p.useCallback($=>{t({action:"onFormValueChange",data:$})},[t]),ue=p.useCallback(($,q)=>{a(q),t({action:"onFormStatusChange",data:{isValid:$,nodeId:h}})},[t,h]);if(!A)return l.jsx("div",{className:De.emptyState,children:l.jsx("p",{children:r.contextualEditor.emptyStateMessage})});if(P)return l.jsx(Ql,{node:A,editorMode:e,type:"quml",singleQuestion:N});if(L&&M&&A.primaryCategory==="Course"){const $=A.parent?yS(((Te=S[0])==null?void 0:Te.children)??[],A.parent):null,q=($==null?void 0:$.role)==="pre"?r.learningPath.priorAssessmentLabel:($==null?void 0:$.role)==="post"?r.learningPath.outcomeAssessmentLabel:($==null?void 0:$.role)==="level"?r.learningPath.levelNumberPrefix.replace("{n}",String($.levelNumber)):null,Z=f===null?"":` · ${(f===1?r.learningPath.contentCountLabel:r.learningPath.contentCountLabelPlural).replace("{count}",String(f))}`;return l.jsxs("div",{className:De.container,children:[l.jsxs("button",{type:"button",className:De.backToPathButton,onClick:()=>A.parent&&w(A.parent),children:[l.jsx(ui,{size:14}),q?r.learningPath.backToLevelButton.replace("{label}",q):r.learningPath.backToPathButton]}),l.jsxs("div",{className:De.courseDetailHeader,children:[l.jsx("span",{className:De.courseDetailIcon,children:l.jsx(Nr,{size:26})}),l.jsxs("div",{children:[l.jsx("h2",{className:De.courseDetailTitle,children:A.name}),l.jsxs("span",{className:De.courseDetailMeta,children:[A.primaryCategory,Z]})]})]}),l.jsx(Bp,{courseId:A.identifier,variant:"full",title:A.name,onLoaded:({totalContents:he})=>m(he)},A.identifier)]})}return U?l.jsx(Pk,{slot:U,isEditable:e==="edit"}):M?l.jsxs("div",{className:De.leafContentLayout,children:[l.jsx(Ql,{node:A,editorMode:e,type:"content",layout:"flow"}),l.jsx(Dk,{node:A,editorMode:e,onMoveClick:()=>c(A.identifier),reorderDialog:i?l.jsx(Ak,{resourceId:i,resourceName:A.name,currentUnitId:A.parent??"",onClose:()=>c(null)}):null})]}):l.jsxs("div",{className:De.container,children:[l.jsx(bE,{crumbs:v}),ee&&l.jsxs("div",{className:De.reviewComment,role:"alert",children:[l.jsx("span",{className:De.reviewCommentLabel,children:r.contextualEditor.reviewCommentLabel}),l.jsx("span",{className:De.reviewCommentText,children:ee})]}),l.jsxs("div",{className:[De.titleRow,L?De.titleRowLp:""].filter(Boolean).join(" "),children:[x&&h&&l.jsx(Lk,{nodeId:h,value:String(A.appIcon??((ye=A.metadata)==null?void 0:ye.appIcon)??""),editable:e==="edit"}),l.jsx("div",{ref:g,className:[De.nodeTitle,L&&x?De.nodeTitleLpRoot:"",L&&!x?De.nodeTitleSub:""].filter(Boolean).join(" "),contentEditable:e==="edit",suppressContentEditableWarning:!0,onInput:Q,onBlur:Q,"data-placeholder":r.contextualEditor.untitledPlaceholder,"aria-label":r.contextualEditor.nodeTitleAriaLabel,children:A.name})]}),l.jsx(CE,{activeTab:n,onChange:$=>o($),errorTabs:s,visibleTabs:x&&!L?void 0:["details"]}),l.jsx("div",{className:De.formArea,children:l.jsx(PA,{nodeMetadata:y,activeTab:n,isRoot:x,isFolder:F,editorMode:e,onFormValueChange:te,onFormStatusChange:ue},`${h??"none"}:${x?"root":"node"}`)}),(F||x)&&n==="details"&&l.jsx("div",{className:[De.contentListArea,L?De.contentListAreaLp:""].filter(Boolean).join(" "),children:l.jsx(JA,{editorMode:e,isRoot:x})}),l.jsx(ek,{isActive:!1,label:r.contextualEditor.dropZoneLabel,nodeId:h??void 0,className:De.dropZone}),d&&l.jsx(Ik,{contentId:E,onClose:()=>u(!1)})]})};function Up(e,t){for(const r of e){if(r.id===t)return r;if(r.children){const n=Up(r.children,t);if(n)return n}}}const zp=ko((e,t)=>({allContent:[],filteredContent:[],searchQuery:"",activeFilter:"all",advancedFilters:{},isLoading:!1,totalCount:0,offset:0,sortAZ:!1,setContent:(r,n)=>{e({allContent:r,totalCount:n,offset:r.length}),t().applyFilter()},appendContent:(r,n)=>{const s=[...t().allContent,...r];e({allContent:s,totalCount:n,offset:s.length}),t().applyFilter()},setFilter:r=>{e({activeFilter:r}),t().applyFilter()},setSearch:r=>{e({searchQuery:r}),t().applyFilter()},setLoading:r=>e({isLoading:r}),setAdvancedFilters:r=>e({advancedFilters:r}),setOffset:r=>e({offset:r}),setSortAZ:r=>e({sortAZ:r}),applyFilter:()=>{const{allContent:r,activeFilter:n,searchQuery:o}=t();let s=r;if(n&&n!=="all"){const a=n.toLowerCase();s=s.filter(i=>[i.mimeType??"",i.primaryCategory??"",i.contentType??""].join(" ").toLowerCase().includes(a))}if(o&&o.trim()!==""){const a=o.toLowerCase().trim();s=s.filter(i=>(i.name??"").toLowerCase().includes(a))}e({filteredContent:s})}}));function Mk(e,t,r,n){const o={primaryCategory:["Course"]};return n&&(o.framework=[n]),!e&&t.length&&r&&(o[r]=t),o}function $k(e,t){if(!(!e||!t))return[...Lp,t,"framework"]}function Bk(e,t,r,n,o){return e?t?r&&!n&&o.length===0?"noSkills":null:"noCurriculum":null}const qk=20,jk=[];function Vp(){var d;const e=K(u=>u.editorConfig),t=re(u=>u.selectedNodeId),r=re(u=>u.treeData),n=p.useCallback(()=>{if(!t||!r.length)return 0;function u(f,m,g=0){var b;for(const h of f){if(h.id===m)return g;if((b=h.children)!=null&&b.length){const v=u(h.children,m,g+1);if(v>=0)return v}}return-1}return Math.max(0,u(r,t))},[t,r])(),o=(d=e==null?void 0:e.config)==null?void 0:d.hierarchy;if(!o)return[...Bh];const s=`level${n}`,a=o[s],i=a==null?void 0:a.children,c=i==null?void 0:i.Content;return c!=null&&c.length?c:[...Bh]}function Uk(){const e=zp(),t=K(A=>{var x,F;return((F=(x=A.editorConfig)==null?void 0:x.context)==null?void 0:F.channel)??""}),r=Vp(),n=K(A=>A.editorProfile),o=hr(A=>A.activeAssessmentSlot),s=re(A=>A.activeNodeMeta),a=re(A=>A.treeData),i=re(A=>A.treeCache),c=re(A=>A.selectedNodeId),d=re(A=>A.getNodeById),u=sr(),f=n.competencyScoped?Nu(a[0],i):void 0,m=p.useRef(),g=u&&Array.isArray(s[u.code])?s[u.code]:jk,b=c?d(c):void 0,h=n.competencyScoped&&!!(b!=null&&b.isFolder)&&!!b.parent&&!lt(b),v=Bk(n.competencyScoped,f,h,o,g),y=p.useCallback(async(A="",x="all",F={},P=!0,N=!1)=>{var M,B,U,ee,Q;e.setLoading(!0);try{if(v){e.setContent([],0);return}let te;if(n.competencyScoped){const ie=Mk(o,g,u==null?void 0:u.code,f);te={status:["Live"],...ie}}else te={status:["Live"],primaryCategory:x&&x!=="all"?[x]:r},(M=F==null?void 0:F.board)!=null&&M.length&&(te.board=F.board),(B=F==null?void 0:F.medium)!=null&&B.length&&(te.medium=F.medium),(U=F==null?void 0:F.gradeLevel)!=null&&U.length&&(te.gradeLevel=F.gradeLevel),(ee=F==null?void 0:F.subject)!=null&&ee.length&&(te.subject=F.subject),(Q=F==null?void 0:F.primaryCategory)!=null&&Q.length&&(te.primaryCategory=F.primaryCategory);const ue=P?0:e.offset,{content:fe,count:pe}=await tk({filters:te,query:A,limit:A?50:qk,offset:ue,channel:t||void 0,sortBy:N?{name:"asc"}:{lastUpdatedOn:"desc"},fields:$k(n.competencyScoped,u==null?void 0:u.code)});P?e.setContent(fe,pe):e.appendContent(fe,pe)}catch(te){console.error("[useLibrary] load error:",te)}finally{e.setLoading(!1)}},[r,t,n,o,g,u,f,v]);p.useEffect(()=>{clearTimeout(m.current),e.setSearch("")},[f]),p.useEffect(()=>{y()},[t]),p.useEffect(()=>{n.competencyScoped&&y()},[n.competencyScoped,o,g.join("|"),f,c]);const C=p.useCallback(A=>{e.setSearch(A),clearTimeout(m.current),m.current=setTimeout(()=>y(A,e.activeFilter,e.advancedFilters,!0,e.sortAZ),300)},[e.activeFilter,e.advancedFilters,e.sortAZ,y]),S=p.useCallback(A=>{e.setFilter(A),y(e.searchQuery,A,e.advancedFilters,!0,e.sortAZ)},[e.searchQuery,e.advancedFilters,e.sortAZ,y]),w=p.useCallback(A=>{e.setAdvancedFilters(A),y(e.searchQuery,e.activeFilter,A,!0,e.sortAZ)},[e.searchQuery,e.activeFilter,e.sortAZ,y]),T=p.useCallback(()=>{const A=!e.sortAZ;e.setSortAZ(A),y(e.searchQuery,e.activeFilter,e.advancedFilters,!0,A)},[e.sortAZ,e.searchQuery,e.activeFilter,e.advancedFilters,y]),E=p.useCallback(()=>{e.isLoading||y(e.searchQuery,e.activeFilter,e.advancedFilters,!1,e.sortAZ)},[e.isLoading,e.searchQuery,e.activeFilter,e.advancedFilters,e.sortAZ,y]),L=e.allContent.length<e.totalCount;return{content:e.filteredContent,isLoading:e.isLoading,totalCount:e.totalCount,activeFilter:e.activeFilter,advancedFilters:e.advancedFilters,searchQuery:e.searchQuery,sortAZ:e.sortAZ,hasMore:L,search:C,setFilter:S,applyAdvancedFilters:w,toggleSort:T,loadMore:E,refetch:()=>y(e.searchQuery,e.activeFilter,e.advancedFilters,!0,e.sortAZ),activeAssessmentSlot:o,emptyReason:v}}function Hp(){var i;const e=oe(),t=K(c=>c.editorProfile.competencyScoped),r=hr(c=>c.activeAssessmentSlot),n=re(c=>c.selectedNodeId),o=re(c=>c.treeData),s=re(c=>c.getNodeById),a=(i=o[0])==null?void 0:i.id;if(!t)return null;if(r==="pre")return e.learningPath.libraryAddPriorAssessmentCourse;if(r==="post")return e.learningPath.libraryAddOutcomeAssessmentCourse;if(n&&n!==a){const c=s(n);if(c!=null&&c.isFolder)return e.learningPath.libraryAddToLevel.replace("{level}",c.name??"")}return e.learningPath.libraryOpenLevelToAdd}const Xt={card:"_card_1cmpg_1",addBtn:"_addBtn_1cmpg_17",dragging:"_dragging_1cmpg_24",ctIcon:"_ctIcon_1cmpg_29",info:"_info_1cmpg_33",name:"_name_1cmpg_41",meta:"_meta_1cmpg_50",skillTags:"_skillTags_1cmpg_58",skillTag:"_skillTag_1cmpg_58",addBtnMuted:"_addBtnMuted_1cmpg_93",added:"_added_1cmpg_102",addedBadge:"_addedBadge_1cmpg_111"},zk={video:Us,pdf:Ao,h5p:Fs,scorm:Bs,audio:$s,quiz:xs,course:Nr,default:xr},Vk=({item:e,onAdd:t,onPreview:r,isDraggable:n,isAdded:o})=>{var S,w;const s=oe(),a=Vo(e),i=zk[a.key]??xr,c=_l(),d=iE(),u=c&&!o&&d,f=K(T=>T.editorProfile.competencyScoped),m=sr(),g=f&&m?(()=>{const T=e[m.code];return Array.isArray(T)?T:T?[String(T)]:[]})():[],{attributes:b,listeners:h,setNodeRef:v,isDragging:y}=ud({id:e.identifier,disabled:!n||!c||!d,data:{type:"library-item",item:e}}),C=()=>{r&&r(e)};return l.jsxs("div",{ref:v,className:[Xt.card,y?Xt.dragging:"",o?Xt.added:""].join(" "),"aria-label":e.name,...n?{...b,...h}:{},role:"listitem",onClick:C,children:[l.jsx("span",{className:[`sbx-ct-sq--${a.key}`,Xt.ctIcon].join(" "),"aria-hidden":"true",children:l.jsx(i,{size:14})}),l.jsxs("div",{className:Xt.info,children:[l.jsx("span",{className:Xt.name,title:e.name,children:e.name}),l.jsxs("span",{className:Xt.meta,children:[((S=e.organisation)==null?void 0:S[0])??e.channel??"",(w=e.organisation)!=null&&w[0]&&e.primaryCategory?" · ":"",e.primaryCategory??""]}),g.length>0&&l.jsx("span",{className:Xt.skillTags,children:g.slice(0,3).map(T=>l.jsx("span",{className:Xt.skillTag,children:T},T))})]}),o&&l.jsx("span",{className:Xt.addedBadge,"aria-label":s.libraryCard.alreadyAddedAriaLabel,title:s.libraryCard.alreadyAddedTitle,children:l.jsx(Yr,{size:12})}),!o&&n&&l.jsx("button",{type:"button",className:[Xt.addBtn,!u&&c?Xt.addBtnMuted:""].join(" "),onClick:T=>{T.stopPropagation(),t(e)},disabled:!c,"aria-disabled":!u,"aria-label":s.libraryCard.addItemAriaLabel.replace("{name}",e.name),title:c?d?s.libraryCard.addToUnitTitle:s.libraryCard.selectUnitToAddTitle:s.libraryCard.draftOnlyTitle,children:l.jsx(Xr,{size:14})})]})},Qp={chips:"_chips_xhhaq_1",chip:"_chip_xhhaq_1"},Hk=({filters:e,active:t,onChange:r})=>{const n=oe();return l.jsx("div",{className:Qp.chips,role:"group","aria-label":n.filterChips.contentTypeFiltersAriaLabel,children:e.map(o=>l.jsx("button",{type:"button",role:"radio","aria-checked":t===o.value,className:["sbx-chip",t===o.value?"filled":"outline",Qp.chip].join(" "),onClick:()=>r(o.value),children:o.label},o.value))})},ht={panel:"_panel_uame3_1",header:"_header_uame3_10",headerTitle:"_headerTitle_uame3_19",closeBtn:"_closeBtn_uame3_25",body:"_body_uame3_43",section:"_section_uame3_59",sectionLabel:"_sectionLabel_uame3_65",chips:"_chips_uame3_73",chip:"_chip_uame3_73",active:"_active_uame3_96",footer:"_footer_uame3_102",resetBtn:"_resetBtn_uame3_112",applyBtn:"_applyBtn_uame3_129"},Qk=e=>[{key:"board",label:e.libraryFilterPanel.boardLabel},{key:"medium",label:e.libraryFilterPanel.mediumLabel},{key:"gradeLevel",label:e.libraryFilterPanel.classLabel},{key:"subject",label:e.libraryFilterPanel.subjectLabel}],Wk=new Set(["board","medium","gradeLevel","subject","topic"]),Rk=({local:e,toggle:t})=>{const r=oe(),n=Vp();return n.length?l.jsxs("div",{className:ht.section,children:[l.jsx("div",{className:ht.sectionLabel,children:r.libraryFilterPanel.primaryCategoryLabel}),l.jsx("div",{className:ht.chips,children:n.map(o=>l.jsx("button",{type:"button",className:[ht.chip,(e.primaryCategory??[]).includes(o)?ht.active:""].join(" "),onClick:()=>t("primaryCategory",o),children:o},o))})]}):null},Gk=({isOpen:e,filters:t,onApply:r,onClose:n})=>{var v,y;const o=oe(),s=K(C=>C.editorConfig),a=K(C=>C.searchFormConfig),i=K(C=>C.contentFramework),c=K(C=>C.contentTargetFWIds),{organisationFramework:d}=ra(i??((v=s==null?void 0:s.context)==null?void 0:v.framework),c??((y=s==null?void 0:s.context)==null?void 0:y.targetFWIds)),[u,f]=p.useState(t),m=a!=null&&a.length?a.filter(C=>Wk.has(C.code)).map(C=>({key:C.code,label:C.label||C.code})):Qk(o);p.useEffect(()=>{f(t)},[t]);const g=(C,S)=>{f(w=>{const T=w[C]??[],E=T.includes(S)?T.filter(L=>L!==S):[...T,S];return{...w,[C]:E}})},b=(d==null?void 0:d.categories)??[],h=C=>{var S;return((S=b.find(w=>w.code===C))==null?void 0:S.terms)??[]};return e?l.jsxs("div",{className:ht.panel,role:"dialog","aria-label":o.libraryFilterPanel.filterLibraryAriaLabel,"aria-modal":"true",children:[l.jsxs("div",{className:ht.header,children:[l.jsx("span",{className:ht.headerTitle,children:o.libraryFilterPanel.filtersHeaderTitle}),l.jsx("button",{type:"button",className:ht.closeBtn,onClick:n,"aria-label":o.libraryFilterPanel.closeFiltersAriaLabel,children:l.jsx(fr,{size:16})})]}),l.jsxs("div",{className:ht.body,children:[m.map(({key:C,label:S})=>{const w=h(C);return w.length?l.jsxs("div",{className:ht.section,children:[l.jsx("div",{className:ht.sectionLabel,children:S}),l.jsx("div",{className:ht.chips,children:w.slice(0,20).map(T=>l.jsx("button",{type:"button",className:[ht.chip,(u[C]??[]).includes(T.name)?ht.active:""].join(" "),onClick:()=>g(C,T.name),children:T.name},T.identifier))})]},C):null}),l.jsx(Rk,{local:u,toggle:g})]}),l.jsxs("div",{className:ht.footer,children:[l.jsx("button",{type:"button",className:ht.resetBtn,onClick:()=>f({}),children:o.libraryFilterPanel.resetButton}),l.jsx("button",{type:"button",className:ht.applyBtn,onClick:()=>{r(u),n()},children:o.libraryFilterPanel.applyButton})]})]}):null},Ct={header:"_header_1tvk1_10",headerCourse:"_headerCourse_1tvk1_20",courseIcon:"_courseIcon_1tvk1_25",titleGroup:"_titleGroup_1tvk1_37",courseMeta:"_courseMeta_1tvk1_45",title:"_title_1tvk1_37",headerActions:"_headerActions_1tvk1_67",iconBtn:"_iconBtn_1tvk1_74",playerArea:"_playerArea_1tvk1_92",footer:"_footer_1tvk1_100",footerCourse:"_footerCourse_1tvk1_109",addBtn:"_addBtn_1tvk1_115",addBtnCourse:"_addBtnCourse_1tvk1_134",modalOverlay:"_modalOverlay_1tvk1_159",modalOverlayCourse:"_modalOverlayCourse_1tvk1_174",modalPanel:"_modalPanel_1tvk1_178",modalPanelCourse:"_modalPanelCourse_1tvk1_190"},Kk="application/vnd.sunbird.questionset",Yk=({content:e,editorMode:t,onAdd:r,onClose:n})=>{var f;const o=oe(),s=t==="edit",a=K(m=>m.editorProfile.competencyScoped),i=Hp();if(!e)return null;const c=a&&e.primaryCategory==="Course",d=[((f=e.organisation)==null?void 0:f[0])??e.channel??"",e.primaryCategory??""].filter(Boolean).join(" • "),u={id:e.identifier,identifier:e.identifier,name:e.name??"",mimeType:e.mimeType,primaryCategory:e.primaryCategory,contentType:e.contentType,appIcon:e.appIcon,status:e.status,isFolder:!1,children:[],metadata:e};return Ue.createPortal(l.jsx("div",{className:[Ct.modalOverlay,c?Ct.modalOverlayCourse:""].filter(Boolean).join(" "),role:"dialog","aria-modal":"true","aria-label":o.libraryPreviewPanel.contentPreviewAriaLabel,onClick:n,children:l.jsxs("div",{className:[Ct.modalPanel,c?Ct.modalPanelCourse:""].filter(Boolean).join(" "),onClick:m=>m.stopPropagation(),children:[l.jsxs("div",{className:[Ct.header,c?Ct.headerCourse:""].filter(Boolean).join(" "),children:[c&&l.jsx("span",{className:Ct.courseIcon,children:l.jsx(Nr,{size:20})}),l.jsxs("div",{className:Ct.titleGroup,children:[l.jsx("span",{className:Ct.title,title:e.name,children:e.name}),c&&d&&l.jsx("span",{className:Ct.courseMeta,children:d})]}),l.jsx("div",{className:Ct.headerActions,children:l.jsx("button",{type:"button",className:Ct.iconBtn,onClick:n,"aria-label":o.libraryPreviewPanel.closePreviewAriaLabel,children:l.jsx(fr,{size:16})})})]}),l.jsx("div",{className:Ct.playerArea,children:c?l.jsx(Bp,{courseId:e.identifier}):l.jsx(Ql,{node:u,editorMode:"read",type:e.mimeType===Kk?"quml":"content"})}),s&&l.jsx("div",{className:[Ct.footer,c?Ct.footerCourse:""].filter(Boolean).join(" "),children:c?l.jsxs("button",{type:"button",className:Ct.addBtnCourse,onClick:()=>r(e),children:[l.jsx(Xr,{size:15})," ",i??o.libraryPreviewPanel.addToUnitButton]}):l.jsx("button",{type:"button",className:Ct.addBtn,onClick:()=>r(e),children:o.libraryPreviewPanel.addToUnitButton})})]})}),document.body)},Re={dock:"_dock_2k0x7_1",header:"_header_2k0x7_8",libraryTargetLabel:"_libraryTargetLabel_2k0x7_18",headerLeft:"_headerLeft_2k0x7_28",headerTitle:"_headerTitle_2k0x7_36",count:"_count_2k0x7_42",searchRow:"_searchRow_2k0x7_51",searchWrap:"_searchWrap_2k0x7_59",searchIcon:"_searchIcon_2k0x7_65",searchInput:"_searchInput_2k0x7_74",filterToggleBtn:"_filterToggleBtn_2k0x7_92",filterToggleBtnActive:"_filterToggleBtnActive_2k0x7_111",filterBadge:"_filterBadge_2k0x7_117",filters:"_filters_2k0x7_136",mainArea:"_mainArea_2k0x7_146",sidePanelOverlay:"_sidePanelOverlay_2k0x7_155",cardList:"_cardList_2k0x7_164",skeleton:"_skeleton_2k0x7_180",skeletonIcon:"_skeletonIcon_2k0x7_190",skeletonText:"_skeletonText_2k0x7_198",skeletonLine:"_skeletonLine_2k0x7_205",skeletonLineSm:"_skeletonLineSm_2k0x7_212",loadMoreBtn:"_loadMoreBtn_2k0x7_227",emptyState:"_emptyState_2k0x7_252",collapseBtn:"_collapseBtn_2k0x7_272"},Zk=[{label:"Courses",value:"all"}];function Xk(e){const t=new Set,r=[...e];for(;r.length>0;){const n=r.shift();n.isFolder||t.add(n.identifier),n.children&&r.push(...n.children)}return t}const Jk=({editorMode:e,collapsed:t=!1,onToggleCollapse:r})=>{const n=oe(),{content:o,isLoading:s,totalCount:a,activeFilter:i,searchQuery:c,sortAZ:d,hasMore:u,search:f,setFilter:m,applyAdvancedFilters:g,toggleSort:b,loadMore:h,activeAssessmentSlot:v,emptyReason:y}=Uk(),{addResource:C,selectedNodeId:S,treeData:w,treeCache:T}=re(),E=hr($=>$.setActiveAssessmentSlot),L=K($=>$.editorProfile.competencyScoped),A=e==="edit",x=Hp(),[F,P]=p.useState(!1),[N,M]=p.useState({}),[B,U]=p.useState(null),[ee,Q]=p.useState(null),te=p.useMemo(()=>Xk(w),[w]),ue=p.useCallback(async($,q)=>{var he,be;const Z=(he=w[0])==null?void 0:he.id;if(!(!Z||ee)){if(xo(((be=w[0])==null?void 0:be.children)??[],q)){Se.error(q==="pre"?n.learningPath.priorSlotFilledToast:n.learningPath.outcomeSlotFilledToast);return}Q($.identifier);try{const{qualifies:ge,meta:le}=await Lu($.identifier);if(!ge){Se.error(n.learningPath.notAssessmentCourseToast.replace("{name}",$.name));return}const ve={...$,...le};if(C(ve,Z,{isAssessmentCourse:!0,slot:q})===!1){Se.error(n.learningPath.bothSlotsFilledToast);return}Se.success(n.libraryDock.itemAddedToast.replace("{name}",$.name)),E(null)}catch(ge){console.error("[LibraryDock] assessment-course check failed:",ge),Se.error(n.learningPath.assessmentCheckFailedToast)}finally{Q(null)}}},[w,C,E,ee,n]),fe=p.useCallback($=>{var be,ge,le;if(L&&!xu(w[0],T)){Se.error(n.learningPath.selectCurriculumFirstToast);return}if(v){ue($,v);return}if(!S){Se.error(L?n.learningPath.selectLevelFirstToast:n.libraryDock.selectUnitFirstToast);return}const q=(be=w[0])==null?void 0:be.id,Z=re.getState().getNodeById(S);if(L){const ve=((ge=w[0])==null?void 0:ge.children)??[],Ae=Z!=null&&Z.isFolder?Z:Z!=null&&Z.parent?re.getState().getNodeById(Z.parent):void 0;if(Ae&&Ui(ve,Ae)){const Y=(le=ve[0])==null?void 0:le.id;Se.error(Ae.id===Y?n.learningPath.priorSlotFilledToast:n.learningPath.outcomeSlotFilledToast);return}}if(S===q||!(Z!=null&&Z.isFolder)){Se(L?n.learningPath.selectLevelFromOutlineToast:n.libraryDock.selectUnitFromOutlineToast,{icon:l.jsx(Dn,{size:16}),duration:4e3});return}if(C($,S)===!1){Se.error((L?n.learningPath.itemAlreadyInPathToast:n.libraryDock.itemAlreadyAddedToast).replace("{name}",$.name));return}Se.success(n.libraryDock.itemAddedToast.replace("{name}",$.name))},[v,ue,S,C,w,T,n,L]),pe=p.useCallback($=>{M($),g($)},[g]),ie=p.useCallback($=>{U($)},[]),Te=p.useCallback($=>{fe($),U(null)},[fe]),ye=p.useMemo(()=>Object.values(N).reduce(($,q)=>$+((q==null?void 0:q.length)??0),0),[N]);return l.jsxs("div",{className:Re.dock,children:[l.jsxs("div",{className:Re.header,children:[l.jsxs("div",{className:Re.headerLeft,children:[l.jsx("button",{type:"button",className:Re.collapseBtn,onClick:r,"aria-label":n.libraryDock.collapseLibraryPanelAriaLabel,title:n.libraryDock.collapseLibraryTitle,children:l.jsx(Py,{size:15})}),l.jsx(Iy,{size:16}),l.jsx("span",{className:Re.headerTitle,children:n.libraryDock.headerTitle}),a>0&&l.jsx("span",{className:Re.count,children:a})]}),x&&l.jsx("span",{className:Re.libraryTargetLabel,children:x})]}),l.jsxs("div",{className:Re.searchRow,children:[l.jsxs("div",{className:Re.searchWrap,children:[l.jsx(qs,{size:14,className:Re.searchIcon}),l.jsx("input",{type:"search",className:Re.searchInput,placeholder:n.libraryDock.searchPlaceholder,value:c,onChange:$=>f($.target.value),"aria-label":n.libraryDock.searchAriaLabel})]}),l.jsx("button",{type:"button",className:[Re.filterToggleBtn,d?Re.filterToggleBtnActive:""].join(" "),onClick:b,"aria-label":d?n.libraryDock.sortAZAriaLabel:n.libraryDock.sortRecentAriaLabel,title:d?n.libraryDock.sortAZTitle:n.libraryDock.sortRecentTitle,children:d?l.jsx(vy,{size:15}):l.jsx(wy,{size:15})}),!L&&l.jsxs("button",{type:"button",className:[Re.filterToggleBtn,F?Re.filterToggleBtnActive:""].join(" "),onClick:()=>P($=>!$),"aria-label":n.libraryDock.toggleAdvancedFiltersAriaLabel,"aria-pressed":F,title:n.libraryDock.advancedFiltersTitle,children:[l.jsx(jy,{size:15}),ye>0&&l.jsx("span",{className:Re.filterBadge,children:ye})]})]}),l.jsx("div",{className:Re.filters,children:l.jsx(Hk,{filters:L?Zk:lE,active:i,onChange:m})}),l.jsxs("div",{className:Re.mainArea,children:[l.jsx("div",{className:Re.cardList,role:"list","aria-label":n.libraryDock.libraryContentAriaLabel,children:s&&o.length===0?Array.from({length:4}).map(($,q)=>l.jsxs("div",{className:Re.skeleton,"aria-hidden":"true",children:[l.jsx("div",{className:Re.skeletonIcon}),l.jsxs("div",{className:Re.skeletonText,children:[l.jsx("div",{className:Re.skeletonLine}),l.jsx("div",{className:Re.skeletonLineSm})]})]},q)):o.length>0?l.jsxs(l.Fragment,{children:[o.map($=>l.jsx(Vk,{item:$,onAdd:fe,onPreview:ie,isDraggable:A,isAdded:te.has($.identifier)},$.identifier)),u&&l.jsx("button",{type:"button",className:Re.loadMoreBtn,onClick:h,disabled:s,"aria-label":n.libraryDock.loadMoreAriaLabel,children:s?n.libraryDock.loadingText:n.libraryDock.loadMoreText})]}):l.jsxs("div",{className:Re.emptyState,children:[l.jsx(qs,{size:24}),y==="noCurriculum"?l.jsxs(l.Fragment,{children:[l.jsx("p",{children:n.learningPath.noCurriculumEmptyTitle}),l.jsx("span",{children:n.learningPath.noCurriculumEmptyHint})]}):y==="noSkills"?l.jsxs(l.Fragment,{children:[l.jsx("p",{children:n.learningPath.noSkillsEmptyTitle}),l.jsx("span",{children:n.learningPath.noSkillsEmptyHint})]}):l.jsxs(l.Fragment,{children:[l.jsx("p",{children:n.libraryDock.noContentFound}),l.jsx("span",{children:n.libraryDock.tryDifferentSearch})]})]})}),F&&l.jsx("div",{className:Re.sidePanelOverlay,children:l.jsx(Gk,{isOpen:F,filters:N,onApply:pe,onClose:()=>P(!1)})}),B&&l.jsx(Yk,{content:B,editorMode:e,onAdd:Te,onClose:()=>U(null)})]})]})};function eI(e,t,r,n=Ci){const o={},s={},a=new Set(["id","isFolder","children","parent","isNew","breadcrumb","title","relationalMetadata","optional","metadata","isAssessmentCourse"]),i=new Set(["targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds","targetFWIds","targetTopicIds","topic","topicsIds"]),c=new Set(["audience","attributions","keywords","language","additionalCategories","medium","gradeLevel","subject","boardIds","mediumIds","gradeLevelIds","subjectIds","targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds","dialcodes"]),d=new Set(["copyrightYear","compatibilityLevel","version"]);function u(g,b=!1){const h={};for(const[v,y]of Object.entries(g))if(!a.has(v)&&!(b&&i.has(v)))if(c.has(v))Array.isArray(y)?h[v]=y:y!=null&&y!==""?h[v]=[y]:h[v]=[];else if(d.has(v)){const C=Number(y);isNaN(C)||(h[v]=C)}else h[v]=y;return h}function f(g){var h;const b={};for(const v of g.children??[]){if(v.isFolder)continue;const y=t[v.identifier];if(!y)continue;const{isNew:C,...S}=y;if(Object.keys(S).length===0)continue;const w=((h=v.metadata)==null?void 0:h.relationalMetadata)??{};b[v.identifier]={name:v.name,...w,...S}}return b}function m(g,b){var w,T;const h=g.identifier,v=t[h],y=h.startsWith("temp-")||!!(v!=null&&v.isNew),C=!g.isFolder&&!b;if(b||y||v&&!C){let E;if(y)E={mimeType:"application/vnd.ekstep.content-collection",code:h,contentType:((w=g.metadata)==null?void 0:w.contentType)??n.unitContentType,primaryCategory:((T=g.metadata)==null?void 0:T.primaryCategory)??n.unitPrimaryCategory,name:g.name,visibility:"Parent",channel:r,...u(g.metadata??{})};else if(b){const{isNew:L,...A}=v??{};E={...u(g.metadata??{},!0),...u(A,!1),name:g.name}}else{const{isNew:L,...A}=v??{};E={name:g.name,visibility:"Parent",...u(A,!0)}}o[h]={metadata:E,objectType:g.objectType||(g.isFolder?"Collection":"Content"),root:b,isNew:y}}const S=g.isFolder?f(g):{};s[h]={name:g.name,children:(g.children??[]).map(E=>E.identifier),...Object.keys(S).length>0?{relationalMetadata:S}:{},root:b},(g.children??[]).forEach(E=>m(E,!1))}return e.forEach((g,b)=>m(g,b===0)),{nodesModified:o,hierarchy:s}}function tI(){const[e,t]=p.useState(!1),r=re(u=>u.treeCache),n=re(u=>u.treeData),o=K(u=>u.isDirty),s=K(u=>u.lastSaved),{setIsDirty:a,setLastSaved:i}=K(),c=K(u=>u.editorConfig);return{save:p.useCallback(async()=>{if(!c||e)return;const u=c.context.contentId??c.context.identifier??"";if(!u)return;if(n.length===0){Se.error("Collection is empty. Please reload before saving.");return}const f=c.context.channel??"",m=c.context.userId??c.context.uid??"";t(!0);try{const g=K.getState().editorProfile,{nodesModified:b,hierarchy:h}=eI(n,r,f,g),{identifiers:v}=await cS(u,b,h,m);v&&Object.keys(v).length>0&&re.getState().replaceNodeIds(v);const y=new Date().toISOString();i(y),a(!1)}catch(g){console.error("[useSaveHierarchy] save failed:",g),Se.error("Failed to save. Please try again.")}finally{t(!1)}},[c,e,n,r,a,i]),isSaving:e,isDirty:o,lastSaved:s}}const rI={};function nI(e){return e==null||e===""||Array.isArray(e)&&e.length===0}function oI(e,t,r,n,o,s=rI){const a=[],i=(c,d)=>{var u;for(const f of c){const m=d&&!f.parent,g=m?r:f.isFolder?n:null;if(g&&g.length>0){const b={...f.metadata??{},...t[f.id]??{}},v=pp(g,b,s,m,o).filter(y=>y.required&&y.visible!==!1&&y.inputType!=="appIcon"&&nI(y.currentValue)).map(y=>y.label);v.length>0&&a.push({nodeId:f.id,nodeName:f.name||"Untitled",missing:v})}(u=f.children)!=null&&u.length&&i(f.children,!1)}};return i(e,!0),a}function sI(e){var S,w;const t=K(T=>T.editorConfig),r=K(T=>T.editorProfile),n=K(T=>T.setButtonLoader),o=K(T=>T.validateAllForms),s=K(T=>T.rootFormConfig),a=K(T=>T.unitFormConfig),i=re(T=>T.treeData),c=re(T=>T.treeCache),d=re(T=>T.selectNode),u=sr(),{scope:f}=Mo(),m=K(T=>T.contentFramework),g=K(T=>T.contentTargetFWIds),{organisationFramework:b,targetFrameworks:h}=ra(m??((S=t==null?void 0:t.context)==null?void 0:S.framework),g??((w=t==null?void 0:t.context)==null?void 0:w.targetFWIds)),v=p.useCallback(()=>{var x,F,P;const T={editorMode:"edit",objectType:(x=t==null?void 0:t.config)==null?void 0:x.objectType,userFullName:(P=(F=t==null?void 0:t.context)==null?void 0:F.user)==null?void 0:P.fullName},E=oI(i,c,s,a,T,{organisationFramework:b,targetFrameworks:h});if(E.length===0)return!0;const L=E[0];Se.error(`"${L.nodeName}": please fill required field${L.missing.length>1?"s":""} — ${L.missing.join(", ")}`);const{setFormStatus:A}=K.getState();return E.forEach(N=>A(N.nodeId,!1)),d(L.nodeId),!1},[i,c,s,a,t,d,b,h]),y=p.useCallback(()=>{if(r.key!=="learningPath")return!0;const T=zi(i[0],u==null?void 0:u.code,f,c);return T.length===0?!0:(Se.error(T[0].message),!1)},[r.key,i,c,u,f]);return{runAction:p.useCallback(async(T,E)=>{var x,F,P,N;const L=((x=t==null?void 0:t.context)==null?void 0:x.contentId)??((F=t==null?void 0:t.context)==null?void 0:F.identifier)??"";if(!L)return Se.error("No content identifier found."),!1;const A=((P=t==null?void 0:t.context)==null?void 0:P.userId)??((N=t==null?void 0:t.context)==null?void 0:N.uid)??"";try{switch(T){case"sendForReview":return v()?o(i)?y()?(n("saveCollection",!0),await e(),await fS(L),Se.success("Content sent for review"),!0):!1:(Se.error("Some units have missing required fields. Please fill them before sending for review."),!1):!1;case"reject":{n("rejectCollection",!0);const M=(E==null?void 0:E.comment)??"";return await hS(L,M),Se.success("Content rejected and sent back to the author"),!0}case"publish":return v()?o(i)?y()?(n("publishCollection",!0),await e(),await dS(L,A),Se.success("Content published successfully"),!0):!1:(Se.error("Some units have missing required fields. Please fill them before publishing."),!1):!1;default:return!1}}catch(M){console.error(`[useToolbarActions] ${T} failed`,M);const B=T==="sendForReview"?"send for review":T==="reject"?"reject":"publish";return Se.error(`Failed to ${B}. Please try again.`),!1}finally{n("saveCollection",!1),n("rejectCollection",!1),n("publishCollection",!1)}},[t,e,n,v,y,o,i]),checkRequiredFields:v}}function aI(){const e=oe(),t=K(c=>c.editorProfile.key==="learningPath"),r=re(c=>c.treeData),n=sr(),{scope:o,source:s}=Mo(),a=p.useRef(!1),i=p.useRef("");p.useEffect(()=>{if(!t||s!=="prior"||!n)return;const c=wS(r[0],n.code,o),d=c.map(u=>u.id).sort().join(",");a.current?c.length>0&&d!==i.current&&Se.error(e.learningPath.priorAssessmentNarrowedScopeToast.replace("{count}",String(c.length))):a.current=!0,i.current=d},[t,s,o.join("|"),n==null?void 0:n.code,r])}function iI(){const e=K(a=>a.editorProfile.key==="learningPath"),t=re(a=>a.treeData),r=re(a=>a.treeCache),n=re(a=>a.updateNode),o=sr(),s=o==null?void 0:o.code;p.useEffect(()=>{if(!e||!s)return;const a=t[0],i=SS(a,s,r);i!==null&&n(a.id,{[s]:i},[s])},[e,t,r,s,n])}const Bt={shell:"_shell_fu72l_1",workspace:"_workspace_fu72l_8",sidebarCollapsed:"_sidebarCollapsed_fu72l_16",dockCollapsed:"_dockCollapsed_fu72l_19",dock:"_dock_fu72l_19",outline:"_outline_fu72l_40",reopenTab:"_reopenTab_fu72l_45",outlineHidden:"_outlineHidden_fu72l_79",editor:"_editor_fu72l_86",editorLp:"_editorLp_fu72l_92",dockHidden:"_dockHidden_fu72l_105",dockReopenTab:"_dockReopenTab_fu72l_112",dragChip:"_dragChip_fu72l_137",dragChipLabel:"_dragChipLabel_fu72l_152"},lI=({editorMode:e,onToolbarEvent:t,onContentAdded:r,onHierarchySaved:n})=>{const o=oe(),[s,a]=p.useState(null),[i,c]=p.useState(!1),[d,u]=p.useState(!1),[f,m]=p.useState(!1);aI(),iI();const{addResource:g,treeData:b,treeCache:h}=re(),v=K(Q=>Q.setFormStatus),y=K(Q=>Q.editorProfile.key==="learningPath"),[C,S]=p.useState(!0),w=re(Q=>Q.selectedNodeId),{save:T,isSaving:E,isDirty:L,lastSaved:A}=tI(),{runAction:x,checkRequiredFields:F}=sI(T);p.useEffect(()=>{if(!L)return;const Q=te=>{te.preventDefault(),te.returnValue=""};return window.addEventListener("beforeunload",Q),()=>window.removeEventListener("beforeunload",Q)},[L]);const P=Nc(ei(Ds,{activationConstraint:{distance:8}})),N=p.useCallback(Q=>{var ue;const te=(ue=Q.active.data.current)==null?void 0:ue.item;te&&a(te)},[]),M=p.useCallback(Q=>{var $,q,Z,he,be;a(null);const te=($=Q.active.data.current)==null?void 0:$.item;if(!te)return;if(y&&!xu(b[0],h)){Se.error(o.learningPath.selectCurriculumFirstToast);return}const ue=Q.over,fe=(ue==null?void 0:ue.id)??w??void 0,pe=y?o.learningPath.dropOntoLevelError:o.splitBuilderShell.dropOntoUnitError;if(!fe){Se.error(pe);return}const ie=(q=b[0])==null?void 0:q.id;if(fe===ie){Se.error(y?o.learningPath.dropOntoPathError:o.splitBuilderShell.dropOntoCourseError);return}const Te=re.getState().getNodeById(fe);if(!(Te!=null&&Te.isFolder)){Se.error(pe);return}if(y&&lt(Te)){const ge=(be=(he=(Z=b[0])==null?void 0:Z.children)==null?void 0:he[0])==null?void 0:be.id;Se.error(Te.id===ge?o.learningPath.priorSlotFilledToast:o.learningPath.outcomeSlotFilledToast);return}if(!g(te,fe)){Se.error((y?o.learningPath.itemAlreadyInPathToast:o.splitBuilderShell.alreadyInCollectionError).replace("{name}",te.name));return}r==null||r(te,fe),Se.success((y?o.learningPath.addedToLevelSuccess:o.splitBuilderShell.addedToUnitSuccess).replace("{name}",te.name))},[w,g,b,h,r,o,y]),B=p.useCallback(async Q=>{if(Q.action==="onFormStatusChange"){const{isValid:te,nodeId:ue}=Q.data??{},fe=te!==!1;S(fe),ue&&v(ue,fe);return}if(Q.action==="back"&&L&&e==="edit"){m(!0);return}if(Q.action==="saveCollection"){if(!C){Se.error(o.splitBuilderShell.fillRequiredMetadataError);return}if(!F())return;await T(),n==null||n(b),t==null||t(Q);return}if(Q.action==="sendForReview"||Q.action==="reject"||Q.action==="publish"){await x(Q.action,Q.data)&&(t==null||t(Q));return}t==null||t(Q)},[T,x,F,t,n,b,L,C,e,o]),U=p.useCallback(async()=>{if(!F()){m(!1);return}await T(),m(!1),n==null||n(b),t==null||t({action:"back"})},[T,F,n,t,b]),ee=p.useCallback(()=>{m(!1),t==null||t({action:"back"})},[t]);return l.jsxs(cd,{sensors:P,onDragStart:N,onDragEnd:M,children:[l.jsxs("div",{className:Bt.shell,children:[l.jsx(RS,{editorMode:e,isSaving:E,isDirty:L,lastSaved:A,isFormValid:C,onToolbarEvent:B}),l.jsxs("div",{className:[Bt.workspace,i?Bt.sidebarCollapsed:"",d?Bt.dockCollapsed:""].filter(Boolean).join(" "),children:[l.jsx("aside",{className:[Bt.outline,i?Bt.outlineHidden:""].join(" "),"aria-label":o.splitBuilderShell.outlineAriaLabel,"aria-hidden":i,children:l.jsx(yE,{editorMode:e,collapsed:i,onToggleCollapse:()=>c(Q=>!Q)})}),i&&l.jsx("button",{className:Bt.reopenTab,onClick:()=>c(!1),title:o.splitBuilderShell.showOutlineTitle,type:"button",children:"›"}),l.jsx("main",{className:[Bt.editor,y?Bt.editorLp:""].filter(Boolean).join(" "),role:"main","aria-label":o.splitBuilderShell.editorAriaLabel,children:l.jsx(Fk,{editorMode:e,onToolbarEvent:B})}),l.jsx("aside",{className:[Bt.dock,d?Bt.dockHidden:""].filter(Boolean).join(" "),"aria-label":o.splitBuilderShell.libraryAriaLabel,"aria-hidden":d,children:l.jsx(Jk,{editorMode:e,collapsed:d,onToggleCollapse:()=>u(Q=>!Q)})}),d&&l.jsx("button",{className:Bt.dockReopenTab,onClick:()=>u(!1),title:o.splitBuilderShell.showLibraryTitle,type:"button",children:"‹"})]})]}),l.jsx(fy,{dropAnimation:null,children:s?l.jsx("div",{className:Bt.dragChip,children:l.jsx("span",{className:Bt.dragChipLabel,children:s.name})}):null}),f&&l.jsx(GS,{onSave:U,onDiscard:ee,onCancel:()=>m(!1),isSaving:E})]})},cI="v1";function dI(e){const t=e.validations,r=t==null?void 0:t.find(o=>o.type==="maxlength"||o.type==="maxLength");if(!r)return e.maxLength;const n=Number(r.value);return Number.isFinite(n)?n:void 0}function Wp(e,t){var r;return{code:e.code??"",label:e.label??e.name??e.code??"",name:e.name,inputType:e.inputType,dataType:e.dataType,required:e.required===!0||Array.isArray(e.validations)&&e.validations.some(n=>n.type==="required")||String(((r=e.renderingHints)==null?void 0:r.class)??"").includes("required"),editable:e.editable!==!1,visible:e.visible!==!1,placeholder:e.placeholder,maxLength:dI(e),depends:e.depends,sourceCategory:e.sourceCategory,range:e.range,enum:e.enum,default:e.default,defaultValue:e.defaultValue,index:e.index,section:t,output:e.output}}function Br(e){const t=e==null?void 0:e.properties;if(!Array.isArray(t))return[];const r=[];for(const n of t)if(Array.isArray(n.fields)){const o=n.name??void 0,s=n.fields.filter(a=>!!a.code).sort((a,i)=>(a.index??0)-(i.index??0));for(const a of s)r.push(Wp(a,o))}else n.code&&r.push(Wp(n));return r}function uI(e){const t=e==null?void 0:e.properties;if(!t)return{};const r={};for(const[n,o]of Object.entries(t))o&&"default"in o&&(r[n]=o.default);return r}async function fI(e,t,r="Collection",n=cI){var d,u;const s=(u=(d=(await Me.post(`/action/object/category/definition/${n}/read?fields=objectMetadata,forms,name,label`,{request:{objectCategoryDefinition:{objectType:r,name:e,...t?{channel:t}:{}}}})).data)==null?void 0:d.result)==null?void 0:u.objectCategoryDefinition,a=(s==null?void 0:s.forms)??{},i=(s==null?void 0:s.objectMetadata)??{},c=i.config??{};return{rootForm:Br(a.create),unitForm:Br(a.unitMetadata),childForm:Br(a.childMetadata),searchForm:Br(a.search??a.searchConfig),relationalForm:Br(a.relationalMetadata),publishChecklist:Br(a.publishchecklist),reviewChecklist:Br(a.review),rfcChecklist:Br(a.requestforchangeschecklist),schemaDefaults:uI(i.schema),frameworkMetadata:c.frameworkMetadata??{},sourcingSettings:c.sourcingSettings??{}}}function Rp(e,t,r){return{framework:e.framework??t??r.framework??null,targetFWIds:e.targetFWIds??r.targetFWIds??null}}function hI({config:e,onError:t}){const[r,n]=p.useState(!0),[o,s]=p.useState(null),[a,i]=p.useState(!1),{setEditorConfig:c,setEditorMode:d,setCategoryDefinition:u,setContentFramework:f,setEditorProfile:m}=K(),{setTreeData:g,selectNode:b}=re();return p.useEffect(()=>{let h=!1;async function v(){var y,C,S;try{n(!0),s(null),e.apiBaseUrl&&_u(e.apiBaseUrl),c(e),d(e.config.mode),m(ab(e));const w=e.context.contentId??e.context.identifier??"",T=e.context.channel??"";let E;if(T)try{E=(y=await fp(T))==null?void 0:y.defaultFramework}catch{}let L=!1;if(w){const A=e.config.objectType==="QuestionSet";let{rootNode:x}=A?await lS(w):await Au(w);if(x&&e.config.primaryCategory==="Learning Path"&&(x=await mS(x)),!h&&(g(x?[x]:[]),x)){b(x.id);const{framework:B,targetFWIds:U}=Rp(x.metadata??{},E,e.context);f(B,U),L=!0}const F=e.config.primaryCategory??"Course",P=e.context.channel??"",N=e.config.categoryDefinitionApiVersion??"v1";try{const M=await fI(F,P,e.config.objectType??"Collection",N);if(!h){u(M);const B=((C=M.sourcingSettings)==null?void 0:C.collection)??{},U={};B.maxDepth&&!e.config.maxDepth&&(U.maxDepth=B.maxDepth),B.children&&!e.config.children&&(U.children=B.children),B.hierarchy&&!((S=e.config.hierarchy)!=null&&S.level1)&&(U.hierarchy={...e.config.hierarchy??{},...B.hierarchy}),Object.keys(U).length>0&&c({...e,config:{...e.config,...U}})}}catch{}}if(!h&&!L){const{framework:A,targetFWIds:x}=Rp({},E,e.context);f(A,x)}h||i(!0)}catch(w){if(!h){const T=w instanceof Error?w:new Error(String(w));s(T),t==null||t(T)}}finally{h||n(!1)}}return v(),()=>{h=!0}},[e.context.contentId,e.context.identifier]),{isLoading:r,error:o,isReady:a}}function pI(){const e=Ti(t=>t.setLanguage);p.useEffect(()=>{e(localStorage.getItem(wi)||"en",{broadcast:!1});const t=n=>{n.key===wi&&n.newValue&&e(n.newValue,{broadcast:!1})},r=n=>{var s;const o=(s=n.detail)==null?void 0:s.lang;o&&e(o,{broadcast:!1})};return window.addEventListener("storage",t),window.addEventListener(_i,r),()=>{window.removeEventListener("storage",t),window.removeEventListener(_i,r)}},[e])}const es={root:"_root_1itrv_1",loadingState:"_loadingState_1itrv_10",loadingSpinner:"_loadingSpinner_1itrv_20",errorState:"_errorState_1itrv_34"},gI=new Bg({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});function mI({error:e,onRetry:t}){const r=oe();return l.jsxs("div",{className:es.errorState,children:[l.jsx("h3",{children:r.collectionEditor.errorBoundaryTitle}),l.jsx("p",{children:e.message}),l.jsx("button",{onClick:t,children:r.collectionEditor.retryButton})]})}class vI extends p.Component{constructor(t){super(t),this.state={error:null}}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t){var r,n;(n=(r=this.props).onError)==null||n.call(r,t)}render(){return this.state.error?l.jsx(mI,{error:this.state.error,onRetry:()=>this.setState({error:null})}):this.props.children}}function yI(e){pI();const t=oe(),{isLoading:r,error:n}=hI({config:e,onError:e.onError}),o=K(a=>a.editorMode),s=K(a=>a.editorProfile);return r?l.jsxs("div",{className:es.loadingState,children:[l.jsx("div",{className:es.loadingSpinner}),l.jsx("p",{children:t.collectionEditor.loadingMessage})]}):n?l.jsxs("div",{className:es.errorState,children:[l.jsx("h3",{children:t.collectionEditor.loadErrorTitle}),l.jsx("p",{children:n.message})]}):l.jsx("div",{className:["sb-split-builder",es.root,s.key==="learningPath"?"sbx-lp-profile":""].filter(Boolean).join(" "),children:l.jsx(lI,{editorMode:o,onToolbarEvent:e.onToolbarEvent,onContentAdded:e.onContentAdded,onHierarchySaved:e.onHierarchySaved})})}const Gp=e=>l.jsx(vI,{onError:e.onError,children:l.jsxs(jg,{client:gI,children:[l.jsx(yI,{...e}),l.jsx(qm,{position:"top-right",toastOptions:{duration:3e3,style:{fontFamily:"var(--sbx-font)"}}})]})}),Na=Symbol.for("r2wc.reactRender"),Kp=Symbol.for("r2wc.shouldRender"),xa=Symbol.for("r2wc.root");function bI(e=""){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function CI(e=""){return e.replace(/-([a-z0-9])/g,function(t){return t[1].toUpperCase()})}var Yp={expando:function(e,t,r){Object.defineProperty(e,t,{enumerable:!0,get:function(){return r},set:function(n){r=n,this[Na]()}}),e[Na]()}};function SI(e,t,r,n={}){var o={isConnected:"isConnected"in HTMLElement.prototype},s=!1,a=function(){var d=Reflect.construct(HTMLElement,arguments,this.constructor);return typeof n.shadow=="string"?d.attachShadow({mode:n.shadow}):n.shadow&&(console.warn('Specifying the "shadow" option as a boolean is deprecated and will be removed in a future version.'),d.attachShadow({mode:"open"})),d},i=Object.create(HTMLElement.prototype);i.constructor=a;var c=new Proxy(i,{has:function(d,u){return u in e.propTypes||u in i},set:function(d,u,f,m){return s&&(o[u]=!0),typeof u=="symbol"||o[u]||u in d?(e.propTypes&&u in e.propTypes&&Yp.expando(m,u,f),Reflect.set(d,u,f,m)):(Yp.expando(m,u,f),!0)},getOwnPropertyDescriptor:function(d,u){var f=Reflect.getOwnPropertyDescriptor(d,u);if(f)return f;if(u in e.propTypes)return{configurable:!0,enumerable:!0,writable:!0,value:void 0}}});return a.prototype=c,i.connectedCallback=function(){this[Kp]=!0,this[Na]()},i.disconnectedCallback=function(){typeof r.createRoot=="function"?this[xa].unmount():r.unmountComponentAtNode(this)},i[Na]=function(){if(this[Kp]===!0){var d={};Object.keys(this).forEach(function(m){o[m]!==!1&&(d[m]=this[m])},this),s=!0;const u=n.shadow?this.shadowRoot:this,f=t.createElement(e,d);typeof r.createRoot=="function"?(this[xa]||(this[xa]=r.createRoot(u)),this[xa].render(f)):r.render(f,u),s=!1}},e.propTypes&&(a.observedAttributes=n.dashStyleAttributes?Object.keys(e.propTypes).map(function(d){return bI(d)}):Object.keys(e.propTypes),i.attributeChangedCallback=function(d,u,f){var m=n.dashStyleAttributes?CI(d):d;this[m]=f}),a}var Gn={},Zp;function wI(){if(Zp)return Gn;Zp=1;var e=Ue;if(process.env.NODE_ENV==="production")Gn.createRoot=e.createRoot,Gn.hydrateRoot=e.hydrateRoot;else{var t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Gn.createRoot=function(r,n){t.usingClientEntryPoint=!0;try{return e.createRoot(r,n)}finally{t.usingClientEntryPoint=!1}},Gn.hydrateRoot=function(r,n,o){t.usingClientEntryPoint=!0;try{return e.hydrateRoot(r,n,o)}finally{t.usingClientEntryPoint=!1}}}return Gn}var _I=wI();const TI=pi(_I);function EI(){if(document.getElementById("sb-ce-react-styles"))return;const e=document.createElement("style");e.id="sb-ce-react-styles",e.textContent="@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;600;700&display=swap');",document.head.insertBefore(e,document.head.firstChild)}function AI(e="sb-collection-editor"){if(EI(),typeof customElements>"u"||customElements.get(e))return;const t=SI(Gp,p,TI,{});customElements.define(e,t)}ke.CollectionEditor=Gp,ke.registerCollectionEditor=AI,ke.setApiBaseUrl=_u,ke.useEditorStore=K,ke.useLibraryStore=zp,ke.useTreeStore=re,Object.defineProperty(ke,Symbol.toStringTag,{value:"Module"})}));