@project-sunbird/collection-editor-react 1.0.13 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/collection-editor.umd.js +21 -21
- package/dist/index.cjs +87 -87
- package/dist/index.js +3538 -3526
- package/dist/types/editor.d.ts +1 -1
- package/dist/utils/lpStructure.d.ts +5 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var gm=Object.defineProperty;var sc=e=>{throw TypeError(e)};var vm=(e,t,r)=>t in e?gm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var gs=(e,t,r)=>vm(e,typeof t!="symbol"?t+"":t,r),Mi=(e,t,r)=>t.has(e)||sc("Cannot "+r);var k=(e,t,r)=>(Mi(e,t,"read from private field"),r?r.call(e):t.get(e)),be=(e,t,r)=>t.has(e)?sc("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),ee=(e,t,r,n)=>(Mi(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Le=(e,t,r)=>(Mi(e,t,"access private method"),r);var po=(e,t,r,n)=>({set _(s){ee(e,t,s,r)},get _(){return k(e,t,n)}});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react"),Tr=require("react-dom"),l=require("react/jsx-runtime");function ym(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 Me=ym(g);var Ks=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(){}},nn,Br,$n,$d,bm=($d=class extends Ks{constructor(){super();be(this,nn);be(this,Br);be(this,$n);ee(this,$n,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){k(this,Br)||this.setEventListener(k(this,$n))}onUnsubscribe(){var t;this.hasListeners()||((t=k(this,Br))==null||t.call(this),ee(this,Br,void 0))}setEventListener(t){var r;ee(this,$n,t),(r=k(this,Br))==null||r.call(this),ee(this,Br,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){k(this,nn)!==t&&(ee(this,nn,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof k(this,nn)=="boolean"?k(this,nn):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},nn=new WeakMap,Br=new WeakMap,$n=new WeakMap,$d),vl=new bm,Cm={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},mr,sn,Ud,Sm=(Ud=class{constructor(){be(this,mr,Cm);be(this,sn,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&k(this,sn)&&e!==k(this,mr)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:k(this,mr),provider:e}),ee(this,mr,e),process.env.NODE_ENV!=="production"&&ee(this,sn,!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&ee(this,sn,!0),k(this,mr).setTimeout(e,t)}clearTimeout(e){k(this,mr).clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&ee(this,sn,!0),k(this,mr).setInterval(e,t)}clearInterval(e){k(this,mr).clearInterval(e)}},mr=new WeakMap,sn=new WeakMap,Ud),en=new Sm;function xm(e){setTimeout(e,0)}var _m=typeof window>"u"||"Deno"in globalThis;function Rt(){}function wm(e,t){return typeof e=="function"?e(t):e}function Ca(e){return typeof e=="number"&&e>=0&&e!==1/0}function Zd(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Qr(e,t){return typeof e=="function"?e(t):e}function Ut(e,t){return typeof e=="function"?e(t):e}function oc(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:o,queryKey:i,stale:a}=e;if(i){if(n){if(t.queryHash!==yl(i,t.options))return!1}else if(!Os(t.queryKey,i))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||s&&s!==t.state.fetchStatus||o&&!o(t))}function ic(e,t){const{exact:r,status:n,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(Ns(t.options.mutationKey)!==Ns(o))return!1}else if(!Os(t.options.mutationKey,o))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function yl(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ns)(e)}function Ns(e){return JSON.stringify(e,(t,r)=>_a(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function Os(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Os(e[r],t[r])):!1}var Tm=Object.prototype.hasOwnProperty;function Sa(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=ac(e)&&ac(t);if(!n&&!(_a(e)&&_a(t)))return t;const o=(n?e:Object.keys(e)).length,i=n?t:Object.keys(t),a=i.length,c=n?new Array(a):{};let u=0;for(let d=0;d<a;d++){const f=n?d:i[d],p=e[f],m=t[f];if(p===m){c[f]=p,(n?d<o:Tm.call(e,f))&&u++;continue}if(p===null||m===null||typeof p!="object"||typeof m!="object"){c[f]=m;continue}const C=Sa(p,m,r+1);c[f]=C,C===p&&u++}return o===a&&u===o?e:c}function xa(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 ac(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function _a(e){if(!lc(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!lc(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function lc(e){return Object.prototype.toString.call(e)==="[object Object]"}function Em(e){return new Promise(t=>{en.setTimeout(t,e)})}function wa(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 Sa(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 Sa(e,t)}return t}function Am(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function km(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Ho=Symbol();function Xd(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Ho&&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===Ho?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Jd(e,t){return typeof e=="function"?e(...t):!!e}function Im(e,t,r){let n=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),n||(n=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)}),e}var Ps=(()=>{let e=()=>_m;return{isServer(){return e()},setIsServer(t){e=t}}})();function Ta(){let e,t;const r=new Promise((s,o)=>{e=s,t=o});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}var Lm=xm;function Dm(){let e=[],t=0,r=a=>{a()},n=a=>{a()},s=Lm;const o=a=>{t?e.push(a):s(()=>{r(a)})},i=()=>{const a=e;e=[],a.length&&s(()=>{n(()=>{a.forEach(c=>{r(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||i()}return c},batchCalls:a=>(...c)=>{o(()=>{a(...c)})},schedule:o,setNotifyFunction:a=>{r=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{s=a}}}var bt=Dm(),Un,qr,zn,zd,jm=(zd=class extends Ks{constructor(){super();be(this,Un,!0);be(this,qr);be(this,zn);ee(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(){k(this,qr)||this.setEventListener(k(this,zn))}onUnsubscribe(){var t;this.hasListeners()||((t=k(this,qr))==null||t.call(this),ee(this,qr,void 0))}setEventListener(t){var r;ee(this,zn,t),(r=k(this,qr))==null||r.call(this),ee(this,qr,t(this.setOnline.bind(this)))}setOnline(t){k(this,Un)!==t&&(ee(this,Un,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return k(this,Un)}},Un=new WeakMap,qr=new WeakMap,zn=new WeakMap,zd),Qo=new jm;function Nm(e){return Math.min(1e3*2**e,3e4)}function ef(e){return(e??"online")==="online"?Qo.isOnline():!0}var Ea=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function tf(e){let t=!1,r=0,n;const s=Ta(),o=()=>s.status!=="pending",i=h=>{var v;if(!o()){const y=new Ea(h);p(y),(v=e.onCancel)==null||v.call(e,y)}},a=()=>{t=!0},c=()=>{t=!1},u=()=>vl.isFocused()&&(e.networkMode==="always"||Qo.isOnline())&&e.canRun(),d=()=>ef(e.networkMode)&&e.canRun(),f=h=>{o()||(n==null||n(),s.resolve(h))},p=h=>{o()||(n==null||n(),s.reject(h))},m=()=>new Promise(h=>{var v;n=y=>{(o()||u())&&h(y)},(v=e.onPause)==null||v.call(e)}).then(()=>{var h;n=void 0,o()||(h=e.onContinue)==null||h.call(e)}),C=()=>{if(o())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 T;if(o())return;const b=e.retry??(Ps.isServer()?0:3),S=e.retryDelay??Nm,x=typeof S=="function"?S(r,y):S,w=b===!0||typeof b=="number"&&r<b||typeof b=="function"&&b(r,y);if(t||!w){p(y);return}r++,(T=e.onFail)==null||T.call(e,r,y),Em(x).then(()=>u()?void 0:m()).then(()=>{t?p(y):C()})})};return{promise:s,status:()=>s.status,cancel:i,continue:()=>(n==null||n(),s),cancelRetry:a,continueRetry:c,canStart:d,start:()=>(d()?C():m().then(C),s)}}var on,Vd,rf=(Vd=class{constructor(){be(this,on)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ca(this.gcTime)&&ee(this,on,en.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ps.isServer()?1/0:300*1e3))}clearGcTimeout(){k(this,on)!==void 0&&(en.clearTimeout(k(this,on)),ee(this,on,void 0))}},on=new WeakMap,Vd);function Om(e){return{onFetch:(t,r)=>{var d,f,p,m,C;const n=t.options,s=(p=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:p.direction,o=((m=t.state.data)==null?void 0:m.pages)||[],i=((C=t.state.data)==null?void 0:C.pageParams)||[];let a={pages:[],pageParams:[]},c=0;const u=async()=>{let h=!1;const v=S=>{Im(S,()=>t.signal,()=>h=!0)},y=Xd(t.options,t.fetchOptions),b=async(S,x,w)=>{if(h)return Promise.reject(t.signal.reason);if(x==null&&S.pages.length)return Promise.resolve(S);const L=(()=>{const j={client:t.client,queryKey:t.queryKey,pageParam:x,direction:w?"backward":"forward",meta:t.options.meta};return v(j),j})(),A=await y(L),{maxPages:O}=t.options,P=w?km:Am;return{pages:P(S.pages,A,O),pageParams:P(S.pageParams,x,O)}};if(s&&o.length){const S=s==="backward",x=S?Pm:cc,w={pages:o,pageParams:i},T=x(n,w);a=await b(w,T,S)}else{const S=e??o.length;do{const x=c===0?i[0]??n.initialPageParam:cc(n,a);if(c>0&&x==null)break;a=await b(a,x),c++}while(c<S)}return a};t.options.persister?t.fetchFn=()=>{var h,v;return(v=(h=t.options).persister)==null?void 0:v.call(h,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=u}}}function cc(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 Pm(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 Vn,an,Hn,Zt,ln,ft,Vs,cn,$t,nf,xr,Hd,Rm=(Hd=class extends rf{constructor(t){super();be(this,$t);be(this,Vn);be(this,an);be(this,Hn);be(this,Zt);be(this,ln);be(this,ft);be(this,Vs);be(this,cn);ee(this,cn,!1),ee(this,Vs,t.defaultOptions),this.setOptions(t.options),this.observers=[],ee(this,ln,t.client),ee(this,Zt,k(this,ln).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ee(this,an,dc(this.options)),this.state=t.state??k(this,an),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return k(this,Vn)}get promise(){var t;return(t=k(this,ft))==null?void 0:t.promise}setOptions(t){if(this.options={...k(this,Vs),...t},t!=null&&t._type&&ee(this,Vn,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=dc(this.options);r.data!==void 0&&(this.setState(uc(r.data,r.dataUpdatedAt)),ee(this,an,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&k(this,Zt).remove(this)}setData(t,r){const n=wa(this.state.data,t,this.options);return Le(this,$t,xr).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t){Le(this,$t,xr).call(this,{type:"setState",state:t})}cancel(t){var n,s;const r=(n=k(this,ft))==null?void 0:n.promise;return(s=k(this,ft))==null||s.cancel(t),r?r.then(Rt).catch(Rt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return k(this,an)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Ut(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ho||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Qr(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:!Zd(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=k(this,ft))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=k(this,ft))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),k(this,Zt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(k(this,ft)&&(k(this,cn)||Le(this,$t,nf).call(this)?k(this,ft).cancel({revert:!0}):k(this,ft).cancelRetry()),this.scheduleGc()),k(this,Zt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Le(this,$t,xr).call(this,{type:"invalidate"})}async fetch(t,r){var u,d,f,p,m,C,h,v,y,b,S;if(this.state.fetchStatus!=="idle"&&((u=k(this,ft))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(k(this,ft))return k(this,ft).continueRetry(),k(this,ft).promise}if(t&&this.setOptions(t),!this.options.queryFn){const x=this.observers.find(w=>w.options.queryFn);x&&this.setOptions(x.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,s=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(ee(this,cn,!0),n.signal)})},o=()=>{const x=Xd(this.options,r),T=(()=>{const L={client:k(this,ln),queryKey:this.queryKey,meta:this.meta};return s(L),L})();return ee(this,cn,!1),this.options.persister?this.options.persister(x,T,this):x(T)},a=(()=>{const x={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:k(this,ln),state:this.state,fetchFn:o};return s(x),x})(),c=k(this,Vn)==="infinite"?Om(this.options.pages):this.options.behavior;c==null||c.onFetch(a,this),ee(this,Hn,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=a.fetchOptions)==null?void 0:d.meta))&&Le(this,$t,xr).call(this,{type:"fetch",meta:(f=a.fetchOptions)==null?void 0:f.meta}),ee(this,ft,tf({initialPromise:r==null?void 0:r.initialPromise,fn:a.fetchFn,onCancel:x=>{x instanceof Ea&&x.revert&&this.setState({...k(this,Hn),fetchStatus:"idle"}),n.abort()},onFail:(x,w)=>{Le(this,$t,xr).call(this,{type:"failed",failureCount:x,error:w})},onPause:()=>{Le(this,$t,xr).call(this,{type:"pause"})},onContinue:()=>{Le(this,$t,xr).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const x=await k(this,ft).start();if(x===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(x),(m=(p=k(this,Zt).config).onSuccess)==null||m.call(p,x,this),(h=(C=k(this,Zt).config).onSettled)==null||h.call(C,x,this.state.error,this),x}catch(x){if(x instanceof Ea){if(x.silent)return k(this,ft).promise;if(x.revert){if(this.state.data===void 0)throw x;return this.state.data}}throw Le(this,$t,xr).call(this,{type:"error",error:x}),(y=(v=k(this,Zt).config).onError)==null||y.call(v,x,this),(S=(b=k(this,Zt).config).onSettled)==null||S.call(b,this.state.data,x,this),x}finally{this.scheduleGc()}}},Vn=new WeakMap,an=new WeakMap,Hn=new WeakMap,Zt=new WeakMap,ln=new WeakMap,ft=new WeakMap,Vs=new WeakMap,cn=new WeakMap,$t=new WeakSet,nf=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},xr=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,...sf(n.data,this.options),fetchMeta:t.meta??null};case"success":const s={...n,...uc(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ee(this,Hn,t.manual?s:void 0),s;case"error":const o=t.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),bt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),k(this,Zt).notify({query:this,type:"updated",action:t})})},Hd);function sf(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ef(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function uc(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function dc(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 Pt,De,Hs,jt,un,Qn,_r,$r,Qs,Wn,Gn,dn,fn,Ur,Kn,Be,Ts,Aa,ka,Ia,La,Da,ja,Na,of,Qd,Fm=(Qd=class extends Ks{constructor(t,r){super();be(this,Be);be(this,Pt);be(this,De);be(this,Hs);be(this,jt);be(this,un);be(this,Qn);be(this,_r);be(this,$r);be(this,Qs);be(this,Wn);be(this,Gn);be(this,dn);be(this,fn);be(this,Ur);be(this,Kn,new Set);this.options=r,ee(this,Pt,t),ee(this,$r,null),ee(this,_r,Ta()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(k(this,De).addObserver(this),fc(k(this,De),this.options)?Le(this,Be,Ts).call(this):this.updateResult(),Le(this,Be,La).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Oa(k(this,De),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Oa(k(this,De),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Le(this,Be,Da).call(this),Le(this,Be,ja).call(this),k(this,De).removeObserver(this)}setOptions(t){const r=this.options,n=k(this,De);if(this.options=k(this,Pt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ut(this.options.enabled,k(this,De))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Le(this,Be,Na).call(this),k(this,De).setOptions(this.options),r._defaulted&&!xa(this.options,r)&&k(this,Pt).getQueryCache().notify({type:"observerOptionsUpdated",query:k(this,De),observer:this});const s=this.hasListeners();s&&hc(k(this,De),n,this.options,r)&&Le(this,Be,Ts).call(this),this.updateResult(),s&&(k(this,De)!==n||Ut(this.options.enabled,k(this,De))!==Ut(r.enabled,k(this,De))||Qr(this.options.staleTime,k(this,De))!==Qr(r.staleTime,k(this,De)))&&Le(this,Be,Aa).call(this);const o=Le(this,Be,ka).call(this);s&&(k(this,De)!==n||Ut(this.options.enabled,k(this,De))!==Ut(r.enabled,k(this,De))||o!==k(this,Ur))&&Le(this,Be,Ia).call(this,o)}getOptimisticResult(t){const r=k(this,Pt).getQueryCache().build(k(this,Pt),t),n=this.createResult(r,t);return Bm(this,n)&&(ee(this,jt,n),ee(this,Qn,this.options),ee(this,un,k(this,De).state)),n}getCurrentResult(){return k(this,jt)}trackResult(t,r){return new Proxy(t,{get:(n,s)=>(this.trackProp(s),r==null||r(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&k(this,_r).status==="pending"&&k(this,_r).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(t){k(this,Kn).add(t)}getCurrentQuery(){return k(this,De)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=k(this,Pt).defaultQueryOptions(t),n=k(this,Pt).getQueryCache().build(k(this,Pt),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Le(this,Be,Ts).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),k(this,jt)))}createResult(t,r){var O;const n=k(this,De),s=this.options,o=k(this,jt),i=k(this,un),a=k(this,Qn),u=t!==n?t.state:k(this,Hs),{state:d}=t;let f={...d},p=!1,m;if(r._optimisticResults){const P=this.hasListeners(),j=!P&&fc(t,r),N=P&&hc(t,n,r,s);(j||N)&&(f={...f,...sf(d.data,t.options)}),r._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:C,errorUpdatedAt:h,status:v}=f;m=f.data;let y=!1;if(r.placeholderData!==void 0&&m===void 0&&v==="pending"){let P;o!=null&&o.isPlaceholderData&&r.placeholderData===(a==null?void 0:a.placeholderData)?(P=o.data,y=!0):P=typeof r.placeholderData=="function"?r.placeholderData((O=k(this,Gn))==null?void 0:O.state.data,k(this,Gn)):r.placeholderData,P!==void 0&&(v="success",m=wa(o==null?void 0:o.data,P,r),p=!0)}if(r.select&&m!==void 0&&!y)if(o&&m===(i==null?void 0:i.data)&&r.select===k(this,Qs))m=k(this,Wn);else try{ee(this,Qs,r.select),m=r.select(m),m=wa(o==null?void 0:o.data,m,r),ee(this,Wn,m),ee(this,$r,null)}catch(P){ee(this,$r,P)}k(this,$r)&&(C=k(this,$r),m=k(this,Wn),h=Date.now(),v="error");const b=f.fetchStatus==="fetching",S=v==="pending",x=v==="error",w=S&&b,T=m!==void 0,A={status:v,fetchStatus:f.fetchStatus,isPending:S,isSuccess:v==="success",isError:x,isInitialLoading:w,isLoading:w,data:m,dataUpdatedAt:f.dataUpdatedAt,error:C,errorUpdatedAt:h,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:b,isRefetching:b&&!S,isLoadingError:x&&!T,isPaused:f.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:x&&T,isStale:bl(t,r),refetch:this.refetch,promise:k(this,_r),isEnabled:Ut(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const P=A.data!==void 0,j=A.status==="error"&&!P,N=U=>{j?U.reject(A.error):P&&U.resolve(A.data)},F=()=>{const U=ee(this,_r,A.promise=Ta());N(U)},R=k(this,_r);switch(R.status){case"pending":t.queryHash===n.queryHash&&N(R);break;case"fulfilled":(j||A.data!==R.value)&&F();break;case"rejected":(!j||A.error!==R.reason)&&F();break}}return A}updateResult(){const t=k(this,jt),r=this.createResult(k(this,De),this.options);if(ee(this,un,k(this,De).state),ee(this,Qn,this.options),k(this,un).data!==void 0&&ee(this,Gn,k(this,De)),xa(r,t))return;ee(this,jt,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,o=typeof s=="function"?s():s;if(o==="all"||!o&&!k(this,Kn).size)return!0;const i=new Set(o??k(this,Kn));return this.options.throwOnError&&i.add("error"),Object.keys(k(this,jt)).some(a=>{const c=a;return k(this,jt)[c]!==t[c]&&i.has(c)})};Le(this,Be,of).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Le(this,Be,La).call(this)}},Pt=new WeakMap,De=new WeakMap,Hs=new WeakMap,jt=new WeakMap,un=new WeakMap,Qn=new WeakMap,_r=new WeakMap,$r=new WeakMap,Qs=new WeakMap,Wn=new WeakMap,Gn=new WeakMap,dn=new WeakMap,fn=new WeakMap,Ur=new WeakMap,Kn=new WeakMap,Be=new WeakSet,Ts=function(t){Le(this,Be,Na).call(this);let r=k(this,De).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Rt)),r},Aa=function(){Le(this,Be,Da).call(this);const t=Qr(this.options.staleTime,k(this,De));if(Ps.isServer()||k(this,jt).isStale||!Ca(t))return;const n=Zd(k(this,jt).dataUpdatedAt,t)+1;ee(this,dn,en.setTimeout(()=>{k(this,jt).isStale||this.updateResult()},n))},ka=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(k(this,De)):this.options.refetchInterval)??!1},Ia=function(t){Le(this,Be,ja).call(this),ee(this,Ur,t),!(Ps.isServer()||Ut(this.options.enabled,k(this,De))===!1||!Ca(k(this,Ur))||k(this,Ur)===0)&&ee(this,fn,en.setInterval(()=>{(this.options.refetchIntervalInBackground||vl.isFocused())&&Le(this,Be,Ts).call(this)},k(this,Ur)))},La=function(){Le(this,Be,Aa).call(this),Le(this,Be,Ia).call(this,Le(this,Be,ka).call(this))},Da=function(){k(this,dn)!==void 0&&(en.clearTimeout(k(this,dn)),ee(this,dn,void 0))},ja=function(){k(this,fn)!==void 0&&(en.clearInterval(k(this,fn)),ee(this,fn,void 0))},Na=function(){const t=k(this,Pt).getQueryCache().build(k(this,Pt),this.options);if(t===k(this,De))return;const r=k(this,De);ee(this,De,t),ee(this,Hs,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},of=function(t){bt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(k(this,jt))}),k(this,Pt).getQueryCache().notify({query:k(this,De),type:"observerResultsUpdated"})})},Qd);function Mm(e,t){return Ut(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Ut(t.retryOnMount,e)===!1)}function fc(e,t){return Mm(e,t)||e.state.data!==void 0&&Oa(e,t,t.refetchOnMount)}function Oa(e,t,r){if(Ut(t.enabled,e)!==!1&&Qr(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&bl(e,t)}return!1}function hc(e,t,r,n){return(e!==t||Ut(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&bl(e,r)}function bl(e,t){return Ut(t.enabled,e)!==!1&&e.isStaleByTime(Qr(t.staleTime,e))}function Bm(e,t){return!xa(e.getCurrentResult(),t)}var Ws,gr,At,hn,vr,Or,Wd,qm=(Wd=class extends rf{constructor(t){super();be(this,vr);be(this,Ws);be(this,gr);be(this,At);be(this,hn);ee(this,Ws,t.client),this.mutationId=t.mutationId,ee(this,At,t.mutationCache),ee(this,gr,[]),this.state=t.state||$m(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){k(this,gr).includes(t)||(k(this,gr).push(t),this.clearGcTimeout(),k(this,At).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ee(this,gr,k(this,gr).filter(r=>r!==t)),this.scheduleGc(),k(this,At).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){k(this,gr).length||(this.state.status==="pending"?this.scheduleGc():k(this,At).remove(this))}continue(){var t;return((t=k(this,hn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,a,c,u,d,f,p,m,C,h,v,y,b,S,x,w,T,L;const r=()=>{Le(this,vr,Or).call(this,{type:"continue"})},n={client:k(this,Ws),meta:this.options.meta,mutationKey:this.options.mutationKey};ee(this,hn,tf({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(A,O)=>{Le(this,vr,Or).call(this,{type:"failed",failureCount:A,error:O})},onPause:()=>{Le(this,vr,Or).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>k(this,At).canRun(this)}));const s=this.state.status==="pending",o=!k(this,hn).canStart();try{if(s)r();else{Le(this,vr,Or).call(this,{type:"pending",variables:t,isPaused:o}),k(this,At).config.onMutate&&await k(this,At).config.onMutate(t,this,n);const O=await((a=(i=this.options).onMutate)==null?void 0:a.call(i,t,n));O!==this.state.context&&Le(this,vr,Or).call(this,{type:"pending",context:O,variables:t,isPaused:o})}const A=await k(this,hn).start();return await((u=(c=k(this,At).config).onSuccess)==null?void 0:u.call(c,A,t,this.state.context,this,n)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,A,t,this.state.context,n)),await((m=(p=k(this,At).config).onSettled)==null?void 0:m.call(p,A,null,this.state.variables,this.state.context,this,n)),await((h=(C=this.options).onSettled)==null?void 0:h.call(C,A,null,t,this.state.context,n)),Le(this,vr,Or).call(this,{type:"success",data:A}),A}catch(A){try{await((y=(v=k(this,At).config).onError)==null?void 0:y.call(v,A,t,this.state.context,this,n))}catch(O){Promise.reject(O)}try{await((S=(b=this.options).onError)==null?void 0:S.call(b,A,t,this.state.context,n))}catch(O){Promise.reject(O)}try{await((w=(x=k(this,At).config).onSettled)==null?void 0:w.call(x,void 0,A,this.state.variables,this.state.context,this,n))}catch(O){Promise.reject(O)}try{await((L=(T=this.options).onSettled)==null?void 0:L.call(T,void 0,A,t,this.state.context,n))}catch(O){Promise.reject(O)}throw Le(this,vr,Or).call(this,{type:"error",error:A}),A}finally{k(this,At).runNext(this)}}},Ws=new WeakMap,gr=new WeakMap,At=new WeakMap,hn=new WeakMap,vr=new WeakSet,Or=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),bt.batch(()=>{k(this,gr).forEach(n=>{n.onMutationUpdate(t)}),k(this,At).notify({mutation:this,type:"updated",action:t})})},Wd);function $m(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var wr,sr,Gs,Gd,Um=(Gd=class extends Ks{constructor(t={}){super();be(this,wr);be(this,sr);be(this,Gs);this.config=t,ee(this,wr,new Set),ee(this,sr,new Map),ee(this,Gs,0)}build(t,r,n){const s=new qm({client:t,mutationCache:this,mutationId:++po(this,Gs)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){k(this,wr).add(t);const r=mo(t);if(typeof r=="string"){const n=k(this,sr).get(r);n?n.push(t):k(this,sr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(k(this,wr).delete(t)){const r=mo(t);if(typeof r=="string"){const n=k(this,sr).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&k(this,sr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=mo(t);if(typeof r=="string"){const n=k(this,sr).get(r),s=n==null?void 0:n.find(o=>o.state.status==="pending");return!s||s===t}else return!0}runNext(t){var n;const r=mo(t);if(typeof r=="string"){const s=(n=k(this,sr).get(r))==null?void 0:n.find(o=>o!==t&&o.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){bt.batch(()=>{k(this,wr).forEach(t=>{this.notify({type:"removed",mutation:t})}),k(this,wr).clear(),k(this,sr).clear()})}getAll(){return Array.from(k(this,wr))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>ic(r,n))}findAll(t={}){return this.getAll().filter(r=>ic(t,r))}notify(t){bt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return bt.batch(()=>Promise.all(t.map(r=>r.continue().catch(Rt))))}},wr=new WeakMap,sr=new WeakMap,Gs=new WeakMap,Gd);function mo(e){var t;return(t=e.options.scope)==null?void 0:t.id}var yr,Kd,zm=(Kd=class extends Ks{constructor(t={}){super();be(this,yr);this.config=t,ee(this,yr,new Map)}build(t,r,n){const s=r.queryKey,o=r.queryHash??yl(s,r);let i=this.get(o);return i||(i=new Rm({client:t,queryKey:s,queryHash:o,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(i)),i}add(t){k(this,yr).has(t.queryHash)||(k(this,yr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=k(this,yr).get(t.queryHash);r&&(t.destroy(),r===t&&k(this,yr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){bt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return k(this,yr).get(t)}getAll(){return[...k(this,yr).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>oc(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>oc(t,n)):r}notify(t){bt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){bt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){bt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},yr=new WeakMap,Kd),Je,zr,Vr,Yn,Zn,Hr,Xn,Jn,Yd,Vm=(Yd=class{constructor(e={}){be(this,Je);be(this,zr);be(this,Vr);be(this,Yn);be(this,Zn);be(this,Hr);be(this,Xn);be(this,Jn);ee(this,Je,e.queryCache||new zm),ee(this,zr,e.mutationCache||new Um),ee(this,Vr,e.defaultOptions||{}),ee(this,Yn,new Map),ee(this,Zn,new Map),ee(this,Hr,0)}mount(){po(this,Hr)._++,k(this,Hr)===1&&(ee(this,Xn,vl.subscribe(async e=>{e&&(await this.resumePausedMutations(),k(this,Je).onFocus())})),ee(this,Jn,Qo.subscribe(async e=>{e&&(await this.resumePausedMutations(),k(this,Je).onOnline())})))}unmount(){var e,t;po(this,Hr)._--,k(this,Hr)===0&&((e=k(this,Xn))==null||e.call(this),ee(this,Xn,void 0),(t=k(this,Jn))==null||t.call(this),ee(this,Jn,void 0))}isFetching(e){return k(this,Je).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return k(this,zr).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=k(this,Je).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=k(this,Je).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Qr(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return k(this,Je).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),s=k(this,Je).get(n.queryHash),o=s==null?void 0:s.state.data,i=wm(t,o);if(i!==void 0)return k(this,Je).build(this,n).setData(i,{...r,manual:!0})}setQueriesData(e,t,r){return bt.batch(()=>k(this,Je).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=k(this,Je).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=k(this,Je);bt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=k(this,Je);return bt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=bt.batch(()=>k(this,Je).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(Rt).catch(Rt)}invalidateQueries(e,t={}){return bt.batch(()=>(k(this,Je).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=bt.batch(()=>k(this,Je).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,r);return r.throwOnError||(o=o.catch(Rt)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(n).then(Rt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=k(this,Je).build(this,t);return r.isStaleByTime(Qr(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Rt).catch(Rt)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Rt).catch(Rt)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Qo.isOnline()?k(this,zr).resumePausedMutations():Promise.resolve()}getQueryCache(){return k(this,Je)}getMutationCache(){return k(this,zr)}getDefaultOptions(){return k(this,Vr)}setDefaultOptions(e){ee(this,Vr,e)}setQueryDefaults(e,t){k(this,Yn).set(Ns(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...k(this,Yn).values()],r={};return t.forEach(n=>{Os(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){k(this,Zn).set(Ns(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...k(this,Zn).values()],r={};return t.forEach(n=>{Os(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...k(this,Vr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=yl(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===Ho&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...k(this,Vr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){k(this,Je).clear(),k(this,zr).clear()}},Je=new WeakMap,zr=new WeakMap,Vr=new WeakMap,Yn=new WeakMap,Zn=new WeakMap,Hr=new WeakMap,Xn=new WeakMap,Jn=new WeakMap,Yd),af=Me.createContext(void 0),Hm=e=>{const t=Me.useContext(af);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Qm=({client:e,children:t})=>(Me.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(af.Provider,{value:e,children:t})),lf=Me.createContext(!1),Wm=()=>Me.useContext(lf);lf.Provider;function Gm(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Km=Me.createContext(Gm()),Ym=()=>Me.useContext(Km),Zm=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?Jd(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},Xm=e=>{Me.useEffect(()=>{e.clearReset()},[e])},Jm=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||Jd(r,[e.error,n])),eg=e=>{if(e.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...s)=>r(n(...s)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},tg=(e,t)=>e.isLoading&&e.isFetching&&!t,rg=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,pc=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function ng(e,t,r){var m,C,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=Wm(),s=Ym(),o=Hm(),i=o.defaultQueryOptions(e);(C=(m=o.getDefaultOptions().queries)==null?void 0:m._experimental_beforeQuery)==null||C.call(m,i);const a=o.getQueryCache().get(i.queryHash);process.env.NODE_ENV!=="production"&&(i.queryFn||console.error(`[${i.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;i._optimisticResults=n?"isRestoring":c?"optimistic":void 0,eg(i),Zm(i,s,a),Xm(s);const u=!o.getQueryCache().get(i.queryHash),[d]=Me.useState(()=>new t(o,i)),f=d.getOptimisticResult(i),p=!n&&c;if(Me.useSyncExternalStore(Me.useCallback(y=>{const b=p?d.subscribe(bt.batchCalls(y)):Rt;return d.updateResult(),b},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),Me.useEffect(()=>{d.setOptions(i)},[i,d]),rg(i,f))throw pc(i,d,s);if(Jm({result:f,errorResetBoundary:s,throwOnError:i.throwOnError,query:a,suspense:i.suspense}))throw f.error;if((v=(h=o.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||v.call(h,i,f),i.experimental_prefetchInRender&&!Ps.isServer()&&tg(f,n)){const y=u?pc(i,d,s):a==null?void 0:a.promise;y==null||y.catch(Rt).finally(()=>{d.updateResult()})}return i.notifyOnChangeProps?f:d.trackResult(f)}function es(e,t){return ng(e,Fm)}let sg={data:""},og=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||sg},ig=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,ag=/\/\*[^]*?\*\/| +/g,mc=/\n+/g,Mr=(e,t)=>{let r="",n="",s="";for(let o in e){let i=e[o];o[0]=="@"?o[1]=="i"?r=o+" "+i+";":n+=o[1]=="f"?Mr(i,o):o+"{"+Mr(i,o[1]=="k"?"":t)+"}":typeof i=="object"?n+=Mr(i,t?t.replace(/([^,])+/g,a=>o.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,a):a?a+" "+c:c)):o):i!=null&&(o=o[1]=="-"?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),s+=Mr.p?Mr.p(o,i):o+":"+i+";")}return r+(t&&s?t+"{"+s+"}":s)+n},Dr={},cf=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+cf(e[r]);return t}return e},lg=(e,t,r,n,s)=>{let o=cf(e),i=Dr[o]||(Dr[o]=(c=>{let u=0,d=11;for(;u<c.length;)d=101*d+c.charCodeAt(u++)>>>0;return"go"+d})(o));if(!Dr[i]){let c=o!==e?e:(u=>{let d,f,p=[{}];for(;d=ig.exec(u.replace(ag,""));)d[4]?p.shift():d[3]?(f=d[3].replace(mc," ").trim(),p.unshift(p[0][f]=p[0][f]||{})):p[0][d[1]]=d[2].replace(mc," ").trim();return p[0]})(e);Dr[i]=Mr(s?{["@keyframes "+i]:c}:c,r?"":"."+i)}let a=r&&Dr.g;return r&&(Dr.g=Dr[i]),((c,u,d,f)=>{f?u.data=u.data.replace(f,c):u.data.indexOf(c)===-1&&(u.data=d?c+u.data:u.data+c)})(Dr[i],t,n,a),i},cg=(e,t,r)=>e.reduce((n,s,o)=>{let i=t[o];if(i&&i.call){let a=i(r),c=a&&a.props&&a.props.className||/^go/.test(a)&&a;i=c?"."+c:a&&typeof a=="object"?a.props?"":Mr(a,""):a===!1?"":a}return n+s+(i??"")},"");function ui(e){let t=this||{},r=e.call?e(t.p):e;return lg(r.unshift?r.raw?cg(r,[].slice.call(arguments,1),t.p):r.reduce((n,s)=>Object.assign(n,s&&s.call?s(t.p):s),{}):r,og(t.target),t.g,t.o,t.k)}let uf,Pa,Ra;ui.bind({g:1});let Er=ui.bind({k:1});function ug(e,t,r,n){Mr.p=t,uf=e,Pa=r,Ra=n}function Wr(e,t){let r=this||{};return function(){let n=arguments;function s(o,i){let a=Object.assign({},o),c=a.className||s.className;r.p=Object.assign({theme:Pa&&Pa()},a),r.o=/go\d/.test(c),a.className=ui.apply(r,n)+(c?" "+c:"");let u=e;return e[0]&&(u=a.as||e,delete a.as),Ra&&u[0]&&Ra(a),uf(u,a)}return s}}var dg=e=>typeof e=="function",Wo=(e,t)=>dg(e)?e(t):e,fg=(()=>{let e=0;return()=>(++e).toString()})(),df=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),hg=20,Cl="default",ff=(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(i=>i.id===t.toast.id?{...i,...t.toast}:i)};case 2:let{toast:n}=t;return ff(e,{type:e.toasts.find(i=>i.id===n.id)?1:0,toast:n});case 3:let{toastId:s}=t;return{...e,toasts:e.toasts.map(i=>i.id===s||s===void 0?{...i,dismissed:!0,visible:!1}:i)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(i=>i.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let o=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(i=>({...i,pauseDuration:i.pauseDuration+o}))}}},Io=[],hf={toasts:[],pausedAt:void 0,settings:{toastLimit:hg}},br={},pf=(e,t=Cl)=>{br[t]=ff(br[t]||hf,e),Io.forEach(([r,n])=>{r===t&&n(br[t])})},mf=e=>Object.keys(br).forEach(t=>pf(e,t)),pg=e=>Object.keys(br).find(t=>br[t].toasts.some(r=>r.id===e)),di=(e=Cl)=>t=>{pf(t,e)},mg={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},gg=(e={},t=Cl)=>{let[r,n]=g.useState(br[t]||hf),s=g.useRef(br[t]);g.useEffect(()=>(s.current!==br[t]&&n(br[t]),Io.push([t,n]),()=>{let i=Io.findIndex(([a])=>a===t);i>-1&&Io.splice(i,1)}),[t]);let o=r.toasts.map(i=>{var a,c,u;return{...e,...e[i.type],...i,removeDelay:i.removeDelay||((a=e[i.type])==null?void 0:a.removeDelay)||(e==null?void 0:e.removeDelay),duration:i.duration||((c=e[i.type])==null?void 0:c.duration)||(e==null?void 0:e.duration)||mg[i.type],style:{...e.style,...(u=e[i.type])==null?void 0:u.style,...i.style}}});return{...r,toasts:o}},vg=(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)||fg()}),Ys=e=>(t,r)=>{let n=vg(t,e,r);return di(n.toasterId||pg(n.id))({type:2,toast:n}),n.id},ct=(e,t)=>Ys("blank")(e,t);ct.error=Ys("error");ct.success=Ys("success");ct.loading=Ys("loading");ct.custom=Ys("custom");ct.dismiss=(e,t)=>{let r={type:3,toastId:e};t?di(t)(r):mf(r)};ct.dismissAll=e=>ct.dismiss(void 0,e);ct.remove=(e,t)=>{let r={type:4,toastId:e};t?di(t)(r):mf(r)};ct.removeAll=e=>ct.remove(void 0,e);ct.promise=(e,t,r)=>{let n=ct.loading(t.loading,{...r,...r==null?void 0:r.loading});return typeof e=="function"&&(e=e()),e.then(s=>{let o=t.success?Wo(t.success,s):void 0;return o?ct.success(o,{id:n,...r,...r==null?void 0:r.success}):ct.dismiss(n),s}).catch(s=>{let o=t.error?Wo(t.error,s):void 0;o?ct.error(o,{id:n,...r,...r==null?void 0:r.error}):ct.dismiss(n)}),e};var yg=1e3,bg=(e,t="default")=>{let{toasts:r,pausedAt:n}=gg(e,t),s=g.useRef(new Map).current,o=g.useCallback((f,p=yg)=>{if(s.has(f))return;let m=setTimeout(()=>{s.delete(f),i({type:4,toastId:f})},p);s.set(f,m)},[]);g.useEffect(()=>{if(n)return;let f=Date.now(),p=r.map(m=>{if(m.duration===1/0)return;let C=(m.duration||0)+m.pauseDuration-(f-m.createdAt);if(C<0){m.visible&&ct.dismiss(m.id);return}return setTimeout(()=>ct.dismiss(m.id,t),C)});return()=>{p.forEach(m=>m&&clearTimeout(m))}},[r,n,t]);let i=g.useCallback(di(t),[t]),a=g.useCallback(()=>{i({type:5,time:Date.now()})},[i]),c=g.useCallback((f,p)=>{i({type:1,toast:{id:f,height:p}})},[i]),u=g.useCallback(()=>{n&&i({type:6,time:Date.now()})},[n,i]),d=g.useCallback((f,p)=>{let{reverseOrder:m=!1,gutter:C=8,defaultPosition:h}=p||{},v=r.filter(S=>(S.position||h)===(f.position||h)&&S.height),y=v.findIndex(S=>S.id===f.id),b=v.filter((S,x)=>x<y&&S.visible).length;return v.filter(S=>S.visible).slice(...m?[b+1]:[0,b]).reduce((S,x)=>S+(x.height||0)+C,0)},[r]);return g.useEffect(()=>{r.forEach(f=>{if(f.dismissed)o(f.id,f.removeDelay);else{let p=s.get(f.id);p&&(clearTimeout(p),s.delete(f.id))}})},[r,o]),{toasts:r,handlers:{updateHeight:c,startPause:a,endPause:u,calculateOffset:d}}},Cg=Er`
|
|
1
|
+
"use strict";var gm=Object.defineProperty;var sc=e=>{throw TypeError(e)};var vm=(e,t,r)=>t in e?gm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var gs=(e,t,r)=>vm(e,typeof t!="symbol"?t+"":t,r),Ma=(e,t,r)=>t.has(e)||sc("Cannot "+r);var I=(e,t,r)=>(Ma(e,t,"read from private field"),r?r.call(e):t.get(e)),Ce=(e,t,r)=>t.has(e)?sc("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),ee=(e,t,r,n)=>(Ma(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Le=(e,t,r)=>(Ma(e,t,"access private method"),r);var po=(e,t,r,n)=>({set _(s){ee(e,t,s,r)},get _(){return I(e,t,n)}});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react"),Tr=require("react-dom"),l=require("react/jsx-runtime");function ym(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 Me=ym(g);var Ks=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(){}},nn,Br,$n,$d,bm=($d=class extends Ks{constructor(){super();Ce(this,nn);Ce(this,Br);Ce(this,$n);ee(this,$n,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){I(this,Br)||this.setEventListener(I(this,$n))}onUnsubscribe(){var t;this.hasListeners()||((t=I(this,Br))==null||t.call(this),ee(this,Br,void 0))}setEventListener(t){var r;ee(this,$n,t),(r=I(this,Br))==null||r.call(this),ee(this,Br,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){I(this,nn)!==t&&(ee(this,nn,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof I(this,nn)=="boolean"?I(this,nn):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},nn=new WeakMap,Br=new WeakMap,$n=new WeakMap,$d),vl=new bm,Cm={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},mr,sn,Ud,Sm=(Ud=class{constructor(){Ce(this,mr,Cm);Ce(this,sn,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&I(this,sn)&&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}),ee(this,mr,e),process.env.NODE_ENV!=="production"&&ee(this,sn,!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&ee(this,sn,!0),I(this,mr).setTimeout(e,t)}clearTimeout(e){I(this,mr).clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&ee(this,sn,!0),I(this,mr).setInterval(e,t)}clearInterval(e){I(this,mr).clearInterval(e)}},mr=new WeakMap,sn=new WeakMap,Ud),en=new Sm;function xm(e){setTimeout(e,0)}var _m=typeof window>"u"||"Deno"in globalThis;function Rt(){}function wm(e,t){return typeof e=="function"?e(t):e}function Ci(e){return typeof e=="number"&&e>=0&&e!==1/0}function Zd(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Qr(e,t){return typeof e=="function"?e(t):e}function Ut(e,t){return typeof e=="function"?e(t):e}function oc(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:o,queryKey:a,stale:i}=e;if(a){if(n){if(t.queryHash!==yl(a,t.options))return!1}else if(!Os(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||s&&s!==t.state.fetchStatus||o&&!o(t))}function ac(e,t){const{exact:r,status:n,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(Ns(t.options.mutationKey)!==Ns(o))return!1}else if(!Os(t.options.mutationKey,o))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function yl(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ns)(e)}function Ns(e){return JSON.stringify(e,(t,r)=>_i(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function Os(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Os(e[r],t[r])):!1}var Tm=Object.prototype.hasOwnProperty;function Si(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=ic(e)&&ic(t);if(!n&&!(_i(e)&&_i(t)))return t;const o=(n?e:Object.keys(e)).length,a=n?t:Object.keys(t),i=a.length,c=n?new Array(i):{};let u=0;for(let d=0;d<i;d++){const f=n?d:a[d],p=e[f],m=t[f];if(p===m){c[f]=p,(n?d<o:Tm.call(e,f))&&u++;continue}if(p===null||m===null||typeof p!="object"||typeof m!="object"){c[f]=m;continue}const C=Si(p,m,r+1);c[f]=C,C===p&&u++}return o===i&&u===o?e:c}function xi(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 ic(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function _i(e){if(!lc(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!lc(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function lc(e){return Object.prototype.toString.call(e)==="[object Object]"}function Em(e){return new Promise(t=>{en.setTimeout(t,e)})}function wi(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 Si(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 Si(e,t)}return t}function Am(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function km(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Ho=Symbol();function Xd(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Ho&&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===Ho?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Jd(e,t){return typeof e=="function"?e(...t):!!e}function Im(e,t,r){let n=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),n||(n=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)}),e}var Ps=(()=>{let e=()=>_m;return{isServer(){return e()},setIsServer(t){e=t}}})();function Ti(){let e,t;const r=new Promise((s,o)=>{e=s,t=o});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}var Lm=xm;function Dm(){let e=[],t=0,r=i=>{i()},n=i=>{i()},s=Lm;const o=i=>{t?e.push(i):s(()=>{r(i)})},a=()=>{const i=e;e=[],i.length&&s(()=>{n(()=>{i.forEach(c=>{r(c)})})})};return{batch:i=>{let c;t++;try{c=i()}finally{t--,t||a()}return c},batchCalls:i=>(...c)=>{o(()=>{i(...c)})},schedule:o,setNotifyFunction:i=>{r=i},setBatchNotifyFunction:i=>{n=i},setScheduler:i=>{s=i}}}var bt=Dm(),Un,qr,zn,zd,jm=(zd=class extends Ks{constructor(){super();Ce(this,Un,!0);Ce(this,qr);Ce(this,zn);ee(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,qr)||this.setEventListener(I(this,zn))}onUnsubscribe(){var t;this.hasListeners()||((t=I(this,qr))==null||t.call(this),ee(this,qr,void 0))}setEventListener(t){var r;ee(this,zn,t),(r=I(this,qr))==null||r.call(this),ee(this,qr,t(this.setOnline.bind(this)))}setOnline(t){I(this,Un)!==t&&(ee(this,Un,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return I(this,Un)}},Un=new WeakMap,qr=new WeakMap,zn=new WeakMap,zd),Qo=new jm;function Nm(e){return Math.min(1e3*2**e,3e4)}function ef(e){return(e??"online")==="online"?Qo.isOnline():!0}var Ei=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function tf(e){let t=!1,r=0,n;const s=Ti(),o=()=>s.status!=="pending",a=h=>{var v;if(!o()){const y=new Ei(h);p(y),(v=e.onCancel)==null||v.call(e,y)}},i=()=>{t=!0},c=()=>{t=!1},u=()=>vl.isFocused()&&(e.networkMode==="always"||Qo.isOnline())&&e.canRun(),d=()=>ef(e.networkMode)&&e.canRun(),f=h=>{o()||(n==null||n(),s.resolve(h))},p=h=>{o()||(n==null||n(),s.reject(h))},m=()=>new Promise(h=>{var v;n=y=>{(o()||u())&&h(y)},(v=e.onPause)==null||v.call(e)}).then(()=>{var h;n=void 0,o()||(h=e.onContinue)==null||h.call(e)}),C=()=>{if(o())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 T;if(o())return;const b=e.retry??(Ps.isServer()?0:3),S=e.retryDelay??Nm,x=typeof S=="function"?S(r,y):S,w=b===!0||typeof b=="number"&&r<b||typeof b=="function"&&b(r,y);if(t||!w){p(y);return}r++,(T=e.onFail)==null||T.call(e,r,y),Em(x).then(()=>u()?void 0:m()).then(()=>{t?p(y):C()})})};return{promise:s,status:()=>s.status,cancel:a,continue:()=>(n==null||n(),s),cancelRetry:i,continueRetry:c,canStart:d,start:()=>(d()?C():m().then(C),s)}}var on,Vd,rf=(Vd=class{constructor(){Ce(this,on)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ci(this.gcTime)&&ee(this,on,en.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ps.isServer()?1/0:300*1e3))}clearGcTimeout(){I(this,on)!==void 0&&(en.clearTimeout(I(this,on)),ee(this,on,void 0))}},on=new WeakMap,Vd);function Om(e){return{onFetch:(t,r)=>{var d,f,p,m,C;const n=t.options,s=(p=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:p.direction,o=((m=t.state.data)==null?void 0:m.pages)||[],a=((C=t.state.data)==null?void 0:C.pageParams)||[];let i={pages:[],pageParams:[]},c=0;const u=async()=>{let h=!1;const v=S=>{Im(S,()=>t.signal,()=>h=!0)},y=Xd(t.options,t.fetchOptions),b=async(S,x,w)=>{if(h)return Promise.reject(t.signal.reason);if(x==null&&S.pages.length)return Promise.resolve(S);const D=(()=>{const A={client:t.client,queryKey:t.queryKey,pageParam:x,direction:w?"backward":"forward",meta:t.options.meta};return v(A),A})(),k=await y(D),{maxPages:N}=t.options,F=w?km:Am;return{pages:F(S.pages,k,N),pageParams:F(S.pageParams,x,N)}};if(s&&o.length){const S=s==="backward",x=S?Pm:cc,w={pages:o,pageParams:a},T=x(n,w);i=await b(w,T,S)}else{const S=e??o.length;do{const x=c===0?a[0]??n.initialPageParam:cc(n,i);if(c>0&&x==null)break;i=await b(i,x),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,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=u}}}function cc(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 Pm(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 Vn,an,Hn,Zt,ln,ft,Vs,cn,$t,nf,xr,Hd,Rm=(Hd=class extends rf{constructor(t){super();Ce(this,$t);Ce(this,Vn);Ce(this,an);Ce(this,Hn);Ce(this,Zt);Ce(this,ln);Ce(this,ft);Ce(this,Vs);Ce(this,cn);ee(this,cn,!1),ee(this,Vs,t.defaultOptions),this.setOptions(t.options),this.observers=[],ee(this,ln,t.client),ee(this,Zt,I(this,ln).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ee(this,an,dc(this.options)),this.state=t.state??I(this,an),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return I(this,Vn)}get promise(){var t;return(t=I(this,ft))==null?void 0:t.promise}setOptions(t){if(this.options={...I(this,Vs),...t},t!=null&&t._type&&ee(this,Vn,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=dc(this.options);r.data!==void 0&&(this.setState(uc(r.data,r.dataUpdatedAt)),ee(this,an,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&I(this,Zt).remove(this)}setData(t,r){const n=wi(this.state.data,t,this.options);return Le(this,$t,xr).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t){Le(this,$t,xr).call(this,{type:"setState",state:t})}cancel(t){var n,s;const r=(n=I(this,ft))==null?void 0:n.promise;return(s=I(this,ft))==null||s.cancel(t),r?r.then(Rt).catch(Rt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return I(this,an)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Ut(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ho||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Qr(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:!Zd(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=I(this,ft))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=I(this,ft))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),I(this,Zt).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,ft)&&(I(this,cn)||Le(this,$t,nf).call(this)?I(this,ft).cancel({revert:!0}):I(this,ft).cancelRetry()),this.scheduleGc()),I(this,Zt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Le(this,$t,xr).call(this,{type:"invalidate"})}async fetch(t,r){var u,d,f,p,m,C,h,v,y,b,S;if(this.state.fetchStatus!=="idle"&&((u=I(this,ft))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(I(this,ft))return I(this,ft).continueRetry(),I(this,ft).promise}if(t&&this.setOptions(t),!this.options.queryFn){const x=this.observers.find(w=>w.options.queryFn);x&&this.setOptions(x.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,s=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(ee(this,cn,!0),n.signal)})},o=()=>{const x=Xd(this.options,r),T=(()=>{const D={client:I(this,ln),queryKey:this.queryKey,meta:this.meta};return s(D),D})();return ee(this,cn,!1),this.options.persister?this.options.persister(x,T,this):x(T)},i=(()=>{const x={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:I(this,ln),state:this.state,fetchFn:o};return s(x),x})(),c=I(this,Vn)==="infinite"?Om(this.options.pages):this.options.behavior;c==null||c.onFetch(i,this),ee(this,Hn,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=i.fetchOptions)==null?void 0:d.meta))&&Le(this,$t,xr).call(this,{type:"fetch",meta:(f=i.fetchOptions)==null?void 0:f.meta}),ee(this,ft,tf({initialPromise:r==null?void 0:r.initialPromise,fn:i.fetchFn,onCancel:x=>{x instanceof Ei&&x.revert&&this.setState({...I(this,Hn),fetchStatus:"idle"}),n.abort()},onFail:(x,w)=>{Le(this,$t,xr).call(this,{type:"failed",failureCount:x,error:w})},onPause:()=>{Le(this,$t,xr).call(this,{type:"pause"})},onContinue:()=>{Le(this,$t,xr).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}));try{const x=await I(this,ft).start();if(x===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(x),(m=(p=I(this,Zt).config).onSuccess)==null||m.call(p,x,this),(h=(C=I(this,Zt).config).onSettled)==null||h.call(C,x,this.state.error,this),x}catch(x){if(x instanceof Ei){if(x.silent)return I(this,ft).promise;if(x.revert){if(this.state.data===void 0)throw x;return this.state.data}}throw Le(this,$t,xr).call(this,{type:"error",error:x}),(y=(v=I(this,Zt).config).onError)==null||y.call(v,x,this),(S=(b=I(this,Zt).config).onSettled)==null||S.call(b,this.state.data,x,this),x}finally{this.scheduleGc()}}},Vn=new WeakMap,an=new WeakMap,Hn=new WeakMap,Zt=new WeakMap,ln=new WeakMap,ft=new WeakMap,Vs=new WeakMap,cn=new WeakMap,$t=new WeakSet,nf=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},xr=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,...sf(n.data,this.options),fetchMeta:t.meta??null};case"success":const s={...n,...uc(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ee(this,Hn,t.manual?s:void 0),s;case"error":const o=t.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),bt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),I(this,Zt).notify({query:this,type:"updated",action:t})})},Hd);function sf(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ef(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function uc(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function dc(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 Pt,De,Hs,jt,un,Qn,_r,$r,Qs,Wn,Gn,dn,fn,Ur,Kn,Be,Ts,Ai,ki,Ii,Li,Di,ji,Ni,of,Qd,Fm=(Qd=class extends Ks{constructor(t,r){super();Ce(this,Be);Ce(this,Pt);Ce(this,De);Ce(this,Hs);Ce(this,jt);Ce(this,un);Ce(this,Qn);Ce(this,_r);Ce(this,$r);Ce(this,Qs);Ce(this,Wn);Ce(this,Gn);Ce(this,dn);Ce(this,fn);Ce(this,Ur);Ce(this,Kn,new Set);this.options=r,ee(this,Pt,t),ee(this,$r,null),ee(this,_r,Ti()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(I(this,De).addObserver(this),fc(I(this,De),this.options)?Le(this,Be,Ts).call(this):this.updateResult(),Le(this,Be,Li).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Oi(I(this,De),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Oi(I(this,De),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Le(this,Be,Di).call(this),Le(this,Be,ji).call(this),I(this,De).removeObserver(this)}setOptions(t){const r=this.options,n=I(this,De);if(this.options=I(this,Pt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ut(this.options.enabled,I(this,De))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Le(this,Be,Ni).call(this),I(this,De).setOptions(this.options),r._defaulted&&!xi(this.options,r)&&I(this,Pt).getQueryCache().notify({type:"observerOptionsUpdated",query:I(this,De),observer:this});const s=this.hasListeners();s&&hc(I(this,De),n,this.options,r)&&Le(this,Be,Ts).call(this),this.updateResult(),s&&(I(this,De)!==n||Ut(this.options.enabled,I(this,De))!==Ut(r.enabled,I(this,De))||Qr(this.options.staleTime,I(this,De))!==Qr(r.staleTime,I(this,De)))&&Le(this,Be,Ai).call(this);const o=Le(this,Be,ki).call(this);s&&(I(this,De)!==n||Ut(this.options.enabled,I(this,De))!==Ut(r.enabled,I(this,De))||o!==I(this,Ur))&&Le(this,Be,Ii).call(this,o)}getOptimisticResult(t){const r=I(this,Pt).getQueryCache().build(I(this,Pt),t),n=this.createResult(r,t);return Bm(this,n)&&(ee(this,jt,n),ee(this,Qn,this.options),ee(this,un,I(this,De).state)),n}getCurrentResult(){return I(this,jt)}trackResult(t,r){return new Proxy(t,{get:(n,s)=>(this.trackProp(s),r==null||r(s),s==="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,s))})}trackProp(t){I(this,Kn).add(t)}getCurrentQuery(){return I(this,De)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=I(this,Pt).defaultQueryOptions(t),n=I(this,Pt).getQueryCache().build(I(this,Pt),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Le(this,Be,Ts).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),I(this,jt)))}createResult(t,r){var N;const n=I(this,De),s=this.options,o=I(this,jt),a=I(this,un),i=I(this,Qn),u=t!==n?t.state:I(this,Hs),{state:d}=t;let f={...d},p=!1,m;if(r._optimisticResults){const F=this.hasListeners(),A=!F&&fc(t,r),P=F&&hc(t,n,r,s);(A||P)&&(f={...f,...sf(d.data,t.options)}),r._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:C,errorUpdatedAt:h,status:v}=f;m=f.data;let y=!1;if(r.placeholderData!==void 0&&m===void 0&&v==="pending"){let F;o!=null&&o.isPlaceholderData&&r.placeholderData===(i==null?void 0:i.placeholderData)?(F=o.data,y=!0):F=typeof r.placeholderData=="function"?r.placeholderData((N=I(this,Gn))==null?void 0:N.state.data,I(this,Gn)):r.placeholderData,F!==void 0&&(v="success",m=wi(o==null?void 0:o.data,F,r),p=!0)}if(r.select&&m!==void 0&&!y)if(o&&m===(a==null?void 0:a.data)&&r.select===I(this,Qs))m=I(this,Wn);else try{ee(this,Qs,r.select),m=r.select(m),m=wi(o==null?void 0:o.data,m,r),ee(this,Wn,m),ee(this,$r,null)}catch(F){ee(this,$r,F)}I(this,$r)&&(C=I(this,$r),m=I(this,Wn),h=Date.now(),v="error");const b=f.fetchStatus==="fetching",S=v==="pending",x=v==="error",w=S&&b,T=m!==void 0,k={status:v,fetchStatus:f.fetchStatus,isPending:S,isSuccess:v==="success",isError:x,isInitialLoading:w,isLoading:w,data:m,dataUpdatedAt:f.dataUpdatedAt,error:C,errorUpdatedAt:h,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:b,isRefetching:b&&!S,isLoadingError:x&&!T,isPaused:f.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:x&&T,isStale:bl(t,r),refetch:this.refetch,promise:I(this,_r),isEnabled:Ut(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const F=k.data!==void 0,A=k.status==="error"&&!F,P=U=>{A?U.reject(k.error):F&&U.resolve(k.data)},R=()=>{const U=ee(this,_r,k.promise=Ti());P(U)},O=I(this,_r);switch(O.status){case"pending":t.queryHash===n.queryHash&&P(O);break;case"fulfilled":(A||k.data!==O.value)&&R();break;case"rejected":(!A||k.error!==O.reason)&&R();break}}return k}updateResult(){const t=I(this,jt),r=this.createResult(I(this,De),this.options);if(ee(this,un,I(this,De).state),ee(this,Qn,this.options),I(this,un).data!==void 0&&ee(this,Gn,I(this,De)),xi(r,t))return;ee(this,jt,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,o=typeof s=="function"?s():s;if(o==="all"||!o&&!I(this,Kn).size)return!0;const a=new Set(o??I(this,Kn));return this.options.throwOnError&&a.add("error"),Object.keys(I(this,jt)).some(i=>{const c=i;return I(this,jt)[c]!==t[c]&&a.has(c)})};Le(this,Be,of).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Le(this,Be,Li).call(this)}},Pt=new WeakMap,De=new WeakMap,Hs=new WeakMap,jt=new WeakMap,un=new WeakMap,Qn=new WeakMap,_r=new WeakMap,$r=new WeakMap,Qs=new WeakMap,Wn=new WeakMap,Gn=new WeakMap,dn=new WeakMap,fn=new WeakMap,Ur=new WeakMap,Kn=new WeakMap,Be=new WeakSet,Ts=function(t){Le(this,Be,Ni).call(this);let r=I(this,De).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Rt)),r},Ai=function(){Le(this,Be,Di).call(this);const t=Qr(this.options.staleTime,I(this,De));if(Ps.isServer()||I(this,jt).isStale||!Ci(t))return;const n=Zd(I(this,jt).dataUpdatedAt,t)+1;ee(this,dn,en.setTimeout(()=>{I(this,jt).isStale||this.updateResult()},n))},ki=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(I(this,De)):this.options.refetchInterval)??!1},Ii=function(t){Le(this,Be,ji).call(this),ee(this,Ur,t),!(Ps.isServer()||Ut(this.options.enabled,I(this,De))===!1||!Ci(I(this,Ur))||I(this,Ur)===0)&&ee(this,fn,en.setInterval(()=>{(this.options.refetchIntervalInBackground||vl.isFocused())&&Le(this,Be,Ts).call(this)},I(this,Ur)))},Li=function(){Le(this,Be,Ai).call(this),Le(this,Be,Ii).call(this,Le(this,Be,ki).call(this))},Di=function(){I(this,dn)!==void 0&&(en.clearTimeout(I(this,dn)),ee(this,dn,void 0))},ji=function(){I(this,fn)!==void 0&&(en.clearInterval(I(this,fn)),ee(this,fn,void 0))},Ni=function(){const t=I(this,Pt).getQueryCache().build(I(this,Pt),this.options);if(t===I(this,De))return;const r=I(this,De);ee(this,De,t),ee(this,Hs,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},of=function(t){bt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(I(this,jt))}),I(this,Pt).getQueryCache().notify({query:I(this,De),type:"observerResultsUpdated"})})},Qd);function Mm(e,t){return Ut(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Ut(t.retryOnMount,e)===!1)}function fc(e,t){return Mm(e,t)||e.state.data!==void 0&&Oi(e,t,t.refetchOnMount)}function Oi(e,t,r){if(Ut(t.enabled,e)!==!1&&Qr(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&bl(e,t)}return!1}function hc(e,t,r,n){return(e!==t||Ut(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&bl(e,r)}function bl(e,t){return Ut(t.enabled,e)!==!1&&e.isStaleByTime(Qr(t.staleTime,e))}function Bm(e,t){return!xi(e.getCurrentResult(),t)}var Ws,gr,At,hn,vr,Or,Wd,qm=(Wd=class extends rf{constructor(t){super();Ce(this,vr);Ce(this,Ws);Ce(this,gr);Ce(this,At);Ce(this,hn);ee(this,Ws,t.client),this.mutationId=t.mutationId,ee(this,At,t.mutationCache),ee(this,gr,[]),this.state=t.state||$m(),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,gr).includes(t)||(I(this,gr).push(t),this.clearGcTimeout(),I(this,At).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ee(this,gr,I(this,gr).filter(r=>r!==t)),this.scheduleGc(),I(this,At).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){I(this,gr).length||(this.state.status==="pending"?this.scheduleGc():I(this,At).remove(this))}continue(){var t;return((t=I(this,hn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var a,i,c,u,d,f,p,m,C,h,v,y,b,S,x,w,T,D;const r=()=>{Le(this,vr,Or).call(this,{type:"continue"})},n={client:I(this,Ws),meta:this.options.meta,mutationKey:this.options.mutationKey};ee(this,hn,tf({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(k,N)=>{Le(this,vr,Or).call(this,{type:"failed",failureCount:k,error:N})},onPause:()=>{Le(this,vr,Or).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>I(this,At).canRun(this)}));const s=this.state.status==="pending",o=!I(this,hn).canStart();try{if(s)r();else{Le(this,vr,Or).call(this,{type:"pending",variables:t,isPaused:o}),I(this,At).config.onMutate&&await I(this,At).config.onMutate(t,this,n);const N=await((i=(a=this.options).onMutate)==null?void 0:i.call(a,t,n));N!==this.state.context&&Le(this,vr,Or).call(this,{type:"pending",context:N,variables:t,isPaused:o})}const k=await I(this,hn).start();return await((u=(c=I(this,At).config).onSuccess)==null?void 0:u.call(c,k,t,this.state.context,this,n)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,k,t,this.state.context,n)),await((m=(p=I(this,At).config).onSettled)==null?void 0:m.call(p,k,null,this.state.variables,this.state.context,this,n)),await((h=(C=this.options).onSettled)==null?void 0:h.call(C,k,null,t,this.state.context,n)),Le(this,vr,Or).call(this,{type:"success",data:k}),k}catch(k){try{await((y=(v=I(this,At).config).onError)==null?void 0:y.call(v,k,t,this.state.context,this,n))}catch(N){Promise.reject(N)}try{await((S=(b=this.options).onError)==null?void 0:S.call(b,k,t,this.state.context,n))}catch(N){Promise.reject(N)}try{await((w=(x=I(this,At).config).onSettled)==null?void 0:w.call(x,void 0,k,this.state.variables,this.state.context,this,n))}catch(N){Promise.reject(N)}try{await((D=(T=this.options).onSettled)==null?void 0:D.call(T,void 0,k,t,this.state.context,n))}catch(N){Promise.reject(N)}throw Le(this,vr,Or).call(this,{type:"error",error:k}),k}finally{I(this,At).runNext(this)}}},Ws=new WeakMap,gr=new WeakMap,At=new WeakMap,hn=new WeakMap,vr=new WeakSet,Or=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),bt.batch(()=>{I(this,gr).forEach(n=>{n.onMutationUpdate(t)}),I(this,At).notify({mutation:this,type:"updated",action:t})})},Wd);function $m(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var wr,sr,Gs,Gd,Um=(Gd=class extends Ks{constructor(t={}){super();Ce(this,wr);Ce(this,sr);Ce(this,Gs);this.config=t,ee(this,wr,new Set),ee(this,sr,new Map),ee(this,Gs,0)}build(t,r,n){const s=new qm({client:t,mutationCache:this,mutationId:++po(this,Gs)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){I(this,wr).add(t);const r=mo(t);if(typeof r=="string"){const n=I(this,sr).get(r);n?n.push(t):I(this,sr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(I(this,wr).delete(t)){const r=mo(t);if(typeof r=="string"){const n=I(this,sr).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&I(this,sr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=mo(t);if(typeof r=="string"){const n=I(this,sr).get(r),s=n==null?void 0:n.find(o=>o.state.status==="pending");return!s||s===t}else return!0}runNext(t){var n;const r=mo(t);if(typeof r=="string"){const s=(n=I(this,sr).get(r))==null?void 0:n.find(o=>o!==t&&o.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){bt.batch(()=>{I(this,wr).forEach(t=>{this.notify({type:"removed",mutation:t})}),I(this,wr).clear(),I(this,sr).clear()})}getAll(){return Array.from(I(this,wr))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>ac(r,n))}findAll(t={}){return this.getAll().filter(r=>ac(t,r))}notify(t){bt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return bt.batch(()=>Promise.all(t.map(r=>r.continue().catch(Rt))))}},wr=new WeakMap,sr=new WeakMap,Gs=new WeakMap,Gd);function mo(e){var t;return(t=e.options.scope)==null?void 0:t.id}var yr,Kd,zm=(Kd=class extends Ks{constructor(t={}){super();Ce(this,yr);this.config=t,ee(this,yr,new Map)}build(t,r,n){const s=r.queryKey,o=r.queryHash??yl(s,r);let a=this.get(o);return a||(a=new Rm({client:t,queryKey:s,queryHash:o,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(a)),a}add(t){I(this,yr).has(t.queryHash)||(I(this,yr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=I(this,yr).get(t.queryHash);r&&(t.destroy(),r===t&&I(this,yr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){bt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return I(this,yr).get(t)}getAll(){return[...I(this,yr).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>oc(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>oc(t,n)):r}notify(t){bt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){bt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){bt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},yr=new WeakMap,Kd),Je,zr,Vr,Yn,Zn,Hr,Xn,Jn,Yd,Vm=(Yd=class{constructor(e={}){Ce(this,Je);Ce(this,zr);Ce(this,Vr);Ce(this,Yn);Ce(this,Zn);Ce(this,Hr);Ce(this,Xn);Ce(this,Jn);ee(this,Je,e.queryCache||new zm),ee(this,zr,e.mutationCache||new Um),ee(this,Vr,e.defaultOptions||{}),ee(this,Yn,new Map),ee(this,Zn,new Map),ee(this,Hr,0)}mount(){po(this,Hr)._++,I(this,Hr)===1&&(ee(this,Xn,vl.subscribe(async e=>{e&&(await this.resumePausedMutations(),I(this,Je).onFocus())})),ee(this,Jn,Qo.subscribe(async e=>{e&&(await this.resumePausedMutations(),I(this,Je).onOnline())})))}unmount(){var e,t;po(this,Hr)._--,I(this,Hr)===0&&((e=I(this,Xn))==null||e.call(this),ee(this,Xn,void 0),(t=I(this,Jn))==null||t.call(this),ee(this,Jn,void 0))}isFetching(e){return I(this,Je).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return I(this,zr).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=I(this,Je).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=I(this,Je).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Qr(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return I(this,Je).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),s=I(this,Je).get(n.queryHash),o=s==null?void 0:s.state.data,a=wm(t,o);if(a!==void 0)return I(this,Je).build(this,n).setData(a,{...r,manual:!0})}setQueriesData(e,t,r){return bt.batch(()=>I(this,Je).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,Je).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=I(this,Je);bt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=I(this,Je);return bt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=bt.batch(()=>I(this,Je).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(Rt).catch(Rt)}invalidateQueries(e,t={}){return bt.batch(()=>(I(this,Je).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=bt.batch(()=>I(this,Je).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,r);return r.throwOnError||(o=o.catch(Rt)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(n).then(Rt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=I(this,Je).build(this,t);return r.isStaleByTime(Qr(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Rt).catch(Rt)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Rt).catch(Rt)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Qo.isOnline()?I(this,zr).resumePausedMutations():Promise.resolve()}getQueryCache(){return I(this,Je)}getMutationCache(){return I(this,zr)}getDefaultOptions(){return I(this,Vr)}setDefaultOptions(e){ee(this,Vr,e)}setQueryDefaults(e,t){I(this,Yn).set(Ns(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...I(this,Yn).values()],r={};return t.forEach(n=>{Os(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){I(this,Zn).set(Ns(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...I(this,Zn).values()],r={};return t.forEach(n=>{Os(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...I(this,Vr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=yl(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===Ho&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...I(this,Vr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){I(this,Je).clear(),I(this,zr).clear()}},Je=new WeakMap,zr=new WeakMap,Vr=new WeakMap,Yn=new WeakMap,Zn=new WeakMap,Hr=new WeakMap,Xn=new WeakMap,Jn=new WeakMap,Yd),af=Me.createContext(void 0),Hm=e=>{const t=Me.useContext(af);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Qm=({client:e,children:t})=>(Me.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(af.Provider,{value:e,children:t})),lf=Me.createContext(!1),Wm=()=>Me.useContext(lf);lf.Provider;function Gm(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Km=Me.createContext(Gm()),Ym=()=>Me.useContext(Km),Zm=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?Jd(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},Xm=e=>{Me.useEffect(()=>{e.clearReset()},[e])},Jm=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||Jd(r,[e.error,n])),eg=e=>{if(e.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...s)=>r(n(...s)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},tg=(e,t)=>e.isLoading&&e.isFetching&&!t,rg=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,pc=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function ng(e,t,r){var m,C,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=Wm(),s=Ym(),o=Hm(),a=o.defaultQueryOptions(e);(C=(m=o.getDefaultOptions().queries)==null?void 0:m._experimental_beforeQuery)==null||C.call(m,a);const i=o.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,eg(a),Zm(a,s,i),Xm(s);const u=!o.getQueryCache().get(a.queryHash),[d]=Me.useState(()=>new t(o,a)),f=d.getOptimisticResult(a),p=!n&&c;if(Me.useSyncExternalStore(Me.useCallback(y=>{const b=p?d.subscribe(bt.batchCalls(y)):Rt;return d.updateResult(),b},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),Me.useEffect(()=>{d.setOptions(a)},[a,d]),rg(a,f))throw pc(a,d,s);if(Jm({result:f,errorResetBoundary:s,throwOnError:a.throwOnError,query:i,suspense:a.suspense}))throw f.error;if((v=(h=o.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||v.call(h,a,f),a.experimental_prefetchInRender&&!Ps.isServer()&&tg(f,n)){const y=u?pc(a,d,s):i==null?void 0:i.promise;y==null||y.catch(Rt).finally(()=>{d.updateResult()})}return a.notifyOnChangeProps?f:d.trackResult(f)}function es(e,t){return ng(e,Fm)}let sg={data:""},og=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||sg},ag=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,ig=/\/\*[^]*?\*\/| +/g,mc=/\n+/g,Mr=(e,t)=>{let r="",n="",s="";for(let o in e){let a=e[o];o[0]=="@"?o[1]=="i"?r=o+" "+a+";":n+=o[1]=="f"?Mr(a,o):o+"{"+Mr(a,o[1]=="k"?"":t)+"}":typeof a=="object"?n+=Mr(a,t?t.replace(/([^,])+/g,i=>o.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,i):i?i+" "+c:c)):o):a!=null&&(o=o[1]=="-"?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),s+=Mr.p?Mr.p(o,a):o+":"+a+";")}return r+(t&&s?t+"{"+s+"}":s)+n},Dr={},cf=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+cf(e[r]);return t}return e},lg=(e,t,r,n,s)=>{let o=cf(e),a=Dr[o]||(Dr[o]=(c=>{let u=0,d=11;for(;u<c.length;)d=101*d+c.charCodeAt(u++)>>>0;return"go"+d})(o));if(!Dr[a]){let c=o!==e?e:(u=>{let d,f,p=[{}];for(;d=ag.exec(u.replace(ig,""));)d[4]?p.shift():d[3]?(f=d[3].replace(mc," ").trim(),p.unshift(p[0][f]=p[0][f]||{})):p[0][d[1]]=d[2].replace(mc," ").trim();return p[0]})(e);Dr[a]=Mr(s?{["@keyframes "+a]:c}:c,r?"":"."+a)}let i=r&&Dr.g;return r&&(Dr.g=Dr[a]),((c,u,d,f)=>{f?u.data=u.data.replace(f,c):u.data.indexOf(c)===-1&&(u.data=d?c+u.data:u.data+c)})(Dr[a],t,n,i),a},cg=(e,t,r)=>e.reduce((n,s,o)=>{let a=t[o];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?"":Mr(i,""):i===!1?"":i}return n+s+(a??"")},"");function ua(e){let t=this||{},r=e.call?e(t.p):e;return lg(r.unshift?r.raw?cg(r,[].slice.call(arguments,1),t.p):r.reduce((n,s)=>Object.assign(n,s&&s.call?s(t.p):s),{}):r,og(t.target),t.g,t.o,t.k)}let uf,Pi,Ri;ua.bind({g:1});let Er=ua.bind({k:1});function ug(e,t,r,n){Mr.p=t,uf=e,Pi=r,Ri=n}function Wr(e,t){let r=this||{};return function(){let n=arguments;function s(o,a){let i=Object.assign({},o),c=i.className||s.className;r.p=Object.assign({theme:Pi&&Pi()},i),r.o=/go\d/.test(c),i.className=ua.apply(r,n)+(c?" "+c:"");let u=e;return e[0]&&(u=i.as||e,delete i.as),Ri&&u[0]&&Ri(i),uf(u,i)}return s}}var dg=e=>typeof e=="function",Wo=(e,t)=>dg(e)?e(t):e,fg=(()=>{let e=0;return()=>(++e).toString()})(),df=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),hg=20,Cl="default",ff=(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 ff(e,{type:e.toasts.find(a=>a.id===n.id)?1:0,toast:n});case 3:let{toastId:s}=t;return{...e,toasts:e.toasts.map(a=>a.id===s||s===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 o=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(a=>({...a,pauseDuration:a.pauseDuration+o}))}}},Io=[],hf={toasts:[],pausedAt:void 0,settings:{toastLimit:hg}},br={},pf=(e,t=Cl)=>{br[t]=ff(br[t]||hf,e),Io.forEach(([r,n])=>{r===t&&n(br[t])})},mf=e=>Object.keys(br).forEach(t=>pf(e,t)),pg=e=>Object.keys(br).find(t=>br[t].toasts.some(r=>r.id===e)),da=(e=Cl)=>t=>{pf(t,e)},mg={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},gg=(e={},t=Cl)=>{let[r,n]=g.useState(br[t]||hf),s=g.useRef(br[t]);g.useEffect(()=>(s.current!==br[t]&&n(br[t]),Io.push([t,n]),()=>{let a=Io.findIndex(([i])=>i===t);a>-1&&Io.splice(a,1)}),[t]);let o=r.toasts.map(a=>{var i,c,u;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)||mg[a.type],style:{...e.style,...(u=e[a.type])==null?void 0:u.style,...a.style}}});return{...r,toasts:o}},vg=(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)||fg()}),Ys=e=>(t,r)=>{let n=vg(t,e,r);return da(n.toasterId||pg(n.id))({type:2,toast:n}),n.id},ct=(e,t)=>Ys("blank")(e,t);ct.error=Ys("error");ct.success=Ys("success");ct.loading=Ys("loading");ct.custom=Ys("custom");ct.dismiss=(e,t)=>{let r={type:3,toastId:e};t?da(t)(r):mf(r)};ct.dismissAll=e=>ct.dismiss(void 0,e);ct.remove=(e,t)=>{let r={type:4,toastId:e};t?da(t)(r):mf(r)};ct.removeAll=e=>ct.remove(void 0,e);ct.promise=(e,t,r)=>{let n=ct.loading(t.loading,{...r,...r==null?void 0:r.loading});return typeof e=="function"&&(e=e()),e.then(s=>{let o=t.success?Wo(t.success,s):void 0;return o?ct.success(o,{id:n,...r,...r==null?void 0:r.success}):ct.dismiss(n),s}).catch(s=>{let o=t.error?Wo(t.error,s):void 0;o?ct.error(o,{id:n,...r,...r==null?void 0:r.error}):ct.dismiss(n)}),e};var yg=1e3,bg=(e,t="default")=>{let{toasts:r,pausedAt:n}=gg(e,t),s=g.useRef(new Map).current,o=g.useCallback((f,p=yg)=>{if(s.has(f))return;let m=setTimeout(()=>{s.delete(f),a({type:4,toastId:f})},p);s.set(f,m)},[]);g.useEffect(()=>{if(n)return;let f=Date.now(),p=r.map(m=>{if(m.duration===1/0)return;let C=(m.duration||0)+m.pauseDuration-(f-m.createdAt);if(C<0){m.visible&&ct.dismiss(m.id);return}return setTimeout(()=>ct.dismiss(m.id,t),C)});return()=>{p.forEach(m=>m&&clearTimeout(m))}},[r,n,t]);let a=g.useCallback(da(t),[t]),i=g.useCallback(()=>{a({type:5,time:Date.now()})},[a]),c=g.useCallback((f,p)=>{a({type:1,toast:{id:f,height:p}})},[a]),u=g.useCallback(()=>{n&&a({type:6,time:Date.now()})},[n,a]),d=g.useCallback((f,p)=>{let{reverseOrder:m=!1,gutter:C=8,defaultPosition:h}=p||{},v=r.filter(S=>(S.position||h)===(f.position||h)&&S.height),y=v.findIndex(S=>S.id===f.id),b=v.filter((S,x)=>x<y&&S.visible).length;return v.filter(S=>S.visible).slice(...m?[b+1]:[0,b]).reduce((S,x)=>S+(x.height||0)+C,0)},[r]);return g.useEffect(()=>{r.forEach(f=>{if(f.dismissed)o(f.id,f.removeDelay);else{let p=s.get(f.id);p&&(clearTimeout(p),s.delete(f.id))}})},[r,o]),{toasts:r,handlers:{updateHeight:c,startPause:i,endPause:u,calculateOffset:d}}},Cg=Er`
|
|
2
2
|
from {
|
|
3
3
|
transform: scale(0) rotate(45deg);
|
|
4
4
|
opacity: 0;
|
|
@@ -169,16 +169,16 @@ to {
|
|
|
169
169
|
color: inherit;
|
|
170
170
|
flex: 1 1 auto;
|
|
171
171
|
white-space: pre-line;
|
|
172
|
-
`,qg=(e,t)=>{let r=e.includes("top")?1:-1,[n,s]=df()?[Rg,Fg]:[Og(r),Pg(r)];return{animation:t?`${Er(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Er(s)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},$g=Me.memo(({toast:e,position:t,style:r,children:n})=>{let s=e.height?qg(e.position||t||"top-center",e.visible):{opacity:0},o=Me.createElement(Ng,{toast:e}),
|
|
172
|
+
`,qg=(e,t)=>{let r=e.includes("top")?1:-1,[n,s]=df()?[Rg,Fg]:[Og(r),Pg(r)];return{animation:t?`${Er(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Er(s)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},$g=Me.memo(({toast:e,position:t,style:r,children:n})=>{let s=e.height?qg(e.position||t||"top-center",e.visible):{opacity:0},o=Me.createElement(Ng,{toast:e}),a=Me.createElement(Bg,{...e.ariaProps},Wo(e.message,e));return Me.createElement(Mg,{className:e.className,style:{...s,...r,...e.style}},typeof n=="function"?n({icon:o,message:a}):Me.createElement(Me.Fragment,null,o,a))});ug(Me.createElement);var Ug=({id:e,className:t,style:r,onHeightUpdate:n,children:s})=>{let o=Me.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 Me.createElement("div",{ref:o,className:t,style:r},s)},zg=(e,t)=>{let r=e.includes("top"),n=r?{top:0}:{bottom:0},s=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:df()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...s}},Vg=ua`
|
|
173
173
|
z-index: 9999;
|
|
174
174
|
> * {
|
|
175
175
|
pointer-events: auto;
|
|
176
176
|
}
|
|
177
|
-
`,go=16,Hg=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:s,toasterId:o,containerStyle:
|
|
177
|
+
`,go=16,Hg=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:s,toasterId:o,containerStyle:a,containerClassName:i})=>{let{toasts:c,handlers:u}=bg(r,o);return Me.createElement("div",{"data-rht-toaster":o||"",style:{position:"fixed",zIndex:9999,top:go,left:go,right:go,bottom:go,pointerEvents:"none",...a},className:i,onMouseEnter:u.startPause,onMouseLeave:u.endPause},c.map(d=>{let f=d.position||t,p=u.calculateOffset(d,{reverseOrder:e,gutter:n,defaultPosition:t}),m=zg(f,p);return Me.createElement(Ug,{id:d.id,key:d.id,onHeightUpdate:u.updateHeight,className:d.visible?Vg:"",style:m},d.type==="custom"?Wo(d.message,d):s?s(d):Me.createElement($g,{toast:d,position:f}))}))},me=ct;function Qg(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return g.useMemo(()=>n=>{t.forEach(s=>s(n))},t)}const fa=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function os(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Sl(e){return"nodeType"in e}function Nt(e){var t,r;return e?os(e)?e:Sl(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function xl(e){const{Document:t}=Nt(e);return e instanceof t}function Zs(e){return os(e)?!1:e instanceof Nt(e).HTMLElement}function gf(e){return e instanceof Nt(e).SVGElement}function as(e){return e?os(e)?e.document:Sl(e)?xl(e)?e:Zs(e)||gf(e)?e.ownerDocument:document:document:document}const ar=fa?g.useLayoutEffect:g.useEffect;function ha(e){const t=g.useRef(e);return ar(()=>{t.current=e}),g.useCallback(function(){for(var r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];return t.current==null?void 0:t.current(...n)},[])}function Wg(){const e=g.useRef(null),t=g.useCallback((n,s)=>{e.current=setInterval(n,s)},[]),r=g.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function Rs(e,t){t===void 0&&(t=[e]);const r=g.useRef(e);return ar(()=>{r.current!==e&&(r.current=e)},t),r}function Xs(e,t){const r=g.useRef();return g.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function Go(e){const t=ha(e),r=g.useRef(null),n=g.useCallback(s=>{s!==r.current&&(t==null||t(s,r.current)),r.current=s},[]);return[r,n]}function Ko(e){const t=g.useRef();return g.useEffect(()=>{t.current=e},[e]),t.current}let Ba={};function Js(e,t){return g.useMemo(()=>{if(t)return t;const r=Ba[e]==null?0:Ba[e]+1;return Ba[e]=r,e+"-"+r},[e,t])}function vf(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),s=1;s<r;s++)n[s-1]=arguments[s];return n.reduce((o,a)=>{const i=Object.entries(a);for(const[c,u]of i){const d=o[c];d!=null&&(o[c]=d+e*u)}return o},{...t})}}const Bn=vf(1),Fs=vf(-1);function Gg(e){return"clientX"in e&&"clientY"in e}function pa(e){if(!e)return!1;const{KeyboardEvent:t}=Nt(e.target);return t&&e instanceof t}function Kg(e){if(!e)return!1;const{TouchEvent:t}=Nt(e.target);return t&&e instanceof t}function Yo(e){if(Kg(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 Gg(e)?{x:e.clientX,y:e.clientY}:null}const Ar=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[Ar.Translate.toString(e),Ar.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),gc="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Yg(e){return e.matches(gc)?e:e.querySelector(gc)}const Zg={display:"none"};function Xg(e){let{id:t,value:r}=e;return g.createElement("div",{id:t,style:Zg},r)}function Jg(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const s={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 g.createElement("div",{id:t,style:s,role:"status","aria-live":n,"aria-atomic":!0},r)}function ev(){const[e,t]=g.useState("");return{announce:g.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const yf=g.createContext(null);function tv(e){const t=g.useContext(yf);g.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function rv(){const[e]=g.useState(()=>new Set),t=g.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[g.useCallback(n=>{let{type:s,event:o}=n;e.forEach(a=>{var i;return(i=a[s])==null?void 0:i.call(a,o)})},[e]),t]}const nv={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
|
-
`},sv={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 ov(e){let{announcements:t=sv,container:r,hiddenTextDescribedById:n,screenReaderInstructions:s=nv}=e;const{announce:o,announcement:i}=ev(),a=Js("DndLiveRegion"),[c,u]=g.useState(!1);if(g.useEffect(()=>{u(!0)},[]),tv(g.useMemo(()=>({onDragStart(f){let{active:p}=f;o(t.onDragStart({active:p}))},onDragMove(f){let{active:p,over:m}=f;t.onDragMove&&o(t.onDragMove({active:p,over:m}))},onDragOver(f){let{active:p,over:m}=f;o(t.onDragOver({active:p,over:m}))},onDragEnd(f){let{active:p,over:m}=f;o(t.onDragEnd({active:p,over:m}))},onDragCancel(f){let{active:p,over:m}=f;o(t.onDragCancel({active:p,over:m}))}}),[o,t])),!c)return null;const d=g.createElement(g.Fragment,null,g.createElement(Xg,{id:n,value:s.draggable}),g.createElement(Jg,{id:a,announcement:i}));return r?Tr.createPortal(d,r):d}var lt;(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"})(lt||(lt={}));function Zo(){}function Fa(e,t){return g.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function bf(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return g.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const ar=Object.freeze({x:0,y:0});function Cf(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function iv(e,t){const r=Yo(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 Sf(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function av(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function vc(e){let{left:t,top:r,height:n,width:s}=e;return[{x:t,y:r},{x:t+s,y:r},{x:t,y:r+n},{x:t+s,y:r+n}]}function xf(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function yc(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 bc=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const s=yc(t,t.left,t.top),o=[];for(const i of n){const{id:a}=i,c=r.get(a);if(c){const u=Cf(yc(c),s);o.push({id:a,data:{droppableContainer:i,value:u}})}}return o.sort(Sf)},lv=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const s=vc(t),o=[];for(const i of n){const{id:a}=i,c=r.get(a);if(c){const u=vc(c),d=s.reduce((p,m,C)=>p+Cf(u[C],m),0),f=Number((d/4).toFixed(4));o.push({id:a,data:{droppableContainer:i,value:f}})}}return o.sort(Sf)};function cv(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),s=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),i=s-n,a=o-r;if(n<s&&r<o){const c=t.width*t.height,u=e.width*e.height,d=i*a,f=d/(c+u-d);return Number(f.toFixed(4))}return 0}const uv=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const s=[];for(const o of n){const{id:i}=o,a=r.get(i);if(a){const c=cv(a,t);c>0&&s.push({id:i,data:{droppableContainer:o,value:c}})}}return s.sort(av)};function dv(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function _f(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ar}function fv(e){return function(r){for(var n=arguments.length,s=new Array(n>1?n-1:0),o=1;o<n;o++)s[o-1]=arguments[o];return s.reduce((i,a)=>({...i,top:i.top+e*a.y,bottom:i.bottom+e*a.y,left:i.left+e*a.x,right:i.right+e*a.x}),{...r})}}const hv=fv(1);function wf(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 pv(e,t,r){const n=wf(t);if(!n)return e;const{scaleX:s,scaleY:o,x:i,y:a}=n,c=e.left-i-(1-s)*parseFloat(r),u=e.top-a-(1-o)*parseFloat(r.slice(r.indexOf(" ")+1)),d=s?e.width/s:e.width,f=o?e.height/o:e.height;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c}}const mv={ignoreTransform:!1};function as(e,t){t===void 0&&(t=mv);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:d}=Nt(e).getComputedStyle(e);u&&(r=pv(r,u,d))}const{top:n,left:s,width:o,height:i,bottom:a,right:c}=r;return{top:n,left:s,width:o,height:i,bottom:a,right:c}}function Cc(e){return as(e,{ignoreTransform:!0})}function gv(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function vv(e,t){return t===void 0&&(t=Nt(e).getComputedStyle(e)),t.position==="fixed"}function yv(e,t){t===void 0&&(t=Nt(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const o=t[s];return typeof o=="string"?r.test(o):!1})}function mi(e,t){const r=[];function n(s){if(t!=null&&r.length>=t||!s)return r;if(xl(s)&&s.scrollingElement!=null&&!r.includes(s.scrollingElement))return r.push(s.scrollingElement),r;if(!Zs(s)||gf(s)||r.includes(s))return r;const o=Nt(e).getComputedStyle(s);return s!==e&&yv(s,o)&&r.push(s),vv(s,o)?r:n(s.parentNode)}return e?n(e):r}function Tf(e){const[t]=mi(e,1);return t??null}function qi(e){return!fi||!e?null:os(e)?e:Sl(e)?xl(e)||e===is(e).scrollingElement?window:Zs(e)?e:null:null}function Ef(e){return os(e)?e.scrollX:e.scrollLeft}function Af(e){return os(e)?e.scrollY:e.scrollTop}function Ma(e){return{x:Ef(e),y:Af(e)}}var mt;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(mt||(mt={}));function kf(e){return!fi||!e?!1:e===document.scrollingElement}function If(e){const t={x:0,y:0},r=kf(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},s=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,i=e.scrollTop>=n.y,a=e.scrollLeft>=n.x;return{isTop:s,isLeft:o,isBottom:i,isRight:a,maxScroll:n,minScroll:t}}const bv={x:.2,y:.2};function Cv(e,t,r,n,s){let{top:o,left:i,right:a,bottom:c}=r;n===void 0&&(n=10),s===void 0&&(s=bv);const{isTop:u,isBottom:d,isLeft:f,isRight:p}=If(e),m={x:0,y:0},C={x:0,y:0},h={height:t.height*s.y,width:t.width*s.x};return!u&&o<=t.top+h.height?(m.y=mt.Backward,C.y=n*Math.abs((t.top+h.height-o)/h.height)):!d&&c>=t.bottom-h.height&&(m.y=mt.Forward,C.y=n*Math.abs((t.bottom-h.height-c)/h.height)),!p&&a>=t.right-h.width?(m.x=mt.Forward,C.x=n*Math.abs((t.right-h.width-a)/h.width)):!f&&i<=t.left+h.width&&(m.x=mt.Backward,C.x=n*Math.abs((t.left+h.width-i)/h.width)),{direction:m,speed:C}}function Sv(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:i}=window;return{top:0,left:0,right:o,bottom:i,width:o,height:i}}const{top:t,left:r,right:n,bottom:s}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:s,width:e.clientWidth,height:e.clientHeight}}function Lf(e){return e.reduce((t,r)=>Mn(t,Ma(r)),ar)}function xv(e){return e.reduce((t,r)=>t+Ef(r),0)}function _v(e){return e.reduce((t,r)=>t+Af(r),0)}function Df(e,t){if(t===void 0&&(t=as),!e)return;const{top:r,left:n,bottom:s,right:o}=t(e);Tf(e)&&(s<=0||o<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const wv=[["x",["left","right"],xv],["y",["top","bottom"],_v]];class _l{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=mi(r),s=Lf(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,i,a]of wv)for(const c of i)Object.defineProperty(this,c,{get:()=>{const u=a(n),d=s[o]-u;return this.rect[c]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ks{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 s;(s=this.target)==null||s.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function Tv(e){const{EventTarget:t}=Nt(e);return e instanceof t?e:is(e)}function $i(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 Xt;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Xt||(Xt={}));function Sc(e){e.preventDefault()}function Ev(e){e.stopPropagation()}var je;(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"})(je||(je={}));const jf={start:[je.Space,je.Enter],cancel:[je.Esc],end:[je.Space,je.Enter,je.Tab]},Av=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case je.Right:return{...r,x:r.x+25};case je.Left:return{...r,x:r.x-25};case je.Down:return{...r,y:r.y+25};case je.Up:return{...r,y:r.y-25}}};class wl{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 ks(is(r)),this.windowListeners=new ks(Nt(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Xt.Resize,this.handleCancel),this.windowListeners.add(Xt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Xt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&Df(n),r(ar)}handleKeyDown(t){if(pi(t)){const{active:r,context:n,options:s}=this.props,{keyboardCodes:o=jf,coordinateGetter:i=Av,scrollBehavior:a="smooth"}=s,{code:c}=t;if(o.end.includes(c)){this.handleEnd(t);return}if(o.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:u}=n.current,d=u?{x:u.left,y:u.top}:ar;this.referenceCoordinates||(this.referenceCoordinates=d);const f=i(t,{active:r,context:n.current,currentCoordinates:d});if(f){const p=Fs(f,d),m={x:0,y:0},{scrollableAncestors:C}=n.current;for(const h of C){const v=t.code,{isTop:y,isRight:b,isLeft:S,isBottom:x,maxScroll:w,minScroll:T}=If(h),L=Sv(h),A={x:Math.min(v===je.Right?L.right-L.width/2:L.right,Math.max(v===je.Right?L.left:L.left+L.width/2,f.x)),y:Math.min(v===je.Down?L.bottom-L.height/2:L.bottom,Math.max(v===je.Down?L.top:L.top+L.height/2,f.y))},O=v===je.Right&&!b||v===je.Left&&!S,P=v===je.Down&&!x||v===je.Up&&!y;if(O&&A.x!==f.x){const j=h.scrollLeft+p.x,N=v===je.Right&&j<=w.x||v===je.Left&&j>=T.x;if(N&&!p.y){h.scrollTo({left:j,behavior:a});return}N?m.x=h.scrollLeft-j:m.x=v===je.Right?h.scrollLeft-w.x:h.scrollLeft-T.x,m.x&&h.scrollBy({left:-m.x,behavior:a});break}else if(P&&A.y!==f.y){const j=h.scrollTop+p.y,N=v===je.Down&&j<=w.y||v===je.Up&&j>=T.y;if(N&&!p.x){h.scrollTo({top:j,behavior:a});return}N?m.y=h.scrollTop-j:m.y=v===je.Down?h.scrollTop-w.y:h.scrollTop-T.y,m.y&&h.scrollBy({top:-m.y,behavior:a});break}}this.handleMove(t,Mn(Fs(f,this.referenceCoordinates),m))}}}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()}}wl.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=jf,onActivation:s}=t,{active:o}=r;const{code:i}=e.nativeEvent;if(n.start.includes(i)){const a=o.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),s==null||s({event:e.nativeEvent}),!0)}return!1}}];function xc(e){return!!(e&&"distance"in e)}function _c(e){return!!(e&&"delay"in e)}class Tl{constructor(t,r,n){var s;n===void 0&&(n=Tv(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:o}=t,{target:i}=o;this.props=t,this.events=r,this.document=is(i),this.documentListeners=new ks(this.document),this.listeners=new ks(n),this.windowListeners=new ks(Nt(i)),this.initialCoordinates=(s=Yo(o))!=null?s:ar,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(Xt.Resize,this.handleCancel),this.windowListeners.add(Xt.DragStart,Sc),this.windowListeners.add(Xt.VisibilityChange,this.handleCancel),this.windowListeners.add(Xt.ContextMenu,Sc),this.documentListeners.add(Xt.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(_c(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(xc(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:s}=this.props;s(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(Xt.Click,Ev,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Xt.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:s,props:o}=this,{onMove:i,options:{activationConstraint:a}}=o;if(!s)return;const c=(r=Yo(t))!=null?r:ar,u=Fs(s,c);if(!n&&a){if(xc(a)){if(a.tolerance!=null&&$i(u,a.tolerance))return this.handleCancel();if($i(u,a.distance))return this.handleStart()}if(_c(a)&&$i(u,a.tolerance))return this.handleCancel();this.handlePending(a,u);return}t.cancelable&&t.preventDefault(),i(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===je.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const kv={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class gi extends Tl{constructor(t){const{event:r}=t,n=is(r.target);super(t,kv,n)}}gi.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 Iv={move:{name:"mousemove"},end:{name:"mouseup"}};var Ba;(function(e){e[e.RightClick=2]="RightClick"})(Ba||(Ba={}));class Lv extends Tl{constructor(t){super(t,Iv,is(t.event.target))}}Lv.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===Ba.RightClick?!1:(n==null||n({event:r}),!0)}}];const Ui={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Dv extends Tl{constructor(t){super(t,Ui)}static setup(){return window.addEventListener(Ui.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Ui.move.name,t)};function t(){}}}Dv.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:s}=r;return s.length>1?!1:(n==null||n({event:r}),!0)}}];var Is;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Is||(Is={}));var Xo;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Xo||(Xo={}));function jv(e){let{acceleration:t,activator:r=Is.Pointer,canScroll:n,draggingRect:s,enabled:o,interval:i=5,order:a=Xo.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:d,delta:f,threshold:p}=e;const m=Ov({delta:f,disabled:!o}),[C,h]=Wg(),v=g.useRef({x:0,y:0}),y=g.useRef({x:0,y:0}),b=g.useMemo(()=>{switch(r){case Is.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Is.DraggableRect:return s}},[r,s,c]),S=g.useRef(null),x=g.useCallback(()=>{const T=S.current;if(!T)return;const L=v.current.x*y.current.x,A=v.current.y*y.current.y;T.scrollBy(L,A)},[]),w=g.useMemo(()=>a===Xo.TreeOrder?[...u].reverse():u,[a,u]);g.useEffect(()=>{if(!o||!u.length||!b){h();return}for(const T of w){if((n==null?void 0:n(T))===!1)continue;const L=u.indexOf(T),A=d[L];if(!A)continue;const{direction:O,speed:P}=Cv(T,A,b,t,p);for(const j of["x","y"])m[j][O[j]]||(P[j]=0,O[j]=0);if(P.x>0||P.y>0){h(),S.current=T,C(x,i),v.current=P,y.current=O;return}}v.current={x:0,y:0},y.current={x:0,y:0},h()},[t,x,n,h,o,i,JSON.stringify(b),JSON.stringify(m),C,u,w,d,JSON.stringify(p)])}const Nv={x:{[mt.Backward]:!1,[mt.Forward]:!1},y:{[mt.Backward]:!1,[mt.Forward]:!1}};function Ov(e){let{delta:t,disabled:r}=e;const n=Ko(t);return Xs(s=>{if(r||!n||!s)return Nv;const o={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[mt.Backward]:s.x[mt.Backward]||o.x===-1,[mt.Forward]:s.x[mt.Forward]||o.x===1},y:{[mt.Backward]:s.y[mt.Backward]||o.y===-1,[mt.Forward]:s.y[mt.Forward]||o.y===1}}},[r,t,n])}function Pv(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return Xs(s=>{var o;return t==null?null:(o=n??s)!=null?o:null},[n,t])}function Rv(e,t){return g.useMemo(()=>e.reduce((r,n)=>{const{sensor:s}=n,o=s.activators.map(i=>({eventName:i.eventName,handler:t(i.handler,n)}));return[...r,...o]},[]),[e,t])}var Ms;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Ms||(Ms={}));var qa;(function(e){e.Optimized="optimized"})(qa||(qa={}));const wc=new Map;function Fv(e,t){let{dragging:r,dependencies:n,config:s}=t;const[o,i]=g.useState(null),{frequency:a,measure:c,strategy:u}=s,d=g.useRef(e),f=v(),p=Rs(f),m=g.useCallback(function(y){y===void 0&&(y=[]),!p.current&&i(b=>b===null?y:b.concat(y.filter(S=>!b.includes(S))))},[p]),C=g.useRef(null),h=Xs(y=>{if(f&&!r)return wc;if(!y||y===wc||d.current!==e||o!=null){const b=new Map;for(let S of e){if(!S)continue;if(o&&o.length>0&&!o.includes(S.id)&&S.rect.current){b.set(S.id,S.rect.current);continue}const x=S.node.current,w=x?new _l(c(x),x):null;S.rect.current=w,w&&b.set(S.id,w)}return b}return y},[e,o,r,f,c]);return g.useEffect(()=>{d.current=e},[e]),g.useEffect(()=>{f||m()},[r,f]),g.useEffect(()=>{o&&o.length>0&&i(null)},[JSON.stringify(o)]),g.useEffect(()=>{f||typeof a!="number"||C.current!==null||(C.current=setTimeout(()=>{m(),C.current=null},a))},[a,f,m,...n]),{droppableRects:h,measureDroppableContainers:m,measuringScheduled:o!=null};function v(){switch(u){case Ms.Always:return!1;case Ms.BeforeDragging:return r;default:return!r}}}function El(e,t){return Xs(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function Mv(e,t){return El(e,t)}function Bv(e){let{callback:t,disabled:r}=e;const n=hi(t),s=g.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(n)},[n,r]);return g.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function vi(e){let{callback:t,disabled:r}=e;const n=hi(t),s=g.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(n)},[r]);return g.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function qv(e){return new _l(as(e),e)}function Tc(e,t,r){t===void 0&&(t=qv);const[n,s]=g.useState(null);function o(){s(c=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=c??r)!=null?u:null}const d=t(e);return JSON.stringify(c)===JSON.stringify(d)?c:d})}const i=Bv({callback(c){if(e)for(const u of c){const{type:d,target:f}=u;if(d==="childList"&&f instanceof HTMLElement&&f.contains(e)){o();break}}}}),a=vi({callback:o});return ir(()=>{o(),e?(a==null||a.observe(e),i==null||i.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),i==null||i.disconnect())},[e]),n}function $v(e){const t=El(e);return _f(e,t)}const Ec=[];function Uv(e){const t=g.useRef(e),r=Xs(n=>e?n&&n!==Ec&&e&&t.current&&e.parentNode===t.current.parentNode?n:mi(e):Ec,[e]);return g.useEffect(()=>{t.current=e},[e]),r}function zv(e){const[t,r]=g.useState(null),n=g.useRef(e),s=g.useCallback(o=>{const i=qi(o.target);i&&r(a=>a?(a.set(i,Ma(i)),new Map(a)):null)},[]);return g.useEffect(()=>{const o=n.current;if(e!==o){i(o);const a=e.map(c=>{const u=qi(c);return u?(u.addEventListener("scroll",s,{passive:!0}),[u,Ma(u)]):null}).filter(c=>c!=null);r(a.length?new Map(a):null),n.current=e}return()=>{i(e),i(o)};function i(a){a.forEach(c=>{const u=qi(c);u==null||u.removeEventListener("scroll",s)})}},[s,e]),g.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,i)=>Mn(o,i),ar):Lf(e):ar,[e,t])}function Ac(e,t){t===void 0&&(t=[]);const r=g.useRef(null);return g.useEffect(()=>{r.current=null},t),g.useEffect(()=>{const n=e!==ar;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?Fs(e,r.current):ar}function Vv(e){g.useEffect(()=>{if(!fi)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 Hv(e,t){return g.useMemo(()=>e.reduce((r,n)=>{let{eventName:s,handler:o}=n;return r[s]=i=>{o(i,t)},r},{}),[e,t])}function Nf(e){return g.useMemo(()=>e?gv(e):null,[e])}const kc=[];function Qv(e,t){t===void 0&&(t=as);const[r]=e,n=Nf(r?Nt(r):null),[s,o]=g.useState(kc);function i(){o(()=>e.length?e.map(c=>kf(c)?n:new _l(t(c),c)):kc)}const a=vi({callback:i});return ir(()=>{a==null||a.disconnect(),i(),e.forEach(c=>a==null?void 0:a.observe(c))},[e]),s}function Of(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Zs(t)?t:e}function Wv(e){let{measure:t}=e;const[r,n]=g.useState(null),s=g.useCallback(u=>{for(const{target:d}of u)if(Zs(d)){n(f=>{const p=t(d);return f?{...f,width:p.width,height:p.height}:p});break}},[t]),o=vi({callback:s}),i=g.useCallback(u=>{const d=Of(u);o==null||o.disconnect(),d&&(o==null||o.observe(d)),n(d?t(d):null)},[t,o]),[a,c]=Go(i);return g.useMemo(()=>({nodeRef:a,rect:r,setRef:c}),[r,a,c])}const Gv=[{sensor:gi,options:{}},{sensor:wl,options:{}}],Kv={current:{}},Lo={draggable:{measure:Cc},droppable:{measure:Cc,strategy:Ms.WhileDragging,frequency:qa.Optimized},dragOverlay:{measure:as}};class Ls 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 Yv={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Ls,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Zo},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Lo,measureDroppableContainers:Zo,windowRect:null,measuringScheduled:!1},Pf={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Zo,draggableNodes:new Map,over:null,measureDroppableContainers:Zo},eo=g.createContext(Pf),Rf=g.createContext(Yv);function Zv(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Ls}}}function Xv(e,t){switch(t.type){case lt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case lt.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 lt.DragEnd:case lt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case lt.RegisterDroppable:{const{element:r}=t,{id:n}=r,s=new Ls(e.droppable.containers);return s.set(n,r),{...e,droppable:{...e.droppable,containers:s}}}case lt.SetDroppableDisabled:{const{id:r,key:n,disabled:s}=t,o=e.droppable.containers.get(r);if(!o||n!==o.key)return e;const i=new Ls(e.droppable.containers);return i.set(r,{...o,disabled:s}),{...e,droppable:{...e.droppable,containers:i}}}case lt.UnregisterDroppable:{const{id:r,key:n}=t,s=e.droppable.containers.get(r);if(!s||n!==s.key)return e;const o=new Ls(e.droppable.containers);return o.delete(r),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function Jv(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:s}=g.useContext(eo),o=Ko(n),i=Ko(r==null?void 0:r.id);return g.useEffect(()=>{if(!t&&!n&&o&&i!=null){if(!pi(o)||document.activeElement===o.target)return;const a=s.get(i);if(!a)return;const{activatorNode:c,node:u}=a;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const d of[c.current,u.current]){if(!d)continue;const f=Yg(d);if(f){f.focus();break}}})}},[n,t,s,i,o]),null}function Ff(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((s,o)=>o({transform:s,...n}),r):r}function ey(e){return g.useMemo(()=>({draggable:{...Lo.draggable,...e==null?void 0:e.draggable},droppable:{...Lo.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Lo.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 ty(e){let{activeNode:t,measure:r,initialRect:n,config:s=!0}=e;const o=g.useRef(!1),{x:i,y:a}=typeof s=="boolean"?{x:s,y:s}:s;ir(()=>{if(!i&&!a||!t){o.current=!1;return}if(o.current||!n)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const d=r(u),f=_f(d,n);if(i||(f.x=0),a||(f.y=0),o.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const p=Tf(u);p&&p.scrollBy({top:f.y,left:f.x})}},[t,i,a,n,r])}const yi=g.createContext({...ar,scaleX:1,scaleY:1});var Rr;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Rr||(Rr={}));const $a=g.memo(function(t){var r,n,s,o;let{id:i,accessibility:a,autoScroll:c=!0,children:u,sensors:d=Gv,collisionDetection:f=uv,measuring:p,modifiers:m,...C}=t;const h=g.useReducer(Xv,void 0,Zv),[v,y]=h,[b,S]=rv(),[x,w]=g.useState(Rr.Uninitialized),T=x===Rr.Initialized,{draggable:{active:L,nodes:A,translate:O},droppable:{containers:P}}=v,j=L!=null?A.get(L):null,N=g.useRef({initial:null,translated:null}),F=g.useMemo(()=>{var ut;return L!=null?{id:L,data:(ut=j==null?void 0:j.data)!=null?ut:Kv,rect:N}:null},[L,j]),R=g.useRef(null),[U,re]=g.useState(null),[G,pe]=g.useState(null),me=Rs(C,Object.values(C)),V=Js("DndDescribedBy",i),de=g.useMemo(()=>P.getEnabled(),[P]),oe=ey(p),{droppableRects:Se,measureDroppableContainers:ve,measuringScheduled:q}=Fv(de,{dragging:T,dependencies:[O.x,O.y],config:oe.droppable}),M=Pv(A,L),$=g.useMemo(()=>G?Yo(G):null,[G]),ne=Zr(),ie=Mv(M,oe.draggable.measure);ty({activeNode:L!=null?A.get(L):null,config:ne.layoutShiftCompensation,initialRect:ie,measure:oe.draggable.measure});const xe=Tc(M,oe.draggable.measure,ie),fe=Tc(M?M.parentElement:null),ge=g.useRef({activatorEvent:null,active:null,activeNode:M,collisionRect:null,collisions:null,droppableRects:Se,draggableNodes:A,draggingNode:null,draggingNodeRect:null,droppableContainers:P,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ae=P.getNodeFor((r=ge.current.over)==null?void 0:r.id),J=Wv({measure:oe.dragOverlay.measure}),he=(n=J.nodeRef.current)!=null?n:M,Q=T?(s=J.rect)!=null?s:xe:null,Ce=!!(J.nodeRef.current&&J.rect),qe=$v(Ce?null:xe),et=Nf(he?Nt(he):null),$e=Uv(T?Ae??M:null),We=Qv($e),tt=Ff(m,{transform:{x:O.x-qe.x,y:O.y-qe.y,scaleX:1,scaleY:1},activatorEvent:G,active:F,activeNodeRect:xe,containerNodeRect:fe,draggingNodeRect:Q,over:ge.current.over,overlayNodeRect:J.rect,scrollableAncestors:$e,scrollableAncestorRects:We,windowRect:et}),Kr=$?Mn($,O):null,_n=zv($e),ds=Ac(_n),Yr=Ac(_n,[xe]),_=Mn(tt,ds),E=Q?hv(Q,tt):null,I=F&&E?f({active:F,collisionRect:E,droppableRects:Se,droppableContainers:de,pointerCoordinates:Kr}):null,z=xf(I,"id"),[H,Y]=g.useState(null),W=Ce?tt:Mn(tt,Yr),le=dv(W,(o=H==null?void 0:H.rect)!=null?o:null,xe),ce=g.useRef(null),Oe=g.useCallback((ut,St)=>{let{sensor:Dt,options:tr}=St;if(R.current==null)return;const Qt=A.get(R.current);if(!Qt)return;const Bt=ut.nativeEvent,dr=new Dt({active:R.current,activeNode:Qt,event:Bt,options:tr,context:ge,onAbort(gt){if(!A.get(gt))return;const{onDragAbort:fr}=me.current,Sr={id:gt};fr==null||fr(Sr),b({type:"onDragAbort",event:Sr})},onPending(gt,Ir,fr,Sr){if(!A.get(gt))return;const{onDragPending:ps}=me.current,Lr={id:gt,constraint:Ir,initialCoordinates:fr,offset:Sr};ps==null||ps(Lr),b({type:"onDragPending",event:Lr})},onStart(gt){const Ir=R.current;if(Ir==null)return;const fr=A.get(Ir);if(!fr)return;const{onDragStart:Sr}=me.current,hs={activatorEvent:Bt,active:{id:Ir,data:fr.data,rect:N}};Tr.unstable_batchedUpdates(()=>{Sr==null||Sr(hs),w(Rr.Initializing),y({type:lt.DragStart,initialCoordinates:gt,active:Ir}),b({type:"onDragStart",event:hs}),re(ce.current),pe(Bt)})},onMove(gt){y({type:lt.DragMove,coordinates:gt})},onEnd:wn(lt.DragEnd),onCancel:wn(lt.DragCancel)});ce.current=dr;function wn(gt){return async function(){const{active:fr,collisions:Sr,over:hs,scrollAdjustedTranslate:ps}=ge.current;let Lr=null;if(fr&&ps){const{cancelDrop:ms}=me.current;Lr={activatorEvent:Bt,active:fr,collisions:Sr,delta:ps,over:hs},gt===lt.DragEnd&&typeof ms=="function"&&await Promise.resolve(ms(Lr))&&(gt=lt.DragCancel)}R.current=null,Tr.unstable_batchedUpdates(()=>{y({type:gt}),w(Rr.Uninitialized),Y(null),re(null),pe(null),ce.current=null;const ms=gt===lt.DragEnd?"onDragEnd":"onDragCancel";if(Lr){const Fi=me.current[ms];Fi==null||Fi(Lr),b({type:ms,event:Lr})}})}}},[A]),Ke=g.useCallback((ut,St)=>(Dt,tr)=>{const Qt=Dt.nativeEvent,Bt=A.get(tr);if(R.current!==null||!Bt||Qt.dndKit||Qt.defaultPrevented)return;const dr={active:Bt};ut(Dt,St.options,dr)===!0&&(Qt.dndKit={capturedBy:St.sensor},R.current=tr,Oe(Dt,St))},[A,Oe]),it=Rv(d,Ke);Vv(d),ir(()=>{xe&&x===Rr.Initializing&&w(Rr.Initialized)},[xe,x]),g.useEffect(()=>{const{onDragMove:ut}=me.current,{active:St,activatorEvent:Dt,collisions:tr,over:Qt}=ge.current;if(!St||!Dt)return;const Bt={active:St,activatorEvent:Dt,collisions:tr,delta:{x:_.x,y:_.y},over:Qt};Tr.unstable_batchedUpdates(()=>{ut==null||ut(Bt),b({type:"onDragMove",event:Bt})})},[_.x,_.y]),g.useEffect(()=>{const{active:ut,activatorEvent:St,collisions:Dt,droppableContainers:tr,scrollAdjustedTranslate:Qt}=ge.current;if(!ut||R.current==null||!St||!Qt)return;const{onDragOver:Bt}=me.current,dr=tr.get(z),wn=dr&&dr.rect.current?{id:dr.id,rect:dr.rect.current,data:dr.data,disabled:dr.disabled}:null,gt={active:ut,activatorEvent:St,collisions:Dt,delta:{x:Qt.x,y:Qt.y},over:wn};Tr.unstable_batchedUpdates(()=>{Y(wn),Bt==null||Bt(gt),b({type:"onDragOver",event:gt})})},[z]),ir(()=>{ge.current={activatorEvent:G,active:F,activeNode:M,collisionRect:E,collisions:I,droppableRects:Se,draggableNodes:A,draggingNode:he,draggingNodeRect:Q,droppableContainers:P,over:H,scrollableAncestors:$e,scrollAdjustedTranslate:_},N.current={initial:Q,translated:E}},[F,M,I,E,A,he,Q,Se,P,H,$e,_]),jv({...ne,delta:O,draggingRect:E,pointerCoordinates:Kr,scrollableAncestors:$e,scrollableAncestorRects:We});const Ht=g.useMemo(()=>({active:F,activeNode:M,activeNodeRect:xe,activatorEvent:G,collisions:I,containerNodeRect:fe,dragOverlay:J,draggableNodes:A,droppableContainers:P,droppableRects:Se,over:H,measureDroppableContainers:ve,scrollableAncestors:$e,scrollableAncestorRects:We,measuringConfiguration:oe,measuringScheduled:q,windowRect:et}),[F,M,xe,G,I,fe,J,A,P,Se,H,ve,$e,We,oe,q,et]),fs=g.useMemo(()=>({activatorEvent:G,activators:it,active:F,activeNodeRect:xe,ariaDescribedById:{draggable:V},dispatch:y,draggableNodes:A,over:H,measureDroppableContainers:ve}),[G,it,F,xe,y,V,A,H,ve]);return g.createElement(yf.Provider,{value:S},g.createElement(eo.Provider,{value:fs},g.createElement(Rf.Provider,{value:Ht},g.createElement(yi.Provider,{value:le},u)),g.createElement(Jv,{disabled:(a==null?void 0:a.restoreFocus)===!1})),g.createElement(ov,{...a,hiddenTextDescribedById:V}));function Zr(){const ut=(U==null?void 0:U.autoScrollEnabled)===!1,St=typeof c=="object"?c.enabled===!1:c===!1,Dt=T&&!ut&&!St;return typeof c=="object"?{...c,enabled:Dt}:{enabled:Dt}}}),ry=g.createContext(null),Ic="button",ny="Draggable";function Mf(e){let{id:t,data:r,disabled:n=!1,attributes:s}=e;const o=Js(ny),{activators:i,activatorEvent:a,active:c,activeNodeRect:u,ariaDescribedById:d,draggableNodes:f,over:p}=g.useContext(eo),{role:m=Ic,roleDescription:C="draggable",tabIndex:h=0}=s??{},v=(c==null?void 0:c.id)===t,y=g.useContext(v?yi:ry),[b,S]=Go(),[x,w]=Go(),T=Hv(i,t),L=Rs(r);ir(()=>(f.set(t,{id:t,key:o,node:b,activatorNode:x,data:L}),()=>{const O=f.get(t);O&&O.key===o&&f.delete(t)}),[f,t]);const A=g.useMemo(()=>({role:m,tabIndex:h,"aria-disabled":n,"aria-pressed":v&&m===Ic?!0:void 0,"aria-roledescription":C,"aria-describedby":d.draggable}),[n,m,h,v,C,d.draggable]);return{active:c,activatorEvent:a,activeNodeRect:u,attributes:A,isDragging:v,listeners:n?void 0:T,node:b,over:p,setNodeRef:S,setActivatorNodeRef:w,transform:y}}function Bf(){return g.useContext(Rf)}const sy="Droppable",oy={timeout:25};function iy(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:s}=e;const o=Js(sy),{active:i,dispatch:a,over:c,measureDroppableContainers:u}=g.useContext(eo),d=g.useRef({disabled:r}),f=g.useRef(!1),p=g.useRef(null),m=g.useRef(null),{disabled:C,updateMeasurementsFor:h,timeout:v}={...oy,...s},y=Rs(h??n),b=g.useCallback(()=>{if(!f.current){f.current=!0;return}m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{u(Array.isArray(y.current)?y.current:[y.current]),m.current=null},v)},[v]),S=vi({callback:b,disabled:C||!i}),x=g.useCallback((A,O)=>{S&&(O&&(S.unobserve(O),f.current=!1),A&&S.observe(A))},[S]),[w,T]=Go(x),L=Rs(t);return g.useEffect(()=>{!S||!w.current||(S.disconnect(),f.current=!1,S.observe(w.current))},[w,S]),g.useEffect(()=>(a({type:lt.RegisterDroppable,element:{id:n,key:o,disabled:r,node:w,rect:p,data:L}}),()=>a({type:lt.UnregisterDroppable,key:o,id:n})),[n]),g.useEffect(()=>{r!==d.current.disabled&&(a({type:lt.SetDroppableDisabled,id:n,key:o,disabled:r}),d.current.disabled=r)},[n,o,r,a]),{active:i,rect:p,isOver:(c==null?void 0:c.id)===n,node:w,over:c,setNodeRef:T}}function ay(e){let{animation:t,children:r}=e;const[n,s]=g.useState(null),[o,i]=g.useState(null),a=Ko(r);return!r&&!n&&a&&s(a),ir(()=>{if(!o)return;const c=n==null?void 0:n.key,u=n==null?void 0:n.props.id;if(c==null||u==null){s(null);return}Promise.resolve(t(u,o)).then(()=>{s(null)})},[t,n,o]),g.createElement(g.Fragment,null,r,n?g.cloneElement(n,{ref:i}):null)}const ly={x:0,y:0,scaleX:1,scaleY:1};function cy(e){let{children:t}=e;return g.createElement(eo.Provider,{value:Pf},g.createElement(yi.Provider,{value:ly},t))}const uy={position:"fixed",touchAction:"none"},dy=e=>pi(e)?"transform 250ms ease":void 0,fy=g.forwardRef((e,t)=>{let{as:r,activatorEvent:n,adjustScale:s,children:o,className:i,rect:a,style:c,transform:u,transition:d=dy}=e;if(!a)return null;const f=s?u:{...u,scaleX:1,scaleY:1},p={...uy,width:a.width,height:a.height,top:a.top,left:a.left,transform:Ar.Transform.toString(f),transformOrigin:s&&n?iv(n,a):void 0,transition:typeof d=="function"?d(n):d,...c};return g.createElement(r,{className:i,style:p,ref:t},o)}),hy=e=>t=>{let{active:r,dragOverlay:n}=t;const s={},{styles:o,className:i}=e;if(o!=null&&o.active)for(const[a,c]of Object.entries(o.active))c!==void 0&&(s[a]=r.node.style.getPropertyValue(a),r.node.style.setProperty(a,c));if(o!=null&&o.dragOverlay)for(const[a,c]of Object.entries(o.dragOverlay))c!==void 0&&n.node.style.setProperty(a,c);return i!=null&&i.active&&r.node.classList.add(i.active),i!=null&&i.dragOverlay&&n.node.classList.add(i.dragOverlay),function(){for(const[c,u]of Object.entries(s))r.node.style.setProperty(c,u);i!=null&&i.active&&r.node.classList.remove(i.active)}},py=e=>{let{transform:{initial:t,final:r}}=e;return[{transform:Ar.Transform.toString(t)},{transform:Ar.Transform.toString(r)}]},my={duration:250,easing:"ease",keyframes:py,sideEffects:hy({styles:{active:{opacity:"0"}}})};function gy(e){let{config:t,draggableNodes:r,droppableContainers:n,measuringConfiguration:s}=e;return hi((o,i)=>{if(t===null)return;const a=r.get(o);if(!a)return;const c=a.node.current;if(!c)return;const u=Of(i);if(!u)return;const{transform:d}=Nt(i).getComputedStyle(i),f=wf(d);if(!f)return;const p=typeof t=="function"?t:vy(t);return Df(c,s.draggable.measure),p({active:{id:o,data:a.data,node:c,rect:s.draggable.measure(c)},draggableNodes:r,dragOverlay:{node:i,rect:s.dragOverlay.measure(u)},droppableContainers:n,measuringConfiguration:s,transform:f})})}function vy(e){const{duration:t,easing:r,sideEffects:n,keyframes:s}={...my,...e};return o=>{let{active:i,dragOverlay:a,transform:c,...u}=o;if(!t)return;const d={x:a.rect.left-i.rect.left,y:a.rect.top-i.rect.top},f={scaleX:c.scaleX!==1?i.rect.width*c.scaleX/a.rect.width:1,scaleY:c.scaleY!==1?i.rect.height*c.scaleY/a.rect.height:1},p={x:c.x-d.x,y:c.y-d.y,...f},m=s({...u,active:i,dragOverlay:a,transform:{initial:c,final:p}}),[C]=m,h=m[m.length-1];if(JSON.stringify(C)===JSON.stringify(h))return;const v=n==null?void 0:n({active:i,dragOverlay:a,...u}),y=a.node.animate(m,{duration:t,easing:r,fill:"forwards"});return new Promise(b=>{y.onfinish=()=>{v==null||v(),b()}})}}let Lc=0;function yy(e){return g.useMemo(()=>{if(e!=null)return Lc++,Lc},[e])}const by=g.memo(e=>{let{adjustScale:t=!1,children:r,dropAnimation:n,style:s,transition:o,modifiers:i,wrapperElement:a="div",className:c,zIndex:u=999}=e;const{activatorEvent:d,active:f,activeNodeRect:p,containerNodeRect:m,draggableNodes:C,droppableContainers:h,dragOverlay:v,over:y,measuringConfiguration:b,scrollableAncestors:S,scrollableAncestorRects:x,windowRect:w}=Bf(),T=g.useContext(yi),L=yy(f==null?void 0:f.id),A=Ff(i,{activatorEvent:d,active:f,activeNodeRect:p,containerNodeRect:m,draggingNodeRect:v.rect,over:y,overlayNodeRect:v.rect,scrollableAncestors:S,scrollableAncestorRects:x,transform:T,windowRect:w}),O=El(p),P=gy({config:n,draggableNodes:C,droppableContainers:h,measuringConfiguration:b}),j=O?v.setRef:void 0;return g.createElement(cy,null,g.createElement(ay,{animation:P},f&&L?g.createElement(fy,{key:L,id:f.id,ref:j,as:a,activatorEvent:d,adjustScale:t,className:c,transition:o,rect:O,style:{zIndex:u,...s},transform:A},r):null))});/**
|
|
181
|
+
`},sv={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 ov(e){let{announcements:t=sv,container:r,hiddenTextDescribedById:n,screenReaderInstructions:s=nv}=e;const{announce:o,announcement:a}=ev(),i=Js("DndLiveRegion"),[c,u]=g.useState(!1);if(g.useEffect(()=>{u(!0)},[]),tv(g.useMemo(()=>({onDragStart(f){let{active:p}=f;o(t.onDragStart({active:p}))},onDragMove(f){let{active:p,over:m}=f;t.onDragMove&&o(t.onDragMove({active:p,over:m}))},onDragOver(f){let{active:p,over:m}=f;o(t.onDragOver({active:p,over:m}))},onDragEnd(f){let{active:p,over:m}=f;o(t.onDragEnd({active:p,over:m}))},onDragCancel(f){let{active:p,over:m}=f;o(t.onDragCancel({active:p,over:m}))}}),[o,t])),!c)return null;const d=g.createElement(g.Fragment,null,g.createElement(Xg,{id:n,value:s.draggable}),g.createElement(Jg,{id:i,announcement:a}));return r?Tr.createPortal(d,r):d}var lt;(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"})(lt||(lt={}));function Zo(){}function Fi(e,t){return g.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function bf(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return g.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const ir=Object.freeze({x:0,y:0});function Cf(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function av(e,t){const r=Yo(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 Sf(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function iv(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function vc(e){let{left:t,top:r,height:n,width:s}=e;return[{x:t,y:r},{x:t+s,y:r},{x:t,y:r+n},{x:t+s,y:r+n}]}function xf(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function yc(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 bc=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const s=yc(t,t.left,t.top),o=[];for(const a of n){const{id:i}=a,c=r.get(i);if(c){const u=Cf(yc(c),s);o.push({id:i,data:{droppableContainer:a,value:u}})}}return o.sort(Sf)},lv=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const s=vc(t),o=[];for(const a of n){const{id:i}=a,c=r.get(i);if(c){const u=vc(c),d=s.reduce((p,m,C)=>p+Cf(u[C],m),0),f=Number((d/4).toFixed(4));o.push({id:i,data:{droppableContainer:a,value:f}})}}return o.sort(Sf)};function cv(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),s=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),a=s-n,i=o-r;if(n<s&&r<o){const c=t.width*t.height,u=e.width*e.height,d=a*i,f=d/(c+u-d);return Number(f.toFixed(4))}return 0}const uv=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const s=[];for(const o of n){const{id:a}=o,i=r.get(a);if(i){const c=cv(i,t);c>0&&s.push({id:a,data:{droppableContainer:o,value:c}})}}return s.sort(iv)};function dv(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function _f(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ir}function fv(e){return function(r){for(var n=arguments.length,s=new Array(n>1?n-1:0),o=1;o<n;o++)s[o-1]=arguments[o];return s.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 hv=fv(1);function wf(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 pv(e,t,r){const n=wf(t);if(!n)return e;const{scaleX:s,scaleY:o,x:a,y:i}=n,c=e.left-a-(1-s)*parseFloat(r),u=e.top-i-(1-o)*parseFloat(r.slice(r.indexOf(" ")+1)),d=s?e.width/s:e.width,f=o?e.height/o:e.height;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c}}const mv={ignoreTransform:!1};function is(e,t){t===void 0&&(t=mv);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:d}=Nt(e).getComputedStyle(e);u&&(r=pv(r,u,d))}const{top:n,left:s,width:o,height:a,bottom:i,right:c}=r;return{top:n,left:s,width:o,height:a,bottom:i,right:c}}function Cc(e){return is(e,{ignoreTransform:!0})}function gv(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function vv(e,t){return t===void 0&&(t=Nt(e).getComputedStyle(e)),t.position==="fixed"}function yv(e,t){t===void 0&&(t=Nt(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const o=t[s];return typeof o=="string"?r.test(o):!1})}function ma(e,t){const r=[];function n(s){if(t!=null&&r.length>=t||!s)return r;if(xl(s)&&s.scrollingElement!=null&&!r.includes(s.scrollingElement))return r.push(s.scrollingElement),r;if(!Zs(s)||gf(s)||r.includes(s))return r;const o=Nt(e).getComputedStyle(s);return s!==e&&yv(s,o)&&r.push(s),vv(s,o)?r:n(s.parentNode)}return e?n(e):r}function Tf(e){const[t]=ma(e,1);return t??null}function qa(e){return!fa||!e?null:os(e)?e:Sl(e)?xl(e)||e===as(e).scrollingElement?window:Zs(e)?e:null:null}function Ef(e){return os(e)?e.scrollX:e.scrollLeft}function Af(e){return os(e)?e.scrollY:e.scrollTop}function Mi(e){return{x:Ef(e),y:Af(e)}}var mt;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(mt||(mt={}));function kf(e){return!fa||!e?!1:e===document.scrollingElement}function If(e){const t={x:0,y:0},r=kf(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},s=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,a=e.scrollTop>=n.y,i=e.scrollLeft>=n.x;return{isTop:s,isLeft:o,isBottom:a,isRight:i,maxScroll:n,minScroll:t}}const bv={x:.2,y:.2};function Cv(e,t,r,n,s){let{top:o,left:a,right:i,bottom:c}=r;n===void 0&&(n=10),s===void 0&&(s=bv);const{isTop:u,isBottom:d,isLeft:f,isRight:p}=If(e),m={x:0,y:0},C={x:0,y:0},h={height:t.height*s.y,width:t.width*s.x};return!u&&o<=t.top+h.height?(m.y=mt.Backward,C.y=n*Math.abs((t.top+h.height-o)/h.height)):!d&&c>=t.bottom-h.height&&(m.y=mt.Forward,C.y=n*Math.abs((t.bottom-h.height-c)/h.height)),!p&&i>=t.right-h.width?(m.x=mt.Forward,C.x=n*Math.abs((t.right-h.width-i)/h.width)):!f&&a<=t.left+h.width&&(m.x=mt.Backward,C.x=n*Math.abs((t.left+h.width-a)/h.width)),{direction:m,speed:C}}function Sv(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:a}=window;return{top:0,left:0,right:o,bottom:a,width:o,height:a}}const{top:t,left:r,right:n,bottom:s}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:s,width:e.clientWidth,height:e.clientHeight}}function Lf(e){return e.reduce((t,r)=>Bn(t,Mi(r)),ir)}function xv(e){return e.reduce((t,r)=>t+Ef(r),0)}function _v(e){return e.reduce((t,r)=>t+Af(r),0)}function Df(e,t){if(t===void 0&&(t=is),!e)return;const{top:r,left:n,bottom:s,right:o}=t(e);Tf(e)&&(s<=0||o<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const wv=[["x",["left","right"],xv],["y",["top","bottom"],_v]];class _l{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=ma(r),s=Lf(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,a,i]of wv)for(const c of a)Object.defineProperty(this,c,{get:()=>{const u=i(n),d=s[o]-u;return this.rect[c]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ks{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 s;(s=this.target)==null||s.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function Tv(e){const{EventTarget:t}=Nt(e);return e instanceof t?e:as(e)}function $a(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 Xt;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Xt||(Xt={}));function Sc(e){e.preventDefault()}function Ev(e){e.stopPropagation()}var je;(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"})(je||(je={}));const jf={start:[je.Space,je.Enter],cancel:[je.Esc],end:[je.Space,je.Enter,je.Tab]},Av=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case je.Right:return{...r,x:r.x+25};case je.Left:return{...r,x:r.x-25};case je.Down:return{...r,y:r.y+25};case je.Up:return{...r,y:r.y-25}}};class wl{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 ks(as(r)),this.windowListeners=new ks(Nt(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Xt.Resize,this.handleCancel),this.windowListeners.add(Xt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Xt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&Df(n),r(ir)}handleKeyDown(t){if(pa(t)){const{active:r,context:n,options:s}=this.props,{keyboardCodes:o=jf,coordinateGetter:a=Av,scrollBehavior:i="smooth"}=s,{code:c}=t;if(o.end.includes(c)){this.handleEnd(t);return}if(o.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:u}=n.current,d=u?{x:u.left,y:u.top}:ir;this.referenceCoordinates||(this.referenceCoordinates=d);const f=a(t,{active:r,context:n.current,currentCoordinates:d});if(f){const p=Fs(f,d),m={x:0,y:0},{scrollableAncestors:C}=n.current;for(const h of C){const v=t.code,{isTop:y,isRight:b,isLeft:S,isBottom:x,maxScroll:w,minScroll:T}=If(h),D=Sv(h),k={x:Math.min(v===je.Right?D.right-D.width/2:D.right,Math.max(v===je.Right?D.left:D.left+D.width/2,f.x)),y:Math.min(v===je.Down?D.bottom-D.height/2:D.bottom,Math.max(v===je.Down?D.top:D.top+D.height/2,f.y))},N=v===je.Right&&!b||v===je.Left&&!S,F=v===je.Down&&!x||v===je.Up&&!y;if(N&&k.x!==f.x){const A=h.scrollLeft+p.x,P=v===je.Right&&A<=w.x||v===je.Left&&A>=T.x;if(P&&!p.y){h.scrollTo({left:A,behavior:i});return}P?m.x=h.scrollLeft-A:m.x=v===je.Right?h.scrollLeft-w.x:h.scrollLeft-T.x,m.x&&h.scrollBy({left:-m.x,behavior:i});break}else if(F&&k.y!==f.y){const A=h.scrollTop+p.y,P=v===je.Down&&A<=w.y||v===je.Up&&A>=T.y;if(P&&!p.x){h.scrollTo({top:A,behavior:i});return}P?m.y=h.scrollTop-A:m.y=v===je.Down?h.scrollTop-w.y:h.scrollTop-T.y,m.y&&h.scrollBy({top:-m.y,behavior:i});break}}this.handleMove(t,Bn(Fs(f,this.referenceCoordinates),m))}}}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()}}wl.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=jf,onActivation:s}=t,{active:o}=r;const{code:a}=e.nativeEvent;if(n.start.includes(a)){const i=o.activatorNode.current;return i&&e.target!==i?!1:(e.preventDefault(),s==null||s({event:e.nativeEvent}),!0)}return!1}}];function xc(e){return!!(e&&"distance"in e)}function _c(e){return!!(e&&"delay"in e)}class Tl{constructor(t,r,n){var s;n===void 0&&(n=Tv(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:o}=t,{target:a}=o;this.props=t,this.events=r,this.document=as(a),this.documentListeners=new ks(this.document),this.listeners=new ks(n),this.windowListeners=new ks(Nt(a)),this.initialCoordinates=(s=Yo(o))!=null?s:ir,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(Xt.Resize,this.handleCancel),this.windowListeners.add(Xt.DragStart,Sc),this.windowListeners.add(Xt.VisibilityChange,this.handleCancel),this.windowListeners.add(Xt.ContextMenu,Sc),this.documentListeners.add(Xt.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(_c(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(xc(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:s}=this.props;s(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(Xt.Click,Ev,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Xt.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:s,props:o}=this,{onMove:a,options:{activationConstraint:i}}=o;if(!s)return;const c=(r=Yo(t))!=null?r:ir,u=Fs(s,c);if(!n&&i){if(xc(i)){if(i.tolerance!=null&&$a(u,i.tolerance))return this.handleCancel();if($a(u,i.distance))return this.handleStart()}if(_c(i)&&$a(u,i.tolerance))return this.handleCancel();this.handlePending(i,u);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===je.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const kv={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ga extends Tl{constructor(t){const{event:r}=t,n=as(r.target);super(t,kv,n)}}ga.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 Iv={move:{name:"mousemove"},end:{name:"mouseup"}};var Bi;(function(e){e[e.RightClick=2]="RightClick"})(Bi||(Bi={}));class Lv extends Tl{constructor(t){super(t,Iv,as(t.event.target))}}Lv.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===Bi.RightClick?!1:(n==null||n({event:r}),!0)}}];const Ua={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Dv extends Tl{constructor(t){super(t,Ua)}static setup(){return window.addEventListener(Ua.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Ua.move.name,t)};function t(){}}}Dv.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:s}=r;return s.length>1?!1:(n==null||n({event:r}),!0)}}];var Is;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Is||(Is={}));var Xo;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Xo||(Xo={}));function jv(e){let{acceleration:t,activator:r=Is.Pointer,canScroll:n,draggingRect:s,enabled:o,interval:a=5,order:i=Xo.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:d,delta:f,threshold:p}=e;const m=Ov({delta:f,disabled:!o}),[C,h]=Wg(),v=g.useRef({x:0,y:0}),y=g.useRef({x:0,y:0}),b=g.useMemo(()=>{switch(r){case Is.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Is.DraggableRect:return s}},[r,s,c]),S=g.useRef(null),x=g.useCallback(()=>{const T=S.current;if(!T)return;const D=v.current.x*y.current.x,k=v.current.y*y.current.y;T.scrollBy(D,k)},[]),w=g.useMemo(()=>i===Xo.TreeOrder?[...u].reverse():u,[i,u]);g.useEffect(()=>{if(!o||!u.length||!b){h();return}for(const T of w){if((n==null?void 0:n(T))===!1)continue;const D=u.indexOf(T),k=d[D];if(!k)continue;const{direction:N,speed:F}=Cv(T,k,b,t,p);for(const A of["x","y"])m[A][N[A]]||(F[A]=0,N[A]=0);if(F.x>0||F.y>0){h(),S.current=T,C(x,a),v.current=F,y.current=N;return}}v.current={x:0,y:0},y.current={x:0,y:0},h()},[t,x,n,h,o,a,JSON.stringify(b),JSON.stringify(m),C,u,w,d,JSON.stringify(p)])}const Nv={x:{[mt.Backward]:!1,[mt.Forward]:!1},y:{[mt.Backward]:!1,[mt.Forward]:!1}};function Ov(e){let{delta:t,disabled:r}=e;const n=Ko(t);return Xs(s=>{if(r||!n||!s)return Nv;const o={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[mt.Backward]:s.x[mt.Backward]||o.x===-1,[mt.Forward]:s.x[mt.Forward]||o.x===1},y:{[mt.Backward]:s.y[mt.Backward]||o.y===-1,[mt.Forward]:s.y[mt.Forward]||o.y===1}}},[r,t,n])}function Pv(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return Xs(s=>{var o;return t==null?null:(o=n??s)!=null?o:null},[n,t])}function Rv(e,t){return g.useMemo(()=>e.reduce((r,n)=>{const{sensor:s}=n,o=s.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,n)}));return[...r,...o]},[]),[e,t])}var Ms;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Ms||(Ms={}));var qi;(function(e){e.Optimized="optimized"})(qi||(qi={}));const wc=new Map;function Fv(e,t){let{dragging:r,dependencies:n,config:s}=t;const[o,a]=g.useState(null),{frequency:i,measure:c,strategy:u}=s,d=g.useRef(e),f=v(),p=Rs(f),m=g.useCallback(function(y){y===void 0&&(y=[]),!p.current&&a(b=>b===null?y:b.concat(y.filter(S=>!b.includes(S))))},[p]),C=g.useRef(null),h=Xs(y=>{if(f&&!r)return wc;if(!y||y===wc||d.current!==e||o!=null){const b=new Map;for(let S of e){if(!S)continue;if(o&&o.length>0&&!o.includes(S.id)&&S.rect.current){b.set(S.id,S.rect.current);continue}const x=S.node.current,w=x?new _l(c(x),x):null;S.rect.current=w,w&&b.set(S.id,w)}return b}return y},[e,o,r,f,c]);return g.useEffect(()=>{d.current=e},[e]),g.useEffect(()=>{f||m()},[r,f]),g.useEffect(()=>{o&&o.length>0&&a(null)},[JSON.stringify(o)]),g.useEffect(()=>{f||typeof i!="number"||C.current!==null||(C.current=setTimeout(()=>{m(),C.current=null},i))},[i,f,m,...n]),{droppableRects:h,measureDroppableContainers:m,measuringScheduled:o!=null};function v(){switch(u){case Ms.Always:return!1;case Ms.BeforeDragging:return r;default:return!r}}}function El(e,t){return Xs(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function Mv(e,t){return El(e,t)}function Bv(e){let{callback:t,disabled:r}=e;const n=ha(t),s=g.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(n)},[n,r]);return g.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function va(e){let{callback:t,disabled:r}=e;const n=ha(t),s=g.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(n)},[r]);return g.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function qv(e){return new _l(is(e),e)}function Tc(e,t,r){t===void 0&&(t=qv);const[n,s]=g.useState(null);function o(){s(c=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=c??r)!=null?u:null}const d=t(e);return JSON.stringify(c)===JSON.stringify(d)?c:d})}const a=Bv({callback(c){if(e)for(const u of c){const{type:d,target:f}=u;if(d==="childList"&&f instanceof HTMLElement&&f.contains(e)){o();break}}}}),i=va({callback:o});return ar(()=>{o(),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 $v(e){const t=El(e);return _f(e,t)}const Ec=[];function Uv(e){const t=g.useRef(e),r=Xs(n=>e?n&&n!==Ec&&e&&t.current&&e.parentNode===t.current.parentNode?n:ma(e):Ec,[e]);return g.useEffect(()=>{t.current=e},[e]),r}function zv(e){const[t,r]=g.useState(null),n=g.useRef(e),s=g.useCallback(o=>{const a=qa(o.target);a&&r(i=>i?(i.set(a,Mi(a)),new Map(i)):null)},[]);return g.useEffect(()=>{const o=n.current;if(e!==o){a(o);const i=e.map(c=>{const u=qa(c);return u?(u.addEventListener("scroll",s,{passive:!0}),[u,Mi(u)]):null}).filter(c=>c!=null);r(i.length?new Map(i):null),n.current=e}return()=>{a(e),a(o)};function a(i){i.forEach(c=>{const u=qa(c);u==null||u.removeEventListener("scroll",s)})}},[s,e]),g.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,a)=>Bn(o,a),ir):Lf(e):ir,[e,t])}function Ac(e,t){t===void 0&&(t=[]);const r=g.useRef(null);return g.useEffect(()=>{r.current=null},t),g.useEffect(()=>{const n=e!==ir;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?Fs(e,r.current):ir}function Vv(e){g.useEffect(()=>{if(!fa)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 Hv(e,t){return g.useMemo(()=>e.reduce((r,n)=>{let{eventName:s,handler:o}=n;return r[s]=a=>{o(a,t)},r},{}),[e,t])}function Nf(e){return g.useMemo(()=>e?gv(e):null,[e])}const kc=[];function Qv(e,t){t===void 0&&(t=is);const[r]=e,n=Nf(r?Nt(r):null),[s,o]=g.useState(kc);function a(){o(()=>e.length?e.map(c=>kf(c)?n:new _l(t(c),c)):kc)}const i=va({callback:a});return ar(()=>{i==null||i.disconnect(),a(),e.forEach(c=>i==null?void 0:i.observe(c))},[e]),s}function Of(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Zs(t)?t:e}function Wv(e){let{measure:t}=e;const[r,n]=g.useState(null),s=g.useCallback(u=>{for(const{target:d}of u)if(Zs(d)){n(f=>{const p=t(d);return f?{...f,width:p.width,height:p.height}:p});break}},[t]),o=va({callback:s}),a=g.useCallback(u=>{const d=Of(u);o==null||o.disconnect(),d&&(o==null||o.observe(d)),n(d?t(d):null)},[t,o]),[i,c]=Go(a);return g.useMemo(()=>({nodeRef:i,rect:r,setRef:c}),[r,i,c])}const Gv=[{sensor:ga,options:{}},{sensor:wl,options:{}}],Kv={current:{}},Lo={draggable:{measure:Cc},droppable:{measure:Cc,strategy:Ms.WhileDragging,frequency:qi.Optimized},dragOverlay:{measure:is}};class Ls 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 Yv={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Ls,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Zo},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Lo,measureDroppableContainers:Zo,windowRect:null,measuringScheduled:!1},Pf={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Zo,draggableNodes:new Map,over:null,measureDroppableContainers:Zo},eo=g.createContext(Pf),Rf=g.createContext(Yv);function Zv(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Ls}}}function Xv(e,t){switch(t.type){case lt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case lt.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 lt.DragEnd:case lt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case lt.RegisterDroppable:{const{element:r}=t,{id:n}=r,s=new Ls(e.droppable.containers);return s.set(n,r),{...e,droppable:{...e.droppable,containers:s}}}case lt.SetDroppableDisabled:{const{id:r,key:n,disabled:s}=t,o=e.droppable.containers.get(r);if(!o||n!==o.key)return e;const a=new Ls(e.droppable.containers);return a.set(r,{...o,disabled:s}),{...e,droppable:{...e.droppable,containers:a}}}case lt.UnregisterDroppable:{const{id:r,key:n}=t,s=e.droppable.containers.get(r);if(!s||n!==s.key)return e;const o=new Ls(e.droppable.containers);return o.delete(r),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function Jv(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:s}=g.useContext(eo),o=Ko(n),a=Ko(r==null?void 0:r.id);return g.useEffect(()=>{if(!t&&!n&&o&&a!=null){if(!pa(o)||document.activeElement===o.target)return;const i=s.get(a);if(!i)return;const{activatorNode:c,node:u}=i;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const d of[c.current,u.current]){if(!d)continue;const f=Yg(d);if(f){f.focus();break}}})}},[n,t,s,a,o]),null}function Ff(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((s,o)=>o({transform:s,...n}),r):r}function ey(e){return g.useMemo(()=>({draggable:{...Lo.draggable,...e==null?void 0:e.draggable},droppable:{...Lo.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Lo.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 ty(e){let{activeNode:t,measure:r,initialRect:n,config:s=!0}=e;const o=g.useRef(!1),{x:a,y:i}=typeof s=="boolean"?{x:s,y:s}:s;ar(()=>{if(!a&&!i||!t){o.current=!1;return}if(o.current||!n)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const d=r(u),f=_f(d,n);if(a||(f.x=0),i||(f.y=0),o.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const p=Tf(u);p&&p.scrollBy({top:f.y,left:f.x})}},[t,a,i,n,r])}const ya=g.createContext({...ir,scaleX:1,scaleY:1});var Rr;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Rr||(Rr={}));const $i=g.memo(function(t){var r,n,s,o;let{id:a,accessibility:i,autoScroll:c=!0,children:u,sensors:d=Gv,collisionDetection:f=uv,measuring:p,modifiers:m,...C}=t;const h=g.useReducer(Xv,void 0,Zv),[v,y]=h,[b,S]=rv(),[x,w]=g.useState(Rr.Uninitialized),T=x===Rr.Initialized,{draggable:{active:D,nodes:k,translate:N},droppable:{containers:F}}=v,A=D!=null?k.get(D):null,P=g.useRef({initial:null,translated:null}),R=g.useMemo(()=>{var ut;return D!=null?{id:D,data:(ut=A==null?void 0:A.data)!=null?ut:Kv,rect:P}:null},[D,A]),O=g.useRef(null),[U,re]=g.useState(null),[W,pe]=g.useState(null),ge=Rs(C,Object.values(C)),G=Js("DndDescribedBy",a),le=g.useMemo(()=>F.getEnabled(),[F]),te=ey(p),{droppableRects:xe,measureDroppableContainers:ve,measuringScheduled:q}=Fv(le,{dragging:T,dependencies:[N.x,N.y],config:te.droppable}),M=Pv(k,D),$=g.useMemo(()=>W?Yo(W):null,[W]),se=Zr(),ae=Mv(M,te.draggable.measure);ty({activeNode:D!=null?k.get(D):null,config:se.layoutShiftCompensation,initialRect:ae,measure:te.draggable.measure});const Se=Tc(M,te.draggable.measure,ae),fe=Tc(M?M.parentElement:null),ye=g.useRef({activatorEvent:null,active:null,activeNode:M,collisionRect:null,collisions:null,droppableRects:xe,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:F,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ae=F.getNodeFor((r=ye.current.over)==null?void 0:r.id),J=Wv({measure:te.dragOverlay.measure}),he=(n=J.nodeRef.current)!=null?n:M,H=T?(s=J.rect)!=null?s:Se:null,be=!!(J.nodeRef.current&&J.rect),qe=$v(be?null:Se),et=Nf(he?Nt(he):null),$e=Uv(T?Ae??M:null),We=Qv($e),tt=Ff(m,{transform:{x:N.x-qe.x,y:N.y-qe.y,scaleX:1,scaleY:1},activatorEvent:W,active:R,activeNodeRect:Se,containerNodeRect:fe,draggingNodeRect:H,over:ye.current.over,overlayNodeRect:J.rect,scrollableAncestors:$e,scrollableAncestorRects:We,windowRect:et}),Kr=$?Bn($,N):null,wn=zv($e),ds=Ac(wn),Yr=Ac(wn,[Se]),_=Bn(tt,ds),E=H?hv(H,tt):null,L=R&&E?f({active:R,collisionRect:E,droppableRects:xe,droppableContainers:le,pointerCoordinates:Kr}):null,z=xf(L,"id"),[V,Y]=g.useState(null),Q=be?tt:Bn(tt,Yr),ce=dv(Q,(o=V==null?void 0:V.rect)!=null?o:null,Se),ue=g.useRef(null),Oe=g.useCallback((ut,St)=>{let{sensor:Dt,options:tr}=St;if(O.current==null)return;const Qt=k.get(O.current);if(!Qt)return;const Bt=ut.nativeEvent,dr=new Dt({active:O.current,activeNode:Qt,event:Bt,options:tr,context:ye,onAbort(gt){if(!k.get(gt))return;const{onDragAbort:fr}=ge.current,Sr={id:gt};fr==null||fr(Sr),b({type:"onDragAbort",event:Sr})},onPending(gt,Ir,fr,Sr){if(!k.get(gt))return;const{onDragPending:ps}=ge.current,Lr={id:gt,constraint:Ir,initialCoordinates:fr,offset:Sr};ps==null||ps(Lr),b({type:"onDragPending",event:Lr})},onStart(gt){const Ir=O.current;if(Ir==null)return;const fr=k.get(Ir);if(!fr)return;const{onDragStart:Sr}=ge.current,hs={activatorEvent:Bt,active:{id:Ir,data:fr.data,rect:P}};Tr.unstable_batchedUpdates(()=>{Sr==null||Sr(hs),w(Rr.Initializing),y({type:lt.DragStart,initialCoordinates:gt,active:Ir}),b({type:"onDragStart",event:hs}),re(ue.current),pe(Bt)})},onMove(gt){y({type:lt.DragMove,coordinates:gt})},onEnd:Tn(lt.DragEnd),onCancel:Tn(lt.DragCancel)});ue.current=dr;function Tn(gt){return async function(){const{active:fr,collisions:Sr,over:hs,scrollAdjustedTranslate:ps}=ye.current;let Lr=null;if(fr&&ps){const{cancelDrop:ms}=ge.current;Lr={activatorEvent:Bt,active:fr,collisions:Sr,delta:ps,over:hs},gt===lt.DragEnd&&typeof ms=="function"&&await Promise.resolve(ms(Lr))&&(gt=lt.DragCancel)}O.current=null,Tr.unstable_batchedUpdates(()=>{y({type:gt}),w(Rr.Uninitialized),Y(null),re(null),pe(null),ue.current=null;const ms=gt===lt.DragEnd?"onDragEnd":"onDragCancel";if(Lr){const Fa=ge.current[ms];Fa==null||Fa(Lr),b({type:ms,event:Lr})}})}}},[k]),Ke=g.useCallback((ut,St)=>(Dt,tr)=>{const Qt=Dt.nativeEvent,Bt=k.get(tr);if(O.current!==null||!Bt||Qt.dndKit||Qt.defaultPrevented)return;const dr={active:Bt};ut(Dt,St.options,dr)===!0&&(Qt.dndKit={capturedBy:St.sensor},O.current=tr,Oe(Dt,St))},[k,Oe]),at=Rv(d,Ke);Vv(d),ar(()=>{Se&&x===Rr.Initializing&&w(Rr.Initialized)},[Se,x]),g.useEffect(()=>{const{onDragMove:ut}=ge.current,{active:St,activatorEvent:Dt,collisions:tr,over:Qt}=ye.current;if(!St||!Dt)return;const Bt={active:St,activatorEvent:Dt,collisions:tr,delta:{x:_.x,y:_.y},over:Qt};Tr.unstable_batchedUpdates(()=>{ut==null||ut(Bt),b({type:"onDragMove",event:Bt})})},[_.x,_.y]),g.useEffect(()=>{const{active:ut,activatorEvent:St,collisions:Dt,droppableContainers:tr,scrollAdjustedTranslate:Qt}=ye.current;if(!ut||O.current==null||!St||!Qt)return;const{onDragOver:Bt}=ge.current,dr=tr.get(z),Tn=dr&&dr.rect.current?{id:dr.id,rect:dr.rect.current,data:dr.data,disabled:dr.disabled}:null,gt={active:ut,activatorEvent:St,collisions:Dt,delta:{x:Qt.x,y:Qt.y},over:Tn};Tr.unstable_batchedUpdates(()=>{Y(Tn),Bt==null||Bt(gt),b({type:"onDragOver",event:gt})})},[z]),ar(()=>{ye.current={activatorEvent:W,active:R,activeNode:M,collisionRect:E,collisions:L,droppableRects:xe,draggableNodes:k,draggingNode:he,draggingNodeRect:H,droppableContainers:F,over:V,scrollableAncestors:$e,scrollAdjustedTranslate:_},P.current={initial:H,translated:E}},[R,M,L,E,k,he,H,xe,F,V,$e,_]),jv({...se,delta:N,draggingRect:E,pointerCoordinates:Kr,scrollableAncestors:$e,scrollableAncestorRects:We});const Ht=g.useMemo(()=>({active:R,activeNode:M,activeNodeRect:Se,activatorEvent:W,collisions:L,containerNodeRect:fe,dragOverlay:J,draggableNodes:k,droppableContainers:F,droppableRects:xe,over:V,measureDroppableContainers:ve,scrollableAncestors:$e,scrollableAncestorRects:We,measuringConfiguration:te,measuringScheduled:q,windowRect:et}),[R,M,Se,W,L,fe,J,k,F,xe,V,ve,$e,We,te,q,et]),fs=g.useMemo(()=>({activatorEvent:W,activators:at,active:R,activeNodeRect:Se,ariaDescribedById:{draggable:G},dispatch:y,draggableNodes:k,over:V,measureDroppableContainers:ve}),[W,at,R,Se,y,G,k,V,ve]);return g.createElement(yf.Provider,{value:S},g.createElement(eo.Provider,{value:fs},g.createElement(Rf.Provider,{value:Ht},g.createElement(ya.Provider,{value:ce},u)),g.createElement(Jv,{disabled:(i==null?void 0:i.restoreFocus)===!1})),g.createElement(ov,{...i,hiddenTextDescribedById:G}));function Zr(){const ut=(U==null?void 0:U.autoScrollEnabled)===!1,St=typeof c=="object"?c.enabled===!1:c===!1,Dt=T&&!ut&&!St;return typeof c=="object"?{...c,enabled:Dt}:{enabled:Dt}}}),ry=g.createContext(null),Ic="button",ny="Draggable";function Mf(e){let{id:t,data:r,disabled:n=!1,attributes:s}=e;const o=Js(ny),{activators:a,activatorEvent:i,active:c,activeNodeRect:u,ariaDescribedById:d,draggableNodes:f,over:p}=g.useContext(eo),{role:m=Ic,roleDescription:C="draggable",tabIndex:h=0}=s??{},v=(c==null?void 0:c.id)===t,y=g.useContext(v?ya:ry),[b,S]=Go(),[x,w]=Go(),T=Hv(a,t),D=Rs(r);ar(()=>(f.set(t,{id:t,key:o,node:b,activatorNode:x,data:D}),()=>{const N=f.get(t);N&&N.key===o&&f.delete(t)}),[f,t]);const k=g.useMemo(()=>({role:m,tabIndex:h,"aria-disabled":n,"aria-pressed":v&&m===Ic?!0:void 0,"aria-roledescription":C,"aria-describedby":d.draggable}),[n,m,h,v,C,d.draggable]);return{active:c,activatorEvent:i,activeNodeRect:u,attributes:k,isDragging:v,listeners:n?void 0:T,node:b,over:p,setNodeRef:S,setActivatorNodeRef:w,transform:y}}function Bf(){return g.useContext(Rf)}const sy="Droppable",oy={timeout:25};function ay(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:s}=e;const o=Js(sy),{active:a,dispatch:i,over:c,measureDroppableContainers:u}=g.useContext(eo),d=g.useRef({disabled:r}),f=g.useRef(!1),p=g.useRef(null),m=g.useRef(null),{disabled:C,updateMeasurementsFor:h,timeout:v}={...oy,...s},y=Rs(h??n),b=g.useCallback(()=>{if(!f.current){f.current=!0;return}m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{u(Array.isArray(y.current)?y.current:[y.current]),m.current=null},v)},[v]),S=va({callback:b,disabled:C||!a}),x=g.useCallback((k,N)=>{S&&(N&&(S.unobserve(N),f.current=!1),k&&S.observe(k))},[S]),[w,T]=Go(x),D=Rs(t);return g.useEffect(()=>{!S||!w.current||(S.disconnect(),f.current=!1,S.observe(w.current))},[w,S]),g.useEffect(()=>(i({type:lt.RegisterDroppable,element:{id:n,key:o,disabled:r,node:w,rect:p,data:D}}),()=>i({type:lt.UnregisterDroppable,key:o,id:n})),[n]),g.useEffect(()=>{r!==d.current.disabled&&(i({type:lt.SetDroppableDisabled,id:n,key:o,disabled:r}),d.current.disabled=r)},[n,o,r,i]),{active:a,rect:p,isOver:(c==null?void 0:c.id)===n,node:w,over:c,setNodeRef:T}}function iy(e){let{animation:t,children:r}=e;const[n,s]=g.useState(null),[o,a]=g.useState(null),i=Ko(r);return!r&&!n&&i&&s(i),ar(()=>{if(!o)return;const c=n==null?void 0:n.key,u=n==null?void 0:n.props.id;if(c==null||u==null){s(null);return}Promise.resolve(t(u,o)).then(()=>{s(null)})},[t,n,o]),g.createElement(g.Fragment,null,r,n?g.cloneElement(n,{ref:a}):null)}const ly={x:0,y:0,scaleX:1,scaleY:1};function cy(e){let{children:t}=e;return g.createElement(eo.Provider,{value:Pf},g.createElement(ya.Provider,{value:ly},t))}const uy={position:"fixed",touchAction:"none"},dy=e=>pa(e)?"transform 250ms ease":void 0,fy=g.forwardRef((e,t)=>{let{as:r,activatorEvent:n,adjustScale:s,children:o,className:a,rect:i,style:c,transform:u,transition:d=dy}=e;if(!i)return null;const f=s?u:{...u,scaleX:1,scaleY:1},p={...uy,width:i.width,height:i.height,top:i.top,left:i.left,transform:Ar.Transform.toString(f),transformOrigin:s&&n?av(n,i):void 0,transition:typeof d=="function"?d(n):d,...c};return g.createElement(r,{className:a,style:p,ref:t},o)}),hy=e=>t=>{let{active:r,dragOverlay:n}=t;const s={},{styles:o,className:a}=e;if(o!=null&&o.active)for(const[i,c]of Object.entries(o.active))c!==void 0&&(s[i]=r.node.style.getPropertyValue(i),r.node.style.setProperty(i,c));if(o!=null&&o.dragOverlay)for(const[i,c]of Object.entries(o.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,u]of Object.entries(s))r.node.style.setProperty(c,u);a!=null&&a.active&&r.node.classList.remove(a.active)}},py=e=>{let{transform:{initial:t,final:r}}=e;return[{transform:Ar.Transform.toString(t)},{transform:Ar.Transform.toString(r)}]},my={duration:250,easing:"ease",keyframes:py,sideEffects:hy({styles:{active:{opacity:"0"}}})};function gy(e){let{config:t,draggableNodes:r,droppableContainers:n,measuringConfiguration:s}=e;return ha((o,a)=>{if(t===null)return;const i=r.get(o);if(!i)return;const c=i.node.current;if(!c)return;const u=Of(a);if(!u)return;const{transform:d}=Nt(a).getComputedStyle(a),f=wf(d);if(!f)return;const p=typeof t=="function"?t:vy(t);return Df(c,s.draggable.measure),p({active:{id:o,data:i.data,node:c,rect:s.draggable.measure(c)},draggableNodes:r,dragOverlay:{node:a,rect:s.dragOverlay.measure(u)},droppableContainers:n,measuringConfiguration:s,transform:f})})}function vy(e){const{duration:t,easing:r,sideEffects:n,keyframes:s}={...my,...e};return o=>{let{active:a,dragOverlay:i,transform:c,...u}=o;if(!t)return;const d={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},p={x:c.x-d.x,y:c.y-d.y,...f},m=s({...u,active:a,dragOverlay:i,transform:{initial:c,final:p}}),[C]=m,h=m[m.length-1];if(JSON.stringify(C)===JSON.stringify(h))return;const v=n==null?void 0:n({active:a,dragOverlay:i,...u}),y=i.node.animate(m,{duration:t,easing:r,fill:"forwards"});return new Promise(b=>{y.onfinish=()=>{v==null||v(),b()}})}}let Lc=0;function yy(e){return g.useMemo(()=>{if(e!=null)return Lc++,Lc},[e])}const by=g.memo(e=>{let{adjustScale:t=!1,children:r,dropAnimation:n,style:s,transition:o,modifiers:a,wrapperElement:i="div",className:c,zIndex:u=999}=e;const{activatorEvent:d,active:f,activeNodeRect:p,containerNodeRect:m,draggableNodes:C,droppableContainers:h,dragOverlay:v,over:y,measuringConfiguration:b,scrollableAncestors:S,scrollableAncestorRects:x,windowRect:w}=Bf(),T=g.useContext(ya),D=yy(f==null?void 0:f.id),k=Ff(a,{activatorEvent:d,active:f,activeNodeRect:p,containerNodeRect:m,draggingNodeRect:v.rect,over:y,overlayNodeRect:v.rect,scrollableAncestors:S,scrollableAncestorRects:x,transform:T,windowRect:w}),N=El(p),F=gy({config:n,draggableNodes:C,droppableContainers:h,measuringConfiguration:b}),A=N?v.setRef:void 0;return g.createElement(cy,null,g.createElement(iy,{animation:F},f&&D?g.createElement(fy,{key:D,id:f.id,ref:A,as:i,activatorEvent:d,adjustScale:t,className:c,transition:o,rect:N,style:{zIndex:u,...s},transform:k},r):null))});/**
|
|
182
182
|
* @license lucide-react v0.400.0 - ISC
|
|
183
183
|
*
|
|
184
184
|
* This source code is licensed under the ISC license.
|
|
@@ -193,307 +193,307 @@ to {
|
|
|
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 xy=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:o,iconNode:i
|
|
196
|
+
*/const xy=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:o,iconNode:a,...i},c)=>g.createElement("svg",{ref:c,...Sy,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:qf("lucide",s),...i},[...a.map(([u,d])=>g.createElement(u,d)),...Array.isArray(o)?o:[o]]));/**
|
|
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
|
|
201
|
+
*/const de=(e,t)=>{const r=g.forwardRef(({className:n,...s},o)=>g.createElement(xy,{ref:o,iconNode:t,className:qf(`lucide-${Cy(e)}`,n),...s}));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 _y=
|
|
206
|
+
*/const _y=de("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 Al=
|
|
211
|
+
*/const Al=de("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 wy=
|
|
216
|
+
*/const wy=de("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 Ty=
|
|
221
|
+
*/const Ty=de("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 Cr=
|
|
226
|
+
*/const Cr=de("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 Ey=
|
|
231
|
+
*/const Ey=de("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
|
|
236
|
+
*/const Sn=de("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
|
|
241
|
+
*/const xn=de("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 kl=
|
|
246
|
+
*/const kl=de("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 Ay=
|
|
251
|
+
*/const Ay=de("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 $f=
|
|
256
|
+
*/const $f=de("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
|
|
261
|
+
*/const ba=de("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 ky=
|
|
266
|
+
*/const ky=de("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 Iy=
|
|
271
|
+
*/const Iy=de("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 Ly=
|
|
276
|
+
*/const Ly=de("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 Uf=
|
|
281
|
+
*/const Uf=de("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 Dy=
|
|
286
|
+
*/const Dy=de("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 to=
|
|
291
|
+
*/const to=de("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 Gr=
|
|
296
|
+
*/const Gr=de("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 Dc=
|
|
301
|
+
*/const Dc=de("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 jy=
|
|
306
|
+
*/const jy=de("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 zf=
|
|
311
|
+
*/const zf=de("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 Vf=
|
|
316
|
+
*/const Vf=de("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 Ny=
|
|
321
|
+
*/const Ny=de("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 Il=
|
|
326
|
+
*/const Il=de("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 Oy=
|
|
331
|
+
*/const Oy=de("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 Hf=
|
|
336
|
+
*/const Hf=de("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
|
|
341
|
+
*/const qn=de("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
|
|
346
|
+
*/const Ca=de("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 Py=
|
|
351
|
+
*/const Py=de("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 Do=
|
|
356
|
+
*/const Do=de("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 Qf=
|
|
361
|
+
*/const Qf=de("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 Ry=
|
|
366
|
+
*/const Ry=de("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
|
|
371
|
+
*/const Sa=de("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
|
|
376
|
+
*/const xa=de("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 Fy=
|
|
381
|
+
*/const Fy=de("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 My=
|
|
386
|
+
*/const My=de("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 By=
|
|
391
|
+
*/const By=de("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 qy=
|
|
396
|
+
*/const qy=de("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 kr=
|
|
401
|
+
*/const kr=de("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 jc=
|
|
406
|
+
*/const jc=de("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 Nc=
|
|
411
|
+
*/const Nc=de("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 $y=
|
|
416
|
+
*/const $y=de("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 Uy=
|
|
421
|
+
*/const Uy=de("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 zy=
|
|
426
|
+
*/const zy=de("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 Jo=
|
|
431
|
+
*/const Jo=de("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 Vy=
|
|
436
|
+
*/const Vy=de("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 Hy=
|
|
441
|
+
*/const Hy=de("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 Qy=
|
|
446
|
+
*/const Qy=de("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 Wy=
|
|
451
|
+
*/const Wy=de("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 Gy=
|
|
456
|
+
*/const Gy=de("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 ls=
|
|
461
|
+
*/const ls=de("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 Ky=
|
|
466
|
+
*/const Ky=de("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
|
|
471
|
+
*/const Ui=de("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 Yy=
|
|
476
|
+
*/const Yy=de("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 Zy=
|
|
481
|
+
*/const Zy=de("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
|
|
486
|
+
*/const _a=de("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 lr=
|
|
491
|
+
*/const lr=de("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 Xy=
|
|
496
|
+
*/const Xy=de("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"}]]),Jy={},Oc=e=>{let t;const r=new Set,n=(d,f)=>{const p=typeof d=="function"?d(t):d;if(!Object.is(p,t)){const m=t;t=f??(typeof p!="object"||p===null)?p:Object.assign({},t,p),r.forEach(C=>C(t,m))}},s=()=>t,c={setState:n,getState:s,getInitialState:()=>u,subscribe:d=>(r.add(d),()=>r.delete(d)),destroy:()=>{(Jy?"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()}},u=t=e(n,s,c);return c},eb=e=>e?Oc(e):Oc;function Ll(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vo={exports:{}},za={},yo={exports:{}},Va={};/**
|
|
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 Pc;function tb(){if(Pc)return
|
|
504
|
+
*/var Pc;function tb(){if(Pc)return Va;Pc=1;var e=g;function t(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,s=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function i(f,p){var m=p(),C=n({inst:{value:m,getSnapshot:p}}),h=C[0].inst,v=C[1];return o(function(){h.value=m,h.getSnapshot=p,c(h)&&v({inst:h})},[f,m,p]),s(function(){return c(h)&&v({inst:h}),f(function(){c(h)&&v({inst:h})})},[f]),a(m),m}function c(f){var p=f.getSnapshot;f=f.value;try{var m=p();return!r(f,m)}catch{return!0}}function u(f,p){return p()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:i;return Va.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,Va}var Ha={};/**
|
|
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 Rc;function rb(){return Rc||(Rc=1,process.env.NODE_ENV!=="production"&&(function(){function e(m,C){return m===C&&(m!==0||1/m===1/C)||m!==m&&C!==C}function t(m,C){d||s.startTransition===void 0||(d=!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=C();if(!f){var v=C();o(h,v)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}v=
|
|
512
|
+
*/var Rc;function rb(){return Rc||(Rc=1,process.env.NODE_ENV!=="production"&&(function(){function e(m,C){return m===C&&(m!==0||1/m===1/C)||m!==m&&C!==C}function t(m,C){d||s.startTransition===void 0||(d=!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=C();if(!f){var v=C();o(h,v)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}v=a({inst:{value:h,getSnapshot:C}});var y=v[0].inst,b=v[1];return c(function(){y.value=h,y.getSnapshot=C,r(y)&&b({inst:y})},[m,h,C]),i(function(){return r(y)&&b({inst:y}),m(function(){r(y)&&b({inst:y})})},[m]),u(h),h}function r(m){var C=m.getSnapshot;m=m.value;try{var h=C();return!o(m,h)}catch{return!0}}function n(m,C){return C()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var s=g,o=typeof Object.is=="function"?Object.is:e,a=s.useState,i=s.useEffect,c=s.useLayoutEffect,u=s.useDebugValue,d=!1,f=!1,p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?n:t;Ha.useSyncExternalStore=s.useSyncExternalStore!==void 0?s.useSyncExternalStore:p,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Ha}var Fc;function Dl(){return Fc||(Fc=1,process.env.NODE_ENV==="production"?yo.exports=tb():yo.exports=rb()),yo.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 Mc;function nb(){if(Mc)return
|
|
520
|
+
*/var Mc;function nb(){if(Mc)return za;Mc=1;var e=g,t=Dl();function r(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var n=typeof Object.is=="function"?Object.is:r,s=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,i=e.useMemo,c=e.useDebugValue;return za.useSyncExternalStoreWithSelector=function(u,d,f,p,m){var C=o(null);if(C.current===null){var h={hasValue:!1,value:null};C.current=h}else h=C.current;C=i(function(){function y(T){if(!b){if(b=!0,S=T,T=p(T),m!==void 0&&h.hasValue){var D=h.value;if(m(D,T))return x=D}return x=T}if(D=x,n(S,T))return D;var k=p(T);return m!==void 0&&m(D,k)?(S=T,D):(S=T,x=k)}var b=!1,S,x,w=f===void 0?null:f;return[function(){return y(d())},w===null?void 0:function(){return y(w())}]},[d,f,p,m]);var v=s(u,C[0],C[1]);return a(function(){h.hasValue=!0,h.value=v},[v]),c(v),v},za}var Qa={};/**
|
|
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 Bc;function sb(){return Bc||(Bc=1,process.env.NODE_ENV!=="production"&&(function(){function e(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=g,r=Dl(),n=typeof Object.is=="function"?Object.is:e,s=r.useSyncExternalStore,o=t.useRef,i=t.useEffect,a=t.useMemo,c=t.useDebugValue;Qi.useSyncExternalStoreWithSelector=function(u,d,f,p,m){var C=o(null);if(C.current===null){var h={hasValue:!1,value:null};C.current=h}else h=C.current;C=a(function(){function y(T){if(!b){if(b=!0,S=T,T=p(T),m!==void 0&&h.hasValue){var L=h.value;if(m(L,T))return x=L}return x=T}if(L=x,n(S,T))return L;var A=p(T);return m!==void 0&&m(L,A)?(S=T,L):(S=T,x=A)}var b=!1,S,x,w=f===void 0?null:f;return[function(){return y(d())},w===null?void 0:function(){return y(w())}]},[d,f,p,m]);var v=s(u,C[0],C[1]);return i(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())})()),Qi}var qc;function ob(){return qc||(qc=1,process.env.NODE_ENV==="production"?vo.exports=nb():vo.exports=sb()),vo.exports}var ib=ob();const ab=Ll(ib),Wf={},{useDebugValue:lb}=g,{useSyncExternalStoreWithSelector:cb}=ab;let $c=!1;const ub=e=>e;function db(e,t=ub,r){(Wf?"production":void 0)!=="production"&&r&&!$c&&(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"),$c=!0);const n=cb(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return lb(n),n}const Uc=e=>{(Wf?"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"?eb(e):e,r=(n,s)=>db(t,n,s);return Object.assign(r,t),r},ro=e=>e?Uc(e):Uc,wi={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}},fb={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}},hb={...wi,key:"evaluationCourse",restrictedContentCategories:["Practice Question Set","Course Assessment"]};function pb(e){switch(e.config.primaryCategory){case"Learning Path":return fb;case"Evaluation Course":return hb;default:return wi}}const X=ro(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:wi,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=X.getState().formStatusMapper,n=[...t];for(;n.length>0;){const s=n.shift();if(r[s.id]===!1)return!1;s.children&&n.push(...s.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}})})),mb=Object.freeze(Object.defineProperty({__proto__:null,useEditorStore:X},Symbol.toStringTag,{value:"Module"})),rt=ro(e=>({activeModal:null,modalData:{},activeAssessmentSlot:null,activeLevelExamTarget:null,openModal:(t,r={})=>e({activeModal:t,modalData:r}),closeModal:()=>e({activeModal:null,modalData:{}}),setActiveAssessmentSlot:t=>e({activeAssessmentSlot:t,activeLevelExamTarget:null}),setActiveLevelExamTarget:t=>e({activeLevelExamTarget:t,activeAssessmentSlot:null})})),gb={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"},vb={ariaLabel:"Select language"},yb={errorBoundaryTitle:"Something went wrong",retryButton:"Retry",loadingMessage:"Loading editor...",loadErrorTitle:"Failed to load editor"},bb={nodePathAriaLabel:"Node path",homeAriaLabel:"Home"},Cb={detailsTab:"Details",audienceCurriculumTab:"Audience & Curriculum",licensingTab:"Licensing",metadataSectionsAriaLabel:"Metadata sections",hasErrorsAriaLabel:"Has errors"},Sb={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"},xb={selectAppIconAriaLabel:"Select app icon",appIconAriaLabel:"App icon",appIconAlt:"App icon",removeIconAriaLabel:"Remove icon"},_b={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"},wb={dragToReorderAriaLabel:"Drag to reorder",removeAriaLabel:"Remove {name}"},Tb={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"},Eb={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"},Ab={shuffleEnabledMessage:"Shuffling is enabled for this question set.",noFieldsMessage:"No fields configured for this tab."},kb={requiredError:"{field} is required",selectIconAriaLabel:"Select app icon",iconAlt:"App icon",selectIconLabel:"Select icon",removeIconAriaLabel:"Remove app icon",removeLabel:"Remove"},Ib={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."},Lb={addPlaceholder:"Add…",addButtonLabel:"Add"},Db={requiredError:"{field} is required"},jb={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"},Nb={requiredError:"{field} is required",inputPlaceholder:"Type and press Enter or comma…"},Ob={requiredError:"{field} is required",selectPlaceholder:"Select license…"},Pb={requiredError:"{field} is required",selectedCountSuffix:"selected",selectPlaceholder:"Select…",noOptionsMessage:"No options"},Rb={requiredError:"{field} is required",selectPlaceholder:"Select…"},Fb={requiredError:"{field} is required"},Mb={requiredError:"{field} is required",selectPlaceholder:"Select…",noOptionsMessage:"No options"},Bb={requiredError:"{field} is required",maxLengthError:"Max {max} characters"},qb={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"},$b={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"},Ub={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"},zb={title:"Confirm deletion",confirmButton:"Confirm",cancelButton:"Cancel",closeAriaLabel:"Close"},Vb={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"},Hb={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"},Qb={title:"Unsaved changes",closeAriaLabel:"Close",bodyMessage:"You have unsaved changes. Would you like to save them before leaving?",cancelButton:"Cancel",discardButton:"Discard",saveButton:"Save"},Wb={contentTypeFiltersAriaLabel:"Content type filters"},Gb={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"},Kb={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",cancelTargetAriaLabel:"Cancel — go back to browsing",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"},Yb={boardLabel:"Board",mediumLabel:"Medium",classLabel:"Class",subjectLabel:"Subject",primaryCategoryLabel:"Primary Category",filterLibraryAriaLabel:"Filter library",filtersHeaderTitle:"Filters",closeFiltersAriaLabel:"Close filters",resetButton:"Reset",applyButton:"Apply"},Zb={contentPreviewAriaLabel:"Content preview",closePreviewAriaLabel:"Close preview",addToUnitButton:"+ Add to Unit"},Xb={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"},Jb={expandAriaLabel:"Expand",collapseAriaLabel:"Collapse",dropHereLabel:"Drop here",nodeOptionsAriaLabel:"Node options",renameMenuItem:"Rename",addSubunitMenuItem:"Add sub-unit",addSiblingMenuItem:"Add Sibling",deleteMenuItem:"Delete"},eC={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."},tC={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."},rC={unitsAddedLabel:"Units added",contentItemsLabel:"Content items",progressLabel:"Progress"},nC={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"},sC={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"},oC={closeAriaLabel:"Close",fillCommentsError:"Fill comments",cancelButton:"Cancel"},iC={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"},aC={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"},lC={remove:"Remove"},cC={dropHere:"Drop here"},uC={loading:"Loading"},dC={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",addCourseToLevelButton:"Add Course to this level",addLevelExamButton:"Add Level Exam — a course with only a question set",levelExamMeta:"Level Exam · Question set only",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?",deleteLevelExamConfirm:"Remove this Level Exam course from the level?",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 an Evaluation Course, so it can't be used as an assessment.`,bothSlotsFilledToast:"Both Prior and Outcome Assessment slots are already filled.",levelExamAlreadyFilledToast:"This level already has a Level Exam course — remove it before adding a different one.",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 Evaluation Course — its content can only be Question Sets or Course Assessment, never other content types.",libraryOpenLevelToAdd:"Open a level to add",libraryAddToLevel:"Add to {level}",libraryAddPriorAssessmentCourse:"Add Prior Assessment course",libraryAddOutcomeAssessmentCourse:"Add Outcome Assessment course",libraryAddLevelExamCourse:"Add Level Exam course for {level}",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.",levelNeedsMixedContentToast:"This level is first or last in the path — a question-set-only course as its only content will be treated as a Prior/Outcome Assessment. Add another course, or one with more than just question sets.",cannotRemoveLastRegularCourseToast:"This level is first or last in the path — removing this course would leave only the Level Exam course, and it would be treated as a Prior/Outcome Assessment. Add another course first.",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.",coursesCardHeading:"Courses",coursesCardDescription:"Courses a learner completes to clear this level — each course may include its own assessments internally. Drag the handle to reorder, use the menu to remove.",coursesEmptyHint:"Not added yet — pick a course from the Library.",courseMetaLabel:"Course",removeFromLevelMenuItem:"Remove from level"},za={contextualEditor:gb,languageSelector:vb,collectionEditor:yb,breadcrumb:bb,tabBar:Cb,contentEditForm:Sb,titleAppIcon:xb,unitContentList:_b,contentRow:wb,csvUpload:Tb,manageCollaborators:Eb,sparkMetaForm:Ab,appIconField:kb,appIconPickerModal:Ib,chipGroupField:Lb,dateTimeField:Db,dialcodeInputField:jb,keywordSuggestField:Nb,licenseSelectField:Ob,multiSelectField:Pb,nestedSelectField:Rb,radioField:Fb,selectField:Mb,textField:Bb,assetBrowser:qb,resourceReorderDialog:$b,assignPageNumber:Ub,confirmDialog:zb,publishChecklist:Vb,qualityParamsModal:Hb,unsavedChangesModal:Qb,filterChips:Wb,libraryCard:Gb,libraryDock:Kb,libraryFilterPanel:Yb,libraryPreviewPanel:Zb,outlineTree:Xb,treeNode:Jb,contentPlayer:eC,dialcodePanel:tC,progressStatus:rC,splitBuilderShell:nC,topbar:sC,reviewCommentModal:oC,confirmReviewModal:iC,generateQRModal:aC,chip:lC,dropZone:cC,spinner:uC,learningPath:dC},fC={emptyStateMessage:"اختر وحدة من المخطط التفصيلي لتحرير تفاصيلها",reviewCommentLabel:"تعليق المراجع:",untitledPlaceholder:"بدون عنوان",nodeTitleAriaLabel:"عنوان العنصر",dropZoneLabel:"أفلت هنا لإضافة محتوى إلى هذه الوحدة"},hC={ariaLabel:"اختيار اللغة"},pC={errorBoundaryTitle:"حدث خطأ ما",retryButton:"إعادة المحاولة",loadingMessage:"جارٍ تحميل المحرر...",loadErrorTitle:"فشل تحميل المحرر"},mC={nodePathAriaLabel:"مسار العنصر",homeAriaLabel:"الصفحة الرئيسية"},gC={detailsTab:"التفاصيل",audienceCurriculumTab:"الجمهور والمنهج",licensingTab:"الترخيص",metadataSectionsAriaLabel:"أقسام البيانات الوصفية",hasErrorsAriaLabel:"يحتوي على أخطاء"},vC={moveToAnotherUnitButton:"نقل إلى وحدة أخرى",collapseMetadataPanelAriaLabel:"طي لوحة البيانات الوصفية",expandMetadataPanelAriaLabel:"توسيع لوحة البيانات الوصفية",collapseTitle:"طي",expandTitle:"توسيع",iconAlt:"أيقونة",contentNamePlaceholder:"اسم المحتوى",keywordsLabel:"الكلمات المفتاحية",addKeywordPlaceholder:"أضف كلمة مفتاحية واضغط Enter",addButton:"إضافة",optionalInCollectionLabel:"اختياري في المجموعة",yesOption:"نعم",noOption:"لا"},yC={selectAppIconAriaLabel:"اختيار أيقونة التطبيق",appIconAriaLabel:"أيقونة التطبيق",appIconAlt:"أيقونة التطبيق",removeIconAriaLabel:"إزالة الأيقونة"},bC={removeConfirm:"هل تريد إزالة هذا المحتوى من الوحدة؟",heading:"المحتوى في هذه الوحدة",emptyTitle:"لا يوجد محتوى بعد",emptyHint:"اسحب من المكتبة أو انقر فوق إضافة محتوى",addContentAriaLabel:"إضافة محتوى إلى الوحدة",addContent:"إضافة محتوى"},CC={dragToReorderAriaLabel:"اسحب لإعادة الترتيب",removeAriaLabel:"إزالة {name}"},SC={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:"تحميل"},xC={saveFailed:"فشل حفظ المتعاونين. يرجى المحاولة مرة أخرى.",title:"إدارة المتعاونين",closeAriaLabel:"إغلاق",searchUsersLabel:"البحث عن المستخدمين",searchPlaceholder:"البحث بالاسم أو البريد الإلكتروني...",searchingAriaLabel:"جارٍ البحث...",searchResultsAriaLabel:"نتائج البحث",add:"إضافة",noUsersFound:"لم يتم العثور على مستخدمين.",currentCollaborators:"المتعاونون الحاليون",noCollaboratorsYet:"لم تتم إضافة أي متعاونين بعد.",remove:"إزالة",saveSuccess:"تم حفظ المتعاونين بنجاح.",cancel:"إلغاء",save:"حفظ"},_C={shuffleEnabledMessage:"تم تفعيل الترتيب العشوائي لهذه المجموعة من الأسئلة.",noFieldsMessage:"لا توجد حقول مُهيَّأة لهذا التبويب."},wC={requiredError:"{field} مطلوب",selectIconAriaLabel:"اختيار أيقونة التطبيق",iconAlt:"أيقونة التطبيق",selectIconLabel:"اختيار أيقونة",removeIconAriaLabel:"إزالة أيقونة التطبيق",removeLabel:"إزالة"},TC={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:"فشل التحميل."},EC={addPlaceholder:"إضافة…",addButtonLabel:"إضافة"},AC={requiredError:"{field} مطلوب"},kC={requiredError:"{field} مطلوب",enterCodeMessage:"أدخل رمز الطلب للتحقق منه.",validMessage:"رمز الطلب صالح.",notFoundMessage:"رمز الطلب غير موجود.",validationFailedMessage:"فشل التحقق. يرجى المحاولة مرة أخرى.",placeholderExample:"مثال: A1B2C3",validateAriaLabel:"التحقق من رمز الطلب",validatingLabel:"جارٍ التحقق…",validateButtonLabel:"تحقق"},IC={requiredError:"{field} مطلوب",inputPlaceholder:"اكتب واضغط Enter أو فاصلة…"},LC={requiredError:"{field} مطلوب",selectPlaceholder:"اختر ترخيصًا…"},DC={requiredError:"{field} مطلوب",selectedCountSuffix:"محدد",selectPlaceholder:"اختر…",noOptionsMessage:"لا توجد خيارات"},jC={requiredError:"{field} مطلوب",selectPlaceholder:"اختر…"},NC={requiredError:"{field} مطلوب"},OC={requiredError:"{field} مطلوب",selectPlaceholder:"اختر…",noOptionsMessage:"لا توجد خيارات"},PC={requiredError:"{field} مطلوب",maxLengthError:"الحد الأقصى {max} حرفًا"},RC={dialogAriaLabel:"متصفح الأصول",title:"متصفح الأصول",closeAriaLabel:"إغلاق",browseTab:"تصفح",uploadTab:"تحميل",searchPlaceholder:"البحث في الأصول...",searchButton:"بحث",loadingMessage:"جارٍ التحميل...",uploadingMessage:"جارٍ التحميل...",chooseFileButton:"اختر ملفًا للتحميل"},FC={dialogAriaLabel:"نقل المورد",moveHeaderPrefix:"نقل",closeAriaLabel:"إغلاق",selectUnitHint:"اختر وحدة لنقل هذا المحتوى إليها:",noUnitsAvailable:"لا توجد وحدات أخرى متاحة",cancelButton:"إلغاء",moveButton:"نقل إلى هنا"},MC={dialogAriaLabel:"تعيين أرقام الصفحات",title:"تعيين أرقام الصفحات",closeAriaLabel:"إغلاق",emptyState:"لم يتم العثور على عناصر محتوى في هذه المجموعة.",contentColumnHeader:"المحتوى",pageNumberColumnHeader:"رقم الصفحة",cancelButton:"إلغاء",saveButton:"حفظ"},BC={title:"تأكيد الحذف",confirmButton:"تأكيد",cancelButton:"إلغاء",closeAriaLabel:"إغلاق"},qC={publishTitlePrefix:"نشر",closeAriaLabel:"إغلاق",confirmPublishPrefix:"هل أنت متأكد من رغبتك في نشر هذا",checklistInstructions:"يرجى تأكيد التحقق من جميع العناصر التالية (بتحديد مربعات الاختيار) قبل أن تتمكن من النشر:",noButton:"لا",yesButton:"نعم"},$C={reviewQualityTitle:"مراجعة الجودة",rejectContentTitle:"رفض المحتوى",closeAriaLabel:"إغلاق",qualityScoreLabel:"درجة الجودة",scorePoorLabel:"0 — ضعيف",scoreExcellentLabel:"10 — ممتاز",commentLabel:"تعليق",optionalLabel:"(اختياري)",commentPlaceholder:"أضف أي ملاحظات لمنشئ المحتوى…",rejectionReasonLabel:"سبب الرفض",rejectReasonPlaceholder:"اذكر سبب رفض هذا المحتوى…",rejectionRequiredMessage:"سبب الرفض مطلوب.",cancelButton:"إلغاء",approveButton:"قبول",rejectButton:"رفض"},UC={title:"تغييرات غير محفوظة",closeAriaLabel:"إغلاق",bodyMessage:"لديك تغييرات غير محفوظة. هل تريد حفظها قبل المغادرة؟",cancelButton:"إلغاء",discardButton:"تجاهل",saveButton:"حفظ"},zC={contentTypeFiltersAriaLabel:"مرشحات نوع المحتوى"},VC={alreadyAddedAriaLabel:"تمت إضافته مسبقًا",alreadyAddedTitle:"تمت إضافته مسبقًا إلى هذه المجموعة",addItemAriaLabel:"إضافة {name} إلى الوحدة",addToUnitTitle:"إضافة إلى الوحدة",selectUnitToAddTitle:"اختر وحدة للإضافة إليها",draftOnlyTitle:"يمكن إضافة المحتوى المسودة فقط"},HC={selectUnitFirstToast:"اختر وحدة أولاً",selectUnitFromOutlineToast:"اختر وحدة من المخطط التفصيلي لإضافة محتوى — لا يمكن إضافة الموارد مباشرة إلى الدورة.",itemAlreadyAddedToast:'"{name}" موجود مسبقًا في هذه المجموعة',itemAddedToast:'تمت إضافة "{name}"',collapseLibraryPanelAriaLabel:"طي لوحة المكتبة",collapseLibraryTitle:"طي المكتبة",cancelTargetAriaLabel:"إلغاء — العودة إلى التصفح",headerTitle:"المكتبة",searchPlaceholder:"البحث في المحتوى…",searchAriaLabel:"البحث في المكتبة",sortAZAriaLabel:"الترتيب: أ–ي (انقر للأحدث)",sortRecentAriaLabel:"الترتيب: الأحدث (انقر لـ أ–ي)",sortAZTitle:"أ–ي",sortRecentTitle:"الأحدث",toggleAdvancedFiltersAriaLabel:"تبديل المرشحات المتقدمة",advancedFiltersTitle:"المرشحات المتقدمة",libraryContentAriaLabel:"محتوى المكتبة",loadMoreAriaLabel:"تحميل المزيد من المحتوى",loadingText:"جارٍ التحميل…",loadMoreText:"تحميل المزيد",noContentFound:"لم يتم العثور على محتوى",tryDifferentSearch:"جرّب بحثًا أو مرشحًا مختلفًا"},QC={boardLabel:"المجلس التعليمي",mediumLabel:"لغة التدريس",classLabel:"الصف",subjectLabel:"المادة",primaryCategoryLabel:"الفئة الأساسية",filterLibraryAriaLabel:"تصفية المكتبة",filtersHeaderTitle:"المرشحات",closeFiltersAriaLabel:"إغلاق المرشحات",resetButton:"إعادة تعيين",applyButton:"تطبيق"},WC={contentPreviewAriaLabel:"معاينة المحتوى",closePreviewAriaLabel:"إغلاق المعاينة",addToUnitButton:"+ إضافة إلى الوحدة"},GC={maxDepthReachedToast:"تم الوصول إلى الحد الأقصى للعمق",downloadCsvFailedToast:"فشل تنزيل ملف CSV",outlineRefreshedToast:"تم تحديث مخطط الدورة.",outlineRefreshFailedToast:"تعذّر تحديث المخطط التفصيلي تلقائيًا. يرجى إعادة تحميل الصفحة.",moreOptionsAriaLabel:"خيارات إضافية",moreOptionsTitle:"خيارات إضافية",foldersExistTitle:'المجلدات موجودة مسبقًا — استخدم "تحديث" بدلاً من ذلك',createFoldersCsvButton:"إنشاء مجلدات باستخدام ملف csv",noFoldersYetTitle:'لا توجد مجلدات بعد — استخدم "إنشاء" أولاً',downloadFoldersCsvButton:"تنزيل المجلدات كملف csv",updateFoldersCsvButton:"تحديث بيانات المجلدات الوصفية باستخدام ملف csv",expandOutlineAriaLabel:"توسيع المخطط التفصيلي",collapseOutlineAriaLabel:"طي المخطط التفصيلي",addUnitButton:"إضافة وحدة",addSubunitButton:"إضافة وحدة فرعية"},KC={expandAriaLabel:"توسيع",collapseAriaLabel:"طي",dropHereLabel:"أفلت هنا",nodeOptionsAriaLabel:"خيارات العنصر",renameMenuItem:"إعادة تسمية",addSubunitMenuItem:"إضافة وحدة فرعية",addSiblingMenuItem:"إضافة عنصر مماثل",deleteMenuItem:"حذف"},YC={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:"لم يتم العثور على السؤال في مجموعة الأسئلة."},ZC={title:"رمز الاستجابة السريعة (رمز الطلب)",invalidFormatError:"تنسيق رمز DIAL غير صالح. استخدم الأحرف الكبيرة والأرقام فقط (مثال: A1B2C3).",duplicateDialcodeError:'رمز DIAL "{code}" مرتبط مسبقًا بعنصر آخر في هذه المجموعة.',dialcodeNotFoundError:"رمز الطلب غير موجود. يرجى إدخال رمز صالح.",linkFailedError:"فشل ربط رمز الطلب. يرجى المحاولة مرة أخرى.",unlinkFailedError:"فشلت إزالة رمز الطلب. يرجى المحاولة مرة أخرى.",qrCodeAltPrefix:"رمز الاستجابة السريعة لـ",linkedCodeLabel:"الرمز المرتبط:",removeButton:"إزالة",noCodeLinkedMessage:"لا يوجد رمز استجابة سريعة مرتبط بهذا المحتوى.",linkManuallyLabel:"الربط يدويًا",dialcodeInputPlaceholder:"أدخل رمز الطلب (مثال: A1B2C3)",dialcodeInputAriaLabel:"إدخال رمز الطلب",linkButton:"ربط",linkedSuccessMessage:"تم ربط رمز الطلب بنجاح."},XC={unitsAddedLabel:"الوحدات المضافة",contentItemsLabel:"عناصر المحتوى",progressLabel:"التقدّم"},JC={dropOntoUnitError:"أفلت على وحدة لإضافة محتوى",dropOntoCourseError:"أفلت المحتوى على وحدة، وليس مباشرة على الدورة.",alreadyInCollectionError:'"{name}" موجود مسبقًا في هذه المجموعة',addedToUnitSuccess:'تمت إضافة "{name}" إلى الوحدة',fillRequiredMetadataError:"يرجى تعبئة البيانات الوصفية المطلوبة",outlineAriaLabel:"مخطط الدورة",showOutlineTitle:"إظهار المخطط التفصيلي",editorAriaLabel:"محرر المحتوى",libraryAriaLabel:"مكتبة المحتوى",showLibraryTitle:"إظهار المكتبة"},eS={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:"اذكر التغييرات التي يجب على المؤلف إجراؤها"},tS={closeAriaLabel:"إغلاق",fillCommentsError:"أضف تعليقات",cancelButton:"إلغاء"},rS={closeAriaLabel:"إغلاق",title:"قبول الشروط والأحكام",agreementTextPart1:"أوافق على أنه بإرسال / نشر هذا المحتوى، فإنني أؤكد أن هذا المحتوى يتوافق مع الإرشادات المعتمدة، بما في ذلك شروط الاستخدام وسياسة المحتوى، وأني أوافق على نشره بموجب",creativeCommonsLinkText:"إطار عمل Creative Commons",agreementTextPart2:"وفقًا لـ",contentPolicyText:"سياسة المحتوى",agreementTextPart3:". وقد تحققت من أنني لا أنتهك حقوق النشر أو الخصوصية الخاصة بالآخرين.",cancelButton:"إلغاء",submitButton:"إرسال"},nS={closeAriaLabel:"إغلاق",title:"إنشاء رموز الاستجابة السريعة",numberOfCodesLabel:"عدد رموز الاستجابة السريعة",countPlaceholder:"أدخل رقمًا (2–250)",countRangeError:"أدخل رقمًا بين 2 و 250.",cancelButton:"إلغاء",generateButton:"إنشاء"},sS={remove:"إزالة"},oS={dropHere:"أفلت هنا"},iS={loading:"جارٍ التحميل"},aS={profileBadgeLabel:"مسار التعلم",pathStructureLabel:"بنية المسار",addLevelButton:"إضافة مستوى",levelNumberPrefix:"المستوى {n}",priorAssessmentLabel:"التقييم المسبق",priorAssessmentHint:"مطلوب دائمًا · لا يُحسب كمستوى",outcomeAssessmentLabel:"تقييم النتائج",outcomeAssessmentHint:"يؤكد النتيجة · لا يُحسب كمستوى",skillCheckBadge:"فحص المهارة",outcomeCheckBadge:"فحص النتيجة",assessmentCourseMeta:"مقرر · بنك أسئلة فقط",addAssessmentSlotButton:"إضافة {label} — مقرر يحتوي على بنك أسئلة فقط",addCourseToLevelButton:"إضافة مقرر إلى هذا المستوى",addLevelExamButton:"إضافة اختبار المستوى — مقرر يحتوي على بنك أسئلة فقط",levelExamMeta:"اختبار المستوى · بنك أسئلة فقط",requiredSlotBadge:"مطلوب",removeAssessmentSlotButton:"إزالة",deletePriorAssessmentConfirm:"حذف التقييم المسبق يزيل الدرجة التي يعتمد عليها التخطي التكيفي لهذا المسار. هل تريد الاستمرار؟",deleteAssessmentSlotConfirm:"هل تريد إزالة مقرر التقييم هذا من المسار؟",deleteLevelExamConfirm:"هل تريد إزالة مقرر اختبار المستوى هذا من المستوى؟",deleteLevelConfirm:'هل تريد حذف "{name}" وكل ما يحتويه؟',deleteCourseConfirm:"هل تريد إزالة هذا المقرر من المسار؟",deleteMultipleConfirm:"هل تريد حذف {count} من العناصر المحددة من المسار؟",courseNameUnavailable:"تفاصيل المقرر غير متوفرة",notAssessmentCourseToast:'"{name}" ليس مقرر تقييم (Evaluation Course)، لذا لا يمكن استخدامه كتقييم.',bothSlotsFilledToast:"تم تعبئة تقييمي المسبق والنتائج بالفعل.",levelExamAlreadyFilledToast:"يحتوي هذا المستوى بالفعل على مقرر اختبار المستوى — أزِله قبل إضافة مقرر آخر.",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:"مقرر تقييم واحد (Evaluation Course) — لا يمكن أن يكون محتواه سوى بنوك أسئلة أو تقييم مقرر، وليس أي أنواع محتوى أخرى.",libraryOpenLevelToAdd:"افتح مستوى للإضافة",libraryAddToLevel:"إضافة إلى {level}",libraryAddPriorAssessmentCourse:"إضافة مقرر التقييم المسبق",libraryAddOutcomeAssessmentCourse:"إضافة مقرر تقييم النتائج",libraryAddLevelExamCourse:"إضافة مقرر اختبار المستوى لـ {level}",policyStrictLabel:"صارمة",policyStrictDescription:"يُنهي كل متعلم كل مستوى، بالترتيب — بصرف النظر عن درجة التقييم المسبق.",policyAdaptiveLabel:"تكيفية",policyAdaptiveDescriptionPre:"يمكن تخطي مستوى، ولكن فقط عندما تتجاوز درجة المتعلم في التقييم المسبق",policyAdaptiveDescriptionPost:" حد الإعفاء.",policyPriorLearningLabel:"التعلم المسبق",policyPriorLearningDescription:"يمكن أن يستند التخطي أيضًا إلى مهارات يمتلكها المتعلم بالفعل — شهادة موثقة أو مقرر سابق — لا التقييم وحده.",selectLevelFirstToast:"اختر مستوى أولاً",selectLevelFromOutlineToast:"افتح مستوى في هيكل المسار لإضافة المقررات — لا يمكن إضافة المقررات إلى المسار نفسه أو داخل مقرر آخر.",selectCurriculumFirstToast:"حدد المنهج (Curriculum) لهذا المسار قبل إضافة المقررات.",noCurriculumEmptyTitle:"لم يتم تحديد منهج",noCurriculumEmptyHint:"حدد منهجًا لهذا المسار لتصفح المقررات.",noSkillsEmptyTitle:"لم يتم تحديد مهارات",noSkillsEmptyHint:"حدد مهارات لهذا المستوى لرؤية المقررات المطابقة.",itemAlreadyInPathToast:'"{name}" موجود بالفعل في مسار التعلم هذا',addedToLevelSuccess:'تمت إضافة "{name}" إلى المستوى',dropOntoLevelError:"أفلِت على مستوى لإضافة مقرر",dropOntoPathError:"أفلِت المقررات على مستوى، وليس على مسار التعلم مباشرة.",priorSlotFilledToast:"التقييم المسبق يحتوي على مقرر بالفعل — أزِله قبل إضافة مقرر آخر.",outcomeSlotFilledToast:"التقييم الختامي يحتوي على مقرر بالفعل — أزِله قبل إضافة مقرر آخر.",levelNeedsMixedContentToast:"هذا المستوى هو الأول أو الأخير في المسار — مقرر يحتوي فقط على بنك أسئلة كمحتوى وحيد له سيُعامل كتقييم مسبق/ختامي. أضف مقررًا آخر، أو مقررًا يحتوي على أكثر من بنك الأسئلة فقط.",cannotRemoveLastRegularCourseToast:"هذا المستوى هو الأول أو الأخير في المسار — إزالة هذا المقرر ستترك فقط مقرر اختبار المستوى، وسيتم التعامل معه كتقييم مسبق/ختامي. أضف مقررًا آخر أولاً.",coursesRemovedFrameworkChangeToast:"تمت إزالة {count} من المقررات المرتبطة بمنهج مختلف من هذا المسار.",levelSkillsResetFrameworkChangeToast:"تم مسح المهارات المختارة في {count} من المستويات — فهي لا تنطبق على المنهج الجديد.",priorAssessmentNarrowedScopeToast:"أدى التقييم المسبق إلى تضييق نطاق المهارات — أصبح لدى {count} من المستويات مهارات خارج هذا النطاق.",coursesCardHeading:"المقررات",coursesCardDescription:"المقررات التي يُتمّها المتعلم لاجتياز هذا المستوى — قد يتضمن كل مقرر تقييماته الخاصة. اسحب المقبض لإعادة الترتيب، واستخدم القائمة للإزالة.",coursesEmptyHint:"لم تتم الإضافة بعد — اختر مقررًا من المكتبة.",courseMetaLabel:"مقرر",removeFromLevelMenuItem:"إزالة من المستوى"},lS={contextualEditor:fC,languageSelector:hC,collectionEditor:pC,breadcrumb:mC,tabBar:gC,contentEditForm:vC,titleAppIcon:yC,unitContentList:bC,contentRow:CC,csvUpload:SC,manageCollaborators:xC,sparkMetaForm:_C,appIconField:wC,appIconPickerModal:TC,chipGroupField:EC,dateTimeField:AC,dialcodeInputField:kC,keywordSuggestField:IC,licenseSelectField:LC,multiSelectField:DC,nestedSelectField:jC,radioField:NC,selectField:OC,textField:PC,assetBrowser:RC,resourceReorderDialog:FC,assignPageNumber:MC,confirmDialog:BC,publishChecklist:qC,qualityParamsModal:$C,unsavedChangesModal:UC,filterChips:zC,libraryCard:VC,libraryDock:HC,libraryFilterPanel:QC,libraryPreviewPanel:WC,outlineTree:GC,treeNode:KC,contentPlayer:YC,dialcodePanel:ZC,progressStatus:XC,splitBuilderShell:JC,topbar:eS,reviewCommentModal:tS,confirmReviewModal:rS,generateQRModal:nS,chip:sS,dropZone:oS,spinner:iS,learningPath:aS},cS={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é"},uS={ariaLabel:"Sélectionner la langue"},dS={errorBoundaryTitle:"Une erreur s'est produite",retryButton:"Réessayer",loadingMessage:"Chargement de l'éditeur...",loadErrorTitle:"Échec du chargement de l'éditeur"},fS={nodePathAriaLabel:"Chemin du nœud",homeAriaLabel:"Accueil"},hS={detailsTab:"Détails",audienceCurriculumTab:"Public et programme",licensingTab:"Licence",metadataSectionsAriaLabel:"Sections de métadonnées",hasErrorsAriaLabel:"Contient des erreurs"},pS={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"},mS={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"},gS={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"},vS={dragToReorderAriaLabel:"Faire glisser pour réorganiser",removeAriaLabel:"Supprimer {name}"},yS={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"},bS={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"},CS={shuffleEnabledMessage:"La lecture aléatoire est activée pour cet ensemble de questions.",noFieldsMessage:"Aucun champ configuré pour cet onglet."},SS={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"},xS={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é."},_S={addPlaceholder:"Ajouter…",addButtonLabel:"Ajouter"},wS={requiredError:"{field} est requis"},TS={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"},ES={requiredError:"{field} est requis",inputPlaceholder:"Saisissez et appuyez sur Entrée ou virgule…"},AS={requiredError:"{field} est requis",selectPlaceholder:"Sélectionner une licence…"},kS={requiredError:"{field} est requis",selectedCountSuffix:"sélectionné(s)",selectPlaceholder:"Sélectionner…",noOptionsMessage:"Aucune option"},IS={requiredError:"{field} est requis",selectPlaceholder:"Sélectionner…"},LS={requiredError:"{field} est requis"},DS={requiredError:"{field} est requis",selectPlaceholder:"Sélectionner…",noOptionsMessage:"Aucune option"},jS={requiredError:"{field} est requis",maxLengthError:"Maximum {max} caractères"},NS={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"},OS={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"},PS={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"},RS={title:"Confirmer la suppression",confirmButton:"Confirmer",cancelButton:"Annuler",closeAriaLabel:"Fermer"},FS={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"},MS={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"},BS={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"},qS={contentTypeFiltersAriaLabel:"Filtres par type de contenu"},$S={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é"},US={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",cancelTargetAriaLabel:"Annuler — revenir à la navigation",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"},zS={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"},VS={contentPreviewAriaLabel:"Aperçu du contenu",closePreviewAriaLabel:"Fermer l'aperçu",addToUnitButton:"+ Ajouter à l'unité"},HS={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é"},QS={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"},WS={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."},GS={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."},KS={unitsAddedLabel:"Unités ajoutées",contentItemsLabel:"Éléments de contenu",progressLabel:"Progression"},YS={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"},ZS={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"},XS={closeAriaLabel:"Fermer",fillCommentsError:"Renseignez les commentaires",cancelButton:"Annuler"},JS={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"},ex={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"},tx={remove:"Supprimer"},rx={dropHere:"Déposer ici"},nx={loading:"Chargement"},sx={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",addCourseToLevelButton:"Ajouter un cours à ce niveau",addLevelExamButton:"Ajouter l'examen de niveau — un cours contenant uniquement un questionnaire",levelExamMeta:"Examen de niveau · Questionnaire uniquement",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 ?",deleteLevelExamConfirm:"Retirer ce cours d'examen de niveau du niveau ?",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 d'évaluation, il ne peut donc pas être utilisé comme évaluation.",bothSlotsFilledToast:"Les évaluations préalable et finale sont déjà renseignées.",levelExamAlreadyFilledToast:"Ce niveau a déjà un cours d'examen de niveau — retirez-le avant d'en ajouter un autre.",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 d'évaluation — son contenu ne peut être que des questionnaires ou une Évaluation de cours, jamais d'autres types de contenu.",libraryOpenLevelToAdd:"Ouvrez un niveau pour ajouter",libraryAddToLevel:"Ajouter à {level}",libraryAddPriorAssessmentCourse:"Ajouter le cours d'évaluation préalable",libraryAddOutcomeAssessmentCourse:"Ajouter le cours d'évaluation finale",libraryAddLevelExamCourse:"Ajouter le cours d'examen de niveau pour {level}",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.",levelNeedsMixedContentToast:"Ce niveau est premier ou dernier dans le parcours — un cours composé uniquement de bancs de questions comme seul contenu sera traité comme une évaluation préalable/finale. Ajoutez un autre cours, ou un cours contenant plus que des bancs de questions.",cannotRemoveLastRegularCourseToast:"Ce niveau est premier ou dernier dans le parcours — retirer ce cours ne laisserait que le cours d'examen de niveau, qui serait alors traité comme une évaluation préalable/finale. Ajoutez d'abord un autre cours.",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.",coursesCardHeading:"Cours",coursesCardDescription:"Cours qu'un apprenant termine pour valider ce niveau — chaque cours peut inclure ses propres évaluations. Faites glisser la poignée pour réorganiser, utilisez le menu pour retirer.",coursesEmptyHint:"Pas encore ajouté — choisissez un cours dans la bibliothèque.",courseMetaLabel:"Cours",removeFromLevelMenuItem:"Retirer du niveau"},ox={contextualEditor:cS,languageSelector:uS,collectionEditor:dS,breadcrumb:fS,tabBar:hS,contentEditForm:pS,titleAppIcon:mS,unitContentList:gS,contentRow:vS,csvUpload:yS,manageCollaborators:bS,sparkMetaForm:CS,appIconField:SS,appIconPickerModal:xS,chipGroupField:_S,dateTimeField:wS,dialcodeInputField:TS,keywordSuggestField:ES,licenseSelectField:AS,multiSelectField:kS,nestedSelectField:IS,radioField:LS,selectField:DS,textField:jS,assetBrowser:NS,resourceReorderDialog:OS,assignPageNumber:PS,confirmDialog:RS,publishChecklist:FS,qualityParamsModal:MS,unsavedChangesModal:BS,filterChips:qS,libraryCard:$S,libraryDock:US,libraryFilterPanel:zS,libraryPreviewPanel:VS,outlineTree:HS,treeNode:QS,contentPlayer:WS,dialcodePanel:GS,progressStatus:KS,splitBuilderShell:YS,topbar:ZS,reviewCommentModal:XS,confirmReviewModal:JS,generateQRModal:ex,chip:tx,dropZone:rx,spinner:nx,learningPath:sx},ix={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"},ax={ariaLabel:"Selecionar idioma"},lx={errorBoundaryTitle:"Algo deu errado",retryButton:"Tentar novamente",loadingMessage:"Carregando editor...",loadErrorTitle:"Falha ao carregar o editor"},cx={nodePathAriaLabel:"Caminho do nó",homeAriaLabel:"Início"},ux={detailsTab:"Detalhes",audienceCurriculumTab:"Público e Currículo",licensingTab:"Licenciamento",metadataSectionsAriaLabel:"Seções de metadados",hasErrorsAriaLabel:"Contém erros"},dx={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"},fx={selectAppIconAriaLabel:"Selecionar ícone do aplicativo",appIconAriaLabel:"Ícone do aplicativo",appIconAlt:"Ícone do aplicativo",removeIconAriaLabel:"Remover ícone"},hx={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"},px={dragToReorderAriaLabel:"Arrastar para reordenar",removeAriaLabel:"Remover {name}"},mx={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"},gx={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"},vx={shuffleEnabledMessage:"A ordem aleatória está ativada para este conjunto de questões.",noFieldsMessage:"Nenhum campo configurado para esta aba."},yx={requiredError:"{field} é obrigatório",selectIconAriaLabel:"Selecionar ícone do aplicativo",iconAlt:"Ícone do aplicativo",selectIconLabel:"Selecionar ícone",removeIconAriaLabel:"Remover ícone do aplicativo",removeLabel:"Remover"},bx={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."},Cx={addPlaceholder:"Adicionar…",addButtonLabel:"Adicionar"},Sx={requiredError:"{field} é obrigatório"},xx={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"},_x={requiredError:"{field} é obrigatório",inputPlaceholder:"Digite e pressione Enter ou vírgula…"},wx={requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar licença…"},Tx={requiredError:"{field} é obrigatório",selectedCountSuffix:"selecionado(s)",selectPlaceholder:"Selecionar…",noOptionsMessage:"Sem opções"},Ex={requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar…"},Ax={requiredError:"{field} é obrigatório"},kx={requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar…",noOptionsMessage:"Sem opções"},Ix={requiredError:"{field} é obrigatório",maxLengthError:"Máx. {max} caracteres"},Lx={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"},Dx={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"},jx={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"},Nx={title:"Confirmar exclusão",confirmButton:"Confirmar",cancelButton:"Cancelar",closeAriaLabel:"Fechar"},Ox={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"},Px={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"},Rx={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"},Fx={contentTypeFiltersAriaLabel:"Filtros de tipo de conteúdo"},Mx={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"},Bx={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",cancelTargetAriaLabel:"Cancelar — voltar à navegação",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"},qx={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"},$x={contentPreviewAriaLabel:"Pré-visualização do conteúdo",closePreviewAriaLabel:"Fechar pré-visualização",addToUnitButton:"+ Adicionar à unidade"},Ux={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"},zx={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"},Vx={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."},Hx={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."},Qx={unitsAddedLabel:"Unidades adicionadas",contentItemsLabel:"Itens de conteúdo",progressLabel:"Progresso"},Wx={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"},Gx={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"},Kx={closeAriaLabel:"Fechar",fillCommentsError:"Preencha os comentários",cancelButton:"Cancelar"},Yx={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"},Zx={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"},Xx={remove:"Remover"},Jx={dropHere:"Solte aqui"},e_={loading:"Carregando"},t_={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",addCourseToLevelButton:"Adicionar curso a este nível",addLevelExamButton:"Adicionar Exame de nível — um curso com apenas um banco de questões",levelExamMeta:"Exame de nível · Apenas 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?",deleteLevelExamConfirm:"Remover este curso de Exame de nível do nível?",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 de Avaliação, portanto não pode ser usado como avaliação.',bothSlotsFilledToast:"As avaliações prévia e de resultado já estão preenchidas.",levelExamAlreadyFilledToast:"Este nível já tem um curso de Exame de nível — remova-o antes de adicionar outro.",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 de Avaliação — seu conteúdo só pode ser Bancos de Questões ou Avaliação de Curso, nunca outros tipos de conteúdo.",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",libraryAddLevelExamCourse:"Adicionar curso de Exame de nível para {level}",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.",levelNeedsMixedContentToast:"Este nível é o primeiro ou o último no percurso — um curso composto apenas por bancos de questões como único conteúdo será tratado como uma Avaliação prévia/final. Adicione outro curso, ou um curso com mais do que apenas bancos de questões.",cannotRemoveLastRegularCourseToast:"Este nível é o primeiro ou o último no percurso — remover este curso deixaria apenas o curso de Exame de Nível, que seria tratado como uma Avaliação prévia/final. Adicione outro curso primeiro.",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.",coursesCardHeading:"Cursos",coursesCardDescription:"Cursos que um aprendiz conclui para cumprir este nível — cada curso pode incluir suas próprias avaliações internas. Arraste a alça para reordenar, use o menu para remover.",coursesEmptyHint:"Ainda não adicionado — escolha um curso na Biblioteca.",courseMetaLabel:"Curso",removeFromLevelMenuItem:"Remover do nível"},r_={contextualEditor:ix,languageSelector:ax,collectionEditor:lx,breadcrumb:cx,tabBar:ux,contentEditForm:dx,titleAppIcon:fx,unitContentList:hx,contentRow:px,csvUpload:mx,manageCollaborators:gx,sparkMetaForm:vx,appIconField:yx,appIconPickerModal:bx,chipGroupField:Cx,dateTimeField:Sx,dialcodeInputField:xx,keywordSuggestField:_x,licenseSelectField:wx,multiSelectField:Tx,nestedSelectField:Ex,radioField:Ax,selectField:kx,textField:Ix,assetBrowser:Lx,resourceReorderDialog:Dx,assignPageNumber:jx,confirmDialog:Nx,publishChecklist:Ox,qualityParamsModal:Px,unsavedChangesModal:Rx,filterChips:Fx,libraryCard:Mx,libraryDock:Bx,libraryFilterPanel:qx,libraryPreviewPanel:$x,outlineTree:Ux,treeNode:zx,contentPlayer:Vx,dialcodePanel:Hx,progressStatus:Qx,splitBuilderShell:Wx,topbar:Gx,reviewCommentModal:Kx,confirmReviewModal:Yx,generateQRModal:Zx,chip:Xx,dropZone:Jx,spinner:e_,learningPath:t_},n_=["ar"],s_={en:za,ar:lS,fr:ox,pt:r_};function Gf(e,t){const r={...e};for(const n of Object.keys(t)){const s=e[n],o=t[n];s&&o&&typeof s=="object"&&typeof o=="object"&&!Array.isArray(s)&&!Array.isArray(o)?r[n]=Gf(s,o):o!==void 0&&(r[n]=o)}return r}function zc(e){const t=s_[e];return!t||e==="en"?za:Gf(za,t)}function o_(e){return n_.includes(e)}const Va="app-language",Ha="app-language-change",jl=ro(e=>({lang:"en",labelConfig:zc("en"),setLanguage:(t,r={})=>{e({lang:t,labelConfig:zc(t)}),localStorage.setItem(Va,t),document.documentElement.setAttribute("dir",o_(t)?"rtl":"ltr"),document.documentElement.setAttribute("lang",t),r.broadcast!==!1&&window.dispatchEvent(new CustomEvent(Ha,{detail:{lang:t}}))}}));function Kf(e,t){return function(){return e.apply(t,arguments)}}const{toString:i_}=Object.prototype,{getPrototypeOf:ts}=Object,{iterator:no,toStringTag:Yf}=Symbol,ei=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Bs=(e,t)=>{let r=e;const n=[];for(;r!=null&&r!==Object.prototype;){if(n.indexOf(r)!==-1)return!1;if(n.push(r),ei(r,t))return!0;r=ts(r)}return!1},a_=(e,t)=>e!=null&&Bs(e,t)?e[t]:void 0,Nl=(e=>t=>{const r=i_.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),cr=e=>(e=e.toLowerCase(),t=>Nl(t)===e),Ti=e=>t=>typeof t===e,{isArray:gn}=Array,rs=Ti("undefined");function cs(e){return e!==null&&!rs(e)&&e.constructor!==null&&!rs(e.constructor)&&Ft(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Zf=cr("ArrayBuffer");function l_(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Zf(e.buffer),t}const c_=Ti("string"),Ft=Ti("function"),Xf=Ti("number"),us=e=>e!==null&&typeof e=="object",u_=e=>e===!0||e===!1,jo=e=>{if(!us(e))return!1;const t=ts(e);return(t===null||t===Object.prototype||ts(t)===null)&&!Bs(e,Yf)&&!Bs(e,no)},d_=e=>{if(!us(e)||cs(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},f_=cr("Date"),h_=cr("File"),p_=e=>!!(e&&typeof e.uri<"u"),m_=e=>e&&typeof e.getParts<"u",g_=cr("Blob"),v_=cr("FileList"),y_=e=>us(e)&&Ft(e.pipe);function b_(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Vc=b_(),Hc=typeof Vc.FormData<"u"?Vc.FormData:void 0,C_=e=>{if(!e)return!1;if(Hc&&e instanceof Hc)return!0;const t=ts(e);if(!t||t===Object.prototype||!Ft(e.append))return!1;const r=Nl(e);return r==="formdata"||r==="object"&&Ft(e.toString)&&e.toString()==="[object FormData]"},S_=cr("URLSearchParams"),[x_,__,w_,T_]=["ReadableStream","Request","Response","Headers"].map(cr),E_=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function so(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,s;if(typeof e!="object"&&(e=[e]),gn(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{if(cs(e))return;const o=r?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let a;for(n=0;n<i;n++)a=o[n],t.call(null,e[a],a,e)}}function Jf(e,t){if(cs(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,s;for(;n-- >0;)if(s=r[n],t===s.toLowerCase())return s;return null}const tn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,eh=e=>!rs(e)&&e!==tn;function Qa(...e){const{caseless:t,skipUndefined:r}=eh(this)&&this||{},n={},s=(o,i)=>{if(i==="__proto__"||i==="constructor"||i==="prototype")return;const a=t&&typeof i=="string"&&Jf(n,i)||i,c=ei(n,a)?n[a]:void 0;jo(c)&&jo(o)?n[a]=Qa(c,o):jo(o)?n[a]=Qa({},o):gn(o)?n[a]=o.slice():(!r||!rs(o))&&(n[a]=o)};for(let o=0,i=e.length;o<i;o++){const a=e[o];if(!a||cs(a)||(so(a,s),typeof a!="object"||gn(a)))continue;const c=Object.getOwnPropertySymbols(a);for(let u=0;u<c.length;u++){const d=c[u];M_.call(a,d)&&s(a[d],d)}}return n}const A_=(e,t,r,{allOwnKeys:n}={})=>(so(t,(s,o)=>{r&&Ft(s)?Object.defineProperty(e,o,{__proto__:null,value:Kf(s,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{__proto__:null,value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),e),k_=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),I_=(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)},L_=(e,t,r,n)=>{let s,o,i;const a={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!n||n(i,e,t))&&!a[i]&&(t[i]=e[i],a[i]=!0);e=r!==!1&&ts(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},D_=(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},j_=e=>{if(!e)return null;if(gn(e))return e;let t=e.length;if(!Xf(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},N_=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ts(Uint8Array)),O_=(e,t)=>{const n=(e&&e[no]).call(e);let s;for(;(s=n.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},P_=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},R_=cr("HTMLFormElement"),F_=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,s){return n.toUpperCase()+s}),{propertyIsEnumerable:M_}=Object.prototype,B_=cr("RegExp"),th=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};so(r,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(n[o]=i||s)}),Object.defineProperties(e,n)},q_=e=>{th(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+"'")})}})},$_=(e,t)=>{const r={},n=s=>{s.forEach(o=>{r[o]=!0})};return gn(e)?n(e):n(String(e).split(t)),r},U_=()=>{},z_=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function V_(e){return!!(e&&Ft(e.append)&&e[Yf]==="FormData"&&e[no])}const H_=e=>{const t=new WeakSet,r=n=>{if(us(n)){if(t.has(n))return;if(cs(n))return n;if(!("toJSON"in n)){t.add(n);const s=gn(n)?[]:{};return so(n,(o,i)=>{const a=r(o);!rs(a)&&(s[i]=a)}),t.delete(n),s}}return n};return r(e)},Q_=cr("AsyncFunction"),W_=e=>e&&(us(e)||Ft(e))&&Ft(e.then)&&Ft(e.catch),rh=((e,t)=>e?setImmediate:t?((r,n)=>(tn.addEventListener("message",({source:s,data:o})=>{s===tn&&o===r&&n.length&&n.shift()()},!1),s=>{n.push(s),tn.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Ft(tn.postMessage)),G_=typeof queueMicrotask<"u"?queueMicrotask.bind(tn):typeof process<"u"&&process.nextTick||rh,nh=e=>e!=null&&Ft(e[no]),K_=e=>e!=null&&Bs(e,no)&&nh(e),D={isArray:gn,isArrayBuffer:Zf,isBuffer:cs,isFormData:C_,isArrayBufferView:l_,isString:c_,isNumber:Xf,isBoolean:u_,isObject:us,isPlainObject:jo,isEmptyObject:d_,isReadableStream:x_,isRequest:__,isResponse:w_,isHeaders:T_,isUndefined:rs,isDate:f_,isFile:h_,isReactNativeBlob:p_,isReactNative:m_,isBlob:g_,isRegExp:B_,isFunction:Ft,isStream:y_,isURLSearchParams:S_,isTypedArray:N_,isFileList:v_,forEach:so,merge:Qa,extend:A_,trim:E_,stripBOM:k_,inherits:I_,toFlatObject:L_,kindOf:Nl,kindOfTest:cr,endsWith:D_,toArray:j_,forEachEntry:O_,matchAll:P_,isHTMLForm:R_,hasOwnProperty:ei,hasOwnProp:ei,hasOwnInPrototypeChain:Bs,getSafeProp:a_,reduceDescriptors:th,freezeMethods:q_,toObjectSet:$_,toCamelCase:F_,noop:U_,toFiniteNumber:z_,findKey:Jf,global:tn,isContextDefined:eh,isSpecCompliantForm:V_,toJSONObject:H_,isAsyncFn:Q_,isThenable:W_,setImmediate:rh,asap:G_,isIterable:nh,isSafeIterable:K_},Y_=D.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"]),Z_=e=>{const t={};let r,n,s;return e&&e.split(`
|
|
529
|
-
`).forEach(function(
|
|
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(s=>n.set(s)),n}static accessor(t){const n=(this[Qc]=this[Qc]={accessors:{}}).accessors,s=this.prototype;function o(i){const a=vs(i);n[a]||(iw(s,i),n[a]=!0)}return D.isArray(t)?t.forEach(o):o(t),this}};Lt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);D.reduceDescriptors(Lt.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});D.freezeMethods(Lt);const aw="[REDACTED ****]";function lw(e){if(D.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(D.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function cw(e,t){const r=new Set(t.map(o=>String(o).toLowerCase())),n=[],s=o=>{if(o===null||typeof o!="object"||D.isBuffer(o))return o;if(n.indexOf(o)!==-1)return;o instanceof Lt&&(o=o.toJSON()),n.push(o);let i;if(D.isArray(o))i=[],o.forEach((a,c)=>{const u=s(a);D.isUndefined(u)||(i[c]=u)});else{if(!D.isPlainObject(o)&&lw(o))return n.pop(),o;i=Object.create(null);for(const[a,c]of Object.entries(o)){const u=r.has(a.toLowerCase())?aw:s(c);D.isUndefined(u)||(i[a]=u)}}return n.pop(),i};return s(e)}let te=class oh extends Error{static from(t,r,n,s,o,i){const a=new oh(t.message,r||t.code,n,s,o);return a.cause=t,a.name=t.name,t.status!=null&&a.status==null&&(a.status=t.status),i&&Object.assign(a,i),a}constructor(t,r,n,s,o){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),s&&(this.request=s),o&&(this.response=o,this.status=o.status)}toJSON(){const t=this.config,r=t&&D.hasOwnProp(t,"redact")?t.redact:void 0,n=D.isArray(r)&&r.length>0?cw(t,r):D.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}}};te.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";te.ERR_BAD_OPTION="ERR_BAD_OPTION";te.ECONNABORTED="ECONNABORTED";te.ETIMEDOUT="ETIMEDOUT";te.ECONNREFUSED="ECONNREFUSED";te.ERR_NETWORK="ERR_NETWORK";te.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";te.ERR_DEPRECATED="ERR_DEPRECATED";te.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";te.ERR_BAD_REQUEST="ERR_BAD_REQUEST";te.ERR_CANCELED="ERR_CANCELED";te.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";te.ERR_INVALID_URL="ERR_INVALID_URL";te.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const uw=null,ih=100;function Wa(e){return D.isPlainObject(e)||D.isArray(e)}function ah(e){return D.endsWith(e,"[]")?e.slice(0,-2):e}function Gi(e,t,r){return e?e.concat(t).map(function(s,o){return s=ah(s),!r&&o?"["+s+"]":s}).join(r?".":""):t}function dw(e){return D.isArray(e)&&!e.some(Wa)}const fw=D.toFlatObject(D,{},null,function(t){return/^is[A-Z]/.test(t)});function Ei(e,t,r){if(!D.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=D.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,S){return!D.isUndefined(S[b])});const n=r.metaTokens,s=r.visitor||C,o=r.dots,i=r.indexes,a=r.Blob||typeof Blob<"u"&&Blob,c=r.maxDepth===void 0?ih:r.maxDepth,u=a&&D.isSpecCompliantForm(t),d=[];if(!D.isFunction(s))throw new TypeError("visitor must be a function");function f(y){if(y===null)return"";if(D.isDate(y))return y.toISOString();if(D.isBoolean(y))return y.toString();if(!u&&D.isBlob(y))throw new te("Blob is not supported. Use a Buffer instead.");return D.isArrayBuffer(y)||D.isTypedArray(y)?u&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function p(y){if(y>c)throw new te("Object is too deeply nested ("+y+" levels). Max depth: "+c,te.ERR_FORM_DATA_DEPTH_EXCEEDED)}function m(y,b){if(c===1/0)return JSON.stringify(y);const S=[];return JSON.stringify(y,function(w,T){if(!D.isObject(T))return T;for(;S.length&&S[S.length-1]!==this;)S.pop();return S.push(T),p(b+S.length-1),T})}function C(y,b,S){let x=y;if(D.isReactNative(t)&&D.isReactNativeBlob(y))return t.append(Gi(S,b,o),f(y)),!1;if(y&&!S&&typeof y=="object"){if(D.endsWith(b,"{}"))b=n?b:b.slice(0,-2),y=m(y,1);else if(D.isArray(y)&&dw(y)||(D.isFileList(y)||D.endsWith(b,"[]"))&&(x=D.toArray(y)))return b=ah(b),x.forEach(function(T,L){!(D.isUndefined(T)||T===null)&&t.append(i===!0?Gi([b],L,o):i===null?b:b+"[]",f(T))}),!1}return Wa(y)?!0:(t.append(Gi(S,b,o),f(y)),!1)}const h=Object.assign(fw,{defaultVisitor:C,convertValue:f,isVisitable:Wa});function v(y,b,S=0){if(!D.isUndefined(y)){if(p(S),d.indexOf(y)!==-1)throw new Error("Circular reference detected in "+b.join("."));d.push(y),D.forEach(y,function(w,T){(!(D.isUndefined(w)||w===null)&&s.call(t,w,D.isString(T)?T.trim():T,b,h))===!0&&v(w,b?b.concat(T):[T],S+1)}),d.pop()}}if(!D.isObject(e))throw new TypeError("data must be an object");return v(e),t}function Wc(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(n){return t[n]})}function Pl(e,t){this._pairs=[],e&&Ei(e,this,t)}const lh=Pl.prototype;lh.append=function(t,r){this._pairs.push([t,r])};lh.toString=function(t){const r=t?function(n){return t.call(this,n,Wc)}:Wc;return this._pairs.map(function(s){return r(s[0])+"="+r(s[1])},"").join("&")};function hw(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ch(e,t,r){if(!t)return e;const n=D.isFunction(r)?{serialize:r}:r,s=D.getSafeProp(n,"encode")||hw,o=D.getSafeProp(n,"serialize");let i;if(o?i=o(t,n):i=D.isURLSearchParams(t)?t.toString():new Pl(t,n).toString(s),i){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Gc{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){D.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Rl={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},pw=typeof URLSearchParams<"u"?URLSearchParams:Pl,mw=typeof FormData<"u"?FormData:null,gw=typeof Blob<"u"?Blob:null,vw={isBrowser:!0,classes:{URLSearchParams:pw,FormData:mw,Blob:gw},protocols:["http","https","file","blob","url","data"]},Fl=typeof window<"u"&&typeof document<"u",Ga=typeof navigator=="object"&&navigator||void 0,yw=Fl&&(!Ga||["ReactNative","NativeScript","NS"].indexOf(Ga.product)<0),bw=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Cw=Fl&&window.location.href||"http://localhost",Sw=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Fl,hasStandardBrowserEnv:yw,hasStandardBrowserWebWorkerEnv:bw,navigator:Ga,origin:Cw},Symbol.toStringTag,{value:"Module"})),Ct={...Sw,...vw};function xw(e,t){return Ei(e,new Ct.classes.URLSearchParams,{visitor:function(r,n,s,o){return Ct.isNode&&D.isBuffer(r)?(this.append(n,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}const Kc=ih;function uh(e){if(e>Kc)throw new te("FormData field is too deeply nested ("+e+" levels). Max depth: "+Kc,te.ERR_FORM_DATA_DEPTH_EXCEEDED)}function _w(e){const t=[],r=/\w+|\[(\w*)]/g;let n;for(;(n=r.exec(e))!==null;)uh(t.length),t.push(n[0]==="[]"?"":n[1]||n[0]);return t}function ww(e){const t={},r=Object.keys(e);let n;const s=r.length;let o;for(n=0;n<s;n++)o=r[n],t[o]=e[o];return t}function dh(e){function t(r,n,s,o){uh(o);let i=r[o++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),c=o>=r.length;return i=!i&&D.isArray(s)?s.length:i,c?(D.hasOwnProp(s,i)?s[i]=D.isArray(s[i])?s[i].concat(n):[s[i],n]:s[i]=n,!a):((!D.hasOwnProp(s,i)||!D.isObject(s[i]))&&(s[i]=[]),t(r,n,s[i],o)&&D.isArray(s[i])&&(s[i]=ww(s[i])),!a)}if(D.isFormData(e)&&D.isFunction(e.entries)){const r={};return D.forEachEntry(e,(n,s)=>{t(_w(n),s,r,0)}),r}return null}const Tn=(e,t)=>e!=null&&D.hasOwnProp(e,t)?e[t]:void 0;function Tw(e,t,r){if(D.isString(e))try{return(t||JSON.parse)(e),D.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const oo={transitional:Rl,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",s=n.indexOf("application/json")>-1,o=D.isObject(t);if(o&&D.isHTMLForm(t)&&(t=new FormData(t)),D.isFormData(t))return s?JSON.stringify(dh(t)):t;if(D.isArrayBuffer(t)||D.isBuffer(t)||D.isStream(t)||D.isFile(t)||D.isBlob(t)||D.isReadableStream(t))return t;if(D.isArrayBufferView(t))return t.buffer;if(D.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(o){const c=Tn(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return xw(t,c).toString();if((a=D.isFileList(t))||n.indexOf("multipart/form-data")>-1){const u=Tn(this,"env"),d=u&&u.FormData;return Ei(a?{"files[]":t}:t,d&&new d,c)}}return o||s?(r.setContentType("application/json",!1),Tw(t)):t}],transformResponse:[function(t){const r=Tn(this,"transitional")||oo.transitional,n=r&&r.forcedJSONParsing,s=Tn(this,"responseType"),o=s==="json";if(D.isResponse(t)||D.isReadableStream(t))return t;if(t&&D.isString(t)&&(n&&!s||o)){const a=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,Tn(this,"parseReviver"))}catch(c){if(a)throw c.name==="SyntaxError"?te.from(c,te.ERR_BAD_RESPONSE,this,null,Tn(this,"response")):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ct.classes.FormData,Blob:Ct.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};D.forEach(["delete","get","head","post","put","patch","query"],e=>{oo.headers[e]={}});function Ki(e,t){const r=this||oo,n=t||r,s=Lt.from(n.headers);let o=n.data;return D.forEach(e,function(a){o=a.call(r,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function fh(e){return!!(e&&e.__CANCEL__)}let io=class extends te{constructor(t,r,n){super(t??"canceled",te.ERR_CANCELED,r,n),this.name="CanceledError",this.__CANCEL__=!0}};function hh(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new te("Request failed with status code "+r.status,r.status>=400&&r.status<500?te.ERR_BAD_REQUEST:te.ERR_BAD_RESPONSE,r.config,r.request,r))}function Ew(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}function Aw(e,t){e=e||10;const r=new Array(e),n=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(c){const u=Date.now(),d=n[o];i||(i=u),r[s]=c,n[s]=u;let f=o,p=0;for(;f!==s;)p+=r[f++],f=f%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),u-i<t)return;const m=d&&u-d;return m?Math.round(p*1e3/m):void 0}}function kw(e,t){let r=0,n=1e3/t,s,o;const i=(u,d=Date.now())=>{r=d,s=null,o&&(clearTimeout(o),o=null),e(...u)};return[(...u)=>{const d=Date.now(),f=d-r;f>=n?i(u,d):(s=u,o||(o=setTimeout(()=>{o=null,i(s)},n-f)))},()=>s&&i(s)]}const ti=(e,t,r=3)=>{let n=0;const s=Aw(50,250);return kw(o=>{if(!o||typeof o.loaded!="number")return;const i=o.loaded,a=o.lengthComputable?o.total:void 0,c=a!=null?Math.min(i,a):i,u=Math.max(0,c-n),d=s(u);n=Math.max(n,c);const f={loaded:c,total:a,progress:a?c/a:void 0,bytes:u,rate:d||void 0,estimated:d&&a?(a-c)/d:void 0,event:o,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(f)},r)},Yc=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Zc=e=>(...t)=>D.asap(()=>e(...t)),Iw=Ct.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Ct.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Ct.origin),Ct.navigator&&/(msie|trident)/i.test(Ct.navigator.userAgent)):()=>!0,Lw=Ct.hasStandardBrowserEnv?{write(e,t,r,n,s,o,i){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];D.isNumber(r)&&a.push(`expires=${new Date(r).toUTCString()}`),D.isString(n)&&a.push(`path=${n}`),D.isString(s)&&a.push(`domain=${s}`),o===!0&&a.push("secure"),D.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.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+/,""),s=n.indexOf("=");if(s!==-1&&n.slice(0,s)===e)return decodeURIComponent(n.slice(s+1))}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Dw(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function jw(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}const Nw=/^https?:(?!\/\/)/i,Ow=/[\t\n\r]/g;function Pw(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}function Rw(e){return Pw(e).replace(Ow,"")}function Xc(e,t){if(typeof e=="string"&&Nw.test(Rw(e)))throw new te('Invalid URL: missing "//" after protocol',te.ERR_INVALID_URL,t)}function ph(e,t,r,n){Xc(t,n);let s=!Dw(t);return e&&(s||r===!1)?(Xc(e,n),jw(e,t)):t}const Jc=e=>e instanceof Lt?{...e}:e;function vn(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(d,f,p,m){return D.isPlainObject(d)&&D.isPlainObject(f)?D.merge.call({caseless:m},d,f):D.isPlainObject(f)?D.merge({},f):D.isArray(f)?f.slice():f}function s(d,f,p,m){if(D.isUndefined(f)){if(!D.isUndefined(d))return n(void 0,d,p,m)}else return n(d,f,p,m)}function o(d,f){if(!D.isUndefined(f))return n(void 0,f)}function i(d,f){if(D.isUndefined(f)){if(!D.isUndefined(d))return n(void 0,d)}else return n(void 0,f)}function a(d){const f=D.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!D.isUndefined(f))if(D.isPlainObject(f)){if(D.hasOwnProp(f,d))return f[d]}else return;const p=D.hasOwnProp(e,"transitional")?e.transitional:void 0;if(D.isPlainObject(p)&&D.hasOwnProp(p,d))return p[d]}function c(d,f,p){if(D.hasOwnProp(t,p))return n(d,f);if(D.hasOwnProp(e,p))return n(void 0,d)}const u={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,allowedSocketPaths:i,responseEncoding:i,validateStatus:c,headers:(d,f,p)=>s(Jc(d),Jc(f),p,!0)};return D.forEach(Object.keys({...e,...t}),function(f){if(f==="__proto__"||f==="constructor"||f==="prototype")return;const p=D.hasOwnProp(u,f)?u[f]:s,m=D.hasOwnProp(e,f)?e[f]:void 0,C=D.hasOwnProp(t,f)?t[f]:void 0,h=p(m,C,f);D.isUndefined(h)&&p!==c||(r[f]=h)}),D.hasOwnProp(t,"validateStatus")&&D.isUndefined(t.validateStatus)&&a("validateStatusUndefinedResolves")===!1&&(D.hasOwnProp(e,"validateStatus")?r.validateStatus=n(void 0,e.validateStatus):delete r.validateStatus),r}const Fw=["content-type","content-length"];function Mw(e,t,r){if(r!=="content-only"){e.set(t);return}Object.entries(t).forEach(([n,s])=>{Fw.includes(n.toLowerCase())&&e.set(n,s)})}const Bw=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16)));function mh(e){const t=vn({},e),r=p=>D.hasOwnProp(t,p)?t[p]:void 0,n=r("data");let s=r("withXSRFToken");const o=r("xsrfHeaderName"),i=r("xsrfCookieName");let a=r("headers");const c=r("auth"),u=r("baseURL"),d=r("allowAbsoluteUrls"),f=r("url");if(t.headers=a=Lt.from(a),t.url=ch(ph(u,f,d,t),r("params"),r("paramsSerializer")),c){const p=D.getSafeProp(c,"username")||"",m=D.getSafeProp(c,"password")||"";a.set("Authorization","Basic "+btoa(p+":"+(m?Bw(m):"")))}if(D.isFormData(n)&&(Ct.hasStandardBrowserEnv||Ct.hasStandardBrowserWebWorkerEnv||D.isReactNative(n)?a.setContentType(void 0):D.isFunction(n.getHeaders)&&Mw(a,n.getHeaders(),r("formDataHeaderPolicy"))),Ct.hasStandardBrowserEnv&&(D.isFunction(s)&&(s=s(t)),s===!0||s==null&&Iw(t.url))){const m=o&&i&&Lw.read(i);m&&a.set(o,m)}return t}const qw=typeof XMLHttpRequest<"u",$w=qw&&function(e){return new Promise(function(r,n){const s=mh(e);let o=s.data;const i=Lt.from(s.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:u}=s,d,f,p,m,C;function h(){m&&m(),C&&C(),s.cancelToken&&s.cancelToken.unsubscribe(d),s.signal&&s.signal.removeEventListener("abort",d)}let v=new XMLHttpRequest;v.open(s.method.toUpperCase(),s.url,!0),v.timeout=s.timeout;function y(){if(!v)return;const S=Lt.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),w={data:!a||a==="text"||a==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:S,config:e,request:v};hh(function(L){r(L),h()},function(L){n(L),h()},w),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 te("Request aborted",te.ECONNABORTED,e,v)),h(),v=null)},v.onerror=function(x){const w=x&&x.message?x.message:"Network Error",T=new te(w,te.ERR_NETWORK,e,v);T.event=x||null,n(T),h(),v=null},v.ontimeout=function(){let x=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const w=s.transitional||Rl;s.timeoutErrorMessage&&(x=s.timeoutErrorMessage),n(new te(x,w.clarifyTimeoutError?te.ETIMEDOUT:te.ECONNABORTED,e,v)),h(),v=null},o===void 0&&i.setContentType(null),"setRequestHeader"in v&&D.forEach(sh(i),function(x,w){v.setRequestHeader(w,x)}),D.isUndefined(s.withCredentials)||(v.withCredentials=!!s.withCredentials),a&&a!=="json"&&(v.responseType=s.responseType),u&&([p,C]=ti(u,!0),v.addEventListener("progress",p)),c&&v.upload&&([f,m]=ti(c),v.upload.addEventListener("progress",f),v.upload.addEventListener("loadend",m)),(s.cancelToken||s.signal)&&(d=S=>{v&&(n(!S||S.type?new io(null,e,v):S),v.abort(),h(),v=null)},s.cancelToken&&s.cancelToken.subscribe(d),s.signal&&(s.signal.aborted?d():s.signal.addEventListener("abort",d)));const b=Ew(s.url);if(b&&!Ct.protocols.includes(b)){n(new te("Unsupported protocol "+b+":",te.ERR_BAD_REQUEST,e));return}v.send(o||null)})},Uw=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const r=new AbortController;let n=!1;const s=function(c){if(!n){n=!0,i();const u=c instanceof Error?c:this.reason;r.abort(u instanceof te?u:new io(u instanceof Error?u.message:u))}};let o=t&&setTimeout(()=>{o=null,s(new te(`timeout of ${t}ms exceeded`,te.ETIMEDOUT))},t);const i=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),e=null)};e.forEach(c=>c.addEventListener("abort",s));const{signal:a}=r;return a.unsubscribe=()=>D.asap(i),a},zw=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,s;for(;n<r;)s=n+t,yield e.slice(n,s),n=s},Vw=async function*(e,t){for await(const r of Hw(e))yield*zw(r,t)},Hw=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()}},eu=(e,t,r,n)=>{const s=Vw(e,t);let o=0,i,a=c=>{i||(i=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:u,value:d}=await s.next();if(u){a(),c.close();return}let f=d.byteLength;if(r){let p=o+=f;r(p)}c.enqueue(new Uint8Array(d))}catch(u){throw a(u),u}},cancel(c){return a(c),s.return()}},{highWaterMark:2})},ri=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,Qw=(e,t,r)=>t+2<r&&ri(e.charCodeAt(t+1))&&ri(e.charCodeAt(t+2));function Ww(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 i=n.length;const a=n.length;for(let m=0;m<a;m++)if(n.charCodeAt(m)===37&&m+2<a){const C=n.charCodeAt(m+1),h=n.charCodeAt(m+2);ri(C)&&ri(h)&&(i-=2,m+=2)}let c=0,u=a-1;const d=m=>m>=2&&n.charCodeAt(m-2)===37&&n.charCodeAt(m-1)===51&&(n.charCodeAt(m)===68||n.charCodeAt(m)===100);u>=0&&(n.charCodeAt(u)===61?(c++,u--):d(u)&&(c++,u-=3)),c===1&&u>=0&&(n.charCodeAt(u)===61||d(u))&&c++;const p=Math.floor(i/4)*3-(c||0);return p>0?p:0}let o=0;for(let i=0,a=n.length;i<a;i++){const c=n.charCodeAt(i);if(c===37&&Qw(n,i,a))o+=1,i+=2;else if(c<128)o+=1;else if(c<2048)o+=2;else if(c>=55296&&c<=56319&&i+1<a){const u=n.charCodeAt(i+1);u>=56320&&u<=57343?(o+=4,i++):o+=3}else o+=3}return o}const Ml="1.18.0",tu=64*1024,{isFunction:bo}=D,Gw=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16))),ru=e=>{if(!D.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},nu=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Kw=e=>{const t=e.indexOf("://");let r=e;return t!==-1&&(r=r.slice(t+3)),r.includes("@")||r.includes(":")},Yw=e=>{const t=D.global!==void 0&&D.global!==null?D.global:globalThis,{ReadableStream:r,TextEncoder:n}=t;e=D.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:s,Request:o,Response:i}=e,a=s?bo(s):typeof fetch=="function",c=bo(o),u=bo(i);if(!a)return!1;const d=a&&bo(r),f=a&&(typeof n=="function"?(y=>b=>y.encode(b))(new n):async y=>new Uint8Array(await new o(y).arrayBuffer())),p=c&&d&&nu(()=>{let y=!1;const b=new o(Ct.origin,{body:new r,method:"POST",get duplex(){return y=!0,"half"}}),S=b.headers.has("Content-Type");return b.body!=null&&b.body.cancel(),y&&!S}),m=u&&d&&nu(()=>D.isReadableStream(new i("").body)),C={stream:m&&(y=>y.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(y=>{!C[y]&&(C[y]=(b,S)=>{let x=b&&b[y];if(x)return x.call(b);throw new te(`Response type '${y}' is not supported`,te.ERR_NOT_SUPPORT,S)})});const h=async y=>{if(y==null)return 0;if(D.isBlob(y))return y.size;if(D.isSpecCompliantForm(y))return(await new o(Ct.origin,{method:"POST",body:y}).arrayBuffer()).byteLength;if(D.isArrayBufferView(y)||D.isArrayBuffer(y))return y.byteLength;if(D.isURLSearchParams(y)&&(y=y+""),D.isString(y))return(await f(y)).byteLength},v=async(y,b)=>{const S=D.toFiniteNumber(y.getContentLength());return S??h(b)};return async y=>{let{url:b,method:S,data:x,signal:w,cancelToken:T,timeout:L,onDownloadProgress:A,onUploadProgress:O,responseType:P,headers:j,withCredentials:N="same-origin",fetchOptions:F,maxContentLength:R,maxBodyLength:U}=mh(y);const re=D.isNumber(R)&&R>-1,G=D.isNumber(U)&&U>-1,pe=M=>D.hasOwnProp(y,M)?y[M]:void 0;let me=s||fetch;P=P?(P+"").toLowerCase():"text";let V=Uw([w,T&&T.toAbortSignal()],L),de=null;const oe=V&&V.unsubscribe&&(()=>{V.unsubscribe()});let Se,ve=null;const q=()=>new te("Request body larger than maxBodyLength limit",te.ERR_BAD_REQUEST,y,de);try{let M;const $=pe("auth");if($){const Q=D.getSafeProp($,"username")||"",Ce=D.getSafeProp($,"password")||"";M={username:Q,password:Ce}}if(Kw(b)){const Q=new URL(b,Ct.origin);if(!M&&(Q.username||Q.password)){const Ce=ru(Q.username),qe=ru(Q.password);M={username:Ce,password:qe}}(Q.username||Q.password)&&(Q.username="",Q.password="",b=Q.href)}if(M&&(j.delete("authorization"),j.set("Authorization","Basic "+btoa(Gw((M.username||"")+":"+(M.password||""))))),re&&typeof b=="string"&&b.startsWith("data:")&&Ww(b)>R)throw new te("maxContentLength size of "+R+" exceeded",te.ERR_BAD_RESPONSE,y,de);if(G&&S!=="get"&&S!=="head"){const Q=await h(x);if(typeof Q=="number"&&isFinite(Q)&&(Se=Q,Q>U))throw q()}const ne=G&&(D.isReadableStream(x)||D.isStream(x)),ie=(Q,Ce,qe)=>eu(Q,tu,et=>{if(G&&et>U)throw ve=q();Ce&&Ce(et)},qe);if(p&&S!=="get"&&S!=="head"&&(O||ne)){if(Se=Se??await v(j,x),Se!==0||ne){let Q=new o(b,{method:"POST",body:x,duplex:"half"}),Ce;if(D.isFormData(x)&&(Ce=Q.headers.get("content-type"))&&j.setContentType(Ce),Q.body){const[qe,et]=O&&Yc(Se,ti(Zc(O)))||[];x=ie(Q.body,qe,et)}}}else if(ne&&!c&&d&&S!=="get"&&S!=="head")x=ie(x);else if(ne&&c&&!p&&S!=="get"&&S!=="head")throw new te("Stream request bodies are not supported by the current fetch implementation",te.ERR_NOT_SUPPORT,y,de);D.isString(N)||(N=N?"include":"omit");const xe=c&&"credentials"in o.prototype;if(D.isFormData(x)){const Q=j.getContentType();Q&&/^multipart\/form-data/i.test(Q)&&!/boundary=/i.test(Q)&&j.delete("content-type")}j.set("User-Agent","axios/"+Ml,!1);const fe={...F,signal:V,method:S.toUpperCase(),headers:sh(j.normalize()),body:x,duplex:"half",credentials:xe?N:void 0};de=c&&new o(b,fe);let ge=await(c?me(de,F):me(b,fe));const Ae=Lt.from(ge.headers);if(re){const Q=D.toFiniteNumber(Ae.getContentLength());if(Q!=null&&Q>R)throw new te("maxContentLength size of "+R+" exceeded",te.ERR_BAD_RESPONSE,y,de)}const J=m&&(P==="stream"||P==="response");if(m&&ge.body&&(A||re||J&&oe)){const Q={};["status","statusText","headers"].forEach(tt=>{Q[tt]=ge[tt]});const Ce=D.toFiniteNumber(Ae.getContentLength()),[qe,et]=A&&Yc(Ce,ti(Zc(A),!0))||[];let $e=0;const We=tt=>{if(re&&($e=tt,$e>R))throw new te("maxContentLength size of "+R+" exceeded",te.ERR_BAD_RESPONSE,y,de);qe&&qe(tt)};ge=new i(eu(ge.body,tu,We,()=>{et&&et(),oe&&oe()}),Q)}P=P||"text";let he=await C[D.findKey(C,P)||"text"](ge,y);if(re&&!m&&!J){let Q;if(he!=null&&(typeof he.byteLength=="number"?Q=he.byteLength:typeof he.size=="number"?Q=he.size:typeof he=="string"&&(Q=typeof n=="function"?new n().encode(he).byteLength:he.length)),typeof Q=="number"&&Q>R)throw new te("maxContentLength size of "+R+" exceeded",te.ERR_BAD_RESPONSE,y,de)}return!J&&oe&&oe(),await new Promise((Q,Ce)=>{hh(Q,Ce,{data:he,headers:Lt.from(ge.headers),status:ge.status,statusText:ge.statusText,config:y,request:de})})}catch(M){if(oe&&oe(),V&&V.aborted&&V.reason instanceof te){const $=V.reason;throw $.config=y,de&&($.request=de),M!==$&&($.cause=M),$}throw ve?(de&&!ve.request&&(ve.request=de),ve):M instanceof te?(de&&!M.request&&(M.request=de),M):M&&M.name==="TypeError"&&/Load failed|fetch/i.test(M.message)?Object.assign(new te("Network Error",te.ERR_NETWORK,y,de,M&&M.response),{cause:M.cause||M}):te.from(M,M&&M.code,y,de,M&&M.response)}}},Zw=new Map,gh=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:s}=t,o=[n,s,r];let i=o.length,a=i,c,u,d=Zw;for(;a--;)c=o[a],u=d.get(c),u===void 0&&d.set(c,u=a?new Map:Yw(t)),d=u;return u};gh();const Bl={http:uw,xhr:$w,fetch:{get:gh}};D.forEach(Bl,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const su=e=>`- ${e}`,Xw=e=>D.isFunction(e)||e===null||e===!1;function Jw(e,t){e=D.isArray(e)?e:[e];const{length:r}=e;let n,s;const o={};for(let i=0;i<r;i++){n=e[i];let a;if(s=n,!Xw(n)&&(s=Bl[(a=String(n)).toLowerCase()],s===void 0))throw new te(`Unknown adapter '${a}'`);if(s&&(D.isFunction(s)||(s=s.get(t))))break;o[a||"#"+i]=s}if(!s){const i=Object.entries(o).map(([c,u])=>`adapter ${c} `+(u===!1?"is not supported by the environment":"is not available in the build"));let a=r?i.length>1?`since :
|
|
531
|
-
`+
|
|
532
|
-
`):" "+su(
|
|
533
|
-
`);return
|
|
534
|
-
`),a
|
|
535
|
-
`,
|
|
536
|
-
`+o)}}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=vn(this.defaults,r);const{transitional:n,paramsSerializer:s,headers:o}=r;n!==void 0&&Oo.assertOptions(n,{silentJSONParsing:xt.transitional(xt.boolean),forcedJSONParsing:xt.transitional(xt.boolean),clarifyTimeoutError:xt.transitional(xt.boolean),legacyInterceptorReqResOrdering:xt.transitional(xt.boolean),advertiseZstdAcceptEncoding:xt.transitional(xt.boolean),validateStatusUndefinedResolves:xt.transitional(xt.boolean)},!1),s!=null&&(D.isFunction(s)?r.paramsSerializer={serialize:s}:Oo.assertOptions(s,{encode:xt.function,serialize:xt.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Oo.assertOptions(r,{baseUrl:xt.spelling("baseURL"),withXsrfToken:xt.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=o&&D.merge(o.common,o[r.method]);o&&D.forEach(["delete","get","head","post","put","patch","query","common"],C=>{delete o[C]}),r.headers=Lt.concat(i,o);const a=[];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||Rl;v&&v.legacyInterceptorReqResOrdering?a.unshift(h.fulfilled,h.rejected):a.push(h.fulfilled,h.rejected)});const u=[];this.interceptors.response.forEach(function(h){u.push(h.fulfilled,h.rejected)});let d,f=0,p;if(!c){const C=[ou.bind(this),void 0];for(C.unshift(...a),C.push(...u),p=C.length,d=Promise.resolve(r);f<p;)d=d.then(C[f++],C[f++]);return d}p=a.length;let m=r;for(;f<p;){const C=a[f++],h=a[f++];try{m=C(m)}catch(v){h.call(this,v);break}}try{d=ou.call(this,m)}catch(C){return Promise.reject(C)}for(f=0,p=u.length;f<p;)d=d.then(u[f++],u[f++]);return d}getUri(t){t=vn(this.defaults,t);const r=ph(t.baseURL,t.url,t.allowAbsoluteUrls,t);return ch(r,t.params,t.paramsSerializer)}};D.forEach(["delete","get","head","options"],function(t){pn.prototype[t]=function(r,n){return this.request(vn(n||{},{method:t,url:r,data:n&&D.hasOwnProp(n,"data")?n.data:void 0}))}});D.forEach(["post","put","patch","query"],function(t){function r(n){return function(o,i,a){return this.request(vn(a||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}pn.prototype[t]=r(),t!=="query"&&(pn.prototype[t+"Form"]=r(!0))});let tT=class yh{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});const n=this;this.promise.then(s=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](s);n._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(a=>{n.subscribe(a),o=a}).then(s);return i.cancel=function(){n.unsubscribe(o)},i},t(function(o,i,a){n.reason||(n.reason=new io(o,i,a),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 yh(function(s){t=s}),cancel:t}}};function rT(e){return function(r){return e.apply(null,r)}}function nT(e){return D.isObject(e)&&e.isAxiosError===!0}const Ka={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(Ka).forEach(([e,t])=>{Ka[t]=e});function bh(e){const t=new pn(e),r=Kf(pn.prototype.request,t);return D.extend(r,pn.prototype,t,{allOwnKeys:!0}),D.extend(r,t,null,{allOwnKeys:!0}),r.create=function(s){return bh(vn(e,s))},r}const st=bh(oo);st.Axios=pn;st.CanceledError=io;st.CancelToken=tT;st.isCancel=fh;st.VERSION=Ml;st.toFormData=Ei;st.AxiosError=te;st.Cancel=st.CanceledError;st.all=function(t){return Promise.all(t)};st.spread=rT;st.isAxiosError=nT;st.mergeConfig=vn;st.AxiosHeaders=Lt;st.formToJSON=e=>dh(D.isHTMLForm(e)?new FormData(e):e);st.getAdapter=vh.getAdapter;st.HttpStatusCode=Ka;st.default=st;const{Axios:s$,AxiosError:o$,CanceledError:i$,isCancel:a$,CancelToken:l$,VERSION:c$,all:u$,Cancel:d$,isAxiosError:f$,spread:h$,toFormData:p$,AxiosHeaders:m$,HttpStatusCode:g$,formToJSON:v$,getAdapter:y$,mergeConfig:b$,create:C$}=st;let Ya="";function Ch(e){Ya=e}const Fe=st.create({timeout:3e4});function sT(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)}Fe.interceptors.request.use(async e=>{var s,o,i;const{useEditorStore:t}=await Promise.resolve().then(()=>mb),r=t.getState(),n=(s=r.editorConfig)==null?void 0:s.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=sT(e.url,(i=(o=r.editorConfig)==null?void 0:o.config)==null?void 0:i.apiSlug),Ya&&(e.baseURL=Ya),e});const Sh=["identifier","name","mimeType","contentType","primaryCategory","appIcon","channel","organisation","pkgVersion"];async function oT(e){var i;const t={status:["Live"],...e.filters??{}};e.channel&&(t.channel=e.channel);const n=((i=(await Fe.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??Sh}},{headers:{"X-Source":"web","X-msgid":Math.random().toString(36).slice(2)}})).data)==null?void 0:i.result)??{},s=new Set(["count","facets"]);return{content:Object.entries(n).filter(([a])=>!s.has(a)).flatMap(([,a])=>Array.isArray(a)?a:[]),count:n.count??0}}async function xh(e){var r,n;return(n=(r=(await Fe.get(`/action/content/v3/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.content}const _h="Evaluation Course";function qn(e){return(e==null?void 0:e.primaryCategory)===_h}function iT(e){const t=(e.children??[]).map(r=>({...r,children:(r.children??[]).map(n=>{var o;const s=!!((o=n.metadata)!=null&&o.isAssessmentCourse)||qn(n.metadata);return{...n,isFolder:!1,children:[],metadata:{...n.metadata??{},...s?{isAssessmentCourse:!0}:{}}}})}));return{...e,children:t}}function nt(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 wh(e){return((e==null?void 0:e.children)??[]).find(t=>{var r;return!!((r=t.metadata)!=null&&r.isAssessmentCourse)})}function aT(e,t,r){return r?e===0?"pre":e===t-1?"post":"levelAssessment":"content"}function lT(e,t){const r=e.findIndex(s=>s.id===t);return r===-1?null:$s(e,r)?{role:r===0?"pre":"post",levelNumber:null}:{role:"level",levelNumber:e.slice(0,r+1).filter((s,o)=>!$s(e,o)).length}}function qs(e,t){return t==="pre"?e.length>0&&nt(e[0]):e.length>1&&nt(e[e.length-1])}function $s(e,t){const r=aT(t,e.length,nt(e[t]));return r==="pre"||r==="post"}function Za(e,t){const r=t?e.findIndex(n=>n.id===t.id):-1;return r!==-1&&$s(e,r)}function au(e,t){var n,s;return(((n=e[0])==null?void 0:n.id)===t.id||((s=e[e.length-1])==null?void 0:s.id)===t.id)&&(t.children??[]).length===0}function cT(e){return qs(e,"pre")?qs(e,"post")?null:"post":"pre"}function uT(e,t,r){if(t<0||t>=e.length)return!1;const n=nt(e[0])?e[0]:null,s=e.length>1&&nt(e[e.length-1])?e[e.length-1]:null,o=[...e],[i]=o.splice(t,1);return o.splice(r,0,i),!(n&&o[0]!==n||s&&o[o.length-1]!==s||!n&&nt(o[0])||!s&&o.length>1&&nt(o[o.length-1]))}function lu(e,t,r){return r?!1:t?!((e==null?void 0:e.children)??[]).some(s=>{var o;return!!((o=s.metadata)!=null&&o.isAssessmentCourse)}):!0}function yn(e){return Array.isArray(e)?e.map(String):e?[String(e)]:[]}function Th(e,t){var n,s;return e?((n=t[e.id])==null?void 0:n.framework)??((s=e.metadata)==null?void 0:s.framework):void 0}function Eh(e,t){return!!Th(e,t)}function Ah(e,t){if(!e||!t)return[];const r=new Set,n=e.children??[];return n.forEach((s,o)=>{var i,a;$s(n,o)?yn((i=s.children[0].metadata)==null?void 0:i[t]).forEach(c=>r.add(c)):yn((a=s.metadata)==null?void 0:a[t]).forEach(c=>r.add(c))}),Array.from(r)}function dT(e,t,r){var u,d;if(!e||!t)return null;const n=Ah(e,t),s=((u=r[e.id])==null?void 0:u[t])??((d=e.metadata)==null?void 0:d[t]),o=yn(s),i=[...n].sort(),a=[...o].sort();return i.length===a.length&&i.every((f,p)=>f===a[p])?null:n}function fT(e,t,r){if(!e||!t||r.length===0)return[];const n=e.children??[];return n.filter((s,o)=>{var a;return $s(n,o)?!1:yn((a=s.metadata)==null?void 0:a[t]).some(c=>!r.includes(c))})}function kh(e,t,r){var s;if(!e||!r||t.length===0)return[];const n=new Set;for(const o of e.children??[])yn((s=o.metadata)==null?void 0:s[r]).forEach(i=>n.add(i));return t.filter(o=>!n.has(o))}const Ih=new Set(["adaptive"]);function ql(e,t,r,n={}){var C,h,v,y;const s=[];if(!e)return s;const o=((C=n[e.id])==null?void 0:C.policy)??((h=e.metadata)==null?void 0:h.policy);o||s.push({code:"policyMissing",message:"Set a consumption policy for this path."});const i=e.children??[],a=i[0],c=i.length>1?i[i.length-1]:void 0,u=nt(a),d=nt(c);!u&&o&&Ih.has(o)&&s.push({code:"priorAssessmentRequired",message:"A Prior Assessment is required for the Adaptive policy."}),[[a,"Prior Assessment"],[c,"Outcome Assessment"]].forEach(([b,S])=>{if(!b)return;const x=b.children??[],w=x.filter(T=>{var L;return!!((L=T.metadata)!=null&&L.isAssessmentCourse)});w.length!==0&&(w.length<x.length||x.length!==1&&s.push({code:"slotNotPure",nodeId:b.id,message:`${S} must contain exactly one question-set-only course.`}))});const f=new Set,p=(b,S)=>{f.has(b)&&s.push({code:"duplicateCourse",nodeId:S,message:"A course appears more than once in this path."}),f.add(b)},m=i.slice(u?1:0,i.length-(d?1:0));u&&p(a.children[0].id,a.id),d&&p(c.children[0].id,c.id);for(const b of m){const S=b.children??[],x=S.length===0;x&&s.push({code:"emptyLevel",nodeId:b.id,message:`"${b.name}" has no courses yet.`});const w=t?yn((v=b.metadata)==null?void 0:v[t]):[];if(w.length===0)x||s.push({code:"levelMissingSkills",nodeId:b.id,message:`"${b.name}" needs at least one skill selected.`});else{if(r.length>0){const L=w.filter(A=>!r.includes(A));L.length>0&&s.push({code:"levelSkillsOutOfScope",nodeId:b.id,message:`"${b.name}" has skills outside the current scope: ${L.join(", ")}.`})}const T=kh(b,w,t);T.length>0&&s.push({code:"levelSkillsUncovered",nodeId:b.id,message:`"${b.name}" has no course covering: ${T.join(", ")}.`})}for(const T of S)p(T.id,b.id),(t?yn((y=T.metadata)==null?void 0:y[t]):[]).length===0&&s.push({code:"courseMissingSkillTag",nodeId:T.id,message:`"${T.name}" has no skill tag.`})}return s}async function hT(e){const t=[],r=(e==null?void 0:e.children)??[],n=r[0],s=r.length>1?r[r.length-1]:void 0;for(const[o,i]of[[n,"Prior Assessment"],[s,"Outcome Assessment"]]){if(!o||!nt(o))continue;const a=o.children[0].id,c=await xh(a);qn(c)||t.push({code:"slotCourseChanged",nodeId:o.id,message:`${i}'s course is no longer an Evaluation Course — pick a different course.`})}return t}function Tt(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 Lh(e,t,r=0){var n;for(const s of e){if(s.id===t)return r;if((n=s.children)!=null&&n.length){const o=Lh(s.children,t,r+1);if(o>=0)return o}}return-1}const cu=new Set(["name","appIcon","description","keywords","trackable","qrCodeProcessId","reservedDialcodes"]);function Dh(e,t,r,n){return e.map(s=>{if(s.id===t){const o=r.metadata??{},i=n!=null&&n.length?new Set([...cu,...n]):cu,a={};for(const c of i)c in r&&(a[c]=r[c]);return{...s,...r,metadata:{...s.metadata??{},...a,...o}}}return s.children&&s.children.length>0?{...s,children:Dh(s.children,t,r,n)}:s})}function Po(e,t,r){return e.map(n=>n.id===t?{...n,children:[...n.children??[],r]}:n.children&&n.children.length>0?{...n,children:Po(n.children,t,r)}:n)}function jh(e,t,r,n){return e.map(s=>{if(s.id===t){const o=[...s.children??[]];return o.splice(n,0,r),{...s,children:o}}return s.children&&s.children.length>0?{...s,children:jh(s.children,t,r,n)}:s})}function Xa(e,t){return e.filter(r=>r.id!==t).map(r=>({...r,children:r.children?Xa(r.children,t):[]}))}function Ja(e,t,r,n){return e.map(s=>{if(s.id===t){const o=[...s.children??[]],[i]=o.splice(r,1);return o.splice(n,0,i),{...s,children:o}}return s.children&&s.children.length>0?{...s,children:Ja(s.children,t,r,n)}:s})}function Nh(e,t){return e.map(r=>{const n=t[r.id]??r.id,s=r.parent?t[r.parent]??r.parent:r.parent;return{...r,id:n,identifier:n,parent:s,children:r.children?Nh(r.children,t):[]}})}function pT(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 mT(e,t){const r=Tt(e,t);if(!r)return[];const n=[];let s=r;for(;s;)n.unshift({id:s.id,name:s.name}),s=s.parent?Tt(e,s.parent):void 0;return n}const se=ro((e,t)=>({treeData:[],selectedNodeId:null,treeCache:{},breadcrumb:[],activeNodeMeta:{},setTreeData:r=>{var s;const n=((s=r[0])==null?void 0:s.id)??null;e({treeData:r,selectedNodeId:n}),n&&setTimeout(()=>t().selectNode(n),0)},selectNode:r=>{const{treeData:n,treeCache:s,getBreadcrumb:o}=t(),i=Tt(n,r),a=o(r),c={...(i==null?void 0:i.metadata)??{},...s[r]??{}};X.getState().setNodeFlags({isFolder:(i==null?void 0:i.isFolder)??!1,isRoot:!(i!=null&&i.parent),isQuml:!1}),rt.getState().setActiveAssessmentSlot(null),e({selectedNodeId:r,breadcrumb:a,activeNodeMeta:c})},updateNode:(r,n,s)=>{if(e(o=>({treeData:Dh(o.treeData,r,n,s),treeCache:{...o.treeCache,[r]:{...o.treeCache[r]??{},...n}}})),t().selectedNodeId===r){const o=Tt(t().treeData,r);e(i=>({activeNodeMeta:{...(o==null?void 0:o.metadata)??{},...i.treeCache[r]??{}}}))}t().markDirty()},addNode:(r,n)=>{var p,m,C;const s=t(),o=X.getState().editorProfile,i=((m=(p=X.getState().editorConfig)==null?void 0:p.config)==null?void 0:m.maxDepth)??o.maxDepth,a=Lh(s.treeData,r);if(a>=i)return console.warn(`[tree.store] addNode: depth would exceed maxDepth (${i}). parentDepth=${a}`),"";const c="temp-"+Math.random().toString(36).slice(2),u={id:c,identifier:c,name:o.defaultUnitName,isFolder:!0,children:[],parent:r,metadata:{mimeType:"application/vnd.ekstep.content-collection",code:crypto.randomUUID(),name:o.defaultUnitName,contentType:o.unitContentType,primaryCategory:o.unitPrimaryCategory,visibility:"Parent"}},d=((C=Tt(s.treeData,r))==null?void 0:C.children)??[],f=o.derivedRoles&&qs(d,"post");return e(h=>({treeData:f?jh(h.treeData,r,u,d.length-1):Po(h.treeData,r,u),treeCache:{...h.treeCache,[c]:{...u.metadata,isNew:!0}}})),setTimeout(()=>t().selectNode(c),0),c},deleteNode:r=>{var o,i,a;const n=(o=t().treeData[0])==null?void 0:o.id;if(r===n)return!1;if(X.getState().editorProfile.derivedRoles){const c=Tt(t().treeData,r),u=c!=null&&c.parent?Tt(t().treeData,c.parent):void 0,d=((i=t().treeData[0])==null?void 0:i.children)??[],f=u?d.findIndex(p=>p.id===u.id):-1;if(f===0||f===d.length-1){const p=(u.children??[]).filter(m=>m.id!==r);if(p.length===1&&((a=p[0].metadata)!=null&&a.isAssessmentCourse))return!1}}return e(c=>({treeData:Xa(c.treeData,r),selectedNodeId:c.selectedNodeId===r?null:c.selectedNodeId})),!0},reorderChildren:(r,n,s)=>{var a;const o=X.getState().editorProfile,i=(a=t().treeData[0])==null?void 0:a.id;if(o.derivedRoles&&r===i){const c=Tt(t().treeData,r);if(c!=null&&c.children&&!uT(c.children,n,s))return}e(c=>({treeData:Ja(c.treeData,r,n,s)}))},moveNode:(r,n,s)=>{var u,d,f;const o=X.getState().editorProfile,i=Tt(t().treeData,r),a=Tt(t().treeData,s);if(!(a!=null&&a.isFolder))return;const c=(u=t().treeData[0])==null?void 0:u.id;if(!(o.derivedRoles&&(i!=null&&i.isFolder)&&s!==c)){if(o.derivedRoles&&i&&!i.isFolder){const p=!!((d=i.metadata)!=null&&d.isAssessmentCourse),m=((f=t().treeData[0])==null?void 0:f.children)??[];if(!lu(a,p,Za(m,a)))return}e(p=>{const m=Tt(p.treeData,r);if(!m)return p;let C=Xa(p.treeData,r);return C=Po(C,s,{...m,parent:s}),{treeData:C}}),t().markDirty()}},addResource:(r,n,s)=>{var C,h,v,y,b,S;const o=X.getState().editorConfig,i=X.getState().editorProfile,a=(C=t().treeData[0])==null?void 0:C.id,c=!!(s!=null&&s.isAssessmentCourse);if(i.derivedRoles&&n===a){if(!c||Tt(t().treeData,r.identifier))return!1;const x=t().treeData[0],w=(x==null?void 0:x.children)??[],T=(s==null?void 0:s.slot)??cT(w);if(!T||qs(w,T))return!1;const L=t().addNode(a,"unit");if(!L)return!1;const{learningPath:A}=jl.getState().labelConfig;if(t().updateNode(L,{name:T==="pre"?A.priorAssessmentLabel:A.outcomeAssessmentLabel}),T==="pre"){const O=(((v=(h=t().treeData[0])==null?void 0:h.children)==null?void 0:v.length)??1)-1;e(P=>({treeData:Ja(P.treeData,a,O,0)}))}return t().addResource(r,L,s)}if(!(((y=o==null?void 0:o.config)==null?void 0:y.allowContentUnderRoot)??!1)&&n===a||Tt(t().treeData,r.identifier))return!1;const d=Tt(t().treeData,n);if(!(d!=null&&d.isFolder))return!1;if(i.derivedRoles){const x=((b=t().treeData[0])==null?void 0:b.children)??[];if(!lu(d,c,Za(x,d)))return!1}const f=((S=o==null?void 0:o.config)==null?void 0:S.maxContentsLimit)??1200;if(pT(t().treeData)>=f)return!1;const m={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(x=>({treeData:Po(x.treeData,n,m)})),t().markDirty(),!0},markDirty:()=>{const{editorMode:r,setIsDirty:n}=X.getState();r==="edit"&&n(!0)},pruneCoursesByFramework:r=>{let n=0;return e(s=>{const o=s.treeData[0];if(!o)return s;const i=[];for(const a of o.children??[]){const c=nt(a),u=(a.children??[]).filter(d=>{var m;if(d.isFolder)return!0;const f=(m=d.metadata)==null?void 0:m.framework,p=!f||(Array.isArray(f)?f.includes(r):f===r);return p||n++,p});c&&u.length===0||i.push(u.length===(a.children??[]).length?a:{...a,children:u})}return n===0?s:{treeData:[{...o,children:i}]}}),n>0&&t().markDirty(),n},clearLevelSkills:r=>{if(!r)return 0;let n=0;return e(s=>{const o=s.treeData[0];if(!o)return s;const i={...s.treeCache},a=(o.children??[]).map(c=>{var p,m;if(!(((p=c.metadata)==null?void 0:p[r])!==void 0||((m=i[c.id])==null?void 0:m[r])!==void 0))return c;n++;const{[r]:d,...f}=c.metadata??{};if(i[c.id]){const{[r]:C,...h}=i[c.id];i[c.id]=h}return{...c,metadata:f}});return n===0?s:{treeData:[{...o,children:a}],treeCache:i}}),n>0&&t().markDirty(),n},replaceNodeIds:r=>{!r||Object.keys(r).length===0||e(n=>{const s=Nh(n.treeData,r),o={};for(const[a,c]of Object.entries(n.treeCache)){const u=r[a]??a,{isNew:d,...f}=c;o[u]=f}const i=n.selectedNodeId?r[n.selectedNodeId]??n.selectedNodeId:null;return{treeData:s,treeCache:o,selectedNodeId:i}})},getNodeById:r=>Tt(t().treeData,r),getChildrenOf:r=>{const n=Tt(t().treeData,r);return(n==null?void 0:n.children)??[]},getBreadcrumb:r=>mT(t().treeData,r)})),gT="_spin_1ah4d_9",vT={spin:gT};function ae(){return jl(e=>e.labelConfig)}const yT=({size:e=16,color:t="currentColor"})=>{const r=ae();return l.jsx("svg",{className:vT.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"})})},Re=({variant:e="ghost",size:t="md",isLoading:r,disabled:n,onClick:s,children:o,className:i,type:a="button"})=>l.jsxs("button",{type:a,className:`sbx-btn-${e} ${t==="sm"?"sbx-btn-sm":""} ${i??""}`,onClick:s,disabled:r||n,"aria-busy":r?!0:void 0,children:[r?l.jsx(yT,{size:14}):null,o]}),Oh=({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 uu(e){var r,n;return(n=(r=(await Fe.get(`/action/framework/v1/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.framework}async function bT(e){var r,n;return((n=(r=(await Fe.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 ki(e,t){const r=es({queryKey:["framework",e],queryFn:()=>uu(e),enabled:!!e,staleTime:3e5}),n=t==null?void 0:t[0],s=es({queryKey:["framework",n],queryFn:()=>uu(n),enabled:!!n,staleTime:300*1e3}),o=s.data?[s.data]:[];return{organisationFramework:r.data,targetFrameworks:o,isLoading:r.isLoading||s.isLoading}}function Ph(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 CT(e){var n,s,o,i;const t=(n=e==null?void 0:e.children)==null?void 0:n[0];if(!nt(t))return;const r=(i=(o=(s=t==null?void 0:t.children)==null?void 0:s[0])==null?void 0:o.metadata)==null?void 0:i.framework;return Array.isArray(r)?r[0]:r}function ur(){var o;const e=X(i=>i.editorConfig),t=X(i=>i.contentFramework),r=se(i=>i.treeData),n=CT(r[0])??t??((o=e==null?void 0:e.context)==null?void 0:o.framework),{organisationFramework:s}=ki(n);return Ph(s==null?void 0:s.categories)}function ST(e,t,r){var u,d,f,p;const n={scope:((t==null?void 0:t.terms)??[]).map(m=>m.name),source:"manual"};if(!t)return n;const s=(u=e==null?void 0:e.children)==null?void 0:u[0];if(!nt(s))return n;const o=(d=s==null?void 0:s.children)==null?void 0:d[0];if(!o)return n;const a=((f=r[o.id])==null?void 0:f[t.code])??((p=o.metadata)==null?void 0:p[t.code]);return{scope:Array.isArray(a)?a:a?[a]:[],source:"prior"}}function ao(){const e=ur(),t=se(n=>n.treeData),r=se(n=>n.treeCache);return g.useMemo(()=>ST(t[0],e,r),[t,e,r])}const xT="_overlay_12iiv_1",_T="_modal_12iiv_15",wT="_modalHeader_12iiv_27",TT="_modalHeaderClose_12iiv_37",ET="_modalBody_12iiv_55",AT="_modalFooter_12iiv_62",kT="_checkRow_12iiv_69",IT="_formGroup_12iiv_112",LT="_textarea_12iiv_123",DT="_sliderGroup_12iiv_144",jT="_sliderValue_12iiv_156",NT="_sliderLabels_12iiv_164",OT="_sectionTitle_12iiv_172",Ee={overlay:xT,modal:_T,modalHeader:wT,modalHeaderClose:TT,modalBody:ET,modalFooter:AT,checkRow:kT,formGroup:IT,textarea:LT,sliderGroup:DT,sliderValue:jT,sliderLabels:NT,sectionTitle:OT},PT=({objectType:e,onConfirm:t,onCancel:r})=>{const n=ae(),s=se(C=>C.treeData[0]),o=se(C=>C.treeCache),i=ur(),{scope:a}=ao(),[c,u]=g.useState(null),d=ql(s,i==null?void 0:i.code,a,o);g.useEffect(()=>{let C=!1;return u(null),hT(s).then(h=>{C||u(h)}),()=>{C=!0}},[s]);const f=c===null,p=[...d,...c??[]],m=!f&&p.length===0;return l.jsx("div",{className:Ee.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"publish-modal-title",children:l.jsxs("div",{className:Ee.modal,children:[l.jsxs("div",{className:Ee.modalHeader,children:[l.jsxs("span",{id:"publish-modal-title",children:[n.publishChecklist.publishTitlePrefix," ",e]}),l.jsx("button",{className:Ee.modalHeaderClose,onClick:r,"aria-label":n.publishChecklist.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:Ee.modalBody,children:p.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:Ee.sectionTitle,children:n.learningPath.resolveBeforePublishing}),l.jsx("ul",{style:{margin:0,paddingLeft:18,fontSize:13,lineHeight:1.6},children:p.map((C,h)=>l.jsx("li",{children:C.message},`${C.code}-${C.nodeId??h}`))})]})}),l.jsxs("div",{className:Ee.modalFooter,children:[l.jsx(Re,{variant:"ghost",onClick:r,children:n.publishChecklist.noButton}),l.jsx(Re,{variant:"primary",onClick:t,disabled:!m,children:n.publishChecklist.yesButton})]})]})})},RT=({contentId:e,onConfirm:t,onCancel:r})=>{const n=ae(),s=X(p=>{var m,C;return(C=(m=p.editorConfig)==null?void 0:m.config)==null?void 0:C.objectType})||"Content",o=X(p=>p.editorProfile.key==="learningPath"),i=X(p=>p.publishChecklist)??[],[a,c]=g.useState({}),u=i.every(p=>a[p.code]),d=i.length===0||u,f=()=>{t()};return o?l.jsx(PT,{objectType:s,onConfirm:t,onCancel:r}):l.jsx("div",{className:Ee.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"publish-modal-title",children:l.jsxs("div",{className:Ee.modal,children:[l.jsxs("div",{className:Ee.modalHeader,children:[l.jsxs("span",{id:"publish-modal-title",children:[n.publishChecklist.publishTitlePrefix," ",s]}),l.jsx("button",{className:Ee.modalHeaderClose,onClick:r,"aria-label":n.publishChecklist.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:Ee.modalBody,children:i.length===0?l.jsxs("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:[n.publishChecklist.confirmPublishPrefix," ",s,"?"]}):l.jsxs(l.Fragment,{children:[l.jsx("p",{className:Ee.sectionTitle,children:n.publishChecklist.checklistInstructions}),i.map(p=>l.jsxs("label",{className:Ee.checkRow,children:[l.jsx("input",{type:"checkbox",checked:!!a[p.code],onChange:m=>c(C=>({...C,[p.code]:m.target.checked}))}),l.jsx("span",{children:p.label})]},p.code))]})}),l.jsxs("div",{className:Ee.modalFooter,children:[l.jsx(Re,{variant:"ghost",onClick:r,children:n.publishChecklist.noButton}),l.jsx(Re,{variant:"primary",onClick:f,disabled:!d,children:n.publishChecklist.yesButton})]})]})})},FT=({contentId:e,action:t,onConfirm:r,onCancel:n})=>{const s=ae(),[o,i]=g.useState(""),[a,c]=g.useState(7),u=t==="approve",d=u?s.qualityParamsModal.reviewQualityTitle:s.qualityParamsModal.rejectContentTitle,f=!u&&o.trim().length===0,p=()=>{u?r(o.trim(),a):r(o.trim())};return l.jsx("div",{className:Ee.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"quality-modal-title",children:l.jsxs("div",{className:Ee.modal,children:[l.jsxs("div",{className:Ee.modalHeader,children:[l.jsx("span",{id:"quality-modal-title",children:d}),l.jsx("button",{className:Ee.modalHeaderClose,onClick:n,"aria-label":s.qualityParamsModal.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:Ee.modalBody,children:u?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:Ee.formGroup,children:[l.jsx("label",{htmlFor:"quality-score",children:s.qualityParamsModal.qualityScoreLabel}),l.jsxs("div",{className:Ee.sliderGroup,children:[l.jsx("input",{id:"quality-score",type:"range",min:0,max:10,step:1,value:a,onChange:m=>c(Number(m.target.value)),"aria-valuemin":0,"aria-valuemax":10,"aria-valuenow":a}),l.jsx("span",{className:Ee.sliderValue,children:a})]}),l.jsxs("div",{className:Ee.sliderLabels,children:[l.jsx("span",{children:s.qualityParamsModal.scorePoorLabel}),l.jsx("span",{children:s.qualityParamsModal.scoreExcellentLabel})]})]}),l.jsxs("div",{className:Ee.formGroup,children:[l.jsxs("label",{htmlFor:"quality-comment",children:[s.qualityParamsModal.commentLabel," ",l.jsx("span",{style:{fontWeight:400,color:"var(--sbx-gray-400, #9CA3AF)"},children:s.qualityParamsModal.optionalLabel})]}),l.jsx("textarea",{id:"quality-comment",className:Ee.textarea,placeholder:s.qualityParamsModal.commentPlaceholder,value:o,onChange:m=>i(m.target.value),rows:4})]})]}):l.jsxs("div",{className:Ee.formGroup,children:[l.jsxs("label",{htmlFor:"reject-reason",children:[s.qualityParamsModal.rejectionReasonLabel," ",l.jsx("span",{style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),l.jsx("textarea",{id:"reject-reason",className:Ee.textarea,placeholder:s.qualityParamsModal.rejectReasonPlaceholder,value:o,onChange:m=>i(m.target.value),rows:5,required:!0,"aria-required":"true"}),o.trim().length===0&&l.jsx("p",{style:{fontSize:12,color:"var(--sbx-error, #DC2626)",marginTop:4},children:s.qualityParamsModal.rejectionRequiredMessage})]})}),l.jsxs("div",{className:Ee.modalFooter,children:[l.jsx(Re,{variant:"ghost",onClick:n,children:s.qualityParamsModal.cancelButton}),l.jsx(Re,{variant:u?"primary":"danger",onClick:p,disabled:f,children:u?s.qualityParamsModal.approveButton:s.qualityParamsModal.rejectButton})]})]})})},MT=({message:e,onConfirm:t,onCancel:r})=>{const n=ae();return Tr.createPortal(l.jsx("div",{className:Ee.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"confirm-dialog-title",children:l.jsxs("div",{className:Ee.modal,children:[l.jsxs("div",{className:Ee.modalHeader,children:[l.jsx("span",{id:"confirm-dialog-title",children:n.confirmDialog.title}),l.jsx("button",{className:Ee.modalHeaderClose,onClick:r,"aria-label":n.confirmDialog.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:Ee.modalBody,children:l.jsx("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:e})}),l.jsxs("div",{className:Ee.modalFooter,children:[l.jsx(Re,{variant:"ghost",onClick:r,children:n.confirmDialog.cancelButton}),l.jsx(Re,{variant:"danger",onClick:t,children:n.confirmDialog.confirmButton})]})]})}),document.body)},Rh=["email","firstName","lastName","identifier","organisations","rootOrgName","phone"];async function BT(e,t={}){var c,u,d,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 s=e.includes("@"),o=/^\d{10,}$/.test(e.trim()),i={filters:n,fields:Rh,offset:0,limit:t.limit??200};return s?n.email=e.trim():o?n.phone=e.trim():i.query=e,((f=(d=(u=(await Fe.post("/action/user/v1/search",{request:i},{params:{fields:"orgName"},headers:{"X-Source":"web","X-msgid":Math.random().toString(36).slice(2)}})).data)==null?void 0:u.result)==null?void 0:d.response)==null?void 0:f.content)??[]}async function qT(e){var r,n,s;return e.length?((s=(n=(r=(await Fe.post("/action/user/v1/search",{request:{filters:{userId:e},fields:Rh,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:s.content)??[]:[]}async function $T(e){var r,n;return((n=(r=(await Fe.get(`/portal/user/v5/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.response)??{}}const Fh="/portal";async function Mh(e){var n,s,o,i,a,c,u;const t=await Fe.get(`${Fh}/questionset/v2/hierarchy/${e}`,{params:{mode:"edit"}}),r=(s=(n=t.data)==null?void 0:n.result)==null?void 0:s.questionset;if(!r||!r.identifier){const d=((i=(o=t.data)==null?void 0:o.params)==null?void 0:i.errmsg)||((c=(a=t.data)==null?void 0:a.params)==null?void 0:c.err)||((u=t.data)==null?void 0:u.responseCode)||`No questionset returned for "${e}"`;throw new Error(`Unable to load questionset hierarchy: ${d}`)}return r}async function UT(e){var r,n;return e.length?((n=(r=(await Fe.post(`${Fh}/question/v2/list`,{request:{search:{identifier:e}}})).data)==null?void 0:r.result)==null?void 0:n.questions)??[]:[]}function Ii(e,t){const r=e??{},n=r.identifier??"",s=r.objectType??"",o=r.mimeType??"",i=r.children,a=Array.isArray(i)?i.map(u=>Ii(u,n)):[],c=o==="application/vnd.ekstep.content-collection"||s.toLowerCase().includes("unit")||s.toLowerCase().includes("textbook")||s.toLowerCase().includes("collection")||s.toLowerCase().includes("course")||s.toLowerCase().includes("lesson")||r.visibility==="Parent"||o==="application/vnd.sunbird.questionset"&&a.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:s,contentType:r.contentType,visibility:r.visibility,status:r.status,appIcon:r.appIcon,isFolder:c,children:a,metadata:r,parent:t}}async function Bh(e){var s,o,i,a,c,u,d;const t=await Fe.get(`/action/collection/v1/hierarchy/${e}`,{params:{mode:"edit"}}),r=(o=(s=t.data)==null?void 0:s.result)==null?void 0:o.content;if(!r||!r.identifier){const f=((a=(i=t.data)==null?void 0:i.params)==null?void 0:a.errmsg)||((u=(c=t.data)==null?void 0:c.params)==null?void 0:u.err)||((d=t.data)==null?void 0:d.responseCode)||`No content returned for "${e}"`;throw new Error(`Unable to load hierarchy: ${f}`)}const n=Ii(r);return{content:r,rootNode:n}}async function zT(e){const t=await Mh(e),r=Ii(t);return{content:t,rootNode:r}}async function VT(e,t,r,n){var o;return((o=(await Fe.patch("/action/collection/v1/hierarchy/update",{request:{data:{nodesModified:t,hierarchy:r,...n?{lastUpdatedBy:n}:{}}}})).data)==null?void 0:o.result)??{}}async function HT(e,t=""){await Fe.post(`/action/collection/v1/publish/${e}`,{request:{content:{lastPublishedBy:t}}})}async function QT(e){var n,s,o,i,a,c,u;const t=await Fe.get(`/action/course/v1/hierarchy/${e}`,{params:{mode:"edit"}}),r=(s=(n=t.data)==null?void 0:n.result)==null?void 0:s.content;if(!r||!r.identifier){const d=((i=(o=t.data)==null?void 0:o.params)==null?void 0:i.errmsg)||((c=(a=t.data)==null?void 0:a.params)==null?void 0:c.err)||((u=t.data)==null?void 0:u.responseCode)||`No course returned for "${e}"`;throw new Error(`Unable to load course hierarchy: ${d}`)}return r}async function WT(e){var r,n;return(n=(r=(await Fe.get(`/action/collection/v1/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.content}async function GT(e){await Fe.post(`/action/collection/v1/review/${e}`,{request:{content:{}}})}async function KT(e,t){await Fe.post(`/action/collection/v1/reject/${e}`,{request:{content:{rejectComment:t}}})}async function YT(e,t){await Fe.patch(`/action/content/v1/collaborator/update/${e}`,{request:{content:{collaborators:t}}})}const ZT="_container_r27rp_1",XT="_header_r27rp_13",JT="_title_r27rp_22",e1="_closeBtn_r27rp_29",t1="_body_r27rp_45",r1="_label_r27rp_54",n1="_searchSection_r27rp_62",s1="_searchRow_r27rp_68",o1="_searchInput_r27rp_74",i1="_searchSpinner_r27rp_89",a1="_resultsList_r27rp_105",l1="_resultItem_r27rp_118",c1="_userInfo_r27rp_133",u1="_userName_r27rp_141",d1="_userEmail_r27rp_150",f1="_userOrg_r27rp_158",h1="_noResults_r27rp_167",p1="_collabSection_r27rp_174",m1="_sectionTitle_r27rp_179",g1="_badge_r27rp_189",v1="_emptyCollab_r27rp_203",y1="_collabList_r27rp_214",b1="_collabItem_r27rp_223",C1="_userAvatar_r27rp_237",S1="_error_r27rp_251",x1="_success_r27rp_257",_1="_footer_r27rp_263",Pe={container:ZT,header:XT,title:JT,closeBtn:e1,body:t1,label:r1,searchSection:n1,searchRow:s1,searchInput:o1,searchSpinner:i1,resultsList:a1,resultItem:l1,userInfo:c1,userName:u1,userEmail:d1,userOrg:f1,noResults:h1,collabSection:p1,sectionTitle:m1,badge:g1,emptyCollab:v1,collabList:y1,collabItem:b1,userAvatar:C1,error:S1,success:x1,footer:_1},w1=({contentId:e,onClose:t})=>{var O,P;const r=ae(),n=X(j=>j.editorConfig),s=(O=n==null?void 0:n.context)==null?void 0:O.channel,o=(P=n==null?void 0:n.config)==null?void 0:P.objectType,[i,a]=g.useState(""),[c,u]=g.useState([]),[d,f]=g.useState(!1),[p,m]=g.useState([]),[C,h]=g.useState(!1),[v,y]=g.useState(""),[b,S]=g.useState(!1),x=g.useRef(null);g.useEffect(()=>{let j=!1;return(async()=>{try{const N=await WT(e),F=(N==null?void 0:N.collaborators)??[];if(!F.length)return;const R=await qT(F);if(j)return;const U=F.map(re=>R.find(G=>G.identifier===re)??{identifier:re,firstName:re});m(U)}catch{}})(),()=>{j=!0}},[e]),g.useEffect(()=>{x.current&&clearTimeout(x.current);const j=i.trim();if(j.length<2){u([]);return}return x.current=setTimeout(async()=>{f(!0);try{const N=await BT(j,{rootOrgId:s,objectType:o}),F=new Set(p.map(R=>R.identifier));u(N.filter(R=>!F.has(R.identifier)))}catch{u([])}finally{f(!1)}},300),()=>{x.current&&clearTimeout(x.current)}},[i,p,s,o]);const w=g.useCallback(j=>{m(N=>N.find(F=>F.identifier===j.identifier)?N:[...N,j]),u(N=>N.filter(F=>F.identifier!==j.identifier)),S(!1)},[]),T=g.useCallback(j=>{m(N=>N.filter(F=>F.identifier!==j)),S(!1)},[]),L=g.useCallback(async()=>{h(!0),y(""),S(!1);try{await YT(e,p.map(j=>j.identifier)),S(!0)}catch{y(r.manageCollaborators.saveFailed)}finally{h(!1)}},[e,p,r.manageCollaborators.saveFailed]),A=j=>`${j.firstName}${j.lastName?` ${j.lastName}`:""}`;return l.jsxs("div",{className:Pe.container,children:[l.jsxs("div",{className:Pe.header,children:[l.jsx("h2",{className:Pe.title,children:r.manageCollaborators.title}),l.jsx("button",{className:Pe.closeBtn,onClick:t,"aria-label":r.manageCollaborators.closeAriaLabel,children:l.jsx(lr,{size:18})})]}),l.jsxs("div",{className:Pe.body,children:[l.jsxs("div",{className:Pe.searchSection,children:[l.jsx("label",{className:Pe.label,htmlFor:"collab-search",children:r.manageCollaborators.searchUsersLabel}),l.jsxs("div",{className:Pe.searchRow,children:[l.jsx("input",{id:"collab-search",type:"text",className:Pe.searchInput,placeholder:r.manageCollaborators.searchPlaceholder,value:i,onChange:j=>a(j.target.value)}),d&&l.jsx("span",{className:Pe.searchSpinner,"aria-label":r.manageCollaborators.searchingAriaLabel})]}),c.length>0&&l.jsx("ul",{className:Pe.resultsList,role:"listbox","aria-label":r.manageCollaborators.searchResultsAriaLabel,children:c.map(j=>{var N,F,R,U;return l.jsxs("li",{className:Pe.resultItem,role:"option","aria-selected":"false",children:[l.jsxs("div",{className:Pe.userInfo,children:[l.jsx("span",{className:Pe.userName,children:A(j)}),j.email&&l.jsx("span",{className:Pe.userEmail,children:j.email}),(((F=(N=j.organisations)==null?void 0:N[0])==null?void 0:F.orgName)??j.rootOrgName)&&l.jsx("span",{className:Pe.userOrg,children:((U=(R=j.organisations)==null?void 0:R[0])==null?void 0:U.orgName)??j.rootOrgName})]}),l.jsx(Re,{variant:"primary",size:"sm",onClick:()=>w(j),children:r.manageCollaborators.add})]},j.identifier)})}),i.trim().length>=2&&!d&&c.length===0&&l.jsx("p",{className:Pe.noResults,children:r.manageCollaborators.noUsersFound})]}),l.jsxs("div",{className:Pe.collabSection,children:[l.jsxs("h3",{className:Pe.sectionTitle,children:[r.manageCollaborators.currentCollaborators,p.length>0&&l.jsx("span",{className:Pe.badge,children:p.length})]}),p.length===0?l.jsx("p",{className:Pe.emptyCollab,children:r.manageCollaborators.noCollaboratorsYet}):l.jsx("ul",{className:Pe.collabList,children:p.map(j=>{var N,F,R,U;return l.jsxs("li",{className:Pe.collabItem,children:[l.jsx("div",{className:Pe.userAvatar,"aria-hidden":"true",children:A(j).charAt(0).toUpperCase()}),l.jsxs("div",{className:Pe.userInfo,children:[l.jsx("span",{className:Pe.userName,children:A(j)}),j.email&&l.jsx("span",{className:Pe.userEmail,children:j.email}),(((F=(N=j.organisations)==null?void 0:N[0])==null?void 0:F.orgName)??j.rootOrgName)&&l.jsx("span",{className:Pe.userOrg,children:((U=(R=j.organisations)==null?void 0:R[0])==null?void 0:U.orgName)??j.rootOrgName})]}),l.jsx(Re,{variant:"danger",size:"sm",onClick:()=>T(j.identifier),children:r.manageCollaborators.remove})]},j.identifier)})})]}),v&&l.jsx("p",{className:Pe.error,role:"alert",children:v}),b&&l.jsx("p",{className:Pe.success,role:"status",children:r.manageCollaborators.saveSuccess})]}),l.jsxs("div",{className:Pe.footer,children:[l.jsx(Re,{variant:"ghost",onClick:t,disabled:C,children:r.manageCollaborators.cancel}),l.jsx(Re,{variant:"primary",isLoading:C,onClick:L,children:r.manageCollaborators.save})]})]})};async function T1(e){return(await Fe.post("/api/dialcode/v1/read",{request:{dialcodes:[e]}})).data}async function E1(e,t){var s;const n=((s=(await Fe.post(`/action/dialcode/v1/reserve/${e}`,{request:{dialcodes:{count:t,qrCodeSpec:{errorCorrectionLevel:"H"}}}})).data)==null?void 0:s.result)??{};return{processId:n.processId??"",reservedDialcodes:n.reservedDialcodes??{}}}async function A1(e){var n;const r=((n=(await Fe.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 k1="_topbar_lk8lp_1",I1="_left_lk8lp_15",L1="_right_lk8lp_23",D1="_backBtn_lk8lp_30",j1="_title_lk8lp_49",N1="_profileBadge_lk8lp_61",O1="_statusChip_lk8lp_76",P1="_savedIndicator_lk8lp_88",R1="_unsaved_lk8lp_98",F1="_iconBtn_lk8lp_103",M1="_iconBtnLabel_lk8lp_130",B1="_qrDropdown_lk8lp_134",q1="_qrMenu_lk8lp_138",$1="_reviewBtns_lk8lp_173",U1="_sourcingBtns_lk8lp_182",z1="_modalOverlay_lk8lp_191",V1="_sbOverlay_lk8lp_201",H1="_sbModal_lk8lp_211",Q1="_sbModalHeader_lk8lp_222",W1="_sbModalTitle_lk8lp_230",G1="_sbModalClose_lk8lp_237",K1="_sbModalBody_lk8lp_250",Y1="_sbLabel_lk8lp_257",Z1="_sbTextarea_lk8lp_264",X1="_sbError_lk8lp_281",J1="_sbModalFooter_lk8lp_288",_e={topbar:k1,left:I1,right:L1,backBtn:D1,title:j1,profileBadge:N1,statusChip:O1,savedIndicator:P1,unsaved:R1,iconBtn:F1,iconBtnLabel:M1,qrDropdown:B1,qrMenu:q1,reviewBtns:$1,sourcingBtns:U1,modalOverlay:z1,sbOverlay:V1,sbModal:H1,sbModalHeader:Q1,sbModalTitle:W1,sbModalClose:G1,sbModalBody:K1,sbLabel:Y1,sbTextarea:Z1,sbError:X1,sbModalFooter:J1};function e0(e){return e?new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):""}function t0(e,t){return typeof e=="string"&&e.trim().length>0?e.trim():t}const r0=({titleText:e,labelText:t,placeholderText:r,submitLabel:n,submitVariant:s="primary",onConfirm:o,onCancel:i})=>{const a=ae(),[c,u]=g.useState(""),d=e.toLowerCase().replace(/\s+/g,"-");return l.jsx("div",{className:_e.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":`${d}-title`,children:l.jsxs("div",{className:_e.sbModal,children:[l.jsxs("div",{className:_e.sbModalHeader,children:[l.jsx("span",{id:`${d}-title`,className:_e.sbModalTitle,children:e}),l.jsx("button",{className:_e.sbModalClose,onClick:i,"aria-label":a.reviewCommentModal.closeAriaLabel,type:"button",children:"×"})]}),l.jsxs("div",{className:_e.sbModalBody,children:[l.jsxs("label",{className:_e.sbLabel,htmlFor:`${d}-comment`,children:[t," ",l.jsx("span",{"aria-hidden":"true",style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),l.jsx("textarea",{id:`${d}-comment`,className:_e.sbTextarea,placeholder:r,value:c,onChange:f=>u(f.target.value),rows:4,required:!0,"aria-required":"true"}),c.trim().length===0&&l.jsx("p",{className:_e.sbError,children:a.reviewCommentModal.fillCommentsError})]}),l.jsxs("div",{className:_e.sbModalFooter,children:[l.jsx(Re,{variant:"ghost",onClick:i,children:a.reviewCommentModal.cancelButton}),l.jsx(Re,{variant:s,onClick:()=>o(c.trim()),disabled:c.trim().length===0,children:n})]})]})})},n0=({onConfirm:e,onCancel:t})=>{const r=ae(),[n,s]=g.useState(!1),o=X(p=>p.editorProfile.key==="learningPath"),i=se(p=>p.treeData[0]),a=se(p=>p.treeCache),c=ur(),{scope:u}=ao(),d=o?ql(i,c==null?void 0:c.code,u,a):[],f=d.length>0;return l.jsx("div",{className:_e.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":"review-confirm-title",children:l.jsxs("div",{className:_e.sbModal,children:[l.jsxs("div",{className:_e.sbModalHeader,children:[l.jsx("span",{id:"review-confirm-title",className:_e.sbModalTitle,children:r.confirmReviewModal.title}),l.jsx("button",{className:_e.sbModalClose,onClick:t,"aria-label":r.confirmReviewModal.closeAriaLabel,type:"button",children:"×"})]}),l.jsx("div",{className:_e.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:d.map((p,m)=>l.jsx("li",{children:p.message},`${p.code}-${p.nodeId??m}`))})]}):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:p=>s(p.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:_e.sbModalFooter,children:[l.jsx(Re,{variant:"ghost",onClick:t,children:r.confirmReviewModal.cancelButton}),!f&&l.jsx(Re,{variant:"primary",onClick:e,disabled:!n,children:r.confirmReviewModal.submitButton})]})]})})},s0=({onConfirm:e,onCancel:t})=>{const r=ae(),[n,s]=g.useState(""),o=parseInt(n,10),i=!isNaN(o)&&o>=2&&o<=250;return l.jsx("div",{className:_e.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":"genqr-title",children:l.jsxs("div",{className:_e.sbModal,children:[l.jsxs("div",{className:_e.sbModalHeader,children:[l.jsx("span",{id:"genqr-title",className:_e.sbModalTitle,children:r.generateQRModal.title}),l.jsx("button",{className:_e.sbModalClose,onClick:t,"aria-label":r.generateQRModal.closeAriaLabel,type:"button",children:"×"})]}),l.jsxs("div",{className:_e.sbModalBody,children:[l.jsxs("label",{className:_e.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:_e.sbTextarea,style:{resize:"none",height:"40px"},placeholder:r.generateQRModal.countPlaceholder,value:n,onChange:a=>s(a.target.value)}),n&&!i&&l.jsx("p",{className:_e.sbError,children:r.generateQRModal.countRangeError})]}),l.jsxs("div",{className:_e.sbModalFooter,children:[l.jsx(Re,{variant:"ghost",onClick:t,children:r.generateQRModal.cancelButton}),l.jsx(Re,{variant:"primary",onClick:()=>e(o),disabled:!i,children:r.generateQRModal.generateButton})]})]})})},o0=({editorMode:e,isSaving:t,isDirty:r,lastSaved:n,isFormValid:s=!0,onToolbarEvent:o})=>{var ie,xe;const i=ae(),c=se(fe=>fe.treeData)[0],u=(c==null?void 0:c.name)??i.contextualEditor.untitledPlaceholder,d=t0(((ie=c==null?void 0:c.metadata)==null?void 0:ie.status)??(c==null?void 0:c.status),i.topbar.draftStatusFallback),f=X(fe=>{var ge,Ae,J,he;return((Ae=(ge=fe.editorConfig)==null?void 0:ge.context)==null?void 0:Ae.contentId)??((he=(J=fe.editorConfig)==null?void 0:J.context)==null?void 0:he.identifier)??""}),{activeModal:p,modalData:m,closeModal:C,openModal:h}=rt(),v=X(fe=>fe.buttonLoaders),y=X(fe=>fe.categoryMeta),b=X(fe=>fe.editorProfile),S=b.key==="learningPath",x=b.features.dialcodes&&(!y||y.schemaDefaults.generateDIALCodes!=="No"),[w,T]=g.useState(!1),[L,A]=g.useState(!1),[O,P]=g.useState(!1),j=g.useRef(null),[N,F]=g.useState(!1);g.useEffect(()=>{if(!O)return;const fe=ge=>{var Ae;(Ae=j.current)!=null&&Ae.contains(ge.target)||P(!1)};return document.addEventListener("mousedown",fe),()=>document.removeEventListener("mousedown",fe)},[O]);const[R,U]=g.useState(!1),[re,G]=g.useState(!1),{updateNode:pe}=se(),me=(xe=c==null?void 0:c.metadata)==null?void 0:xe.qrCodeProcessId,V=g.useCallback(async fe=>{if(f){F(!1),U(!0);try{const{processId:ge,reservedDialcodes:Ae}=await E1(f,fe);ge&&c&&pe(c.id,{qrCodeProcessId:ge,reservedDialcodes:Ae}),ye.success(i.topbar.qrGenerationStartedToast)}catch{ye.error(i.topbar.qrGenerationFailedToast)}finally{U(!1)}}},[f,c,pe,i]),de=g.useCallback(async()=>{if(!me){ye.error(i.topbar.qrCodesNotGeneratedToast);return}G(!0);try{const fe=await A1(me);if(fe.status==="in-process"){ye(i.topbar.qrGenerationInProgressToast,{icon:l.jsx(Bn,{size:16})});return}const ge=fe.url;if(!ge){ye.error(i.topbar.qrCodesNotReadyToast);return}const Ae=await fetch(ge).then(We=>We.blob()),J=await new Promise(We=>{const tt=new FileReader;tt.onloadend=()=>We(tt.result),tt.readAsDataURL(Ae)}),he=(c==null?void 0:c.metadata)??{},Q=We=>Array.isArray(We)?We.join("_"):typeof We=="string"?We:"",Ce=[f,Q(he.medium),Q(he.gradeLevel),Q(he.subject)].filter(Boolean),qe=new Date().toISOString().replace(/[:.]/g,"-"),et=`${Ce.join("_")}_${qe}.zip`,$e=document.createElement("a");$e.href=J,$e.download=et,$e.style.display="none",document.body.appendChild($e),$e.click(),document.body.removeChild($e),ye.success(i.topbar.qrCodesDownloadedToast)}catch{ye.error(i.topbar.qrCodesDownloadFailedToast)}finally{G(!1)}},[me,c,f,i]),oe=e==="edit",Se=e==="review",ve=e==="sourcingreview",q=e==="read",M=g.useCallback((fe,ge)=>{o({action:fe,data:ge})},[o]),$=g.useCallback(()=>{C(),M("publish")},[C,M]),ne=g.useCallback((fe,ge)=>{const Ae=m==null?void 0:m.action;C(),Ae==="approve"?M("sourcingApprove",{comment:fe,score:ge}):M("reject",{comment:fe})},[C,M,m]);return l.jsxs(l.Fragment,{children:[l.jsxs("header",{className:_e.topbar,role:"banner",children:[l.jsxs("div",{className:_e.left,children:[l.jsx("button",{className:_e.backBtn,onClick:()=>M("back"),"aria-label":i.topbar.backAriaLabel,type:"button",children:l.jsx(Al,{size:18})}),l.jsx("h1",{className:_e.title,title:u,children:u}),S&&l.jsxs("span",{className:_e.profileBadge,children:[l.jsx(Oh,{size:13,"aria-hidden":"true"}),i.learningPath.profileBadgeLabel]}),l.jsx("span",{className:`sbx-chip ${_e.statusChip}`,"aria-label":`${i.topbar.statusAriaLabelPrefix} ${d}`,children:d})]}),l.jsxs("div",{className:_e.right,children:[t?l.jsx("span",{className:_e.savedIndicator,"aria-live":"polite",children:i.topbar.savingIndicator}):r&&oe?l.jsx("span",{className:`${_e.savedIndicator} ${_e.unsaved}`,"aria-live":"polite",children:i.topbar.unsavedIndicator}):n?l.jsxs("span",{className:_e.savedIndicator,"aria-live":"polite",children:[l.jsx(Cn,{size:14,"aria-hidden":"true"}),i.topbar.savedIndicatorPrefix," ",e0(n)]}):null,!q&&!Se&&!ve&&d!=="Review"&&l.jsx("span",{title:s?void 0:i.topbar.fillRequiredFieldsTooltip,children:l.jsx(Re,{variant:"ghost",size:"sm",onClick:()=>M("saveCollection"),disabled:!s,children:i.topbar.saveAsDraftButton})}),oe&&l.jsxs(l.Fragment,{children:[l.jsxs(Re,{variant:"primary",size:"sm",onClick:()=>A(!0),disabled:v.saveCollection,isLoading:v.saveCollection,children:[l.jsx(Vy,{size:14,"aria-hidden":"true"})," ",i.topbar.sendForReviewButton]}),b.features.collaborators&&l.jsx("button",{className:_e.iconBtn,onClick:()=>h("manageCollaborators"),"aria-label":i.topbar.collaboratorsLabel,title:i.topbar.collaboratorsLabel,type:"button",children:l.jsx(Zy,{size:16,"aria-hidden":"true"})}),x&&l.jsxs("div",{className:_e.qrDropdown,ref:j,children:[l.jsxs("button",{className:_e.iconBtn,onClick:()=>P(fe=>!fe),"aria-label":i.topbar.qrCodesLabel,title:i.topbar.qrCodesLabel,type:"button","aria-haspopup":"true","aria-expanded":O,children:[l.jsx(jc,{size:16,"aria-hidden":"true"}),l.jsx("span",{className:_e.iconBtnLabel,children:i.topbar.qrCodesLabel}),l.jsx(Sn,{size:14,style:{marginLeft:2},"aria-hidden":"true"})]}),O&&l.jsxs("div",{className:_e.qrMenu,role:"menu",children:[l.jsxs("button",{role:"menuitem",type:"button",onClick:()=>{P(!1),F(!0)},disabled:R,children:[l.jsx(jc,{size:14}),R?i.topbar.generatingEllipsis:i.topbar.generateQrCodesMenuItem]}),l.jsxs("button",{role:"menuitem",type:"button",onClick:()=>{P(!1),de()},disabled:re||!me,children:[l.jsx(Ly,{size:14}),re?i.topbar.downloadingEllipsis:i.topbar.downloadQrCodesMenuItem]})]})]})]}),Se&&l.jsxs("div",{className:_e.reviewBtns,children:[l.jsxs(Re,{variant:"primary",size:"sm",onClick:()=>h("publishChecklist"),disabled:v.publishCollection,isLoading:v.publishCollection,children:[l.jsx($f,{size:14,"aria-hidden":"true"})," ",i.topbar.publishButton]}),l.jsxs(Re,{variant:"primary",size:"sm",onClick:()=>T(!0),disabled:v.rejectCollection,isLoading:v.rejectCollection,children:[l.jsx(Nc,{size:14,"aria-hidden":"true"})," ",i.topbar.requestForChangesButton]})]}),ve&&l.jsxs("div",{className:_e.sourcingBtns,children:[l.jsxs(Re,{variant:"primary",size:"sm",onClick:()=>h("qualityParams",{action:"approve"}),children:[l.jsx(Qy,{size:14,"aria-hidden":"true"})," ",i.topbar.approveButton]}),l.jsxs(Re,{variant:"primary",size:"sm",onClick:()=>h("qualityParams",{action:"reject"}),children:[l.jsx(Nc,{size:14,"aria-hidden":"true"})," ",i.topbar.requestForChangesButton]})]})]})]}),p==="publishChecklist"&&l.jsx(RT,{contentId:f,onConfirm:$,onCancel:C}),p==="qualityParams"&&l.jsx(FT,{contentId:f,action:(m==null?void 0:m.action)??"reject",onConfirm:ne,onCancel:C}),p==="manageCollaborators"&&l.jsx("div",{className:_e.modalOverlay,role:"dialog","aria-modal":"true",children:l.jsx(w1,{contentId:f,onClose:C})}),p==="confirmDelete"&&l.jsx(MT,{message:(m==null?void 0:m.message)??"",onConfirm:()=>{const fe=m==null?void 0:m.onConfirm;C(),fe==null||fe()},onCancel:C}),L&&l.jsx(n0,{onConfirm:()=>{A(!1),M("sendForReview")},onCancel:()=>A(!1)}),w&&l.jsx(r0,{titleText:i.topbar.requestChangesTitle,labelText:i.topbar.changesRequestedLabel,placeholderText:i.topbar.describeChangesPlaceholder,submitLabel:i.topbar.requestForChangesButton,submitVariant:"primary",onConfirm:fe=>{T(!1),M("reject",{comment:fe})},onCancel:()=>T(!1)}),N&&l.jsx(s0,{onConfirm:V,onCancel:()=>F(!1)})]})},i0=({onSave:e,onDiscard:t,onCancel:r,isSaving:n})=>{const s=ae();return Tr.createPortal(l.jsx("div",{className:Ee.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"unsaved-title",children:l.jsxs("div",{className:Ee.modal,children:[l.jsxs("div",{className:Ee.modalHeader,children:[l.jsx("span",{id:"unsaved-title",children:s.unsavedChangesModal.title}),l.jsx("button",{className:Ee.modalHeaderClose,onClick:r,"aria-label":s.unsavedChangesModal.closeAriaLabel,disabled:n,children:"×"})]}),l.jsx("div",{className:Ee.modalBody,children:l.jsx("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:s.unsavedChangesModal.bodyMessage})}),l.jsxs("div",{className:Ee.modalFooter,children:[l.jsx(Re,{variant:"ghost",onClick:r,disabled:n,children:s.unsavedChangesModal.cancelButton}),l.jsx(Re,{variant:"danger",onClick:t,disabled:n,children:s.unsavedChangesModal.discardButton}),l.jsx(Re,{variant:"primary",onClick:e,isLoading:n,disabled:n,children:s.unsavedChangesModal.saveButton})]})]})}),document.body)};var a0=Dl();const qh=g.createContext(null);function Mt(){const e=g.useContext(qh);if(e===null)throw new Error("No Tree Api Provided");return e}const $h=g.createContext(null);function l0(){const e=g.useContext($h);if(e===null)throw new Error("Provide a NodesContext");return e}const Uh=g.createContext(null);function c0(){const e=g.useContext(Uh);if(e===null)throw new Error("Provide a DnDContext");return e}const zh=g.createContext(0);function Vh(){g.useContext(zh)}function Ro(e,t,r){return Math.max(Math.min(e,r),t)}function Hh(e){return e&&e.isLeaf}function Qh(e){return e&&e.isInternal&&!e.isOpen}function Wh(e){var t;return e&&e.isOpen&&!(!((t=e.children)===null||t===void 0)&&t.length)}const Gh=(e,t)=>{let r=e;for(;r;){if(r.id===t.id)return!0;r=r.parent}return!1},Kh=e=>{if(!e.parent)throw Error("Node does not have a parent");return e.parent.children.findIndex(t=>t.id===e.id)};function $l(e,t){if(!e)return null;if(e.id===t)return e;if(e.children)for(let r of e.children){const n=$l(r,t);if(n)return n}return null}function ni(e,t){if(t(e),e.children)for(let r of e.children)ni(r,t)}function Yh(e){const t=Xh(e);let r;for(let n=0;n<t.length;++n)if(t[n]===e){r=u0(t,n);break}r==null||r.focus()}function Zh(e){const t=Xh(e);let r;for(let n=0;n<t.length;++n)if(t[n]===e){r=d0(t,n);break}r==null||r.focus()}function u0(e,t){return t+1<e.length?e[t+1]:e[0]}function d0(e,t){return t-1>=0?e[t-1]:e[e.length-1]}function Xh(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 Es(e,t){return typeof t=="boolean"?t:typeof t=="string"?e[t]:t(e)}function Rn(e){return typeof e=="string"?e:e.id}function f0(e,...t){if(e)return e(...t)}function Jh(e){return new Promise((t,r)=>{let n=0;function s(){n+=1,n===100&&r(),e()?t():setTimeout(s,10)}s()})}function ep(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 tp(e){const t=e.focusedNode;return t?t.isOpen?t.id:t.parent&&!t.parent.isRoot?t.parent.id:null:null}const h0=Object.freeze(Object.defineProperty({__proto__:null,access:Es,bound:Ro,dfs:$l,focusNextElement:Yh,focusPrevElement:Zh,getInsertIndex:ep,getInsertParentId:tp,identify:Rn,indexOf:Kh,isClosed:Qh,isDescendant:Gh,isItem:Hh,isOpenWithEmptyChildren:Wh,safeRun:f0,waitFor:Jh,walk:ni},Symbol.toStringTag,{value:"Module"})),p0={display:"flex",alignItems:"center",zIndex:1},m0={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},g0={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},v0=g.memo(function({top:t,left:r,indent:n}){const s={position:"absolute",pointerEvents:"none",top:t-2+"px",left:r+"px",right:n+"px"};return l.jsxs("div",{style:Object.assign(Object.assign({},p0),s),children:[l.jsx("div",{style:Object.assign({},g0)}),l.jsx("div",{style:Object.assign({},m0)})]})});function y0({node:e,attrs:t,innerRef:r,children:n}){return l.jsx("div",Object.assign({},t,{ref:r,onFocus:s=>s.stopPropagation(),onClick:e.handleClick,children:n}))}function b0(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(S0,Object.assign({},e)):l.jsx(C0,Object.assign({},e))]})}function C0(e){return l.jsx(l.Fragment,{children:l.jsx("span",{children:e.node.data.name})})}function S0({node:e}){const t=g.useRef();return g.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 Us="__REACT_ARBORIST_INTERNAL_ROOT__";function du(e){var t;function r(o,i,a){const c=e.accessId(o),u=new zs({tree:e,data:o,level:i,parent:a,id:c,children:null,isDraggable:e.isDraggable(o),rowIndex:null}),d=e.accessChildren(o);return d&&(u.children=d.map(f=>r(f,i+1,u))),u}const n=new zs({tree:e,id:Us,data:{id:Us},level:-1,parent:null,children:null,isDraggable:!0,rowIndex:null}),s=(t=e.props.data)!==null&&t!==void 0?t:[];return n.children=s.map(o=>r(o,0,n)),n}class zs{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===Us}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 zs(Object.assign({},this))}edit(){return this.tree.edit(this)}}function Zi(e){return{type:"EDIT",id:e}}function x0(e={id:null},t){return t.type==="EDIT"?Object.assign(Object.assign({},e),{id:t.id}):e}function En(e){return{type:"FOCUS",id:e}}function _0(){return{type:"TREE_BLUR"}}function w0(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 el={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 fu(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 T0(e={filtered:{},unfiltered:{}},t){return t.type.startsWith("VISIBILITY")?t.filtered?Object.assign(Object.assign({},e),{filtered:fu(e.filtered,t)}):Object.assign(Object.assign({},e),{unfiltered:fu(e.unfiltered,t)}):e}const ns=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}}},jr={clear:()=>({type:"SELECTION_CLEAR"}),only:e=>({type:"SELECTION_ONLY",id:Rn(e)}),add:e=>({type:"SELECTION_ADD",ids:(Array.isArray(e)?e:[e]).map(Rn)}),remove:e=>({type:"SELECTION_REMOVE",ids:(Array.isArray(e)?e:[e]).map(Rn)}),set:e=>Object.assign({type:"SELECTION_SET"},e),mostRecent:e=>({type:"SELECTION_MOST_RECENT",id:e===null?null:Rn(e)}),anchor:e=>({type:"SELECTION_ANCHOR",id:e===null?null:Rn(e)})};function E0(e=ns().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 ss={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 A0(e=ns().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 ns().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},e),{parentId:t.parentId,index:t.index});default:return e}}const k0={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},I0=e=>{if(!e)return{display:"none"};const{x:t,y:r}=e;return{transform:`translate(${t}px, ${r}px)`}},L0=e=>{if(!e)return{display:"none"};const{x:t,y:r}=e;return{transform:`translate(${t+10}px, ${r+10}px)`}};function rp({offset:e,mouse:t,id:r,dragIds:n,isDragging:s}){return l.jsxs(D0,{isDragging:s,children:[l.jsx(j0,{offset:e,children:l.jsx(O0,{id:r,dragIds:n})}),l.jsx(N0,{mouse:t,count:n.length})]})}const D0=g.memo(function(t){return t.isDragging?l.jsx("div",{style:k0,children:t.children}):null});function j0(e){return l.jsx("div",{className:"row preview",style:I0(e.offset),children:e.children})}function N0(e){const{count:t,mouse:r}=e;return t>1?l.jsx("div",{className:"selected-count",style:L0(r),children:t}):null}const O0=g.memo(function(t){const r=Mt(),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 tl(){return tl=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},tl.apply(null,arguments)}function hu(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rl(e,t){return rl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},rl(e,t)}function P0(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,rl(e,t)}var pu=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function R0(e,t){return!!(e===t||pu(e)&&pu(t))}function F0(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!R0(e[r],t[r]))return!1;return!0}function Xi(e,t){t===void 0&&(t=F0);var r,n=[],s,o=!1;function i(){for(var a=[],c=0;c<arguments.length;c++)a[c]=arguments[c];return o&&r===this&&t(a,n)||(s=e.apply(this,a),o=!0,r=this,n=a),s}return i}var M0=typeof performance=="object"&&typeof performance.now=="function",mu=M0?function(){return performance.now()}:function(){return Date.now()};function gu(e){cancelAnimationFrame(e.id)}function B0(e,t){var r=mu();function n(){mu()-r>=t?e.call(null):s.id=requestAnimationFrame(n)}var s={id:requestAnimationFrame(n)};return s}var Ji=-1;function vu(e){if(e===void 0&&(e=!1),Ji===-1||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),Ji=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Ji}var An=null;function yu(e){if(e===void 0&&(e=!1),An===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"),s=n.style;return s.width="100px",s.height="100px",t.appendChild(n),document.body.appendChild(t),t.scrollLeft>0?An="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?An="negative":An="positive-ascending"),document.body.removeChild(t),An}return An}process.env.NODE_ENV;var q0=150,$0=function(t,r){return t},Fo=null,Mo=null;process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof window.WeakSet<"u"&&(Fo=new WeakSet,Mo=new WeakSet);function np(e){var t,r=e.getItemOffset,n=e.getEstimatedTotalSize,s=e.getItemSize,o=e.getOffsetForIndexAndAlignment,i=e.getStartIndexForOffset,a=e.getStopIndexForStartIndex,c=e.initInstanceProps,u=e.shouldResetStyleCacheOnItemSizeChange,d=e.validateProps;return t=(function(f){P0(p,f);function p(C){var h;return h=f.call(this,C)||this,h._instanceProps=c(h.props,hu(h)),h._outerRef=void 0,h._resetIsScrollingTimeoutId=null,h.state={instance:hu(h),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof h.props.initialScrollOffset=="number"?h.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},h._callOnItemsRendered=void 0,h._callOnItemsRendered=Xi(function(v,y,b,S){return h.props.onItemsRendered({overscanStartIndex:v,overscanStopIndex:y,visibleStartIndex:b,visibleStopIndex:S})}),h._callOnScroll=void 0,h._callOnScroll=Xi(function(v,y,b){return h.props.onScroll({scrollDirection:v,scrollOffset:y,scrollUpdateWasRequested:b})}),h._getItemStyle=void 0,h._getItemStyle=function(v){var y=h.props,b=y.direction,S=y.itemSize,x=y.layout,w=h._getItemStyleCache(u&&S,u&&x,u&&b),T;if(w.hasOwnProperty(v))T=w[v];else{var L=r(h.props,v,h._instanceProps),A=s(h.props,v,h._instanceProps),O=b==="horizontal"||x==="horizontal",P=b==="rtl",j=O?L:0;w[v]=T={position:"absolute",left:P?void 0:j,right:P?j:void 0,top:O?0:L,height:O?"100%":A,width:O?A:"100%"}}return T},h._getItemStyleCache=void 0,h._getItemStyleCache=Xi(function(v,y,b){return{}}),h._onScrollHorizontal=function(v){var y=v.currentTarget,b=y.clientWidth,S=y.scrollLeft,x=y.scrollWidth;h.setState(function(w){if(w.scrollOffset===S)return null;var T=h.props.direction,L=S;if(T==="rtl")switch(yu()){case"negative":L=-S;break;case"positive-descending":L=x-b-S;break}return L=Math.max(0,Math.min(L,x-b)),{isScrolling:!0,scrollDirection:w.scrollOffset<L?"forward":"backward",scrollOffset:L,scrollUpdateWasRequested:!1}},h._resetIsScrollingDebounced)},h._onScrollVertical=function(v){var y=v.currentTarget,b=y.clientHeight,S=y.scrollHeight,x=y.scrollTop;h.setState(function(w){if(w.scrollOffset===x)return null;var T=Math.max(0,Math.min(x,S-b));return{isScrolling:!0,scrollDirection:w.scrollOffset<T?"forward":"backward",scrollOffset:T,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&&gu(h._resetIsScrollingTimeoutId),h._resetIsScrollingTimeoutId=B0(h._resetIsScrolling,q0)},h._resetIsScrolling=function(){h._resetIsScrollingTimeoutId=null,h.setState({isScrolling:!1},function(){h._getItemStyleCache(-1,null)})},h}p.getDerivedStateFromProps=function(h,v){return U0(h,v),d(h),null};var m=p.prototype;return m.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)},m.scrollToItem=function(h,v){v===void 0&&(v="auto");var y=this.props,b=y.itemCount,S=y.layout,x=this.state.scrollOffset;h=Math.max(0,Math.min(h,b-1));var w=0;if(this._outerRef){var T=this._outerRef;S==="vertical"?w=T.scrollWidth>T.clientWidth?vu():0:w=T.scrollHeight>T.clientHeight?vu():0}this.scrollTo(o(this.props,h,v,x,this._instanceProps,w))},m.componentDidMount=function(){var h=this.props,v=h.direction,y=h.initialScrollOffset,b=h.layout;if(typeof y=="number"&&this._outerRef!=null){var S=this._outerRef;v==="horizontal"||b==="horizontal"?S.scrollLeft=y:S.scrollTop=y}this._callPropsCallbacks()},m.componentDidUpdate=function(){var h=this.props,v=h.direction,y=h.layout,b=this.state,S=b.scrollOffset,x=b.scrollUpdateWasRequested;if(x&&this._outerRef!=null){var w=this._outerRef;if(v==="horizontal"||y==="horizontal")if(v==="rtl")switch(yu()){case"negative":w.scrollLeft=-S;break;case"positive-ascending":w.scrollLeft=S;break;default:var T=w.clientWidth,L=w.scrollWidth;w.scrollLeft=L-T-S;break}else w.scrollLeft=S;else w.scrollTop=S}this._callPropsCallbacks()},m.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&gu(this._resetIsScrollingTimeoutId)},m.render=function(){var h=this.props,v=h.children,y=h.className,b=h.direction,S=h.height,x=h.innerRef,w=h.innerElementType,T=h.innerTagName,L=h.itemCount,A=h.itemData,O=h.itemKey,P=O===void 0?$0:O,j=h.layout,N=h.outerElementType,F=h.outerTagName,R=h.style,U=h.useIsScrolling,re=h.width,G=this.state.isScrolling,pe=b==="horizontal"||j==="horizontal",me=pe?this._onScrollHorizontal:this._onScrollVertical,V=this._getRangeToRender(),de=V[0],oe=V[1],Se=[];if(L>0)for(var ve=de;ve<=oe;ve++)Se.push(g.createElement(v,{data:A,key:P(ve,A),index:ve,isScrolling:U?G:void 0,style:this._getItemStyle(ve)}));var q=n(this.props,this._instanceProps);return g.createElement(N||F||"div",{className:y,onScroll:me,ref:this._outerRefSetter,style:tl({position:"relative",height:S,width:re,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:b},R)},g.createElement(w||T||"div",{children:Se,ref:x,style:{height:pe?"100%":q,pointerEvents:G?"none":void 0,width:pe?q:"100%"}}))},m._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var h=this.props.itemCount;if(h>0){var v=this._getRangeToRender(),y=v[0],b=v[1],S=v[2],x=v[3];this._callOnItemsRendered(y,b,S,x)}}if(typeof this.props.onScroll=="function"){var w=this.state,T=w.scrollDirection,L=w.scrollOffset,A=w.scrollUpdateWasRequested;this._callOnScroll(T,L,A)}},m._getRangeToRender=function(){var h=this.props,v=h.itemCount,y=h.overscanCount,b=this.state,S=b.isScrolling,x=b.scrollDirection,w=b.scrollOffset;if(v===0)return[0,0,0,0];var T=i(this.props,w,this._instanceProps),L=a(this.props,T,w,this._instanceProps),A=!S||x==="backward"?Math.max(1,y):1,O=!S||x==="forward"?Math.max(1,y):1;return[Math.max(0,T-A),Math.max(0,Math.min(v-1,L+O)),T,L]},p})(g.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var U0=function(t,r){var n=t.children,s=t.direction,o=t.height,i=t.layout,a=t.innerTagName,c=t.outerTagName,u=t.width,d=r.instance;if(process.env.NODE_ENV!=="production"){(a!=null||c!=null)&&Mo&&!Mo.has(d)&&(Mo.add(d),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var f=s==="horizontal"||i==="horizontal";switch(s){case"horizontal":case"vertical":Fo&&!Fo.has(d)&&(Fo.add(d),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". '+('"'+s+'" was specified.'))}switch(i){case"horizontal":case"vertical":break;default:throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". '+('"'+i+'" 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 u!="number")throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. '+('"'+(u===null?"null":typeof u)+'" was specified.'));if(!f&&typeof o!="number")throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. '+('"'+(o===null?"null":typeof o)+'" was specified.'))}},z0=50,Fn=function(t,r,n){var s=t,o=s.itemSize,i=n.itemMetadataMap,a=n.lastMeasuredIndex;if(r>a){var c=0;if(a>=0){var u=i[a];c=u.offset+u.size}for(var d=a+1;d<=r;d++){var f=o(d);i[d]={offset:c,size:f},c+=f}n.lastMeasuredIndex=r}return i[r]},V0=function(t,r,n){var s=r.itemMetadataMap,o=r.lastMeasuredIndex,i=o>0?s[o].offset:0;return i>=n?sp(t,r,o,0,n):H0(t,r,Math.max(0,o),n)},sp=function(t,r,n,s,o){for(;s<=n;){var i=s+Math.floor((n-s)/2),a=Fn(t,i,r).offset;if(a===o)return i;a<o?s=i+1:a>o&&(n=i-1)}return s>0?s-1:0},H0=function(t,r,n,s){for(var o=t.itemCount,i=1;n<o&&Fn(t,n,r).offset<s;)n+=i,i*=2;return sp(t,r,Math.min(n,o-1),Math.floor(n/2),s)},bu=function(t,r){var n=t.itemCount,s=r.itemMetadataMap,o=r.estimatedItemSize,i=r.lastMeasuredIndex,a=0;if(i>=n&&(i=n-1),i>=0){var c=s[i];a=c.offset+c.size}var u=n-i-1,d=u*o;return a+d},Q0=np({getItemOffset:function(t,r,n){return Fn(t,r,n).offset},getItemSize:function(t,r,n){return n.itemMetadataMap[r].size},getEstimatedTotalSize:bu,getOffsetForIndexAndAlignment:function(t,r,n,s,o,i){var a=t.direction,c=t.height,u=t.layout,d=t.width,f=a==="horizontal"||u==="horizontal",p=f?d:c,m=Fn(t,r,o),C=bu(t,o),h=Math.max(0,Math.min(C-p,m.offset)),v=Math.max(0,m.offset-p+m.size+i);switch(n==="smart"&&(s>=v-p&&s<=h+p?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 s>=v&&s<=h?s:s<v?v:h}},getStartIndexForOffset:function(t,r,n){return V0(t,n,r)},getStopIndexForStartIndex:function(t,r,n,s){for(var o=t.direction,i=t.height,a=t.itemCount,c=t.layout,u=t.width,d=o==="horizontal"||c==="horizontal",f=d?u:i,p=Fn(t,r,s),m=n+f,C=p.offset+p.size,h=r;h<a-1&&C<m;)h++,C+=Fn(t,h,s).size;return h},initInstanceProps:function(t,r){var n=t,s=n.estimatedItemSize,o={itemMetadataMap:{},estimatedItemSize:s||z0,lastMeasuredIndex:-1};return r.resetAfterIndex=function(i,a){a===void 0&&(a=!0),o.lastMeasuredIndex=Math.min(o.lastMeasuredIndex,i-1),r._getItemStyleCache(-1),a&&r.forceUpdate()},o},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.'))}}),W0=np({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,s,o,i){var a=t.direction,c=t.height,u=t.itemCount,d=t.itemSize,f=t.layout,p=t.width,m=a==="horizontal"||f==="horizontal",C=m?p:c,h=Math.max(0,u*d-C),v=Math.min(h,r*d),y=Math.max(0,r*d-C+d+i);switch(n==="smart"&&(s>=y-C&&s<=v+C?n="auto":n="center"),n){case"start":return v;case"end":return y;case"center":{var b=Math.round(y+(v-y)/2);return b<Math.ceil(C/2)?0:b>h+Math.floor(C/2)?h:b}case"auto":default:return s>=y&&s<=v?s:s<y?y:v}},getStartIndexForOffset:function(t,r){var n=t.itemCount,s=t.itemSize;return Math.max(0,Math.min(n-1,Math.floor(r/s)))},getStopIndexForStartIndex:function(t,r,n){var s=t.direction,o=t.height,i=t.itemCount,a=t.itemSize,c=t.layout,u=t.width,d=s==="horizontal"||c==="horizontal",f=r*a,p=d?u:o,m=Math.ceil((p+n-f)/a);return Math.max(0,Math.min(i-1,r+m-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 G0(){var e,t;const r=Mt(),s=c0().cursor;if(!s||s.type!=="line")return null;const o=r.indent,i=r.rowTopPosition(s.index)+((t=(e=r.props.padding)!==null&&e!==void 0?e:r.props.paddingTop)!==null&&t!==void 0?t:0),a=o*s.level,c=r.renderCursor;return l.jsx(c,{top:i,left:a,indent:o})}var K0=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 s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r};const Y0=g.forwardRef(function(t,r){const{children:n}=t,s=K0(t,["children"]),o=Mt();return l.jsxs("div",Object.assign({ref:r},s,{onClick:i=>{i.currentTarget===i.target&&o.deselectAll()},children:[l.jsx(Z0,{}),n]}))}),Z0=()=>{const e=Mt();return l.jsx("div",{style:{height:e.rowTopPosition(e.visibleNodes.length),width:"100%",position:"absolute",left:"0",right:"0"},children:l.jsx(G0,{})})};var X0=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 s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r};const J0=g.forwardRef(function(t,r){var n,s,o,i,{style:a}=t,c=X0(t,["style"]);const u=Mt(),d=(s=(n=u.props.padding)!==null&&n!==void 0?n:u.props.paddingTop)!==null&&s!==void 0?s:0,f=(i=(o=u.props.padding)!==null&&o!==void 0?o:u.props.paddingBottom)!==null&&i!==void 0?i:0;return l.jsx("div",Object.assign({ref:r,style:Object.assign(Object.assign({},a),{height:`${parseFloat(a.height)+d+f}px`})},c))});var op=g.createContext({dragDropManager:void 0}),Jt;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Jt||(Jt={}));function we(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),s=2;s<r;s++)n[s-2]=arguments[s];if(process.env.NODE_ENV!=="production"&&t===void 0)throw new Error("invariant requires an error message argument");if(!e){var o;if(t===void 0)o=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var i=0;o=new Error(t.replace(/%s/g,function(){return n[i++]})),o.name="Invariant Violation"}throw o.framesToPop=1,o}}var Ul="dnd-core/INIT_COORDS",Li="dnd-core/BEGIN_DRAG",zl="dnd-core/PUBLISH_DRAG_SOURCE",Di="dnd-core/HOVER",ji="dnd-core/DROP",Ni="dnd-core/END_DRAG";function Cu(e,t){return{type:Ul,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}function Bo(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Bo=function(r){return typeof r}:Bo=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Bo(e)}function eE(e,t,r){return t.split(".").reduce(function(n,s){return n&&n[s]?n[s]:r||null},e)}function tE(e,t){return e.filter(function(r){return r!==t})}function ip(e){return Bo(e)==="object"}function rE(e,t){var r=new Map,n=function(i){r.set(i,r.has(i)?r.get(i)+1:1)};e.forEach(n),t.forEach(n);var s=[];return r.forEach(function(o,i){o===1&&s.push(i)}),s}function nE(e,t){return e.filter(function(r){return t.indexOf(r)>-1})}var sE={type:Ul,payload:{clientOffset:null,sourceClientOffset:null}};function oE(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},s=n.publishSource,o=s===void 0?!0:s,i=n.clientOffset,a=n.getSourceClientOffset,c=e.getMonitor(),u=e.getRegistry();e.dispatch(Cu(i)),iE(r,c,u);var d=cE(r,c);if(d===null){e.dispatch(sE);return}var f=null;if(i){if(!a)throw new Error("getSourceClientOffset must be defined");aE(a),f=a(d)}e.dispatch(Cu(i,f));var p=u.getSource(d),m=p.beginDrag(c,d);if(m!=null){lE(m),u.pinSource(d);var C=u.getSourceType(d);return{type:Li,payload:{itemType:C,item:m,sourceId:d,clientOffset:i||null,sourceClientOffset:f||null,isSourcePublic:!!o}}}}}function iE(e,t,r){we(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(n){we(r.getSource(n),"Expected sourceIds to be registered.")})}function aE(e){we(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function lE(e){we(ip(e),"Item must be an object.")}function cE(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 uE(e){return function(){var r=e.getMonitor();if(r.isDragging())return{type:zl}}}function nl(e,t){return t===null?e===null:Array.isArray(e)?e.some(function(r){return r===t}):e===t}function dE(e){return function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=n.clientOffset;fE(r);var o=r.slice(0),i=e.getMonitor(),a=e.getRegistry();hE(o,i,a);var c=i.getItemType();return pE(o,a,c),mE(o,i,a),{type:Di,payload:{targetIds:o,clientOffset:s||null}}}}function fE(e){we(Array.isArray(e),"Expected targetIds to be an array.")}function hE(e,t,r){we(t.isDragging(),"Cannot call hover while not dragging."),we(!t.didDrop(),"Cannot call hover after drop.");for(var n=0;n<e.length;n++){var s=e[n];we(e.lastIndexOf(s)===n,"Expected targetIds to be unique in the passed array.");var o=r.getTarget(s);we(o,"Expected targetIds to be registered.")}}function pE(e,t,r){for(var n=e.length-1;n>=0;n--){var s=e[n],o=t.getTargetType(s);nl(o,r)||e.splice(n,1)}}function mE(e,t,r){e.forEach(function(n){var s=r.getTarget(n);s.hover(t,n)})}function Su(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function xu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Su(Object(r),!0).forEach(function(n){gE(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Su(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vE(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.getMonitor(),s=e.getRegistry();yE(n);var o=SE(n);o.forEach(function(i,a){var c=bE(i,a,s,n),u={type:ji,payload:{dropResult:xu(xu({},r),c)}};e.dispatch(u)})}}function yE(e){we(e.isDragging(),"Cannot call drop while not dragging."),we(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function bE(e,t,r,n){var s=r.getTarget(e),o=s?s.drop(n,e):void 0;return CE(o),typeof o>"u"&&(o=t===0?{}:n.getDropResult()),o}function CE(e){we(typeof e>"u"||ip(e),"Drop result must either be an object or undefined.")}function SE(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function xE(e){return function(){var r=e.getMonitor(),n=e.getRegistry();_E(r);var s=r.getSourceId();if(s!=null){var o=n.getSource(s,!0);o.endDrag(r,s),n.unpinSource()}return{type:Ni}}}function _E(e){we(e.isDragging(),"Cannot call endDrag while not dragging.")}function wE(e){return{beginDrag:oE(e),publishDragSource:uE(e),hover:dE(e),drop:vE(e),endDrag:xE(e)}}function TE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function EE(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 AE(e,t,r){return t&&EE(e.prototype,t),e}function ys(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var kE=(function(){function e(t,r){var n=this;TE(this,e),ys(this,"store",void 0),ys(this,"monitor",void 0),ys(this,"backend",void 0),ys(this,"isSetUp",!1),ys(this,"handleRefCountChange",function(){var s=n.store.getState().refCount>0;n.backend&&(s&&!n.isSetUp?(n.backend.setup(),n.isSetUp=!0):!s&&n.isSetUp&&(n.backend.teardown(),n.isSetUp=!1))}),this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}return AE(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 s(i){return function(){for(var a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];var d=i.apply(r,c);typeof d<"u"&&n(d)}}var o=wE(this);return Object.keys(o).reduce(function(i,a){var c=o[a];return i[a]=s(c),i},{})}},{key:"dispatch",value:function(r){this.store.dispatch(r)}}]),e})();function Wt(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 _u=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),wu=function(){return Math.random().toString(36).substring(7).split("").join(".")},Tu={INIT:"@@redux/INIT"+wu(),REPLACE:"@@redux/REPLACE"+wu()};function IE(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 LE(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(NE(e))return"date";if(jE(e))return"error";var r=DE(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 DE(e){return typeof e.constructor=="function"?e.constructor.name:null}function jE(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function NE(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function kn(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=LE(e)),t}function ap(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"?Wt(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"?Wt(1):"Expected the enhancer to be a function. Instead, received: '"+kn(r)+"'");return r(ap)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?Wt(2):"Expected the root reducer to be a function. Instead, received: '"+kn(e)+"'");var s=e,o=t,i=[],a=i,c=!1;function u(){a===i&&(a=i.slice())}function d(){if(c)throw new Error(process.env.NODE_ENV==="production"?Wt(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(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?Wt(4):"Expected the listener to be a function. Instead, received: '"+kn(h)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?Wt(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 u(),a.push(h),function(){if(v){if(c)throw new Error(process.env.NODE_ENV==="production"?Wt(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,u();var b=a.indexOf(h);a.splice(b,1),i=null}}}function p(h){if(!IE(h))throw new Error(process.env.NODE_ENV==="production"?Wt(7):"Actions must be plain objects. Instead, the actual type was: '"+kn(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"?Wt(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"?Wt(9):"Reducers may not dispatch actions.");try{c=!0,o=s(o,h)}finally{c=!1}for(var v=i=a,y=0;y<v.length;y++){var b=v[y];b()}return h}function m(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?Wt(10):"Expected the nextReducer to be a function. Instead, received: '"+kn(h));s=h,p({type:Tu.REPLACE})}function C(){var h,v=f;return h={subscribe:function(b){if(typeof b!="object"||b===null)throw new Error(process.env.NODE_ENV==="production"?Wt(11):"Expected the observer to be an object. Instead, received: '"+kn(b)+"'");function S(){b.next&&b.next(d())}S();var x=v(S);return{unsubscribe:x}}},h[_u]=function(){return this},h}return p({type:Tu.INIT}),n={dispatch:p,subscribe:f,getState:d,replaceReducer:m},n[_u]=C,n}var OE=function(t,r){return t===r};function PE(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function RE(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:OE;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 Eu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Au(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Eu(Object(r),!0).forEach(function(n){FE(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Eu(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function FE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ku={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function ME(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ku,t=arguments.length>1?arguments[1]:void 0,r=t.payload;switch(t.type){case Ul:case Li:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case Di:return PE(e.clientOffset,r.clientOffset)?e:Au(Au({},e),{},{clientOffset:r.clientOffset});case Ni:case ji:return ku;default:return e}}var Vl="dnd-core/ADD_SOURCE",Hl="dnd-core/ADD_TARGET",Ql="dnd-core/REMOVE_SOURCE",Oi="dnd-core/REMOVE_TARGET";function BE(e){return{type:Vl,payload:{sourceId:e}}}function qE(e){return{type:Hl,payload:{targetId:e}}}function $E(e){return{type:Ql,payload:{sourceId:e}}}function UE(e){return{type:Oi,payload:{targetId:e}}}function Iu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Gt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Iu(Object(r),!0).forEach(function(n){zE(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Iu(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function zE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var VE={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function HE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:VE,t=arguments.length>1?arguments[1]:void 0,r=t.payload;switch(t.type){case Li:return Gt(Gt({},e),{},{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case zl:return Gt(Gt({},e),{},{isSourcePublic:!0});case Di:return Gt(Gt({},e),{},{targetIds:r.targetIds});case Oi:return e.targetIds.indexOf(r.targetId)===-1?e:Gt(Gt({},e),{},{targetIds:tE(e.targetIds,r.targetId)});case ji:return Gt(Gt({},e),{},{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case Ni:return Gt(Gt({},e),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function QE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Vl:case Hl:return e+1;case Ql:case Oi:return e-1;default:return e}}var si=[],Wl=[];si.__IS_NONE__=!0;Wl.__IS_ALL__=!0;function WE(e,t){if(e===si)return!1;if(e===Wl||typeof t>"u")return!0;var r=nE(t,e);return r.length>0}function GE(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case Di:break;case Vl:case Hl:case Oi:case Ql:return si;case Li:case zl:case Ni:case ji:default:return Wl}var t=e.payload,r=t.targetIds,n=r===void 0?[]:r,s=t.prevTargetIds,o=s===void 0?[]:s,i=rE(n,o),a=i.length>0||!RE(n,o);if(!a)return si;var c=o[o.length-1],u=n[n.length-1];return c!==u&&(c&&i.push(c),u&&i.push(u)),i}function KE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e+1}function Lu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Du(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Lu(Object(r),!0).forEach(function(n){YE(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lu(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function YE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ZE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:GE(e.dirtyHandlerIds,{type:t.type,payload:Du(Du({},t.payload),{},{prevTargetIds:eE(e,"dragOperation.targetIds",[])})}),dragOffset:ME(e.dragOffset,t),refCount:QE(e.refCount,t),dragOperation:HE(e.dragOperation,t),stateId:KE(e.stateId)}}function XE(e,t){return{x:e.x+t.x,y:e.y+t.y}}function lp(e,t){return{x:e.x-t.x,y:e.y-t.y}}function JE(e){var t=e.clientOffset,r=e.initialClientOffset,n=e.initialSourceClientOffset;return!t||!r||!n?null:lp(XE(t,n),r)}function eA(e){var t=e.clientOffset,r=e.initialClientOffset;return!t||!r?null:lp(t,r)}function tA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rA(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 nA(e,t,r){return t&&rA(e.prototype,t),e}function ju(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var sA=(function(){function e(t,r){tA(this,e),ju(this,"store",void 0),ju(this,"registry",void 0),this.store=t,this.registry=r}return nA(e,[{key:"subscribeToStateChange",value:function(r){var n=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0},o=s.handlerIds;we(typeof r=="function","listener must be a function."),we(typeof o>"u"||Array.isArray(o),"handlerIds, when specified, must be an array of strings.");var i=this.store.getState().stateId,a=function(){var u=n.store.getState(),d=u.stateId;try{var f=d===i||d===i+1&&!WE(u.dirtyHandlerIds,o);f||r()}finally{i=d}};return this.store.subscribe(a)}},{key:"subscribeToOffsetChange",value:function(r){var n=this;we(typeof r=="function","listener must be a function.");var s=this.store.getState().dragOffset,o=function(){var a=n.store.getState().dragOffset;a!==s&&(s=a,r())};return this.store.subscribe(o)}},{key:"canDragSource",value:function(r){if(!r)return!1;var n=this.registry.getSource(r);return we(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(we(n,"Expected to find a valid target. targetId=".concat(r)),!this.isDragging()||this.didDrop())return!1;var s=this.registry.getTargetType(r),o=this.getItemType();return nl(s,o)&&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(we(n,"Expected to find a valid source. sourceId=".concat(r)),!this.isDragging()||!this.isSourcePublic())return!1;var s=this.registry.getSourceType(r),o=this.getItemType();return s!==o?!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 s=n.shallow;if(!this.isDragging())return!1;var o=this.registry.getTargetType(r),i=this.getItemType();if(i&&!nl(o,i))return!1;var a=this.getTargetIds();if(!a.length)return!1;var c=a.indexOf(r);return s?c===a.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 JE(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return eA(this.store.getState().dragOffset)}}]),e})(),oA=0;function iA(){return oA++}function qo(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?qo=function(r){return typeof r}:qo=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},qo(e)}function aA(e){we(typeof e.canDrag=="function","Expected canDrag to be a function."),we(typeof e.beginDrag=="function","Expected beginDrag to be a function."),we(typeof e.endDrag=="function","Expected endDrag to be a function.")}function lA(e){we(typeof e.canDrop=="function","Expected canDrop to be a function."),we(typeof e.hover=="function","Expected hover to be a function."),we(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}we(typeof e=="string"||qo(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 Nu=typeof global<"u"?global:self,cp=Nu.MutationObserver||Nu.WebKitMutationObserver;function up(e){return function(){const r=setTimeout(s,0),n=setInterval(s,50);function s(){clearTimeout(r),clearInterval(n),e()}}}function cA(e){let t=1;const r=new cp(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const uA=typeof cp=="function"?cA:up;class dA{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,s=t.length-this.index;n<s;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=uA(this.flush),this.requestErrorThrow=up(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class fA{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 hA{create(t){const r=this.freeTasks,n=r.length?r.pop():new fA(this.onError,s=>r[r.length]=s);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}const dp=new dA,pA=new hA(dp.registerPendingError);function mA(e){dp.enqueueTask(pA.create(e))}function gA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vA(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 yA(e,t,r){return t&&vA(e.prototype,t),e}function In(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bA(e,t){return _A(e)||xA(e,t)||SA(e,t)||CA()}function CA(){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
|
|
538
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DA(e,t){if(e){if(typeof e=="string")return Fu(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 Fu(e,t)}}function Fu(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 jA(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,o=!1,i,a;try{for(r=r.call(e);!(s=(i=r.next()).done)&&(n.push(i.value),!(t&&n.length===t));s=!0);}catch(c){o=!0,a=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function NA(e){if(Array.isArray(e))return e}function OA(e,t){if(e==null)return{};var r=PA(e,t),n,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)n=o[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function PA(e,t){if(e==null)return{};var r={},n=Object.keys(e),s,o;for(o=0;o<n.length;o++)s=n[o],!(t.indexOf(s)>=0)&&(r[s]=e[s]);return r}var Mu=0,$o=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),RA=g.memo(function(t){var r=t.children,n=OA(t,kA),s=FA(n),o=IA(s,2),i=o[0],a=o[1];return g.useEffect(function(){if(a){var c=fp();return++Mu,function(){--Mu===0&&(c[$o]=null)}}},[]),l.jsx(op.Provider,Object.assign({value:i},{children:r}),void 0)});function FA(e){if("manager"in e){var t={dragDropManager:e.manager};return[t,!1]}var r=MA(e.backend,e.context,e.options,e.debugMode),n=!e.context;return[r,n]}function MA(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:fp(),r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,s=t;return s[$o]||(s[$o]={dragDropManager:EA(e,t,r,n)}),s[$o]}function fp(){return typeof global<"u"?global:window}function BA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qA(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 $A(e,t,r){return t&&qA(e.prototype,t),e}function Bu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ea=!1,ta=!1,UA=(function(){function e(t){BA(this,e),Bu(this,"internalMonitor",void 0),Bu(this,"sourceId",null),this.internalMonitor=t.getMonitor()}return $A(e,[{key:"receiveHandlerId",value:function(r){this.sourceId=r}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){we(!ea,"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 ea=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{ea=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;we(!ta,"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 ta=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{ta=!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 zA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function VA(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 HA(e,t,r){return t&&VA(e.prototype,t),e}function qu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ra=!1,QA=(function(){function e(t){zA(this,e),qu(this,"internalMonitor",void 0),qu(this,"targetId",null),this.internalMonitor=t.getMonitor()}return HA(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;we(!ra,"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 ra=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{ra=!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 WA(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 GA(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(!g.isValidElement(t)){var n=t;return e(n,r),n}var s=t;WA(s);var o=r?function(i){return e(i,r)}:e;return KA(s,o)}}function hp(e){var t={};return Object.keys(e).forEach(function(r){var n=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{var s=GA(n);t[r]=function(){return s}}}),t}function $u(e,t){typeof e=="function"?e(t):e.current=t}function KA(e,t){var r=e.ref;return we(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?g.cloneElement(e,{ref:function(s){$u(r,s),$u(t,s)}}):g.cloneElement(e,{ref:t})}function Uo(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Uo=function(r){return typeof r}:Uo=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Uo(e)}function ol(e){return e!==null&&Uo(e)==="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function il(e,t,r,n){var s=void 0;if(s!==void 0)return!!s;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;var o=Object.keys(e),i=Object.keys(t);if(o.length!==i.length)return!1;for(var a=Object.prototype.hasOwnProperty.bind(t),c=0;c<o.length;c++){var u=o[c];if(!a(u))return!1;var d=e[u],f=t[u];if(s=void 0,s===!1||s===void 0&&d!==f)return!1}return!0}function YA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZA(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 XA(e,t,r){return t&&ZA(e.prototype,t),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 JA=(function(){function e(t){var r=this;YA(this,e),_t(this,"hooks",hp({dragSource:function(s,o){r.clearDragSource(),r.dragSourceOptions=o||null,ol(s)?r.dragSourceRef=s:r.dragSourceNode=s,r.reconnectDragSource()},dragPreview:function(s,o){r.clearDragPreview(),r.dragPreviewOptions=o||null,ol(s)?r.dragPreviewRef=s:r.dragPreviewNode=s,r.reconnectDragPreview()}})),_t(this,"handlerId",null),_t(this,"dragSourceRef",null),_t(this,"dragSourceNode",void 0),_t(this,"dragSourceOptionsInternal",null),_t(this,"dragSourceUnsubscribe",void 0),_t(this,"dragPreviewRef",null),_t(this,"dragPreviewNode",void 0),_t(this,"dragPreviewOptionsInternal",null),_t(this,"dragPreviewUnsubscribe",void 0),_t(this,"lastConnectedHandlerId",null),_t(this,"lastConnectedDragSource",null),_t(this,"lastConnectedDragSourceOptions",null),_t(this,"lastConnectedDragPreview",null),_t(this,"lastConnectedDragPreviewOptions",null),_t(this,"backend",void 0),this.backend=t}return XA(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!il(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!il(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 ek(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tk(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 rk(e,t,r){return t&&tk(e.prototype,t),e}function hr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var nk=(function(){function e(t){var r=this;ek(this,e),hr(this,"hooks",hp({dropTarget:function(s,o){r.clearDropTarget(),r.dropTargetOptions=o,ol(s)?r.dropTargetRef=s:r.dropTargetNode=s,r.reconnect()}})),hr(this,"handlerId",null),hr(this,"dropTargetRef",null),hr(this,"dropTargetNode",void 0),hr(this,"dropTargetOptionsInternal",null),hr(this,"unsubscribeDropTarget",void 0),hr(this,"lastConnectedHandlerId",null),hr(this,"lastConnectedDropTarget",null),hr(this,"lastConnectedDropTargetOptions",null),hr(this,"backend",void 0),this.backend=t}return rk(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!il(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 sk(e,t,r){var n=r.getRegistry(),s=n.addTarget(e,t);return[s,function(){return n.removeTarget(s)}]}function ok(e,t,r){var n=r.getRegistry(),s=n.addSource(e,t);return[s,function(){return n.removeSource(s)}]}var bn=typeof window<"u"?g.useLayoutEffect:g.useEffect;function zo(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?zo=function(r){return typeof r}:zo=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},zo(e)}function ik(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ak(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 lk(e,t,r){return t&&ak(e.prototype,t),e}function na(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ck=(function(){function e(t,r,n){ik(this,e),na(this,"spec",void 0),na(this,"monitor",void 0),na(this,"connector",void 0),this.spec=t,this.monitor=r,this.connector=n}return lk(e,[{key:"beginDrag",value:function(){var r,n=this.spec,s=this.monitor,o=null;return zo(n.item)==="object"?o=n.item:typeof n.item=="function"?o=n.item(s):o={},(r=o)!==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 s=this.spec,o=this.monitor,i=s.isDragging;return i?i(o):n===r.getSourceId()}},{key:"endDrag",value:function(){var r=this.spec,n=this.monitor,s=this.connector,o=r.end;o&&o(n.getItem(),n),s.reconnect()}}]),e})();function uk(e,t,r){var n=g.useMemo(function(){return new ck(e,t,r)},[t,r]);return g.useEffect(function(){n.spec=e},[e]),n}function xn(){var e=g.useContext(op),t=e.dragDropManager;return we(t!=null,"Expected drag drop context"),t}function dk(e){return g.useMemo(function(){var t=e.type;return we(t!=null,"spec.type must be defined"),t},[e])}function fk(e,t){return gk(e)||mk(e,t)||pk(e,t)||hk()}function hk(){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
|
|
540
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
541
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
542
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
543
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
544
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
545
|
-
`)},dataTransfer:function(t){return t}},matchesTypes:["Url","text/uri-list"]}),So(Ln,_p,{exposeProperties:{text:function(t,r){return oa(t,r,"")},dataTransfer:function(t){return t}},matchesTypes:["Text","text/plain"]}),Ln);function _I(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wI(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 TI(e,t,r){return t&&wI(e.prototype,t),e}function Xu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var EI=(function(){function e(t){_I(this,e),Xu(this,"item",void 0),Xu(this,"config",void 0),this.config=t,this.item={},this.initializeExposedProperties()}return TI(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 s={};Object.keys(this.config.exposeProperties).forEach(function(o){s[o]={value:n.config.exposeProperties[o](r,n.config.matchesTypes),configurable:!0,enumerable:!0}}),Object.defineProperties(this.item,s)}}},{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 AI(e,t){var r=new EI(ll[e]);return r.loadDataTransfer(t),r}function ia(e){if(!e)return null;var t=Array.prototype.slice.call(e.types||[]);return Object.keys(ll).filter(function(r){var n=ll[r].matchesTypes;return n.some(function(s){return t.indexOf(s)>-1})})[0]||null}function kI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function II(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 LI(e,t,r){return t&&II(e.prototype,t),e}function aa(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var DI=(function(){function e(t,r){kI(this,e),aa(this,"ownerDocument",null),aa(this,"globalContext",void 0),aa(this,"optionsArgs",void 0),this.globalContext=t,this.optionsArgs=r}return LI(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 Ju(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function ed(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ju(Object(r),!0).forEach(function(n){Ie(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ju(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function jI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function NI(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 OI(e,t,r){return t&&NI(e.prototype,t),e}function Ie(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var PI=(function(){function e(t,r,n){var s=this;jI(this,e),Ie(this,"options",void 0),Ie(this,"actions",void 0),Ie(this,"monitor",void 0),Ie(this,"registry",void 0),Ie(this,"enterLeaveCounter",void 0),Ie(this,"sourcePreviewNodes",new Map),Ie(this,"sourcePreviewNodeOptions",new Map),Ie(this,"sourceNodes",new Map),Ie(this,"sourceNodeOptions",new Map),Ie(this,"dragStartSourceIds",null),Ie(this,"dropTargetIds",[]),Ie(this,"dragEnterTargetIds",[]),Ie(this,"currentNativeSource",null),Ie(this,"currentNativeHandle",null),Ie(this,"currentDragSourceNode",null),Ie(this,"altKeyPressed",!1),Ie(this,"mouseMoveTimeoutTimer",null),Ie(this,"asyncEndDragFrameId",null),Ie(this,"dragOverTargetIds",null),Ie(this,"lastClientOffset",null),Ie(this,"hoverRafId",null),Ie(this,"getSourceClientOffset",function(o){var i=s.sourceNodes.get(o);return i&&Cp(i)||null}),Ie(this,"endDragNativeItem",function(){s.isDraggingNativeItem()&&(s.actions.endDrag(),s.currentNativeHandle&&s.registry.removeSource(s.currentNativeHandle),s.currentNativeHandle=null,s.currentNativeSource=null)}),Ie(this,"isNodeInDocument",function(o){return!!(o&&s.document&&s.document.body&&s.document.body.contains(o))}),Ie(this,"endDragIfSourceWasRemovedFromDOM",function(){var o=s.currentDragSourceNode;o==null||s.isNodeInDocument(o)||s.clearCurrentDragSourceNode()&&s.monitor.isDragging()&&s.actions.endDrag()}),Ie(this,"handleTopDragStartCapture",function(){s.clearCurrentDragSourceNode(),s.dragStartSourceIds=[]}),Ie(this,"handleTopDragStart",function(o){if(!o.defaultPrevented){var i=s.dragStartSourceIds;s.dragStartSourceIds=null;var a=Co(o);s.monitor.isDragging()&&s.actions.endDrag(),s.actions.beginDrag(i||[],{publishSource:!1,getSourceClientOffset:s.getSourceClientOffset,clientOffset:a});var c=o.dataTransfer,u=ia(c);if(s.monitor.isDragging()){if(c&&typeof c.setDragImage=="function"){var d=s.monitor.getSourceId(),f=s.sourceNodes.get(d),p=s.sourcePreviewNodes.get(d)||f;if(p){var m=s.getCurrentSourcePreviewNodeOptions(),C=m.anchorX,h=m.anchorY,v=m.offsetX,y=m.offsetY,b={anchorX:C,anchorY:h},S={offsetX:v,offsetY:y},x=xI(f,p,a,b,S);c.setDragImage(p,x.x,x.y)}}try{c==null||c.setData("application/json",{})}catch{}s.setCurrentDragSourceNode(o.target);var w=s.getCurrentSourcePreviewNodeOptions(),T=w.captureDraggingState;T?s.actions.publishDragSource():setTimeout(function(){return s.actions.publishDragSource()},0)}else if(u)s.beginDragNativeItem(u);else{if(c&&!c.types&&(o.target&&!o.target.hasAttribute||!o.target.hasAttribute("draggable")))return;o.preventDefault()}}}),Ie(this,"handleTopDragEndCapture",function(){s.clearCurrentDragSourceNode()&&s.monitor.isDragging()&&s.actions.endDrag()}),Ie(this,"handleTopDragEnterCapture",function(o){s.dragEnterTargetIds=[];var i=s.enterLeaveCounter.enter(o.target);if(!(!i||s.monitor.isDragging())){var a=o.dataTransfer,c=ia(a);c&&s.beginDragNativeItem(c,a)}}),Ie(this,"handleTopDragEnter",function(o){var i=s.dragEnterTargetIds;if(s.dragEnterTargetIds=[],!!s.monitor.isDragging()){s.altKeyPressed=o.altKey,i.length>0&&s.actions.hover(i,{clientOffset:Co(o)});var a=i.some(function(c){return s.monitor.canDropOnTarget(c)});a&&(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=s.getCurrentDropEffect()))}}),Ie(this,"handleTopDragOverCapture",function(){s.dragOverTargetIds=[]}),Ie(this,"handleTopDragOver",function(o){var i=s.dragOverTargetIds;if(s.dragOverTargetIds=[],!s.monitor.isDragging()){o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none");return}s.altKeyPressed=o.altKey,s.lastClientOffset=Co(o),s.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(s.hoverRafId=requestAnimationFrame(function(){s.monitor.isDragging()&&s.actions.hover(i||[],{clientOffset:s.lastClientOffset}),s.hoverRafId=null}));var a=(i||[]).some(function(c){return s.monitor.canDropOnTarget(c)});a?(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=s.getCurrentDropEffect())):s.isDraggingNativeItem()?o.preventDefault():(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none"))}),Ie(this,"handleTopDragLeaveCapture",function(o){s.isDraggingNativeItem()&&o.preventDefault();var i=s.enterLeaveCounter.leave(o.target);i&&s.isDraggingNativeItem()&&setTimeout(function(){return s.endDragNativeItem()},0)}),Ie(this,"handleTopDropCapture",function(o){if(s.dropTargetIds=[],s.isDraggingNativeItem()){var i;o.preventDefault(),(i=s.currentNativeSource)===null||i===void 0||i.loadDataTransfer(o.dataTransfer)}else ia(o.dataTransfer)&&o.preventDefault();s.enterLeaveCounter.reset()}),Ie(this,"handleTopDrop",function(o){var i=s.dropTargetIds;s.dropTargetIds=[],s.actions.hover(i,{clientOffset:Co(o)}),s.actions.drop({dropEffect:s.getCurrentDropEffect()}),s.isDraggingNativeItem()?s.endDragNativeItem():s.monitor.isDragging()&&s.actions.endDrag()}),Ie(this,"handleSelectStart",function(o){var i=o.target;typeof i.dragDrop=="function"&&(i.tagName==="INPUT"||i.tagName==="SELECT"||i.tagName==="TEXTAREA"||i.isContentEditable||(o.preventDefault(),i.dragDrop()))}),this.options=new DI(r,n),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new pI(this.isNodeInDocument)}return OI(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,s){var o=this;return this.sourcePreviewNodeOptions.set(r,s),this.sourcePreviewNodes.set(r,n),function(){o.sourcePreviewNodes.delete(r),o.sourcePreviewNodeOptions.delete(r)}}},{key:"connectDragSource",value:function(r,n,s){var o=this;this.sourceNodes.set(r,n),this.sourceNodeOptions.set(r,s);var i=function(u){return o.handleDragStart(u,r)},a=function(u){return o.handleSelectStart(u)};return n.setAttribute("draggable","true"),n.addEventListener("dragstart",i),n.addEventListener("selectstart",a),function(){o.sourceNodes.delete(r),o.sourceNodeOptions.delete(r),n.removeEventListener("dragstart",i),n.removeEventListener("selectstart",a),n.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(r,n){var s=this,o=function(u){return s.handleDragEnter(u,r)},i=function(u){return s.handleDragOver(u,r)},a=function(u){return s.handleDrop(u,r)};return n.addEventListener("dragenter",o),n.addEventListener("dragover",i),n.addEventListener("drop",a),function(){n.removeEventListener("dragenter",o),n.removeEventListener("dragover",i),n.removeEventListener("drop",a)}}},{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 ed({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 ed({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}},{key:"isDraggingNativeItem",value:function(){var r=this.monitor.getItemType();return Object.keys(Zu).some(function(n){return Zu[n]===r})}},{key:"beginDragNativeItem",value:function(r,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=AI(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 s=1e3;this.mouseMoveTimeoutTimer=setTimeout(function(){var o;return(o=n.rootElement)===null||o===void 0?void 0:o.addEventListener("mousemove",n.endDragIfSourceWasRemovedFromDOM,!0)},s)}},{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})(),xo;function RI(){return xo||(xo=new Image,xo.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),xo}var FI=function(t,r,n){return new PI(t,r,n)};function MI(e,t){return typeof e=="function"?e(t):e??"NODE"}function BI(e){return e.isDraggable&&!e.isEditing}function qI(e){const t=Mt(),r=t.selectedIds,[n,s,o]=$k(()=>({canDrag:()=>BI(e),type:MI(t.props.dragType,e),item:()=>{const i=t.isSelected(e.id)?Array.from(r):[e.id];return t.dispatch(ss.dragStart(e.id,i)),{id:e.id,dragIds:i,data:e.data}},end:()=>{t.hideCursor(),t.redrawList(),t.dispatch(ss.dragEnd())}}),[r,e,t.props.dragType]);return g.useEffect(()=>{o(RI())},[o]),s}function $I(e,t){const r=e.getBoundingClientRect(),n=t.x-Math.round(r.x),s=t.y-Math.round(r.y),o=r.height,i=s<o/2,a=!i,c=o/4,u=s>c&&s<o-c;return{x:n,inTopHalf:i,inBottomHalf:a,inMiddle:u,atTop:!u&&i,atBottom:!u&&a}}function UI(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 _o(e,t){return{parentId:e||null,index:t}}function Dn(e,t){return{type:"line",index:e,level:t}}function zI(e){return{type:"highlight",id:e}}function la(e,t){var r;let n=e;for(;n.parent&&n.level>t;)n=n.parent;const s=((r=n.parent)===null||r===void 0?void 0:r.id)||null,o=Kh(n)+1;return{parentId:s,index:o}}function Tp(e){var t;const r=$I(e.element,e.offset),n=e.indent,s=Math.round(Math.max(0,r.x-n)/n),{node:o,nextNode:i,prevNode:a}=e,[c,u]=UI(o,a,i,r);if(o&&o.isInternal&&r.inMiddle)return{drop:_o(o.id,null),cursor:zI(o.id)};if(!c)return{drop:_o((t=u==null?void 0:u.parent)===null||t===void 0?void 0:t.id,0),cursor:Dn(0,0)};if(Hh(c)){const d=Ro(s,(u==null?void 0:u.level)||0,c.level);return{drop:la(c,d),cursor:Dn(c.rowIndex+1,d)}}if(Qh(c)){const d=Ro(s,(u==null?void 0:u.level)||0,c.level);return{drop:la(c,d),cursor:Dn(c.rowIndex+1,d)}}if(Wh(c)){const d=Ro(s,0,c.level+1);return d>c.level?{drop:_o(c.id,0),cursor:Dn(c.rowIndex+1,d)}:{drop:la(c,d),cursor:Dn(c.rowIndex+1,d)}}return{drop:_o(c==null?void 0:c.id,0),cursor:Dn(c.rowIndex+1,c.level+1)}}function VI(e,t){const r=Mt(),[n,s]=vp(()=>({accept:"NODE",canDrop:()=>r.canDrop(),hover:(o,i)=>{const a=i.getClientOffset();if(!e.current||!a)return;const{cursor:c,drop:u}=Tp({element:e.current,offset:a,indent:r.indent,node:t,prevNode:t.prev,nextNode:t.next});u&&r.dispatch(ss.hovering(u.parentId,u.index)),i.canDrop()?c&&r.showCursor(c):r.hideCursor()},drop:(o,i)=>{if(!i.canDrop())return null;r.drop()}}),[t,e.current,r.props]);return s}function HI(e){const t=Mt(),r=t.at(e);if(!r)throw new Error(`Could not find node for index: ${e}`);return g.useMemo(()=>{const n=r.clone();return t.visibleNodes[e]=n,n},[...Object.values(r.state),r])}const td=g.memo(function({index:t,style:r}){Vh(),l0();const n=Mt(),s=HI(t),o=g.useRef(null),i=qI(s),a=VI(o,s),c=g.useCallback(h=>{o.current=h,a(h)},[a]),u=n.indent*s.level,d=g.useMemo(()=>({paddingLeft:u}),[u]),f=g.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]),p={role:"treeitem","aria-level":s.level+1,"aria-selected":s.isSelected,"aria-expanded":s.isOpen,style:f,tabIndex:-1,className:n.props.rowClassName};g.useEffect(()=>{var h;!s.isEditing&&s.isFocused&&((h=o.current)===null||h===void 0||h.focus({preventScroll:!0}))},[s.isEditing,s.isFocused,o.current]);const m=n.renderNode,C=n.renderRow;return l.jsx(C,{node:s,innerRef:c,attrs:p,children:l.jsx(m,{node:s,tree:n,style:d,dragHandle:i})})});let ca="",rd=null;function Ep(){Vh();const e=Mt();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 s=Array.from(e.selectedIds);if(s.length>1){let o=e.mostRecentNode;for(;o&&o.isSelected;)o=o.nextSibling;o||(o=e.lastNode),e.focus(o,{scroll:!1}),e.delete(Array.from(s))}else{const o=e.focusedNode;if(o){const i=o.nextSibling,a=o.parent;e.focus(i||a,{scroll:!1}),e.delete(o)}}return}if(t.key==="Tab"&&!t.shiftKey){t.preventDefault(),Yh(t.currentTarget);return}if(t.key==="Tab"&&t.shiftKey){t.preventDefault(),Zh(t.currentTarget);return}if(t.key==="ArrowDown"){t.preventDefault();const s=e.nextNode;if(t.metaKey){e.select(e.focusedNode),e.activate(e.focusedNode);return}else if(!t.shiftKey||e.props.disableMultiSelection){e.focus(s);return}else{if(!s)return;const o=e.focusedNode;o?o.isSelected?e.selectContiguous(s):e.selectMulti(s):e.focus(e.firstNode);return}}if(t.key==="ArrowUp"){t.preventDefault();const s=e.prevNode;if(!t.shiftKey||e.props.disableMultiSelection){e.focus(s);return}else{if(!s)return;const o=e.focusedNode;o?o.isSelected?e.selectContiguous(s):e.selectMulti(s):e.focus(e.lastNode);return}}if(t.key==="ArrowRight"){const s=e.focusedNode;if(!s)return;s.isInternal&&s.isOpen?e.focus(e.nextNode):s.isInternal&&e.open(s.id);return}if(t.key==="ArrowLeft"){const s=e.focusedNode;if(!s||s.isRoot)return;s.isInternal&&s.isOpen?e.close(s.id):!((r=s.parent)===null||r===void 0)&&r.isRoot||e.focus(s.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 s=e.focusedNode;if(!s||!s.isEditable||!e.props.onRename)return;setTimeout(()=>{s&&e.edit(s)});return}if(t.key===" "){t.preventDefault();const s=e.focusedNode;if(!s)return;s.isLeaf?(s.select(),s.activate()):s.toggle();return}if(t.key==="*"){const s=e.focusedNode;if(!s)return;e.openSiblings(s);return}if(t.key==="PageUp"){t.preventDefault(),e.pageUp();return}t.key==="PageDown"&&(t.preventDefault(),e.pageDown()),clearTimeout(rd),ca+=t.key,rd=setTimeout(()=>{ca=""},600);const n=e.visibleNodes.find(s=>{const o=s.data.name;return typeof o=="string"?o.toLowerCase().startsWith(ca):!1});n&&e.focus(n.id)},children:l.jsx(QI,{})})}function QI(){var e,t;const r=Mt(),n={className:r.props.className,outerRef:r.listEl,itemCount:r.visibleNodes.length,height:r.height,width:r.width,overscanCount:r.overscanCount,itemKey:s=>{var o;return((o=r.visibleNodes[s])===null||o===void 0?void 0:o.id)||s},outerElementType:(e=r.props.outerElementType)!==null&&e!==void 0?e:Y0,innerElementType:(t=r.props.innerElementType)!==null&&t!==void 0?t:J0,onScroll:r.props.onScroll,onItemsRendered:r.onItemsRendered.bind(r)};return typeof r.props.rowHeight=="function"?l.jsx(Q0,Object.assign({},n,{itemSize:r.rowHeightAt,ref:r.list,children:td})):l.jsx(W0,Object.assign({},n,{itemSize:r.rowHeight,ref:r.list,children:td}))}function nd(e){return e.isFiltered?GI(e.root,e.isMatch.bind(e)):WI(e.root)}function WI(e){const t=[];function r(n){var s;n.level>=0&&t.push(n),n.isOpen&&((s=n.children)===null||s===void 0||s.forEach(r))}return r(e),t.forEach(Ap),t}function GI(e,t){const r={},n=[];function s(i){if(!i.isRoot&&t(i)){r[i.id]=!0;let c=i.parent;for(;c;)r[c.id]=!0,c=c.parent}if(i.children)for(let c of i.children)s(c)}function o(i){var a;i.level>=0&&r[i.id]&&n.push(i),i.isOpen&&((a=i.children)===null||a===void 0||a.forEach(o))}return s(e),o(e),n.forEach(Ap),n}function Ap(e,t){e.rowIndex=t}const sd=e=>e.reduce((t,r,n)=>(t[r.id]=n,t),{});var ua=function(e,t,r,n){function s(o){return o instanceof r?o:new r(function(i){i(o)})}return new(r||(r=Promise))(function(o,i){function a(d){try{u(n.next(d))}catch(f){i(f)}}function c(d){try{u(n.throw(d))}catch(f){i(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((n=n.apply(e,t||[])).next())})};const{safeRun:wt}=h0;class Ds{constructor(t,r,n,s){this.store=t,this.props=r,this.list=n,this.listEl=s,this.visibleStartIndex=0,this.visibleStopIndex=0,this.rowOffsets=null,this.rowHeightAt=o=>{const i=this.props.rowHeight;if(typeof i=="function"){const a=this.at(o);return a?i(a):this.rowHeight}return i??24},this.rowTopPosition=o=>{if(typeof this.props.rowHeight!="function")return o*this.rowHeight;const i=this.getRowOffsets(),a=Math.max(0,Math.min(o,i.length-1));return i[a]},this.redrawList=(o=0)=>{this.rowOffsets=null;const i=this.list.current;i&&"resetAfterIndex"in i&&i.resetAfterIndex(Math.max(0,o))},this.root=du(this),this.visibleNodes=nd(this),this.idToIndex=sd(this.visibleNodes)}update(t){this.props=t,this.root=du(this),this.visibleNodes=nd(this),this.idToIndex=sd(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,s)=>JSON.stringify(Object.values(n.data)).toLocaleLowerCase().includes(s.toLocaleLowerCase()));return n=>r(n,this.searchTerm)}accessChildren(t){var r;const n=this.props.childrenAccessor||"children";return(r=Es(t,n))!==null&&r!==void 0?r:null}accessId(t){const r=this.props.idAccessor||"id",n=Es(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 zs)return t.id;const r=this.props.idAccessor||"id";return Es(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 s=(n=this.indexOf(t))!==null&&n!==void 0?n:0,o=this.indexOf(r);if(o===null)return[];const i=Math.min(s,o),a=Math.max(s,o);return this.visibleNodes.slice(i,a+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 ua(this,arguments,void 0,function*(t={}){var r,n;const s=t.parentId===void 0?tp(this):t.parentId,o=(r=t.index)!==null&&r!==void 0?r:ep(this),i=(n=t.type)!==null&&n!==void 0?n:"leaf",a=yield wt(this.props.onCreate,{type:i,parentId:s,index:o,parentNode:this.get(s)});a&&(this.focus(a),setTimeout(()=>{this.edit(a).then(()=>{this.select(a),this.activate(a)})}))})}delete(t){return ua(this,void 0,void 0,function*(){if(!t)return;const n=(Array.isArray(t)?t:[t]).map(i=>this.identify(i)),s=n.map(i=>this.get(i)).filter(i=>!!i),o=s.length?Math.min(...s.map(i=>{var a;return(a=i.rowIndex)!==null&&a!==void 0?a:0})):0;yield wt(this.props.onDelete,{nodes:s,ids:n}),this.redrawList(o)})}edit(t){var r,n;const s=this.identify(t);return this.resolveEdit({cancelled:!0}),this.scrollTo(s),this.dispatch(Zi(s)),this.redrawList((n=(r=this.get(s))===null||r===void 0?void 0:r.rowIndex)!==null&&n!==void 0?n:0),new Promise(o=>{Ds.editPromise=o})}submit(t,r){return ua(this,void 0,void 0,function*(){var n,s;if(!t)return;const o=this.identify(t);yield wt(this.props.onRename,{id:o,name:r,node:this.get(o)}),this.dispatch(Zi(null)),this.resolveEdit({cancelled:!1,value:r}),this.redrawList((s=(n=this.get(o))===null||n===void 0?void 0:n.rowIndex)!==null&&s!==void 0?s:0),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(Zi(null)),this.resolveEdit({cancelled:!0}),this.redrawList(),setTimeout(()=>this.onFocus())}activate(t){const r=this.get(this.identifyNull(t));r&&wt(this.props.onActivate,r)}resolveEdit(t){const r=Ds.editPromise;r&&r(t),Ds.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(En(this.identify(t))),r.scroll!==!1&&this.scrollTo(t),this.focusedNode&&wt(this.props.onFocus,this.focusedNode)))}pageUp(){var t,r;const n=this.visibleStartIndex,o=this.visibleStopIndex-n;let i=(r=(t=this.focusedNode)===null||t===void 0?void 0:t.rowIndex)!==null&&r!==void 0?r:0;i>n?i=n:i=Math.max(n-o,0),this.focus(this.at(i))}pageDown(){var t,r;const n=this.visibleStartIndex,s=this.visibleStopIndex,o=s-n;let i=(r=(t=this.focusedNode)===null||t===void 0?void 0:t.rowIndex)!==null&&r!==void 0?r:0;i<s?i=s:i=Math.min(i+o,this.visibleNodes.length-1),this.focus(this.at(i))}select(t,r={}){var n;if(!t)return;const s=r.focus!==!1,o=this.identify(t);s&&this.dispatch(En(o)),!((n=this.get(o))===null||n===void 0)&&n.isSelectable&&this.setSelection({ids:[o],anchor:o,mostRecent:o}),this.scrollTo(o,r.align),this.focusedNode&&s&&wt(this.props.onFocus,this.focusedNode)}deselect(t){if(!t)return;const r=this.identify(t);this.dispatch(jr.remove(r)),wt(this.props.onSelect,this.selectedNodes)}selectMulti(t,r={}){const n=this.get(this.identifyNull(t));if(!n)return;const s=r.focus!==!1;s&&this.dispatch(En(n.id)),n.isSelectable&&(this.dispatch(jr.add(n.id)),this.dispatch(jr.anchor(n.id)),this.dispatch(jr.mostRecent(n.id))),this.scrollTo(n,r.align),this.focusedNode&&s&&wt(this.props.onFocus,this.focusedNode),wt(this.props.onSelect,this.selectedNodes)}selectContiguous(t){var r;if(!t)return;const n=this.identify(t);if(this.dispatch(En(n)),!((r=this.get(n))===null||r===void 0)&&r.isSelectable){const{anchor:s,mostRecent:o}=this.state.nodes.selection,i=this.filterSelectableNodes(this.nodesBetween(s,this.identifyNull(n)));this.dispatch(jr.remove(this.nodesBetween(s,o))),this.dispatch(jr.add(i)),this.dispatch(jr.mostRecent(n))}this.scrollTo(n),this.focusedNode&&wt(this.props.onFocus,this.focusedNode),wt(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null})}selectAll(){var t,r,n;const s=this.filterSelectableNodes(Object.keys(this.idToIndex));this.setSelection({ids:s,anchor:(t=s[0])!==null&&t!==void 0?t:null,mostRecent:(r=s[s.length-1])!==null&&r!==void 0?r:null}),this.dispatch(En((n=this.lastNode)===null||n===void 0?void 0:n.id)),this.focusedNode&&wt(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(i=>this.identify(i))),s=this.identifyNull(t.anchor),o=this.identifyNull(t.mostRecent);this.dispatch(jr.set({ids:n,anchor:s,mostRecent:o})),wt(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,s=this.props.disableDrop;for(const o of n)if(!o||!r||o.isInternal&&Gh(r,o))return!1;return typeof s=="function"?!s({parentNode:r,dragNodes:this.dragNodes,index:this.state.dnd.index||0}):typeof s=="string"?!r.data[s]:typeof s=="boolean"?!s:!0}drop(){const{parentId:t,index:r,dragIds:n}=this.state.dnd;wt(this.props.onMove,{dragIds:n,parentId:t===Us?null:t,index:r===null?0:r,dragNodes:this.dragNodes,parentNode:this.get(t)}),this.open(t)}hideCursor(){this.dispatch(ss.cursor({type:"none"}))}showCursor(t){this.dispatch(ss.cursor(t))}open(t,r=!0){var n,s;const o=this.identifyNull(t);o&&(this.isOpen(o)||(this.dispatch(el.open(o,this.isFiltered)),r&&this.redrawList((s=(n=this.get(o))===null||n===void 0?void 0:n.rowIndex)!==null&&s!==void 0?s:0),wt(this.props.onToggle,o)))}close(t,r=!0){var n,s;const o=this.identifyNull(t);o&&this.isOpen(o)&&(this.dispatch(el.close(o,this.isFiltered)),r&&this.redrawList((s=(n=this.get(o))===null||n===void 0?void 0:n.rowIndex)!==null&&s!==void 0?s:0),wt(this.props.onToggle,o))}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=$l(this.root,r);let s=n==null?void 0:n.parent;for(;s;)this.open(s.id,!1),s=s.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 s of r.children)s.isInternal&&(n?this.close(s.id,!1):this.open(s.id,!1));this.redrawList(),this.scrollTo(this.focusedNode)}}openAll(){ni(this.root,t=>{t.isInternal&&this.open(t.id,!1)}),this.redrawList()}closeAll(){ni(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),Jh(()=>n in this.idToIndex).then(()=>{var s;const o=this.idToIndex[n];o!==void 0&&((s=this.list.current)===null||s===void 0||s.scrollToItem(o,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,s;if(!t)return!1;if(t===Us)return!0;const o=(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:(s=this.state.nodes.open.unfiltered[t])!==null&&s!==void 0?s:o}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!Es(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:s}=this.state.nodes.drag;return r===n&&s===null}onFocus(){const t=this.focusedNode||this.firstNode;t&&this.dispatch(En(t.id))}onBlur(){this.dispatch(_0())}onItemsRendered(t){this.visibleStartIndex=t.visibleStartIndex,this.visibleStopIndex=t.visibleStopIndex}get renderContainer(){return this.props.renderContainer||Ep}get renderRow(){return this.props.renderRow||y0}get renderNode(){return this.props.children||b0}get renderDragPreview(){return this.props.renderDragPreview||rp}get renderCursor(){return this.props.renderCursor||v0}}function Et(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 KI=typeof Symbol=="function"&&Symbol.observable||"@@observable",od=KI,da=()=>Math.random().toString(36).substring(7).split("").join("."),YI={INIT:`@@redux/INIT${da()}`,REPLACE:`@@redux/REPLACE${da()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${da()}`},mn=YI;function kp(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 ZI(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(eL(e))return"date";if(JI(e))return"error";const r=XI(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 XI(e){return typeof e.constructor=="function"?e.constructor.name:null}function JI(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function eL(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Pr(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=ZI(e)),t}function Ip(e,t,r){if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?Et(2):`Expected the root reducer to be a function. Instead, received: '${Pr(e)}'`);if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?Et(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"?Et(1):`Expected the enhancer to be a function. Instead, received: '${Pr(r)}'`);return r(Ip)(e,t)}let n=e,s=t,o=new Map,i=o,a=0,c=!1;function u(){i===o&&(i=new Map,o.forEach((v,y)=>{i.set(y,v)}))}function d(){if(c)throw new Error(process.env.NODE_ENV==="production"?Et(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(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?Et(4):`Expected the listener to be a function. Instead, received: '${Pr(v)}'`);if(c)throw new Error(process.env.NODE_ENV==="production"?Et(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;u();const b=a++;return i.set(b,v),function(){if(y){if(c)throw new Error(process.env.NODE_ENV==="production"?Et(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,u(),i.delete(b),o=null}}}function p(v){if(!kp(v))throw new Error(process.env.NODE_ENV==="production"?Et(7):`Actions must be plain objects. Instead, the actual type was: '${Pr(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"?Et(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"?Et(17):`Action "type" property must be a string. Instead, the actual type was: '${Pr(v.type)}'. Value was: '${v.type}' (stringified)`);if(c)throw new Error(process.env.NODE_ENV==="production"?Et(9):"Reducers may not dispatch actions.");try{c=!0,s=n(s,v)}finally{c=!1}return(o=i).forEach(b=>{b()}),v}function m(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?Et(10):`Expected the nextReducer to be a function. Instead, received: '${Pr(v)}`);n=v,p({type:mn.REPLACE})}function C(){const v=f;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(process.env.NODE_ENV==="production"?Et(11):`Expected the observer to be an object. Instead, received: '${Pr(y)}'`);function b(){const x=y;x.next&&x.next(d())}return b(),{unsubscribe:v(b)}},[od](){return this}}}return p({type:mn.INIT}),{dispatch:p,subscribe:f,getState:d,replaceReducer:m,[od]:C}}function id(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function tL(e,t,r,n){const s=Object.keys(t),o=r&&r.type===mn.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(s.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(!kp(e))return`The ${o} has unexpected type of "${Pr(e)}". Expected argument to be an object with the following keys: "${s.join('", "')}"`;const i=Object.keys(e).filter(a=>!t.hasOwnProperty(a)&&!n[a]);if(i.forEach(a=>{n[a]=!0}),!(r&&r.type===mn.REPLACE)&&i.length>0)return`Unexpected ${i.length>1?"keys":"key"} "${i.join('", "')}" found in ${o}. Expected to find one of the known reducer keys instead: "${s.join('", "')}". Unexpected keys will be ignored.`}function rL(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:mn.INIT})>"u")throw new Error(process.env.NODE_ENV==="production"?Et(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:mn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?Et(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${mn.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 ad(e){const t=Object.keys(e),r={};for(let i=0;i<t.length;i++){const a=t[i];process.env.NODE_ENV!=="production"&&typeof e[a]>"u"&&id(`No reducer provided for key "${a}"`),typeof e[a]=="function"&&(r[a]=e[a])}const n=Object.keys(r);let s;process.env.NODE_ENV!=="production"&&(s={});let o;try{rL(r)}catch(i){o=i}return function(a={},c){if(o)throw o;if(process.env.NODE_ENV!=="production"){const f=tL(a,r,c,s);f&&id(f)}let u=!1;const d={};for(let f=0;f<n.length;f++){const p=n[f],m=r[p],C=a[p],h=m(C,c);if(typeof h>"u"){const v=c&&c.type;throw new Error(process.env.NODE_ENV==="production"?Et(14):`When called with an action of type ${v?`"${String(v)}"`:"(unknown type)"}, the slice reducer for key "${p}" 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.`)}d[p]=h,u=u||h!==C}return u=u||n.length!==Object.keys(a).length,u?d:a}}function nL(e=ns().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 sL=ad({nodes:ad({focus:w0,edit:x0,open:T0,selection:E0,drag:nL}),dnd:A0}),oL=ns();function iL({treeProps:e,imperativeHandle:t,children:r}){const n=g.useRef(null),s=g.useRef(null),o=g.useRef(Ip(sL,ns(e))),i=a0.useSyncExternalStore(o.current.subscribe,o.current.getState,()=>oL),a=g.useMemo(()=>new Ds(o.current,e,n,s),[]),c=g.useRef(0);return g.useMemo(()=>{c.current+=1,a.update(e)},Object.values(e)),g.useMemo(()=>{c.current+=1,a.update(a.props)},[i.nodes.open]),g.useImperativeHandle(t,()=>a),g.useEffect(()=>{a.props.selection?a.select(a.props.selection,{focus:!1}):a.deselectAll()},[a.props.selection]),g.useEffect(()=>{a.props.searchTerm||o.current.dispatch(el.clear(!0))},[a.props.searchTerm]),l.jsx(qh.Provider,{value:a,children:l.jsx(zh.Provider,{value:c.current,children:l.jsx($h.Provider,{value:i.nodes,children:l.jsx(Uh.Provider,{value:i.dnd,children:l.jsx(RA,Object.assign({},e.dndManager?{manager:e.dndManager}:{backend:e.dndBackend||FI,options:{rootElement:a.props.dndRootElement||void 0}},{children:r}))})})})})}function aL(){const e=Mt(),[,t]=vp(()=>({accept:"NODE",canDrop:(r,n)=>n.isOver({shallow:!0})?e.canDrop():!1,hover:(r,n)=>{if(!n.isOver({shallow:!0}))return;const s=n.getClientOffset();if(!e.listEl.current||!s)return;const{cursor:o,drop:i}=Tp({element:e.listEl.current,offset:s,indent:e.indent,node:null,prevNode:e.visibleNodes[e.visibleNodes.length-1],nextNode:null});i&&e.dispatch(ss.hovering(i.parentId,i.index)),n.canDrop()?o&&e.showCursor(o):e.hideCursor()},drop:(r,n)=>{if(!n.isOver({shallow:!0})||!n.canDrop())return null;e.drop()}}),[e]);t(e.listEl)}function lL(e){return aL(),e.children}function cL(){const t=Mt().props.renderContainer||Ep;return l.jsx(l.Fragment,{children:l.jsx(t,{})})}function uL(){const e=Mt(),{offset:t,mouse:r,item:n,isDragging:s}=lI(i=>({offset:i.getSourceClientOffset(),mouse:i.getClientOffset(),item:i.getItem(),isDragging:i.isDragging()})),o=e.props.renderDragPreview||rp;return l.jsx(o,{offset:t,mouse:r,id:(n==null?void 0:n.id)||null,dragIds:(n==null?void 0:n.dragIds)||[],isDragging:s})}function dL(e={}){var t,r;const n=(t=e.idAccessor)!==null&&t!==void 0?t:"id",s=(r=e.childrenAccessor)!==null&&r!==void 0?r:"children";return{getId:typeof n=="function"?n:o=>o[n],getChildren:typeof s=="function"?s:o=>o[s],childrenKey:typeof s=="string"?s:"children"}}class fL{constructor(t,r={}){this.accessors=dL(r),this.root=hL(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 s=this.find(t,n);if(s)return s}return null}return null}}function hL(e,t){const r=new Lp({},null,t,"ROOT");return r.children=e.map(n=>Gl(n,r,t)),r}function Gl(e,t,r){const n=new Lp(e,t,r),s=r.getChildren(e);return s&&(n.children=s.map(o=>Gl(o,n,r))),n}class Lp{constructor(t,r,n,s){this.data=t,this.parent=r,this.accessors=n,this.id=s??n.getId(t)}hasParent(){return!!this.parent}get childIndex(){return this.hasParent()?this.parent.children.indexOf(this):-1}addChild(t,r){var n,s;const o=Gl(t,this,this.accessors);this.children=(n=this.children)!==null&&n!==void 0?n:[],this.children.splice(r,0,o);const i=this.accessors.childrenKey,a=this.data;a[i]=(s=a[i])!==null&&s!==void 0?s:[],a[i].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 pL=0;function mL(e,t={}){const[r,n]=g.useState(e),s=t.idAccessor,o=t.childrenAccessor,i=g.useMemo(()=>new fL(r,{idAccessor:s,childrenAccessor:o}),[r,s,o]),a=C=>{for(const h of C.dragIds)i.move({id:h,parentId:C.parentId,index:C.index});n(i.data)},c=({name:C,id:h})=>{i.update({id:h,changes:{name:C}}),n(i.data)},u=typeof s=="string"?s:"id",d=typeof o=="string"?o:"children";return[r,{onMove:a,onRename:c,onCreate:({parentId:C,index:h,type:v})=>{if(typeof s=="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 o=="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={[u]:`simple-tree-id-${pL++}`,name:""};return v==="internal"&&(y[d]=[]),i.create({parentId:C,index:h,data:y}),n(i.data),y},onDelete:C=>{C.ids.forEach(h=>i.drop({id:h})),n(i.data)}}]}function gL(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]=mL(e.initialData,{idAccessor:e.idAccessor,childrenAccessor:e.childrenAccessor});return Object.assign(Object.assign(Object.assign({},e),r),{data:t})}else return e}function vL(e,t){const r=gL(e);return l.jsxs(iL,{treeProps:r,imperativeHandle:t,children:[l.jsx(lL,{children:l.jsx(cL,{})}),l.jsx(uL,{})]})}const yL=g.forwardRef(vL);function Kl(){return se(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 bL(){return se(e=>{var s;if(!e.selectedNodeId)return!1;const t=(s=e.treeData[0])==null?void 0:s.id,r=o=>{var i;for(const a of o){if(a.id===e.selectedNodeId)return a;if((i=a.children)!=null&&i.length){const c=r(a.children);if(c)return c}}},n=r(e.treeData);return!!(n!=null&&n.isFolder)&&n.id!==t})}const ld={video:"#EA580C",pdf:"#DC2626",h5p:"#0D9488",scorm:"#7C3AED",audio:"#DB2777",quiz:"#16A34A",course:"#A85236",default:"#6B7280"},cd={video:"Video",pdf:"FileText",h5p:"Layers",scorm:"Package",audio:"Music",quiz:"HelpCircle",course:"BookOpen",default:"File"},ud=["Course Assessment","eTextbook","Exam Question","Explanation Content","Learning Resource","Practice Question Set","SCORM Content","Teacher Resource"],fa=[{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 CL(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 lo(e){const t=CL(e);return{key:t,color:ld[t]??ld.default,bgClass:`sbx-ct-sq--${t}`,badgeClass:`sbx-ct-badge--${t}`,tintClass:`sbx-ct-tint--${t}`,iconName:cd[t]??cd.default,label:t.charAt(0).toUpperCase()+t.slice(1)}}const SL="_row_1yoqj_1",xL="_grip_1yoqj_16",_L="_menuBtn_1yoqj_19",wL="_rowLp_1yoqj_23",TL="_selected_1yoqj_27",EL="_title_1yoqj_32",AL="_dropTarget_1yoqj_41",kL="_toggle_1yoqj_58",IL="_ctIcon_1yoqj_73",LL="_ctIconLp_1yoqj_85",DL="_folderIcon_1yoqj_89",jL="_rootIcon_1yoqj_94",NL="_titleLp_1yoqj_110",OL="_levelTitle_1yoqj_114",PL="_renameInput_1yoqj_119",RL="_dropHere_1yoqj_128",FL="_menuWrap_1yoqj_138",ML="_menu_1yoqj_19",BL="_dangerItem_1yoqj_190",at={row:SL,grip:xL,menuBtn:_L,rowLp:wL,selected:TL,title:EL,dropTarget:AL,toggle:kL,ctIcon:IL,ctIconLp:LL,folderIcon:DL,rootIcon:jL,titleLp:NL,levelTitle:OL,renameInput:PL,dropHere:RL,menuWrap:FL,menu:ML,dangerItem:BL},qL={video:_i,pdf:to,h5p:Ci,scorm:xi,audio:Si,quiz:bi,course:Cr,default:Gr},$L=({node:e,style:t,dragHandle:r,editorMode:n})=>{var F;const[s,o]=g.useState(!1),[i,a]=g.useState(!1),[c,u]=g.useState(e.data.name),d=g.useRef(null),f=ae(),p=X(R=>R.editorProfile),m=n==="edit",C=Kl(),h=lo(e.data),v=qL[h.key]??Gr,y=e.isSelected,b=e.level===0,S=e.data.isFolder??(e.children&&e.children.length>0),x=p.key==="learningPath",w=b?x?Oh:Ey:S?x?Ry:Vf:v,T=x&&S&&!b&&!nt(e.data),L=x&&!!((F=e.data.metadata)!=null&&F.isAssessmentCourse),A=e.level+1<=p.maxDepth,O=x?f.learningPath.addLevelButton:f.treeNode.addSubunitMenuItem,P=x?f.learningPath.addLevelButton:f.treeNode.addSiblingMenuItem;g.useEffect(()=>{if(!s)return;const R=U=>{var re;(re=d.current)!=null&&re.contains(U.target)||o(!1)};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[s]);const j=g.useCallback(()=>{c.trim()&&e.submit(c.trim()),a(!1)},[c,e]),N=g.useCallback(R=>{R.key==="Enter"&&j(),R.key==="Escape"&&(u(e.data.name),a(!1))},[j,e.data.name]);return l.jsxs("div",{className:[at.row,x?at.rowLp:"",y?at.selected:"",e.state.isOver&&S?at.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:[m&&l.jsx("span",{ref:r,className:at.grip,"aria-hidden":"true",children:l.jsx(Il,{size:14})}),l.jsx("button",{className:at.toggle,onClick:R=>{R.stopPropagation(),e.toggle()},"aria-label":e.isClosed?f.treeNode.expandAriaLabel:f.treeNode.collapseAriaLabel,style:{visibility:S?"visible":"hidden"},children:e.isClosed?l.jsx(kl,{size:14}):l.jsx(Sn,{size:14})}),l.jsx("span",{className:[at.ctIcon,b||S||L?at.folderIcon:h.bgClass,x?at.ctIconLp:"",b&&x?at.rootIcon:""].filter(Boolean).join(" "),"aria-hidden":"true",children:l.jsx(w,{size:b&&x?15:12})}),i?l.jsx("input",{className:at.renameInput,value:c,autoFocus:!0,onChange:R=>u(R.target.value),onBlur:j,onKeyDown:N,onClick:R=>R.stopPropagation()}):l.jsx("span",{className:[at.title,x?at.titleLp:"",T?at.levelTitle:""].filter(Boolean).join(" "),title:e.data.name,onDoubleClick:()=>m&&a(!0),children:e.data.name.length>25?`${e.data.name.slice(0,25)}...`:e.data.name}),e.state.isOver&&S&&l.jsx("span",{className:at.dropHere,"aria-hidden":"true",children:f.treeNode.dropHereLabel}),m&&l.jsxs("div",{className:at.menuWrap,ref:d,children:[l.jsx("button",{className:at.menuBtn,onClick:R=>{R.stopPropagation(),o(U=>!U)},"aria-label":f.treeNode.nodeOptionsAriaLabel,children:l.jsx(Uf,{size:14})}),s&&l.jsxs("div",{className:at.menu,role:"menu",children:[l.jsxs("button",{role:"menuitem",onClick:()=>{a(!0),o(!1)},children:[l.jsx(qy,{size:13})," ",f.treeNode.renameMenuItem]}),S&&C&&A&&l.jsxs("button",{role:"menuitem",onClick:()=>{e.tree.create({parentId:e.id}),o(!1)},children:[l.jsx(zf,{size:13})," ",O]}),e.data.parent&&C&&!x&&l.jsxs("button",{role:"menuitem",onClick:()=>{e.tree.create({parentId:e.data.parent}),o(!1)},children:[l.jsx(kr,{size:13})," ",P]}),!b&&l.jsxs("button",{role:"menuitem",className:at.dangerItem,onClick:()=>{e.tree.delete(e.id),o(!1)},children:[l.jsx(ls,{size:13})," ",f.treeNode.deleteMenuItem]})]})]})]})};async function UL(e,t){var o,i;const n=((o=(await Fe.post(`/action/content/v3/upload/url/${e}?type=hierarchy`,{request:{content:{fileName:t}}})).data)==null?void 0:o.result)??{},s=((i=n.content)==null?void 0:i.preSignedURL)??n.pre_signed_url??n.preSignedUrl;if(!s)throw new Error("Could not obtain an upload URL");return s}async function zL(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 VL(e,t){var a;const r=await UL(e,t.name),n=await zL(r,t),s=new FormData;return s.append("fileUrl",n),s.append("mimeType",t.type||"text/csv"),{processId:(((a=(await Fe.post(`/action/collection/v1/import/${e}`,s)).data)==null?void 0:a.result)??{}).processId??""}}async function HL(e){var r;return((r=(await Fe.get(`/action/collection/v1/import/status/${e}`)).data)==null?void 0:r.result)??{status:"PENDING"}}async function Dp(e){var n,s,o;const r=(o=(s=(n=(await Fe.get(`/action/collection/v1/export/${e}`)).data)==null?void 0:n.result)==null?void 0:s.collection)==null?void 0:o.tocUrl;if(!r)throw new Error("No export URL returned");return r}async function QL(e){return Dp(e)}const WL="_container_jr3ij_1",GL="_header_jr3ij_13",KL="_title_jr3ij_22",YL="_closeBtn_jr3ij_29",ZL="_body_jr3ij_45",XL="_dropZone_jr3ij_54",JL="_dragOver_jr3ij_67",eD="_hasFile_jr3ij_72",tD="_hiddenInput_jr3ij_78",rD="_fileInfo_jr3ij_82",nD="_fileIcon_jr3ij_89",sD="_fileName_jr3ij_93",oD="_fileSize_jr3ij_100",iD="_dropHint_jr3ij_105",aD="_dropIcon_jr3ij_112",lD="_dropText_jr3ij_117",cD="_dropSubtext_jr3ij_124",uD="_sampleLink_jr3ij_130",dD="_statusBar_jr3ij_145",fD="_status_uploading_jr3ij_154",hD="_status_processing_jr3ij_154",pD="_status_done_jr3ij_159",mD="_status_error_jr3ij_164",gD="_successDetail_jr3ij_170",vD="_spinner_jr3ij_175",yD="_spin_jr3ij_175",bD="_errorMsg_jr3ij_191",CD="_failedSection_jr3ij_197",SD="_failedTitle_jr3ij_203",xD="_tableWrap_jr3ij_213",_D="_failedTable_jr3ij_219",wD="_reasonCell_jr3ij_244",TD="_footer_jr3ij_248",Ue={container:WL,header:GL,title:KL,closeBtn:YL,body:ZL,dropZone:XL,dragOver:JL,hasFile:eD,hiddenInput:tD,fileInfo:rD,fileIcon:nD,fileName:sD,fileSize:oD,dropHint:iD,dropIcon:aD,dropText:lD,dropSubtext:cD,sampleLink:uD,statusBar:dD,status_uploading:fD,status_processing:hD,status_done:pD,status_error:mD,successDetail:gD,spinner:vD,spin:yD,errorMsg:bD,failedSection:CD,failedTitle:SD,tableWrap:xD,failedTable:_D,reasonCell:wD,footer:TD},ED=({contentId:e,onComplete:t,onClose:r,mode:n="create"})=>{const s=ae(),[o,i]=g.useState(null),[a,c]=g.useState(!1),[u,d]=g.useState("idle"),[f,p]=g.useState(""),[m,C]=g.useState([]),[h,v]=g.useState(null),y=g.useRef(null),b=g.useRef(null),S=g.useCallback(()=>{b.current!==null&&(clearInterval(b.current),b.current=null)},[]);g.useEffect(()=>()=>S(),[S]);const x=j=>j.name.toLowerCase().endsWith(".csv")?j.size>50*1024*1024?(p(s.csvUpload.fileTooLarge),!1):!0:(p(s.csvUpload.invalidFileType),!1),w=g.useCallback(j=>{p(""),C([]),v(null),d("idle"),x(j)&&i(j)},[]),T=g.useCallback(j=>{j.preventDefault(),c(!1);const N=j.dataTransfer.files[0];N&&w(N)},[w]),L=g.useCallback(j=>{var F;const N=(F=j.target.files)==null?void 0:F[0];N&&w(N),j.target.value=""},[w]),A=g.useCallback(async()=>{try{const j=await QL(e),N=document.createElement("a");N.href=j,N.download="sample_hierarchy.csv",N.target="_blank",N.click()}catch{p(s.csvUpload.downloadSampleFailed)}},[e,s.csvUpload.downloadSampleFailed]),O=g.useCallback(async()=>{if(o){d("uploading"),p(""),C([]);try{const{processId:j}=await VL(e,o);if(!j){d("done"),v(null),setTimeout(t,1500);return}d("processing"),b.current=setInterval(async()=>{try{const N=await HL(j);N.status==="COMPLETED"?(S(),d("done"),v(N.successCount??null),N.failedRecords&&N.failedRecords.length>0?C(N.failedRecords):setTimeout(t,1500)):N.status==="FAILED"&&(S(),d("error"),p(s.csvUpload.processingFailed),N.failedRecords&&C(N.failedRecords))}catch{S(),d("error"),p(s.csvUpload.connectionLost)}},2e3)}catch{d("error"),p(s.csvUpload.uploadFailed)}}},[e,o,t,S,s.csvUpload.processingFailed,s.csvUpload.connectionLost,s.csvUpload.uploadFailed]),P={idle:"",uploading:s.csvUpload.statusUploading,processing:s.csvUpload.statusProcessing,done:s.csvUpload.statusDone,error:s.csvUpload.statusError};return l.jsxs("div",{className:Ue.container,children:[l.jsxs("div",{className:Ue.header,children:[l.jsx("h2",{className:Ue.title,children:n==="update"?s.csvUpload.titleUpdate:s.csvUpload.titleCreate}),l.jsx("button",{className:Ue.closeBtn,onClick:r,"aria-label":s.csvUpload.closeAriaLabel,children:l.jsx(lr,{size:18})})]}),l.jsxs("div",{className:Ue.body,children:[l.jsxs("div",{className:`${Ue.dropZone} ${a?Ue.dragOver:""} ${o?Ue.hasFile:""}`,onDragEnter:j=>{j.preventDefault(),c(!0)},onDragOver:j=>{j.preventDefault(),c(!0)},onDragLeave:j=>{j.preventDefault(),c(!1)},onDrop:T,onClick:()=>{var j;return(j=y.current)==null?void 0:j.click()},role:"button",tabIndex:0,"aria-label":s.csvUpload.dropZoneAriaLabel,onKeyDown:j=>{var N;return j.key==="Enter"&&((N=y.current)==null?void 0:N.click())},children:[l.jsx("input",{ref:y,type:"file",accept:".csv",className:Ue.hiddenInput,onChange:L,"aria-hidden":"true"}),o?l.jsxs("div",{className:Ue.fileInfo,children:[l.jsx(to,{size:24,className:Ue.fileIcon}),l.jsx("span",{className:Ue.fileName,children:o.name}),l.jsxs("span",{className:Ue.fileSize,children:["(",(o.size/1024).toFixed(1)," KB)"]})]}):l.jsxs("div",{className:Ue.dropHint,children:[l.jsx(Ua,{size:32,className:Ue.dropIcon}),l.jsx("p",{className:Ue.dropText,children:s.csvUpload.dropText}),l.jsx("p",{className:Ue.dropSubtext,children:s.csvUpload.dropSubtext})]})]}),l.jsx("button",{className:Ue.sampleLink,onClick:A,type:"button",children:s.csvUpload.downloadSample}),u!=="idle"&&l.jsxs("div",{className:`${Ue.statusBar} ${Ue[`status_${u}`]}`,role:"status","aria-live":"polite",children:[u==="processing"&&l.jsx("span",{className:Ue.spinner,"aria-hidden":"true"}),P[u],u==="done"&&h!==null&&l.jsx("span",{className:Ue.successDetail,children:s.csvUpload.itemsImportedSuffix.replace("{count}",String(h))})]}),f&&l.jsx("p",{className:Ue.errorMsg,role:"alert",children:f}),m.length>0&&l.jsxs("div",{className:Ue.failedSection,children:[l.jsx("h4",{className:Ue.failedTitle,children:s.csvUpload.failedRowsTitle.replace("{count}",String(m.length))}),l.jsx("div",{className:Ue.tableWrap,children:l.jsxs("table",{className:Ue.failedTable,children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:s.csvUpload.rowHeader}),l.jsx("th",{children:s.csvUpload.nameHeader}),l.jsx("th",{children:s.csvUpload.reasonHeader})]})}),l.jsx("tbody",{children:m.map((j,N)=>l.jsxs("tr",{children:[l.jsx("td",{children:j.rowNumber??N+1}),l.jsx("td",{children:j.name??"—"}),l.jsx("td",{className:Ue.reasonCell,children:j.reason??s.csvUpload.unknownError})]},N))})]})})]})]}),l.jsxs("div",{className:Ue.footer,children:[l.jsx(Re,{variant:"ghost",onClick:r,disabled:u==="uploading"||u==="processing",children:s.csvUpload.cancel}),l.jsx(Re,{variant:"primary",isLoading:u==="uploading"||u==="processing",disabled:!o||u==="done",onClick:O,children:u==="done"?s.csvUpload.uploaded:s.csvUpload.upload})]})]})};function Yl(){var v,y,b,S,x,w,T;const e=ae(),t=se(L=>L.treeData),r=se(L=>L.treeCache),n=se(L=>L.deleteNode),s=rt(L=>L.activeAssessmentSlot),o=rt(L=>L.setActiveAssessmentSlot),i=rt(L=>L.openModal),a=((v=t[0])==null?void 0:v.children)??[],c=a[0],u=a.length>1?a[a.length-1]:void 0,d=nt(c),f=nt(u),p=t[0],m=p?((y=r[p.id])==null?void 0:y.policy)??((b=p.metadata)==null?void 0:b.policy):void 0,C=!!m&&Ih.has(m),h=L=>{const A=L==="pre"?c:u;if(!A)return;const O=L==="pre"&&C?e.learningPath.deletePriorAssessmentConfirm:e.learningPath.deleteAssessmentSlotConfirm;i("confirmDelete",{message:O,onConfirm:()=>n(A.id)})};return{pre:{level:c,filled:d,courseName:d?(x=(S=c==null?void 0:c.children)==null?void 0:S[0])==null?void 0:x.name:void 0,required:C},post:{level:u,filled:f,courseName:f?(T=(w=u==null?void 0:u.children)==null?void 0:w[0])==null?void 0:T.name:void 0,required:!1},activeAssessmentSlot:s,setActiveAssessmentSlot:o,deleteSlot:h}}const AD="_container_1ghxo_1",kD="_header_1ghxo_8",ID="_sectionLabel_1ghxo_18",LD="_headerActions_1ghxo_26",DD="_iconBtn_1ghxo_33",jD="_menuWrap_1ghxo_51",ND="_dropdownMenu_1ghxo_55",OD="_treeWrapper_1ghxo_87",PD="_csvModal_1ghxo_103",RD="_footer_1ghxo_113",rr={container:AD,header:kD,sectionLabel:ID,headerActions:LD,iconBtn:DD,menuWrap:jD,dropdownMenu:ND,treeWrapper:OD,csvModal:PD,footer:RD},FD=({editorMode:e,collapsed:t=!1,onToggleCollapse:r})=>{var Ae;const n=ae(),s=g.useRef(null),o=g.useRef(null),i=g.useRef(null),[a,c]=g.useState(400),[u,d]=g.useState(!1),[f,p]=g.useState(!1),[m,C]=g.useState("create"),{treeData:h,selectedNodeId:v,selectNode:y,addNode:b,deleteNode:S,getNodeById:x,reorderChildren:w,moveNode:T,setTreeData:L}=se(),A=rt(J=>J.openModal),O=X(J=>J.editorProfile),P=O.key==="learningPath",j=e==="edit",N=Kl(),F=j&&N,R=P?n.learningPath.addLevelButton:n.outlineTree.addUnitButton,U=O.maxDepth>1,re=(((Ae=h[0])==null?void 0:Ae.children)??[]).some(J=>J.isFolder),{pre:G,post:pe,deleteSlot:me}=Yl(),{level:V}=G,{level:de}=pe,oe=X(J=>{var he,Q,Ce,qe;return((Q=(he=J.editorConfig)==null?void 0:he.context)==null?void 0:Q.contentId)??((qe=(Ce=J.editorConfig)==null?void 0:Ce.context)==null?void 0:qe.identifier)??""}),Se=X(J=>{var Q,Ce;const he=(Ce=(Q=J.categoryMeta)==null?void 0:Q.sourcingSettings)==null?void 0:Ce.collection;return(he==null?void 0:he.enableBulkUpload)!==!1}),ve=O.features.csvUpload&&Se;g.useEffect(()=>{const J=o.current;if(!J)return;const he=new ResizeObserver(()=>{c(J.clientHeight||400)});return he.observe(J),c(J.clientHeight||400),()=>he.disconnect()},[]),g.useEffect(()=>{if(!u)return;const J=he=>{var Q;(Q=i.current)!=null&&Q.contains(he.target)||d(!1)};return document.addEventListener("mousedown",J),()=>document.removeEventListener("mousedown",J)},[u]);const q=g.useCallback(J=>{J.length>0&&y(J[0].data.id)},[y]),M=g.useCallback(({parentId:J,index:he,dragIds:Q})=>{if(!J)return;const Ce=Q[0],qe=cl(h,Ce);if(!qe)return;const et=qe.parent;if(et===J){const $e=cl(h,J);if(!($e!=null&&$e.children))return;const We=$e.children.findIndex(tt=>tt.id===Ce);if(We<0)return;w(J,We,he>We?he-1:he)}else T(Ce,et??"",J)},[h,w,T]),$=g.useCallback(({ids:J})=>{if(!P){for(const Q of J)S(Q);return}if(J.length===1){const Q=J[0];if((V==null?void 0:V.id)===Q){me("pre");return}if((de==null?void 0:de.id)===Q){me("post");return}const Ce=x(Q),qe=Ce!=null&&Ce.isFolder?n.learningPath.deleteLevelConfirm.replace("{name}",Ce.name):n.learningPath.deleteCourseConfirm;A("confirmDelete",{message:qe,onConfirm:()=>S(Q)});return}const he=n.learningPath.deleteMultipleConfirm.replace("{count}",String(J.length));A("confirmDelete",{message:he,onConfirm:()=>{for(const Q of J)S(Q)}})},[S,me,P,V,de,x,A,n]),ne=g.useCallback(({parentId:J})=>{var Ce;const he=J??((Ce=h[0])==null?void 0:Ce.id)??"";if(!he)return{id:crypto.randomUUID()};const Q=b(he,"unit");return Q?{id:Q}:(ye.error(n.outlineTree.maxDepthReachedToast),{id:crypto.randomUUID()})},[b,h,n]),ie=g.useCallback(()=>{var he;const J=(he=h[0])==null?void 0:he.id;J&&(b(J,"unit")||ye.error(n.outlineTree.maxDepthReachedToast))},[h,b,n]),xe=g.useCallback(()=>{v&&(b(v,"subunit")||ye.error(n.outlineTree.maxDepthReachedToast))},[v,b,n]),fe=g.useCallback(async()=>{if(d(!1),!!oe)try{const J=await Dp(oe),he=await fetch(J).then(qe=>qe.blob()),Q=URL.createObjectURL(he),Ce=document.createElement("a");Ce.href=Q,Ce.download=`${oe}-folders.csv`,Ce.style.display="none",document.body.appendChild(Ce),Ce.click(),document.body.removeChild(Ce),URL.revokeObjectURL(Q)}catch{ye.error(n.outlineTree.downloadCsvFailedToast)}},[oe,n]),ge=g.useCallback(async()=>{if(p(!1),!!oe)try{const{rootNode:J}=await Bh(oe);L([J]),ye.success(n.outlineTree.outlineRefreshedToast)}catch{ye.error(n.outlineTree.outlineRefreshFailedToast)}},[oe,L,n]);return l.jsxs("div",{className:rr.container,children:[l.jsxs("div",{className:rr.header,children:[P&&l.jsx("span",{className:rr.sectionLabel,children:n.learningPath.pathStructureLabel}),l.jsxs("div",{className:rr.headerActions,children:[j&&ve&&l.jsxs("div",{className:rr.menuWrap,ref:i,children:[l.jsx("button",{type:"button",className:rr.iconBtn,onClick:()=>d(J=>!J),"aria-label":n.outlineTree.moreOptionsAriaLabel,title:n.outlineTree.moreOptionsTitle,"aria-haspopup":"true","aria-expanded":u,children:l.jsx(Uf,{size:15})}),u&&l.jsxs("div",{className:rr.dropdownMenu,role:"menu",children:[l.jsx("button",{role:"menuitem",type:"button",disabled:re,title:re?n.outlineTree.foldersExistTitle:void 0,onClick:()=>{d(!1),C("create"),p(!0)},children:n.outlineTree.createFoldersCsvButton}),l.jsx("button",{role:"menuitem",type:"button",disabled:!re,title:re?void 0:n.outlineTree.noFoldersYetTitle,onClick:fe,children:n.outlineTree.downloadFoldersCsvButton}),l.jsx("button",{role:"menuitem",type:"button",disabled:!re,title:re?void 0:n.outlineTree.noFoldersYetTitle,onClick:()=>{d(!1),C("update"),p(!0)},children:n.outlineTree.updateFoldersCsvButton})]})]}),r&&l.jsx("button",{type:"button",className:rr.iconBtn,onClick:r,"aria-label":t?n.outlineTree.expandOutlineAriaLabel:n.outlineTree.collapseOutlineAriaLabel,title:t?n.outlineTree.expandOutlineAriaLabel:n.outlineTree.collapseOutlineAriaLabel,children:t?l.jsx(My,{size:15}):l.jsx(Fy,{size:15})})]})]}),l.jsx("div",{className:rr.treeWrapper,ref:o,children:l.jsx(yL,{ref:s,data:h,idAccessor:"id",childrenAccessor:"children",onSelect:q,onMove:j?M:void 0,onDelete:j?$:void 0,onCreate:j?ne:void 0,disableEdit:!j,disableDrop:!j,selection:v??void 0,rowHeight:40,indent:20,paddingBottom:16,height:a,width:"100%",children:J=>l.jsx($L,{...J,editorMode:e})})}),j&&l.jsxs("div",{className:rr.footer,children:[l.jsxs(Re,{variant:"ghost",size:"sm",onClick:ie,disabled:!F,children:[l.jsx(kr,{size:14})," ",R]}),U&&l.jsxs(Re,{variant:"ghost",size:"sm",onClick:xe,disabled:!F||!v,children:[l.jsx(zf,{size:14})," ",n.outlineTree.addSubunitButton]})]}),f&&l.jsx("div",{className:rr.csvModal,children:l.jsx(ED,{contentId:oe,mode:m,onComplete:ge,onClose:()=>p(!1)})})]})};function cl(e,t){for(const r of e){if(r.id===t)return r;if(r.children){const n=cl(r.children,t);if(n)return n}}}const MD="_breadcrumb_zd1aj_1",BD="_crumb_zd1aj_10",qD="_sep_zd1aj_26",$D="_current_zd1aj_31",Cs={breadcrumb:MD,crumb:BD,sep:qD,current:$D},UD=({crumbs:e})=>{const t=se(n=>n.selectNode),r=ae();return e.length?l.jsxs("nav",{className:Cs.breadcrumb,"aria-label":r.breadcrumb.nodePathAriaLabel,children:[l.jsx("button",{className:Cs.crumb,onClick:()=>t(e[0].id),"aria-label":r.breadcrumb.homeAriaLabel,children:l.jsx(Oy,{size:13})}),e.map((n,s)=>l.jsxs(g.Fragment,{children:[l.jsx(kl,{size:13,className:Cs.sep}),s<e.length-1?l.jsx("button",{className:Cs.crumb,onClick:()=>t(n.id),children:n.name}):l.jsx("span",{className:Cs.current,children:n.name})]},n.id))]}):null},zD="_tabBar_qhks1_1",VD="_tab_qhks1_1",HD="_active_qhks1_29",QD="_error_qhks1_35",WD="_errorDot_qhks1_39",Ss={tabBar:zD,tab:VD,active:HD,error:QD,errorDot:WD},GD=({activeTab:e,onChange:t,errorTabs:r=[],visibleTabs:n})=>{const s=ae(),o=[{id:"details",label:s.tabBar.detailsTab},{id:"audience",label:s.tabBar.audienceCurriculumTab},{id:"licensing",label:s.tabBar.licensingTab}],i=n?o.filter(a=>n.includes(a.id)):o;return l.jsx("div",{className:Ss.tabBar,role:"tablist","aria-label":s.tabBar.metadataSectionsAriaLabel,children:i.map(a=>l.jsxs("button",{role:"tab","aria-selected":e===a.id,"aria-controls":`panel-${a.id}`,className:[Ss.tab,e===a.id?Ss.active:"",r.includes(a.id)?Ss.error:""].join(" "),onClick:()=>t(a.id),children:[a.label,r.includes(a.id)&&l.jsx("span",{className:Ss.errorDot,"aria-label":s.tabBar.hasErrorsAriaLabel})]},a.id))})};var co=e=>e.type==="checkbox",rn=e=>e instanceof Date,yt=e=>e==null;const jp=e=>typeof e=="object";var Ze=e=>!yt(e)&&!Array.isArray(e)&&jp(e)&&!rn(e),ul=e=>Ze(e)&&e.target?co(e.target)?e.target.checked:e.target.value:e,Np=(e,t)=>t.split(".").some((r,n,s)=>!isNaN(Number(r))&&e.has(s.slice(0,n).join("."))),Op=e=>{const t=e.constructor&&e.constructor.prototype;return Ze(t)&&t.hasOwnProperty("isPrototypeOf")},Pi=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Xe(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(Pi&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(Ze(e)&&Op(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=Xe(e[s]));return n}const Fr={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},or={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},nr={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},ha="form",Pp="root",Rp=["__proto__","constructor","prototype"];var uo=e=>/^\w*$/.test(e),Qe=e=>e===void 0,Ri=e=>e.split(/[.[\]'"]/g).filter(Boolean),Z=(e,t,r)=>{if(!t||!Ze(e))return r;const n=uo(t)?[t]:Ri(t);if(n.some(o=>Rp.includes(o)))return r;const s=n.reduce((o,i)=>yt(o)?void 0:o[i],e);return Qe(s)||s===e?Qe(e[t])?r:e[t]:s},zt=e=>typeof e=="boolean",kt=e=>typeof e=="function",Ve=(e,t,r)=>{let n=-1;const s=uo(t)?[t]:Ri(t),o=s.length,i=o-1;for(;++n<o;){const a=s[n];let c=r;if(n!==i){const u=e[a];c=Ze(u)||Array.isArray(u)?u:isNaN(+s[n+1])?{}:[]}if(Rp.includes(a))return;e[a]=c,e=e[a]}};const Zl=g.createContext(null);Zl.displayName="HookFormControlContext";const Xl=()=>g.useContext(Zl);var Fp=(e,t,r,n=!0)=>{const s={};for(const o in e)Object.defineProperty(s,o,{get:()=>{const i=o;return t._proxyFormState[i]!==or.all&&(t._proxyFormState[i]=!n||or.all),r&&(r[i]=!0),e[i]}});return s};const Jl=Pi?g.useLayoutEffect:g.useEffect;function KD(e){const t=Xl(),{control:r=t,disabled:n,name:s,exact:o}=e||{},[i,a]=g.useState(()=>({...r._formState,defaultValues:r._defaultValues})),c=g.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Jl(()=>r._subscribe({name:s,formState:c.current,exact:o,callback:u=>{!n&&a({...r._formState,...u,defaultValues:r._defaultValues})}}),[s,n,o]),g.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),g.useMemo(()=>Fp(i,r,c.current,!1),[i,r])}var It=e=>typeof e=="string",dl=(e,t,r,n,s)=>It(e)?(n&&t.watch.add(e),Z(r,e,s)):Array.isArray(e)?e.map(o=>(n&&t.watch.add(o),Z(r,o))):(n&&(t.watchAll=!0),r),fl=e=>yt(e)||!jp(e);const dd=(e,t)=>t.length===0&&!Array.isArray(e)&&!Op(e);function Vt(e,t,r=new WeakMap){if(e===t)return!0;if(fl(e)||fl(t))return Object.is(e,t);if(rn(e)&&rn(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;if(dd(e,n)||dd(t,s))return Object.is(e,t);const o=r.get(e);if(o&&o.has(t))return!0;o?o.add(t):r.set(e,new WeakSet([t]));for(const i of n){const a=e[i];if(!(i in t))return!1;if(i!=="ref"){const c=t[i];if(rn(a)&&rn(c)||(Ze(a)||Array.isArray(a))&&(Ze(c)||Array.isArray(c))?!Vt(a,c,r):!Object.is(a,c))return!1}}return!0}function YD(e){const t=Xl(),{control:r=t,name:n,defaultValue:s,disabled:o,exact:i,compute:a}=e||{},c=g.useRef(s),u=g.useRef(a),d=g.useRef(void 0),f=g.useRef(r),p=g.useRef(n);u.current=a;const[m,C]=g.useState(()=>{const x=r._getWatch(n,c.current);return u.current?u.current(x):x}),h=g.useCallback(x=>{const w=dl(n,r._names,x||r._formValues,!1,c.current);return u.current?u.current(w):w},[r._formValues,r._names,n]),v=g.useCallback(x=>{if(!o){const w=dl(n,r._names,x||r._formValues,!1,c.current);if(u.current){const T=u.current(w);Vt(T,d.current)||(C(T),d.current=T)}else C(w)}},[r._formValues,r._names,o,n]);Jl(()=>((f.current!==r||!Vt(p.current,n))&&(f.current=r,p.current=n,v()),r._subscribe({name:n,formState:{values:!0},exact:i,callback:x=>{v(x.values)}})),[r,i,n,v]),g.useEffect(()=>r._removeUnmounted());const y=f.current!==r,b=p.current,S=g.useMemo(()=>{if(o)return null;const x=!y&&!Vt(b,n);return y||x?h():null},[o,y,n,b,h]);return S!==null?S:m}function fo(e){const t=Xl(),{name:r,disabled:n,control:s=t,shouldUnregister:o,defaultValue:i,exact:a=!0}=e,c=Np(s._names.array,r),u=g.useMemo(()=>Z(s._formValues,r,Z(s._defaultValues,r,i)),[s,r,i]),d=YD({control:s,name:r,defaultValue:u,exact:a}),f=KD({control:s,name:r,exact:a}),p=g.useRef(e),m=g.useRef(null),C=g.useRef(s.register(r,{...e.rules,value:d,...zt(e.disabled)?{disabled:e.disabled}:{}}));p.current=e;const h=g.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Z(f.errors,r)},isDirty:{enumerable:!0,get:()=>!!Z(f.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!Z(f.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!Z(f.validatingFields,r)},error:{enumerable:!0,get:()=>Z(f.errors,r)}}),[f,r]),v=g.useCallback(x=>{const w=ul(x);return Z(s._fields,r)||(C.current=s.register(r,{...p.current.rules,value:w})),C.current.onChange({target:{value:ul(x),name:r},type:Fr.CHANGE})},[r,s]),y=g.useCallback(()=>C.current.onBlur({target:{value:Z(s._formValues,r),name:r},type:Fr.BLUR}),[r,s._formValues]),b=g.useCallback(x=>{x&&(m.current={focus:()=>kt(x.focus)&&x.focus(),select:()=>kt(x.select)&&x.select(),setCustomValidity:T=>kt(x.setCustomValidity)&&x.setCustomValidity(T),reportValidity:()=>kt(x.reportValidity)&&x.reportValidity()});const w=Z(s._fields,r);w&&w._f&&x&&(w._f.ref=m.current)},[s._fields,r]),S=g.useMemo(()=>({name:r,value:d,...zt(n)||f.disabled?{disabled:f.disabled||n}:{},onChange:v,onBlur:y,ref:b}),[r,n,f.disabled,v,y,b,d]);return g.useEffect(()=>{const x=s._options.shouldUnregister||o;s.register(r,{...p.current.rules,...zt(p.current.disabled)?{disabled:p.current.disabled}:{}});const w=(T,L)=>{const A=Z(s._fields,T);A&&A._f&&(A._f.mount=L)};if(w(r,!0),x){const T=Xe(Z(o?s._defaultValues:s._options.values||s._defaultValues,r,Z(s._options.defaultValues,r,p.current.defaultValue)));Ve(s._defaultValues,r,T),Qe(Z(s._formValues,r))&&Ve(s._formValues,r,T)}if(!c&&s.register(r),m.current){const T=Z(s._fields,r);T&&T._f&&(T._f.ref=m.current)}return()=>{(c?x&&!s._state.action:x)?s.unregister(r):w(r,!1)}},[r,s,c,o]),g.useEffect(()=>{s._setDisabledField({disabled:n,name:r})},[n,r,s]),g.useMemo(()=>({field:S,formState:f,fieldState:h}),[S,f,h])}const ZD=e=>e.render(fo(e)),ec=g.createContext(null);ec.displayName="HookFormContext";const er=()=>g.useContext(ec),XD=({children:e,watch:t,getValues:r,getFieldState:n,setError:s,clearErrors:o,setValue:i,setValues:a,trigger:c,formState:u,resetField:d,reset:f,handleSubmit:p,unregister:m,control:C,register:h,setFocus:v,subscribe:y})=>{const b=g.useMemo(()=>({watch:t,getValues:r,getFieldState:n,setError:s,clearErrors:o,setValue:i,setValues:a,trigger:c,formState:u,resetField:d,reset:f,handleSubmit:p,unregister:m,control:C,register:h,setFocus:v,subscribe:y}),[o,C,u,n,r,p,h,f,d,s,v,i,a,y,c,m,t]);return g.createElement(ec.Provider,{value:b},g.createElement(Zl.Provider,{value:b.control},e))};var JD=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},Mp=e=>Array.isArray(e)?e.filter(Boolean):[],Vo=e=>Array.isArray(e)?e:[e],fd=()=>{let e=[];return{get observers(){return e},next:s=>{for(const o of e)o.next&&o.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(o=>o!==s)}}),unsubscribe:()=>{e=[]}}};function Bp(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const s=e[n],o=t[n];if(s&&Ze(s)&&o){const i=Bp(s,o);Ze(i)&&(r[n]=i)}else e[n]&&(r[n]=o)}return r}var ht=e=>Ze(e)&&!Object.keys(e).length,tc=e=>e.type==="file",oi=e=>{if(!Pi)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},qp=e=>e.type==="select-multiple",rc=e=>e.type==="radio",ej=e=>rc(e)||co(e),pa=e=>oi(e)&&e.isConnected;function tj(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;){if(yt(e)){e=void 0;break}e=e[t[n]],n++}return e}function rj(e){for(const t in e)if(e.hasOwnProperty(t)&&!Qe(e[t]))return!1;return!0}function ot(e,t){if(It(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;const r=Array.isArray(t)?t:uo(t)?[t]:Ri(t),n=r.length===1?e:tj(e,r),s=r.length-1,o=r[s];return n&&delete n[o],s!==0&&(Ze(n)&&ht(n)||Array.isArray(n)&&rj(n))&&ot(e,r.slice(0,-1)),e}var nj=e=>{for(const t in e)if(kt(e[t]))return!0;return!1};function $p(e){return Array.isArray(e)||Ze(e)&&!nj(e)}function hl(e,t={}){for(const r in e){const n=e[r];$p(n)?(t[r]=Array.isArray(n)?[]:{},hl(n,t[r])):Qe(n)||(t[r]=!0)}return t}function pl(e){if(e!==!1){if(e===!0)return!0;if(Array.isArray(e)){const t=e.map(r=>pl(r));return t.some(r=>r!==void 0)?t:void 0}if(Ze(e)){const t={};for(const r in e){const n=pl(e[r]);Qe(n)||(t[r]=n)}return Object.keys(t).length?t:void 0}}}function Jr(e,t,r){r||(r=hl(t));for(const n in e){const s=e[n];if($p(s))Qe(t)||fl(r[n])?r[n]=hl(s,Array.isArray(s)?[]:{}):Jr(s,yt(t)?{}:t[n],r[n]);else{const o=t[n];r[n]=!Vt(s,o)}}return pl(r)||{}}const hd={value:!1,isValid:!1},pd={value:!0,isValid:!0};var Up=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&&!Qe(e[0].attributes.value)?Qe(e[0].value)||e[0].value===""?pd:{value:e[0].value,isValid:!0}:pd:hd}return hd},zp=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Qe(e)?e:t?e===""?NaN:e&&+e:r&&It(e)?new Date(e):n?n(e):e;const md={isValid:!1,value:null};var Vp=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,md):md;function gd(e){const t=e.ref;return tc(t)?t.files:rc(t)?Vp(e.refs).value:qp(t)?[...t.selectedOptions].map(({value:r})=>r):co(t)?Up(e.refs).value:zp(Qe(t.value)?e.ref.value:t.value,e)}var sj=(e,t,r,n)=>{const s={};for(const o of e){const i=Z(t,o);i&&Ve(s,o,i._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},ii=e=>e instanceof RegExp,xs=e=>Qe(e)?e:ii(e)?e.source:Ze(e)?ii(e.value)?e.value.source:e.value:e,vd=e=>({isOnSubmit:!e||e===or.onSubmit,isOnBlur:e===or.onBlur,isOnChange:e===or.onChange,isOnAll:e===or.all,isOnTouch:e===or.onTouched});const yd="AsyncFunction";var oj=e=>!!e&&!!e.validate&&!!(kt(e.validate)&&e.validate.constructor.name===yd||Ze(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===yd)),ij=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),ma=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(`${n}.`)));const js=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const o=Z(e,s);if(o){const{_f:i,...a}=o;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],s)&&!n)return!0;if(i.ref&&t(i.ref,i.name)&&!n)return!0;if(js(a,t))break}else if(Ze(a)&&js(a,t))break}}};function bd(e,t,r){const n=Z(e,r);if(n||uo(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const o=s.join("."),i=Z(t,o),a=Z(e,o);if(i&&!Array.isArray(i)&&r!==o)return{name:r};if(a&&a.type)return{name:o,error:a};if(a&&a.root&&a.root.type)return{name:`${o}.root`,error:a.root};s.pop()}return{name:r}}var aj=(e,t,r,n)=>{r(e);const{name:s,...o}=e;return ht(o)||n&&Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(i=>t[i]===(!n||or.all))},lj=(e,t,r)=>!e||!t||e===t||Vo(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),cj=(e,t,r,n,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:(r?n.isOnChange:s.isOnChange)?e:!0,uj=(e,t)=>!Mp(Z(e,t)).length&&ot(e,t),Cd=(e,t,r)=>{const n=Z(e,r),s=Array.isArray(n)?n:[];return Ve(s,Pp,t[r]),Ve(e,r,s),e};function Sd(e,t,r="validate"){if(It(e)||Array.isArray(e)&&e.every(It)||zt(e)&&!e)return{type:r,message:It(e)?e:"",ref:t}}var jn=e=>Ze(e)&&!ii(e)?e:{value:e,message:""},xd=async(e,t,r,n,s,o)=>{const{ref:i,refs:a,required:c,maxLength:u,minLength:d,min:f,max:p,pattern:m,validate:C,name:h,valueAsNumber:v,mount:y}=e._f,b=Z(r,h);if(!y||t.has(h))return{};const S=a?a[0]:i,x=N=>{if(s&&S.reportValidity){const F=zt(N)?"":N||"";a?a.forEach(R=>R.setCustomValidity(F)):S.setCustomValidity(F),S.reportValidity()}},w={},T=rc(i),L=co(i),A=T||L,O=(v||tc(i))&&Qe(i.value)&&Qe(b)||oi(i)&&i.value===""||b===""||Array.isArray(b)&&!b.length,P=JD.bind(null,h,n,w),j=(N,F,R,U=nr.maxLength,re=nr.minLength)=>{const G=N?F:R;w[h]={type:N?U:re,message:G,ref:i,...P(N?U:re,G)}};if(o?!Array.isArray(b)||!b.length:c&&(!A&&(O||yt(b))||zt(b)&&!b||L&&!Up(a).isValid||T&&!Vp(a).isValid)){const{value:N,message:F}=It(c)?{value:!!c,message:c}:jn(c);if(N&&(w[h]={type:nr.required,message:F,ref:S,...P(nr.required,F)},!n))return x(F),w}if(!O&&(!yt(f)||!yt(p))){let N,F;const R=jn(p),U=jn(f);if(!yt(b)&&!isNaN(b)){const re=i.valueAsNumber||b&&+b;yt(R.value)||(N=re>R.value),yt(U.value)||(F=re<U.value)}else{const re=i.valueAsDate||new Date(b),G=V=>new Date(new Date().toDateString()+" "+V),pe=i.type=="time",me=i.type=="week";It(R.value)&&b&&(N=pe?G(b)>G(R.value):me?b>R.value:re>new Date(R.value)),It(U.value)&&b&&(F=pe?G(b)<G(U.value):me?b<U.value:re<new Date(U.value))}if((N||F)&&(j(!!N,R.message,U.message,nr.max,nr.min),!n))return x(w[h].message),w}if((u||d)&&!O&&(It(b)||o&&Array.isArray(b))){const N=jn(u),F=jn(d),R=!yt(N.value)&&b.length>+N.value,U=!yt(F.value)&&b.length<+F.value;if((R||U)&&(j(R,N.message,F.message),!n))return x(w[h].message),w}if(m&&!O&&It(b)){const{value:N,message:F}=jn(m);if(ii(N)&&!b.match(N)&&(w[h]={type:nr.pattern,message:F,ref:i,...P(nr.pattern,F)},!n))return x(F),w}if(C){if(kt(C)){const N=await C(b,r),F=Sd(N,S);if(F&&(w[h]={...F,...P(nr.validate,F.message)},!n))return x(F.message),w}else if(Ze(C)){let N={};for(const F in C){if(!ht(N)&&!n)break;const R=Sd(await C[F](b,r),S,F);R&&(N={...R,...P(F,R.message)},x(R.message),n&&(w[h]=N))}if(!ht(N)&&(w[h]={ref:S,...N},!n))return w}}return x(!0),w};const dj={mode:or.onSubmit,reValidateMode:or.onChange,shouldFocusError:!0},Hp={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function fj(e={}){let t={...dj,...e},r={...Xe(Hp),isLoading:kt(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},n={},s=Ze(t.defaultValues)||Ze(t.values)?Xe(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:Xe(s),i={action:!1,mount:!1,watch:!1,keepIsValid:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},c,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={...d};let p={...f};const m={array:fd(),state:fd()},C=t.criteriaMode===or.all,h=_=>E=>{clearTimeout(u),u=setTimeout(_,E)},v=async _=>{if(!i.keepIsValid&&!t.disabled&&(f.isValid||p.isValid||_)){let E;t.resolver?(E=ht((await P()).errors),y()):E=await F({fields:n,onlyCheckValid:!0,eventType:Fr.VALID}),E!==r.isValid&&m.state.next({isValid:E})}},y=(_,E)=>{!t.disabled&&(f.isValidating||f.validatingFields||p.isValidating||p.validatingFields)&&((_||Array.from(a.mount)).forEach(I=>{I&&(E?Ve(r.validatingFields,I,E):ot(r.validatingFields,I))}),m.state.next({validatingFields:r.validatingFields,isValidating:!ht(r.validatingFields)}))},b=()=>{r.dirtyFields=Jr(s,o)},S=(_,E=[],I,z,H=!0,Y=!0)=>{if(z&&I&&!t.disabled){if(i.action=!0,Y&&Array.isArray(Z(n,_))){const W=I(Z(n,_),z.argA,z.argB);H&&Ve(n,_,W)}if(Y&&Array.isArray(Z(r.errors,_))){const W=I(Z(r.errors,_),z.argA,z.argB);H&&Ve(r.errors,_,W),uj(r.errors,_)}if((f.touchedFields||p.touchedFields)&&Y&&Array.isArray(Z(r.touchedFields,_))){const W=I(Z(r.touchedFields,_),z.argA,z.argB);H&&Ve(r.touchedFields,_,W)}(f.dirtyFields||p.dirtyFields)&&b(),m.state.next({name:_,isDirty:U(_,E),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Ve(o,_,E)},x=(_,E)=>{Ve(r.errors,_,E),r.errors={...r.errors},m.state.next({errors:r.errors})},w=_=>{r.errors=_,m.state.next({errors:r.errors,isValid:!1})},T=_=>{const E=uo(_)?[_]:Ri(_);let I=o,z=s;for(let H=0;H<E.length-1;H++){const Y=E[H];if(I=yt(I)?I:I[Y],z=yt(z)?z:z[Y],I===null&&z!==null)return!0}return!1},L=(_,E,I,z)=>{const H=Z(n,_);if(H){if(T(_))return;const Y=Qe(Z(o,_)),W=Z(o,_,Qe(I)?Z(s,_):I);Qe(W)||z&&z.defaultChecked||E?Ve(o,_,E?W:gd(H._f)):pe(_,W),i.mount&&!i.action&&(v(),Y&&r.isDirty&&(f.isDirty||p.isDirty)&&(U()||(r.isDirty=!1,m.state.next({...r}))),e.shouldUnregister&&Y&&!Qe(Z(o,_))&&ma(_,a)&&(i.watch=!0))}},A=(_,E,I,z,H)=>{let Y=!1,W=!1;const le={name:_};if(!t.disabled){if(!I||z){(f.isDirty||p.isDirty)&&(W=r.isDirty,r.isDirty=le.isDirty=U(),Y=W!==le.isDirty);const ce=Vt(Z(s,_),E);W=!!Z(r.dirtyFields,_),ce!==r.isDirty?r.dirtyFields=Jr(s,o):ce?ot(r.dirtyFields,_):Ve(r.dirtyFields,_,!0),le.dirtyFields=r.dirtyFields,Y=Y||(f.dirtyFields||p.dirtyFields)&&W!==!ce}if(I){const ce=Z(r.touchedFields,_);ce||(Ve(r.touchedFields,_,I),le.touchedFields=r.touchedFields,Y=Y||(f.touchedFields||p.touchedFields)&&ce!==I)}Y&&H&&m.state.next(le)}return Y?le:{}},O=(_,E,I,z)=>{const H=Z(r.errors,_),Y=(f.isValid||p.isValid)&&zt(E)&&r.isValid!==E;if(t.delayError&&I?(c=h(()=>x(_,I)),c(t.delayError)):(clearTimeout(u),c=null,I?Ve(r.errors,_,I):ot(r.errors,_),r.errors={...r.errors}),(I?!Vt(H,I):H)||!ht(z)||Y){const W={...z,...Y&&zt(E)?{isValid:E}:{},errors:r.errors,name:_};r={...r,...W},m.state.next(W)}},P=async _=>(y(_,!0),await t.resolver(o,t.context,sj(_||a.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),j=async _=>{const{errors:E}=await P(_);if(y(_),_){for(const I of _){const z=Z(E,I);z?a.array.has(I)&&Ze(z)&&!Object.keys(z).some(H=>!Number.isNaN(Number(H)))?Cd(r.errors,{[I]:z},I):Ve(r.errors,I,z):ot(r.errors,I)}r.errors={...r.errors}}else r.errors=E;return E},N=async({name:_,eventType:E})=>{if(e.validate){const I=await e.validate({formValues:o,formState:r,name:_,eventType:E});if(Ze(I))for(const z in I){const H=I[z];H&&ie(`${ha}.${z}`,{message:It(H.message)?H.message:"",type:H.type||nr.validate})}else It(I)||!I?ie(ha,{message:I||"",type:nr.validate}):ne(ha);return I}return!0},F=async({fields:_,onlyCheckValid:E,name:I,eventType:z,context:H={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(H.runRootValidation=!0,!await N({name:I,eventType:z})&&(H.valid=!1,E)))return H.valid;for(const Y in _){const W=_[Y];if(W){const{_f:le,...ce}=W;if(le){const Oe=a.array.has(le.name),Ke=W._f&&oj(W._f),it=f.validatingFields||f.isValidating||p.validatingFields||p.isValidating;Ke&&it&&y([le.name],!0);const Ht=await xd(W,a.disabled,o,C,t.shouldUseNativeValidation&&!E,Oe);if(Ke&&it&&y([le.name]),Ht[le.name]&&(H.valid=!1,E)||(!E&&(Z(Ht,le.name)?Oe?Cd(r.errors,Ht,le.name):Ve(r.errors,le.name,Ht[le.name]):ot(r.errors,le.name)),e.shouldUseNativeValidation&&Ht[le.name]))break}!ht(ce)&&await F({context:H,onlyCheckValid:E,fields:ce,name:Y,eventType:z})}}return H.valid},R=()=>{for(const _ of a.unMount){const E=Z(n,_);E&&(E._f.refs?E._f.refs.every(I=>!pa(I)):!pa(E._f.ref))&&Ae(_)}a.unMount=new Set},U=(_,E)=>!t.disabled&&(_&&E&&Ve(o,_,E),!Vt(M(),s)),re=(_,E,I)=>dl(_,a,{...i.mount?o:Qe(E)?s:It(_)?{[_]:E}:E},I,E),G=_=>Mp(Z(i.mount?o:s,_,t.shouldUnregister?Z(s,_,[]):[])),pe=(_,E,I={},z=!1)=>{const H=Z(n,_);let Y=E;if(H){const W=H._f;W&&(!W.disabled&&Ve(o,_,zp(E,W)),Y=oi(W.ref)&&yt(E)?"":E,qp(W.ref)?[...W.ref.options].forEach(le=>le.selected=Y.includes(le.value)):W.refs?co(W.ref)?W.refs.forEach(le=>{(!le.defaultChecked||!le.disabled)&&(Array.isArray(Y)?le.checked=!!Y.find(ce=>ce===le.value):le.checked=Y===le.value||!!Y)}):W.refs.forEach(le=>le.checked=le.value===Y):tc(W.ref)?W.ref.value="":(W.ref.value=Y,W.ref.type||m.state.next({name:_,values:z?o:Xe(o)})))}(I.shouldDirty||I.shouldTouch)&&A(_,Y,I.shouldTouch,I.shouldDirty,!0),I.shouldValidate&&q(_)},me=(_,E,I,z=!1)=>{for(const H in E){if(!E.hasOwnProperty(H))return;const Y=E[H],W=_+"."+H,le=Z(n,W);(a.array.has(_)||Ze(Y)||le&&!le._f)&&!rn(Y)?me(W,Y,I,z):pe(W,Y,I,z)}},V=(_,E,I,z)=>{const H=Z(n,_),Y=a.array.has(_),W=z?E:Xe(E),le=Z(o,_),ce=Vt(le,W);if(ce||Ve(o,_,W),Y)m.array.next({name:_,values:z?o:Xe(o)}),(f.isDirty||f.dirtyFields||p.isDirty||p.dirtyFields)&&I.shouldDirty&&(b(),m.state.next({name:_,dirtyFields:r.dirtyFields,isDirty:U(_,W)}));else{const Oe=Array.isArray(W)&&!W.length||ht(W);!H||H._f||yt(W)||Oe?pe(_,W,I,z):me(_,W,I,z)}if(!ce){const Oe=ma(_,a),Ke=z?o:Xe(o);m.state.next({...Oe&&r,name:i.mount||Oe?_:void 0,values:Ke})}},de=(_,E,I={})=>V(_,E,I,!1),oe=(_,E={})=>{const I=kt(_)?_(o):_;if(!Vt(o,I)){o={...o,...I};for(const z of a.mount)V(z,Z(I,z),E,!0);m.state.next({...r,name:void 0,type:void 0,values:o}),E.shouldValidate&&v()}},Se=async _=>{i.mount=!0;const E=_.target;let I=E.name,z=!0;const H=Z(n,I),Y=ce=>{z=Number.isNaN(ce)||rn(ce)&&isNaN(ce.getTime())||Vt(ce,Z(o,I,ce))},W=vd(t.mode),le=vd(t.reValidateMode);if(H){let ce,Oe;const Ke=E.type?gd(H._f):ul(_),it=_.type===Fr.BLUR||_.type===Fr.FOCUS_OUT,Ht=!ij(H._f)&&!e.validate&&!t.resolver&&!Z(r.errors,I)&&!H._f.deps||cj(it,Z(r.touchedFields,I),r.isSubmitted,le,W),fs=ma(I,a,it);Ve(o,I,Ke),it?(!E||!E.readOnly)&&(H._f.onBlur&&H._f.onBlur(_),c&&c(0)):H._f.onChange&&H._f.onChange(_);const Zr=A(I,Ke,it),ut=!ht(Zr)||fs;if(!it&&m.state.next({name:I,type:_.type,values:Xe(o)}),Ht)return(f.isValid||p.isValid)&&(t.mode==="onBlur"?it&&v():it||v()),ut&&m.state.next({name:I,...fs?{}:Zr});if(!t.resolver&&e.validate&&await N({name:I,eventType:_.type}),!it&&fs&&m.state.next({...r}),t.resolver){const{errors:St}=await P([I]);if(y([I]),Y(Ke),!z){!ht(Zr)&&m.state.next(Zr);return}const Dt=bd(r.errors,n,I),tr=bd(St,n,Dt.name||I);ce=tr.error,I=tr.name,Oe=ht(St)}else y([I],!0),ce=(await xd(H,a.disabled,o,C,t.shouldUseNativeValidation))[I],y([I]),Y(Ke),z&&(ce?Oe=!1:(f.isValid||p.isValid)&&(Oe=await F({fields:n,onlyCheckValid:!0,name:I,eventType:_.type})));z&&(H._f.deps&&(!Array.isArray(H._f.deps)||H._f.deps.length>0)&&q(H._f.deps),O(I,Oe,ce,Zr))}},ve=(_,E)=>{if(Z(r.errors,E)&&_.focus)return _.focus(),1},q=async(_,E={})=>{let I,z;const H=Vo(_);if(t.resolver){const Y=await j(Qe(_)?_:H);I=ht(Y),z=_?!H.some(W=>Z(Y,W)):I}else _?(z=(await Promise.all(H.map(async Y=>{const W=Z(n,Y);return await F({fields:W&&W._f?{[Y]:W}:W,eventType:Fr.TRIGGER})}))).every(Boolean),!(!z&&!r.isValid)&&v()):z=I=await F({fields:n,name:_,eventType:Fr.TRIGGER});return m.state.next({...!It(_)||(f.isValid||p.isValid)&&I!==r.isValid?{}:{name:_},...t.resolver||!_?{isValid:I}:{},errors:r.errors}),E.shouldFocus&&!z&&js(n,ve,_?H:a.mount),z},M=(_,E)=>{let I={...i.mount?o:s};return E&&(I=Bp(E.dirtyFields?r.dirtyFields:r.touchedFields,I)),Qe(_)?I:It(_)?Z(I,_):_.map(z=>Z(I,z))},$=(_,E)=>({invalid:!!Z((E||r).errors,_),isDirty:!!Z((E||r).dirtyFields,_),error:Z((E||r).errors,_),isValidating:!!Z(r.validatingFields,_),isTouched:!!Z((E||r).touchedFields,_)}),ne=_=>{const E=_?Vo(_):void 0;E==null||E.forEach(I=>ot(r.errors,I)),E?E.forEach(I=>{m.state.next({name:I,errors:r.errors})}):m.state.next({errors:{}})},ie=(_,E,I)=>{const z=(Z(n,_,{_f:{}})._f||{}).ref,H=Z(r.errors,_)||{},{ref:Y,message:W,type:le,...ce}=H;Ve(r.errors,_,{...ce,...E,ref:z}),m.state.next({name:_,errors:r.errors,isValid:!1}),I&&I.shouldFocus&&z&&z.focus&&z.focus()},xe=(_,E)=>kt(_)?m.state.subscribe({next:I=>"values"in I&&_(I.values||re(void 0,E),I)}):re(_,E,!0),fe=_=>m.state.subscribe({next:E=>{if(lj(_.name,E.name,_.exact)&&aj(E,_.formState||f,Kr,_.reRenderRoot)){const I={...o};_.callback({values:I,...r,...E,defaultValues:s})}}}).unsubscribe,ge=_=>(i.mount=!0,p={...p,..._.formState},fe({..._,formState:{...d,..._.formState}})),Ae=(_,E={})=>{for(const I of _?Vo(_):a.mount)a.mount.delete(I),a.array.delete(I),E.keepValue||(ot(n,I),ot(o,I)),!E.keepError&&ot(r.errors,I),!E.keepDirty&&ot(r.dirtyFields,I),!E.keepTouched&&ot(r.touchedFields,I),!E.keepIsValidating&&ot(r.validatingFields,I),!t.shouldUnregister&&!E.keepDefaultValue&&ot(s,I);m.state.next({values:Xe(o)}),m.state.next({...r,...E.keepDirty?{isDirty:U()}:{}}),!E.keepIsValid&&v()},J=({disabled:_,name:E})=>{if(zt(_)&&i.mount||_||a.disabled.has(E)){const H=a.disabled.has(E)!==!!_;_?a.disabled.add(E):a.disabled.delete(E),H&&i.mount&&!i.action&&v()}},he=(_,E={})=>{let I=Z(n,_);const z=zt(E.disabled)||zt(t.disabled),H=!a.registerName.has(_)&&I&&I._f&&!I._f.mount;return Ve(n,_,{...I||{},_f:{...I&&I._f?I._f:{ref:{name:_}},name:_,mount:!0,...E}}),a.mount.add(_),I&&!H?J({disabled:zt(E.disabled)?E.disabled:t.disabled,name:_}):L(_,!0,E.value),{...z?{disabled:E.disabled||t.disabled}:{},...t.progressive?{required:!!E.required,min:xs(E.min),max:xs(E.max),minLength:xs(E.minLength),maxLength:xs(E.maxLength),pattern:xs(E.pattern)}:{},name:_,onChange:Se,onBlur:Se,ref:Y=>{if(Y){a.registerName.add(_),he(_,E),a.registerName.delete(_),I=Z(n,_);const W=Qe(Y.value)&&Y.querySelectorAll&&Y.querySelectorAll("input,select,textarea")[0]||Y,le=ej(W),ce=I._f.refs||[];if(le?ce.find(Oe=>Oe===W):W===I._f.ref)return;Ve(n,_,{_f:{...I._f,...le?{refs:[...ce.filter(pa),W,...Array.isArray(Z(s,_))?[{}]:[]],ref:{type:W.type,name:_}}:{ref:W}}}),L(_,!1,void 0,W)}else I=Z(n,_,{}),I._f&&(I._f.mount=!1),(t.shouldUnregister||E.shouldUnregister)&&!(Np(a.array,_)&&i.action)&&a.unMount.add(_)}}},Q=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&js(n,ve,a.mount),Ce=_=>{zt(_)&&(m.state.next({disabled:_}),js(n,(E,I)=>{const z=Z(n,I);z&&(E.disabled=z._f.disabled||_,Array.isArray(z._f.refs)&&z._f.refs.forEach(H=>{H.disabled=z._f.disabled||_}))},0,!1))},qe=(_,E)=>async I=>{let z;I&&(I.preventDefault&&I.preventDefault(),I.persist&&I.persist());let H=Xe(o);if(m.state.next({isSubmitting:!0}),t.resolver){const{errors:Y,values:W}=await P();y(),r.errors=Y,H=Xe(W)}else await F({fields:n,eventType:Fr.SUBMIT});if(a.disabled.size)for(const Y of a.disabled)ot(H,Y);if(ot(r.errors,Pp),ht(r.errors)){m.state.next({errors:{}});try{await _(H,I)}catch(Y){z=Y}}else E&&await E({...r.errors},I),Q(),setTimeout(Q);if(m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ht(r.errors)&&!z,submitCount:r.submitCount+1,errors:r.errors}),z)throw z},et=(_,E={})=>{Z(n,_)&&(Qe(E.defaultValue)?de(_,Xe(Z(s,_))):(de(_,E.defaultValue),Ve(s,_,Xe(E.defaultValue))),E.keepTouched||ot(r.touchedFields,_),E.keepDirty||(ot(r.dirtyFields,_),r.isDirty=E.defaultValue?U(_,Xe(Z(s,_))):U()),E.keepError||(ot(r.errors,_),f.isValid&&v()),m.state.next({...r}))},$e=(_,E={})=>{const I=_?Xe(_):s,z=Xe(I),H=ht(_),Y=z;if(E.keepDefaultValues||(s=I),!E.keepValues){if(E.keepDirtyValues){const W=new Set([...a.mount,...Object.keys(Jr(s,o))]);for(const le of Array.from(W)){const ce=Z(r.dirtyFields,le),Oe=Z(o,le),Ke=Z(Y,le);ce&&!Qe(Oe)?Ve(Y,le,Oe):!ce&&!Qe(Ke)&&de(le,Ke)}}else{if(Pi&&Qe(_))for(const W of a.mount){const le=Z(n,W);if(le&&le._f){const ce=Array.isArray(le._f.refs)?le._f.refs[0]:le._f.ref;if(oi(ce)){const Oe=ce.closest("form");if(Oe){Oe.reset();break}}}}if(E.keepFieldsRef)for(const W of a.mount)de(W,Z(Y,W));else n={}}if(t.shouldUnregister){if(o=E.keepDefaultValues?Xe(s):{},E.keepFieldsRef)for(const W of a.mount)Ve(o,W,Z(Y,W))}else o=Xe(Y);m.array.next({values:{...Y}}),m.state.next({values:{...Y}})}a={mount:E.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!f.isValid||!!E.keepIsValid||!!E.keepDirtyValues||!t.shouldUnregister&&!ht(Y),i.watch=!!t.shouldUnregister,i.keepIsValid=!!E.keepIsValid,i.action=!1,E.keepErrors||(r.errors={}),m.state.next({submitCount:E.keepSubmitCount?r.submitCount:0,isDirty:H?!1:E.keepDirty?r.isDirty:E.keepValues?U():!!(E.keepDefaultValues&&!Vt(_,s)),isSubmitted:E.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:H?{}:E.keepDirtyValues?E.keepDefaultValues&&o?Jr(s,o):r.dirtyFields:E.keepDefaultValues&&_?Jr(s,_):E.keepDirty?r.dirtyFields:{},touchedFields:E.keepTouched?r.touchedFields:{},errors:E.keepErrors?r.errors:{},isSubmitSuccessful:E.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},We=(_,E)=>$e(kt(_)?_(o):_,{...t.resetOptions,...E}),tt=(_,E={})=>{const I=Z(n,_),z=I&&I._f;if(z){const H=z.refs?z.refs[0]:z.ref;H.focus&&setTimeout(()=>{H.focus(),E.shouldSelect&&kt(H.select)&&H.select()})}},Kr=_=>{r={...r,..._}},Yr={control:{register:he,unregister:Ae,getFieldState:$,handleSubmit:qe,setError:ie,_subscribe:fe,_runSchema:P,_updateIsValidating:y,_focusError:Q,_getWatch:re,_getDirty:U,_setValid:v,_setFieldArray:S,_setDisabledField:J,_setErrors:w,_getFieldArray:G,_reset:$e,_resetDefaultValues:()=>kt(t.defaultValues)&&t.defaultValues().then(_=>{We(_,t.resetOptions),m.state.next({isLoading:!1})}),_removeUnmounted:R,_disableForm:Ce,_subjects:m,_proxyFormState:f,get _fields(){return n},get _formValues(){return o},get _state(){return i},set _state(_){i=_},get _defaultValues(){return s},get _names(){return a},set _names(_){a=_},get _formState(){return r},get _options(){return t},set _options(_){t={...t,..._}}},subscribe:ge,trigger:q,register:he,handleSubmit:qe,watch:xe,setValue:de,setValues:oe,getValues:M,reset:We,resetField:et,resetDefaultValues:(_,E={})=>{if(s=Xe(_),!E.keepDirty){const I=Jr(s,o);r.dirtyFields=I,r.isDirty=!ht(I)}E.keepIsValid||v(),m.state.next({...r,defaultValues:s})},clearErrors:ne,unregister:Ae,setError:ie,setFocus:tt,getFieldState:$};return{...Yr,formControl:Yr}}function hj(e={}){const t=g.useRef(void 0),r=g.useRef(void 0),n=g.useRef(e.formControl),[s,o]=g.useState(()=>({...Xe(Hp),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:s},e.defaultValues&&!kt(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:a,...c}=fj(e);t.current={...c,formState:s}}const i=t.current.control;return i._options=e,Jl(()=>{const a=i._subscribe({formState:i._proxyFormState,callback:()=>o({...i._formState,defaultValues:i._defaultValues}),reRenderRoot:!0});return o(c=>({...c,isReady:!0})),i._formState.isReady=!0,a},[i]),g.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),g.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),g.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),g.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),g.useEffect(()=>{if(i._proxyFormState.isDirty){const a=i._getDirty();a!==s.isDirty&&i._subjects.state.next({isDirty:a})}},[i,s.isDirty]),g.useEffect(()=>{var a;e.values&&!Vt(e.values,r.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),!((a=i._options.resetOptions)===null||a===void 0)&&a.keepIsValid||i._setValid(),r.current=e.values,o(c=>({...c}))):i._resetDefaultValues()},[i,e.values]),g.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=g.useMemo(()=>Fp(s,i),[i,s]),t.current}function pj(e,t,r){const n=e??[],s=new Set(n.map(d=>d.type).filter(Boolean)),o=(t??[]).filter(d=>!s.has(d)),{data:i}=es({queryKey:["framework-search",o.sort().join(","),r],queryFn:()=>bT({type:o,systemDefault:"Yes"}),enabled:o.length>0,staleTime:600*1e3}),a=t&&t.length?n.filter(d=>d.type&&t.includes(d.type)):n,c=[...(i??[]).map(d=>({label:d.name,value:d.identifier})),...a.map(d=>({label:d.name,value:d.identifier}))],u=new Set;return c.filter(d=>u.has(d.value)?!1:(u.add(d.value),!0))}async function Qp(e){var r,n;return(n=(r=(await Fe.get(`/action/channel/v1/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.channel}function mj(e){var r,n,s,o,i,a,c;const t=es({queryKey:["channel",e],queryFn:()=>Qp(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:(s=t.data)==null?void 0:s.frameworks,collectionAdditionalCategories:(o=t.data)==null?void 0:o.collectionAdditionalCategories,contentAdditionalCategories:(i=t.data)==null?void 0:i.contentAdditionalCategories,defaultLicense:(a=t.data)==null?void 0:a.defaultLicense,defaultFramework:(c=t.data)==null?void 0:c.defaultFramework,isLoading:t.isLoading}}function gj(e){const{data:t}=es({queryKey:["user","read",e],enabled:!!e,staleTime:1/0,queryFn:()=>$T(e)});return t&&([t.firstName,t.lastName].filter(Boolean).join(" ").trim()||t.userName)||void 0}const Wp=[{label:"Strict",value:"strict"},{label:"Adaptive",value:"adaptive"},{label:"Prior learning",value:"priorLearning"}],vj={"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."}},yj=new Set(["review","read","sourcingreview","orgreview"]),wo={"First Section":"details","Second Section":"details","Third Section":"details","Organisation Framework Terms":"details","Target Framework Terms":"audience","Fourth Section":"licensing","Sixth Section":"licensing"},bj={Categorisation:"Second Section","Basic Information":"First Section","Licensing & Attribution":"Fourth Section",Curriculum:"Organisation Framework Terms","Target Audience":"Target Framework Terms"},Cj={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"},ho={board:"board",boardIds:"board",medium:"medium",gradeLevel:"gradeLevel",subject:"subject",subjectIds:"subject",topicsIds:"topic",topic:"topic",targetBoardIds:"board",targetMediumIds:"medium",targetGradeLevelIds:"gradeLevel",targetSubjectIds:"subject"},nc=new Set(["targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds"]);function Gp(e,t,r,n,s={}){if(!(e!=null&&e.length))return _d(Bj(t,n,r,s),r,t,n,s);const o=new Map;for(const c of e){const u=c.code;u&&!o.has(u)&&o.set(u,c)}const i=new Set,a=e.filter(c=>{var d;if(n&&(c.code==="dialCode"||c.code==="dialcode")||((d=s.profile)==null?void 0:d.key)==="learningPath"&&nc.has(c.code)||c.visible===!1)return!1;const u=c.code;return i.has(u)?!1:(i.add(u),!0)}).map(c=>{const u=c.code??"",d=Aj(c),f=kj(c,r,t,o,s),p=t[u],m=xj(u,Kp(p,d),d,t,s),C={code:u,label:c.label??u,inputType:d,required:!!(c.required===!0||Array.isArray(c.validations)&&c.validations.some(h=>h.type==="required")),editable:Sj(u,c.editable!==!1,s),placeholder:c.placeholder,maxLength:c.maxLength,options:Tj(f,m,d,r),depends:c.depends,tab:Ej(c),section:c.section,sourceCategory:c.sourceCategory,defaultValue:c.defaultValue??c.default,currentValue:m};if(u==="dialcodes"){const h=t.dialcodeRequired==="Yes";return{...C,required:h,visible:h}}return C});return _d(a,r,t,n,s)}function _d(e,t,r,n,s){var o;return((o=s.profile)==null?void 0:o.key)==="learningPath"?Mj(e,t,r,n):Fj(e,t,r,n)}function Sj(e,t,r){var o;const n=r.editorMode??"edit";if(!yj.has(n))return t!==!1;const s=(o=r.editableFields)==null?void 0:o[n];return!!(s&&s.includes(e))}function xj(e,t,r,n,s){const o=t==null||t===""||Array.isArray(t)&&t.length===0;switch(e){case"license":return o?s.defaultLicense??"":t;case"copyright":return o&&s.channelName?s.channelName:t;case"copyrightYear":return o?String(new Date().getFullYear()):t;case"author":case"creator":return o&&s.userFullName?s.userFullName:t;case"instructions":{const i=n.instructions;return i&&typeof i=="object"&&!Array.isArray(i)?i.default??"":typeof t=="object"&&t!==null?"":t}case"maxTime":case"warningTime":{if(!o)return t;const i=n.timeLimits,a=i==null?void 0:i[e];return a!=null&&a!==""?_j(Number(a)):t}default:return t}}function _j(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),s=o=>String(o).padStart(2,"0");return n>0?`${s(n)}:${s(r)}:${s(t)}`:`${s(r)}:${s(t)}`}function wj(e){var n,s,o;const t=new Map,r=i=>i==null?void 0:i.forEach(a=>{a.identifier&&t.set(a.identifier,a.name),a.name&&t.set(a.name,a.name)});return(s=(n=e.organisationFramework)==null?void 0:n.categories)==null||s.forEach(i=>r(i.terms)),(o=e.targetFrameworks)==null||o.forEach(i=>{var a;return(a=i.categories)==null?void 0:a.forEach(c=>r(c.terms))}),t}function Tj(e,t,r,n){if(r!=="select"&&r!=="multiselect"&&r!=="radio")return e;const s=Array.isArray(t)?t:t!=null&&t!==""?[t]:[];if(!s.length)return e;const o=e?[...e]:[],i=new Set(o.map(c=>c.value)),a=wj(n);for(const c of s){const u=String(c);i.has(u)||(o.push({label:a.get(u)??u,value:u}),i.add(u))}return o}function Ej(e){const t=e.section;if(t){if(wo[t])return wo[t];const n=bj[t];if(n&&wo[n])return wo[n]}const r=e.code??"";return Cj[r]??"details"}function Kp(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 Aj(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 kj(e,t,r,n,s){var u;const o=e.code??"";if(((u=s.profile)==null?void 0:u.key)==="learningPath"&&o==="policy")return Wp;if(o==="maxQuestions"){const d=s.childCount??0;if(d>0)return Array.from({length:d},(f,p)=>({label:String(p+1),value:String(p+1)}))}const i=e.range;if(Array.isArray(i)&&i.length)return typeof i[0]=="string"?i.map(d=>({label:d,value:d})):i.map(d=>({label:d.name,value:d.identifier}));const a=e.enum;if(a!=null&&a.length)return a.map(d=>({label:d,value:d}));if(o==="framework")return t.orgFrameworks;if(o==="additionalCategories"){const f=(s.objectType??"")==="QuestionSet"?s.contentAdditionalCategories??s.collectionAdditionalCategories:s.collectionAdditionalCategories??s.contentAdditionalCategories,p=(f&&f.length?f:s.contextAdditionalCategories)??t.channelAdditionalCategories;return p!=null&&p.length?jj(p).map(m=>({label:m,value:m})):void 0}const c=e.sourceCategory??ho[o];if(c)return Yp(o,c,e,t,r,n)}function Ij(e,t){return nc.has(e)||t.output==="identifier"||typeof t.section=="string"&&t.section.includes("Target")}function Lj(e,t){return nc.has(e)||typeof t.section=="string"&&t.section.includes("Target")}function ga(e,t,r){var o,i,a,c,u;const n=(i=(o=e.organisationFramework)==null?void 0:o.categories)==null?void 0:i.find(d=>d.code===t),s=(u=(c=(a=e.targetFrameworks)==null?void 0:a[0])==null?void 0:c.categories)==null?void 0:u.find(d=>d.code===t);return r?(s==null?void 0:s.terms)??(n==null?void 0:n.terms)??[]:(n==null?void 0:n.terms)??(s==null?void 0:s.terms)??[]}function Dj(e){const t=new Set,r=[];for(const n of e){const s=n.identifier??n.name;s&&!t.has(s)&&(t.add(s),r.push(n))}return r}function jj(e){return Array.from(new Set(e))}function Nj(e){return Array.isArray(e)?e:e!=null&&e!==""?[e]:[]}function Yp(e,t,r,n,s,o){const i=Ij(e,r),a=Lj(e,r),c=h=>({label:h.name,value:i?h.identifier:h.name}),u=r.depends;if(!(u!=null&&u.length))return ga(n,t,a).map(c);const d=u.flatMap(h=>Nj(s[h])).map(String);if(!d.length)return[];const f=[];for(const h of u){const v=o.get(h),y=(v==null?void 0:v.sourceCategory)??ho[h]??h;f.push(...ga(n,y,a))}const m=f.filter(h=>d.includes(String(h.name))||d.includes(String(h.identifier))||d.includes(String(h.code))).flatMap(h=>h.associations??[]).filter(h=>String(h.category??"").toLowerCase()===t.toLowerCase()),C=Dj(m);return C.length?C.map(c):ga(n,t,a).map(c)}function _s(e,t){const r=ho[e];if(r)return Yp(e,r,{},t,{},new Map)}function Ge(e,t,r){return Kp(e[t],r)}const Oj=["board","medium","gradeLevel","subject"];function Pj(e){var r;const t=((r=e.organisationFramework)==null?void 0:r.categories)??[];return t.length?t.some(n=>Oj.includes(n.code)):!0}function Rj(e,t){var r,n,s;return!!((n=(r=e.organisationFramework)==null?void 0:r.categories)!=null&&n.some(o=>o.code===t)||(s=e.targetFrameworks)!=null&&s.some(o=>{var i;return(i=o.categories)==null?void 0:i.some(a=>a.code===t)}))}function Fj(e,t,r,n){var c;if(!n||Pj(t))return e;const s=e.filter(u=>{const d=u.sourceCategory??ho[u.code];return!d||Rj(t,d)}),o=new Set(s.map(u=>u.code)),i=[];for(const u of((c=t.organisationFramework)==null?void 0:c.categories)??[])o.has(u.code)||i.push({code:u.code,label:u.name,inputType:"multiselect",editable:!0,tab:"details",section:"Organisation Framework Terms",options:(u.terms??[]).map(d=>({label:d.name,value:d.name})),currentValue:Ge(r,u.code,"multiselect")});if(!i.length)return s;const a=s.findIndex(u=>u.code==="framework");return a>=0?[...s.slice(0,a+1),...i,...s.slice(a+1)]:[...s,...i]}const va="Organisation Framework Terms";function Mj(e,t,r,n){var m,C;if(!n)return e;const s=[...((m=t.organisationFramework)==null?void 0:m.categories)??[]].sort((h,v)=>(h.index??1/0)-(v.index??1/0));if(!s.length)return e;const o=(C=Ph(s))==null?void 0:C.code,i=h=>h.sourceCategory??ho[h.code];let c=e.filter(h=>{const v=i(h);return v?v!==o&&s.some(y=>y.code===v):!0}).map(h=>i(h)?{...h,section:va,required:!0,inputType:"select",currentValue:Ge(r,h.code,"select")}:h),u=c.findIndex(h=>h.code==="framework");if(u===-1){const h={code:"framework",label:"Curriculum",inputType:"select",required:!0,editable:!0,tab:"details",section:va,options:t.orgFrameworks,currentValue:Ge(r,"framework","select")},v=c.findIndex(y=>!!i(y));u=v>=0?v:c.length,c=[...c.slice(0,u),h,...c.slice(u)]}if(!!!Ge(r,"framework","select"))return c.filter(h=>h.code==="framework"||!i(h));const f=new Set(c.map(h=>h.code)),p=s.filter(h=>h.code!==o&&!f.has(h.code)).map(h=>({code:h.code,label:h.name,inputType:"select",required:!0,editable:!0,tab:"details",section:va,options:(h.terms??[]).map(v=>({label:v.name,value:v.name})),currentValue:Ge(r,h.code,"select")}));return p.length?[...c.slice(0,u+1),...p,...c.slice(u+1)]:c}function Bj(e,t,r,n={}){var o,i;const s=[{code:"name",label:"Title",inputType:"text",required:!0,editable:!0,tab:"details",section:"First Section",maxLength:200,currentValue:Ge(e,"name","text")},{code:"description",label:"Description",inputType:"textarea",editable:!0,tab:"details",section:"First Section",maxLength:2e3,currentValue:Ge(e,"description","textarea")},{code:"keywords",label:"Keywords",inputType:"chips",editable:!0,tab:"details",section:"First Section",currentValue:Ge(e,"keywords","chips")}];return t?((o=n.profile)==null?void 0:o.key)==="learningPath"?(s.push({code:"framework",label:"Curriculum",inputType:"select",required:!0,editable:!0,tab:"details",section:"Organisation Framework Terms",options:r.orgFrameworks,currentValue:Ge(e,"framework","select")},{code:"policy",label:"Consumption policy",inputType:"select",required:!0,editable:!0,tab:"details",section:"Consumption policy",options:Wp,currentValue:Ge(e,"policy","select")||"strict"}),s):(s.push({code:"primaryCategory",label:"Category",inputType:"select",editable:!1,tab:"details",section:"Second Section",currentValue:Ge(e,"primaryCategory","select")},{code:"additionalCategories",label:"Additional Category",inputType:"multiselect",editable:!0,tab:"details",section:"Second Section",currentValue:Ge(e,"additionalCategories","multiselect"),options:(i=r.channelAdditionalCategories)==null?void 0:i.map(a=>({label:a,value:a}))},{code:"framework",label:"Course Type",inputType:"select",required:!0,editable:!0,tab:"details",section:"Organisation Framework Terms",options:r.orgFrameworks,currentValue:Ge(e,"framework","select")},{code:"subjectIds",label:"Subjects covered",inputType:"multiselect",required:!0,editable:!0,tab:"details",section:"Organisation Framework Terms",options:_s("subjectIds",r),currentValue:Ge(e,"subjectIds","multiselect")}),s.push({code:"audience",label:"Audience Type",inputType:"multiselect",editable:!0,tab:"audience",section:"Target Framework Terms",currentValue:Ge(e,"audience","multiselect")},{code:"targetBoardIds",label:"Board/Syllabus of the audience",inputType:"select",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",options:_s("targetBoardIds",r),currentValue:Ge(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:_s("targetMediumIds",r),currentValue:Ge(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:_s("targetGradeLevelIds",r),currentValue:Ge(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:_s("targetSubjectIds",r),currentValue:Ge(e,"targetSubjectIds","multiselect")}),s.push({code:"creator",label:"Author",inputType:"text",editable:!0,tab:"licensing",section:"Fourth Section",currentValue:Ge(e,"creator","text")},{code:"attributions",label:"Attributions",inputType:"text",editable:!0,tab:"licensing",section:"Fourth Section",currentValue:Ge(e,"attributions","text")},{code:"copyright",label:"Copyright",inputType:"text",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:Ge(e,"copyright","text")},{code:"copyrightYear",label:"Copyright Year",inputType:"text",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:Ge(e,"copyrightYear","text")},{code:"license",label:"License",inputType:"select",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:Ge(e,"license","select")}),s):s}const qj=["allowECM","levels","setPeriod","instances"];function Zp(e){const t={};return e.forEach((r,n)=>{t[`L${n+1}`]={label:r}}),t}function $j(e,t={}){const r={...e};for(const o of qj)delete r[o];const n=e.levels;Array.isArray(n)&&n.length&&(r.outcomeDeclaration={levels:Zp(n)});const s=e.instances;return s!=null&&s!==""&&(r.instances={label:s}),t.isReview&&(r.name===void 0||r.name===null||r.name==="")&&t.nodeTitle&&(r.name=t.nodeTitle),r}function Uj(e,t){return e==="allowECM"||e==="setPeriod"?null:e==="levels"?{outcomeDeclaration:{levels:Array.isArray(t)?Zp(t):{}}}:e==="instances"?{instances:t!=null&&t!==""?{label:t}:""}:{[e]:t}}function zj(e,t){const{watch:r,setValue:n}=e,s=g.useRef(!1);g.useEffect(()=>{const o=r((i,{name:a})=>{var c;if(!(!a||s.current)){s.current=!0;try{const u=new Set([a]);let d=!0;for(;d;){d=!1;for(const f of t)u.has(f.code)||(c=f.depends)!=null&&c.some(p=>u.has(p))&&(n(f.code,f.inputType==="multiselect"||f.inputType==="chips"?[]:"",{shouldDirty:!0}),u.add(f.code),d=!0)}}finally{s.current=!1}}});return()=>o.unsubscribe()},[r,n,t])}const Vj="_section_ylgu8_1",Hj="_header_ylgu8_11",Qj="_title_ylgu8_17",Wj="_description_ylgu8_24",Gj="_divider_ylgu8_30",Kj="_fields_ylgu8_36",Nn={section:Vj,header:Hj,title:Qj,description:Wj,divider:Gj,fields:Kj},Yj=({title:e,description:t,children:r})=>l.jsxs("div",{className:Nn.section,children:[l.jsxs("div",{className:Nn.header,children:[l.jsx("h3",{className:Nn.title,children:e}),t&&l.jsx("p",{className:Nn.description,children:t})]}),l.jsx("hr",{className:Nn.divider}),l.jsx("div",{className:Nn.fields,children:r})]}),Zj="_field_1s288_1",Xj="_fullWidth_1s288_7",Jj="_label_1s288_11",eN="_required_1s288_19",tN="_input_1s288_24",rN="_textarea_1s288_45",nN="_inputError_1s288_50",sN="_error_1s288_54",oN="_selectBtn_1s288_59",iN="_selectOpen_1s288_83",aN="_placeholder_1s288_87",lN="_selectedVal_1s288_91",cN="_chevronUp_1s288_95",uN="_dropdown_1s288_100",dN="_option_1s288_116",fN="_optionSelected_1s288_134",hN="_noOpts_1s288_139",pN="_chipGroup_1s288_146",mN="_chipInput_1s288_158",gN="_addChipBtn_1s288_167",vN="_radioGroup_1s288_184",yN="_radioLabel_1s288_191",bN="_iconWrap_1s288_199",CN="_iconPreview_1s288_214",SN="_iconPlaceholder_1s288_220",xN="_removeIconBtn_1s288_233",_N="_tagChip_1s288_252",wN="_tagChipRemove_1s288_264",TN="_nestedSelectRow_1s288_278",EN="_dialcodeRow_1s288_287",AN="_validateBtn_1s288_293",kN="_dialcodeValid_1s288_315",IN="_dialcodeSpinner_1s288_325",B={field:Zj,fullWidth:Xj,label:Jj,required:eN,input:tN,textarea:rN,inputError:nN,error:sN,selectBtn:oN,selectOpen:iN,placeholder:aN,selectedVal:lN,chevronUp:cN,dropdown:uN,option:dN,optionSelected:fN,noOpts:hN,chipGroup:pN,chipInput:mN,addChipBtn:gN,radioGroup:vN,radioLabel:yN,iconWrap:bN,iconPreview:CN,iconPlaceholder:SN,removeIconBtn:xN,tagChip:_N,tagChipRemove:wN,nestedSelectRow:TN,dialcodeRow:EN,validateBtn:AN,dialcodeValid:kN,dialcodeSpinner:IN},wd=({name:e,label:t,required:r,disabled:n,multiline:s,maxLength:o,placeholder:i})=>{const a=ae(),{register:c,formState:{errors:u}}=er(),d=u[e],f={required:r?a.textField.requiredError.replace("{field}",t):!1,maxLength:o?{value:o,message:a.textField.maxLengthError.replace("{max}",String(o))}:void 0};return l.jsxs("div",{className:[B.field,s?B.fullWidth:""].join(" "),children:[l.jsxs("label",{className:B.label,htmlFor:e,children:[t,r&&l.jsx("span",{className:B.required,children:"*"})]}),s?l.jsx("textarea",{id:e,className:[B.input,B.textarea,d?B.inputError:""].join(" "),disabled:n,placeholder:i,rows:3,...c(e,f)}):l.jsx("input",{id:e,type:"text",className:[B.input,d?B.inputError:""].join(" "),disabled:n,placeholder:i,...c(e,f)}),d&&l.jsx("span",{className:B.error,children:String(d.message)})]})},LN=({name:e,label:t,options:r,required:n,disabled:s})=>{var v;const o=ae(),[i,a]=g.useState(!1),c=g.useRef(null),{register:u,watch:d,setValue:f,formState:{errors:p}}=er(),m=d(e),C=((v=r.find(y=>y.value===m))==null?void 0:v.label)??o.selectField.selectPlaceholder,h=p[e];return g.useEffect(()=>{if(!i)return;const y=b=>{var S;(S=c.current)!=null&&S.contains(b.target)||a(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[i]),l.jsxs("div",{className:B.field,ref:c,style:{position:"relative"},children:[l.jsxs("label",{className:B.label,children:[t,n&&l.jsx("span",{className:B.required,children:"*"})]}),l.jsx("input",{type:"hidden",...u(e,{required:n?o.selectField.requiredError.replace("{field}",t):!1})}),l.jsxs("button",{type:"button",disabled:s,className:[B.selectBtn,h?B.inputError:"",i?B.selectOpen:""].join(" "),onClick:()=>a(y=>!y),children:[l.jsx("span",{className:m?B.selectedVal:B.placeholder,children:C}),l.jsx(Sn,{size:14,className:i?B.chevronUp:""})]}),i&&l.jsxs("div",{className:B.dropdown,children:[r.map(y=>l.jsxs("button",{type:"button",className:[B.option,m===y.value?B.optionSelected:""].join(" "),onClick:()=>{f(e,y.value,{shouldDirty:!0,shouldValidate:!0}),a(!1)},children:[l.jsx("span",{children:y.label}),m===y.value&&l.jsx(Cn,{size:13})]},y.value)),!r.length&&l.jsx("span",{className:B.noOpts,children:o.selectField.noOptionsMessage})]}),h&&l.jsx("span",{className:B.error,children:String(h.message)})]})},DN=({name:e,label:t,options:r,required:n,disabled:s})=>{const o=ae(),[i,a]=g.useState(!1),c=g.useRef(null),{register:u,watch:d,setValue:f,formState:{errors:p}}=er(),m=d(e)??[],C=p[e],h=m.length?`${m.length} ${o.multiSelectField.selectedCountSuffix}`:o.multiSelectField.selectPlaceholder;g.useEffect(()=>{if(!i)return;const y=b=>{var S;(S=c.current)!=null&&S.contains(b.target)||a(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[i]);const v=y=>{const b=m.includes(y)?m.filter(S=>S!==y):[...m,y];f(e,b,{shouldDirty:!0,shouldValidate:!0})};return l.jsxs("div",{className:B.field,ref:c,style:{position:"relative"},children:[l.jsxs("label",{className:B.label,children:[t,n&&l.jsx("span",{className:B.required,children:"*"})]}),l.jsx("input",{type:"hidden",...u(e,{required:n?o.multiSelectField.requiredError.replace("{field}",t):!1})}),l.jsxs("button",{type:"button",disabled:s,className:[B.selectBtn,C?B.inputError:"",i?B.selectOpen:""].join(" "),onClick:()=>a(y=>!y),children:[l.jsx("span",{className:m.length?B.selectedVal:B.placeholder,children:h}),l.jsx(Sn,{size:14,className:i?B.chevronUp:""})]}),i&&l.jsxs("div",{className:B.dropdown,children:[r.map(y=>l.jsxs("button",{type:"button",className:[B.option,m.includes(y.value)?B.optionSelected:""].join(" "),onClick:()=>v(y.value),children:[l.jsx(Cn,{size:13,style:{opacity:m.includes(y.value)?1:0}}),l.jsx("span",{children:y.label})]},y.value)),!r.length&&l.jsx("span",{className:B.noOpts,children:o.multiSelectField.noOptionsMessage})]}),C&&l.jsx("span",{className:B.error,children:String(C.message)})]})},jN=({name:e,label:t,required:r,disabled:n,placeholder:s})=>{const o=ae(),i=s??o.chipGroupField.addPlaceholder,[a,c]=g.useState(""),[u,d]=g.useState(!1),f=g.useRef(null),{watch:p,setValue:m,formState:{errors:C}}=er(),h=p(e)??[],v=C[e],y=()=>{const S=a.trim();S&&!h.includes(S)&&m(e,[...h,S],{shouldDirty:!0}),c(""),d(!1)},b=S=>m(e,h.filter(x=>x!==S),{shouldDirty:!0});return l.jsxs("div",{className:[B.field,B.fullWidth].join(" "),children:[l.jsxs("label",{className:B.label,children:[t,r&&l.jsx("span",{className:B.required,children:"*"})]}),l.jsxs("div",{className:B.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:()=>b(S),"aria-label":`Remove ${S}`,children:"×"})]},S)),!n&&(u?l.jsx("input",{ref:f,autoFocus:!0,className:B.chipInput,value:a,onChange:S=>c(S.target.value),onKeyDown:S=>{S.key==="Enter"&&(S.preventDefault(),y()),S.key==="Escape"&&(c(""),d(!1))},onBlur:y,placeholder:i}):l.jsxs("button",{type:"button",className:B.addChipBtn,onClick:()=>{d(!0),setTimeout(()=>{var S;return(S=f.current)==null?void 0:S.focus()},50)},children:[l.jsx(kr,{size:12})," ",o.chipGroupField.addButtonLabel]}))]}),v&&l.jsx("span",{className:B.error,children:String(v.message)})]})},NN=({name:e,label:t,options:r,required:n,disabled:s})=>{const o=ae(),{register:i,formState:{errors:a}}=er(),c=a[e];return l.jsxs("div",{className:B.field,children:[l.jsxs("label",{className:B.label,children:[t,n&&l.jsx("span",{className:B.required,children:"*"})]}),l.jsx("div",{className:B.radioGroup,children:r.map(u=>l.jsxs("label",{className:B.radioLabel,children:[l.jsx("input",{type:"radio",value:u.value,disabled:s,...i(e,{required:n?o.radioField.requiredError.replace("{field}",t):!1})}),u.label]},u.value))}),c&&l.jsx("span",{className:B.error,children:String(c.message)})]})};async function ON(e,t,r,n){var i,a;const o=(a=(i=(await Fe.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:i.result)==null?void 0:a.node_id;if(!o)throw new Error("Asset creation failed: no node_id returned");return o}async function PN(e,t){var s,o;const n=(o=(s=(await Fe.post(`/action/content/v3/upload/url/${e}`,{request:{content:{fileName:t}}})).data)==null?void 0:s.result)==null?void 0:o.pre_signed_url;if(!n)throw new Error("Pre-signed URL fetch failed");return n}async function RN(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 FN(e,t,r){var i,a;const n=new FormData;n.append("fileUrl",t),n.append("mimeType",r);const o=(a=(i=(await Fe.post(`/action/asset/v1/upload/${e}`,n,{params:{enctype:"multipart/form-data",processData:!1,contentType:!1,cache:!1}})).data)==null?void 0:i.result)==null?void 0:a.content_url;if(!o)throw new Error("Asset finalize failed: no content_url returned");return o}const MN="_overlay_ga6eh_1",BN="_modal_ga6eh_12",qN="_header_ga6eh_24",$N="_title_ga6eh_33",UN="_closeBtn_ga6eh_39",zN="_tabs_ga6eh_57",VN="_tab_ga6eh_57",HN="_activeTab_ga6eh_83",QN="_body_ga6eh_88",WN="_searchWrap_ga6eh_99",GN="_searchIcon_ga6eh_104",KN="_searchInput_ga6eh_113",YN="_grid_ga6eh_132",ZN="_imgCell_ga6eh_148",XN="_imgCellSelected_ga6eh_166",JN="_thumb_ga6eh_171",eO="_noThumb_ga6eh_177",tO="_checkBadge_ga6eh_183",rO="_loadMoreBtn_ga6eh_198",nO="_loadingRow_ga6eh_220",sO="_empty_ga6eh_230",oO="_spinner_ga6eh_237",iO="_uploadArea_ga6eh_247",aO="_dropZone_ga6eh_256",lO="_uploadIcon_ga6eh_277",cO="_dropText_ga6eh_281",uO="_dropSubtext_ga6eh_288",dO="_uploadPreview_ga6eh_294",fO="_hiddenInput_ga6eh_301",hO="_fileName_ga6eh_305",pO="_errorText_ga6eh_311",mO="_footer_ga6eh_318",gO="_cancelBtn_ga6eh_328",vO="_confirmBtn_ga6eh_345",Te={overlay:MN,modal:BN,header:qN,title:$N,closeBtn:UN,tabs:zN,tab:VN,activeTab:HN,body:QN,searchWrap:WN,searchIcon:GN,searchInput:KN,grid:YN,imgCell:ZN,imgCellSelected:XN,thumb:JN,noThumb:eO,checkBadge:tO,loadMoreBtn:rO,loadingRow:nO,empty:sO,spinner:oO,uploadArea:iO,dropZone:aO,uploadIcon:lO,dropText:cO,dropSubtext:uO,uploadPreview:dO,hiddenInput:fO,fileName:hO,errorText:pO,footer:mO,cancelBtn:gO,confirmBtn:vO},Td=18,Xp=({nodeId:e,currentValue:t,onSelect:r,onClose:n})=>{const s=ae(),[o,i]=g.useState("my"),[a,c]=g.useState(""),[u,d]=g.useState([]),[f,p]=g.useState(0),[m,C]=g.useState(!1),[h,v]=g.useState(null),[y,b]=g.useState(0),[S,x]=g.useState(null),[w,T]=g.useState(""),[L,A]=g.useState(!1),[O,P]=g.useState(""),j=g.useRef(null),N=X(q=>{var M,$;return(($=(M=q.editorConfig)==null?void 0:M.context)==null?void 0:$.channel)??""}),F=X(q=>{var M,$;return(($=(M=q.editorConfig)==null?void 0:M.context)==null?void 0:$.uid)??""}),R=X(q=>{var M,$,ne;return((ne=($=(M=q.editorConfig)==null?void 0:M.context)==null?void 0:$.cloudStorage)==null?void 0:ne.presigned_headers)??{}}),U=X(q=>{var M,$,ne;return((ne=($=(M=q.editorConfig)==null?void 0:M.config)==null?void 0:$.assetConfig)==null?void 0:ne.size)??1*1024*1024}),re=X(q=>{var M,$,ne;return((ne=($=(M=q.editorConfig)==null?void 0:M.config)==null?void 0:$.assetConfig)==null?void 0:ne.accepted)??"image/png,image/jpeg"}),G=g.useCallback(async(q,M,$=!1)=>{var ne;C(!0);try{const ie={status:["Live"],mediaType:["image"],mimeType:["image/png","image/jpeg","image/jpg","image/gif","image/svg+xml"]};o==="my"&&F&&(ie.createdBy=F),N&&(ie.channel=N);const fe=((ne=(await Fe.post("/action/composite/v3/search",{request:{filters:ie,query:q,limit:Td,offset:M,sort_by:{createdOn:"desc"},fields:["identifier","name","appIcon","artifactUrl","downloadUrl"]}},{headers:{"X-Source":"web"}})).data)==null?void 0:ne.result)??{},ge=fe.content??[];p(fe.count??0),d(Ae=>$?[...Ae,...ge]:ge)}catch{}finally{C(!1)}},[o,F,N]);g.useEffect(()=>{o!=="upload"&&(d([]),b(0),G(a,0))},[o]);const pe=g.useRef(),me=q=>{c(q),clearTimeout(pe.current),pe.current=setTimeout(()=>{d([]),b(0),G(q,0)},400)},V=()=>{const q=y+Td;b(q),G(a,q,!0)},de=()=>{const q=(h==null?void 0:h.artifactUrl)??(h==null?void 0:h.appIcon)??(h==null?void 0:h.downloadUrl)??"";q&&r(q)};g.useEffect(()=>()=>{w&&URL.revokeObjectURL(w)},[w]);const oe=q=>{var ne;const M=(ne=q.target.files)==null?void 0:ne[0];if(q.target.value="",!M)return;const $=re.split(",").map(ie=>ie.trim());if(!$.includes(M.type)){const ie=$.map(xe=>xe.replace("image/","").toUpperCase()).join(", ");P(s.appIconPickerModal.invalidFileTypeError.replace("{types}",ie));return}if(M.size>U){const ie=(U/1048576).toFixed(0);P(s.appIconPickerModal.fileTooLargeError.replace("{size}",ie));return}w&&URL.revokeObjectURL(w),x(M),T(URL.createObjectURL(M)),P("")},Se=async()=>{if(S){A(!0),P("");try{const q=await ON(S.name.split(".").slice(0,-1).join(".")||S.name,S.type,F,N),M=await PN(q,S.name);await RN(M,S,R);const $=M.split("?")[0],ne=await FN(q,$,S.type);r(ne)}catch(q){P(q instanceof Error?q.message:s.appIconPickerModal.uploadFailedError)}finally{A(!1)}}},ve=u.length<f;return l.jsx("div",{className:Te.overlay,role:"dialog","aria-modal":"true","aria-label":s.appIconPickerModal.dialogAriaLabel,children:l.jsxs("div",{className:Te.modal,children:[l.jsxs("div",{className:Te.header,children:[l.jsx("span",{className:Te.title,children:s.appIconPickerModal.title}),l.jsx("button",{className:Te.closeBtn,onClick:n,"aria-label":s.appIconPickerModal.closeAriaLabel,children:l.jsx(lr,{size:18})})]}),l.jsxs("div",{className:Te.tabs,role:"tablist",children:[l.jsx("button",{role:"tab","aria-selected":o==="my",className:`${Te.tab} ${o==="my"?Te.activeTab:""}`,onClick:()=>i("my"),children:s.appIconPickerModal.myImagesTab}),l.jsx("button",{role:"tab","aria-selected":o==="all",className:`${Te.tab} ${o==="all"?Te.activeTab:""}`,onClick:()=>i("all"),children:s.appIconPickerModal.allImagesTab}),l.jsxs("button",{role:"tab","aria-selected":o==="upload",className:`${Te.tab} ${o==="upload"?Te.activeTab:""}`,onClick:()=>i("upload"),children:[l.jsx(Ua,{size:13,style:{marginRight:4}}),s.appIconPickerModal.uploadTab]})]}),l.jsx("div",{className:Te.body,children:o!=="upload"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:Te.searchWrap,children:[l.jsx(Jo,{size:14,className:Te.searchIcon}),l.jsx("input",{type:"search",className:Te.searchInput,placeholder:s.appIconPickerModal.searchPlaceholder,value:a,onChange:q=>me(q.target.value)})]}),m&&u.length===0?l.jsxs("div",{className:Te.loadingRow,children:[l.jsx(Do,{size:20,className:Te.spinner}),l.jsx("span",{children:s.appIconPickerModal.loadingText})]}):u.length===0?l.jsx("div",{className:Te.empty,children:s.appIconPickerModal.noImagesFound}):l.jsx("div",{className:Te.grid,children:u.map(q=>{const M=q.appIcon??q.artifactUrl??q.downloadUrl??"",$=(h==null?void 0:h.identifier)===q.identifier;return l.jsxs("button",{type:"button",className:`${Te.imgCell} ${$?Te.imgCellSelected:""}`,onClick:()=>v(q),title:q.name,children:[M?l.jsx("img",{src:M,alt:q.name,className:Te.thumb}):l.jsx("div",{className:Te.noThumb,children:s.appIconPickerModal.noThumbnailText}),$&&l.jsx("div",{className:Te.checkBadge,children:l.jsx(Cn,{size:12})})]},q.identifier)})}),ve&&!m&&l.jsx("button",{className:Te.loadMoreBtn,onClick:V,children:s.appIconPickerModal.loadMoreButton}),m&&u.length>0&&l.jsx("div",{className:Te.loadingRow,children:l.jsx(Do,{size:16,className:Te.spinner})})]}):l.jsxs("div",{className:Te.uploadArea,children:[l.jsx("div",{className:Te.dropZone,onClick:()=>{var q;return(q=j.current)==null?void 0:q.click()},onDragOver:q=>q.preventDefault(),onDrop:q=>{q.preventDefault();const M=q.dataTransfer.files[0];M&&oe({target:{files:[M],value:""}})},children:w?l.jsx("img",{src:w,alt:s.appIconPickerModal.previewAlt,className:Te.uploadPreview}):l.jsxs(l.Fragment,{children:[l.jsx(Ua,{size:32,className:Te.uploadIcon}),l.jsx("p",{className:Te.dropText,children:s.appIconPickerModal.dropZoneText}),l.jsx("p",{className:Te.dropSubtext,children:s.appIconPickerModal.acceptedTypesInfo.replace("{types}",re.split(",").map(q=>q.replace("image/","").toUpperCase()).join(", ")).replace("{size}",(U/(1024*1024)).toFixed(0))})]})}),l.jsx("input",{ref:j,type:"file",accept:re,className:Te.hiddenInput,onChange:oe}),S&&l.jsx("p",{className:Te.fileName,children:S.name}),O&&l.jsx("p",{className:Te.errorText,children:O})]})}),l.jsxs("div",{className:Te.footer,children:[l.jsx("button",{className:Te.cancelBtn,onClick:n,children:s.appIconPickerModal.cancelButton}),o==="upload"?l.jsx("button",{className:Te.confirmBtn,disabled:!S||L,onClick:Se,children:L?l.jsxs(l.Fragment,{children:[l.jsx(Do,{size:14,className:Te.spinner})," ",s.appIconPickerModal.uploadingText]}):s.appIconPickerModal.uploadAndUseButton}):l.jsx("button",{className:Te.confirmBtn,disabled:!h,onClick:de,children:s.appIconPickerModal.useSelectedButton})]})]})})},yO=({name:e,label:t,nodeId:r,required:n,disabled:s})=>{const o=ae(),[i,a]=g.useState(!1),{watch:c,setValue:u,register:d,formState:{errors:f}}=er(),p=c(e),m=f[e],C=v=>{u(e,v,{shouldDirty:!0,shouldValidate:!0}),a(!1)},h=()=>{u(e,"",{shouldDirty:!0,shouldValidate:!0})};return l.jsxs("div",{className:B.field,children:[l.jsxs("label",{className:B.label,children:[t,n&&l.jsx("span",{className:B.required,children:"*"})]}),l.jsx("input",{type:"hidden",...d(e,{required:n?o.appIconField.requiredError.replace("{field}",t):!1})}),l.jsx("div",{className:B.iconWrap,role:"button",tabIndex:s?-1:0,"aria-label":o.appIconField.selectIconAriaLabel,onClick:()=>!s&&a(!0),onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&!s&&a(!0)},children:p?l.jsx("img",{src:p,alt:o.appIconField.iconAlt,className:B.iconPreview}):l.jsxs("div",{className:B.iconPlaceholder,children:[l.jsx(Hf,{size:20}),l.jsx("span",{children:o.appIconField.selectIconLabel})]})}),p&&!s&&l.jsxs("button",{type:"button",className:B.removeIconBtn,onClick:h,"aria-label":o.appIconField.removeIconAriaLabel,children:[l.jsx(ls,{size:13}),l.jsx("span",{children:o.appIconField.removeLabel})]}),m&&l.jsx("span",{className:B.error,children:String(m.message)}),i&&l.jsx(Xp,{nodeId:r,currentValue:p,onSelect:C,onClose:()=>a(!1)})]})},bO=({name:e,label:t,required:r,disabled:n})=>{const s=ae(),{control:o}=er(),{field:i,fieldState:{error:a}}=fo({name:e,control:o,rules:{required:r?s.dateTimeField.requiredError.replace("{field}",t):!1}});return l.jsxs("div",{className:B.field,children:[l.jsxs("label",{className:B.label,htmlFor:e,children:[t,r&&l.jsx("span",{className:B.required,children:"*"})]}),l.jsx("input",{id:e,type:"datetime-local",className:[B.input,a?B.inputError:""].join(" "),disabled:n,value:i.value??"",onChange:i.onChange,onBlur:i.onBlur,ref:i.ref}),a&&l.jsx("span",{className:B.error,children:String(a.message)})]})},CO=({name:e,label:t,required:r,disabled:n})=>{const s=ae(),{control:o}=er(),{field:i,fieldState:{error:a}}=fo({name:e,control:o,rules:{required:r?s.keywordSuggestField.requiredError.replace("{field}",t):!1},defaultValue:[]}),[c,u]=g.useState(""),d=g.useRef(null),f=i.value??[],p=v=>{const y=v.trim();!y||f.includes(y)||i.onChange([...f,y])},m=v=>{i.onChange(f.filter(y=>y!==v))},C=v=>{v.key==="Enter"||v.key===","?(v.preventDefault(),p(c),u("")):v.key==="Backspace"&&c===""&&f.length>0&&m(f[f.length-1])},h=()=>{c.trim()&&(p(c),u("")),i.onBlur()};return l.jsxs("div",{className:[B.field,B.fullWidth].join(" "),children:[l.jsxs("label",{className:B.label,children:[t,r&&l.jsx("span",{className:B.required,children:"*"})]}),l.jsxs("div",{className:[B.chipGroup,a?B.inputError:""].join(" "),onClick:()=>{var v;return!n&&((v=d.current)==null?void 0:v.focus())},style:{cursor:n?"not-allowed":"text"},children:[f.map(v=>l.jsxs("span",{className:B.tagChip,children:[v,!n&&l.jsx("button",{type:"button",className:B.tagChipRemove,onClick:y=>{y.stopPropagation(),m(v)},"aria-label":`Remove ${v}`,children:l.jsx(lr,{size:11})})]},v)),!n&&l.jsx("input",{ref:d,className:B.chipInput,value:c,onChange:v=>u(v.target.value),onKeyDown:C,onBlur:h,placeholder:f.length===0?s.keywordSuggestField.inputPlaceholder:"",style:{flexGrow:1,minWidth:120}})]}),a&&l.jsx("span",{className:B.error,children:String(a.message)})]})},SO=({name:e,label:t,levels:r,required:n,disabled:s})=>{const o=ae(),{control:i}=er(),{field:a,fieldState:{error:c}}=fo({name:e,control:i,rules:{required:n?o.nestedSelectField.requiredError.replace("{field}",t):!1},defaultValue:{}}),u=a.value??{},d=(f,p,m)=>{const C={};for(let h=0;h<p;h++)C[r[h].code]=u[r[h].code]??"";C[f]=m;for(let h=p+1;h<r.length;h++)C[r[h].code]="";a.onChange(C)};return l.jsxs("div",{className:[B.field,B.fullWidth].join(" "),children:[l.jsxs("label",{className:B.label,children:[t,n&&l.jsx("span",{className:B.required,children:"*"})]}),l.jsx("div",{className:B.nestedSelectRow,children:r.map((f,p)=>{const m=p>0&&!u[r[p-1].code];return l.jsxs("div",{className:B.field,style:{flex:1},children:[l.jsx("label",{className:B.label,htmlFor:`${e}_${f.code}`,children:f.label}),l.jsxs("select",{id:`${e}_${f.code}`,className:[B.input,c?B.inputError:""].join(" "),disabled:s||m,value:u[f.code]??"",onChange:C=>d(f.code,p,C.target.value),onBlur:a.onBlur,children:[l.jsx("option",{value:"",children:o.nestedSelectField.selectPlaceholder}),f.options.map(C=>l.jsx("option",{value:C.value,children:C.label},C.value))]})]},f.code)})}),c&&l.jsx("span",{className:B.error,children:String(c.message)})]})},Ed=[{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"}],xO=({name:e,label:t,required:r,disabled:n})=>{const s=ae(),[o,i]=g.useState(!1),a=g.useRef(null),{register:c,watch:u,setValue:d,formState:{errors:f}}=er(),p=u(e),m=Ed.find(v=>v.value===p),C=(m==null?void 0:m.label)??s.licenseSelectField.selectPlaceholder,h=f[e];return g.useEffect(()=>{if(!o)return;const v=y=>{var b;(b=a.current)!=null&&b.contains(y.target)||i(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[o]),l.jsxs("div",{className:B.field,ref:a,style:{position:"relative"},children:[l.jsxs("label",{className:B.label,children:[t,r&&l.jsx("span",{className:B.required,children:"*"})]}),l.jsx("input",{type:"hidden",...c(e,{required:r?s.licenseSelectField.requiredError.replace("{field}",t):!1})}),l.jsxs("button",{type:"button",disabled:n,className:[B.selectBtn,h?B.inputError:"",o?B.selectOpen:""].join(" "),onClick:()=>i(v=>!v),"aria-haspopup":"listbox","aria-expanded":o,children:[l.jsx("span",{className:p?B.selectedVal:B.placeholder,children:C}),l.jsx(Sn,{size:14,className:o?B.chevronUp:""})]}),o&&l.jsx("div",{className:B.dropdown,role:"listbox",children:Ed.map(v=>l.jsxs("button",{type:"button",role:"option","aria-selected":p===v.value,className:[B.option,p===v.value?B.optionSelected:""].join(" "),onClick:()=>{d(e,v.value,{shouldDirty:!0,shouldValidate:!0}),i(!1)},children:[l.jsx("span",{children:v.label}),p===v.value&&l.jsx(Cn,{size:13})]},v.value))}),h&&l.jsx("span",{className:B.error,children:String(h.message)})]})},_O=({name:e,label:t,required:r,disabled:n})=>{const s=ae(),{control:o}=er(),{field:i,fieldState:{error:a}}=fo({name:e,control:o,rules:{required:r?s.dialcodeInputField.requiredError.replace("{field}",t):!1},defaultValue:""}),[c,u]=g.useState("idle"),[d,f]=g.useState(""),p=async()=>{const C=(i.value??"").trim();if(!C){u("invalid"),f(s.dialcodeInputField.enterCodeMessage);return}u("loading"),f("");try{const h=await T1(C),v=h==null?void 0:h.result,y=v==null?void 0:v.dialcodes;Array.isArray(y)&&y.length>0?(u("valid"),f(s.dialcodeInputField.validMessage)):(u("invalid"),f(s.dialcodeInputField.notFoundMessage))}catch{u("invalid"),f(s.dialcodeInputField.validationFailedMessage)}},m=()=>c==="loading"?l.jsx(Do,{size:16,className:B.dialcodeSpinner}):c==="valid"?l.jsx($f,{size:16,color:"var(--sbx-success, #2e7d32)"}):c==="invalid"?l.jsx(ky,{size:16,color:"var(--sbx-error)"}):null;return l.jsxs("div",{className:B.field,children:[l.jsxs("label",{className:B.label,htmlFor:e,children:[t,r&&l.jsx("span",{className:B.required,children:"*"})]}),l.jsxs("div",{className:B.dialcodeRow,children:[l.jsx("input",{id:e,type:"text",className:[B.input,a?B.inputError:""].join(" "),disabled:n,value:i.value??"",onChange:C=>{i.onChange(C),u("idle"),f("")},onBlur:i.onBlur,ref:i.ref,placeholder:s.dialcodeInputField.placeholderExample,style:{flex:1}}),l.jsx("button",{type:"button",className:B.validateBtn,onClick:p,disabled:n||c==="loading","aria-label":s.dialcodeInputField.validateAriaLabel,children:c==="loading"?s.dialcodeInputField.validatingLabel:s.dialcodeInputField.validateButtonLabel}),m()]}),a&&l.jsx("span",{className:B.error,children:String(a.message)}),!a&&d&&l.jsx("span",{className:c==="valid"?B.dialcodeValid:B.error,children:d})]})},wO="_cards_1j7eu_1",TO="_card_1j7eu_1",EO="_cardActive_1j7eu_30",AO="_cardIcon_1j7eu_35",kO="_cardIconPrimary_1j7eu_46",IO="_cardIconHover_1j7eu_50",LO="_radioDot_1j7eu_54",DO="_radioDotActive_1j7eu_65",jO="_cardTitle_1j7eu_70",NO="_cardTitleInk_1j7eu_76",OO="_cardDescription_1j7eu_80",PO="_cardDescriptionCharcoal_1j7eu_86",qt={cards:wO,card:TO,cardActive:EO,cardIcon:AO,cardIconPrimary:kO,cardIconHover:IO,radioDot:LO,radioDotActive:DO,cardTitle:jO,cardTitleInk:NO,cardDescription:OO,cardDescriptionCharcoal:PO},RO=({name:e,label:t,required:r,disabled:n})=>{const s=ae(),{control:o}=er(),i=[{value:"strict",Icon:Qf,iconVariant:qt.cardIconPrimary,title:s.learningPath.policyStrictLabel,titleVariant:"",description:l.jsx(l.Fragment,{children:s.learningPath.policyStrictDescription}),descriptionVariant:""},{value:"adaptive",Icon:Xy,iconVariant:qt.cardIconPrimary,title:s.learningPath.policyAdaptiveLabel,titleVariant:qt.cardTitleInk,description:l.jsxs(l.Fragment,{children:[s.learningPath.policyAdaptiveDescriptionPre,l.jsx("span",{className:B.required,children:"*"}),s.learningPath.policyAdaptiveDescriptionPost]}),descriptionVariant:qt.cardDescriptionCharcoal},{value:"priorLearning",Icon:Hy,iconVariant:qt.cardIconHover,title:s.learningPath.policyPriorLearningLabel,titleVariant:"",description:l.jsx(l.Fragment,{children:s.learningPath.policyPriorLearningDescription}),descriptionVariant:""}];return l.jsxs("div",{className:B.field,children:[l.jsxs("label",{className:B.label,children:[t,r&&l.jsx("span",{className:B.required,children:"*"})]}),l.jsx(ZD,{name:e,control:o,rules:{required:r?s.selectField.requiredError.replace("{field}",t):!1},render:({field:a})=>l.jsx("div",{className:qt.cards,children:i.map(({value:c,Icon:u,iconVariant:d,title:f,titleVariant:p,description:m,descriptionVariant:C})=>{const h=a.value===c;return l.jsxs("button",{type:"button",disabled:n,className:[qt.card,h?qt.cardActive:""].join(" "),onClick:()=>a.onChange(c),children:[l.jsx("span",{className:[qt.cardIcon,d].join(" "),children:l.jsx(u,{size:16})}),l.jsx("span",{className:[qt.radioDot,h?qt.radioDotActive:""].join(" ")}),l.jsx("span",{className:[qt.cardTitle,p].join(" "),children:f}),l.jsx("span",{className:[qt.cardDescription,C].join(" "),children:m})]},c)})})})]})},FO="_form_lktqh_1",MO="_formLp_lktqh_7",BO="_ungrouped_lktqh_12",qO="_ungroupedLp_lktqh_23",$O="_fullWidthField_lktqh_27",UO="_noFields_lktqh_31",On={form:FO,formLp:MO,ungrouped:BO,ungroupedLp:qO,fullWidthField:$O,noFields:UO},zO=({nodeMetadata:e,activeTab:t,isRoot:r,isFolder:n,editorMode:s,onFormValueChange:o,onFormStatusChange:i})=>{var qe,et,$e,We,tt,Kr,_n,ds,Yr;const a=ae(),c=X(_=>_.editorConfig),u=X(_=>_.editorProfile),d=u.key==="learningPath",f=X(_=>_.rootFormConfig),p=X(_=>_.unitFormConfig),m=X(_=>_.categoryMeta),C=X(_=>_.contentFramework),h=X(_=>_.contentTargetFWIds),{organisationFramework:v,targetFrameworks:y,isLoading:b}=ki(C??((qe=c==null?void 0:c.context)==null?void 0:qe.framework),h??((et=c==null?void 0:c.context)==null?void 0:et.targetFWIds)),{frameworks:S,collectionAdditionalCategories:x,contentAdditionalCategories:w,defaultLicense:T,name:L}=mj(($e=c==null?void 0:c.context)==null?void 0:$e.channel),A=gj(((We=c==null?void 0:c.context)==null?void 0:We.userId)??((tt=c==null?void 0:c.context)==null?void 0:tt.uid)),O=pj(S,(Kr=m==null?void 0:m.frameworkMetadata)==null?void 0:Kr.orgFWType,(_n=c==null?void 0:c.context)==null?void 0:_n.channel),P={organisationFramework:v,targetFrameworks:y,orgFrameworks:O,channelAdditionalCategories:x},j=se(_=>_.selectedNodeId),N=se(_=>_.treeData),F=se(_=>_.treeCache),R=j?F[j]??{}:{},U={...e,...R},re=g.useMemo(()=>{var E;if(!j)return 0;const _=[...N];for(;_.length;){const I=_.shift();if(I.id===j)return((E=I.children)==null?void 0:E.length)??0;I.children&&_.push(...I.children)}return 0},[N,j]),G=(c==null?void 0:c.config)??{},pe=(c==null?void 0:c.context)??{},me={editorMode:s,editableFields:G.editableFields,objectType:G.objectType,setDefaultCopyRight:G.setDefaultCopyRight===!0,defaultLicense:pe.defaultLicense??T,contextAdditionalCategories:pe.additionalCategories,userFullName:((ds=pe.user)==null?void 0:ds.fullName)??A,channelName:L,collectionAdditionalCategories:x,contentAdditionalCategories:w,childCount:re,profile:u},V=r?f:p,de=V||(((Yr=c==null?void 0:c.config.hierarchy)==null?void 0:Yr.formConfig)??[]),oe=Gp(de,U,P,r,me),Se=oe.filter(_=>_.tab===t&&_.inputType!=="appIcon"&&_.visible!==!1),ve=hj({mode:"onChange",defaultValues:Object.fromEntries(oe.map(_=>{const E=["multiselect","chips","keywords","tagsinput"],I=["nestedselect"];return E.includes(_.inputType)?[_.code,_.currentValue??_.defaultValue??[]]:I.includes(_.inputType)?[_.code,_.currentValue??_.defaultValue??{}]:[_.code,_.currentValue??_.defaultValue??""]}))});zj(ve,oe);const{updateNode:q}=se(),M=g.useRef(oe);M.current=oe;const $=g.useRef(j);$.current=j;const ne=g.useRef(o);ne.current=o;const ie=g.useRef(i);ie.current=i;const xe=g.useRef(typeof U.shuffle=="boolean"?U.shuffle:void 0),fe=g.useRef(U.name??"");fe.current=U.name??"";const ge=g.useRef(s);ge.current=s;const Ae=ur(),J=g.useRef(Ae==null?void 0:Ae.code);J.current=Ae==null?void 0:Ae.code;const he=["review","read","sourcingreview","orgreview"];g.useEffect(()=>{const _=$.current;if(_){const E=Object.fromEntries(M.current.filter(I=>I.currentValue!==void 0&&I.currentValue!==null).map(I=>[I.code,I.currentValue]));Object.keys(E).length>0&&q(_,E)}ve.trigger().then(()=>{const E=ve.formState.errors,I=M.current,z=Array.from(new Set(Object.keys(E).map(H=>{var Y;return(Y=I.find(W=>W.code===H))==null?void 0:Y.tab}).filter(Boolean)));ie.current(Object.keys(E).length===0,z)})},[]),g.useEffect(()=>{const _=ve.watch((E,{name:I})=>{const z=$.current;if(!z)return;const H=M.current,Y=new Set(H.map(ce=>ce.code));if(I&&Y.has(I)){let ce=ve.getValues(I);if(I==="dialcodes"&&(ce=Array.isArray(ce)?ce:ce?[ce]:[]),I==="shuffle"&&(ce===!0&&xe.current===!1&&ye(a.sparkMetaForm.shuffleEnabledMessage,{icon:l.jsx(Bn,{size:16})}),xe.current=ce),I==="framework"&&r&&typeof ce=="string"&&ce){const Ke=X.getState();if(Ke.setContentFramework(ce,Ke.contentTargetFWIds),d){const it=se.getState().pruneCoursesByFramework(ce);it>0&&ye(a.learningPath.coursesRemovedFrameworkChangeToast.replace("{count}",String(it)),{icon:l.jsx(Bn,{size:16}),duration:5e3});const Ht=se.getState().clearLevelSkills(J.current);Ht>0&&ye(a.learningPath.levelSkillsResetFrameworkChangeToast.replace("{count}",String(Ht)),{icon:l.jsx(Bn,{size:16}),duration:5e3})}}const Oe=Uj(I,ce);Oe&&(q(z,Oe),ne.current(Oe))}else if(!I){const ce=ve.getValues(),Oe=Object.fromEntries(Object.entries(ce).filter(([it])=>Y.has(it))),Ke=$j(Oe,{isReview:he.includes(ge.current),nodeTitle:fe.current});Object.keys(Ke).length>0&&(q(z,Ke),ne.current(Ke))}const W=ve.formState.errors,le=Array.from(new Set(Object.keys(W).map(ce=>{var Oe;return(Oe=H.find(Ke=>Ke.code===ce))==null?void 0:Oe.tab}).filter(Boolean)));ie.current(Object.keys(W).length===0,le)});return()=>_.unsubscribe()},[ve]),g.useEffect(()=>{for(const _ of["author","creator","copyright","copyrightYear","license"]){const E=M.current.find(z=>z.code===_);if(!E||E.currentValue===void 0||E.currentValue===null||E.currentValue==="")continue;const I=ve.getValues(_);(I==null||I==="")&&ve.setValue(_,E.currentValue,{shouldDirty:!1})}},[A,L,ve]);const Q=Se.reduce((_,E)=>{const I=_[_.length-1];return I&&I.section===E.section?I.fields.push(E):_.push({section:E.section,fields:[E]}),_},[]),Ce=_=>{const E={key:_.code,name:_.code,label:_.label,required:_.required,disabled:_.editable===!1};if(d&&_.code==="policy")return l.jsx("div",{className:On.fullWidthField,children:l.jsx(RO,{...E})},_.code);switch(_.inputType){case"textarea":return l.jsx(wd,{...E,multiline:!0,maxLength:_.maxLength});case"select":return l.jsx(LN,{...E,options:_.options??[]});case"multiselect":return l.jsx(DN,{...E,options:_.options??[]});case"chips":return l.jsx(jN,{...E});case"radio":return l.jsx(NN,{...E,options:_.options??[]});case"appIcon":return l.jsx(yO,{...E,nodeId:j??""});case"datepicker":case"datetime":return l.jsx(bO,{...E});case"keywords":case"tagsinput":return l.jsx(CO,{...E});case"nestedselect":return l.jsx(SO,{...E,levels:_.levels??[]});case"license":return l.jsx(xO,{...E});case"dialcode":return l.jsx(_O,{...E});default:return l.jsx(wd,{...E,maxLength:_.maxLength})}};return l.jsx(XD,{...ve,children:l.jsxs("div",{className:[On.form,d?On.formLp:""].filter(Boolean).join(" "),children:[Q.map((_,E)=>{const I=_.section?vj[_.section]:void 0;return I?l.jsx(Yj,{title:I.title,description:I.description,children:_.fields.map(Ce)},_.section??E):l.jsx("div",{className:[On.ungrouped,d?On.ungroupedLp:""].filter(Boolean).join(" "),children:_.fields.map(Ce)},E)}),Se.length===0&&!b&&l.jsx("p",{className:On.noFields,children:a.sparkMetaForm.noFieldsMessage})]})})};function Jp(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function VO(e,t){return e.reduce((r,n,s)=>{const o=t.get(n);return o&&(r[s]=o),r},Array(e.length))}function To(e){return e!==null&&e>=0}function HO(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 QO(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const em=e=>{let{rects:t,activeIndex:r,overIndex:n,index:s}=e;const o=Jp(t,n,r),i=t[s],a=o[s];return!a||!i?null:{x:a.left-i.left,y:a.top-i.top,scaleX:a.width/i.width,scaleY:a.height/i.height}},Eo={scaleX:1,scaleY:1},Ad=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:s,rects:o,overIndex:i}=e;const a=(t=o[r])!=null?t:n;if(!a)return null;if(s===r){const u=o[i];return u?{x:0,y:r<i?u.top+u.height-(a.top+a.height):u.top-a.top,...Eo}:null}const c=WO(o,s,r);return s>r&&s<=i?{x:0,y:-a.height-c,...Eo}:s<r&&s>=i?{x:0,y:a.height+c,...Eo}:{x:0,y:0,...Eo}};function WO(e,t,r){const n=e[t],s=e[t-1],o=e[t+1];return n?r<t?s?n.top-(s.top+s.height):o?o.top-(n.top+n.height):0:o?o.top-(n.top+n.height):s?n.top-(s.top+s.height):0:0}const tm="Sortable",rm=g.createContext({activeIndex:-1,containerId:tm,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:em,disabled:{draggable:!1,droppable:!1}});function kd(e){let{children:t,id:r,items:n,strategy:s=em,disabled:o=!1}=e;const{active:i,dragOverlay:a,droppableRects:c,over:u,measureDroppableContainers:d}=Bf(),f=Js(tm,r),p=a.rect!==null,m=g.useMemo(()=>n.map(T=>typeof T=="object"&&"id"in T?T.id:T),[n]),C=i!=null,h=i?m.indexOf(i.id):-1,v=u?m.indexOf(u.id):-1,y=g.useRef(m),b=!HO(m,y.current),S=v!==-1&&h===-1||b,x=QO(o);ir(()=>{b&&C&&d(m)},[b,m,C,d]),g.useEffect(()=>{y.current=m},[m]);const w=g.useMemo(()=>({activeIndex:h,containerId:f,disabled:x,disableTransforms:S,items:m,overIndex:v,useDragOverlay:p,sortedRects:VO(m,c),strategy:s}),[h,f,x.draggable,x.droppable,S,m,v,c,p,s]);return g.createElement(rm.Provider,{value:w},t)}const GO=e=>{let{id:t,items:r,activeIndex:n,overIndex:s}=e;return Jp(r,n,s).indexOf(t)},KO=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:s,items:o,newIndex:i,previousItems:a,previousContainerId:c,transition:u}=e;return!u||!n||a!==o&&s===i?!1:r?!0:i!==s&&t===c},YO={duration:200,easing:"ease"},nm="transform",ZO=Ar.Transition.toString({property:nm,duration:0,easing:"linear"}),XO={roleDescription:"sortable"};function JO(e){let{disabled:t,index:r,node:n,rect:s}=e;const[o,i]=g.useState(null),a=g.useRef(r);return ir(()=>{if(!t&&r!==a.current&&n.current){const c=s.current;if(c){const u=as(n.current,{ignoreTransform:!0}),d={x:c.left-u.left,y:c.top-u.top,scaleX:c.width/u.width,scaleY:c.height/u.height};(d.x||d.y)&&i(d)}}r!==a.current&&(a.current=r)},[t,r,n,s]),g.useEffect(()=>{o&&i(null)},[o]),o}function sm(e){let{animateLayoutChanges:t=KO,attributes:r,disabled:n,data:s,getNewIndex:o=GO,id:i,strategy:a,resizeObserverConfig:c,transition:u=YO}=e;const{items:d,containerId:f,activeIndex:p,disabled:m,disableTransforms:C,sortedRects:h,overIndex:v,useDragOverlay:y,strategy:b}=g.useContext(rm),S=eP(n,m),x=d.indexOf(i),w=g.useMemo(()=>({sortable:{containerId:f,index:x,items:d},...s}),[f,s,x,d]),T=g.useMemo(()=>d.slice(d.indexOf(i)),[d,i]),{rect:L,node:A,isOver:O,setNodeRef:P}=iy({id:i,data:w,disabled:S.droppable,resizeObserverConfig:{updateMeasurementsFor:T,...c}}),{active:j,activatorEvent:N,activeNodeRect:F,attributes:R,setNodeRef:U,listeners:re,isDragging:G,over:pe,setActivatorNodeRef:me,transform:V}=Mf({id:i,data:w,attributes:{...XO,...r},disabled:S.draggable}),de=Qg(P,U),oe=!!j,Se=oe&&!C&&To(p)&&To(v),ve=!y&&G,q=ve&&Se?V:null,$=Se?q??(a??b)({rects:h,activeNodeRect:F,activeIndex:p,overIndex:v,index:x}):null,ne=To(p)&&To(v)?o({id:i,items:d,activeIndex:p,overIndex:v}):x,ie=j==null?void 0:j.id,xe=g.useRef({activeId:ie,items:d,newIndex:ne,containerId:f}),fe=d!==xe.current.items,ge=t({active:j,containerId:f,isDragging:G,isSorting:oe,id:i,index:x,items:d,newIndex:xe.current.newIndex,previousItems:xe.current.items,previousContainerId:xe.current.containerId,transition:u,wasDragging:xe.current.activeId!=null}),Ae=JO({disabled:!ge,index:x,node:A,rect:L});return g.useEffect(()=>{oe&&xe.current.newIndex!==ne&&(xe.current.newIndex=ne),f!==xe.current.containerId&&(xe.current.containerId=f),d!==xe.current.items&&(xe.current.items=d)},[oe,ne,f,d]),g.useEffect(()=>{if(ie===xe.current.activeId)return;if(ie&&!xe.current.activeId){xe.current.activeId=ie;return}const he=setTimeout(()=>{xe.current.activeId=ie},50);return()=>clearTimeout(he)},[ie]),{active:j,activeIndex:p,attributes:R,data:w,rect:L,index:x,newIndex:ne,items:d,isOver:O,isSorting:oe,isDragging:G,listeners:re,node:A,overIndex:v,over:pe,setNodeRef:de,setActivatorNodeRef:me,setDroppableNodeRef:P,setDraggableNodeRef:U,transform:Ae??$,transition:J()};function J(){if(Ae||fe&&xe.current.newIndex===x)return ZO;if(!(ve&&!pi(N)||!u)&&(oe||ge))return Ar.Transition.toString({...u,property:nm})}}function eP(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 ai(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 tP=[je.Down,je.Right,je.Up,je.Left],rP=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:s,droppableContainers:o,over:i,scrollableAncestors:a}}=t;if(tP.includes(e.code)){if(e.preventDefault(),!r||!n)return;const c=[];o.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const p=s.get(f.id);if(p)switch(e.code){case je.Down:n.top<p.top&&c.push(f);break;case je.Up:n.top>p.top&&c.push(f);break;case je.Left:n.left>p.left&&c.push(f);break;case je.Right:n.left<p.left&&c.push(f);break}});const u=lv({collisionRect:n,droppableRects:s,droppableContainers:c});let d=xf(u,"id");if(d===(i==null?void 0:i.id)&&u.length>1&&(d=u[1].id),d!=null){const f=o.get(r.id),p=o.get(d),m=p?s.get(p.id):null,C=p==null?void 0:p.node.current;if(C&&m&&f&&p){const v=mi(C).some((T,L)=>a[L]!==T),y=om(f,p),b=nP(f,p),S=v||!y?{x:0,y:0}:{x:b?n.width-m.width:0,y:b?n.height-m.height:0},x={x:m.left,y:m.top};return S.x&&S.y?x:Fs(x,S)}}}};function om(e,t){return!ai(e)||!ai(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function nP(e,t){return!ai(e)||!ai(t)||!om(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const sP="_row_11nth_1",oP="_removeBtn_11nth_14",iP="_grip_11nth_17",aP="_ctIcon_11nth_34",lP="_info_11nth_38",cP="_name_11nth_46",uP="_meta_11nth_55",Xr={row:sP,removeBtn:oP,grip:iP,ctIcon:aP,info:lP,name:cP,meta:uP},dP={video:_i,pdf:to,h5p:Ci,scorm:xi,audio:Si,quiz:bi,course:Cr,default:Gr},fP=({item:e,onRemove:t,isEditable:r})=>{const n=ae(),s=lo(e),o=dP[s.key]??Gr,{attributes:i,listeners:a,setNodeRef:c,transform:u,transition:d,isDragging:f}=sm({id:e.id,disabled:!r}),p={transform:Ar.Transform.toString(u),transition:d,opacity:f?.5:1};return l.jsxs("div",{ref:c,style:p,className:Xr.row,role:"listitem",children:[r&&l.jsx("span",{className:Xr.grip,...i,...a,"aria-label":n.contentRow.dragToReorderAriaLabel,children:l.jsx(Il,{size:15})}),l.jsx("span",{className:[`sbx-ct-sq--${s.key}`,Xr.ctIcon].join(" "),"aria-hidden":"true",children:l.jsx(o,{size:14})}),l.jsxs("div",{className:Xr.info,children:[l.jsx("span",{className:Xr.name,title:e.name,children:e.name}),l.jsx("span",{className:Xr.meta,children:s.label})]}),l.jsx("span",{className:`sbx-ct-badge--${s.key}`,children:s.label}),r&&l.jsx("button",{type:"button",className:Xr.removeBtn,onClick:()=>t(e.id),"aria-label":n.contentRow.removeAriaLabel.replace("{name}",e.name),children:l.jsx(lr,{size:14})})]})},hP="_container_1assk_1",pP="_header_1assk_7",mP="_heading_1assk_13",gP="_count_1assk_21",vP="_list_1assk_30",yP="_emptyState_1assk_36",bP="_skillPicker_1assk_52",CP="_skillsCovered_1assk_52",SP="_chips_1assk_64",xP="_chip_1assk_64",_P="_skillWarning_1assk_80",wP="_selectedSkills_1assk_85",TP="_skillPill_1assk_91",EP="_skillPillFlagged_1assk_103",AP="_skillPillUncovered_1assk_107",kP="_skillPillRemove_1assk_112",IP="_skillSearchBox_1assk_127",LP="_skillSearchWrap_1assk_132",DP="_searchIcon_1assk_147",jP="_skillSearchInput_1assk_152",NP="_skillDropdown_1assk_165",OP="_skillOption_1assk_179",PP="_skillCheckbox_1assk_201",RP="_skillCheckboxChecked_1assk_213",FP="_skillDropdownEmpty_1assk_218",MP="_skillPickerNote_1assk_224",BP="_emptyHint_1assk_229",qP="_assessmentsCard_1assk_242",$P="_assessmentSlots_1assk_254",UP="_assessmentItemRow_1assk_260",zP="_assessmentItemIcon_1assk_271",VP="_assessmentItemInfo_1assk_283",HP="_assessmentItemTitle_1assk_290",QP="_assessmentItemMeta_1assk_299",WP="_coursesCard_1assk_304",GP="_coursesCardTitle_1assk_315",KP="_coursesCardDescription_1assk_322",YP="_coursesList_1assk_329",ZP="_courseRow_1assk_335",XP="_courseDragHandle_1assk_345",JP="_courseIcon_1assk_357",eR="_courseInfo_1assk_369",tR="_courseTitle_1assk_376",rR="_courseMeta_1assk_385",nR="_addRowIcon_1assk_390",sR="_assessmentItemBadge_1assk_402",oR="_menuWrap_1assk_413",iR="_menuBtn_1assk_418",aR="_dropmenu_1assk_431",lR="_dangerItem_1assk_461",cR="_addRow_1assk_390",uR="_addRowActive_1assk_485",dR="_addRowAssessment_1assk_491",fR="_addRowText_1assk_498",hR="_requiredBadge_1assk_503",K={container:hP,header:pP,heading:mP,count:gP,list:vP,emptyState:yP,skillPicker:bP,skillsCovered:CP,chips:SP,chip:xP,skillWarning:_P,selectedSkills:wP,skillPill:TP,skillPillFlagged:EP,skillPillUncovered:AP,skillPillRemove:kP,skillSearchBox:IP,skillSearchWrap:LP,searchIcon:DP,skillSearchInput:jP,skillDropdown:NP,skillOption:OP,skillCheckbox:PP,skillCheckboxChecked:RP,skillDropdownEmpty:FP,skillPickerNote:MP,emptyHint:BP,assessmentsCard:qP,assessmentSlots:$P,assessmentItemRow:UP,assessmentItemIcon:zP,assessmentItemInfo:VP,assessmentItemTitle:HP,assessmentItemMeta:QP,coursesCard:WP,coursesCardTitle:GP,coursesCardDescription:KP,coursesList:YP,courseRow:ZP,courseDragHandle:XP,courseIcon:JP,courseInfo:eR,courseTitle:tR,courseMeta:rR,addRowIcon:nR,assessmentItemBadge:sR,menuWrap:oR,menuBtn:iR,dropmenu:aR,dangerItem:lR,addRow:cR,addRowActive:uR,addRowAssessment:dR,addRowText:fR,requiredBadge:hR},pR=({options:e,selected:t,outOfScope:r,uncovered:n,onChange:s,isEditable:o,description:i})=>{const a=ae(),[c,u]=g.useState(""),[d,f]=g.useState(!1),p=g.useRef(null);g.useEffect(()=>{if(!d)return;const v=y=>{var b;(b=p.current)!=null&&b.contains(y.target)||f(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[d]);const m=c?e.filter(v=>v.toLowerCase().includes(c.toLowerCase())):e,C=v=>{o&&s(t.includes(v)?t.filter(y=>y!==v):[...t,v])},h=v=>{o&&s(t.filter(y=>y!==v))};return l.jsxs("div",{className:K.skillPicker,children:[l.jsxs("div",{className:K.header,children:[l.jsx("span",{className:K.heading,children:a.learningPath.skillsHeading}),l.jsx("span",{className:K.count,children:t.length})]}),l.jsx("span",{className:K.skillPickerNote,children:i}),r.length>0&&l.jsx("div",{className:K.skillWarning,role:"alert",children:a.learningPath.skillsOutOfScopeWarning.replace("{skills}",r.join(", "))}),n.length>0&&l.jsx("div",{className:K.skillWarning,role:"alert",children:a.learningPath.skillsUncoveredWarning.replace("{skills}",n.join(", "))}),t.length>0&&l.jsx("div",{className:K.selectedSkills,children:t.map(v=>{const y=r.includes(v),b=n.includes(v);return l.jsxs("span",{className:[K.skillPill,y?K.skillPillFlagged:"",b?K.skillPillUncovered:""].filter(Boolean).join(" "),title:b?a.learningPath.skillUncoveredPillTitle:void 0,children:[v,o&&l.jsx("button",{type:"button",className:K.skillPillRemove,onClick:()=>h(v),"aria-label":a.learningPath.removeSkillAriaLabel.replace("{skill}",v),children:l.jsx(lr,{size:11})})]},v)})}),o?l.jsxs("div",{className:K.skillSearchBox,ref:p,children:[l.jsxs("div",{className:K.skillSearchWrap,onClick:()=>f(!0),children:[l.jsx("input",{type:"search",className:K.skillSearchInput,placeholder:a.learningPath.searchSkillsPlaceholder,value:c,onChange:v=>u(v.target.value),onFocus:()=>f(!0),"aria-label":a.learningPath.searchSkillsPlaceholder}),l.jsx(Jo,{size:14,className:K.searchIcon})]}),d&&l.jsx("div",{className:K.skillDropdown,role:"listbox",children:e.length===0?l.jsx("div",{className:K.skillDropdownEmpty,children:a.learningPath.noSkillsAvailable}):m.length===0?l.jsx("div",{className:K.skillDropdownEmpty,children:a.learningPath.noMatchingSkills}):m.map(v=>{const y=t.includes(v);return l.jsxs("button",{type:"button",role:"option","aria-selected":y,className:K.skillOption,onClick:()=>C(v),children:[l.jsx("span",{className:[K.skillCheckbox,y?K.skillCheckboxChecked:""].join(" "),children:y&&l.jsx(Cn,{size:12})}),v]},v)})})]}):t.length===0&&l.jsx("span",{className:K.emptyHint,children:a.learningPath.noSkillsSelectedYet})]})},ml=({slot:e,isEditable:t})=>{const r=ae(),{pre:n,post:s,activeAssessmentSlot:o,setActiveAssessmentSlot:i,deleteSlot:a}=Yl(),c=se(v=>v.selectNode),[u,d]=g.useState(!1),f=g.useRef(null),p=e==="pre"?n:s,m=e==="pre"?r.learningPath.priorAssessmentLabel:r.learningPath.outcomeAssessmentLabel;if(g.useEffect(()=>{if(!u)return;const v=y=>{var b;(b=f.current)!=null&&b.contains(y.target)||d(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[u]),!p.filled){const v=o===e;return l.jsxs("button",{type:"button",className:[K.addRow,K.addRowAssessment,v?K.addRowActive:""].filter(Boolean).join(" "),disabled:!t,onClick:()=>i(v?null:e),"aria-pressed":v,children:[l.jsx("span",{className:K.addRowIcon,children:l.jsx(kr,{size:16})}),l.jsx("span",{className:K.addRowText,children:r.learningPath.addAssessmentSlotButton.replace("{label}",m)}),p.required&&l.jsx("span",{className:K.requiredBadge,children:r.learningPath.requiredSlotBadge})]})}const C=e==="pre"?r.learningPath.skillCheckBadge:r.learningPath.outcomeCheckBadge,h=()=>p.level&&c(p.level.id);return l.jsxs("div",{className:K.assessmentItemRow,role:"button",tabIndex:0,onClick:h,onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),h())},children:[l.jsx("span",{className:K.assessmentItemIcon,children:l.jsx(Cr,{size:16})}),l.jsxs("div",{className:K.assessmentItemInfo,children:[l.jsx("span",{className:K.assessmentItemTitle,children:p.courseName||r.learningPath.courseNameUnavailable}),l.jsxs("span",{className:K.assessmentItemMeta,children:[m," · ",r.learningPath.assessmentCourseMeta]})]}),l.jsx("span",{className:K.assessmentItemBadge,children:C}),t&&l.jsxs("div",{className:K.menuWrap,ref:f,children:[l.jsx("button",{type:"button",className:K.menuBtn,onClick:v=>{v.stopPropagation(),d(y=>!y)},"aria-label":r.treeNode.nodeOptionsAriaLabel,children:"⋮"}),u&&l.jsxs("div",{className:K.dropmenu,onClick:v=>v.stopPropagation(),children:[l.jsxs("button",{type:"button",onClick:()=>{d(!1),p.level&&c(p.level.id)},children:[l.jsx(Dy,{size:12})," ",r.learningPath.viewCourseMenuItem]}),l.jsxs("button",{type:"button",className:K.dangerItem,onClick:()=>{d(!1),a(e)},children:[l.jsx(ls,{size:12})," ",r.treeNode.deleteMenuItem]})]})]})]})};function mR(e){var p,m;const t=ae(),r=se(C=>C.treeData),n=se(C=>C.deleteNode),s=rt(C=>C.activeLevelExamTarget),o=rt(C=>C.setActiveLevelExamTarget),i=rt(C=>C.openModal),a=(m=(p=r[0])==null?void 0:p.children)==null?void 0:m.find(C=>C.id===e),c=wh(a),u=s===e,d=()=>{e&&o(u?null:e)},f=()=>{c&&i("confirmDelete",{message:t.learningPath.deleteLevelExamConfirm,onConfirm:()=>n(c.id)})};return{course:c,filled:!!c,courseName:c==null?void 0:c.name,isActiveTarget:u,armExam:d,deleteExam:f}}const gR=({levelId:e,isEditable:t})=>{const r=ae(),{filled:n,courseName:s,isActiveTarget:o,armExam:i,deleteExam:a}=mR(e);return n?l.jsxs("div",{className:K.assessmentItemRow,children:[l.jsx("span",{className:K.assessmentItemIcon,children:l.jsx(Cr,{size:16})}),l.jsxs("div",{className:K.assessmentItemInfo,children:[l.jsx("span",{className:K.assessmentItemTitle,children:s||r.learningPath.courseNameUnavailable}),l.jsx("span",{className:K.assessmentItemMeta,children:r.learningPath.levelExamMeta})]}),t&&l.jsx("button",{type:"button",className:K.menuBtn,onClick:a,"aria-label":r.treeNode.deleteMenuItem,children:l.jsx(ls,{size:14})})]}):l.jsxs("button",{type:"button",className:[K.addRow,K.addRowAssessment,o?K.addRowActive:""].filter(Boolean).join(" "),disabled:!t,onClick:i,"aria-pressed":o,children:[l.jsx("span",{className:K.addRowIcon,children:l.jsx(kr,{size:16})}),l.jsx("span",{className:K.addRowText,children:r.learningPath.addLevelExamButton})]})},vR=({item:e,onRemove:t,isEditable:r})=>{const n=ae(),[s,o]=g.useState(!1),i=g.useRef(null),{attributes:a,listeners:c,setNodeRef:u,transform:d,transition:f,isDragging:p}=sm({id:e.id,disabled:!r}),m={transform:Ar.Transform.toString(d),transition:f,opacity:p?.5:1};return g.useEffect(()=>{if(!s)return;const C=h=>{var v;(v=i.current)!=null&&v.contains(h.target)||o(!1)};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[s]),l.jsxs("div",{ref:u,style:m,className:K.courseRow,children:[r&&l.jsx("span",{className:K.courseDragHandle,...a,...c,"aria-label":n.contentRow.dragToReorderAriaLabel,children:l.jsx(Il,{size:16})}),l.jsx("span",{className:K.courseIcon,children:l.jsx(Cr,{size:18})}),l.jsxs("div",{className:K.courseInfo,children:[l.jsx("span",{className:K.courseTitle,title:e.name,children:e.name}),l.jsx("span",{className:K.courseMeta,children:n.learningPath.courseMetaLabel})]}),r&&l.jsxs("div",{className:K.menuWrap,ref:i,children:[l.jsx("button",{type:"button",className:K.menuBtn,onClick:C=>{C.stopPropagation(),o(h=>!h)},"aria-label":n.treeNode.nodeOptionsAriaLabel,children:"⋮"}),s&&l.jsx("div",{className:K.dropmenu,onClick:C=>C.stopPropagation(),children:l.jsxs("button",{type:"button",className:K.dangerItem,onClick:()=>{o(!1),t(e.id)},children:[l.jsx(ls,{size:12})," ",n.learningPath.removeFromLevelMenuItem]})})]})]})},yR=({editorMode:e,isRoot:t=!1})=>{const r=ae(),{selectedNodeId:n,getChildrenOf:s,getNodeById:o,reorderChildren:i,deleteNode:a,activeNodeMeta:c,updateNode:u,treeData:d}=se(),f=X(V=>V.editorProfile),p=n?s(n):[],m=e==="edit",C=n?o(n):void 0,h=f.competencyScoped,v=h&&!t&&!nt(C),y=h&&t,b=rt(V=>V.activeAssessmentSlot),S=rt(V=>V.activeLevelExamTarget),x=rt(V=>V.setActiveAssessmentSlot),w=!b&&!S,{scope:T,source:L}=ao(),A=ur(),O=A&&Array.isArray(c[A.code])?c[A.code]:[],P=L==="prior"?O.filter(V=>!T.includes(V)):[],j=y?Ah(d[0],A==null?void 0:A.code):[],N=v?kh(C,O,A==null?void 0:A.code):[],F=g.useCallback(V=>{!n||!(A!=null&&A.code)||u(n,{[A.code]:V},[A.code])},[n,A==null?void 0:A.code,u]),R=bf(Fa(gi,{activationConstraint:{distance:5}}),Fa(wl,{coordinateGetter:rP})),U=g.useCallback(V=>{const{active:de,over:oe}=V;if(!oe||de.id===oe.id||!n)return;const Se=se.getState().getChildrenOf(n),ve=Se.findIndex(M=>M.id===de.id),q=Se.findIndex(M=>M.id===oe.id);ve<0||q<0||i(n,ve,q)},[n,i]),re=g.useCallback(V=>{window.confirm(r.unitContentList.removeConfirm)&&a(V)},[a,r.unitContentList.removeConfirm]),G=rt(V=>V.openModal),pe=g.useCallback(V=>{G("confirmDelete",{message:r.learningPath.deleteCourseConfirm,onConfirm:()=>{a(V)||ye.error(r.learningPath.cannotRemoveLastRegularCourseToast)}})},[G,a,r.learningPath.deleteCourseConfirm,r.learningPath.cannotRemoveLastRegularCourseToast]),me=v?p.filter(V=>{var de;return!((de=V.metadata)!=null&&de.isAssessmentCourse)}):[];return n?l.jsxs("div",{className:K.container,children:[y&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:K.skillsCovered,children:[l.jsx("span",{className:K.heading,children:r.learningPath.skillsCoveredHeading}),l.jsx("span",{className:K.emptyHint,children:r.learningPath.skillsCoveredDescription}),j.length>0&&l.jsx("div",{className:K.chips,children:j.map(V=>l.jsx("span",{className:K.chip,children:V},V))}),j.length===0&&l.jsx("span",{className:K.emptyHint,children:r.learningPath.noSkillsYet})]}),l.jsxs("div",{className:K.assessmentsCard,children:[l.jsx("span",{className:K.heading,children:r.learningPath.assessmentsCardHeading}),l.jsx("span",{className:K.emptyHint,children:r.learningPath.assessmentsCardDescription}),l.jsxs("div",{className:K.assessmentSlots,children:[l.jsx(ml,{slot:"pre",isEditable:m}),l.jsx(ml,{slot:"post",isEditable:m})]})]})]}),v&&l.jsx(pR,{options:T,selected:O,outOfScope:P,uncovered:N,onChange:F,isEditable:m,description:L==="prior"?r.learningPath.skillScopeFromPriorNote:r.learningPath.skillScopeManualNote}),v&&l.jsxs("button",{type:"button",className:[K.addRow,K.addRowAssessment,w?K.addRowActive:""].filter(Boolean).join(" "),disabled:!m,onClick:()=>x(null),"aria-pressed":w,children:[l.jsx("span",{className:K.addRowIcon,children:l.jsx(kr,{size:16})}),l.jsx("span",{className:K.addRowText,children:r.learningPath.addCourseToLevelButton})]}),v&&l.jsx(gR,{levelId:n,isEditable:m}),v&&l.jsxs("div",{className:K.coursesCard,children:[l.jsx("h3",{className:K.coursesCardTitle,children:r.learningPath.coursesCardHeading}),l.jsx("p",{className:K.coursesCardDescription,children:r.learningPath.coursesCardDescription}),me.length>0?l.jsx($a,{sensors:R,collisionDetection:bc,onDragEnd:U,children:l.jsx(kd,{items:me.map(V=>V.id),strategy:Ad,children:l.jsx("div",{className:K.coursesList,role:"list",children:me.map(V=>l.jsx(vR,{item:V,onRemove:pe,isEditable:m},V.id))})})}):l.jsx("span",{className:K.emptyHint,children:r.learningPath.coursesEmptyHint})]}),!h&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:K.header,children:[l.jsx("span",{className:K.heading,children:r.unitContentList.heading}),l.jsx("span",{className:K.count,children:p.length})]}),p.length>0?l.jsx($a,{sensors:R,collisionDetection:bc,onDragEnd:U,children:l.jsx(kd,{items:p.map(V=>V.id),strategy:Ad,children:l.jsx("div",{className:K.list,role:"list",children:p.map(V=>l.jsx(fP,{item:V,onRemove:re,isEditable:m},V.id))})})}):l.jsxs("div",{className:K.emptyState,children:[l.jsx("p",{children:r.unitContentList.emptyTitle}),l.jsx("span",{children:r.unitContentList.emptyHint})]}),m&&!nt(C)&&l.jsxs("button",{className:K.addRow,type:"button","aria-label":r.unitContentList.addContentAriaLabel,children:[l.jsx(kr,{size:14})," ",r.unitContentList.addContent]})]})]}):null},bR="_dropZone_ijo5w_1",CR="_active_ijo5w_14",Id={dropZone:bR,active:CR},SR=({isActive:e,label:t,nodeId:r,className:n})=>{const s=ae(),o=t??s.dropZone.dropHere;return l.jsx("div",{className:`${Id.dropZone} ${e?Id.active:""} ${n??""}`,"data-droppable":e?"true":void 0,"data-node-id":r,"aria-label":o,role:"region",children:l.jsx("span",{children:o})})},Ld="application/vnd.sunbird.question";function Dd(e){return{cardinality:"single",type:"integer",defaultValue:e.maxScore??1}}function im(e,t,r){if(!e)return null;if(e.identifier===t)return{question:e,parent:r};for(const n of e.children??[]){const s=im(n,t,e);if(s)return s}return null}function xR(e,t){const r=im(e,t);if(!r)return null;const{question:n,parent:s}=r,o={...e,children:[n],childNodes:[t],shuffle:s==null?void 0:s.shuffle,showSolutions:(s==null?void 0:s.showSolutions)??"No",showFeedback:(s==null?void 0:s.showFeedback)??"No"};return(s==null?void 0:s.shuffle)===!0?o.maxScore=1:n.qType==="SA"?delete o.maxScore:n.maxScore!=null&&(o.maxScore=n.maxScore),o}function _R(e,t){const r=((t==null?void 0:t.enabled)??!0)&&!!e;return es({queryKey:["quml","questionset",e],enabled:r,queryFn:async()=>{const n=await Mh(e),s=d=>{if(!d)return[];const f=d.mimeType===Ld&&d.identifier?[d.identifier]:[],p=(d.children??[]).flatMap(s);return[...f,...p]},o=s(n),i=new Map;o.length&&(await UT(o)).forEach(f=>{const p=f.identifier;p&&i.set(p,f)});const a=d=>{if(!d)return d;if(d.mimeType===Ld&&d.identifier){const f=i.get(d.identifier)??d,p=f.outcomeDeclaration;return p!=null&&p.maxScore||(f.outcomeDeclaration={...p??{},maxScore:Dd(f)}),f}return Array.isArray(d.children)&&(d.children=d.children.map(f=>a(f))),d},c=a(n),u=c.outcomeDeclaration;return u!=null&&u.maxScore||(c.outcomeDeclaration={...u??{},maxScore:Dd(c)}),c}})}const jd="/assets/quml-player/sunbird-quml-player.js",wR="/assets/quml-player/styles.css",Nd="sunbird-quml-player";function TR(e){const t=e.children??[];return t.length?t.every(n=>n.objectType==="Question")?[e]:t:[]}const dt=class dt{constructor(){gs(this,"eventHandlers",new WeakMap)}loadScript(){return dt.scriptLoaded||customElements.get(Nd)?(dt.scriptLoaded=!0,Promise.resolve()):(dt.scriptLoading||(dt.scriptLoading=new Promise((t,r)=>{const n=document.createElement("script");n.src=jd,n.setAttribute("data-quml-player-script","true"),n.onload=()=>{dt.scriptLoaded=!0,dt.scriptLoading=void 0,t()},n.onerror=()=>{dt.scriptLoading=void 0,r(new Error(`Failed to load QuML player script: ${jd}`))},document.body.appendChild(n)})),dt.scriptLoading)}loadStyles(){if(dt.stylesLoaded||document.querySelector('[data-quml-player-styles="true"]')){dt.stylesLoaded=!0;return}const t=document.createElement("link");t.rel="stylesheet",t.href=wR,t.setAttribute("data-quml-player-styles","true"),document.head.appendChild(t),dt.stylesLoaded=!0}static unloadStyles(){var t;(t=document.querySelector('[data-quml-player-styles="true"]'))==null||t.remove(),dt.stylesLoaded=!1}async createConfig(t,r,n){var o,i,a;return await this.loadScript(),{context:{mode:(n==null?void 0:n.mode)??"play",host:"",pdata:{id:((o=r==null?void 0:r.pdata)==null?void 0:o.id)??"sunbird.portal",ver:((i=r==null?void 0:r.pdata)==null?void 0:i.ver)??"1.0",pid:((a=r==null?void 0:r.pdata)==null?void 0:a.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:TR(t),identifier:t.identifier??""},metadata:t}}createElement(t){this.loadStyles();const r=document.createElement(Nd);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 s=i=>r==null?void 0:r(i),o=i=>n==null?void 0:n(i.detail);t.addEventListener("playerEvent",s),t.addEventListener("telemetryEvent",o),this.eventHandlers.set(t,{player:s,telemetry:o})}removeEventListeners(t){const r=this.eventHandlers.get(t);r&&(t.removeEventListener("playerEvent",r.player),t.removeEventListener("telemetryEvent",r.telemetry),this.eventHandlers.delete(t))}};gs(dt,"scriptLoaded",!1),gs(dt,"scriptLoading"),gs(dt,"stylesLoaded",!1);let li=dt;const Ao=new li,ER="_contentPlayerRoot_r6xk8_1",AR="_flowLayout_r6xk8_9",kR="_stage_r6xk8_13",IR="_aspectRatio_r6xk8_16",LR="_playerHeader_r6xk8_32",DR="_playerHeaderThumb_r6xk8_46",jR="_playerHeaderTitle_r6xk8_56",NR="_typeBadge_r6xk8_66",OR="_typeDot_r6xk8_105",PR="_playerFrame_r6xk8_125",RR="_coverOverlay_r6xk8_133",FR="_coverHidden_r6xk8_145",MR="_coverThumb_r6xk8_150",BR="_coverPlayRing_r6xk8_159",qR="_coverPlayIcon_r6xk8_172",$R="_coverLabel_r6xk8_181",UR="_coverSkeleton_r6xk8_187",zR="_playerWrapper_r6xk8_213",VR="_infoStrip_r6xk8_223",HR="_infoChip_r6xk8_239",QR="_infoChipLabel_r6xk8_258",WR="_infoChipIcon_r6xk8_267",GR="_playerError_r6xk8_273",KR="_playerErrorIcon_r6xk8_287",YR="_playerErrorMsg_r6xk8_292",ZR="_qumlRoot_r6xk8_299",He={contentPlayerRoot:ER,flowLayout:AR,stage:kR,aspectRatio:IR,playerHeader:LR,playerHeaderThumb:DR,playerHeaderTitle:jR,typeBadge:NR,typeDot:OR,playerFrame:PR,coverOverlay:RR,coverHidden:FR,coverThumb:MR,coverPlayRing:BR,coverPlayIcon:qR,coverLabel:$R,coverSkeleton:UR,playerWrapper:zR,infoStrip:VR,infoChip:HR,infoChipLabel:QR,infoChipIcon:WR,playerError:GR,playerErrorIcon:KR,playerErrorMsg:YR,qumlRoot:ZR},XR="application/vnd.sunbird.questionset";function JR(e,t){const r=new Map,n=o=>{for(const i of o)r.set(i.id,i),i.children&&n(i.children)};n(e);let s=r.get(t);for(;s;){if(s.mimeType===XR)return s.identifier;s=s.parent?r.get(s.parent):void 0}return null}const eF=[{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 tF(e){return eF.find(t=>t.mimes.includes(e))??{key:"other"}}function rF(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 nF={"pdf-player":["application/pdf"],"video-player":["video/mp4","video/webm"],"epub-player":["application/epub"]},sF={"pdf-player":"/assets/sunbird-pdf-player.js","video-player":"/assets/sunbird-video-player.js","epub-player":"/assets/sunbird-epub-player.js"},oF={"pdf-player":"sunbird-pdf-player","video-player":"sunbird-video-player","epub-player":"sunbird-epub-player"},iF="/content/preview/preview.html?webview=true&build_number=2.8.0.e552fcd";function ya(e){for(const[t,r]of Object.entries(nF))if(r.includes(e))return t;return"default-player"}function aF(e,t,r){var o;const n=r==null?void 0:r.context,s=t.mimeType??e.mimeType??"";return{context:{mode:"play",partner:[],pdata:{id:((o=n==null?void 0:n.pdata)==null?void 0:o.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:s==="application/vnd.ekstep.ecml-archive"?t.body??{}:{}}}function lF(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 cF(e,t,r=100){await lF(sF[t]??""),!customElements.get(e)&&await new Promise((n,s)=>{let o=0;const i=setInterval(()=>{o++,customElements.get(e)?(clearInterval(i),n()):o>=r&&(clearInterval(i),s(new Error(`Custom element <${e}> did not register`)))},100)})}const uF=[{key:"author",icon:Yy},{key:"license",icon:Uy},{key:"language",icon:Ny},{key:"gradeLevel",icon:zy},{key:"subject",icon:Cr},{key:"contentType",icon:Gy}];function dF(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 fF({node:e}){const t=ae(),r=e.metadata??{},n=uF.flatMap(s=>{const o=r[s.key];if(!o)return[];const i=Array.isArray(o)?o.join(", "):String(o);return i?[{...s,label:dF(s.key,t),val:i}]:[]});return n.length?l.jsx("div",{className:He.infoStrip,children:n.map(s=>l.jsxs("div",{className:He.infoChip,children:[s.icon&&l.jsx(s.icon,{size:13,className:He.infoChipIcon}),l.jsx("span",{className:He.infoChipLabel,children:s.label}),s.val]},s.key))}):null}function am({node:e,hidden:t}){var s;const r=ae(),n=e.appIcon??((s=e.metadata)==null?void 0:s.appIcon);return l.jsx("div",{className:`${He.coverOverlay} ${t?He.coverHidden:""}`,children:n?l.jsxs(l.Fragment,{children:[l.jsx("img",{src:n,alt:e.name,className:He.coverThumb}),l.jsx("div",{className:He.coverPlayRing,children:l.jsx("div",{className:He.coverPlayIcon})}),l.jsx("span",{className:He.coverLabel,children:r.contentPlayer.loadingPreview})]}):l.jsx("div",{className:He.coverSkeleton})})}function lm({message:e}){return l.jsxs("div",{className:He.playerError,children:[l.jsx(Ky,{size:28,className:He.playerErrorIcon}),l.jsx("span",{className:He.playerErrorMsg,children:e})]})}function hF({mimeType:e}){const t=ae(),r=tF(e);return l.jsxs("span",{className:He.typeBadge,"data-type":r.key,children:[l.jsx("span",{className:He.typeDot}),rF(r.key,t)]})}const gl=({node:e,editorMode:t,type:r,singleQuestion:n,layout:s="fill"})=>{var i;if(r==="quml")return l.jsx(mF,{node:e,editorMode:t,singleQuestion:!!n});const o=e.appIcon??((i=e.metadata)==null?void 0:i.appIcon);return l.jsxs("div",{className:`${He.contentPlayerRoot} ${s==="flow"?He.flowLayout:""}`,children:[l.jsxs("div",{className:He.stage,children:[l.jsxs("div",{className:He.playerHeader,children:[o&&l.jsx("img",{src:o,alt:"",className:He.playerHeaderThumb}),l.jsx("span",{className:He.playerHeaderTitle,children:e.name}),l.jsx(hF,{mimeType:e.mimeType??""})]}),l.jsx(pF,{node:e})]}),l.jsx(fF,{node:e})]})};function pF({node:e}){var y;const t=ae(),r=X(b=>b.editorConfig),[n,s]=g.useState(()=>ya(e.mimeType??"")),[o,i]=g.useState(!1),[a,c]=g.useState(null),[u,d]=g.useState(e.metadata??{}),[f,p]=g.useState(!1),m=g.useRef(null),C=g.useRef(null),h=((y=r==null?void 0:r.config)==null?void 0:y.previewCdnUrl)??iF;g.useEffect(()=>{let b=!1;return p(!1),i(!1),c(null),d(e.metadata??{}),s(ya(e.mimeType??"")),xh(e.identifier).then(S=>{if(b)return;const x={...e.metadata??{},...S};d(x);const w=S.mimeType??e.mimeType??"";s(ya(w)),p(!0)}).catch(()=>{b||p(!0)}),()=>{b=!0}},[e.identifier]);const v=aF(e,u,r);return g.useEffect(()=>{if(!f||n!=="default-player")return;const b=m.current;if(!b)return;b.src=h;const S=()=>{try{const w=b.contentWindow;if(typeof(w==null?void 0:w.initializePreview)!="function"){c(t.contentPlayer.previewPlayerUnavailable);return}w.initializePreview(v),setTimeout(()=>i(!0),300)}catch(w){console.error("[ContentPlayer] initializePreview failed",w),c(t.contentPlayer.failedToInitializePlayer)}},x=()=>c(t.contentPlayer.previewPlayerLoadFailed);return b.addEventListener("load",S),b.addEventListener("error",x),()=>{b.removeEventListener("load",S),b.removeEventListener("error",x),b.src=""}},[e.identifier,n,h,f,t]),g.useEffect(()=>{if(!f||n==="default-player")return;const b=C.current;if(!b)return;const S=oF[n];if(!S)return;const x=v;cF(S,n).then(()=>{if(!C.current)return;if(!customElements.get(S)){s("default-player");return}const w=document.createElement(S);w.setAttribute("player-config",JSON.stringify(x)),w.addEventListener("playerEvent",()=>{}),w.addEventListener("telemetryEvent",()=>{}),b.innerHTML="",b.appendChild(w),setTimeout(()=>{try{w.playerConfig=x}catch{}i(!0)},200)}).catch(()=>{console.warn(`[ContentPlayer] ${n} script unavailable, falling back to iframe`),s("default-player")})},[e.identifier,n,f]),l.jsxs("div",{className:He.aspectRatio,children:[a?l.jsx(lm,{message:a}):l.jsx(am,{node:e,hidden:o}),n==="default-player"?l.jsx("iframe",{ref:m,id:"contentPlayer",title:e.name,className:He.playerFrame,name:"contentPlayer",allowFullScreen:!0}):l.jsx("div",{ref:C,className:He.playerFrame})]})}function mF({node:e,editorMode:t,singleQuestion:r}){const n=ae(),s=X(m=>m.editorConfig),o=se(m=>m.treeData),i=g.useRef(null),a=r?JR(o,e.id):e.identifier,{data:c,isLoading:u,error:d}=_R(a??"",{enabled:!!a}),f=g.useMemo(()=>c?r?xR(c,e.identifier):c:null,[c,r,e.identifier]);g.useEffect(()=>{const m=i.current;if(!m||!f)return;let C=null,h=!1;return(async()=>{try{const v=await Ao.createConfig(f,s==null?void 0:s.context,{mode:t==="edit"?"edit":"play"});if(h||!i.current)return;const y=Ao.createElement(v);C=y,Ao.attachEventListeners(y,b=>console.debug("[QumlPlayer] playerEvent",b.detail),b=>console.debug("[QumlPlayer] telemetryEvent",b)),m.innerHTML="",m.appendChild(y)}catch(v){console.error("[QumlPlayer] failed to initialize",v)}})(),()=>{h=!0,C&&(Ao.removeEventListeners(C),C.remove()),li.unloadStyles()}},[f,s,t,r]);const p=d?`${n.contentPlayer.unableToLoadQuestionset} ${d.message}`:r&&!a?n.contentPlayer.parentQuestionsetNotResolved:r&&c&&!f?n.contentPlayer.questionNotFoundInQuestionset:null;return l.jsxs("div",{className:He.qumlRoot,children:[p?l.jsx(lm,{message:p}):u||!f?l.jsx(am,{node:e,hidden:!1}):null,l.jsx("div",{ref:i,className:He.playerWrapper})]})}const gF="_overlay_ifddx_1",vF="_modal_ifddx_11",yF="_header_ifddx_21",bF="_body_ifddx_37",CF="_hint_ifddx_43",SF="_list_ifddx_49",xF="_item_ifddx_55",_F="_selected_ifddx_68",wF="_empty_ifddx_73",TF="_footer_ifddx_79",EF="_cancelBtn_ifddx_87",AF="_moveBtn_ifddx_95",Kt={overlay:gF,modal:vF,header:yF,body:bF,hint:CF,list:SF,item:xF,selected:_F,empty:wF,footer:TF,cancelBtn:EF,moveBtn:AF};function kF(e,t,r){const n=[],s=o=>{var i;for(const a of o)a.isFolder&&a.id!==r&&a.id!==t&&n.push(a),(i=a.children)!=null&&i.length&&s(a.children)};return s(e),n}const IF=({resourceId:e,resourceName:t,currentUnitId:r,onClose:n})=>{var f;const s=ae(),{treeData:o,moveNode:i}=se(),a=kF(o,((f=o[0])==null?void 0:f.id)??"",r),[c,u]=g.useState(null),d=()=>{c&&(i(e,r,c),n())};return l.jsx("div",{className:Kt.overlay,role:"dialog","aria-label":s.resourceReorderDialog.dialogAriaLabel,children:l.jsxs("div",{className:Kt.modal,children:[l.jsxs("div",{className:Kt.header,children:[l.jsxs("span",{children:[s.resourceReorderDialog.moveHeaderPrefix,' "',t,'"']}),l.jsx("button",{onClick:n,"aria-label":s.resourceReorderDialog.closeAriaLabel,children:l.jsx(lr,{size:16})})]}),l.jsxs("div",{className:Kt.body,children:[l.jsx("p",{className:Kt.hint,children:s.resourceReorderDialog.selectUnitHint}),l.jsxs("ul",{className:Kt.list,children:[a.map(p=>l.jsxs("li",{className:`${Kt.item} ${c===p.id?Kt.selected:""}`,onClick:()=>u(p.id),children:[l.jsx(jy,{size:14}),l.jsx("span",{children:p.name})]},p.id)),a.length===0&&l.jsx("li",{className:Kt.empty,children:s.resourceReorderDialog.noUnitsAvailable})]})]}),l.jsxs("div",{className:Kt.footer,children:[l.jsx("button",{className:Kt.cancelBtn,onClick:n,children:s.resourceReorderDialog.cancelButton}),l.jsx("button",{className:Kt.moveBtn,onClick:d,disabled:!c,children:s.resourceReorderDialog.moveButton})]})]})})},LF="_overlay_16at9_1",DF="_modal_16at9_11",jF="_header_16at9_21",NF="_body_16at9_37",OF="_table_16at9_43",PF="_pageInput_16at9_61",RF="_empty_16at9_68",FF="_footer_16at9_74",MF="_cancelBtn_16at9_82",BF="_saveBtn_16at9_90",pr={overlay:LF,modal:DF,header:jF,body:NF,table:OF,pageInput:PF,empty:RF,footer:FF,cancelBtn:MF,saveBtn:BF};function qF(e){const t=[],r=n=>{var s;for(const o of n)!o.isFolder&&(!o.children||o.children.length===0)?t.push(o):(s=o.children)!=null&&s.length&&r(o.children)};return r(e),t}const $F=({onClose:e})=>{const t=ae(),{treeData:r,updateNode:n}=se(),s=qF(r),[o,i]=g.useState(()=>Object.fromEntries(s.map(c=>{var u;return[c.id,String(((u=c.metadata)==null?void 0:u.pageNumber)??"")]}))),a=g.useCallback(()=>{for(const[c,u]of Object.entries(o))u!==""&&n(c,{pageNumber:parseInt(u,10)||void 0});e()},[o,n,e]);return l.jsx("div",{className:pr.overlay,role:"dialog","aria-label":t.assignPageNumber.dialogAriaLabel,children:l.jsxs("div",{className:pr.modal,children:[l.jsxs("div",{className:pr.header,children:[l.jsx("span",{children:t.assignPageNumber.title}),l.jsx("button",{onClick:e,"aria-label":t.assignPageNumber.closeAriaLabel,children:l.jsx(lr,{size:16})})]}),l.jsx("div",{className:pr.body,children:s.length===0?l.jsx("p",{className:pr.empty,children:t.assignPageNumber.emptyState}):l.jsxs("table",{className:pr.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:s.map(c=>l.jsxs("tr",{children:[l.jsx("td",{children:c.name}),l.jsx("td",{children:l.jsx("input",{type:"number",min:1,value:o[c.id]??"",onChange:u=>i(d=>({...d,[c.id]:u.target.value})),className:pr.pageInput})})]},c.id))})]})}),l.jsxs("div",{className:pr.footer,children:[l.jsx("button",{className:pr.cancelBtn,onClick:e,children:t.assignPageNumber.cancelButton}),l.jsxs("button",{className:pr.saveBtn,onClick:a,children:[l.jsx($y,{size:14})," ",t.assignPageNumber.saveButton]})]})]})})},UF="_container_1a7t2_1",zF="_panelHeader_1a7t2_10",VF="_panelHeaderLeft_1a7t2_19",HF="_panelCollapseBtn_1a7t2_27",QF="_titleRow_1a7t2_46",WF="_field_1a7t2_47",GF="_moveBtn_1a7t2_64",KF="_icon_1a7t2_84",YF="_nameInput_1a7t2_93",ZF="_fieldHeader_1a7t2_118",XF="_label_1a7t2_124",JF="_fieldCount_1a7t2_133",eM="_chips_1a7t2_170",tM="_chip_1a7t2_170",rM="_chipRemove_1a7t2_188",nM="_keywordInput_1a7t2_202",sM="_input_1a7t2_207",oM="_addBtn_1a7t2_220",iM="_radioGroup_1a7t2_234",aM="_radioLabel_1a7t2_239",Ye={container:UF,panelHeader:zF,panelHeaderLeft:VF,panelCollapseBtn:HF,titleRow:QF,field:WF,moveBtn:GF,icon:KF,nameInput:YF,fieldHeader:ZF,label:XF,fieldCount:JF,chips:eM,chip:tM,chipRemove:rM,keywordInput:nM,input:sM,addBtn:oM,radioGroup:iM,radioLabel:aM},lM=({node:e,editorMode:t,onMoveClick:r,reorderDialog:n})=>{var N,F;const{updateNode:s,markDirty:o}=se(),i=t==="edit",a=lo(e),c=ae(),u=X(R=>R.relationalFormConfig),d=R=>u==null?void 0:u.find(U=>U.code===R),f=R=>!u||!!d(R),p=(R,U)=>{var re;return((re=d(R))==null?void 0:re.label)||U},[m,C]=g.useState(!0),h=((N=e.metadata)==null?void 0:N.relationalMetadata)??{},[v,y]=g.useState(h.name??e.name??""),[b,S]=g.useState(""),[x,w]=g.useState(Array.isArray(h.keywords)?h.keywords:Array.isArray((F=e.metadata)==null?void 0:F.keywords)?e.metadata.keywords:[]),[T,L]=g.useState(!!h.optional);g.useEffect(()=>{var U,re;const R=((U=e.metadata)==null?void 0:U.relationalMetadata)??{};y(R.name??e.name??""),w(Array.isArray(R.keywords)?R.keywords:Array.isArray((re=e.metadata)==null?void 0:re.keywords)?e.metadata.keywords:[]),L(!!R.optional)},[e.id]);const A=()=>{v.trim()&&v!==e.name&&(s(e.id,{name:v.trim()}),o())},O=()=>{const R=b.trim();if(R&&!x.includes(R)){const U=[...x,R];w(U),s(e.id,{keywords:U}),o()}S("")},P=R=>{const U=x.filter(re=>re!==R);w(U),s(e.id,{keywords:U}),o()},j=R=>{L(R),s(e.id,{optional:R}),o()};return l.jsxs("div",{className:Ye.container,children:[l.jsxs("div",{className:Ye.panelHeader,children:[l.jsxs("div",{className:Ye.panelHeaderLeft,children:[l.jsx("span",{className:`sbx-ct-badge--${a.key}`,children:a.label}),i&&l.jsx("button",{type:"button",className:Ye.moveBtn,onClick:r,children:c.contentEditForm.moveToAnotherUnitButton})]}),l.jsx("button",{type:"button",className:Ye.panelCollapseBtn,onClick:()=>C(R=>!R),"aria-expanded":m,"aria-label":m?c.contentEditForm.collapseMetadataPanelAriaLabel:c.contentEditForm.expandMetadataPanelAriaLabel,title:m?c.contentEditForm.collapseTitle:c.contentEditForm.expandTitle,children:m?l.jsx(Sn,{size:15}):l.jsx(Ay,{size:15})})]}),m&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:Ye.titleRow,children:[e.appIcon&&l.jsx("img",{src:e.appIcon,alt:c.contentEditForm.iconAlt,className:Ye.icon}),l.jsx("input",{type:"text",className:Ye.nameInput,value:v,disabled:!i,onChange:R=>y(R.target.value),onBlur:A,placeholder:c.contentEditForm.contentNamePlaceholder})]}),f("keywords")&&l.jsxs("div",{className:Ye.field,children:[l.jsx("div",{className:Ye.fieldHeader,children:l.jsxs("label",{className:Ye.label,children:[p("keywords",c.contentEditForm.keywordsLabel),x.length>0&&l.jsx("span",{className:Ye.fieldCount,children:x.length})]})}),x.length>0&&l.jsx("div",{className:Ye.chips,children:x.map(R=>l.jsxs("span",{className:Ye.chip,children:[R,i&&l.jsx("button",{type:"button",className:Ye.chipRemove,onClick:()=>P(R),children:"×"})]},R))}),i&&l.jsxs("div",{className:Ye.keywordInput,children:[l.jsx("input",{type:"text",className:Ye.input,value:b,placeholder:c.contentEditForm.addKeywordPlaceholder,onChange:R=>S(R.target.value),onKeyDown:R=>{R.key==="Enter"&&(R.preventDefault(),O())}}),l.jsx("button",{type:"button",className:Ye.addBtn,onClick:O,children:c.contentEditForm.addButton})]})]}),f("optional")&&l.jsxs("div",{className:Ye.field,children:[l.jsx("label",{className:Ye.label,children:p("optional",c.contentEditForm.optionalInCollectionLabel)}),l.jsxs("div",{className:Ye.radioGroup,children:[l.jsxs("label",{className:Ye.radioLabel,children:[l.jsx("input",{type:"radio",name:`optional-${e.id}`,checked:T===!0,onChange:()=>j(!0),disabled:!i}),c.contentEditForm.yesOption]}),l.jsxs("label",{className:Ye.radioLabel,children:[l.jsx("input",{type:"radio",name:`optional-${e.id}`,checked:T===!1,onChange:()=>j(!1),disabled:!i}),c.contentEditForm.noOption]})]})]})]}),n]})},cM="_iconBtn_64kgu_1",uM="_editable_64kgu_14",dM="_iconImg_64kgu_26",fM="_placeholder_64kgu_34",hM="_removeBtn_64kgu_41",ws={iconBtn:cM,editable:uM,iconImg:dM,placeholder:fM,removeBtn:hM},pM=({nodeId:e,value:t,editable:r})=>{const[n,s]=g.useState(!1),{updateNode:o,markDirty:i}=se(),a=ae(),c=d=>{o(e,{appIcon:d}),i(),s(!1)},u=d=>{d.stopPropagation(),o(e,{appIcon:""}),i()};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:[ws.iconBtn,r?ws.editable:""].filter(Boolean).join(" "),role:r?"button":void 0,tabIndex:r?0:-1,"aria-label":r?a.titleAppIcon.selectAppIconAriaLabel:a.titleAppIcon.appIconAriaLabel,onClick:()=>r&&s(!0),onKeyDown:d=>{r&&(d.key==="Enter"||d.key===" ")&&s(!0)},children:[t?l.jsx("img",{src:t,alt:a.titleAppIcon.appIconAlt,className:ws.iconImg}):l.jsx("div",{className:ws.placeholder,children:l.jsx(Hf,{size:24})}),t&&r&&l.jsx("button",{type:"button",className:ws.removeBtn,onClick:u,"aria-label":a.titleAppIcon.removeIconAriaLabel,children:l.jsx(ls,{size:11})})]}),n&&l.jsx(Xp,{nodeId:e,currentValue:t,onSelect:c,onClose:()=>s(!1)})]})},mM="_courseDetails_pkcf3_1",gM="_courseDetailsLoading_pkcf3_7",vM="_courseDetailsError_pkcf3_7",yM="_detailsCard_pkcf3_12",bM="_unitsCard_pkcf3_12",CM="_cardTitle_pkcf3_22",SM="_fieldGroup_pkcf3_29",xM="_fieldGroupLast_pkcf3_33",_M="_fieldLabel_pkcf3_37",wM="_fieldValue_pkcf3_47",TM="_fieldValueMultiline_pkcf3_52",EM="_unitsLabel_pkcf3_58",AM="_unitsDescription_pkcf3_68",kM="_unitList_pkcf3_74",IM="_unitCard_pkcf3_80",LM="_unitHeader_pkcf3_86",DM="_unitIcon_pkcf3_99",jM="_unitTitle_pkcf3_111",NM="_unitCount_pkcf3_120",OM="_unitBody_pkcf3_126",PM="_unitDescription_pkcf3_131",RM="_unitKeywords_pkcf3_138",FM="_keywordPill_pkcf3_145",MM="_unitTopicsRow_pkcf3_155",BM="_unitContents_pkcf3_167",qM="_contentRow_pkcf3_174",$M="_contentIcon_pkcf3_180",UM="_contentTitle_pkcf3_185",zM="_contentSkills_pkcf3_193",VM="_skillPill_pkcf3_200",Ne={courseDetails:mM,courseDetailsLoading:gM,courseDetailsError:vM,detailsCard:yM,unitsCard:bM,cardTitle:CM,fieldGroup:SM,fieldGroupLast:xM,fieldLabel:_M,fieldValue:wM,fieldValueMultiline:TM,unitsLabel:EM,unitsDescription:AM,unitList:kM,unitCard:IM,unitHeader:LM,unitIcon:DM,unitTitle:jM,unitCount:NM,unitBody:OM,unitDescription:PM,unitKeywords:RM,keywordPill:FM,unitTopicsRow:MM,unitContents:BM,contentRow:qM,contentIcon:$M,contentTitle:UM,contentSkills:zM,skillPill:VM},HM={video:_i,pdf:to,h5p:Ci,scorm:xi,audio:Si,quiz:bi,course:Cr,default:Gr};function ba(e){return Array.isArray(e)?e.map(String):e?[String(e)]:[]}const cm=({courseId:e,variant:t="compact",title:r,onLoaded:n})=>{const s=ae(),o=ur(),[i,a]=g.useState(null),[c,u]=g.useState(""),[d,f]=g.useState(null),[p,m]=g.useState({}),C=t==="full";g.useEffect(()=>{let b=!1;return a(null),u(""),f(null),QT(e).then(S=>{if(b)return;const w=(S.children??[]).map(T=>Ii(T));a(w),u(S.description??""),m(Object.fromEntries(w.map(T=>[T.id,!0]))),n==null||n({totalContents:w.reduce((T,L)=>{var A;return T+(((A=L.children)==null?void 0:A.length)??0)},0)})}).catch(()=>{b||f(s.learningPath.courseDetailsError)}),()=>{b=!0}},[e,s.learningPath.courseDetailsError]);const h=b=>m(S=>({...S,[b]:!S[b]})),v=b=>{var S;return o?ba((S=b.metadata)==null?void 0:S[o.code]):[]},y=b=>(b===1?s.learningPath.contentCountLabel:s.learningPath.contentCountLabelPlural).replace("{count}",String(b));return l.jsx("div",{className:Ne.courseDetails,children:d?l.jsx("p",{className:Ne.courseDetailsError,children:d}):i===null?l.jsx("p",{className:Ne.courseDetailsLoading,children:s.learningPath.courseDetailsLoading}):l.jsxs(l.Fragment,{children:[C&&l.jsxs("div",{className:Ne.detailsCard,children:[l.jsx("h3",{className:Ne.cardTitle,children:s.learningPath.courseDetailsCardTitle}),l.jsxs("div",{className:Ne.fieldGroup,children:[l.jsx("span",{className:Ne.fieldLabel,children:s.learningPath.courseTitleFieldLabel}),l.jsx("div",{className:Ne.fieldValue,children:r})]}),l.jsxs("div",{className:Ne.fieldGroupLast,children:[l.jsx("span",{className:Ne.fieldLabel,children:s.learningPath.courseDescriptionFieldLabel}),l.jsx("div",{className:Ne.fieldValueMultiline,children:c||s.learningPath.noCourseDescriptionPlaceholder})]})]}),i.length===0?l.jsx("p",{className:Ne.courseDetailsLoading,children:s.learningPath.courseDetailsEmpty}):l.jsxs("div",{className:C?Ne.unitsCard:void 0,children:[l.jsx("span",{className:Ne.unitsLabel,children:s.learningPath.unitsSectionLabel}),C&&l.jsx("p",{className:Ne.unitsDescription,children:s.learningPath.unitsSectionDescription}),l.jsx("div",{className:Ne.unitList,children:i.map(b=>{var L,A;const S=!!p[b.id],x=(b.children??[]).length,w=ba((L=b.metadata)==null?void 0:L.keywords),T=ba((A=b.metadata)==null?void 0:A.topic);return l.jsxs("div",{className:Ne.unitCard,children:[l.jsxs("button",{type:"button",className:Ne.unitHeader,onClick:()=>h(b.id),"aria-expanded":S,children:[S?l.jsx(Sn,{size:17}):l.jsx(kl,{size:17}),l.jsx("span",{className:Ne.unitIcon,children:l.jsx(Vf,{size:16})}),l.jsx("span",{className:Ne.unitTitle,children:b.name}),C&&l.jsx("span",{className:Ne.unitCount,children:y(x)})]}),S&&l.jsxs("div",{className:Ne.unitBody,children:[C&&b.description&&l.jsx("p",{className:Ne.unitDescription,children:b.description}),C&&w.length>0&&l.jsx("div",{className:Ne.unitKeywords,children:w.map(O=>l.jsx("span",{className:Ne.keywordPill,children:O},O))}),C&&T.length>0&&l.jsxs("div",{className:Ne.unitTopicsRow,children:[l.jsx("span",{className:Ne.fieldLabel,children:s.learningPath.unitTopicsFieldLabel}),l.jsx("span",{children:T.join(", ")})]}),l.jsx("div",{className:Ne.unitContents,children:(b.children??[]).map(O=>{const P=lo(O),j=HM[P.key]??Gr,N=v(O);return l.jsxs("div",{className:Ne.contentRow,children:[l.jsx(j,{size:16,className:Ne.contentIcon}),l.jsx("span",{className:Ne.contentTitle,children:O.name}),N.length>0&&l.jsx("div",{className:Ne.contentSkills,children:N.map(F=>l.jsx("span",{className:Ne.skillPill,children:F},F))})]},O.id)})})]})]},b.id)})})]})]})})},QM="_backToPathButton_1u4o4_1",WM="_assessmentTitle_1u4o4_15",GM="_slotPills_1u4o4_22",KM="_slotPill_1u4o4_22",YM="_slotPillHint_1u4o4_40",ZM="_slotPillPurpose_1u4o4_45",XM="_slotPillWarning_1u4o4_51",JM="_slotPillPrimary_1u4o4_56",e2="_courseCard_1u4o4_62",t2="_courseCardHeading_1u4o4_72",r2="_courseCardDescription_1u4o4_79",n2="_courseNotAdded_1u4o4_85",s2="_assessmentExplainer_1u4o4_93",o2="_assessmentExplainerHeading_1u4o4_107",i2="_leafContentLayout_1u4o4_117",a2="_container_1u4o4_131",l2="_emptyState_1u4o4_140",c2="_titleRow_1u4o4_150",u2="_titleRowLp_1u4o4_157",d2="_nodeTitle_1u4o4_171",f2="_nodeTitleLpRoot_1u4o4_193",h2="_nodeTitleSub_1u4o4_198",p2="_courseDetailHeader_1u4o4_203",m2="_courseDetailIcon_1u4o4_210",g2="_courseDetailTitle_1u4o4_222",v2="_courseDetailMeta_1u4o4_229",y2="_formArea_1u4o4_234",b2="_contentListArea_1u4o4_238",C2="_contentListAreaLp_1u4o4_242",S2="_dropZone_1u4o4_246",x2="_reviewComment_1u4o4_253",_2="_reviewCommentLabel_1u4o4_266",w2="_reviewCommentText_1u4o4_272",ke={backToPathButton:QM,assessmentTitle:WM,slotPills:GM,slotPill:KM,slotPillHint:YM,slotPillPurpose:ZM,slotPillWarning:XM,slotPillPrimary:JM,courseCard:e2,courseCardHeading:t2,courseCardDescription:r2,courseNotAdded:n2,assessmentExplainer:s2,assessmentExplainerHeading:o2,leafContentLayout:i2,container:a2,emptyState:l2,titleRow:c2,titleRowLp:u2,nodeTitle:d2,nodeTitleLpRoot:f2,nodeTitleSub:h2,courseDetailHeader:p2,courseDetailIcon:m2,courseDetailTitle:g2,courseDetailMeta:v2,formArea:y2,contentListArea:b2,contentListAreaLp:C2,dropZone:S2,reviewComment:x2,reviewCommentLabel:_2,reviewCommentText:w2},T2=({slot:e,isEditable:t})=>{var m;const r=ae(),n=se(C=>C.treeData),s=se(C=>C.selectNode),o=(m=n[0])==null?void 0:m.id,{pre:i,post:a}=Yl(),c=(e==="pre"?i:a).filled,u=e==="pre"?r.learningPath.priorAssessmentLabel:r.learningPath.outcomeAssessmentLabel,d=e==="pre"?Bn:Ty,f=e==="pre"?r.learningPath.priorAssessmentExplainerTitle:r.learningPath.outcomeAssessmentExplainerTitle,p=e==="pre"?r.learningPath.priorAssessmentExplainerBody:r.learningPath.outcomeAssessmentExplainerBody;return l.jsxs("div",{className:ke.container,children:[l.jsxs("button",{type:"button",className:ke.backToPathButton,onClick:()=>o&&s(o),children:[l.jsx(Al,{size:14})," ",r.learningPath.backToPathButton]}),l.jsx("div",{className:ke.assessmentTitle,children:u}),l.jsx("div",{className:ke.slotPills,children:e==="pre"?l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:`${ke.slotPill} ${ke.slotPillHint}`,children:[l.jsx(Dc,{size:12})," ",r.learningPath.priorAssessmentHint]}),l.jsxs("span",{className:`${ke.slotPill} ${ke.slotPillPurpose}`,children:[l.jsx(_y,{size:12})," ",r.learningPath.priorAssessmentPurposeLabel]})]}):l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:`${ke.slotPill} ${ke.slotPillWarning}`,children:[l.jsx(Qf,{size:12})," ",r.learningPath.outcomeUnlocksHint]}),l.jsxs("span",{className:`${ke.slotPill} ${ke.slotPillPrimary}`,children:[l.jsx(Dc,{size:12})," ",r.learningPath.outcomeAssessmentHint]})]})}),l.jsxs("div",{className:ke.formArea,children:[l.jsxs("div",{className:ke.courseCard,children:[l.jsx("div",{className:ke.courseCardHeading,children:r.learningPath.assessmentCourseSectionTitle}),l.jsx("p",{className:ke.courseCardDescription,children:r.learningPath.assessmentCourseSectionDescription}),c?l.jsx(ml,{slot:e,isEditable:t}):l.jsx("div",{className:ke.courseNotAdded,children:r.learningPath.assessmentNotAddedYet})]}),l.jsxs("div",{className:ke.assessmentExplainer,children:[l.jsxs("div",{className:ke.assessmentExplainerHeading,children:[l.jsx(d,{size:16}),l.jsx("span",{children:f})]}),l.jsx("p",{children:p})]})]})]})},E2="application/vnd.sunbird.questionset",um="application/vnd.sunbird.question",A2=[E2,um];function Od(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 k2=({editorMode:e,onToolbarEvent:t})=>{var V,de,oe,Se,ve;const r=ae(),[n,s]=g.useState("details"),[o,i]=g.useState([]),[a,c]=g.useState(null),[u,d]=g.useState(!1),[f,p]=g.useState(null),m=g.useRef(null),C=g.useRef(),{selectedNodeId:h,breadcrumb:v,activeNodeMeta:y,updateNode:b,treeData:S,selectNode:x}=se(),w=rt(q=>q.activeAssessmentSlot),T=X(q=>{var M,$,ne,ie;return(($=(M=q.editorConfig)==null?void 0:M.context)==null?void 0:$.contentId)??((ie=(ne=q.editorConfig)==null?void 0:ne.context)==null?void 0:ie.identifier)??""}),L=X(q=>q.editorProfile.competencyScoped),A=h?dm(S,h):null;g.useEffect(()=>{p(null)},[A==null?void 0:A.identifier]);const O=!!A&&!A.parent,P=!!(A!=null&&A.isFolder),j=A&&A2.includes(A.mimeType??""),N=(A==null?void 0:A.mimeType)===um,F=A&&!A.isFolder&&!j&&!O,U=L&&P&&nt(A??void 0)?((oe=(de=(V=S[0])==null?void 0:V.children)==null?void 0:de[0])==null?void 0:oe.id)===(A==null?void 0:A.id)?"pre":"post":L?w:null,re=Od(A)??(O?Od(S[0]):void 0),G=g.useCallback(()=>{const q=m.current;if(!q||!h)return;const M=q.innerText.trim();clearTimeout(C.current),C.current=setTimeout(()=>{b(h,{name:M})},600)},[h,b]),pe=g.useCallback(q=>{t({action:"onFormValueChange",data:q})},[t]),me=g.useCallback((q,M)=>{i(M),t({action:"onFormStatusChange",data:{isValid:q,nodeId:h}})},[t,h]);if(!A)return l.jsx("div",{className:ke.emptyState,children:l.jsx("p",{children:r.contextualEditor.emptyStateMessage})});if(j)return l.jsx(gl,{node:A,editorMode:e,type:"quml",singleQuestion:N});if(L&&F&&(A.primaryCategory==="Course"||qn(A))){const q=A.parent?lT(((Se=S[0])==null?void 0:Se.children)??[],A.parent):null,M=(q==null?void 0:q.role)==="pre"?r.learningPath.priorAssessmentLabel:(q==null?void 0:q.role)==="post"?r.learningPath.outcomeAssessmentLabel:(q==null?void 0:q.role)==="level"?r.learningPath.levelNumberPrefix.replace("{n}",String(q.levelNumber)):null,$=f===null?"":` · ${(f===1?r.learningPath.contentCountLabel:r.learningPath.contentCountLabelPlural).replace("{count}",String(f))}`;return l.jsxs("div",{className:ke.container,children:[l.jsxs("button",{type:"button",className:ke.backToPathButton,onClick:()=>A.parent&&x(A.parent),children:[l.jsx(Al,{size:14}),M?r.learningPath.backToLevelButton.replace("{label}",M):r.learningPath.backToPathButton]}),l.jsxs("div",{className:ke.courseDetailHeader,children:[l.jsx("span",{className:ke.courseDetailIcon,children:l.jsx(Cr,{size:26})}),l.jsxs("div",{children:[l.jsx("h2",{className:ke.courseDetailTitle,children:A.name}),l.jsxs("span",{className:ke.courseDetailMeta,children:[A.primaryCategory,$]})]})]}),l.jsx(cm,{courseId:A.identifier,variant:"full",title:A.name,onLoaded:({totalContents:ne})=>p(ne)},A.identifier)]})}return U?l.jsx(T2,{slot:U,isEditable:e==="edit"}):F?l.jsxs("div",{className:ke.leafContentLayout,children:[l.jsx(gl,{node:A,editorMode:e,type:"content",layout:"flow"}),l.jsx(lM,{node:A,editorMode:e,onMoveClick:()=>c(A.identifier),reorderDialog:a?l.jsx(IF,{resourceId:a,resourceName:A.name,currentUnitId:A.parent??"",onClose:()=>c(null)}):null})]}):l.jsxs("div",{className:ke.container,children:[l.jsx(UD,{crumbs:v}),re&&l.jsxs("div",{className:ke.reviewComment,role:"alert",children:[l.jsx("span",{className:ke.reviewCommentLabel,children:r.contextualEditor.reviewCommentLabel}),l.jsx("span",{className:ke.reviewCommentText,children:re})]}),l.jsxs("div",{className:[ke.titleRow,L?ke.titleRowLp:""].filter(Boolean).join(" "),children:[O&&h&&l.jsx(pM,{nodeId:h,value:String(A.appIcon??((ve=A.metadata)==null?void 0:ve.appIcon)??""),editable:e==="edit"}),l.jsx("div",{ref:m,className:[ke.nodeTitle,L&&O?ke.nodeTitleLpRoot:"",L&&!O?ke.nodeTitleSub:""].filter(Boolean).join(" "),contentEditable:e==="edit",suppressContentEditableWarning:!0,onInput:G,onBlur:G,"data-placeholder":r.contextualEditor.untitledPlaceholder,"aria-label":r.contextualEditor.nodeTitleAriaLabel,children:A.name})]}),l.jsx(GD,{activeTab:n,onChange:q=>s(q),errorTabs:o,visibleTabs:O&&!L?void 0:["details"]}),l.jsx("div",{className:ke.formArea,children:l.jsx(zO,{nodeMetadata:y,activeTab:n,isRoot:O,isFolder:P,editorMode:e,onFormValueChange:pe,onFormStatusChange:me},`${h??"none"}:${O?"root":"node"}`)}),(P||O)&&n==="details"&&l.jsx("div",{className:[ke.contentListArea,L?ke.contentListAreaLp:""].filter(Boolean).join(" "),children:l.jsx(yR,{editorMode:e,isRoot:O})}),l.jsx(SR,{isActive:!1,label:r.contextualEditor.dropZoneLabel,nodeId:h??void 0,className:ke.dropZone}),u&&l.jsx($F,{contentId:T,onClose:()=>d(!1)})]})};function dm(e,t){for(const r of e){if(r.id===t)return r;if(r.children){const n=dm(r.children,t);if(n)return n}}}const fm=ro((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 o=[...t().allContent,...r];e({allContent:o,totalCount:n,offset:o.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:s}=t();let o=r;if(n&&n!=="all"){const i=n.toLowerCase();o=o.filter(a=>[a.mimeType??"",a.primaryCategory??"",a.contentType??""].join(" ").toLowerCase().includes(i))}if(s&&s.trim()!==""){const i=s.toLowerCase().trim();o=o.filter(a=>(a.name??"").toLowerCase().includes(i))}e({filteredContent:o})}}));function I2(e,t,r,n,s){const o={primaryCategory:[t?_h:"Course"]};return s&&(o.framework=[s]),!e&&r.length&&n&&(o[n]=r),o}function L2(e,t){if(!(!e||!t))return[...Sh,t,"framework"]}function D2(e,t,r,n,s,o=!1){return!e||o?null:t?r&&!n&&s.length===0?"noSkills":null:"noCurriculum"}const j2=20,N2=[];function hm(){var d;const e=X(f=>f.editorConfig),t=X(f=>f.editorProfile),r=se(f=>f.selectedNodeId),n=se(f=>f.treeData);if(t.restrictedContentCategories)return t.restrictedContentCategories;const s=g.useCallback(()=>{if(!r||!n.length)return 0;function f(p,m,C=0){var h;for(const v of p){if(v.id===m)return C;if((h=v.children)!=null&&h.length){const y=f(v.children,m,C+1);if(y>=0)return y}}return-1}return Math.max(0,f(n,r))},[r,n])(),o=(d=e==null?void 0:e.config)==null?void 0:d.hierarchy;if(!o)return[...ud];const i=`level${s}`,a=o[i],c=a==null?void 0:a.children,u=c==null?void 0:c.Content;return u!=null&&u.length?u:[...ud]}function O2(){const e=fm(),t=X(P=>{var j,N;return((N=(j=P.editorConfig)==null?void 0:j.context)==null?void 0:N.channel)??""}),r=hm(),n=X(P=>P.editorProfile),s=rt(P=>P.activeAssessmentSlot),o=rt(P=>P.activeLevelExamTarget),i=se(P=>P.activeNodeMeta),a=se(P=>P.treeData),c=se(P=>P.treeCache),u=se(P=>P.selectedNodeId),d=se(P=>P.getNodeById),f=ur(),p=n.competencyScoped?Th(a[0],c):void 0,m=g.useRef(),C=f&&Array.isArray(i[f.code])?i[f.code]:N2,h=u?d(u):void 0,v=n.competencyScoped&&!!(h!=null&&h.isFolder)&&!!h.parent&&!nt(h),y=!!s||!!o,b=D2(n.competencyScoped,p,v,s,C,y),S=g.useCallback(async(P="",j="all",N={},F=!0,R=!1)=>{var U,re,G,pe,me;e.setLoading(!0);try{if(b){e.setContent([],0);return}let V;if(n.competencyScoped){const ve=I2(s,y,C,f==null?void 0:f.code,p);V={status:["Live"],...ve}}else V={status:["Live"],primaryCategory:j&&j!=="all"?[j]:r},(U=N==null?void 0:N.board)!=null&&U.length&&(V.board=N.board),(re=N==null?void 0:N.medium)!=null&&re.length&&(V.medium=N.medium),(G=N==null?void 0:N.gradeLevel)!=null&&G.length&&(V.gradeLevel=N.gradeLevel),(pe=N==null?void 0:N.subject)!=null&&pe.length&&(V.subject=N.subject),(me=N==null?void 0:N.primaryCategory)!=null&&me.length&&(V.primaryCategory=N.primaryCategory);const de=F?0:e.offset,{content:oe,count:Se}=await oT({filters:V,query:P,limit:P?50:j2,offset:de,channel:t||void 0,sortBy:R?{name:"asc"}:{lastUpdatedOn:"desc"},fields:L2(n.competencyScoped,f==null?void 0:f.code)});F?e.setContent(oe,Se):e.appendContent(oe,Se)}catch(V){console.error("[useLibrary] load error:",V)}finally{e.setLoading(!1)}},[r,t,n,s,y,C,f,p,b]);g.useEffect(()=>{clearTimeout(m.current),e.setSearch("")},[p]),g.useEffect(()=>{S()},[t,n.key]),g.useEffect(()=>{n.competencyScoped&&S()},[n.competencyScoped,s,o,C.join("|"),p,u]);const x=g.useCallback(P=>{e.setSearch(P),clearTimeout(m.current),m.current=setTimeout(()=>S(P,e.activeFilter,e.advancedFilters,!0,e.sortAZ),300)},[e.activeFilter,e.advancedFilters,e.sortAZ,S]),w=g.useCallback(P=>{e.setFilter(P),S(e.searchQuery,P,e.advancedFilters,!0,e.sortAZ)},[e.searchQuery,e.advancedFilters,e.sortAZ,S]),T=g.useCallback(P=>{e.setAdvancedFilters(P),S(e.searchQuery,e.activeFilter,P,!0,e.sortAZ)},[e.searchQuery,e.activeFilter,e.sortAZ,S]),L=g.useCallback(()=>{const P=!e.sortAZ;e.setSortAZ(P),S(e.searchQuery,e.activeFilter,e.advancedFilters,!0,P)},[e.sortAZ,e.searchQuery,e.activeFilter,e.advancedFilters,S]),A=g.useCallback(()=>{e.isLoading||S(e.searchQuery,e.activeFilter,e.advancedFilters,!1,e.sortAZ)},[e.isLoading,e.searchQuery,e.activeFilter,e.advancedFilters,e.sortAZ,S]),O=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:O,search:x,setFilter:w,applyAdvancedFilters:T,toggleSort:L,loadMore:A,refetch:()=>S(e.searchQuery,e.activeFilter,e.advancedFilters,!0,e.sortAZ),activeAssessmentSlot:s,emptyReason:b}}function pm(){var c;const e=ae(),t=X(u=>u.editorProfile.competencyScoped),r=rt(u=>u.activeAssessmentSlot),n=rt(u=>u.activeLevelExamTarget),s=se(u=>u.selectedNodeId),o=se(u=>u.treeData),i=se(u=>u.getNodeById),a=(c=o[0])==null?void 0:c.id;if(!t)return null;if(r==="pre")return e.learningPath.libraryAddPriorAssessmentCourse;if(r==="post")return e.learningPath.libraryAddOutcomeAssessmentCourse;if(n){const u=i(n);return e.learningPath.libraryAddLevelExamCourse.replace("{level}",(u==null?void 0:u.name)??"")}if(s&&s!==a){const u=i(s);if(u!=null&&u.isFolder)return e.learningPath.libraryAddToLevel.replace("{level}",u.name??"")}return e.learningPath.libraryOpenLevelToAdd}const P2="_card_1o49q_1",R2="_addBtn_1o49q_17",F2="_dragging_1o49q_24",M2="_ctIcon_1o49q_29",B2="_info_1o49q_33",q2="_name_1o49q_41",$2="_meta_1o49q_50",U2="_skillTags_1o49q_58",z2="_skillTag_1o49q_58",V2="_addBtnMuted_1o49q_93",H2="_added_1o49q_102",Q2="_addedBadge_1o49q_111",Yt={card:P2,addBtn:R2,dragging:F2,ctIcon:M2,info:B2,name:q2,meta:$2,skillTags:U2,skillTag:z2,addBtnMuted:V2,added:H2,addedBadge:Q2},W2={video:_i,pdf:to,h5p:Ci,scorm:xi,audio:Si,quiz:bi,course:Cr,default:Gr},G2=({item:e,onAdd:t,onPreview:r,isDraggable:n,isAdded:s})=>{var S,x;const o=ae(),i=lo(e),a=W2[i.key]??Gr,c=Kl(),u=bL(),d=c&&!s&&u,f=X(w=>w.editorProfile.competencyScoped),p=ur(),m=f&&p?(()=>{const w=e[p.code];return Array.isArray(w)?w:w?[String(w)]:[]})():[],{attributes:C,listeners:h,setNodeRef:v,isDragging:y}=Mf({id:e.identifier,disabled:!n||!c||!u,data:{type:"library-item",item:e}}),b=()=>{r&&r(e)};return l.jsxs("div",{ref:v,className:[Yt.card,y?Yt.dragging:"",s?Yt.added:""].join(" "),"aria-label":e.name,...n?{...C,...h}:{},role:"listitem",onClick:b,children:[l.jsx("span",{className:[`sbx-ct-sq--${i.key}`,Yt.ctIcon].join(" "),"aria-hidden":"true",children:l.jsx(a,{size:14})}),l.jsxs("div",{className:Yt.info,children:[l.jsx("span",{className:Yt.name,title:e.name,children:e.name}),l.jsxs("span",{className:Yt.meta,children:[((S=e.organisation)==null?void 0:S[0])??e.channel??"",(x=e.organisation)!=null&&x[0]&&e.primaryCategory?" · ":"",e.primaryCategory??""]}),m.length>0&&l.jsx("span",{className:Yt.skillTags,children:m.slice(0,3).map(w=>l.jsx("span",{className:Yt.skillTag,children:w},w))})]}),s&&l.jsx("span",{className:Yt.addedBadge,"aria-label":o.libraryCard.alreadyAddedAriaLabel,title:o.libraryCard.alreadyAddedTitle,children:l.jsx(Cn,{size:12})}),!s&&n&&l.jsx("button",{type:"button",className:[Yt.addBtn,!d&&c?Yt.addBtnMuted:""].join(" "),onClick:w=>{w.stopPropagation(),t(e)},disabled:!c,"aria-disabled":!d,"aria-label":o.libraryCard.addItemAriaLabel.replace("{name}",e.name),title:c?u?o.libraryCard.addToUnitTitle:o.libraryCard.selectUnitToAddTitle:o.libraryCard.draftOnlyTitle,children:l.jsx(kr,{size:14})})]})},K2="_chips_xhhaq_1",Y2="_chip_xhhaq_1",Pd={chips:K2,chip:Y2},Z2=({filters:e,active:t,onChange:r})=>{const n=ae();return l.jsx("div",{className:Pd.chips,role:"group","aria-label":n.filterChips.contentTypeFiltersAriaLabel,children:e.map(s=>l.jsx("button",{type:"button",role:"radio","aria-checked":t===s.value,className:["sbx-chip",t===s.value?"filled":"outline",Pd.chip].join(" "),onClick:()=>r(s.value),children:s.label},s.value))})},X2="_panel_1iejx_1",J2="_header_1iejx_10",eB="_headerTitle_1iejx_19",tB="_closeBtn_1iejx_25",rB="_body_1iejx_43",nB="_section_1iejx_59",sB="_sectionLabel_1iejx_65",oB="_chips_1iejx_73",iB="_chip_1iejx_73",aB="_active_1iejx_96",lB="_footer_1iejx_102",cB="_resetBtn_1iejx_112",uB="_applyBtn_1iejx_129",pt={panel:X2,header:J2,headerTitle:eB,closeBtn:tB,body:rB,section:nB,sectionLabel:sB,chips:oB,chip:iB,active:aB,footer:lB,resetBtn:cB,applyBtn:uB},dB=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}],fB=new Set(["board","medium","gradeLevel","subject","topic"]),hB=({local:e,toggle:t})=>{const r=ae(),n=hm();return n.length?l.jsxs("div",{className:pt.section,children:[l.jsx("div",{className:pt.sectionLabel,children:r.libraryFilterPanel.primaryCategoryLabel}),l.jsx("div",{className:pt.chips,children:n.map(s=>l.jsx("button",{type:"button",className:[pt.chip,(e.primaryCategory??[]).includes(s)?pt.active:""].join(" "),onClick:()=>t("primaryCategory",s),children:s},s))})]}):null},pB=({isOpen:e,filters:t,onApply:r,onClose:n})=>{var v,y;const s=ae(),o=X(b=>b.editorConfig),i=X(b=>b.searchFormConfig),a=X(b=>b.contentFramework),c=X(b=>b.contentTargetFWIds),{organisationFramework:u}=ki(a??((v=o==null?void 0:o.context)==null?void 0:v.framework),c??((y=o==null?void 0:o.context)==null?void 0:y.targetFWIds)),[d,f]=g.useState(t),p=i!=null&&i.length?i.filter(b=>fB.has(b.code)).map(b=>({key:b.code,label:b.label||b.code})):dB(s);g.useEffect(()=>{f(t)},[t]);const m=(b,S)=>{f(x=>{const w=x[b]??[],T=w.includes(S)?w.filter(L=>L!==S):[...w,S];return{...x,[b]:T}})},C=(u==null?void 0:u.categories)??[],h=b=>{var S;return((S=C.find(x=>x.code===b))==null?void 0:S.terms)??[]};return e?l.jsxs("div",{className:pt.panel,role:"dialog","aria-label":s.libraryFilterPanel.filterLibraryAriaLabel,"aria-modal":"true",children:[l.jsxs("div",{className:pt.header,children:[l.jsx("span",{className:pt.headerTitle,children:s.libraryFilterPanel.filtersHeaderTitle}),l.jsx("button",{type:"button",className:pt.closeBtn,onClick:n,"aria-label":s.libraryFilterPanel.closeFiltersAriaLabel,children:l.jsx(lr,{size:16})})]}),l.jsxs("div",{className:pt.body,children:[p.map(({key:b,label:S})=>{const x=h(b);return x.length?l.jsxs("div",{className:pt.section,children:[l.jsx("div",{className:pt.sectionLabel,children:S}),l.jsx("div",{className:pt.chips,children:x.slice(0,20).map(w=>l.jsx("button",{type:"button",className:[pt.chip,(d[b]??[]).includes(w.name)?pt.active:""].join(" "),onClick:()=>m(b,w.name),children:w.name},w.identifier))})]},b):null}),l.jsx(hB,{local:d,toggle:m})]}),l.jsxs("div",{className:pt.footer,children:[l.jsx("button",{type:"button",className:pt.resetBtn,onClick:()=>f({}),children:s.libraryFilterPanel.resetButton}),l.jsx("button",{type:"button",className:pt.applyBtn,onClick:()=>{r(d),n()},children:s.libraryFilterPanel.applyButton})]})]}):null},mB="_header_1n6zo_10",gB="_headerCourse_1n6zo_20",vB="_courseIcon_1n6zo_25",yB="_titleGroup_1n6zo_37",bB="_courseMeta_1n6zo_45",CB="_title_1n6zo_37",SB="_headerActions_1n6zo_67",xB="_iconBtn_1n6zo_74",_B="_playerArea_1n6zo_92",wB="_footer_1n6zo_100",TB="_footerCourse_1n6zo_109",EB="_addBtn_1n6zo_115",AB="_addBtnCourse_1n6zo_134",kB="_modalOverlay_1n6zo_159",IB="_modalOverlayCourse_1n6zo_174",LB="_modalPanel_1n6zo_178",DB="_modalPanelCourse_1n6zo_190",vt={header:mB,headerCourse:gB,courseIcon:vB,titleGroup:yB,courseMeta:bB,title:CB,headerActions:SB,iconBtn:xB,playerArea:_B,footer:wB,footerCourse:TB,addBtn:EB,addBtnCourse:AB,modalOverlay:kB,modalOverlayCourse:IB,modalPanel:LB,modalPanelCourse:DB},jB="application/vnd.sunbird.questionset",NB=({content:e,editorMode:t,onAdd:r,onClose:n})=>{var f;const s=ae(),o=t==="edit",i=X(p=>p.editorProfile.competencyScoped),a=pm();if(!e)return null;const c=i&&e.primaryCategory==="Course",u=[((f=e.organisation)==null?void 0:f[0])??e.channel??"",e.primaryCategory??""].filter(Boolean).join(" • "),d={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 Tr.createPortal(l.jsx("div",{className:[vt.modalOverlay,c?vt.modalOverlayCourse:""].filter(Boolean).join(" "),role:"dialog","aria-modal":"true","aria-label":s.libraryPreviewPanel.contentPreviewAriaLabel,onClick:n,children:l.jsxs("div",{className:[vt.modalPanel,c?vt.modalPanelCourse:""].filter(Boolean).join(" "),onClick:p=>p.stopPropagation(),children:[l.jsxs("div",{className:[vt.header,c?vt.headerCourse:""].filter(Boolean).join(" "),children:[c&&l.jsx("span",{className:vt.courseIcon,children:l.jsx(Cr,{size:20})}),l.jsxs("div",{className:vt.titleGroup,children:[l.jsx("span",{className:vt.title,title:e.name,children:e.name}),c&&u&&l.jsx("span",{className:vt.courseMeta,children:u})]}),l.jsx("div",{className:vt.headerActions,children:l.jsx("button",{type:"button",className:vt.iconBtn,onClick:n,"aria-label":s.libraryPreviewPanel.closePreviewAriaLabel,children:l.jsx(lr,{size:16})})})]}),l.jsx("div",{className:vt.playerArea,children:c?l.jsx(cm,{courseId:e.identifier}):l.jsx(gl,{node:d,editorMode:"read",type:e.mimeType===jB?"quml":"content"})}),o&&l.jsx("div",{className:[vt.footer,c?vt.footerCourse:""].filter(Boolean).join(" "),children:c?l.jsxs("button",{type:"button",className:vt.addBtnCourse,onClick:()=>r(e),children:[l.jsx(kr,{size:15})," ",a??s.libraryPreviewPanel.addToUnitButton]}):l.jsx("button",{type:"button",className:vt.addBtn,onClick:()=>r(e),children:s.libraryPreviewPanel.addToUnitButton})})]})}),document.body)},OB="_dock_j39wj_1",PB="_header_j39wj_8",RB="_libraryTargetLabel_j39wj_18",FB="_libraryTargetChip_j39wj_28",MB="_headerLeft_j39wj_46",BB="_headerTitle_j39wj_54",qB="_count_j39wj_60",$B="_searchRow_j39wj_69",UB="_searchWrap_j39wj_77",zB="_searchIcon_j39wj_83",VB="_searchInput_j39wj_92",HB="_filterToggleBtn_j39wj_110",QB="_filterToggleBtnActive_j39wj_129",WB="_filterBadge_j39wj_135",GB="_filters_j39wj_154",KB="_mainArea_j39wj_164",YB="_sidePanelOverlay_j39wj_173",ZB="_cardList_j39wj_182",XB="_skeleton_j39wj_198",JB="_skeletonIcon_j39wj_208",eq="_skeletonText_j39wj_216",tq="_skeletonLine_j39wj_223",rq="_skeletonLineSm_j39wj_230",nq="_loadMoreBtn_j39wj_245",sq="_emptyState_j39wj_270",oq="_collapseBtn_j39wj_290",ze={dock:OB,header:PB,libraryTargetLabel:RB,libraryTargetChip:FB,headerLeft:MB,headerTitle:BB,count:qB,searchRow:$B,searchWrap:UB,searchIcon:zB,searchInput:VB,filterToggleBtn:HB,filterToggleBtnActive:QB,filterBadge:WB,filters:GB,mainArea:KB,sidePanelOverlay:YB,cardList:ZB,skeleton:XB,skeletonIcon:JB,skeletonText:eq,skeletonLine:tq,skeletonLineSm:rq,loadMoreBtn:nq,emptyState:sq,collapseBtn:oq},iq=[{label:"Courses",value:"all"}];function aq(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 lq=({editorMode:e,collapsed:t=!1,onToggleCollapse:r})=>{const n=ae(),{content:s,isLoading:o,totalCount:i,activeFilter:a,searchQuery:c,sortAZ:u,hasMore:d,search:f,setFilter:p,applyAdvancedFilters:m,toggleSort:C,loadMore:h,activeAssessmentSlot:v,emptyReason:y}=O2(),{addResource:b,selectedNodeId:S,treeData:x,treeCache:w}=se(),T=rt($=>$.setActiveAssessmentSlot),L=rt($=>$.activeLevelExamTarget),A=rt($=>$.setActiveLevelExamTarget),O=X($=>$.editorProfile.competencyScoped),P=X($=>$.editorProfile.restrictedContentCategories),j=e==="edit",N=pm(),[F,R]=g.useState(!1),[U,re]=g.useState({}),[G,pe]=g.useState(null),me=g.useMemo(()=>aq(x),[x]),V=g.useCallback(($,ne)=>{var fe,ge;const ie=(fe=x[0])==null?void 0:fe.id;if(!ie)return;if(qs(((ge=x[0])==null?void 0:ge.children)??[],ne)){ye.error(ne==="pre"?n.learningPath.priorSlotFilledToast:n.learningPath.outcomeSlotFilledToast);return}if(!qn($)){ye.error(n.learningPath.notAssessmentCourseToast.replace("{name}",$.name));return}if(b($,ie,{isAssessmentCourse:!0,slot:ne})===!1){ye.error(n.learningPath.bothSlotsFilledToast);return}ye.success(n.libraryDock.itemAddedToast.replace("{name}",$.name)),T(null)},[x,b,T,n]),de=g.useCallback(($,ne)=>{var ge;const ie=se.getState().getNodeById(ne);if(!ie)return;if(wh(ie)){ye.error(n.learningPath.levelExamAlreadyFilledToast);return}if(!qn($)){ye.error(n.learningPath.notAssessmentCourseToast.replace("{name}",$.name));return}const xe=((ge=x[0])==null?void 0:ge.children)??[];if(au(xe,ie)){ye.error(n.learningPath.levelNeedsMixedContentToast);return}if(b($,ne,{isAssessmentCourse:!0})===!1){ye.error(n.learningPath.itemAlreadyInPathToast.replace("{name}",$.name));return}ye.success(n.libraryDock.itemAddedToast.replace("{name}",$.name)),A(null)},[x,b,A,n]),oe=g.useCallback($=>{var fe,ge,Ae,J;if(v){V($,v);return}if(L){de($,L);return}if(O&&!Eh(x[0],w)){ye.error(n.learningPath.selectCurriculumFirstToast);return}if(!S){ye.error(O?n.learningPath.selectLevelFirstToast:n.libraryDock.selectUnitFirstToast);return}const ne=(fe=x[0])==null?void 0:fe.id,ie=se.getState().getNodeById(S);if(O){const he=((ge=x[0])==null?void 0:ge.children)??[],Q=ie!=null&&ie.isFolder?ie:ie!=null&&ie.parent?se.getState().getNodeById(ie.parent):void 0;if(Q&&Za(he,Q)){const Ce=(Ae=he[0])==null?void 0:Ae.id;ye.error(Q.id===Ce?n.learningPath.priorSlotFilledToast:n.learningPath.outcomeSlotFilledToast);return}}if(S===ne||!(ie!=null&&ie.isFolder)){ye(O?n.learningPath.selectLevelFromOutlineToast:n.libraryDock.selectUnitFromOutlineToast,{icon:l.jsx(Bn,{size:16}),duration:4e3});return}if(O&&au(((J=x[0])==null?void 0:J.children)??[],ie)&&qn($)){ye.error(n.learningPath.levelNeedsMixedContentToast);return}if(b($,S)===!1){ye.error((O?n.learningPath.itemAlreadyInPathToast:n.libraryDock.itemAlreadyAddedToast).replace("{name}",$.name));return}ye.success(n.libraryDock.itemAddedToast.replace("{name}",$.name))},[v,V,L,de,S,b,x,w,n,O]),Se=g.useCallback($=>{re($),m($)},[m]),ve=g.useCallback($=>{pe($)},[]),q=g.useCallback($=>{oe($),pe(null)},[oe]),M=g.useMemo(()=>Object.values(U).reduce(($,ne)=>$+((ne==null?void 0:ne.length)??0),0),[U]);return l.jsxs("div",{className:ze.dock,children:[l.jsxs("div",{className:ze.header,children:[l.jsxs("div",{className:ze.headerLeft,children:[l.jsx("button",{type:"button",className:ze.collapseBtn,onClick:r,"aria-label":n.libraryDock.collapseLibraryPanelAriaLabel,title:n.libraryDock.collapseLibraryTitle,children:l.jsx(By,{size:15})}),l.jsx(Py,{size:16}),l.jsx("span",{className:ze.headerTitle,children:n.libraryDock.headerTitle}),i>0&&l.jsx("span",{className:ze.count,children:i})]}),N&&(v||L?l.jsxs("button",{type:"button",className:ze.libraryTargetChip,onClick:()=>T(null),"aria-label":n.libraryDock.cancelTargetAriaLabel,title:n.libraryDock.cancelTargetAriaLabel,children:[l.jsx("span",{className:ze.libraryTargetLabel,children:N}),l.jsx(lr,{size:11,"aria-hidden":"true"})]}):l.jsx("span",{className:ze.libraryTargetLabel,children:N}))]}),l.jsxs("div",{className:ze.searchRow,children:[l.jsxs("div",{className:ze.searchWrap,children:[l.jsx(Jo,{size:14,className:ze.searchIcon}),l.jsx("input",{type:"search",className:ze.searchInput,placeholder:n.libraryDock.searchPlaceholder,value:c,onChange:$=>f($.target.value),"aria-label":n.libraryDock.searchAriaLabel})]}),l.jsx("button",{type:"button",className:[ze.filterToggleBtn,u?ze.filterToggleBtnActive:""].join(" "),onClick:C,"aria-label":u?n.libraryDock.sortAZAriaLabel:n.libraryDock.sortRecentAriaLabel,title:u?n.libraryDock.sortAZTitle:n.libraryDock.sortRecentTitle,children:u?l.jsx(wy,{size:15}):l.jsx(Iy,{size:15})}),!O&&l.jsxs("button",{type:"button",className:[ze.filterToggleBtn,F?ze.filterToggleBtnActive:""].join(" "),onClick:()=>R($=>!$),"aria-label":n.libraryDock.toggleAdvancedFiltersAriaLabel,"aria-pressed":F,title:n.libraryDock.advancedFiltersTitle,children:[l.jsx(Wy,{size:15}),M>0&&l.jsx("span",{className:ze.filterBadge,children:M})]})]}),l.jsx("div",{className:ze.filters,children:l.jsx(Z2,{filters:O?iq:P?[fa[0],...fa.filter($=>P.includes($.value))]:fa,active:a,onChange:p})}),l.jsxs("div",{className:ze.mainArea,children:[l.jsx("div",{className:ze.cardList,role:"list","aria-label":n.libraryDock.libraryContentAriaLabel,children:o&&s.length===0?Array.from({length:4}).map(($,ne)=>l.jsxs("div",{className:ze.skeleton,"aria-hidden":"true",children:[l.jsx("div",{className:ze.skeletonIcon}),l.jsxs("div",{className:ze.skeletonText,children:[l.jsx("div",{className:ze.skeletonLine}),l.jsx("div",{className:ze.skeletonLineSm})]})]},ne)):s.length>0?l.jsxs(l.Fragment,{children:[s.map($=>l.jsx(G2,{item:$,onAdd:oe,onPreview:ve,isDraggable:j,isAdded:me.has($.identifier)},$.identifier)),d&&l.jsx("button",{type:"button",className:ze.loadMoreBtn,onClick:h,disabled:o,"aria-label":n.libraryDock.loadMoreAriaLabel,children:o?n.libraryDock.loadingText:n.libraryDock.loadMoreText})]}):l.jsxs("div",{className:ze.emptyState,children:[l.jsx(Jo,{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:ze.sidePanelOverlay,children:l.jsx(pB,{isOpen:F,filters:U,onApply:Se,onClose:()=>R(!1)})}),G&&l.jsx(NB,{content:G,editorMode:e,onAdd:q,onClose:()=>pe(null)})]})]})};function cq(e,t,r,n=wi){const s={},o={},i=new Set(["id","isFolder","children","parent","isNew","breadcrumb","title","relationalMetadata","optional","metadata","isAssessmentCourse"]),a=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","industry","domain","dialcodes"]),u=new Set(["copyrightYear","compatibilityLevel","version"]);function d(m,C=!1){const h={};for(const[v,y]of Object.entries(m))if(!i.has(v)&&!(C&&a.has(v)))if(c.has(v))Array.isArray(y)?h[v]=y:y!=null&&y!==""?h[v]=[y]:h[v]=[];else if(u.has(v)){const b=Number(y);isNaN(b)||(h[v]=b)}else h[v]=y;return h}function f(m){var h;const C={};for(const v of m.children??[]){if(v.isFolder)continue;const y=t[v.identifier];if(!y)continue;const{isNew:b,...S}=y;if(Object.keys(S).length===0)continue;const x=((h=v.metadata)==null?void 0:h.relationalMetadata)??{};C[v.identifier]={name:v.name,...x,...S}}return C}function p(m,C){var x,w;const h=m.identifier,v=t[h],y=h.startsWith("temp-")||!!(v!=null&&v.isNew),b=!m.isFolder&&!C;if(C||y||v&&!b){let T;if(y)T={mimeType:"application/vnd.ekstep.content-collection",code:h,contentType:((x=m.metadata)==null?void 0:x.contentType)??n.unitContentType,primaryCategory:((w=m.metadata)==null?void 0:w.primaryCategory)??n.unitPrimaryCategory,name:m.name,visibility:"Parent",channel:r,...d(m.metadata??{})};else if(C){const{isNew:L,...A}=v??{};T={...d(m.metadata??{},!0),...d(A,!1),name:m.name}}else{const{isNew:L,...A}=v??{};T={name:m.name,visibility:"Parent",...d(A,!0)}}s[h]={metadata:T,objectType:m.objectType||(m.isFolder?"Collection":"Content"),root:C,isNew:y}}const S=m.isFolder?f(m):{};o[h]={name:m.name,children:(m.children??[]).map(T=>T.identifier),...Object.keys(S).length>0?{relationalMetadata:S}:{},root:C},(m.children??[]).forEach(T=>p(T,!1))}return e.forEach((m,C)=>p(m,C===0)),{nodesModified:s,hierarchy:o}}function uq(){const[e,t]=g.useState(!1),r=se(d=>d.treeCache),n=se(d=>d.treeData),s=X(d=>d.isDirty),o=X(d=>d.lastSaved),{setIsDirty:i,setLastSaved:a}=X(),c=X(d=>d.editorConfig);return{save:g.useCallback(async()=>{if(!c||e)return;const d=c.context.contentId??c.context.identifier??"";if(!d)return;if(n.length===0){ye.error("Collection is empty. Please reload before saving.");return}const f=c.context.channel??"",p=c.context.userId??c.context.uid??"";t(!0);try{const m=X.getState().editorProfile,{nodesModified:C,hierarchy:h}=cq(n,r,f,m),{identifiers:v}=await VT(d,C,h,p);v&&Object.keys(v).length>0&&se.getState().replaceNodeIds(v);const y=new Date().toISOString();a(y),i(!1)}catch(m){console.error("[useSaveHierarchy] save failed:",m),ye.error("Failed to save. Please try again.")}finally{t(!1)}},[c,e,n,r,i,a]),isSaving:e,isDirty:s,lastSaved:o}}const dq={};function fq(e){return e==null||e===""||Array.isArray(e)&&e.length===0}function hq(e,t,r,n,s,o=dq){const i=[],a=(c,u)=>{var d;for(const f of c){const p=u&&!f.parent,m=p?r:f.isFolder?n:null;if(m&&m.length>0){const C={...f.metadata??{},...t[f.id]??{}},v=Gp(m,C,o,p,s).filter(y=>y.required&&y.visible!==!1&&y.inputType!=="appIcon"&&fq(y.currentValue)).map(y=>y.label);v.length>0&&i.push({nodeId:f.id,nodeName:f.name||"Untitled",missing:v})}(d=f.children)!=null&&d.length&&a(f.children,!1)}};return a(e,!0),i}function pq(e){var S,x;const t=X(w=>w.editorConfig),r=X(w=>w.editorProfile),n=X(w=>w.setButtonLoader),s=X(w=>w.validateAllForms),o=X(w=>w.rootFormConfig),i=X(w=>w.unitFormConfig),a=se(w=>w.treeData),c=se(w=>w.treeCache),u=se(w=>w.selectNode),d=ur(),{scope:f}=ao(),p=X(w=>w.contentFramework),m=X(w=>w.contentTargetFWIds),{organisationFramework:C,targetFrameworks:h}=ki(p??((S=t==null?void 0:t.context)==null?void 0:S.framework),m??((x=t==null?void 0:t.context)==null?void 0:x.targetFWIds)),v=g.useCallback(()=>{var O,P,j;const w={editorMode:"edit",objectType:(O=t==null?void 0:t.config)==null?void 0:O.objectType,userFullName:(j=(P=t==null?void 0:t.context)==null?void 0:P.user)==null?void 0:j.fullName},T=hq(a,c,o,i,w,{organisationFramework:C,targetFrameworks:h});if(T.length===0)return!0;const L=T[0];ye.error(`"${L.nodeName}": please fill required field${L.missing.length>1?"s":""} — ${L.missing.join(", ")}`);const{setFormStatus:A}=X.getState();return T.forEach(N=>A(N.nodeId,!1)),u(L.nodeId),!1},[a,c,o,i,t,u,C,h]),y=g.useCallback(()=>{if(r.key!=="learningPath")return!0;const w=ql(a[0],d==null?void 0:d.code,f,c);return w.length===0?!0:(ye.error(w[0].message),!1)},[r.key,a,c,d,f]);return{runAction:g.useCallback(async(w,T)=>{var O,P,j,N;const L=((O=t==null?void 0:t.context)==null?void 0:O.contentId)??((P=t==null?void 0:t.context)==null?void 0:P.identifier)??"";if(!L)return ye.error("No content identifier found."),!1;const A=((j=t==null?void 0:t.context)==null?void 0:j.userId)??((N=t==null?void 0:t.context)==null?void 0:N.uid)??"";try{switch(w){case"sendForReview":return v()?s(a)?y()?(n("saveCollection",!0),await e(),await GT(L),ye.success("Content sent for review"),!0):!1:(ye.error("Some units have missing required fields. Please fill them before sending for review."),!1):!1;case"reject":{n("rejectCollection",!0);const F=(T==null?void 0:T.comment)??"";return await KT(L,F),ye.success("Content rejected and sent back to the author"),!0}case"publish":return v()?s(a)?y()?(n("publishCollection",!0),await e(),await HT(L,A),ye.success("Content published successfully"),!0):!1:(ye.error("Some units have missing required fields. Please fill them before publishing."),!1):!1;default:return!1}}catch(F){console.error(`[useToolbarActions] ${w} failed`,F);const R=w==="sendForReview"?"send for review":w==="reject"?"reject":"publish";return ye.error(`Failed to ${R}. Please try again.`),!1}finally{n("saveCollection",!1),n("rejectCollection",!1),n("publishCollection",!1)}},[t,e,n,v,y,s,a]),checkRequiredFields:v}}function mq(){const e=ae(),t=X(c=>c.editorProfile.key==="learningPath"),r=se(c=>c.treeData),n=ur(),{scope:s,source:o}=ao(),i=g.useRef(!1),a=g.useRef("");g.useEffect(()=>{if(!t||o!=="prior"||!n)return;const c=fT(r[0],n.code,s),u=c.map(d=>d.id).sort().join(",");i.current?c.length>0&&u!==a.current&&ye.error(e.learningPath.priorAssessmentNarrowedScopeToast.replace("{count}",String(c.length))):i.current=!0,a.current=u},[t,o,s.join("|"),n==null?void 0:n.code,r])}function gq(){const e=X(i=>i.editorProfile.key==="learningPath"),t=se(i=>i.treeData),r=se(i=>i.treeCache),n=se(i=>i.updateNode),s=ur(),o=s==null?void 0:s.code;g.useEffect(()=>{if(!e||!o)return;const i=t[0],a=dT(i,o,r);a!==null&&n(i.id,{[o]:a},[o])},[e,t,r,o,n])}const vq="_shell_1k9or_1",yq="_workspace_1k9or_8",bq="_sidebarCollapsed_1k9or_16",Cq="_dockCollapsed_1k9or_19",Sq="_dock_1k9or_19",xq="_outline_1k9or_40",_q="_reopenTab_1k9or_45",wq="_outlineHidden_1k9or_79",Tq="_editor_1k9or_86",Eq="_editorLp_1k9or_92",Aq="_dockHidden_1k9or_105",kq="_dockReopenTab_1k9or_112",Iq="_dragChip_1k9or_137",Lq="_dragChipLabel_1k9or_152",Ot={shell:vq,workspace:yq,sidebarCollapsed:bq,dockCollapsed:Cq,dock:Sq,outline:xq,reopenTab:_q,outlineHidden:wq,editor:Tq,editorLp:Eq,dockHidden:Aq,dockReopenTab:kq,dragChip:Iq,dragChipLabel:Lq},Dq=({editorMode:e,onToolbarEvent:t,onContentAdded:r,onHierarchySaved:n})=>{const s=ae(),[o,i]=g.useState(null),[a,c]=g.useState(!1),[u,d]=g.useState(!1),[f,p]=g.useState(!1);mq(),gq();const{addResource:m,treeData:C,treeCache:h}=se(),v=X(G=>G.setFormStatus),y=X(G=>G.editorProfile.key==="learningPath"),[b,S]=g.useState(!0),x=se(G=>G.selectedNodeId),{save:w,isSaving:T,isDirty:L,lastSaved:A}=uq(),{runAction:O,checkRequiredFields:P}=pq(w);g.useEffect(()=>{if(!L)return;const G=pe=>{pe.preventDefault(),pe.returnValue=""};return window.addEventListener("beforeunload",G),()=>window.removeEventListener("beforeunload",G)},[L]);const j=bf(Fa(gi,{activationConstraint:{distance:8}})),N=g.useCallback(G=>{var me;const pe=(me=G.active.data.current)==null?void 0:me.item;pe&&i(pe)},[]),F=g.useCallback(G=>{var q,M,$,ne,ie;i(null);const pe=(q=G.active.data.current)==null?void 0:q.item;if(!pe)return;if(y&&!Eh(C[0],h)){ye.error(s.learningPath.selectCurriculumFirstToast);return}const me=G.over,V=(me==null?void 0:me.id)??x??void 0,de=y?s.learningPath.dropOntoLevelError:s.splitBuilderShell.dropOntoUnitError;if(!V){ye.error(de);return}const oe=(M=C[0])==null?void 0:M.id;if(V===oe){ye.error(y?s.learningPath.dropOntoPathError:s.splitBuilderShell.dropOntoCourseError);return}const Se=se.getState().getNodeById(V);if(!(Se!=null&&Se.isFolder)){ye.error(de);return}if(y&&nt(Se)){const xe=(ie=(ne=($=C[0])==null?void 0:$.children)==null?void 0:ne[0])==null?void 0:ie.id;ye.error(Se.id===xe?s.learningPath.priorSlotFilledToast:s.learningPath.outcomeSlotFilledToast);return}if(!m(pe,V)){ye.error((y?s.learningPath.itemAlreadyInPathToast:s.splitBuilderShell.alreadyInCollectionError).replace("{name}",pe.name));return}r==null||r(pe,V),ye.success((y?s.learningPath.addedToLevelSuccess:s.splitBuilderShell.addedToUnitSuccess).replace("{name}",pe.name))},[x,m,C,h,r,s,y]),R=g.useCallback(async G=>{if(G.action==="onFormStatusChange"){const{isValid:pe,nodeId:me}=G.data??{},V=pe!==!1;S(V),me&&v(me,V);return}if(G.action==="back"&&L&&e==="edit"){p(!0);return}if(G.action==="saveCollection"){if(!b){ye.error(s.splitBuilderShell.fillRequiredMetadataError);return}if(!P())return;await w(),n==null||n(C),t==null||t(G);return}if(G.action==="sendForReview"||G.action==="reject"||G.action==="publish"){await O(G.action,G.data)&&(t==null||t(G));return}t==null||t(G)},[w,O,P,t,n,C,L,b,e,s]),U=g.useCallback(async()=>{if(!P()){p(!1);return}await w(),p(!1),n==null||n(C),t==null||t({action:"back"})},[w,P,n,t,C]),re=g.useCallback(()=>{p(!1),t==null||t({action:"back"})},[t]);return l.jsxs($a,{sensors:j,onDragStart:N,onDragEnd:F,children:[l.jsxs("div",{className:Ot.shell,children:[l.jsx(o0,{editorMode:e,isSaving:T,isDirty:L,lastSaved:A,isFormValid:b,onToolbarEvent:R}),l.jsxs("div",{className:[Ot.workspace,a?Ot.sidebarCollapsed:"",u?Ot.dockCollapsed:""].filter(Boolean).join(" "),children:[l.jsx("aside",{className:[Ot.outline,a?Ot.outlineHidden:""].join(" "),"aria-label":s.splitBuilderShell.outlineAriaLabel,"aria-hidden":a,children:l.jsx(FD,{editorMode:e,collapsed:a,onToggleCollapse:()=>c(G=>!G)})}),a&&l.jsx("button",{className:Ot.reopenTab,onClick:()=>c(!1),title:s.splitBuilderShell.showOutlineTitle,type:"button",children:"›"}),l.jsx("main",{className:[Ot.editor,y?Ot.editorLp:""].filter(Boolean).join(" "),role:"main","aria-label":s.splitBuilderShell.editorAriaLabel,children:l.jsx(k2,{editorMode:e,onToolbarEvent:R})}),l.jsx("aside",{className:[Ot.dock,u?Ot.dockHidden:""].filter(Boolean).join(" "),"aria-label":s.splitBuilderShell.libraryAriaLabel,"aria-hidden":u,children:l.jsx(lq,{editorMode:e,collapsed:u,onToggleCollapse:()=>d(G=>!G)})}),u&&l.jsx("button",{className:Ot.dockReopenTab,onClick:()=>d(!1),title:s.splitBuilderShell.showLibraryTitle,type:"button",children:"‹"})]})]}),l.jsx(by,{dropAnimation:null,children:o?l.jsx("div",{className:Ot.dragChip,children:l.jsx("span",{className:Ot.dragChipLabel,children:o.name})}):null}),f&&l.jsx(i0,{onSave:U,onDiscard:re,onCancel:()=>p(!1),isSaving:T})]})},jq="v1";function Nq(e){const t=e.validations,r=t==null?void 0:t.find(s=>s.type==="maxlength"||s.type==="maxLength");if(!r)return e.maxLength;const n=Number(r.value);return Number.isFinite(n)?n:void 0}function Rd(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:Nq(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 Nr(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 s=n.name??void 0,o=n.fields.filter(i=>!!i.code).sort((i,a)=>(i.index??0)-(a.index??0));for(const i of o)r.push(Rd(i,s))}else n.code&&r.push(Rd(n));return r}function Oq(e){const t=e==null?void 0:e.properties;if(!t)return{};const r={};for(const[n,s]of Object.entries(t))s&&"default"in s&&(r[n]=s.default);return r}async function Pq(e,t,r="Collection",n=jq){var u,d;const o=(d=(u=(await Fe.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:u.result)==null?void 0:d.objectCategoryDefinition,i=(o==null?void 0:o.forms)??{},a=(o==null?void 0:o.objectMetadata)??{},c=a.config??{};return{rootForm:Nr(i.create),unitForm:Nr(i.unitMetadata),childForm:Nr(i.childMetadata),searchForm:Nr(i.search??i.searchConfig),relationalForm:Nr(i.relationalMetadata),publishChecklist:Nr(i.publishchecklist),reviewChecklist:Nr(i.review),rfcChecklist:Nr(i.requestforchangeschecklist),schemaDefaults:Oq(a.schema),frameworkMetadata:c.frameworkMetadata??{},sourcingSettings:c.sourcingSettings??{}}}function Fd(e,t,r){return{framework:e.framework??t??r.framework??null,targetFWIds:e.targetFWIds??r.targetFWIds??null}}function Rq({config:e,onError:t}){const[r,n]=g.useState(!0),[s,o]=g.useState(null),[i,a]=g.useState(!1),{setEditorConfig:c,setEditorMode:u,setCategoryDefinition:d,setContentFramework:f,setEditorProfile:p}=X(),{setTreeData:m,selectNode:C}=se();return g.useEffect(()=>{let h=!1;async function v(){var y,b,S;try{n(!0),o(null),e.apiBaseUrl&&Ch(e.apiBaseUrl),c(e),u(e.config.mode),p(pb(e));const x=e.context.contentId??e.context.identifier??"",w=e.context.channel??"";let T;if(w)try{T=(y=await Qp(w))==null?void 0:y.defaultFramework}catch{}let L=!1;if(x){const A=e.config.objectType==="QuestionSet";let{rootNode:O}=A?await zT(x):await Bh(x);if(O&&e.config.primaryCategory==="Learning Path"&&(O=iT(O)),!h&&(m(O?[O]:[]),O)){C(O.id);const{framework:R,targetFWIds:U}=Fd(O.metadata??{},T,e.context);f(R,U),L=!0}const P=e.config.primaryCategory??"Course",j=e.context.channel??"",N=e.config.categoryDefinitionApiVersion??"v1";try{const F=await Pq(P,j,e.config.objectType??"Collection",N);if(!h){d(F);const R=((b=F.sourcingSettings)==null?void 0:b.collection)??{},U={};R.maxDepth&&!e.config.maxDepth&&(U.maxDepth=R.maxDepth),R.children&&!e.config.children&&(U.children=R.children),R.hierarchy&&!((S=e.config.hierarchy)!=null&&S.level1)&&(U.hierarchy={...e.config.hierarchy??{},...R.hierarchy}),Object.keys(U).length>0&&c({...e,config:{...e.config,...U}})}}catch{}}if(!h&&!L){const{framework:A,targetFWIds:O}=Fd({},T,e.context);f(A,O)}h||a(!0)}catch(x){if(!h){const w=x instanceof Error?x:new Error(String(x));o(w),t==null||t(w)}}finally{h||n(!1)}}return v(),()=>{h=!0}},[e.context.contentId,e.context.identifier]),{isLoading:r,error:s,isReady:i}}function Fq(){const e=jl(t=>t.setLanguage);g.useEffect(()=>{e(localStorage.getItem(Va)||"en",{broadcast:!1});const t=n=>{n.key===Va&&n.newValue&&e(n.newValue,{broadcast:!1})},r=n=>{var o;const s=(o=n.detail)==null?void 0:o.lang;s&&e(s,{broadcast:!1})};return window.addEventListener("storage",t),window.addEventListener(Ha,r),()=>{window.removeEventListener("storage",t),window.removeEventListener(Ha,r)}},[e])}const Mq="_root_qcpw6_1",Bq="_loadingState_qcpw6_10",qq="_loadingSpinner_qcpw6_20",$q="_errorState_qcpw6_34",As={root:Mq,loadingState:Bq,loadingSpinner:qq,errorState:$q},Uq=new Vm({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});function zq({error:e,onRetry:t}){const r=ae();return l.jsxs("div",{className:As.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 Vq extends g.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(zq,{error:this.state.error,onRetry:()=>this.setState({error:null})}):this.props.children}}function Hq(e){Fq();const t=ae(),{isLoading:r,error:n}=Rq({config:e,onError:e.onError}),s=X(i=>i.editorMode),o=X(i=>i.editorProfile);return r?l.jsxs("div",{className:As.loadingState,children:[l.jsx("div",{className:As.loadingSpinner}),l.jsx("p",{children:t.collectionEditor.loadingMessage})]}):n?l.jsxs("div",{className:As.errorState,children:[l.jsx("h3",{children:t.collectionEditor.loadErrorTitle}),l.jsx("p",{children:n.message})]}):l.jsx("div",{className:["sb-split-builder",As.root,o.key==="learningPath"?"sbx-lp-profile":""].filter(Boolean).join(" "),children:l.jsx(Dq,{editorMode:s,onToolbarEvent:e.onToolbarEvent,onContentAdded:e.onContentAdded,onHierarchySaved:e.onHierarchySaved})})}const mm=e=>l.jsx(Vq,{onError:e.onError,children:l.jsxs(Qm,{client:Uq,children:[l.jsx(Hq,{...e}),l.jsx(Hg,{position:"top-right",toastOptions:{duration:3e3,style:{fontFamily:"var(--sbx-font)"}}})]})}),ci=Symbol.for("r2wc.reactRender"),Md=Symbol.for("r2wc.shouldRender"),ko=Symbol.for("r2wc.root");function Qq(e=""){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Wq(e=""){return e.replace(/-([a-z0-9])/g,function(t){return t[1].toUpperCase()})}var Bd={expando:function(e,t,r){Object.defineProperty(e,t,{enumerable:!0,get:function(){return r},set:function(n){r=n,this[ci]()}}),e[ci]()}};function Gq(e,t,r,n={}){var s={isConnected:"isConnected"in HTMLElement.prototype},o=!1,i=function(){var u=Reflect.construct(HTMLElement,arguments,this.constructor);return typeof n.shadow=="string"?u.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.'),u.attachShadow({mode:"open"})),u},a=Object.create(HTMLElement.prototype);a.constructor=i;var c=new Proxy(a,{has:function(u,d){return d in e.propTypes||d in a},set:function(u,d,f,p){return o&&(s[d]=!0),typeof d=="symbol"||s[d]||d in u?(e.propTypes&&d in e.propTypes&&Bd.expando(p,d,f),Reflect.set(u,d,f,p)):(Bd.expando(p,d,f),!0)},getOwnPropertyDescriptor:function(u,d){var f=Reflect.getOwnPropertyDescriptor(u,d);if(f)return f;if(d in e.propTypes)return{configurable:!0,enumerable:!0,writable:!0,value:void 0}}});return i.prototype=c,a.connectedCallback=function(){this[Md]=!0,this[ci]()},a.disconnectedCallback=function(){typeof r.createRoot=="function"?this[ko].unmount():r.unmountComponentAtNode(this)},a[ci]=function(){if(this[Md]===!0){var u={};Object.keys(this).forEach(function(p){s[p]!==!1&&(u[p]=this[p])},this),o=!0;const d=n.shadow?this.shadowRoot:this,f=t.createElement(e,u);typeof r.createRoot=="function"?(this[ko]||(this[ko]=r.createRoot(d)),this[ko].render(f)):r.render(f,d),o=!1}},e.propTypes&&(i.observedAttributes=n.dashStyleAttributes?Object.keys(e.propTypes).map(function(u){return Qq(u)}):Object.keys(e.propTypes),a.attributeChangedCallback=function(u,d,f){var p=n.dashStyleAttributes?Wq(u):u;this[p]=f}),i}var Pn={},qd;function Kq(){if(qd)return Pn;qd=1;var e=Tr;if(process.env.NODE_ENV==="production")Pn.createRoot=e.createRoot,Pn.hydrateRoot=e.hydrateRoot;else{var t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Pn.createRoot=function(r,n){t.usingClientEntryPoint=!0;try{return e.createRoot(r,n)}finally{t.usingClientEntryPoint=!1}},Pn.hydrateRoot=function(r,n,s){t.usingClientEntryPoint=!0;try{return e.hydrateRoot(r,n,s)}finally{t.usingClientEntryPoint=!1}}}return Pn}var Yq=Kq();const Zq=Ll(Yq);function Xq(){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 Jq(e="sb-collection-editor"){if(Xq(),typeof customElements>"u"||customElements.get(e))return;const t=Gq(mm,g,Zq,{});customElements.define(e,t)}exports.CollectionEditor=mm;exports.registerCollectionEditor=Jq;exports.setApiBaseUrl=Ch;exports.useEditorStore=X;exports.useLibraryStore=fm;exports.useTreeStore=se;
|
|
528
|
+
*/var Bc;function sb(){return Bc||(Bc=1,process.env.NODE_ENV!=="production"&&(function(){function e(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=g,r=Dl(),n=typeof Object.is=="function"?Object.is:e,s=r.useSyncExternalStore,o=t.useRef,a=t.useEffect,i=t.useMemo,c=t.useDebugValue;Qa.useSyncExternalStoreWithSelector=function(u,d,f,p,m){var C=o(null);if(C.current===null){var h={hasValue:!1,value:null};C.current=h}else h=C.current;C=i(function(){function y(T){if(!b){if(b=!0,S=T,T=p(T),m!==void 0&&h.hasValue){var D=h.value;if(m(D,T))return x=D}return x=T}if(D=x,n(S,T))return D;var k=p(T);return m!==void 0&&m(D,k)?(S=T,D):(S=T,x=k)}var b=!1,S,x,w=f===void 0?null:f;return[function(){return y(d())},w===null?void 0:function(){return y(w())}]},[d,f,p,m]);var v=s(u,C[0],C[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())})()),Qa}var qc;function ob(){return qc||(qc=1,process.env.NODE_ENV==="production"?vo.exports=nb():vo.exports=sb()),vo.exports}var ab=ob();const ib=Ll(ab),Wf={},{useDebugValue:lb}=g,{useSyncExternalStoreWithSelector:cb}=ib;let $c=!1;const ub=e=>e;function db(e,t=ub,r){(Wf?"production":void 0)!=="production"&&r&&!$c&&(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"),$c=!0);const n=cb(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return lb(n),n}const Uc=e=>{(Wf?"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"?eb(e):e,r=(n,s)=>db(t,n,s);return Object.assign(r,t),r},ro=e=>e?Uc(e):Uc,wa={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}},fb={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}},hb={...wa,key:"evaluationCourse",restrictedContentCategories:["Practice Question Set","Course Assessment"]};function pb(e){switch(e.config.primaryCategory){case"Learning Path":return fb;case"Evaluation Course":return hb;default:return wa}}const X=ro(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:wa,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=X.getState().formStatusMapper,n=[...t];for(;n.length>0;){const s=n.shift();if(r[s.id]===!1)return!1;s.children&&n.push(...s.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}})})),mb=Object.freeze(Object.defineProperty({__proto__:null,useEditorStore:X},Symbol.toStringTag,{value:"Module"})),rt=ro(e=>({activeModal:null,modalData:{},activeAssessmentSlot:null,activeLevelExamTarget:null,openModal:(t,r={})=>e({activeModal:t,modalData:r}),closeModal:()=>e({activeModal:null,modalData:{}}),setActiveAssessmentSlot:t=>e({activeAssessmentSlot:t,activeLevelExamTarget:null}),setActiveLevelExamTarget:t=>e({activeLevelExamTarget:t,activeAssessmentSlot:null})})),gb={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"},vb={ariaLabel:"Select language"},yb={errorBoundaryTitle:"Something went wrong",retryButton:"Retry",loadingMessage:"Loading editor...",loadErrorTitle:"Failed to load editor"},bb={nodePathAriaLabel:"Node path",homeAriaLabel:"Home"},Cb={detailsTab:"Details",audienceCurriculumTab:"Audience & Curriculum",licensingTab:"Licensing",metadataSectionsAriaLabel:"Metadata sections",hasErrorsAriaLabel:"Has errors"},Sb={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"},xb={selectAppIconAriaLabel:"Select app icon",appIconAriaLabel:"App icon",appIconAlt:"App icon",removeIconAriaLabel:"Remove icon"},_b={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"},wb={dragToReorderAriaLabel:"Drag to reorder",removeAriaLabel:"Remove {name}"},Tb={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"},Eb={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"},Ab={shuffleEnabledMessage:"Shuffling is enabled for this question set.",noFieldsMessage:"No fields configured for this tab."},kb={requiredError:"{field} is required",selectIconAriaLabel:"Select app icon",iconAlt:"App icon",selectIconLabel:"Select icon",removeIconAriaLabel:"Remove app icon",removeLabel:"Remove"},Ib={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."},Lb={addPlaceholder:"Add…",addButtonLabel:"Add"},Db={requiredError:"{field} is required"},jb={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"},Nb={requiredError:"{field} is required",inputPlaceholder:"Type and press Enter or comma…"},Ob={requiredError:"{field} is required",selectPlaceholder:"Select license…"},Pb={requiredError:"{field} is required",selectedCountSuffix:"selected",selectPlaceholder:"Select…",noOptionsMessage:"No options"},Rb={requiredError:"{field} is required",selectPlaceholder:"Select…"},Fb={requiredError:"{field} is required"},Mb={requiredError:"{field} is required",selectPlaceholder:"Select…",noOptionsMessage:"No options"},Bb={requiredError:"{field} is required",maxLengthError:"Max {max} characters"},qb={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"},$b={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"},Ub={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"},zb={title:"Confirm deletion",confirmButton:"Confirm",cancelButton:"Cancel",closeAriaLabel:"Close"},Vb={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"},Hb={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"},Qb={title:"Unsaved changes",closeAriaLabel:"Close",bodyMessage:"You have unsaved changes. Would you like to save them before leaving?",cancelButton:"Cancel",discardButton:"Discard",saveButton:"Save"},Wb={contentTypeFiltersAriaLabel:"Content type filters"},Gb={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"},Kb={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",cancelTargetAriaLabel:"Cancel — go back to browsing",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"},Yb={boardLabel:"Board",mediumLabel:"Medium",classLabel:"Class",subjectLabel:"Subject",primaryCategoryLabel:"Primary Category",filterLibraryAriaLabel:"Filter library",filtersHeaderTitle:"Filters",closeFiltersAriaLabel:"Close filters",resetButton:"Reset",applyButton:"Apply"},Zb={contentPreviewAriaLabel:"Content preview",closePreviewAriaLabel:"Close preview",addToUnitButton:"+ Add to Unit"},Xb={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"},Jb={expandAriaLabel:"Expand",collapseAriaLabel:"Collapse",dropHereLabel:"Drop here",nodeOptionsAriaLabel:"Node options",renameMenuItem:"Rename",addSubunitMenuItem:"Add sub-unit",addSiblingMenuItem:"Add Sibling",deleteMenuItem:"Delete"},eC={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."},tC={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."},rC={unitsAddedLabel:"Units added",contentItemsLabel:"Content items",progressLabel:"Progress"},nC={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"},sC={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"},oC={closeAriaLabel:"Close",fillCommentsError:"Fill comments",cancelButton:"Cancel"},aC={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"},iC={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"},lC={remove:"Remove"},cC={dropHere:"Drop here"},uC={loading:"Loading"},dC={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",addCourseToLevelButton:"Add Course to this level",addLevelExamButton:"Add Level Exam — a course with only a question set",levelExamMeta:"Level Exam · Question set only",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?",deleteLevelExamConfirm:"Remove this Level Exam course from the level?",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 an Evaluation Course, so it can't be used as an assessment.`,bothSlotsFilledToast:"Both Prior and Outcome Assessment slots are already filled.",levelExamAlreadyFilledToast:"This level already has a Level Exam course — remove it before adding a different one.",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 Evaluation Course — its content can only be Question Sets or Course Assessment, never other content types.",libraryOpenLevelToAdd:"Open a level to add",libraryAddToLevel:"Add to {level}",libraryAddPriorAssessmentCourse:"Add Prior Assessment course",libraryAddOutcomeAssessmentCourse:"Add Outcome Assessment course",libraryAddLevelExamCourse:"Add Level Exam course for {level}",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.",levelNeedsMixedContentToast:"This level is first or last in the path — a question-set-only course as its only content will be treated as a Prior/Outcome Assessment. Add another course, or one with more than just question sets.",cannotRemoveLastRegularCourseToast:"This level is first or last in the path — removing this course would leave only the Level Exam course, and it would be treated as a Prior/Outcome Assessment. Add another course first.",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.",coursesCardHeading:"Courses",coursesCardDescription:"Courses a learner completes to clear this level — each course may include its own assessments internally. Drag the handle to reorder, use the menu to remove.",coursesEmptyHint:"Not added yet — pick a course from the Library.",courseMetaLabel:"Course",removeFromLevelMenuItem:"Remove from level"},zi={contextualEditor:gb,languageSelector:vb,collectionEditor:yb,breadcrumb:bb,tabBar:Cb,contentEditForm:Sb,titleAppIcon:xb,unitContentList:_b,contentRow:wb,csvUpload:Tb,manageCollaborators:Eb,sparkMetaForm:Ab,appIconField:kb,appIconPickerModal:Ib,chipGroupField:Lb,dateTimeField:Db,dialcodeInputField:jb,keywordSuggestField:Nb,licenseSelectField:Ob,multiSelectField:Pb,nestedSelectField:Rb,radioField:Fb,selectField:Mb,textField:Bb,assetBrowser:qb,resourceReorderDialog:$b,assignPageNumber:Ub,confirmDialog:zb,publishChecklist:Vb,qualityParamsModal:Hb,unsavedChangesModal:Qb,filterChips:Wb,libraryCard:Gb,libraryDock:Kb,libraryFilterPanel:Yb,libraryPreviewPanel:Zb,outlineTree:Xb,treeNode:Jb,contentPlayer:eC,dialcodePanel:tC,progressStatus:rC,splitBuilderShell:nC,topbar:sC,reviewCommentModal:oC,confirmReviewModal:aC,generateQRModal:iC,chip:lC,dropZone:cC,spinner:uC,learningPath:dC},fC={emptyStateMessage:"اختر وحدة من المخطط التفصيلي لتحرير تفاصيلها",reviewCommentLabel:"تعليق المراجع:",untitledPlaceholder:"بدون عنوان",nodeTitleAriaLabel:"عنوان العنصر",dropZoneLabel:"أفلت هنا لإضافة محتوى إلى هذه الوحدة"},hC={ariaLabel:"اختيار اللغة"},pC={errorBoundaryTitle:"حدث خطأ ما",retryButton:"إعادة المحاولة",loadingMessage:"جارٍ تحميل المحرر...",loadErrorTitle:"فشل تحميل المحرر"},mC={nodePathAriaLabel:"مسار العنصر",homeAriaLabel:"الصفحة الرئيسية"},gC={detailsTab:"التفاصيل",audienceCurriculumTab:"الجمهور والمنهج",licensingTab:"الترخيص",metadataSectionsAriaLabel:"أقسام البيانات الوصفية",hasErrorsAriaLabel:"يحتوي على أخطاء"},vC={moveToAnotherUnitButton:"نقل إلى وحدة أخرى",collapseMetadataPanelAriaLabel:"طي لوحة البيانات الوصفية",expandMetadataPanelAriaLabel:"توسيع لوحة البيانات الوصفية",collapseTitle:"طي",expandTitle:"توسيع",iconAlt:"أيقونة",contentNamePlaceholder:"اسم المحتوى",keywordsLabel:"الكلمات المفتاحية",addKeywordPlaceholder:"أضف كلمة مفتاحية واضغط Enter",addButton:"إضافة",optionalInCollectionLabel:"اختياري في المجموعة",yesOption:"نعم",noOption:"لا"},yC={selectAppIconAriaLabel:"اختيار أيقونة التطبيق",appIconAriaLabel:"أيقونة التطبيق",appIconAlt:"أيقونة التطبيق",removeIconAriaLabel:"إزالة الأيقونة"},bC={removeConfirm:"هل تريد إزالة هذا المحتوى من الوحدة؟",heading:"المحتوى في هذه الوحدة",emptyTitle:"لا يوجد محتوى بعد",emptyHint:"اسحب من المكتبة أو انقر فوق إضافة محتوى",addContentAriaLabel:"إضافة محتوى إلى الوحدة",addContent:"إضافة محتوى"},CC={dragToReorderAriaLabel:"اسحب لإعادة الترتيب",removeAriaLabel:"إزالة {name}"},SC={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:"تحميل"},xC={saveFailed:"فشل حفظ المتعاونين. يرجى المحاولة مرة أخرى.",title:"إدارة المتعاونين",closeAriaLabel:"إغلاق",searchUsersLabel:"البحث عن المستخدمين",searchPlaceholder:"البحث بالاسم أو البريد الإلكتروني...",searchingAriaLabel:"جارٍ البحث...",searchResultsAriaLabel:"نتائج البحث",add:"إضافة",noUsersFound:"لم يتم العثور على مستخدمين.",currentCollaborators:"المتعاونون الحاليون",noCollaboratorsYet:"لم تتم إضافة أي متعاونين بعد.",remove:"إزالة",saveSuccess:"تم حفظ المتعاونين بنجاح.",cancel:"إلغاء",save:"حفظ"},_C={shuffleEnabledMessage:"تم تفعيل الترتيب العشوائي لهذه المجموعة من الأسئلة.",noFieldsMessage:"لا توجد حقول مُهيَّأة لهذا التبويب."},wC={requiredError:"{field} مطلوب",selectIconAriaLabel:"اختيار أيقونة التطبيق",iconAlt:"أيقونة التطبيق",selectIconLabel:"اختيار أيقونة",removeIconAriaLabel:"إزالة أيقونة التطبيق",removeLabel:"إزالة"},TC={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:"فشل التحميل."},EC={addPlaceholder:"إضافة…",addButtonLabel:"إضافة"},AC={requiredError:"{field} مطلوب"},kC={requiredError:"{field} مطلوب",enterCodeMessage:"أدخل رمز الطلب للتحقق منه.",validMessage:"رمز الطلب صالح.",notFoundMessage:"رمز الطلب غير موجود.",validationFailedMessage:"فشل التحقق. يرجى المحاولة مرة أخرى.",placeholderExample:"مثال: A1B2C3",validateAriaLabel:"التحقق من رمز الطلب",validatingLabel:"جارٍ التحقق…",validateButtonLabel:"تحقق"},IC={requiredError:"{field} مطلوب",inputPlaceholder:"اكتب واضغط Enter أو فاصلة…"},LC={requiredError:"{field} مطلوب",selectPlaceholder:"اختر ترخيصًا…"},DC={requiredError:"{field} مطلوب",selectedCountSuffix:"محدد",selectPlaceholder:"اختر…",noOptionsMessage:"لا توجد خيارات"},jC={requiredError:"{field} مطلوب",selectPlaceholder:"اختر…"},NC={requiredError:"{field} مطلوب"},OC={requiredError:"{field} مطلوب",selectPlaceholder:"اختر…",noOptionsMessage:"لا توجد خيارات"},PC={requiredError:"{field} مطلوب",maxLengthError:"الحد الأقصى {max} حرفًا"},RC={dialogAriaLabel:"متصفح الأصول",title:"متصفح الأصول",closeAriaLabel:"إغلاق",browseTab:"تصفح",uploadTab:"تحميل",searchPlaceholder:"البحث في الأصول...",searchButton:"بحث",loadingMessage:"جارٍ التحميل...",uploadingMessage:"جارٍ التحميل...",chooseFileButton:"اختر ملفًا للتحميل"},FC={dialogAriaLabel:"نقل المورد",moveHeaderPrefix:"نقل",closeAriaLabel:"إغلاق",selectUnitHint:"اختر وحدة لنقل هذا المحتوى إليها:",noUnitsAvailable:"لا توجد وحدات أخرى متاحة",cancelButton:"إلغاء",moveButton:"نقل إلى هنا"},MC={dialogAriaLabel:"تعيين أرقام الصفحات",title:"تعيين أرقام الصفحات",closeAriaLabel:"إغلاق",emptyState:"لم يتم العثور على عناصر محتوى في هذه المجموعة.",contentColumnHeader:"المحتوى",pageNumberColumnHeader:"رقم الصفحة",cancelButton:"إلغاء",saveButton:"حفظ"},BC={title:"تأكيد الحذف",confirmButton:"تأكيد",cancelButton:"إلغاء",closeAriaLabel:"إغلاق"},qC={publishTitlePrefix:"نشر",closeAriaLabel:"إغلاق",confirmPublishPrefix:"هل أنت متأكد من رغبتك في نشر هذا",checklistInstructions:"يرجى تأكيد التحقق من جميع العناصر التالية (بتحديد مربعات الاختيار) قبل أن تتمكن من النشر:",noButton:"لا",yesButton:"نعم"},$C={reviewQualityTitle:"مراجعة الجودة",rejectContentTitle:"رفض المحتوى",closeAriaLabel:"إغلاق",qualityScoreLabel:"درجة الجودة",scorePoorLabel:"0 — ضعيف",scoreExcellentLabel:"10 — ممتاز",commentLabel:"تعليق",optionalLabel:"(اختياري)",commentPlaceholder:"أضف أي ملاحظات لمنشئ المحتوى…",rejectionReasonLabel:"سبب الرفض",rejectReasonPlaceholder:"اذكر سبب رفض هذا المحتوى…",rejectionRequiredMessage:"سبب الرفض مطلوب.",cancelButton:"إلغاء",approveButton:"قبول",rejectButton:"رفض"},UC={title:"تغييرات غير محفوظة",closeAriaLabel:"إغلاق",bodyMessage:"لديك تغييرات غير محفوظة. هل تريد حفظها قبل المغادرة؟",cancelButton:"إلغاء",discardButton:"تجاهل",saveButton:"حفظ"},zC={contentTypeFiltersAriaLabel:"مرشحات نوع المحتوى"},VC={alreadyAddedAriaLabel:"تمت إضافته مسبقًا",alreadyAddedTitle:"تمت إضافته مسبقًا إلى هذه المجموعة",addItemAriaLabel:"إضافة {name} إلى الوحدة",addToUnitTitle:"إضافة إلى الوحدة",selectUnitToAddTitle:"اختر وحدة للإضافة إليها",draftOnlyTitle:"يمكن إضافة المحتوى المسودة فقط"},HC={selectUnitFirstToast:"اختر وحدة أولاً",selectUnitFromOutlineToast:"اختر وحدة من المخطط التفصيلي لإضافة محتوى — لا يمكن إضافة الموارد مباشرة إلى الدورة.",itemAlreadyAddedToast:'"{name}" موجود مسبقًا في هذه المجموعة',itemAddedToast:'تمت إضافة "{name}"',collapseLibraryPanelAriaLabel:"طي لوحة المكتبة",collapseLibraryTitle:"طي المكتبة",cancelTargetAriaLabel:"إلغاء — العودة إلى التصفح",headerTitle:"المكتبة",searchPlaceholder:"البحث في المحتوى…",searchAriaLabel:"البحث في المكتبة",sortAZAriaLabel:"الترتيب: أ–ي (انقر للأحدث)",sortRecentAriaLabel:"الترتيب: الأحدث (انقر لـ أ–ي)",sortAZTitle:"أ–ي",sortRecentTitle:"الأحدث",toggleAdvancedFiltersAriaLabel:"تبديل المرشحات المتقدمة",advancedFiltersTitle:"المرشحات المتقدمة",libraryContentAriaLabel:"محتوى المكتبة",loadMoreAriaLabel:"تحميل المزيد من المحتوى",loadingText:"جارٍ التحميل…",loadMoreText:"تحميل المزيد",noContentFound:"لم يتم العثور على محتوى",tryDifferentSearch:"جرّب بحثًا أو مرشحًا مختلفًا"},QC={boardLabel:"المجلس التعليمي",mediumLabel:"لغة التدريس",classLabel:"الصف",subjectLabel:"المادة",primaryCategoryLabel:"الفئة الأساسية",filterLibraryAriaLabel:"تصفية المكتبة",filtersHeaderTitle:"المرشحات",closeFiltersAriaLabel:"إغلاق المرشحات",resetButton:"إعادة تعيين",applyButton:"تطبيق"},WC={contentPreviewAriaLabel:"معاينة المحتوى",closePreviewAriaLabel:"إغلاق المعاينة",addToUnitButton:"+ إضافة إلى الوحدة"},GC={maxDepthReachedToast:"تم الوصول إلى الحد الأقصى للعمق",downloadCsvFailedToast:"فشل تنزيل ملف CSV",outlineRefreshedToast:"تم تحديث مخطط الدورة.",outlineRefreshFailedToast:"تعذّر تحديث المخطط التفصيلي تلقائيًا. يرجى إعادة تحميل الصفحة.",moreOptionsAriaLabel:"خيارات إضافية",moreOptionsTitle:"خيارات إضافية",foldersExistTitle:'المجلدات موجودة مسبقًا — استخدم "تحديث" بدلاً من ذلك',createFoldersCsvButton:"إنشاء مجلدات باستخدام ملف csv",noFoldersYetTitle:'لا توجد مجلدات بعد — استخدم "إنشاء" أولاً',downloadFoldersCsvButton:"تنزيل المجلدات كملف csv",updateFoldersCsvButton:"تحديث بيانات المجلدات الوصفية باستخدام ملف csv",expandOutlineAriaLabel:"توسيع المخطط التفصيلي",collapseOutlineAriaLabel:"طي المخطط التفصيلي",addUnitButton:"إضافة وحدة",addSubunitButton:"إضافة وحدة فرعية"},KC={expandAriaLabel:"توسيع",collapseAriaLabel:"طي",dropHereLabel:"أفلت هنا",nodeOptionsAriaLabel:"خيارات العنصر",renameMenuItem:"إعادة تسمية",addSubunitMenuItem:"إضافة وحدة فرعية",addSiblingMenuItem:"إضافة عنصر مماثل",deleteMenuItem:"حذف"},YC={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:"لم يتم العثور على السؤال في مجموعة الأسئلة."},ZC={title:"رمز الاستجابة السريعة (رمز الطلب)",invalidFormatError:"تنسيق رمز DIAL غير صالح. استخدم الأحرف الكبيرة والأرقام فقط (مثال: A1B2C3).",duplicateDialcodeError:'رمز DIAL "{code}" مرتبط مسبقًا بعنصر آخر في هذه المجموعة.',dialcodeNotFoundError:"رمز الطلب غير موجود. يرجى إدخال رمز صالح.",linkFailedError:"فشل ربط رمز الطلب. يرجى المحاولة مرة أخرى.",unlinkFailedError:"فشلت إزالة رمز الطلب. يرجى المحاولة مرة أخرى.",qrCodeAltPrefix:"رمز الاستجابة السريعة لـ",linkedCodeLabel:"الرمز المرتبط:",removeButton:"إزالة",noCodeLinkedMessage:"لا يوجد رمز استجابة سريعة مرتبط بهذا المحتوى.",linkManuallyLabel:"الربط يدويًا",dialcodeInputPlaceholder:"أدخل رمز الطلب (مثال: A1B2C3)",dialcodeInputAriaLabel:"إدخال رمز الطلب",linkButton:"ربط",linkedSuccessMessage:"تم ربط رمز الطلب بنجاح."},XC={unitsAddedLabel:"الوحدات المضافة",contentItemsLabel:"عناصر المحتوى",progressLabel:"التقدّم"},JC={dropOntoUnitError:"أفلت على وحدة لإضافة محتوى",dropOntoCourseError:"أفلت المحتوى على وحدة، وليس مباشرة على الدورة.",alreadyInCollectionError:'"{name}" موجود مسبقًا في هذه المجموعة',addedToUnitSuccess:'تمت إضافة "{name}" إلى الوحدة',fillRequiredMetadataError:"يرجى تعبئة البيانات الوصفية المطلوبة",outlineAriaLabel:"مخطط الدورة",showOutlineTitle:"إظهار المخطط التفصيلي",editorAriaLabel:"محرر المحتوى",libraryAriaLabel:"مكتبة المحتوى",showLibraryTitle:"إظهار المكتبة"},eS={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:"اذكر التغييرات التي يجب على المؤلف إجراؤها"},tS={closeAriaLabel:"إغلاق",fillCommentsError:"أضف تعليقات",cancelButton:"إلغاء"},rS={closeAriaLabel:"إغلاق",title:"قبول الشروط والأحكام",agreementTextPart1:"أوافق على أنه بإرسال / نشر هذا المحتوى، فإنني أؤكد أن هذا المحتوى يتوافق مع الإرشادات المعتمدة، بما في ذلك شروط الاستخدام وسياسة المحتوى، وأني أوافق على نشره بموجب",creativeCommonsLinkText:"إطار عمل Creative Commons",agreementTextPart2:"وفقًا لـ",contentPolicyText:"سياسة المحتوى",agreementTextPart3:". وقد تحققت من أنني لا أنتهك حقوق النشر أو الخصوصية الخاصة بالآخرين.",cancelButton:"إلغاء",submitButton:"إرسال"},nS={closeAriaLabel:"إغلاق",title:"إنشاء رموز الاستجابة السريعة",numberOfCodesLabel:"عدد رموز الاستجابة السريعة",countPlaceholder:"أدخل رقمًا (2–250)",countRangeError:"أدخل رقمًا بين 2 و 250.",cancelButton:"إلغاء",generateButton:"إنشاء"},sS={remove:"إزالة"},oS={dropHere:"أفلت هنا"},aS={loading:"جارٍ التحميل"},iS={profileBadgeLabel:"مسار التعلم",pathStructureLabel:"بنية المسار",addLevelButton:"إضافة مستوى",levelNumberPrefix:"المستوى {n}",priorAssessmentLabel:"التقييم المسبق",priorAssessmentHint:"مطلوب دائمًا · لا يُحسب كمستوى",outcomeAssessmentLabel:"تقييم النتائج",outcomeAssessmentHint:"يؤكد النتيجة · لا يُحسب كمستوى",skillCheckBadge:"فحص المهارة",outcomeCheckBadge:"فحص النتيجة",assessmentCourseMeta:"مقرر · بنك أسئلة فقط",addAssessmentSlotButton:"إضافة {label} — مقرر يحتوي على بنك أسئلة فقط",addCourseToLevelButton:"إضافة مقرر إلى هذا المستوى",addLevelExamButton:"إضافة اختبار المستوى — مقرر يحتوي على بنك أسئلة فقط",levelExamMeta:"اختبار المستوى · بنك أسئلة فقط",requiredSlotBadge:"مطلوب",removeAssessmentSlotButton:"إزالة",deletePriorAssessmentConfirm:"حذف التقييم المسبق يزيل الدرجة التي يعتمد عليها التخطي التكيفي لهذا المسار. هل تريد الاستمرار؟",deleteAssessmentSlotConfirm:"هل تريد إزالة مقرر التقييم هذا من المسار؟",deleteLevelExamConfirm:"هل تريد إزالة مقرر اختبار المستوى هذا من المستوى؟",deleteLevelConfirm:'هل تريد حذف "{name}" وكل ما يحتويه؟',deleteCourseConfirm:"هل تريد إزالة هذا المقرر من المسار؟",deleteMultipleConfirm:"هل تريد حذف {count} من العناصر المحددة من المسار؟",courseNameUnavailable:"تفاصيل المقرر غير متوفرة",notAssessmentCourseToast:'"{name}" ليس مقرر تقييم (Evaluation Course)، لذا لا يمكن استخدامه كتقييم.',bothSlotsFilledToast:"تم تعبئة تقييمي المسبق والنتائج بالفعل.",levelExamAlreadyFilledToast:"يحتوي هذا المستوى بالفعل على مقرر اختبار المستوى — أزِله قبل إضافة مقرر آخر.",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:"مقرر تقييم واحد (Evaluation Course) — لا يمكن أن يكون محتواه سوى بنوك أسئلة أو تقييم مقرر، وليس أي أنواع محتوى أخرى.",libraryOpenLevelToAdd:"افتح مستوى للإضافة",libraryAddToLevel:"إضافة إلى {level}",libraryAddPriorAssessmentCourse:"إضافة مقرر التقييم المسبق",libraryAddOutcomeAssessmentCourse:"إضافة مقرر تقييم النتائج",libraryAddLevelExamCourse:"إضافة مقرر اختبار المستوى لـ {level}",policyStrictLabel:"صارمة",policyStrictDescription:"يُنهي كل متعلم كل مستوى، بالترتيب — بصرف النظر عن درجة التقييم المسبق.",policyAdaptiveLabel:"تكيفية",policyAdaptiveDescriptionPre:"يمكن تخطي مستوى، ولكن فقط عندما تتجاوز درجة المتعلم في التقييم المسبق",policyAdaptiveDescriptionPost:" حد الإعفاء.",policyPriorLearningLabel:"التعلم المسبق",policyPriorLearningDescription:"يمكن أن يستند التخطي أيضًا إلى مهارات يمتلكها المتعلم بالفعل — شهادة موثقة أو مقرر سابق — لا التقييم وحده.",selectLevelFirstToast:"اختر مستوى أولاً",selectLevelFromOutlineToast:"افتح مستوى في هيكل المسار لإضافة المقررات — لا يمكن إضافة المقررات إلى المسار نفسه أو داخل مقرر آخر.",selectCurriculumFirstToast:"حدد المنهج (Curriculum) لهذا المسار قبل إضافة المقررات.",noCurriculumEmptyTitle:"لم يتم تحديد منهج",noCurriculumEmptyHint:"حدد منهجًا لهذا المسار لتصفح المقررات.",noSkillsEmptyTitle:"لم يتم تحديد مهارات",noSkillsEmptyHint:"حدد مهارات لهذا المستوى لرؤية المقررات المطابقة.",itemAlreadyInPathToast:'"{name}" موجود بالفعل في مسار التعلم هذا',addedToLevelSuccess:'تمت إضافة "{name}" إلى المستوى',dropOntoLevelError:"أفلِت على مستوى لإضافة مقرر",dropOntoPathError:"أفلِت المقررات على مستوى، وليس على مسار التعلم مباشرة.",priorSlotFilledToast:"التقييم المسبق يحتوي على مقرر بالفعل — أزِله قبل إضافة مقرر آخر.",outcomeSlotFilledToast:"التقييم الختامي يحتوي على مقرر بالفعل — أزِله قبل إضافة مقرر آخر.",levelNeedsMixedContentToast:"هذا المستوى هو الأول أو الأخير في المسار — مقرر يحتوي فقط على بنك أسئلة كمحتوى وحيد له سيُعامل كتقييم مسبق/ختامي. أضف مقررًا آخر، أو مقررًا يحتوي على أكثر من بنك الأسئلة فقط.",cannotRemoveLastRegularCourseToast:"هذا المستوى هو الأول أو الأخير في المسار — إزالة هذا المقرر ستترك فقط مقرر اختبار المستوى، وسيتم التعامل معه كتقييم مسبق/ختامي. أضف مقررًا آخر أولاً.",coursesRemovedFrameworkChangeToast:"تمت إزالة {count} من المقررات المرتبطة بمنهج مختلف من هذا المسار.",levelSkillsResetFrameworkChangeToast:"تم مسح المهارات المختارة في {count} من المستويات — فهي لا تنطبق على المنهج الجديد.",priorAssessmentNarrowedScopeToast:"أدى التقييم المسبق إلى تضييق نطاق المهارات — أصبح لدى {count} من المستويات مهارات خارج هذا النطاق.",coursesCardHeading:"المقررات",coursesCardDescription:"المقررات التي يُتمّها المتعلم لاجتياز هذا المستوى — قد يتضمن كل مقرر تقييماته الخاصة. اسحب المقبض لإعادة الترتيب، واستخدم القائمة للإزالة.",coursesEmptyHint:"لم تتم الإضافة بعد — اختر مقررًا من المكتبة.",courseMetaLabel:"مقرر",removeFromLevelMenuItem:"إزالة من المستوى"},lS={contextualEditor:fC,languageSelector:hC,collectionEditor:pC,breadcrumb:mC,tabBar:gC,contentEditForm:vC,titleAppIcon:yC,unitContentList:bC,contentRow:CC,csvUpload:SC,manageCollaborators:xC,sparkMetaForm:_C,appIconField:wC,appIconPickerModal:TC,chipGroupField:EC,dateTimeField:AC,dialcodeInputField:kC,keywordSuggestField:IC,licenseSelectField:LC,multiSelectField:DC,nestedSelectField:jC,radioField:NC,selectField:OC,textField:PC,assetBrowser:RC,resourceReorderDialog:FC,assignPageNumber:MC,confirmDialog:BC,publishChecklist:qC,qualityParamsModal:$C,unsavedChangesModal:UC,filterChips:zC,libraryCard:VC,libraryDock:HC,libraryFilterPanel:QC,libraryPreviewPanel:WC,outlineTree:GC,treeNode:KC,contentPlayer:YC,dialcodePanel:ZC,progressStatus:XC,splitBuilderShell:JC,topbar:eS,reviewCommentModal:tS,confirmReviewModal:rS,generateQRModal:nS,chip:sS,dropZone:oS,spinner:aS,learningPath:iS},cS={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é"},uS={ariaLabel:"Sélectionner la langue"},dS={errorBoundaryTitle:"Une erreur s'est produite",retryButton:"Réessayer",loadingMessage:"Chargement de l'éditeur...",loadErrorTitle:"Échec du chargement de l'éditeur"},fS={nodePathAriaLabel:"Chemin du nœud",homeAriaLabel:"Accueil"},hS={detailsTab:"Détails",audienceCurriculumTab:"Public et programme",licensingTab:"Licence",metadataSectionsAriaLabel:"Sections de métadonnées",hasErrorsAriaLabel:"Contient des erreurs"},pS={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"},mS={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"},gS={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"},vS={dragToReorderAriaLabel:"Faire glisser pour réorganiser",removeAriaLabel:"Supprimer {name}"},yS={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"},bS={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"},CS={shuffleEnabledMessage:"La lecture aléatoire est activée pour cet ensemble de questions.",noFieldsMessage:"Aucun champ configuré pour cet onglet."},SS={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"},xS={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é."},_S={addPlaceholder:"Ajouter…",addButtonLabel:"Ajouter"},wS={requiredError:"{field} est requis"},TS={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"},ES={requiredError:"{field} est requis",inputPlaceholder:"Saisissez et appuyez sur Entrée ou virgule…"},AS={requiredError:"{field} est requis",selectPlaceholder:"Sélectionner une licence…"},kS={requiredError:"{field} est requis",selectedCountSuffix:"sélectionné(s)",selectPlaceholder:"Sélectionner…",noOptionsMessage:"Aucune option"},IS={requiredError:"{field} est requis",selectPlaceholder:"Sélectionner…"},LS={requiredError:"{field} est requis"},DS={requiredError:"{field} est requis",selectPlaceholder:"Sélectionner…",noOptionsMessage:"Aucune option"},jS={requiredError:"{field} est requis",maxLengthError:"Maximum {max} caractères"},NS={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"},OS={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"},PS={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"},RS={title:"Confirmer la suppression",confirmButton:"Confirmer",cancelButton:"Annuler",closeAriaLabel:"Fermer"},FS={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"},MS={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"},BS={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"},qS={contentTypeFiltersAriaLabel:"Filtres par type de contenu"},$S={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é"},US={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",cancelTargetAriaLabel:"Annuler — revenir à la navigation",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"},zS={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"},VS={contentPreviewAriaLabel:"Aperçu du contenu",closePreviewAriaLabel:"Fermer l'aperçu",addToUnitButton:"+ Ajouter à l'unité"},HS={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é"},QS={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"},WS={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."},GS={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."},KS={unitsAddedLabel:"Unités ajoutées",contentItemsLabel:"Éléments de contenu",progressLabel:"Progression"},YS={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"},ZS={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"},XS={closeAriaLabel:"Fermer",fillCommentsError:"Renseignez les commentaires",cancelButton:"Annuler"},JS={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"},ex={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"},tx={remove:"Supprimer"},rx={dropHere:"Déposer ici"},nx={loading:"Chargement"},sx={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",addCourseToLevelButton:"Ajouter un cours à ce niveau",addLevelExamButton:"Ajouter l'examen de niveau — un cours contenant uniquement un questionnaire",levelExamMeta:"Examen de niveau · Questionnaire uniquement",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 ?",deleteLevelExamConfirm:"Retirer ce cours d'examen de niveau du niveau ?",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 d'évaluation, il ne peut donc pas être utilisé comme évaluation.",bothSlotsFilledToast:"Les évaluations préalable et finale sont déjà renseignées.",levelExamAlreadyFilledToast:"Ce niveau a déjà un cours d'examen de niveau — retirez-le avant d'en ajouter un autre.",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 d'évaluation — son contenu ne peut être que des questionnaires ou une Évaluation de cours, jamais d'autres types de contenu.",libraryOpenLevelToAdd:"Ouvrez un niveau pour ajouter",libraryAddToLevel:"Ajouter à {level}",libraryAddPriorAssessmentCourse:"Ajouter le cours d'évaluation préalable",libraryAddOutcomeAssessmentCourse:"Ajouter le cours d'évaluation finale",libraryAddLevelExamCourse:"Ajouter le cours d'examen de niveau pour {level}",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.",levelNeedsMixedContentToast:"Ce niveau est premier ou dernier dans le parcours — un cours composé uniquement de bancs de questions comme seul contenu sera traité comme une évaluation préalable/finale. Ajoutez un autre cours, ou un cours contenant plus que des bancs de questions.",cannotRemoveLastRegularCourseToast:"Ce niveau est premier ou dernier dans le parcours — retirer ce cours ne laisserait que le cours d'examen de niveau, qui serait alors traité comme une évaluation préalable/finale. Ajoutez d'abord un autre cours.",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.",coursesCardHeading:"Cours",coursesCardDescription:"Cours qu'un apprenant termine pour valider ce niveau — chaque cours peut inclure ses propres évaluations. Faites glisser la poignée pour réorganiser, utilisez le menu pour retirer.",coursesEmptyHint:"Pas encore ajouté — choisissez un cours dans la bibliothèque.",courseMetaLabel:"Cours",removeFromLevelMenuItem:"Retirer du niveau"},ox={contextualEditor:cS,languageSelector:uS,collectionEditor:dS,breadcrumb:fS,tabBar:hS,contentEditForm:pS,titleAppIcon:mS,unitContentList:gS,contentRow:vS,csvUpload:yS,manageCollaborators:bS,sparkMetaForm:CS,appIconField:SS,appIconPickerModal:xS,chipGroupField:_S,dateTimeField:wS,dialcodeInputField:TS,keywordSuggestField:ES,licenseSelectField:AS,multiSelectField:kS,nestedSelectField:IS,radioField:LS,selectField:DS,textField:jS,assetBrowser:NS,resourceReorderDialog:OS,assignPageNumber:PS,confirmDialog:RS,publishChecklist:FS,qualityParamsModal:MS,unsavedChangesModal:BS,filterChips:qS,libraryCard:$S,libraryDock:US,libraryFilterPanel:zS,libraryPreviewPanel:VS,outlineTree:HS,treeNode:QS,contentPlayer:WS,dialcodePanel:GS,progressStatus:KS,splitBuilderShell:YS,topbar:ZS,reviewCommentModal:XS,confirmReviewModal:JS,generateQRModal:ex,chip:tx,dropZone:rx,spinner:nx,learningPath:sx},ax={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"},ix={ariaLabel:"Selecionar idioma"},lx={errorBoundaryTitle:"Algo deu errado",retryButton:"Tentar novamente",loadingMessage:"Carregando editor...",loadErrorTitle:"Falha ao carregar o editor"},cx={nodePathAriaLabel:"Caminho do nó",homeAriaLabel:"Início"},ux={detailsTab:"Detalhes",audienceCurriculumTab:"Público e Currículo",licensingTab:"Licenciamento",metadataSectionsAriaLabel:"Seções de metadados",hasErrorsAriaLabel:"Contém erros"},dx={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"},fx={selectAppIconAriaLabel:"Selecionar ícone do aplicativo",appIconAriaLabel:"Ícone do aplicativo",appIconAlt:"Ícone do aplicativo",removeIconAriaLabel:"Remover ícone"},hx={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"},px={dragToReorderAriaLabel:"Arrastar para reordenar",removeAriaLabel:"Remover {name}"},mx={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"},gx={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"},vx={shuffleEnabledMessage:"A ordem aleatória está ativada para este conjunto de questões.",noFieldsMessage:"Nenhum campo configurado para esta aba."},yx={requiredError:"{field} é obrigatório",selectIconAriaLabel:"Selecionar ícone do aplicativo",iconAlt:"Ícone do aplicativo",selectIconLabel:"Selecionar ícone",removeIconAriaLabel:"Remover ícone do aplicativo",removeLabel:"Remover"},bx={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."},Cx={addPlaceholder:"Adicionar…",addButtonLabel:"Adicionar"},Sx={requiredError:"{field} é obrigatório"},xx={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"},_x={requiredError:"{field} é obrigatório",inputPlaceholder:"Digite e pressione Enter ou vírgula…"},wx={requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar licença…"},Tx={requiredError:"{field} é obrigatório",selectedCountSuffix:"selecionado(s)",selectPlaceholder:"Selecionar…",noOptionsMessage:"Sem opções"},Ex={requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar…"},Ax={requiredError:"{field} é obrigatório"},kx={requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar…",noOptionsMessage:"Sem opções"},Ix={requiredError:"{field} é obrigatório",maxLengthError:"Máx. {max} caracteres"},Lx={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"},Dx={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"},jx={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"},Nx={title:"Confirmar exclusão",confirmButton:"Confirmar",cancelButton:"Cancelar",closeAriaLabel:"Fechar"},Ox={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"},Px={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"},Rx={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"},Fx={contentTypeFiltersAriaLabel:"Filtros de tipo de conteúdo"},Mx={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"},Bx={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",cancelTargetAriaLabel:"Cancelar — voltar à navegação",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"},qx={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"},$x={contentPreviewAriaLabel:"Pré-visualização do conteúdo",closePreviewAriaLabel:"Fechar pré-visualização",addToUnitButton:"+ Adicionar à unidade"},Ux={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"},zx={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"},Vx={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."},Hx={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."},Qx={unitsAddedLabel:"Unidades adicionadas",contentItemsLabel:"Itens de conteúdo",progressLabel:"Progresso"},Wx={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"},Gx={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"},Kx={closeAriaLabel:"Fechar",fillCommentsError:"Preencha os comentários",cancelButton:"Cancelar"},Yx={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"},Zx={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"},Xx={remove:"Remover"},Jx={dropHere:"Solte aqui"},e_={loading:"Carregando"},t_={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",addCourseToLevelButton:"Adicionar curso a este nível",addLevelExamButton:"Adicionar Exame de nível — um curso com apenas um banco de questões",levelExamMeta:"Exame de nível · Apenas 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?",deleteLevelExamConfirm:"Remover este curso de Exame de nível do nível?",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 de Avaliação, portanto não pode ser usado como avaliação.',bothSlotsFilledToast:"As avaliações prévia e de resultado já estão preenchidas.",levelExamAlreadyFilledToast:"Este nível já tem um curso de Exame de nível — remova-o antes de adicionar outro.",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 de Avaliação — seu conteúdo só pode ser Bancos de Questões ou Avaliação de Curso, nunca outros tipos de conteúdo.",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",libraryAddLevelExamCourse:"Adicionar curso de Exame de nível para {level}",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.",levelNeedsMixedContentToast:"Este nível é o primeiro ou o último no percurso — um curso composto apenas por bancos de questões como único conteúdo será tratado como uma Avaliação prévia/final. Adicione outro curso, ou um curso com mais do que apenas bancos de questões.",cannotRemoveLastRegularCourseToast:"Este nível é o primeiro ou o último no percurso — remover este curso deixaria apenas o curso de Exame de Nível, que seria tratado como uma Avaliação prévia/final. Adicione outro curso primeiro.",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.",coursesCardHeading:"Cursos",coursesCardDescription:"Cursos que um aprendiz conclui para cumprir este nível — cada curso pode incluir suas próprias avaliações internas. Arraste a alça para reordenar, use o menu para remover.",coursesEmptyHint:"Ainda não adicionado — escolha um curso na Biblioteca.",courseMetaLabel:"Curso",removeFromLevelMenuItem:"Remover do nível"},r_={contextualEditor:ax,languageSelector:ix,collectionEditor:lx,breadcrumb:cx,tabBar:ux,contentEditForm:dx,titleAppIcon:fx,unitContentList:hx,contentRow:px,csvUpload:mx,manageCollaborators:gx,sparkMetaForm:vx,appIconField:yx,appIconPickerModal:bx,chipGroupField:Cx,dateTimeField:Sx,dialcodeInputField:xx,keywordSuggestField:_x,licenseSelectField:wx,multiSelectField:Tx,nestedSelectField:Ex,radioField:Ax,selectField:kx,textField:Ix,assetBrowser:Lx,resourceReorderDialog:Dx,assignPageNumber:jx,confirmDialog:Nx,publishChecklist:Ox,qualityParamsModal:Px,unsavedChangesModal:Rx,filterChips:Fx,libraryCard:Mx,libraryDock:Bx,libraryFilterPanel:qx,libraryPreviewPanel:$x,outlineTree:Ux,treeNode:zx,contentPlayer:Vx,dialcodePanel:Hx,progressStatus:Qx,splitBuilderShell:Wx,topbar:Gx,reviewCommentModal:Kx,confirmReviewModal:Yx,generateQRModal:Zx,chip:Xx,dropZone:Jx,spinner:e_,learningPath:t_},n_=["ar"],s_={en:zi,ar:lS,fr:ox,pt:r_};function Gf(e,t){const r={...e};for(const n of Object.keys(t)){const s=e[n],o=t[n];s&&o&&typeof s=="object"&&typeof o=="object"&&!Array.isArray(s)&&!Array.isArray(o)?r[n]=Gf(s,o):o!==void 0&&(r[n]=o)}return r}function zc(e){const t=s_[e];return!t||e==="en"?zi:Gf(zi,t)}function o_(e){return n_.includes(e)}const Vi="app-language",Hi="app-language-change",jl=ro(e=>({lang:"en",labelConfig:zc("en"),setLanguage:(t,r={})=>{e({lang:t,labelConfig:zc(t)}),localStorage.setItem(Vi,t),document.documentElement.setAttribute("dir",o_(t)?"rtl":"ltr"),document.documentElement.setAttribute("lang",t),r.broadcast!==!1&&window.dispatchEvent(new CustomEvent(Hi,{detail:{lang:t}}))}}));function Kf(e,t){return function(){return e.apply(t,arguments)}}const{toString:a_}=Object.prototype,{getPrototypeOf:ts}=Object,{iterator:no,toStringTag:Yf}=Symbol,ea=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Bs=(e,t)=>{let r=e;const n=[];for(;r!=null&&r!==Object.prototype;){if(n.indexOf(r)!==-1)return!1;if(n.push(r),ea(r,t))return!0;r=ts(r)}return!1},i_=(e,t)=>e!=null&&Bs(e,t)?e[t]:void 0,Nl=(e=>t=>{const r=a_.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),cr=e=>(e=e.toLowerCase(),t=>Nl(t)===e),Ta=e=>t=>typeof t===e,{isArray:vn}=Array,rs=Ta("undefined");function cs(e){return e!==null&&!rs(e)&&e.constructor!==null&&!rs(e.constructor)&&Ft(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Zf=cr("ArrayBuffer");function l_(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Zf(e.buffer),t}const c_=Ta("string"),Ft=Ta("function"),Xf=Ta("number"),us=e=>e!==null&&typeof e=="object",u_=e=>e===!0||e===!1,jo=e=>{if(!us(e))return!1;const t=ts(e);return(t===null||t===Object.prototype||ts(t)===null)&&!Bs(e,Yf)&&!Bs(e,no)},d_=e=>{if(!us(e)||cs(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},f_=cr("Date"),h_=cr("File"),p_=e=>!!(e&&typeof e.uri<"u"),m_=e=>e&&typeof e.getParts<"u",g_=cr("Blob"),v_=cr("FileList"),y_=e=>us(e)&&Ft(e.pipe);function b_(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Vc=b_(),Hc=typeof Vc.FormData<"u"?Vc.FormData:void 0,C_=e=>{if(!e)return!1;if(Hc&&e instanceof Hc)return!0;const t=ts(e);if(!t||t===Object.prototype||!Ft(e.append))return!1;const r=Nl(e);return r==="formdata"||r==="object"&&Ft(e.toString)&&e.toString()==="[object FormData]"},S_=cr("URLSearchParams"),[x_,__,w_,T_]=["ReadableStream","Request","Response","Headers"].map(cr),E_=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function so(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,s;if(typeof e!="object"&&(e=[e]),vn(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{if(cs(e))return;const o=r?Object.getOwnPropertyNames(e):Object.keys(e),a=o.length;let i;for(n=0;n<a;n++)i=o[n],t.call(null,e[i],i,e)}}function Jf(e,t){if(cs(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,s;for(;n-- >0;)if(s=r[n],t===s.toLowerCase())return s;return null}const tn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,eh=e=>!rs(e)&&e!==tn;function Qi(...e){const{caseless:t,skipUndefined:r}=eh(this)&&this||{},n={},s=(o,a)=>{if(a==="__proto__"||a==="constructor"||a==="prototype")return;const i=t&&typeof a=="string"&&Jf(n,a)||a,c=ea(n,i)?n[i]:void 0;jo(c)&&jo(o)?n[i]=Qi(c,o):jo(o)?n[i]=Qi({},o):vn(o)?n[i]=o.slice():(!r||!rs(o))&&(n[i]=o)};for(let o=0,a=e.length;o<a;o++){const i=e[o];if(!i||cs(i)||(so(i,s),typeof i!="object"||vn(i)))continue;const c=Object.getOwnPropertySymbols(i);for(let u=0;u<c.length;u++){const d=c[u];M_.call(i,d)&&s(i[d],d)}}return n}const A_=(e,t,r,{allOwnKeys:n}={})=>(so(t,(s,o)=>{r&&Ft(s)?Object.defineProperty(e,o,{__proto__:null,value:Kf(s,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{__proto__:null,value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),e),k_=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),I_=(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)},L_=(e,t,r,n)=>{let s,o,a;const i={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)a=s[o],(!n||n(a,e,t))&&!i[a]&&(t[a]=e[a],i[a]=!0);e=r!==!1&&ts(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},D_=(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},j_=e=>{if(!e)return null;if(vn(e))return e;let t=e.length;if(!Xf(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},N_=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ts(Uint8Array)),O_=(e,t)=>{const n=(e&&e[no]).call(e);let s;for(;(s=n.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},P_=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},R_=cr("HTMLFormElement"),F_=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,s){return n.toUpperCase()+s}),{propertyIsEnumerable:M_}=Object.prototype,B_=cr("RegExp"),th=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};so(r,(s,o)=>{let a;(a=t(s,o,e))!==!1&&(n[o]=a||s)}),Object.defineProperties(e,n)},q_=e=>{th(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+"'")})}})},$_=(e,t)=>{const r={},n=s=>{s.forEach(o=>{r[o]=!0})};return vn(e)?n(e):n(String(e).split(t)),r},U_=()=>{},z_=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function V_(e){return!!(e&&Ft(e.append)&&e[Yf]==="FormData"&&e[no])}const H_=e=>{const t=new WeakSet,r=n=>{if(us(n)){if(t.has(n))return;if(cs(n))return n;if(!("toJSON"in n)){t.add(n);const s=vn(n)?[]:{};return so(n,(o,a)=>{const i=r(o);!rs(i)&&(s[a]=i)}),t.delete(n),s}}return n};return r(e)},Q_=cr("AsyncFunction"),W_=e=>e&&(us(e)||Ft(e))&&Ft(e.then)&&Ft(e.catch),rh=((e,t)=>e?setImmediate:t?((r,n)=>(tn.addEventListener("message",({source:s,data:o})=>{s===tn&&o===r&&n.length&&n.shift()()},!1),s=>{n.push(s),tn.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Ft(tn.postMessage)),G_=typeof queueMicrotask<"u"?queueMicrotask.bind(tn):typeof process<"u"&&process.nextTick||rh,nh=e=>e!=null&&Ft(e[no]),K_=e=>e!=null&&Bs(e,no)&&nh(e),j={isArray:vn,isArrayBuffer:Zf,isBuffer:cs,isFormData:C_,isArrayBufferView:l_,isString:c_,isNumber:Xf,isBoolean:u_,isObject:us,isPlainObject:jo,isEmptyObject:d_,isReadableStream:x_,isRequest:__,isResponse:w_,isHeaders:T_,isUndefined:rs,isDate:f_,isFile:h_,isReactNativeBlob:p_,isReactNative:m_,isBlob:g_,isRegExp:B_,isFunction:Ft,isStream:y_,isURLSearchParams:S_,isTypedArray:N_,isFileList:v_,forEach:so,merge:Qi,extend:A_,trim:E_,stripBOM:k_,inherits:I_,toFlatObject:L_,kindOf:Nl,kindOfTest:cr,endsWith:D_,toArray:j_,forEachEntry:O_,matchAll:P_,isHTMLForm:R_,hasOwnProperty:ea,hasOwnProp:ea,hasOwnInPrototypeChain:Bs,getSafeProp:i_,reduceDescriptors:th,freezeMethods:q_,toObjectSet:$_,toCamelCase:F_,noop:U_,toFiniteNumber:z_,findKey:Jf,global:tn,isContextDefined:eh,isSpecCompliantForm:V_,toJSONObject:H_,isAsyncFn:Q_,isThenable:W_,setImmediate:rh,asap:G_,isIterable:nh,isSafeIterable:K_},Y_=j.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"]),Z_=e=>{const t={};let r,n,s;return e&&e.split(`
|
|
529
|
+
`).forEach(function(a){s=a.indexOf(":"),r=a.substring(0,s).trim().toLowerCase(),n=a.substring(s+1).trim(),!(!r||t[r]&&Y_[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t};function X_(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 J_=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),ew=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function Ol(e,t){return j.isArray(e)?e.map(r=>Ol(r,t)):X_(String(e).replace(t,""))}const tw=e=>Ol(e,J_),rw=e=>Ol(e,ew);function sh(e){const t=Object.create(null);return j.forEach(e.toJSON(),(r,n)=>{t[n]=rw(r)}),t}const Qc=Symbol("internals");function vs(e){return e&&String(e).trim().toLowerCase()}function No(e){return e===!1||e==null?e:j.isArray(e)?e.map(No):tw(String(e))}function nw(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 sw=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Wa(e,t,r,n,s){if(j.isFunction(n))return n.call(this,t,r);if(s&&(t=r),!!j.isString(t)){if(j.isString(n))return t.indexOf(n)!==-1;if(j.isRegExp(n))return n.test(t)}}function ow(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function aw(e,t){const r=j.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{__proto__:null,value:function(s,o,a){return this[n].call(this,t,s,o,a)},configurable:!0})})}let Lt=class{constructor(t){t&&this.set(t)}set(t,r,n){const s=this;function o(i,c,u){const d=vs(c);if(!d)return;const f=j.findKey(s,d);(!f||s[f]===void 0||u===!0||u===void 0&&s[f]!==!1)&&(s[f||c]=No(i))}const a=(i,c)=>j.forEach(i,(u,d)=>o(u,d,c));if(j.isPlainObject(t)||t instanceof this.constructor)a(t,r);else if(j.isString(t)&&(t=t.trim())&&!sw(t))a(Z_(t),r);else if(j.isObject(t)&&j.isSafeIterable(t)){let i=Object.create(null),c,u;for(const d of t){if(!j.isArray(d))throw new TypeError("Object iterator must return a key-value pair");u=d[0],j.hasOwnProp(i,u)?(c=i[u],i[u]=j.isArray(c)?[...c,d[1]]:[c,d[1]]):i[u]=d[1]}a(i,r)}else t!=null&&o(r,t,n);return this}get(t,r){if(t=vs(t),t){const n=j.findKey(this,t);if(n){const s=this[n];if(!r)return s;if(r===!0)return nw(s);if(j.isFunction(r))return r.call(this,s,n);if(j.isRegExp(r))return r.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=vs(t),t){const n=j.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||Wa(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let s=!1;function o(a){if(a=vs(a),a){const i=j.findKey(n,a);i&&(!r||Wa(n,n[i],i,r))&&(delete n[i],s=!0)}}return j.isArray(t)?t.forEach(o):o(t),s}clear(t){const r=Object.keys(this);let n=r.length,s=!1;for(;n--;){const o=r[n];(!t||Wa(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const r=this,n={};return j.forEach(this,(s,o)=>{const a=j.findKey(n,o);if(a){r[a]=No(s),delete r[o];return}const i=t?ow(o):String(o).trim();i!==o&&delete r[o],r[i]=No(s),n[i]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return j.forEach(this,(n,s)=>{n!=null&&n!==!1&&(r[s]=t&&j.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(s=>n.set(s)),n}static accessor(t){const n=(this[Qc]=this[Qc]={accessors:{}}).accessors,s=this.prototype;function o(a){const i=vs(a);n[i]||(aw(s,a),n[i]=!0)}return j.isArray(t)?t.forEach(o):o(t),this}};Lt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);j.reduceDescriptors(Lt.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});j.freezeMethods(Lt);const iw="[REDACTED ****]";function lw(e){if(j.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(j.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function cw(e,t){const r=new Set(t.map(o=>String(o).toLowerCase())),n=[],s=o=>{if(o===null||typeof o!="object"||j.isBuffer(o))return o;if(n.indexOf(o)!==-1)return;o instanceof Lt&&(o=o.toJSON()),n.push(o);let a;if(j.isArray(o))a=[],o.forEach((i,c)=>{const u=s(i);j.isUndefined(u)||(a[c]=u)});else{if(!j.isPlainObject(o)&&lw(o))return n.pop(),o;a=Object.create(null);for(const[i,c]of Object.entries(o)){const u=r.has(i.toLowerCase())?iw:s(c);j.isUndefined(u)||(a[i]=u)}}return n.pop(),a};return s(e)}let ne=class oh extends Error{static from(t,r,n,s,o,a){const i=new oh(t.message,r||t.code,n,s,o);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,s,o){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),s&&(this.request=s),o&&(this.response=o,this.status=o.status)}toJSON(){const t=this.config,r=t&&j.hasOwnProp(t,"redact")?t.redact:void 0,n=j.isArray(r)&&r.length>0?cw(t,r):j.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}}};ne.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";ne.ERR_BAD_OPTION="ERR_BAD_OPTION";ne.ECONNABORTED="ECONNABORTED";ne.ETIMEDOUT="ETIMEDOUT";ne.ECONNREFUSED="ECONNREFUSED";ne.ERR_NETWORK="ERR_NETWORK";ne.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";ne.ERR_DEPRECATED="ERR_DEPRECATED";ne.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";ne.ERR_BAD_REQUEST="ERR_BAD_REQUEST";ne.ERR_CANCELED="ERR_CANCELED";ne.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";ne.ERR_INVALID_URL="ERR_INVALID_URL";ne.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const uw=null,ah=100;function Wi(e){return j.isPlainObject(e)||j.isArray(e)}function ih(e){return j.endsWith(e,"[]")?e.slice(0,-2):e}function Ga(e,t,r){return e?e.concat(t).map(function(s,o){return s=ih(s),!r&&o?"["+s+"]":s}).join(r?".":""):t}function dw(e){return j.isArray(e)&&!e.some(Wi)}const fw=j.toFlatObject(j,{},null,function(t){return/^is[A-Z]/.test(t)});function Ea(e,t,r){if(!j.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=j.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,S){return!j.isUndefined(S[b])});const n=r.metaTokens,s=r.visitor||C,o=r.dots,a=r.indexes,i=r.Blob||typeof Blob<"u"&&Blob,c=r.maxDepth===void 0?ah:r.maxDepth,u=i&&j.isSpecCompliantForm(t),d=[];if(!j.isFunction(s))throw new TypeError("visitor must be a function");function f(y){if(y===null)return"";if(j.isDate(y))return y.toISOString();if(j.isBoolean(y))return y.toString();if(!u&&j.isBlob(y))throw new ne("Blob is not supported. Use a Buffer instead.");return j.isArrayBuffer(y)||j.isTypedArray(y)?u&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function p(y){if(y>c)throw new ne("Object is too deeply nested ("+y+" levels). Max depth: "+c,ne.ERR_FORM_DATA_DEPTH_EXCEEDED)}function m(y,b){if(c===1/0)return JSON.stringify(y);const S=[];return JSON.stringify(y,function(w,T){if(!j.isObject(T))return T;for(;S.length&&S[S.length-1]!==this;)S.pop();return S.push(T),p(b+S.length-1),T})}function C(y,b,S){let x=y;if(j.isReactNative(t)&&j.isReactNativeBlob(y))return t.append(Ga(S,b,o),f(y)),!1;if(y&&!S&&typeof y=="object"){if(j.endsWith(b,"{}"))b=n?b:b.slice(0,-2),y=m(y,1);else if(j.isArray(y)&&dw(y)||(j.isFileList(y)||j.endsWith(b,"[]"))&&(x=j.toArray(y)))return b=ih(b),x.forEach(function(T,D){!(j.isUndefined(T)||T===null)&&t.append(a===!0?Ga([b],D,o):a===null?b:b+"[]",f(T))}),!1}return Wi(y)?!0:(t.append(Ga(S,b,o),f(y)),!1)}const h=Object.assign(fw,{defaultVisitor:C,convertValue:f,isVisitable:Wi});function v(y,b,S=0){if(!j.isUndefined(y)){if(p(S),d.indexOf(y)!==-1)throw new Error("Circular reference detected in "+b.join("."));d.push(y),j.forEach(y,function(w,T){(!(j.isUndefined(w)||w===null)&&s.call(t,w,j.isString(T)?T.trim():T,b,h))===!0&&v(w,b?b.concat(T):[T],S+1)}),d.pop()}}if(!j.isObject(e))throw new TypeError("data must be an object");return v(e),t}function Wc(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(n){return t[n]})}function Pl(e,t){this._pairs=[],e&&Ea(e,this,t)}const lh=Pl.prototype;lh.append=function(t,r){this._pairs.push([t,r])};lh.toString=function(t){const r=t?function(n){return t.call(this,n,Wc)}:Wc;return this._pairs.map(function(s){return r(s[0])+"="+r(s[1])},"").join("&")};function hw(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ch(e,t,r){if(!t)return e;const n=j.isFunction(r)?{serialize:r}:r,s=j.getSafeProp(n,"encode")||hw,o=j.getSafeProp(n,"serialize");let a;if(o?a=o(t,n):a=j.isURLSearchParams(t)?t.toString():new Pl(t,n).toString(s),a){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class Gc{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){j.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Rl={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},pw=typeof URLSearchParams<"u"?URLSearchParams:Pl,mw=typeof FormData<"u"?FormData:null,gw=typeof Blob<"u"?Blob:null,vw={isBrowser:!0,classes:{URLSearchParams:pw,FormData:mw,Blob:gw},protocols:["http","https","file","blob","url","data"]},Fl=typeof window<"u"&&typeof document<"u",Gi=typeof navigator=="object"&&navigator||void 0,yw=Fl&&(!Gi||["ReactNative","NativeScript","NS"].indexOf(Gi.product)<0),bw=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Cw=Fl&&window.location.href||"http://localhost",Sw=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Fl,hasStandardBrowserEnv:yw,hasStandardBrowserWebWorkerEnv:bw,navigator:Gi,origin:Cw},Symbol.toStringTag,{value:"Module"})),Ct={...Sw,...vw};function xw(e,t){return Ea(e,new Ct.classes.URLSearchParams,{visitor:function(r,n,s,o){return Ct.isNode&&j.isBuffer(r)?(this.append(n,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}const Kc=ah;function uh(e){if(e>Kc)throw new ne("FormData field is too deeply nested ("+e+" levels). Max depth: "+Kc,ne.ERR_FORM_DATA_DEPTH_EXCEEDED)}function _w(e){const t=[],r=/\w+|\[(\w*)]/g;let n;for(;(n=r.exec(e))!==null;)uh(t.length),t.push(n[0]==="[]"?"":n[1]||n[0]);return t}function ww(e){const t={},r=Object.keys(e);let n;const s=r.length;let o;for(n=0;n<s;n++)o=r[n],t[o]=e[o];return t}function dh(e){function t(r,n,s,o){uh(o);let a=r[o++];if(a==="__proto__")return!0;const i=Number.isFinite(+a),c=o>=r.length;return a=!a&&j.isArray(s)?s.length:a,c?(j.hasOwnProp(s,a)?s[a]=j.isArray(s[a])?s[a].concat(n):[s[a],n]:s[a]=n,!i):((!j.hasOwnProp(s,a)||!j.isObject(s[a]))&&(s[a]=[]),t(r,n,s[a],o)&&j.isArray(s[a])&&(s[a]=ww(s[a])),!i)}if(j.isFormData(e)&&j.isFunction(e.entries)){const r={};return j.forEachEntry(e,(n,s)=>{t(_w(n),s,r,0)}),r}return null}const En=(e,t)=>e!=null&&j.hasOwnProp(e,t)?e[t]:void 0;function Tw(e,t,r){if(j.isString(e))try{return(t||JSON.parse)(e),j.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const oo={transitional:Rl,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",s=n.indexOf("application/json")>-1,o=j.isObject(t);if(o&&j.isHTMLForm(t)&&(t=new FormData(t)),j.isFormData(t))return s?JSON.stringify(dh(t)):t;if(j.isArrayBuffer(t)||j.isBuffer(t)||j.isStream(t)||j.isFile(t)||j.isBlob(t)||j.isReadableStream(t))return t;if(j.isArrayBufferView(t))return t.buffer;if(j.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(o){const c=En(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return xw(t,c).toString();if((i=j.isFileList(t))||n.indexOf("multipart/form-data")>-1){const u=En(this,"env"),d=u&&u.FormData;return Ea(i?{"files[]":t}:t,d&&new d,c)}}return o||s?(r.setContentType("application/json",!1),Tw(t)):t}],transformResponse:[function(t){const r=En(this,"transitional")||oo.transitional,n=r&&r.forcedJSONParsing,s=En(this,"responseType"),o=s==="json";if(j.isResponse(t)||j.isReadableStream(t))return t;if(t&&j.isString(t)&&(n&&!s||o)){const i=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,En(this,"parseReviver"))}catch(c){if(i)throw c.name==="SyntaxError"?ne.from(c,ne.ERR_BAD_RESPONSE,this,null,En(this,"response")):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ct.classes.FormData,Blob:Ct.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};j.forEach(["delete","get","head","post","put","patch","query"],e=>{oo.headers[e]={}});function Ka(e,t){const r=this||oo,n=t||r,s=Lt.from(n.headers);let o=n.data;return j.forEach(e,function(i){o=i.call(r,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function fh(e){return!!(e&&e.__CANCEL__)}let ao=class extends ne{constructor(t,r,n){super(t??"canceled",ne.ERR_CANCELED,r,n),this.name="CanceledError",this.__CANCEL__=!0}};function hh(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new ne("Request failed with status code "+r.status,r.status>=400&&r.status<500?ne.ERR_BAD_REQUEST:ne.ERR_BAD_RESPONSE,r.config,r.request,r))}function Ew(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}function Aw(e,t){e=e||10;const r=new Array(e),n=new Array(e);let s=0,o=0,a;return t=t!==void 0?t:1e3,function(c){const u=Date.now(),d=n[o];a||(a=u),r[s]=c,n[s]=u;let f=o,p=0;for(;f!==s;)p+=r[f++],f=f%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),u-a<t)return;const m=d&&u-d;return m?Math.round(p*1e3/m):void 0}}function kw(e,t){let r=0,n=1e3/t,s,o;const a=(u,d=Date.now())=>{r=d,s=null,o&&(clearTimeout(o),o=null),e(...u)};return[(...u)=>{const d=Date.now(),f=d-r;f>=n?a(u,d):(s=u,o||(o=setTimeout(()=>{o=null,a(s)},n-f)))},()=>s&&a(s)]}const ta=(e,t,r=3)=>{let n=0;const s=Aw(50,250);return kw(o=>{if(!o||typeof o.loaded!="number")return;const a=o.loaded,i=o.lengthComputable?o.total:void 0,c=i!=null?Math.min(a,i):a,u=Math.max(0,c-n),d=s(u);n=Math.max(n,c);const f={loaded:c,total:i,progress:i?c/i:void 0,bytes:u,rate:d||void 0,estimated:d&&i?(i-c)/d:void 0,event:o,lengthComputable:i!=null,[t?"download":"upload"]:!0};e(f)},r)},Yc=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Zc=e=>(...t)=>j.asap(()=>e(...t)),Iw=Ct.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Ct.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Ct.origin),Ct.navigator&&/(msie|trident)/i.test(Ct.navigator.userAgent)):()=>!0,Lw=Ct.hasStandardBrowserEnv?{write(e,t,r,n,s,o,a){if(typeof document>"u")return;const i=[`${e}=${encodeURIComponent(t)}`];j.isNumber(r)&&i.push(`expires=${new Date(r).toUTCString()}`),j.isString(n)&&i.push(`path=${n}`),j.isString(s)&&i.push(`domain=${s}`),o===!0&&i.push("secure"),j.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+/,""),s=n.indexOf("=");if(s!==-1&&n.slice(0,s)===e)return decodeURIComponent(n.slice(s+1))}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Dw(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function jw(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}const Nw=/^https?:(?!\/\/)/i,Ow=/[\t\n\r]/g;function Pw(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}function Rw(e){return Pw(e).replace(Ow,"")}function Xc(e,t){if(typeof e=="string"&&Nw.test(Rw(e)))throw new ne('Invalid URL: missing "//" after protocol',ne.ERR_INVALID_URL,t)}function ph(e,t,r,n){Xc(t,n);let s=!Dw(t);return e&&(s||r===!1)?(Xc(e,n),jw(e,t)):t}const Jc=e=>e instanceof Lt?{...e}:e;function yn(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(d,f,p,m){return j.isPlainObject(d)&&j.isPlainObject(f)?j.merge.call({caseless:m},d,f):j.isPlainObject(f)?j.merge({},f):j.isArray(f)?f.slice():f}function s(d,f,p,m){if(j.isUndefined(f)){if(!j.isUndefined(d))return n(void 0,d,p,m)}else return n(d,f,p,m)}function o(d,f){if(!j.isUndefined(f))return n(void 0,f)}function a(d,f){if(j.isUndefined(f)){if(!j.isUndefined(d))return n(void 0,d)}else return n(void 0,f)}function i(d){const f=j.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!j.isUndefined(f))if(j.isPlainObject(f)){if(j.hasOwnProp(f,d))return f[d]}else return;const p=j.hasOwnProp(e,"transitional")?e.transitional:void 0;if(j.isPlainObject(p)&&j.hasOwnProp(p,d))return p[d]}function c(d,f,p){if(j.hasOwnProp(t,p))return n(d,f);if(j.hasOwnProp(e,p))return n(void 0,d)}const u={url:o,method:o,data:o,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:(d,f,p)=>s(Jc(d),Jc(f),p,!0)};return j.forEach(Object.keys({...e,...t}),function(f){if(f==="__proto__"||f==="constructor"||f==="prototype")return;const p=j.hasOwnProp(u,f)?u[f]:s,m=j.hasOwnProp(e,f)?e[f]:void 0,C=j.hasOwnProp(t,f)?t[f]:void 0,h=p(m,C,f);j.isUndefined(h)&&p!==c||(r[f]=h)}),j.hasOwnProp(t,"validateStatus")&&j.isUndefined(t.validateStatus)&&i("validateStatusUndefinedResolves")===!1&&(j.hasOwnProp(e,"validateStatus")?r.validateStatus=n(void 0,e.validateStatus):delete r.validateStatus),r}const Fw=["content-type","content-length"];function Mw(e,t,r){if(r!=="content-only"){e.set(t);return}Object.entries(t).forEach(([n,s])=>{Fw.includes(n.toLowerCase())&&e.set(n,s)})}const Bw=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16)));function mh(e){const t=yn({},e),r=p=>j.hasOwnProp(t,p)?t[p]:void 0,n=r("data");let s=r("withXSRFToken");const o=r("xsrfHeaderName"),a=r("xsrfCookieName");let i=r("headers");const c=r("auth"),u=r("baseURL"),d=r("allowAbsoluteUrls"),f=r("url");if(t.headers=i=Lt.from(i),t.url=ch(ph(u,f,d,t),r("params"),r("paramsSerializer")),c){const p=j.getSafeProp(c,"username")||"",m=j.getSafeProp(c,"password")||"";i.set("Authorization","Basic "+btoa(p+":"+(m?Bw(m):"")))}if(j.isFormData(n)&&(Ct.hasStandardBrowserEnv||Ct.hasStandardBrowserWebWorkerEnv||j.isReactNative(n)?i.setContentType(void 0):j.isFunction(n.getHeaders)&&Mw(i,n.getHeaders(),r("formDataHeaderPolicy"))),Ct.hasStandardBrowserEnv&&(j.isFunction(s)&&(s=s(t)),s===!0||s==null&&Iw(t.url))){const m=o&&a&&Lw.read(a);m&&i.set(o,m)}return t}const qw=typeof XMLHttpRequest<"u",$w=qw&&function(e){return new Promise(function(r,n){const s=mh(e);let o=s.data;const a=Lt.from(s.headers).normalize();let{responseType:i,onUploadProgress:c,onDownloadProgress:u}=s,d,f,p,m,C;function h(){m&&m(),C&&C(),s.cancelToken&&s.cancelToken.unsubscribe(d),s.signal&&s.signal.removeEventListener("abort",d)}let v=new XMLHttpRequest;v.open(s.method.toUpperCase(),s.url,!0),v.timeout=s.timeout;function y(){if(!v)return;const S=Lt.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),w={data:!i||i==="text"||i==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:S,config:e,request:v};hh(function(D){r(D),h()},function(D){n(D),h()},w),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 ne("Request aborted",ne.ECONNABORTED,e,v)),h(),v=null)},v.onerror=function(x){const w=x&&x.message?x.message:"Network Error",T=new ne(w,ne.ERR_NETWORK,e,v);T.event=x||null,n(T),h(),v=null},v.ontimeout=function(){let x=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const w=s.transitional||Rl;s.timeoutErrorMessage&&(x=s.timeoutErrorMessage),n(new ne(x,w.clarifyTimeoutError?ne.ETIMEDOUT:ne.ECONNABORTED,e,v)),h(),v=null},o===void 0&&a.setContentType(null),"setRequestHeader"in v&&j.forEach(sh(a),function(x,w){v.setRequestHeader(w,x)}),j.isUndefined(s.withCredentials)||(v.withCredentials=!!s.withCredentials),i&&i!=="json"&&(v.responseType=s.responseType),u&&([p,C]=ta(u,!0),v.addEventListener("progress",p)),c&&v.upload&&([f,m]=ta(c),v.upload.addEventListener("progress",f),v.upload.addEventListener("loadend",m)),(s.cancelToken||s.signal)&&(d=S=>{v&&(n(!S||S.type?new ao(null,e,v):S),v.abort(),h(),v=null)},s.cancelToken&&s.cancelToken.subscribe(d),s.signal&&(s.signal.aborted?d():s.signal.addEventListener("abort",d)));const b=Ew(s.url);if(b&&!Ct.protocols.includes(b)){n(new ne("Unsupported protocol "+b+":",ne.ERR_BAD_REQUEST,e));return}v.send(o||null)})},Uw=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const r=new AbortController;let n=!1;const s=function(c){if(!n){n=!0,a();const u=c instanceof Error?c:this.reason;r.abort(u instanceof ne?u:new ao(u instanceof Error?u.message:u))}};let o=t&&setTimeout(()=>{o=null,s(new ne(`timeout of ${t}ms exceeded`,ne.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),e=null)};e.forEach(c=>c.addEventListener("abort",s));const{signal:i}=r;return i.unsubscribe=()=>j.asap(a),i},zw=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,s;for(;n<r;)s=n+t,yield e.slice(n,s),n=s},Vw=async function*(e,t){for await(const r of Hw(e))yield*zw(r,t)},Hw=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()}},eu=(e,t,r,n)=>{const s=Vw(e,t);let o=0,a,i=c=>{a||(a=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:u,value:d}=await s.next();if(u){i(),c.close();return}let f=d.byteLength;if(r){let p=o+=f;r(p)}c.enqueue(new Uint8Array(d))}catch(u){throw i(u),u}},cancel(c){return i(c),s.return()}},{highWaterMark:2})},ra=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,Qw=(e,t,r)=>t+2<r&&ra(e.charCodeAt(t+1))&&ra(e.charCodeAt(t+2));function Ww(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 m=0;m<i;m++)if(n.charCodeAt(m)===37&&m+2<i){const C=n.charCodeAt(m+1),h=n.charCodeAt(m+2);ra(C)&&ra(h)&&(a-=2,m+=2)}let c=0,u=i-1;const d=m=>m>=2&&n.charCodeAt(m-2)===37&&n.charCodeAt(m-1)===51&&(n.charCodeAt(m)===68||n.charCodeAt(m)===100);u>=0&&(n.charCodeAt(u)===61?(c++,u--):d(u)&&(c++,u-=3)),c===1&&u>=0&&(n.charCodeAt(u)===61||d(u))&&c++;const p=Math.floor(a/4)*3-(c||0);return p>0?p:0}let o=0;for(let a=0,i=n.length;a<i;a++){const c=n.charCodeAt(a);if(c===37&&Qw(n,a,i))o+=1,a+=2;else if(c<128)o+=1;else if(c<2048)o+=2;else if(c>=55296&&c<=56319&&a+1<i){const u=n.charCodeAt(a+1);u>=56320&&u<=57343?(o+=4,a++):o+=3}else o+=3}return o}const Ml="1.18.0",tu=64*1024,{isFunction:bo}=j,Gw=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16))),ru=e=>{if(!j.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},nu=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Kw=e=>{const t=e.indexOf("://");let r=e;return t!==-1&&(r=r.slice(t+3)),r.includes("@")||r.includes(":")},Yw=e=>{const t=j.global!==void 0&&j.global!==null?j.global:globalThis,{ReadableStream:r,TextEncoder:n}=t;e=j.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:s,Request:o,Response:a}=e,i=s?bo(s):typeof fetch=="function",c=bo(o),u=bo(a);if(!i)return!1;const d=i&&bo(r),f=i&&(typeof n=="function"?(y=>b=>y.encode(b))(new n):async y=>new Uint8Array(await new o(y).arrayBuffer())),p=c&&d&&nu(()=>{let y=!1;const b=new o(Ct.origin,{body:new r,method:"POST",get duplex(){return y=!0,"half"}}),S=b.headers.has("Content-Type");return b.body!=null&&b.body.cancel(),y&&!S}),m=u&&d&&nu(()=>j.isReadableStream(new a("").body)),C={stream:m&&(y=>y.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(y=>{!C[y]&&(C[y]=(b,S)=>{let x=b&&b[y];if(x)return x.call(b);throw new ne(`Response type '${y}' is not supported`,ne.ERR_NOT_SUPPORT,S)})});const h=async y=>{if(y==null)return 0;if(j.isBlob(y))return y.size;if(j.isSpecCompliantForm(y))return(await new o(Ct.origin,{method:"POST",body:y}).arrayBuffer()).byteLength;if(j.isArrayBufferView(y)||j.isArrayBuffer(y))return y.byteLength;if(j.isURLSearchParams(y)&&(y=y+""),j.isString(y))return(await f(y)).byteLength},v=async(y,b)=>{const S=j.toFiniteNumber(y.getContentLength());return S??h(b)};return async y=>{let{url:b,method:S,data:x,signal:w,cancelToken:T,timeout:D,onDownloadProgress:k,onUploadProgress:N,responseType:F,headers:A,withCredentials:P="same-origin",fetchOptions:R,maxContentLength:O,maxBodyLength:U}=mh(y);const re=j.isNumber(O)&&O>-1,W=j.isNumber(U)&&U>-1,pe=M=>j.hasOwnProp(y,M)?y[M]:void 0;let ge=s||fetch;F=F?(F+"").toLowerCase():"text";let G=Uw([w,T&&T.toAbortSignal()],D),le=null;const te=G&&G.unsubscribe&&(()=>{G.unsubscribe()});let xe,ve=null;const q=()=>new ne("Request body larger than maxBodyLength limit",ne.ERR_BAD_REQUEST,y,le);try{let M;const $=pe("auth");if($){const H=j.getSafeProp($,"username")||"",be=j.getSafeProp($,"password")||"";M={username:H,password:be}}if(Kw(b)){const H=new URL(b,Ct.origin);if(!M&&(H.username||H.password)){const be=ru(H.username),qe=ru(H.password);M={username:be,password:qe}}(H.username||H.password)&&(H.username="",H.password="",b=H.href)}if(M&&(A.delete("authorization"),A.set("Authorization","Basic "+btoa(Gw((M.username||"")+":"+(M.password||""))))),re&&typeof b=="string"&&b.startsWith("data:")&&Ww(b)>O)throw new ne("maxContentLength size of "+O+" exceeded",ne.ERR_BAD_RESPONSE,y,le);if(W&&S!=="get"&&S!=="head"){const H=await h(x);if(typeof H=="number"&&isFinite(H)&&(xe=H,H>U))throw q()}const se=W&&(j.isReadableStream(x)||j.isStream(x)),ae=(H,be,qe)=>eu(H,tu,et=>{if(W&&et>U)throw ve=q();be&&be(et)},qe);if(p&&S!=="get"&&S!=="head"&&(N||se)){if(xe=xe??await v(A,x),xe!==0||se){let H=new o(b,{method:"POST",body:x,duplex:"half"}),be;if(j.isFormData(x)&&(be=H.headers.get("content-type"))&&A.setContentType(be),H.body){const[qe,et]=N&&Yc(xe,ta(Zc(N)))||[];x=ae(H.body,qe,et)}}}else if(se&&!c&&d&&S!=="get"&&S!=="head")x=ae(x);else if(se&&c&&!p&&S!=="get"&&S!=="head")throw new ne("Stream request bodies are not supported by the current fetch implementation",ne.ERR_NOT_SUPPORT,y,le);j.isString(P)||(P=P?"include":"omit");const Se=c&&"credentials"in o.prototype;if(j.isFormData(x)){const H=A.getContentType();H&&/^multipart\/form-data/i.test(H)&&!/boundary=/i.test(H)&&A.delete("content-type")}A.set("User-Agent","axios/"+Ml,!1);const fe={...R,signal:G,method:S.toUpperCase(),headers:sh(A.normalize()),body:x,duplex:"half",credentials:Se?P:void 0};le=c&&new o(b,fe);let ye=await(c?ge(le,R):ge(b,fe));const Ae=Lt.from(ye.headers);if(re){const H=j.toFiniteNumber(Ae.getContentLength());if(H!=null&&H>O)throw new ne("maxContentLength size of "+O+" exceeded",ne.ERR_BAD_RESPONSE,y,le)}const J=m&&(F==="stream"||F==="response");if(m&&ye.body&&(k||re||J&&te)){const H={};["status","statusText","headers"].forEach(tt=>{H[tt]=ye[tt]});const be=j.toFiniteNumber(Ae.getContentLength()),[qe,et]=k&&Yc(be,ta(Zc(k),!0))||[];let $e=0;const We=tt=>{if(re&&($e=tt,$e>O))throw new ne("maxContentLength size of "+O+" exceeded",ne.ERR_BAD_RESPONSE,y,le);qe&&qe(tt)};ye=new a(eu(ye.body,tu,We,()=>{et&&et(),te&&te()}),H)}F=F||"text";let he=await C[j.findKey(C,F)||"text"](ye,y);if(re&&!m&&!J){let H;if(he!=null&&(typeof he.byteLength=="number"?H=he.byteLength:typeof he.size=="number"?H=he.size:typeof he=="string"&&(H=typeof n=="function"?new n().encode(he).byteLength:he.length)),typeof H=="number"&&H>O)throw new ne("maxContentLength size of "+O+" exceeded",ne.ERR_BAD_RESPONSE,y,le)}return!J&&te&&te(),await new Promise((H,be)=>{hh(H,be,{data:he,headers:Lt.from(ye.headers),status:ye.status,statusText:ye.statusText,config:y,request:le})})}catch(M){if(te&&te(),G&&G.aborted&&G.reason instanceof ne){const $=G.reason;throw $.config=y,le&&($.request=le),M!==$&&($.cause=M),$}throw ve?(le&&!ve.request&&(ve.request=le),ve):M instanceof ne?(le&&!M.request&&(M.request=le),M):M&&M.name==="TypeError"&&/Load failed|fetch/i.test(M.message)?Object.assign(new ne("Network Error",ne.ERR_NETWORK,y,le,M&&M.response),{cause:M.cause||M}):ne.from(M,M&&M.code,y,le,M&&M.response)}}},Zw=new Map,gh=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:s}=t,o=[n,s,r];let a=o.length,i=a,c,u,d=Zw;for(;i--;)c=o[i],u=d.get(c),u===void 0&&d.set(c,u=i?new Map:Yw(t)),d=u;return u};gh();const Bl={http:uw,xhr:$w,fetch:{get:gh}};j.forEach(Bl,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const su=e=>`- ${e}`,Xw=e=>j.isFunction(e)||e===null||e===!1;function Jw(e,t){e=j.isArray(e)?e:[e];const{length:r}=e;let n,s;const o={};for(let a=0;a<r;a++){n=e[a];let i;if(s=n,!Xw(n)&&(s=Bl[(i=String(n)).toLowerCase()],s===void 0))throw new ne(`Unknown adapter '${i}'`);if(s&&(j.isFunction(s)||(s=s.get(t))))break;o[i||"#"+a]=s}if(!s){const a=Object.entries(o).map(([c,u])=>`adapter ${c} `+(u===!1?"is not supported by the environment":"is not available in the build"));let i=r?a.length>1?`since :
|
|
531
|
+
`+a.map(su).join(`
|
|
532
|
+
`):" "+su(a[0]):"as no adapter specified";throw new ne("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return s}const vh={getAdapter:Jw,adapters:Bl};function Ya(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ao(null,e)}function ou(e){return Ya(e),e.headers=Lt.from(e.headers),e.data=Ka.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),vh.getAdapter(e.adapter||oo.adapter,e)(e).then(function(n){Ya(e),e.response=n;try{n.data=Ka.call(e,e.transformResponse,n)}finally{delete e.response}return n.headers=Lt.from(n.headers),n},function(n){if(!fh(n)&&(Ya(e),n&&n.response)){e.response=n.response;try{n.response.data=Ka.call(e,e.transformResponse,n.response)}finally{delete e.response}n.response.headers=Lt.from(n.response.headers)}return Promise.reject(n)})}const Aa={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Aa[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const au={};Aa.transitional=function(t,r,n){function s(o,a){return"[Axios v"+Ml+"] Transitional option '"+o+"'"+a+(n?". "+n:"")}return(o,a,i)=>{if(t===!1)throw new ne(s(a," has been removed"+(r?" in "+r:"")),ne.ERR_DEPRECATED);return r&&!au[a]&&(au[a]=!0,console.warn(s(a," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(o,a,i):!0}};Aa.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function eT(e,t,r){if(typeof e!="object")throw new ne("options must be an object",ne.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let s=n.length;for(;s-- >0;){const o=n[s],a=Object.prototype.hasOwnProperty.call(t,o)?t[o]:void 0;if(a){const i=e[o],c=i===void 0||a(i,o,e);if(c!==!0)throw new ne("option "+o+" must be "+c,ne.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new ne("Unknown option "+o,ne.ERR_BAD_OPTION)}}const Oo={assertOptions:eT,validators:Aa},xt=Oo.validators;let pn=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Gc,response:new Gc}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=(()=>{if(!s.stack)return"";const a=s.stack.indexOf(`
|
|
533
|
+
`);return a===-1?"":s.stack.slice(a+1)})();try{if(!n.stack)n.stack=o;else if(o){const a=o.indexOf(`
|
|
534
|
+
`),i=a===-1?-1:o.indexOf(`
|
|
535
|
+
`,a+1),c=i===-1?"":o.slice(i+1);String(n.stack).endsWith(c)||(n.stack+=`
|
|
536
|
+
`+o)}}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=yn(this.defaults,r);const{transitional:n,paramsSerializer:s,headers:o}=r;n!==void 0&&Oo.assertOptions(n,{silentJSONParsing:xt.transitional(xt.boolean),forcedJSONParsing:xt.transitional(xt.boolean),clarifyTimeoutError:xt.transitional(xt.boolean),legacyInterceptorReqResOrdering:xt.transitional(xt.boolean),advertiseZstdAcceptEncoding:xt.transitional(xt.boolean),validateStatusUndefinedResolves:xt.transitional(xt.boolean)},!1),s!=null&&(j.isFunction(s)?r.paramsSerializer={serialize:s}:Oo.assertOptions(s,{encode:xt.function,serialize:xt.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Oo.assertOptions(r,{baseUrl:xt.spelling("baseURL"),withXsrfToken:xt.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let a=o&&j.merge(o.common,o[r.method]);o&&j.forEach(["delete","get","head","post","put","patch","query","common"],C=>{delete o[C]}),r.headers=Lt.concat(a,o);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||Rl;v&&v.legacyInterceptorReqResOrdering?i.unshift(h.fulfilled,h.rejected):i.push(h.fulfilled,h.rejected)});const u=[];this.interceptors.response.forEach(function(h){u.push(h.fulfilled,h.rejected)});let d,f=0,p;if(!c){const C=[ou.bind(this),void 0];for(C.unshift(...i),C.push(...u),p=C.length,d=Promise.resolve(r);f<p;)d=d.then(C[f++],C[f++]);return d}p=i.length;let m=r;for(;f<p;){const C=i[f++],h=i[f++];try{m=C(m)}catch(v){h.call(this,v);break}}try{d=ou.call(this,m)}catch(C){return Promise.reject(C)}for(f=0,p=u.length;f<p;)d=d.then(u[f++],u[f++]);return d}getUri(t){t=yn(this.defaults,t);const r=ph(t.baseURL,t.url,t.allowAbsoluteUrls,t);return ch(r,t.params,t.paramsSerializer)}};j.forEach(["delete","get","head","options"],function(t){pn.prototype[t]=function(r,n){return this.request(yn(n||{},{method:t,url:r,data:n&&j.hasOwnProp(n,"data")?n.data:void 0}))}});j.forEach(["post","put","patch","query"],function(t){function r(n){return function(o,a,i){return this.request(yn(i||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}pn.prototype[t]=r(),t!=="query"&&(pn.prototype[t+"Form"]=r(!0))});let tT=class yh{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});const n=this;this.promise.then(s=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](s);n._listeners=null}),this.promise.then=s=>{let o;const a=new Promise(i=>{n.subscribe(i),o=i}).then(s);return a.cancel=function(){n.unsubscribe(o)},a},t(function(o,a,i){n.reason||(n.reason=new ao(o,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 yh(function(s){t=s}),cancel:t}}};function rT(e){return function(r){return e.apply(null,r)}}function nT(e){return j.isObject(e)&&e.isAxiosError===!0}const Ki={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(Ki).forEach(([e,t])=>{Ki[t]=e});function bh(e){const t=new pn(e),r=Kf(pn.prototype.request,t);return j.extend(r,pn.prototype,t,{allOwnKeys:!0}),j.extend(r,t,null,{allOwnKeys:!0}),r.create=function(s){return bh(yn(e,s))},r}const st=bh(oo);st.Axios=pn;st.CanceledError=ao;st.CancelToken=tT;st.isCancel=fh;st.VERSION=Ml;st.toFormData=Ea;st.AxiosError=ne;st.Cancel=st.CanceledError;st.all=function(t){return Promise.all(t)};st.spread=rT;st.isAxiosError=nT;st.mergeConfig=yn;st.AxiosHeaders=Lt;st.formToJSON=e=>dh(j.isHTMLForm(e)?new FormData(e):e);st.getAdapter=vh.getAdapter;st.HttpStatusCode=Ki;st.default=st;const{Axios:s$,AxiosError:o$,CanceledError:a$,isCancel:i$,CancelToken:l$,VERSION:c$,all:u$,Cancel:d$,isAxiosError:f$,spread:h$,toFormData:p$,AxiosHeaders:m$,HttpStatusCode:g$,formToJSON:v$,getAdapter:y$,mergeConfig:b$,create:C$}=st;let Yi="";function Ch(e){Yi=e}const Fe=st.create({timeout:3e4});function sT(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)}Fe.interceptors.request.use(async e=>{var s,o,a;const{useEditorStore:t}=await Promise.resolve().then(()=>mb),r=t.getState(),n=(s=r.editorConfig)==null?void 0:s.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=sT(e.url,(a=(o=r.editorConfig)==null?void 0:o.config)==null?void 0:a.apiSlug),Yi&&(e.baseURL=Yi),e});const Sh="/portal";async function xh(e){var n,s,o,a,i,c,u;const t=await Fe.get(`${Sh}/questionset/v2/hierarchy/${e}`,{params:{mode:"edit"}}),r=(s=(n=t.data)==null?void 0:n.result)==null?void 0:s.questionset;if(!r||!r.identifier){const d=((a=(o=t.data)==null?void 0:o.params)==null?void 0:a.errmsg)||((c=(i=t.data)==null?void 0:i.params)==null?void 0:c.err)||((u=t.data)==null?void 0:u.responseCode)||`No questionset returned for "${e}"`;throw new Error(`Unable to load questionset hierarchy: ${d}`)}return r}async function oT(e){var r,n;return e.length?((n=(r=(await Fe.post(`${Sh}/question/v2/list`,{request:{search:{identifier:e}}})).data)==null?void 0:r.result)==null?void 0:n.questions)??[]:[]}function ka(e,t){const r=e??{},n=r.identifier??"",s=r.objectType??"",o=r.mimeType??"",a=r.children,i=Array.isArray(a)?a.map(u=>ka(u,n)):[],c=o==="application/vnd.ekstep.content-collection"||s.toLowerCase().includes("unit")||s.toLowerCase().includes("textbook")||s.toLowerCase().includes("collection")||s.toLowerCase().includes("course")||s.toLowerCase().includes("lesson")||r.visibility==="Parent"||o==="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:s,contentType:r.contentType,visibility:r.visibility,status:r.status,appIcon:r.appIcon,isFolder:c,children:i,metadata:r,parent:t}}async function _h(e){var s,o,a,i,c,u,d;const t=await Fe.get(`/action/collection/v1/hierarchy/${e}`,{params:{mode:"edit"}}),r=(o=(s=t.data)==null?void 0:s.result)==null?void 0:o.content;if(!r||!r.identifier){const f=((i=(a=t.data)==null?void 0:a.params)==null?void 0:i.errmsg)||((u=(c=t.data)==null?void 0:c.params)==null?void 0:u.err)||((d=t.data)==null?void 0:d.responseCode)||`No content returned for "${e}"`;throw new Error(`Unable to load hierarchy: ${f}`)}const n=ka(r);return{content:r,rootNode:n}}async function aT(e){const t=await xh(e),r=ka(t);return{content:t,rootNode:r}}async function iT(e,t,r,n){var o;return((o=(await Fe.patch("/action/collection/v1/hierarchy/update",{request:{data:{nodesModified:t,hierarchy:r,...n?{lastUpdatedBy:n}:{}}}})).data)==null?void 0:o.result)??{}}async function lT(e,t=""){await Fe.post(`/action/collection/v1/publish/${e}`,{request:{content:{lastPublishedBy:t}}})}async function cT(e){var n,s,o,a,i,c,u;const t=await Fe.get(`/action/course/v1/hierarchy/${e}`,{params:{mode:"edit"}}),r=(s=(n=t.data)==null?void 0:n.result)==null?void 0:s.content;if(!r||!r.identifier){const d=((a=(o=t.data)==null?void 0:o.params)==null?void 0:a.errmsg)||((c=(i=t.data)==null?void 0:i.params)==null?void 0:c.err)||((u=t.data)==null?void 0:u.responseCode)||`No course returned for "${e}"`;throw new Error(`Unable to load course hierarchy: ${d}`)}return r}async function wh(e){var r,n;return(n=(r=(await Fe.get(`/action/collection/v1/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.content}async function uT(e){await Fe.post(`/action/collection/v1/review/${e}`,{request:{content:{}}})}async function dT(e,t){await Fe.post(`/action/collection/v1/reject/${e}`,{request:{content:{rejectComment:t}}})}async function fT(e,t){await Fe.patch(`/action/content/v1/collaborator/update/${e}`,{request:{content:{collaborators:t}}})}const Th="Evaluation Course";function mn(e){return(e==null?void 0:e.primaryCategory)===Th}function hT(e){const t=(e.children??[]).map(r=>({...r,children:(r.children??[]).map(n=>{var o;const s=!!((o=n.metadata)!=null&&o.isAssessmentCourse)||mn(n.metadata);return{...n,isFolder:!1,children:[],metadata:{...n.metadata??{},...s?{isAssessmentCourse:!0}:{}}}})}));return{...e,children:t}}function nt(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 Eh(e){return((e==null?void 0:e.children)??[]).find(t=>{var r;return!!((r=t.metadata)!=null&&r.isAssessmentCourse)})}function pT(e,t,r){return r?e===0?"pre":e===t-1?"post":"levelAssessment":"content"}function mT(e,t){const r=e.findIndex(s=>s.id===t);return r===-1?null:$s(e,r)?{role:r===0?"pre":"post",levelNumber:null}:{role:"level",levelNumber:e.slice(0,r+1).filter((s,o)=>!$s(e,o)).length}}function qs(e,t){return t==="pre"?e.length>0&&nt(e[0]):e.length>1&&nt(e[e.length-1])}function $s(e,t){const r=pT(t,e.length,nt(e[t]));return r==="pre"||r==="post"}function Zi(e,t){const r=t?e.findIndex(n=>n.id===t.id):-1;return r!==-1&&$s(e,r)}function iu(e,t){var n,s;return(((n=e[0])==null?void 0:n.id)===t.id||((s=e[e.length-1])==null?void 0:s.id)===t.id)&&(t.children??[]).length===0}function gT(e){return qs(e,"pre")?qs(e,"post")?null:"post":"pre"}function vT(e,t,r){if(t<0||t>=e.length)return!1;const n=nt(e[0])?e[0]:null,s=e.length>1&&nt(e[e.length-1])?e[e.length-1]:null,o=[...e],[a]=o.splice(t,1);return o.splice(r,0,a),!(n&&o[0]!==n||s&&o[o.length-1]!==s||!n&&nt(o[0])||!s&&o.length>1&&nt(o[o.length-1]))}function lu(e,t,r){return r?!1:t?!((e==null?void 0:e.children)??[]).some(s=>{var o;return!!((o=s.metadata)!=null&&o.isAssessmentCourse)}):!0}function bn(e){return Array.isArray(e)?e.map(String):e?[String(e)]:[]}function Ah(e,t){var n,s;return e?((n=t[e.id])==null?void 0:n.framework)??((s=e.metadata)==null?void 0:s.framework):void 0}function kh(e,t){return!!Ah(e,t)}function Ih(e,t){if(!e||!t)return[];const r=new Set,n=e.children??[];return n.forEach((s,o)=>{var a,i;$s(n,o)?bn((a=s.children[0].metadata)==null?void 0:a[t]).forEach(c=>r.add(c)):bn((i=s.metadata)==null?void 0:i[t]).forEach(c=>r.add(c))}),Array.from(r)}function yT(e,t,r){var u,d;if(!e||!t)return null;const n=Ih(e,t),s=((u=r[e.id])==null?void 0:u[t])??((d=e.metadata)==null?void 0:d[t]),o=bn(s),a=[...n].sort(),i=[...o].sort();return a.length===i.length&&a.every((f,p)=>f===i[p])?null:n}function bT(e,t,r){if(!e||!t||r.length===0)return[];const n=e.children??[];return n.filter((s,o)=>{var i;return $s(n,o)?!1:bn((i=s.metadata)==null?void 0:i[t]).some(c=>!r.includes(c))})}function Lh(e,t,r){var s;if(!e||!r||t.length===0)return[];const n=new Set;for(const o of e.children??[])bn((s=o.metadata)==null?void 0:s[r]).forEach(a=>n.add(a));return t.filter(o=>!n.has(o))}const Dh=new Set(["adaptive"]);function ql(e,t,r,n={}){var C,h,v,y;const s=[];if(!e)return s;const o=((C=n[e.id])==null?void 0:C.policy)??((h=e.metadata)==null?void 0:h.policy);o||s.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,u=nt(i),d=nt(c);!u&&o&&Dh.has(o)&&s.push({code:"priorAssessmentRequired",message:"A Prior Assessment is required for the Adaptive policy."}),[[i,"Prior Assessment"],[c,"Outcome Assessment"]].forEach(([b,S])=>{if(!b)return;const x=b.children??[],w=x.filter(T=>{var D;return!!((D=T.metadata)!=null&&D.isAssessmentCourse)});w.length!==0&&(w.length<x.length||x.length!==1&&s.push({code:"slotNotPure",nodeId:b.id,message:`${S} must contain exactly one question-set-only course.`}))});const f=new Set,p=(b,S)=>{f.has(b)&&s.push({code:"duplicateCourse",nodeId:S,message:"A course appears more than once in this path."}),f.add(b)},m=a.slice(u?1:0,a.length-(d?1:0));u&&p(i.children[0].id,i.id),d&&p(c.children[0].id,c.id);for(const b of m){const S=b.children??[],x=S.length===0;x&&s.push({code:"emptyLevel",nodeId:b.id,message:`"${b.name}" has no courses yet.`});const w=t?bn((v=b.metadata)==null?void 0:v[t]):[];if(w.length===0)x||s.push({code:"levelMissingSkills",nodeId:b.id,message:`"${b.name}" needs at least one skill selected.`});else{if(r.length>0){const D=w.filter(k=>!r.includes(k));D.length>0&&s.push({code:"levelSkillsOutOfScope",nodeId:b.id,message:`"${b.name}" has skills outside the current scope: ${D.join(", ")}.`})}const T=Lh(b,w,t);T.length>0&&s.push({code:"levelSkillsUncovered",nodeId:b.id,message:`"${b.name}" has no course covering: ${T.join(", ")}.`})}for(const T of S)p(T.id,b.id),(t?bn((y=T.metadata)==null?void 0:y[t]):[]).length===0&&s.push({code:"courseMissingSkillTag",nodeId:T.id,message:`"${T.name}" has no skill tag.`})}return s}async function CT(e){const t=[],r=(e==null?void 0:e.children)??[],n=r[0],s=r.length>1?r[r.length-1]:void 0;for(const[o,a]of[[n,"Prior Assessment"],[s,"Outcome Assessment"]]){if(!o||!nt(o))continue;const i=o.children[0].id,c=await wh(i);mn(c)||t.push({code:"slotCourseChanged",nodeId:o.id,message:`${a}'s course is no longer an Evaluation Course — pick a different course.`})}return t}function Tt(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 jh(e,t,r=0){var n;for(const s of e){if(s.id===t)return r;if((n=s.children)!=null&&n.length){const o=jh(s.children,t,r+1);if(o>=0)return o}}return-1}const cu=new Set(["name","appIcon","description","keywords","trackable","qrCodeProcessId","reservedDialcodes"]);function Nh(e,t,r,n){return e.map(s=>{if(s.id===t){const o=r.metadata??{},a=n!=null&&n.length?new Set([...cu,...n]):cu,i={};for(const c of a)c in r&&(i[c]=r[c]);return{...s,...r,metadata:{...s.metadata??{},...i,...o}}}return s.children&&s.children.length>0?{...s,children:Nh(s.children,t,r,n)}:s})}function Po(e,t,r){return e.map(n=>n.id===t?{...n,children:[...n.children??[],r]}:n.children&&n.children.length>0?{...n,children:Po(n.children,t,r)}:n)}function Oh(e,t,r,n){return e.map(s=>{if(s.id===t){const o=[...s.children??[]];return o.splice(n,0,r),{...s,children:o}}return s.children&&s.children.length>0?{...s,children:Oh(s.children,t,r,n)}:s})}function Xi(e,t){return e.filter(r=>r.id!==t).map(r=>({...r,children:r.children?Xi(r.children,t):[]}))}function Ji(e,t,r,n){return e.map(s=>{if(s.id===t){const o=[...s.children??[]],[a]=o.splice(r,1);return o.splice(n,0,a),{...s,children:o}}return s.children&&s.children.length>0?{...s,children:Ji(s.children,t,r,n)}:s})}function Ph(e,t){return e.map(r=>{const n=t[r.id]??r.id,s=r.parent?t[r.parent]??r.parent:r.parent;return{...r,id:n,identifier:n,parent:s,children:r.children?Ph(r.children,t):[]}})}function ST(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 xT(e,t){const r=Tt(e,t);if(!r)return[];const n=[];let s=r;for(;s;)n.unshift({id:s.id,name:s.name}),s=s.parent?Tt(e,s.parent):void 0;return n}const oe=ro((e,t)=>({treeData:[],selectedNodeId:null,treeCache:{},breadcrumb:[],activeNodeMeta:{},setTreeData:r=>{var s;const n=((s=r[0])==null?void 0:s.id)??null;e({treeData:r,selectedNodeId:n}),n&&setTimeout(()=>t().selectNode(n),0)},selectNode:r=>{const{treeData:n,treeCache:s,getBreadcrumb:o}=t(),a=Tt(n,r),i=o(r),c={...(a==null?void 0:a.metadata)??{},...s[r]??{}};X.getState().setNodeFlags({isFolder:(a==null?void 0:a.isFolder)??!1,isRoot:!(a!=null&&a.parent),isQuml:!1}),rt.getState().setActiveAssessmentSlot(null),e({selectedNodeId:r,breadcrumb:i,activeNodeMeta:c})},updateNode:(r,n,s)=>{if(e(o=>({treeData:Nh(o.treeData,r,n,s),treeCache:{...o.treeCache,[r]:{...o.treeCache[r]??{},...n}}})),t().selectedNodeId===r){const o=Tt(t().treeData,r);e(a=>({activeNodeMeta:{...(o==null?void 0:o.metadata)??{},...a.treeCache[r]??{}}}))}t().markDirty()},addNode:(r,n)=>{var p,m,C;const s=t(),o=X.getState().editorProfile,a=((m=(p=X.getState().editorConfig)==null?void 0:p.config)==null?void 0:m.maxDepth)??o.maxDepth,i=jh(s.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),u={id:c,identifier:c,name:o.defaultUnitName,isFolder:!0,children:[],parent:r,metadata:{mimeType:"application/vnd.ekstep.content-collection",code:crypto.randomUUID(),name:o.defaultUnitName,contentType:o.unitContentType,primaryCategory:o.unitPrimaryCategory,visibility:"Parent"}},d=((C=Tt(s.treeData,r))==null?void 0:C.children)??[],f=o.derivedRoles&&qs(d,"post");return e(h=>({treeData:f?Oh(h.treeData,r,u,d.length-1):Po(h.treeData,r,u),treeCache:{...h.treeCache,[c]:{...u.metadata,isNew:!0}}})),setTimeout(()=>t().selectNode(c),0),c},deleteNode:r=>{var o,a,i;const n=(o=t().treeData[0])==null?void 0:o.id;if(r===n)return!1;if(X.getState().editorProfile.derivedRoles){const c=Tt(t().treeData,r),u=c!=null&&c.parent?Tt(t().treeData,c.parent):void 0,d=((a=t().treeData[0])==null?void 0:a.children)??[],f=u?d.findIndex(p=>p.id===u.id):-1;if(f===0||f===d.length-1){const p=(u.children??[]).filter(m=>m.id!==r);if(p.length===1&&((i=p[0].metadata)!=null&&i.isAssessmentCourse))return!1}}return e(c=>({treeData:Xi(c.treeData,r),selectedNodeId:c.selectedNodeId===r?null:c.selectedNodeId})),!0},reorderChildren:(r,n,s)=>{var i;const o=X.getState().editorProfile,a=(i=t().treeData[0])==null?void 0:i.id;if(o.derivedRoles&&r===a){const c=Tt(t().treeData,r);if(c!=null&&c.children&&!vT(c.children,n,s))return}e(c=>({treeData:Ji(c.treeData,r,n,s)}))},moveNode:(r,n,s)=>{var u,d,f;const o=X.getState().editorProfile,a=Tt(t().treeData,r),i=Tt(t().treeData,s);if(!(i!=null&&i.isFolder))return;const c=(u=t().treeData[0])==null?void 0:u.id;if(!(o.derivedRoles&&(a!=null&&a.isFolder)&&s!==c)){if(o.derivedRoles&&a&&!a.isFolder){const p=!!((d=a.metadata)!=null&&d.isAssessmentCourse),m=((f=t().treeData[0])==null?void 0:f.children)??[];if(!lu(i,p,Zi(m,i)))return}e(p=>{const m=Tt(p.treeData,r);if(!m)return p;let C=Xi(p.treeData,r);return C=Po(C,s,{...m,parent:s}),{treeData:C}}),t().markDirty()}},addResource:(r,n,s)=>{var C,h,v,y,b,S;const o=X.getState().editorConfig,a=X.getState().editorProfile,i=(C=t().treeData[0])==null?void 0:C.id,c=!!(s!=null&&s.isAssessmentCourse);if(a.derivedRoles&&n===i){if(!c||Tt(t().treeData,r.identifier))return!1;const x=t().treeData[0],w=(x==null?void 0:x.children)??[],T=(s==null?void 0:s.slot)??gT(w);if(!T||qs(w,T))return!1;const D=t().addNode(i,"unit");if(!D)return!1;const{learningPath:k}=jl.getState().labelConfig;if(t().updateNode(D,{name:T==="pre"?k.priorAssessmentLabel:k.outcomeAssessmentLabel}),T==="pre"){const N=(((v=(h=t().treeData[0])==null?void 0:h.children)==null?void 0:v.length)??1)-1;e(F=>({treeData:Ji(F.treeData,i,N,0)}))}return t().addResource(r,D,s)}if(!(((y=o==null?void 0:o.config)==null?void 0:y.allowContentUnderRoot)??!1)&&n===i||Tt(t().treeData,r.identifier))return!1;const d=Tt(t().treeData,n);if(!(d!=null&&d.isFolder))return!1;if(a.derivedRoles){const x=((b=t().treeData[0])==null?void 0:b.children)??[];if(!lu(d,c,Zi(x,d)))return!1}const f=((S=o==null?void 0:o.config)==null?void 0:S.maxContentsLimit)??1200;if(ST(t().treeData)>=f)return!1;const m={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(x=>({treeData:Po(x.treeData,n,m)})),t().markDirty(),!0},markDirty:()=>{const{editorMode:r,setIsDirty:n}=X.getState();r==="edit"&&n(!0)},pruneCoursesByFramework:r=>{let n=0;return e(s=>{const o=s.treeData[0];if(!o)return s;const a=[];for(const i of o.children??[]){const c=nt(i),u=(i.children??[]).filter(d=>{var m;if(d.isFolder)return!0;const f=(m=d.metadata)==null?void 0:m.framework,p=!f||(Array.isArray(f)?f.includes(r):f===r);return p||n++,p});c&&u.length===0||a.push(u.length===(i.children??[]).length?i:{...i,children:u})}return n===0?s:{treeData:[{...o,children:a}]}}),n>0&&t().markDirty(),n},clearLevelSkills:r=>{if(!r)return 0;let n=0;return e(s=>{const o=s.treeData[0];if(!o)return s;const a={...s.treeCache},i=(o.children??[]).map(c=>{var p,m;if(!(((p=c.metadata)==null?void 0:p[r])!==void 0||((m=a[c.id])==null?void 0:m[r])!==void 0))return c;n++;const{[r]:d,...f}=c.metadata??{};if(a[c.id]){const{[r]:C,...h}=a[c.id];a[c.id]=h}return{...c,metadata:f}});return n===0?s:{treeData:[{...o,children:i}],treeCache:a}}),n>0&&t().markDirty(),n},replaceNodeIds:r=>{!r||Object.keys(r).length===0||e(n=>{const s=Ph(n.treeData,r),o={};for(const[i,c]of Object.entries(n.treeCache)){const u=r[i]??i,{isNew:d,...f}=c;o[u]=f}const a=n.selectedNodeId?r[n.selectedNodeId]??n.selectedNodeId:null;return{treeData:s,treeCache:o,selectedNodeId:a}})},getNodeById:r=>Tt(t().treeData,r),getChildrenOf:r=>{const n=Tt(t().treeData,r);return(n==null?void 0:n.children)??[]},getBreadcrumb:r=>xT(t().treeData,r)})),_T="_spin_1ah4d_9",wT={spin:_T};function ie(){return jl(e=>e.labelConfig)}const TT=({size:e=16,color:t="currentColor"})=>{const r=ie();return l.jsx("svg",{className:wT.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"})})},Re=({variant:e="ghost",size:t="md",isLoading:r,disabled:n,onClick:s,children:o,className:a,type:i="button"})=>l.jsxs("button",{type:i,className:`sbx-btn-${e} ${t==="sm"?"sbx-btn-sm":""} ${a??""}`,onClick:s,disabled:r||n,"aria-busy":r?!0:void 0,children:[r?l.jsx(TT,{size:14}):null,o]}),Rh=({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 uu(e){var r,n;return(n=(r=(await Fe.get(`/action/framework/v1/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.framework}async function ET(e){var r,n;return((n=(r=(await Fe.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 Ia(e,t){const r=es({queryKey:["framework",e],queryFn:()=>uu(e),enabled:!!e,staleTime:3e5}),n=t==null?void 0:t[0],s=es({queryKey:["framework",n],queryFn:()=>uu(n),enabled:!!n,staleTime:300*1e3}),o=s.data?[s.data]:[];return{organisationFramework:r.data,targetFrameworks:o,isLoading:r.isLoading||s.isLoading}}function Fh(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 AT(e){var n,s,o,a;const t=(n=e==null?void 0:e.children)==null?void 0:n[0];if(!nt(t))return;const r=(a=(o=(s=t==null?void 0:t.children)==null?void 0:s[0])==null?void 0:o.metadata)==null?void 0:a.framework;return Array.isArray(r)?r[0]:r}function ur(){var o;const e=X(a=>a.editorConfig),t=X(a=>a.contentFramework),r=oe(a=>a.treeData),n=AT(r[0])??t??((o=e==null?void 0:e.context)==null?void 0:o.framework),{organisationFramework:s}=Ia(n);return Fh(s==null?void 0:s.categories)}function kT(e,t,r){var u,d,f,p;const n={scope:((t==null?void 0:t.terms)??[]).map(m=>m.name),source:"manual"};if(!t)return n;const s=(u=e==null?void 0:e.children)==null?void 0:u[0];if(!nt(s))return n;const o=(d=s==null?void 0:s.children)==null?void 0:d[0];if(!o)return n;const i=((f=r[o.id])==null?void 0:f[t.code])??((p=o.metadata)==null?void 0:p[t.code]);return{scope:Array.isArray(i)?i:i?[i]:[],source:"prior"}}function io(){const e=ur(),t=oe(n=>n.treeData),r=oe(n=>n.treeCache);return g.useMemo(()=>kT(t[0],e,r),[t,e,r])}const IT="_overlay_12iiv_1",LT="_modal_12iiv_15",DT="_modalHeader_12iiv_27",jT="_modalHeaderClose_12iiv_37",NT="_modalBody_12iiv_55",OT="_modalFooter_12iiv_62",PT="_checkRow_12iiv_69",RT="_formGroup_12iiv_112",FT="_textarea_12iiv_123",MT="_sliderGroup_12iiv_144",BT="_sliderValue_12iiv_156",qT="_sliderLabels_12iiv_164",$T="_sectionTitle_12iiv_172",Ee={overlay:IT,modal:LT,modalHeader:DT,modalHeaderClose:jT,modalBody:NT,modalFooter:OT,checkRow:PT,formGroup:RT,textarea:FT,sliderGroup:MT,sliderValue:BT,sliderLabels:qT,sectionTitle:$T},UT=({objectType:e,onConfirm:t,onCancel:r})=>{const n=ie(),s=oe(C=>C.treeData[0]),o=oe(C=>C.treeCache),a=ur(),{scope:i}=io(),[c,u]=g.useState(null),d=ql(s,a==null?void 0:a.code,i,o);g.useEffect(()=>{let C=!1;return u(null),CT(s).then(h=>{C||u(h)}).catch(h=>{console.error("[PublishChecklist] assessment-course re-check failed:",h),C||u([{code:"slotCourseCheckFailed",message:n.learningPath.assessmentCheckFailedToast}])}),()=>{C=!0}},[s]);const f=c===null,p=[...d,...c??[]],m=!f&&p.length===0;return l.jsx("div",{className:Ee.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"publish-modal-title",children:l.jsxs("div",{className:Ee.modal,children:[l.jsxs("div",{className:Ee.modalHeader,children:[l.jsxs("span",{id:"publish-modal-title",children:[n.publishChecklist.publishTitlePrefix," ",e]}),l.jsx("button",{className:Ee.modalHeaderClose,onClick:r,"aria-label":n.publishChecklist.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:Ee.modalBody,children:p.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:Ee.sectionTitle,children:n.learningPath.resolveBeforePublishing}),l.jsx("ul",{style:{margin:0,paddingLeft:18,fontSize:13,lineHeight:1.6},children:p.map((C,h)=>l.jsx("li",{children:C.message},`${C.code}-${C.nodeId??h}`))})]})}),l.jsxs("div",{className:Ee.modalFooter,children:[l.jsx(Re,{variant:"ghost",onClick:r,children:n.publishChecklist.noButton}),l.jsx(Re,{variant:"primary",onClick:t,disabled:!m,children:n.publishChecklist.yesButton})]})]})})},zT=({contentId:e,onConfirm:t,onCancel:r})=>{const n=ie(),s=X(p=>{var m,C;return(C=(m=p.editorConfig)==null?void 0:m.config)==null?void 0:C.objectType})||"Content",o=X(p=>p.editorProfile.key==="learningPath"),a=X(p=>p.publishChecklist)??[],[i,c]=g.useState({}),u=a.every(p=>i[p.code]),d=a.length===0||u,f=()=>{t()};return o?l.jsx(UT,{objectType:s,onConfirm:t,onCancel:r}):l.jsx("div",{className:Ee.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"publish-modal-title",children:l.jsxs("div",{className:Ee.modal,children:[l.jsxs("div",{className:Ee.modalHeader,children:[l.jsxs("span",{id:"publish-modal-title",children:[n.publishChecklist.publishTitlePrefix," ",s]}),l.jsx("button",{className:Ee.modalHeaderClose,onClick:r,"aria-label":n.publishChecklist.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:Ee.modalBody,children:a.length===0?l.jsxs("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:[n.publishChecklist.confirmPublishPrefix," ",s,"?"]}):l.jsxs(l.Fragment,{children:[l.jsx("p",{className:Ee.sectionTitle,children:n.publishChecklist.checklistInstructions}),a.map(p=>l.jsxs("label",{className:Ee.checkRow,children:[l.jsx("input",{type:"checkbox",checked:!!i[p.code],onChange:m=>c(C=>({...C,[p.code]:m.target.checked}))}),l.jsx("span",{children:p.label})]},p.code))]})}),l.jsxs("div",{className:Ee.modalFooter,children:[l.jsx(Re,{variant:"ghost",onClick:r,children:n.publishChecklist.noButton}),l.jsx(Re,{variant:"primary",onClick:f,disabled:!d,children:n.publishChecklist.yesButton})]})]})})},VT=({contentId:e,action:t,onConfirm:r,onCancel:n})=>{const s=ie(),[o,a]=g.useState(""),[i,c]=g.useState(7),u=t==="approve",d=u?s.qualityParamsModal.reviewQualityTitle:s.qualityParamsModal.rejectContentTitle,f=!u&&o.trim().length===0,p=()=>{u?r(o.trim(),i):r(o.trim())};return l.jsx("div",{className:Ee.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"quality-modal-title",children:l.jsxs("div",{className:Ee.modal,children:[l.jsxs("div",{className:Ee.modalHeader,children:[l.jsx("span",{id:"quality-modal-title",children:d}),l.jsx("button",{className:Ee.modalHeaderClose,onClick:n,"aria-label":s.qualityParamsModal.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:Ee.modalBody,children:u?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:Ee.formGroup,children:[l.jsx("label",{htmlFor:"quality-score",children:s.qualityParamsModal.qualityScoreLabel}),l.jsxs("div",{className:Ee.sliderGroup,children:[l.jsx("input",{id:"quality-score",type:"range",min:0,max:10,step:1,value:i,onChange:m=>c(Number(m.target.value)),"aria-valuemin":0,"aria-valuemax":10,"aria-valuenow":i}),l.jsx("span",{className:Ee.sliderValue,children:i})]}),l.jsxs("div",{className:Ee.sliderLabels,children:[l.jsx("span",{children:s.qualityParamsModal.scorePoorLabel}),l.jsx("span",{children:s.qualityParamsModal.scoreExcellentLabel})]})]}),l.jsxs("div",{className:Ee.formGroup,children:[l.jsxs("label",{htmlFor:"quality-comment",children:[s.qualityParamsModal.commentLabel," ",l.jsx("span",{style:{fontWeight:400,color:"var(--sbx-gray-400, #9CA3AF)"},children:s.qualityParamsModal.optionalLabel})]}),l.jsx("textarea",{id:"quality-comment",className:Ee.textarea,placeholder:s.qualityParamsModal.commentPlaceholder,value:o,onChange:m=>a(m.target.value),rows:4})]})]}):l.jsxs("div",{className:Ee.formGroup,children:[l.jsxs("label",{htmlFor:"reject-reason",children:[s.qualityParamsModal.rejectionReasonLabel," ",l.jsx("span",{style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),l.jsx("textarea",{id:"reject-reason",className:Ee.textarea,placeholder:s.qualityParamsModal.rejectReasonPlaceholder,value:o,onChange:m=>a(m.target.value),rows:5,required:!0,"aria-required":"true"}),o.trim().length===0&&l.jsx("p",{style:{fontSize:12,color:"var(--sbx-error, #DC2626)",marginTop:4},children:s.qualityParamsModal.rejectionRequiredMessage})]})}),l.jsxs("div",{className:Ee.modalFooter,children:[l.jsx(Re,{variant:"ghost",onClick:n,children:s.qualityParamsModal.cancelButton}),l.jsx(Re,{variant:u?"primary":"danger",onClick:p,disabled:f,children:u?s.qualityParamsModal.approveButton:s.qualityParamsModal.rejectButton})]})]})})},HT=({message:e,onConfirm:t,onCancel:r})=>{const n=ie();return Tr.createPortal(l.jsx("div",{className:Ee.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"confirm-dialog-title",children:l.jsxs("div",{className:Ee.modal,children:[l.jsxs("div",{className:Ee.modalHeader,children:[l.jsx("span",{id:"confirm-dialog-title",children:n.confirmDialog.title}),l.jsx("button",{className:Ee.modalHeaderClose,onClick:r,"aria-label":n.confirmDialog.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:Ee.modalBody,children:l.jsx("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:e})}),l.jsxs("div",{className:Ee.modalFooter,children:[l.jsx(Re,{variant:"ghost",onClick:r,children:n.confirmDialog.cancelButton}),l.jsx(Re,{variant:"danger",onClick:t,children:n.confirmDialog.confirmButton})]})]})}),document.body)},Mh=["email","firstName","lastName","identifier","organisations","rootOrgName","phone"];async function QT(e,t={}){var c,u,d,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 s=e.includes("@"),o=/^\d{10,}$/.test(e.trim()),a={filters:n,fields:Mh,offset:0,limit:t.limit??200};return s?n.email=e.trim():o?n.phone=e.trim():a.query=e,((f=(d=(u=(await Fe.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:u.result)==null?void 0:d.response)==null?void 0:f.content)??[]}async function WT(e){var r,n,s;return e.length?((s=(n=(r=(await Fe.post("/action/user/v1/search",{request:{filters:{userId:e},fields:Mh,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:s.content)??[]:[]}async function GT(e){var r,n;return((n=(r=(await Fe.get(`/action/user/v5/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.response)??{}}const KT="_container_r27rp_1",YT="_header_r27rp_13",ZT="_title_r27rp_22",XT="_closeBtn_r27rp_29",JT="_body_r27rp_45",e1="_label_r27rp_54",t1="_searchSection_r27rp_62",r1="_searchRow_r27rp_68",n1="_searchInput_r27rp_74",s1="_searchSpinner_r27rp_89",o1="_resultsList_r27rp_105",a1="_resultItem_r27rp_118",i1="_userInfo_r27rp_133",l1="_userName_r27rp_141",c1="_userEmail_r27rp_150",u1="_userOrg_r27rp_158",d1="_noResults_r27rp_167",f1="_collabSection_r27rp_174",h1="_sectionTitle_r27rp_179",p1="_badge_r27rp_189",m1="_emptyCollab_r27rp_203",g1="_collabList_r27rp_214",v1="_collabItem_r27rp_223",y1="_userAvatar_r27rp_237",b1="_error_r27rp_251",C1="_success_r27rp_257",S1="_footer_r27rp_263",Pe={container:KT,header:YT,title:ZT,closeBtn:XT,body:JT,label:e1,searchSection:t1,searchRow:r1,searchInput:n1,searchSpinner:s1,resultsList:o1,resultItem:a1,userInfo:i1,userName:l1,userEmail:c1,userOrg:u1,noResults:d1,collabSection:f1,sectionTitle:h1,badge:p1,emptyCollab:m1,collabList:g1,collabItem:v1,userAvatar:y1,error:b1,success:C1,footer:S1},x1=({contentId:e,onClose:t})=>{var N,F;const r=ie(),n=X(A=>A.editorConfig),s=(N=n==null?void 0:n.context)==null?void 0:N.channel,o=(F=n==null?void 0:n.config)==null?void 0:F.objectType,[a,i]=g.useState(""),[c,u]=g.useState([]),[d,f]=g.useState(!1),[p,m]=g.useState([]),[C,h]=g.useState(!1),[v,y]=g.useState(""),[b,S]=g.useState(!1),x=g.useRef(null);g.useEffect(()=>{let A=!1;return(async()=>{try{const P=await wh(e),R=(P==null?void 0:P.collaborators)??[];if(!R.length)return;const O=await WT(R);if(A)return;const U=R.map(re=>O.find(W=>W.identifier===re)??{identifier:re,firstName:re});m(U)}catch{}})(),()=>{A=!0}},[e]),g.useEffect(()=>{x.current&&clearTimeout(x.current);const A=a.trim();if(A.length<2){u([]);return}return x.current=setTimeout(async()=>{f(!0);try{const P=await QT(A,{rootOrgId:s,objectType:o}),R=new Set(p.map(O=>O.identifier));u(P.filter(O=>!R.has(O.identifier)))}catch{u([])}finally{f(!1)}},300),()=>{x.current&&clearTimeout(x.current)}},[a,p,s,o]);const w=g.useCallback(A=>{m(P=>P.find(R=>R.identifier===A.identifier)?P:[...P,A]),u(P=>P.filter(R=>R.identifier!==A.identifier)),S(!1)},[]),T=g.useCallback(A=>{m(P=>P.filter(R=>R.identifier!==A)),S(!1)},[]),D=g.useCallback(async()=>{h(!0),y(""),S(!1);try{await fT(e,p.map(A=>A.identifier)),S(!0)}catch{y(r.manageCollaborators.saveFailed)}finally{h(!1)}},[e,p,r.manageCollaborators.saveFailed]),k=A=>`${A.firstName}${A.lastName?` ${A.lastName}`:""}`;return l.jsxs("div",{className:Pe.container,children:[l.jsxs("div",{className:Pe.header,children:[l.jsx("h2",{className:Pe.title,children:r.manageCollaborators.title}),l.jsx("button",{className:Pe.closeBtn,onClick:t,"aria-label":r.manageCollaborators.closeAriaLabel,children:l.jsx(lr,{size:18})})]}),l.jsxs("div",{className:Pe.body,children:[l.jsxs("div",{className:Pe.searchSection,children:[l.jsx("label",{className:Pe.label,htmlFor:"collab-search",children:r.manageCollaborators.searchUsersLabel}),l.jsxs("div",{className:Pe.searchRow,children:[l.jsx("input",{id:"collab-search",type:"text",className:Pe.searchInput,placeholder:r.manageCollaborators.searchPlaceholder,value:a,onChange:A=>i(A.target.value)}),d&&l.jsx("span",{className:Pe.searchSpinner,"aria-label":r.manageCollaborators.searchingAriaLabel})]}),c.length>0&&l.jsx("ul",{className:Pe.resultsList,role:"listbox","aria-label":r.manageCollaborators.searchResultsAriaLabel,children:c.map(A=>{var P,R,O,U;return l.jsxs("li",{className:Pe.resultItem,role:"option","aria-selected":"false",children:[l.jsxs("div",{className:Pe.userInfo,children:[l.jsx("span",{className:Pe.userName,children:k(A)}),A.email&&l.jsx("span",{className:Pe.userEmail,children:A.email}),(((R=(P=A.organisations)==null?void 0:P[0])==null?void 0:R.orgName)??A.rootOrgName)&&l.jsx("span",{className:Pe.userOrg,children:((U=(O=A.organisations)==null?void 0:O[0])==null?void 0:U.orgName)??A.rootOrgName})]}),l.jsx(Re,{variant:"primary",size:"sm",onClick:()=>w(A),children:r.manageCollaborators.add})]},A.identifier)})}),a.trim().length>=2&&!d&&c.length===0&&l.jsx("p",{className:Pe.noResults,children:r.manageCollaborators.noUsersFound})]}),l.jsxs("div",{className:Pe.collabSection,children:[l.jsxs("h3",{className:Pe.sectionTitle,children:[r.manageCollaborators.currentCollaborators,p.length>0&&l.jsx("span",{className:Pe.badge,children:p.length})]}),p.length===0?l.jsx("p",{className:Pe.emptyCollab,children:r.manageCollaborators.noCollaboratorsYet}):l.jsx("ul",{className:Pe.collabList,children:p.map(A=>{var P,R,O,U;return l.jsxs("li",{className:Pe.collabItem,children:[l.jsx("div",{className:Pe.userAvatar,"aria-hidden":"true",children:k(A).charAt(0).toUpperCase()}),l.jsxs("div",{className:Pe.userInfo,children:[l.jsx("span",{className:Pe.userName,children:k(A)}),A.email&&l.jsx("span",{className:Pe.userEmail,children:A.email}),(((R=(P=A.organisations)==null?void 0:P[0])==null?void 0:R.orgName)??A.rootOrgName)&&l.jsx("span",{className:Pe.userOrg,children:((U=(O=A.organisations)==null?void 0:O[0])==null?void 0:U.orgName)??A.rootOrgName})]}),l.jsx(Re,{variant:"danger",size:"sm",onClick:()=>T(A.identifier),children:r.manageCollaborators.remove})]},A.identifier)})})]}),v&&l.jsx("p",{className:Pe.error,role:"alert",children:v}),b&&l.jsx("p",{className:Pe.success,role:"status",children:r.manageCollaborators.saveSuccess})]}),l.jsxs("div",{className:Pe.footer,children:[l.jsx(Re,{variant:"ghost",onClick:t,disabled:C,children:r.manageCollaborators.cancel}),l.jsx(Re,{variant:"primary",isLoading:C,onClick:D,children:r.manageCollaborators.save})]})]})};async function _1(e){return(await Fe.post("/api/dialcode/v1/read",{request:{dialcodes:[e]}})).data}async function w1(e,t){var s;const n=((s=(await Fe.post(`/action/dialcode/v1/reserve/${e}`,{request:{dialcodes:{count:t,qrCodeSpec:{errorCorrectionLevel:"H"}}}})).data)==null?void 0:s.result)??{};return{processId:n.processId??"",reservedDialcodes:n.reservedDialcodes??{}}}async function T1(e){var n;const r=((n=(await Fe.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 E1="_topbar_lk8lp_1",A1="_left_lk8lp_15",k1="_right_lk8lp_23",I1="_backBtn_lk8lp_30",L1="_title_lk8lp_49",D1="_profileBadge_lk8lp_61",j1="_statusChip_lk8lp_76",N1="_savedIndicator_lk8lp_88",O1="_unsaved_lk8lp_98",P1="_iconBtn_lk8lp_103",R1="_iconBtnLabel_lk8lp_130",F1="_qrDropdown_lk8lp_134",M1="_qrMenu_lk8lp_138",B1="_reviewBtns_lk8lp_173",q1="_sourcingBtns_lk8lp_182",$1="_modalOverlay_lk8lp_191",U1="_sbOverlay_lk8lp_201",z1="_sbModal_lk8lp_211",V1="_sbModalHeader_lk8lp_222",H1="_sbModalTitle_lk8lp_230",Q1="_sbModalClose_lk8lp_237",W1="_sbModalBody_lk8lp_250",G1="_sbLabel_lk8lp_257",K1="_sbTextarea_lk8lp_264",Y1="_sbError_lk8lp_281",Z1="_sbModalFooter_lk8lp_288",_e={topbar:E1,left:A1,right:k1,backBtn:I1,title:L1,profileBadge:D1,statusChip:j1,savedIndicator:N1,unsaved:O1,iconBtn:P1,iconBtnLabel:R1,qrDropdown:F1,qrMenu:M1,reviewBtns:B1,sourcingBtns:q1,modalOverlay:$1,sbOverlay:U1,sbModal:z1,sbModalHeader:V1,sbModalTitle:H1,sbModalClose:Q1,sbModalBody:W1,sbLabel:G1,sbTextarea:K1,sbError:Y1,sbModalFooter:Z1};function X1(e){return e?new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):""}function J1(e,t){return typeof e=="string"&&e.trim().length>0?e.trim():t}const e0=({titleText:e,labelText:t,placeholderText:r,submitLabel:n,submitVariant:s="primary",onConfirm:o,onCancel:a})=>{const i=ie(),[c,u]=g.useState(""),d=e.toLowerCase().replace(/\s+/g,"-");return l.jsx("div",{className:_e.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":`${d}-title`,children:l.jsxs("div",{className:_e.sbModal,children:[l.jsxs("div",{className:_e.sbModalHeader,children:[l.jsx("span",{id:`${d}-title`,className:_e.sbModalTitle,children:e}),l.jsx("button",{className:_e.sbModalClose,onClick:a,"aria-label":i.reviewCommentModal.closeAriaLabel,type:"button",children:"×"})]}),l.jsxs("div",{className:_e.sbModalBody,children:[l.jsxs("label",{className:_e.sbLabel,htmlFor:`${d}-comment`,children:[t," ",l.jsx("span",{"aria-hidden":"true",style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),l.jsx("textarea",{id:`${d}-comment`,className:_e.sbTextarea,placeholder:r,value:c,onChange:f=>u(f.target.value),rows:4,required:!0,"aria-required":"true"}),c.trim().length===0&&l.jsx("p",{className:_e.sbError,children:i.reviewCommentModal.fillCommentsError})]}),l.jsxs("div",{className:_e.sbModalFooter,children:[l.jsx(Re,{variant:"ghost",onClick:a,children:i.reviewCommentModal.cancelButton}),l.jsx(Re,{variant:s,onClick:()=>o(c.trim()),disabled:c.trim().length===0,children:n})]})]})})},t0=({onConfirm:e,onCancel:t})=>{const r=ie(),[n,s]=g.useState(!1),o=X(p=>p.editorProfile.key==="learningPath"),a=oe(p=>p.treeData[0]),i=oe(p=>p.treeCache),c=ur(),{scope:u}=io(),d=o?ql(a,c==null?void 0:c.code,u,i):[],f=d.length>0;return l.jsx("div",{className:_e.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":"review-confirm-title",children:l.jsxs("div",{className:_e.sbModal,children:[l.jsxs("div",{className:_e.sbModalHeader,children:[l.jsx("span",{id:"review-confirm-title",className:_e.sbModalTitle,children:r.confirmReviewModal.title}),l.jsx("button",{className:_e.sbModalClose,onClick:t,"aria-label":r.confirmReviewModal.closeAriaLabel,type:"button",children:"×"})]}),l.jsx("div",{className:_e.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:d.map((p,m)=>l.jsx("li",{children:p.message},`${p.code}-${p.nodeId??m}`))})]}):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:p=>s(p.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:_e.sbModalFooter,children:[l.jsx(Re,{variant:"ghost",onClick:t,children:r.confirmReviewModal.cancelButton}),!f&&l.jsx(Re,{variant:"primary",onClick:e,disabled:!n,children:r.confirmReviewModal.submitButton})]})]})})},r0=({onConfirm:e,onCancel:t})=>{const r=ie(),[n,s]=g.useState(""),o=parseInt(n,10),a=!isNaN(o)&&o>=2&&o<=250;return l.jsx("div",{className:_e.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":"genqr-title",children:l.jsxs("div",{className:_e.sbModal,children:[l.jsxs("div",{className:_e.sbModalHeader,children:[l.jsx("span",{id:"genqr-title",className:_e.sbModalTitle,children:r.generateQRModal.title}),l.jsx("button",{className:_e.sbModalClose,onClick:t,"aria-label":r.generateQRModal.closeAriaLabel,type:"button",children:"×"})]}),l.jsxs("div",{className:_e.sbModalBody,children:[l.jsxs("label",{className:_e.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:_e.sbTextarea,style:{resize:"none",height:"40px"},placeholder:r.generateQRModal.countPlaceholder,value:n,onChange:i=>s(i.target.value)}),n&&!a&&l.jsx("p",{className:_e.sbError,children:r.generateQRModal.countRangeError})]}),l.jsxs("div",{className:_e.sbModalFooter,children:[l.jsx(Re,{variant:"ghost",onClick:t,children:r.generateQRModal.cancelButton}),l.jsx(Re,{variant:"primary",onClick:()=>e(o),disabled:!a,children:r.generateQRModal.generateButton})]})]})})},n0=({editorMode:e,isSaving:t,isDirty:r,lastSaved:n,isFormValid:s=!0,onToolbarEvent:o})=>{var ae,Se;const a=ie(),c=oe(fe=>fe.treeData)[0],u=(c==null?void 0:c.name)??a.contextualEditor.untitledPlaceholder,d=J1(((ae=c==null?void 0:c.metadata)==null?void 0:ae.status)??(c==null?void 0:c.status),a.topbar.draftStatusFallback),f=X(fe=>{var ye,Ae,J,he;return((Ae=(ye=fe.editorConfig)==null?void 0:ye.context)==null?void 0:Ae.contentId)??((he=(J=fe.editorConfig)==null?void 0:J.context)==null?void 0:he.identifier)??""}),{activeModal:p,modalData:m,closeModal:C,openModal:h}=rt(),v=X(fe=>fe.buttonLoaders),y=X(fe=>fe.categoryMeta),b=X(fe=>fe.editorProfile),S=b.key==="learningPath",x=b.features.dialcodes&&(!y||y.schemaDefaults.generateDIALCodes!=="No"),[w,T]=g.useState(!1),[D,k]=g.useState(!1),[N,F]=g.useState(!1),A=g.useRef(null),[P,R]=g.useState(!1);g.useEffect(()=>{if(!N)return;const fe=ye=>{var Ae;(Ae=A.current)!=null&&Ae.contains(ye.target)||F(!1)};return document.addEventListener("mousedown",fe),()=>document.removeEventListener("mousedown",fe)},[N]);const[O,U]=g.useState(!1),[re,W]=g.useState(!1),{updateNode:pe}=oe(),ge=(Se=c==null?void 0:c.metadata)==null?void 0:Se.qrCodeProcessId,G=g.useCallback(async fe=>{if(f){R(!1),U(!0);try{const{processId:ye,reservedDialcodes:Ae}=await w1(f,fe);ye&&c&&pe(c.id,{qrCodeProcessId:ye,reservedDialcodes:Ae}),me.success(a.topbar.qrGenerationStartedToast)}catch{me.error(a.topbar.qrGenerationFailedToast)}finally{U(!1)}}},[f,c,pe,a]),le=g.useCallback(async()=>{if(!ge){me.error(a.topbar.qrCodesNotGeneratedToast);return}W(!0);try{const fe=await T1(ge);if(fe.status==="in-process"){me(a.topbar.qrGenerationInProgressToast,{icon:l.jsx(qn,{size:16})});return}const ye=fe.url;if(!ye){me.error(a.topbar.qrCodesNotReadyToast);return}const Ae=await fetch(ye).then(We=>We.blob()),J=await new Promise(We=>{const tt=new FileReader;tt.onloadend=()=>We(tt.result),tt.readAsDataURL(Ae)}),he=(c==null?void 0:c.metadata)??{},H=We=>Array.isArray(We)?We.join("_"):typeof We=="string"?We:"",be=[f,H(he.medium),H(he.gradeLevel),H(he.subject)].filter(Boolean),qe=new Date().toISOString().replace(/[:.]/g,"-"),et=`${be.join("_")}_${qe}.zip`,$e=document.createElement("a");$e.href=J,$e.download=et,$e.style.display="none",document.body.appendChild($e),$e.click(),document.body.removeChild($e),me.success(a.topbar.qrCodesDownloadedToast)}catch{me.error(a.topbar.qrCodesDownloadFailedToast)}finally{W(!1)}},[ge,c,f,a]),te=e==="edit",xe=e==="review",ve=e==="sourcingreview",q=e==="read",M=g.useCallback((fe,ye)=>{o({action:fe,data:ye})},[o]),$=g.useCallback(()=>{C(),M("publish")},[C,M]),se=g.useCallback((fe,ye)=>{const Ae=m==null?void 0:m.action;C(),Ae==="approve"?M("sourcingApprove",{comment:fe,score:ye}):M("reject",{comment:fe})},[C,M,m]);return l.jsxs(l.Fragment,{children:[l.jsxs("header",{className:_e.topbar,role:"banner",children:[l.jsxs("div",{className:_e.left,children:[l.jsx("button",{className:_e.backBtn,onClick:()=>M("back"),"aria-label":a.topbar.backAriaLabel,type:"button",children:l.jsx(Al,{size:18})}),l.jsx("h1",{className:_e.title,title:u,children:u}),S&&l.jsxs("span",{className:_e.profileBadge,children:[l.jsx(Rh,{size:13,"aria-hidden":"true"}),a.learningPath.profileBadgeLabel]}),l.jsx("span",{className:`sbx-chip ${_e.statusChip}`,"aria-label":`${a.topbar.statusAriaLabelPrefix} ${d}`,children:d})]}),l.jsxs("div",{className:_e.right,children:[t?l.jsx("span",{className:_e.savedIndicator,"aria-live":"polite",children:a.topbar.savingIndicator}):r&&te?l.jsx("span",{className:`${_e.savedIndicator} ${_e.unsaved}`,"aria-live":"polite",children:a.topbar.unsavedIndicator}):n?l.jsxs("span",{className:_e.savedIndicator,"aria-live":"polite",children:[l.jsx(Sn,{size:14,"aria-hidden":"true"}),a.topbar.savedIndicatorPrefix," ",X1(n)]}):null,!q&&!xe&&!ve&&d!=="Review"&&l.jsx("span",{title:s?void 0:a.topbar.fillRequiredFieldsTooltip,children:l.jsx(Re,{variant:"ghost",size:"sm",onClick:()=>M("saveCollection"),disabled:!s,children:a.topbar.saveAsDraftButton})}),te&&l.jsxs(l.Fragment,{children:[l.jsxs(Re,{variant:"primary",size:"sm",onClick:()=>k(!0),disabled:v.saveCollection,isLoading:v.saveCollection,children:[l.jsx(Vy,{size:14,"aria-hidden":"true"})," ",a.topbar.sendForReviewButton]}),b.features.collaborators&&l.jsx("button",{className:_e.iconBtn,onClick:()=>h("manageCollaborators"),"aria-label":a.topbar.collaboratorsLabel,title:a.topbar.collaboratorsLabel,type:"button",children:l.jsx(Zy,{size:16,"aria-hidden":"true"})}),x&&l.jsxs("div",{className:_e.qrDropdown,ref:A,children:[l.jsxs("button",{className:_e.iconBtn,onClick:()=>F(fe=>!fe),"aria-label":a.topbar.qrCodesLabel,title:a.topbar.qrCodesLabel,type:"button","aria-haspopup":"true","aria-expanded":N,children:[l.jsx(jc,{size:16,"aria-hidden":"true"}),l.jsx("span",{className:_e.iconBtnLabel,children:a.topbar.qrCodesLabel}),l.jsx(xn,{size:14,style:{marginLeft:2},"aria-hidden":"true"})]}),N&&l.jsxs("div",{className:_e.qrMenu,role:"menu",children:[l.jsxs("button",{role:"menuitem",type:"button",onClick:()=>{F(!1),R(!0)},disabled:O,children:[l.jsx(jc,{size:14}),O?a.topbar.generatingEllipsis:a.topbar.generateQrCodesMenuItem]}),l.jsxs("button",{role:"menuitem",type:"button",onClick:()=>{F(!1),le()},disabled:re||!ge,children:[l.jsx(Ly,{size:14}),re?a.topbar.downloadingEllipsis:a.topbar.downloadQrCodesMenuItem]})]})]})]}),xe&&l.jsxs("div",{className:_e.reviewBtns,children:[l.jsxs(Re,{variant:"primary",size:"sm",onClick:()=>h("publishChecklist"),disabled:v.publishCollection,isLoading:v.publishCollection,children:[l.jsx($f,{size:14,"aria-hidden":"true"})," ",a.topbar.publishButton]}),l.jsxs(Re,{variant:"primary",size:"sm",onClick:()=>T(!0),disabled:v.rejectCollection,isLoading:v.rejectCollection,children:[l.jsx(Nc,{size:14,"aria-hidden":"true"})," ",a.topbar.requestForChangesButton]})]}),ve&&l.jsxs("div",{className:_e.sourcingBtns,children:[l.jsxs(Re,{variant:"primary",size:"sm",onClick:()=>h("qualityParams",{action:"approve"}),children:[l.jsx(Qy,{size:14,"aria-hidden":"true"})," ",a.topbar.approveButton]}),l.jsxs(Re,{variant:"primary",size:"sm",onClick:()=>h("qualityParams",{action:"reject"}),children:[l.jsx(Nc,{size:14,"aria-hidden":"true"})," ",a.topbar.requestForChangesButton]})]})]})]}),p==="publishChecklist"&&l.jsx(zT,{contentId:f,onConfirm:$,onCancel:C}),p==="qualityParams"&&l.jsx(VT,{contentId:f,action:(m==null?void 0:m.action)??"reject",onConfirm:se,onCancel:C}),p==="manageCollaborators"&&l.jsx("div",{className:_e.modalOverlay,role:"dialog","aria-modal":"true",children:l.jsx(x1,{contentId:f,onClose:C})}),p==="confirmDelete"&&l.jsx(HT,{message:(m==null?void 0:m.message)??"",onConfirm:()=>{const fe=m==null?void 0:m.onConfirm;C(),fe==null||fe()},onCancel:C}),D&&l.jsx(t0,{onConfirm:()=>{k(!1),M("sendForReview")},onCancel:()=>k(!1)}),w&&l.jsx(e0,{titleText:a.topbar.requestChangesTitle,labelText:a.topbar.changesRequestedLabel,placeholderText:a.topbar.describeChangesPlaceholder,submitLabel:a.topbar.requestForChangesButton,submitVariant:"primary",onConfirm:fe=>{T(!1),M("reject",{comment:fe})},onCancel:()=>T(!1)}),P&&l.jsx(r0,{onConfirm:G,onCancel:()=>R(!1)})]})},s0=({onSave:e,onDiscard:t,onCancel:r,isSaving:n})=>{const s=ie();return Tr.createPortal(l.jsx("div",{className:Ee.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"unsaved-title",children:l.jsxs("div",{className:Ee.modal,children:[l.jsxs("div",{className:Ee.modalHeader,children:[l.jsx("span",{id:"unsaved-title",children:s.unsavedChangesModal.title}),l.jsx("button",{className:Ee.modalHeaderClose,onClick:r,"aria-label":s.unsavedChangesModal.closeAriaLabel,disabled:n,children:"×"})]}),l.jsx("div",{className:Ee.modalBody,children:l.jsx("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:s.unsavedChangesModal.bodyMessage})}),l.jsxs("div",{className:Ee.modalFooter,children:[l.jsx(Re,{variant:"ghost",onClick:r,disabled:n,children:s.unsavedChangesModal.cancelButton}),l.jsx(Re,{variant:"danger",onClick:t,disabled:n,children:s.unsavedChangesModal.discardButton}),l.jsx(Re,{variant:"primary",onClick:e,isLoading:n,disabled:n,children:s.unsavedChangesModal.saveButton})]})]})}),document.body)};var o0=Dl();const Bh=g.createContext(null);function Mt(){const e=g.useContext(Bh);if(e===null)throw new Error("No Tree Api Provided");return e}const qh=g.createContext(null);function a0(){const e=g.useContext(qh);if(e===null)throw new Error("Provide a NodesContext");return e}const $h=g.createContext(null);function i0(){const e=g.useContext($h);if(e===null)throw new Error("Provide a DnDContext");return e}const Uh=g.createContext(0);function zh(){g.useContext(Uh)}function Ro(e,t,r){return Math.max(Math.min(e,r),t)}function Vh(e){return e&&e.isLeaf}function Hh(e){return e&&e.isInternal&&!e.isOpen}function Qh(e){var t;return e&&e.isOpen&&!(!((t=e.children)===null||t===void 0)&&t.length)}const Wh=(e,t)=>{let r=e;for(;r;){if(r.id===t.id)return!0;r=r.parent}return!1},Gh=e=>{if(!e.parent)throw Error("Node does not have a parent");return e.parent.children.findIndex(t=>t.id===e.id)};function $l(e,t){if(!e)return null;if(e.id===t)return e;if(e.children)for(let r of e.children){const n=$l(r,t);if(n)return n}return null}function na(e,t){if(t(e),e.children)for(let r of e.children)na(r,t)}function Kh(e){const t=Zh(e);let r;for(let n=0;n<t.length;++n)if(t[n]===e){r=l0(t,n);break}r==null||r.focus()}function Yh(e){const t=Zh(e);let r;for(let n=0;n<t.length;++n)if(t[n]===e){r=c0(t,n);break}r==null||r.focus()}function l0(e,t){return t+1<e.length?e[t+1]:e[0]}function c0(e,t){return t-1>=0?e[t-1]:e[e.length-1]}function Zh(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 Es(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 u0(e,...t){if(e)return e(...t)}function Xh(e){return new Promise((t,r)=>{let n=0;function s(){n+=1,n===100&&r(),e()?t():setTimeout(s,10)}s()})}function Jh(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 ep(e){const t=e.focusedNode;return t?t.isOpen?t.id:t.parent&&!t.parent.isRoot?t.parent.id:null:null}const d0=Object.freeze(Object.defineProperty({__proto__:null,access:Es,bound:Ro,dfs:$l,focusNextElement:Kh,focusPrevElement:Yh,getInsertIndex:Jh,getInsertParentId:ep,identify:Fn,indexOf:Gh,isClosed:Hh,isDescendant:Wh,isItem:Vh,isOpenWithEmptyChildren:Qh,safeRun:u0,waitFor:Xh,walk:na},Symbol.toStringTag,{value:"Module"})),f0={display:"flex",alignItems:"center",zIndex:1},h0={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},p0={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},m0=g.memo(function({top:t,left:r,indent:n}){const s={position:"absolute",pointerEvents:"none",top:t-2+"px",left:r+"px",right:n+"px"};return l.jsxs("div",{style:Object.assign(Object.assign({},f0),s),children:[l.jsx("div",{style:Object.assign({},p0)}),l.jsx("div",{style:Object.assign({},h0)})]})});function g0({node:e,attrs:t,innerRef:r,children:n}){return l.jsx("div",Object.assign({},t,{ref:r,onFocus:s=>s.stopPropagation(),onClick:e.handleClick,children:n}))}function v0(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(b0,Object.assign({},e)):l.jsx(y0,Object.assign({},e))]})}function y0(e){return l.jsx(l.Fragment,{children:l.jsx("span",{children:e.node.data.name})})}function b0({node:e}){const t=g.useRef();return g.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 Us="__REACT_ARBORIST_INTERNAL_ROOT__";function du(e){var t;function r(o,a,i){const c=e.accessId(o),u=new zs({tree:e,data:o,level:a,parent:i,id:c,children:null,isDraggable:e.isDraggable(o),rowIndex:null}),d=e.accessChildren(o);return d&&(u.children=d.map(f=>r(f,a+1,u))),u}const n=new zs({tree:e,id:Us,data:{id:Us},level:-1,parent:null,children:null,isDraggable:!0,rowIndex:null}),s=(t=e.props.data)!==null&&t!==void 0?t:[];return n.children=s.map(o=>r(o,0,n)),n}class zs{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===Us}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 zs(Object.assign({},this))}edit(){return this.tree.edit(this)}}function Za(e){return{type:"EDIT",id:e}}function C0(e={id:null},t){return t.type==="EDIT"?Object.assign(Object.assign({},e),{id:t.id}):e}function An(e){return{type:"FOCUS",id:e}}function S0(){return{type:"TREE_BLUR"}}function x0(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 el={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 fu(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 _0(e={filtered:{},unfiltered:{}},t){return t.type.startsWith("VISIBILITY")?t.filtered?Object.assign(Object.assign({},e),{filtered:fu(e.filtered,t)}):Object.assign(Object.assign({},e),{unfiltered:fu(e.unfiltered,t)}):e}const ns=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}}},jr={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 w0(e=ns().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 ss={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 T0(e=ns().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 ns().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},e),{parentId:t.parentId,index:t.index});default:return e}}const E0={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},A0=e=>{if(!e)return{display:"none"};const{x:t,y:r}=e;return{transform:`translate(${t}px, ${r}px)`}},k0=e=>{if(!e)return{display:"none"};const{x:t,y:r}=e;return{transform:`translate(${t+10}px, ${r+10}px)`}};function tp({offset:e,mouse:t,id:r,dragIds:n,isDragging:s}){return l.jsxs(I0,{isDragging:s,children:[l.jsx(L0,{offset:e,children:l.jsx(j0,{id:r,dragIds:n})}),l.jsx(D0,{mouse:t,count:n.length})]})}const I0=g.memo(function(t){return t.isDragging?l.jsx("div",{style:E0,children:t.children}):null});function L0(e){return l.jsx("div",{className:"row preview",style:A0(e.offset),children:e.children})}function D0(e){const{count:t,mouse:r}=e;return t>1?l.jsx("div",{className:"selected-count",style:k0(r),children:t}):null}const j0=g.memo(function(t){const r=Mt(),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 tl(){return tl=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},tl.apply(null,arguments)}function hu(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rl(e,t){return rl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},rl(e,t)}function N0(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,rl(e,t)}var pu=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function O0(e,t){return!!(e===t||pu(e)&&pu(t))}function P0(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!O0(e[r],t[r]))return!1;return!0}function Xa(e,t){t===void 0&&(t=P0);var r,n=[],s,o=!1;function a(){for(var i=[],c=0;c<arguments.length;c++)i[c]=arguments[c];return o&&r===this&&t(i,n)||(s=e.apply(this,i),o=!0,r=this,n=i),s}return a}var R0=typeof performance=="object"&&typeof performance.now=="function",mu=R0?function(){return performance.now()}:function(){return Date.now()};function gu(e){cancelAnimationFrame(e.id)}function F0(e,t){var r=mu();function n(){mu()-r>=t?e.call(null):s.id=requestAnimationFrame(n)}var s={id:requestAnimationFrame(n)};return s}var Ja=-1;function vu(e){if(e===void 0&&(e=!1),Ja===-1||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),Ja=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Ja}var kn=null;function yu(e){if(e===void 0&&(e=!1),kn===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"),s=n.style;return s.width="100px",s.height="100px",t.appendChild(n),document.body.appendChild(t),t.scrollLeft>0?kn="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?kn="negative":kn="positive-ascending"),document.body.removeChild(t),kn}return kn}process.env.NODE_ENV;var M0=150,B0=function(t,r){return t},Fo=null,Mo=null;process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof window.WeakSet<"u"&&(Fo=new WeakSet,Mo=new WeakSet);function rp(e){var t,r=e.getItemOffset,n=e.getEstimatedTotalSize,s=e.getItemSize,o=e.getOffsetForIndexAndAlignment,a=e.getStartIndexForOffset,i=e.getStopIndexForStartIndex,c=e.initInstanceProps,u=e.shouldResetStyleCacheOnItemSizeChange,d=e.validateProps;return t=(function(f){N0(p,f);function p(C){var h;return h=f.call(this,C)||this,h._instanceProps=c(h.props,hu(h)),h._outerRef=void 0,h._resetIsScrollingTimeoutId=null,h.state={instance:hu(h),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof h.props.initialScrollOffset=="number"?h.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},h._callOnItemsRendered=void 0,h._callOnItemsRendered=Xa(function(v,y,b,S){return h.props.onItemsRendered({overscanStartIndex:v,overscanStopIndex:y,visibleStartIndex:b,visibleStopIndex:S})}),h._callOnScroll=void 0,h._callOnScroll=Xa(function(v,y,b){return h.props.onScroll({scrollDirection:v,scrollOffset:y,scrollUpdateWasRequested:b})}),h._getItemStyle=void 0,h._getItemStyle=function(v){var y=h.props,b=y.direction,S=y.itemSize,x=y.layout,w=h._getItemStyleCache(u&&S,u&&x,u&&b),T;if(w.hasOwnProperty(v))T=w[v];else{var D=r(h.props,v,h._instanceProps),k=s(h.props,v,h._instanceProps),N=b==="horizontal"||x==="horizontal",F=b==="rtl",A=N?D:0;w[v]=T={position:"absolute",left:F?void 0:A,right:F?A:void 0,top:N?0:D,height:N?"100%":k,width:N?k:"100%"}}return T},h._getItemStyleCache=void 0,h._getItemStyleCache=Xa(function(v,y,b){return{}}),h._onScrollHorizontal=function(v){var y=v.currentTarget,b=y.clientWidth,S=y.scrollLeft,x=y.scrollWidth;h.setState(function(w){if(w.scrollOffset===S)return null;var T=h.props.direction,D=S;if(T==="rtl")switch(yu()){case"negative":D=-S;break;case"positive-descending":D=x-b-S;break}return D=Math.max(0,Math.min(D,x-b)),{isScrolling:!0,scrollDirection:w.scrollOffset<D?"forward":"backward",scrollOffset:D,scrollUpdateWasRequested:!1}},h._resetIsScrollingDebounced)},h._onScrollVertical=function(v){var y=v.currentTarget,b=y.clientHeight,S=y.scrollHeight,x=y.scrollTop;h.setState(function(w){if(w.scrollOffset===x)return null;var T=Math.max(0,Math.min(x,S-b));return{isScrolling:!0,scrollDirection:w.scrollOffset<T?"forward":"backward",scrollOffset:T,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&&gu(h._resetIsScrollingTimeoutId),h._resetIsScrollingTimeoutId=F0(h._resetIsScrolling,M0)},h._resetIsScrolling=function(){h._resetIsScrollingTimeoutId=null,h.setState({isScrolling:!1},function(){h._getItemStyleCache(-1,null)})},h}p.getDerivedStateFromProps=function(h,v){return q0(h,v),d(h),null};var m=p.prototype;return m.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)},m.scrollToItem=function(h,v){v===void 0&&(v="auto");var y=this.props,b=y.itemCount,S=y.layout,x=this.state.scrollOffset;h=Math.max(0,Math.min(h,b-1));var w=0;if(this._outerRef){var T=this._outerRef;S==="vertical"?w=T.scrollWidth>T.clientWidth?vu():0:w=T.scrollHeight>T.clientHeight?vu():0}this.scrollTo(o(this.props,h,v,x,this._instanceProps,w))},m.componentDidMount=function(){var h=this.props,v=h.direction,y=h.initialScrollOffset,b=h.layout;if(typeof y=="number"&&this._outerRef!=null){var S=this._outerRef;v==="horizontal"||b==="horizontal"?S.scrollLeft=y:S.scrollTop=y}this._callPropsCallbacks()},m.componentDidUpdate=function(){var h=this.props,v=h.direction,y=h.layout,b=this.state,S=b.scrollOffset,x=b.scrollUpdateWasRequested;if(x&&this._outerRef!=null){var w=this._outerRef;if(v==="horizontal"||y==="horizontal")if(v==="rtl")switch(yu()){case"negative":w.scrollLeft=-S;break;case"positive-ascending":w.scrollLeft=S;break;default:var T=w.clientWidth,D=w.scrollWidth;w.scrollLeft=D-T-S;break}else w.scrollLeft=S;else w.scrollTop=S}this._callPropsCallbacks()},m.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&gu(this._resetIsScrollingTimeoutId)},m.render=function(){var h=this.props,v=h.children,y=h.className,b=h.direction,S=h.height,x=h.innerRef,w=h.innerElementType,T=h.innerTagName,D=h.itemCount,k=h.itemData,N=h.itemKey,F=N===void 0?B0:N,A=h.layout,P=h.outerElementType,R=h.outerTagName,O=h.style,U=h.useIsScrolling,re=h.width,W=this.state.isScrolling,pe=b==="horizontal"||A==="horizontal",ge=pe?this._onScrollHorizontal:this._onScrollVertical,G=this._getRangeToRender(),le=G[0],te=G[1],xe=[];if(D>0)for(var ve=le;ve<=te;ve++)xe.push(g.createElement(v,{data:k,key:F(ve,k),index:ve,isScrolling:U?W:void 0,style:this._getItemStyle(ve)}));var q=n(this.props,this._instanceProps);return g.createElement(P||R||"div",{className:y,onScroll:ge,ref:this._outerRefSetter,style:tl({position:"relative",height:S,width:re,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:b},O)},g.createElement(w||T||"div",{children:xe,ref:x,style:{height:pe?"100%":q,pointerEvents:W?"none":void 0,width:pe?q:"100%"}}))},m._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var h=this.props.itemCount;if(h>0){var v=this._getRangeToRender(),y=v[0],b=v[1],S=v[2],x=v[3];this._callOnItemsRendered(y,b,S,x)}}if(typeof this.props.onScroll=="function"){var w=this.state,T=w.scrollDirection,D=w.scrollOffset,k=w.scrollUpdateWasRequested;this._callOnScroll(T,D,k)}},m._getRangeToRender=function(){var h=this.props,v=h.itemCount,y=h.overscanCount,b=this.state,S=b.isScrolling,x=b.scrollDirection,w=b.scrollOffset;if(v===0)return[0,0,0,0];var T=a(this.props,w,this._instanceProps),D=i(this.props,T,w,this._instanceProps),k=!S||x==="backward"?Math.max(1,y):1,N=!S||x==="forward"?Math.max(1,y):1;return[Math.max(0,T-k),Math.max(0,Math.min(v-1,D+N)),T,D]},p})(g.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var q0=function(t,r){var n=t.children,s=t.direction,o=t.height,a=t.layout,i=t.innerTagName,c=t.outerTagName,u=t.width,d=r.instance;if(process.env.NODE_ENV!=="production"){(i!=null||c!=null)&&Mo&&!Mo.has(d)&&(Mo.add(d),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var f=s==="horizontal"||a==="horizontal";switch(s){case"horizontal":case"vertical":Fo&&!Fo.has(d)&&(Fo.add(d),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". '+('"'+s+'" 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 u!="number")throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. '+('"'+(u===null?"null":typeof u)+'" was specified.'));if(!f&&typeof o!="number")throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. '+('"'+(o===null?"null":typeof o)+'" was specified.'))}},$0=50,Mn=function(t,r,n){var s=t,o=s.itemSize,a=n.itemMetadataMap,i=n.lastMeasuredIndex;if(r>i){var c=0;if(i>=0){var u=a[i];c=u.offset+u.size}for(var d=i+1;d<=r;d++){var f=o(d);a[d]={offset:c,size:f},c+=f}n.lastMeasuredIndex=r}return a[r]},U0=function(t,r,n){var s=r.itemMetadataMap,o=r.lastMeasuredIndex,a=o>0?s[o].offset:0;return a>=n?np(t,r,o,0,n):z0(t,r,Math.max(0,o),n)},np=function(t,r,n,s,o){for(;s<=n;){var a=s+Math.floor((n-s)/2),i=Mn(t,a,r).offset;if(i===o)return a;i<o?s=a+1:i>o&&(n=a-1)}return s>0?s-1:0},z0=function(t,r,n,s){for(var o=t.itemCount,a=1;n<o&&Mn(t,n,r).offset<s;)n+=a,a*=2;return np(t,r,Math.min(n,o-1),Math.floor(n/2),s)},bu=function(t,r){var n=t.itemCount,s=r.itemMetadataMap,o=r.estimatedItemSize,a=r.lastMeasuredIndex,i=0;if(a>=n&&(a=n-1),a>=0){var c=s[a];i=c.offset+c.size}var u=n-a-1,d=u*o;return i+d},V0=rp({getItemOffset:function(t,r,n){return Mn(t,r,n).offset},getItemSize:function(t,r,n){return n.itemMetadataMap[r].size},getEstimatedTotalSize:bu,getOffsetForIndexAndAlignment:function(t,r,n,s,o,a){var i=t.direction,c=t.height,u=t.layout,d=t.width,f=i==="horizontal"||u==="horizontal",p=f?d:c,m=Mn(t,r,o),C=bu(t,o),h=Math.max(0,Math.min(C-p,m.offset)),v=Math.max(0,m.offset-p+m.size+a);switch(n==="smart"&&(s>=v-p&&s<=h+p?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 s>=v&&s<=h?s:s<v?v:h}},getStartIndexForOffset:function(t,r,n){return U0(t,n,r)},getStopIndexForStartIndex:function(t,r,n,s){for(var o=t.direction,a=t.height,i=t.itemCount,c=t.layout,u=t.width,d=o==="horizontal"||c==="horizontal",f=d?u:a,p=Mn(t,r,s),m=n+f,C=p.offset+p.size,h=r;h<i-1&&C<m;)h++,C+=Mn(t,h,s).size;return h},initInstanceProps:function(t,r){var n=t,s=n.estimatedItemSize,o={itemMetadataMap:{},estimatedItemSize:s||$0,lastMeasuredIndex:-1};return r.resetAfterIndex=function(a,i){i===void 0&&(i=!0),o.lastMeasuredIndex=Math.min(o.lastMeasuredIndex,a-1),r._getItemStyleCache(-1),i&&r.forceUpdate()},o},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.'))}}),H0=rp({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,s,o,a){var i=t.direction,c=t.height,u=t.itemCount,d=t.itemSize,f=t.layout,p=t.width,m=i==="horizontal"||f==="horizontal",C=m?p:c,h=Math.max(0,u*d-C),v=Math.min(h,r*d),y=Math.max(0,r*d-C+d+a);switch(n==="smart"&&(s>=y-C&&s<=v+C?n="auto":n="center"),n){case"start":return v;case"end":return y;case"center":{var b=Math.round(y+(v-y)/2);return b<Math.ceil(C/2)?0:b>h+Math.floor(C/2)?h:b}case"auto":default:return s>=y&&s<=v?s:s<y?y:v}},getStartIndexForOffset:function(t,r){var n=t.itemCount,s=t.itemSize;return Math.max(0,Math.min(n-1,Math.floor(r/s)))},getStopIndexForStartIndex:function(t,r,n){var s=t.direction,o=t.height,a=t.itemCount,i=t.itemSize,c=t.layout,u=t.width,d=s==="horizontal"||c==="horizontal",f=r*i,p=d?u:o,m=Math.ceil((p+n-f)/i);return Math.max(0,Math.min(a-1,r+m-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 Q0(){var e,t;const r=Mt(),s=i0().cursor;if(!s||s.type!=="line")return null;const o=r.indent,a=r.rowTopPosition(s.index)+((t=(e=r.props.padding)!==null&&e!==void 0?e:r.props.paddingTop)!==null&&t!==void 0?t:0),i=o*s.level,c=r.renderCursor;return l.jsx(c,{top:a,left:i,indent:o})}var W0=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 s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r};const G0=g.forwardRef(function(t,r){const{children:n}=t,s=W0(t,["children"]),o=Mt();return l.jsxs("div",Object.assign({ref:r},s,{onClick:a=>{a.currentTarget===a.target&&o.deselectAll()},children:[l.jsx(K0,{}),n]}))}),K0=()=>{const e=Mt();return l.jsx("div",{style:{height:e.rowTopPosition(e.visibleNodes.length),width:"100%",position:"absolute",left:"0",right:"0"},children:l.jsx(Q0,{})})};var Y0=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 s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r};const Z0=g.forwardRef(function(t,r){var n,s,o,a,{style:i}=t,c=Y0(t,["style"]);const u=Mt(),d=(s=(n=u.props.padding)!==null&&n!==void 0?n:u.props.paddingTop)!==null&&s!==void 0?s:0,f=(a=(o=u.props.padding)!==null&&o!==void 0?o:u.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)+d+f}px`})},c))});var sp=g.createContext({dragDropManager:void 0}),Jt;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Jt||(Jt={}));function we(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),s=2;s<r;s++)n[s-2]=arguments[s];if(process.env.NODE_ENV!=="production"&&t===void 0)throw new Error("invariant requires an error message argument");if(!e){var o;if(t===void 0)o=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=0;o=new Error(t.replace(/%s/g,function(){return n[a++]})),o.name="Invariant Violation"}throw o.framesToPop=1,o}}var Ul="dnd-core/INIT_COORDS",La="dnd-core/BEGIN_DRAG",zl="dnd-core/PUBLISH_DRAG_SOURCE",Da="dnd-core/HOVER",ja="dnd-core/DROP",Na="dnd-core/END_DRAG";function Cu(e,t){return{type:Ul,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}function Bo(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Bo=function(r){return typeof r}:Bo=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Bo(e)}function X0(e,t,r){return t.split(".").reduce(function(n,s){return n&&n[s]?n[s]:r||null},e)}function J0(e,t){return e.filter(function(r){return r!==t})}function op(e){return Bo(e)==="object"}function eE(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 s=[];return r.forEach(function(o,a){o===1&&s.push(a)}),s}function tE(e,t){return e.filter(function(r){return t.indexOf(r)>-1})}var rE={type:Ul,payload:{clientOffset:null,sourceClientOffset:null}};function nE(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},s=n.publishSource,o=s===void 0?!0:s,a=n.clientOffset,i=n.getSourceClientOffset,c=e.getMonitor(),u=e.getRegistry();e.dispatch(Cu(a)),sE(r,c,u);var d=iE(r,c);if(d===null){e.dispatch(rE);return}var f=null;if(a){if(!i)throw new Error("getSourceClientOffset must be defined");oE(i),f=i(d)}e.dispatch(Cu(a,f));var p=u.getSource(d),m=p.beginDrag(c,d);if(m!=null){aE(m),u.pinSource(d);var C=u.getSourceType(d);return{type:La,payload:{itemType:C,item:m,sourceId:d,clientOffset:a||null,sourceClientOffset:f||null,isSourcePublic:!!o}}}}}function sE(e,t,r){we(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(n){we(r.getSource(n),"Expected sourceIds to be registered.")})}function oE(e){we(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function aE(e){we(op(e),"Item must be an object.")}function iE(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 lE(e){return function(){var r=e.getMonitor();if(r.isDragging())return{type:zl}}}function nl(e,t){return t===null?e===null:Array.isArray(e)?e.some(function(r){return r===t}):e===t}function cE(e){return function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=n.clientOffset;uE(r);var o=r.slice(0),a=e.getMonitor(),i=e.getRegistry();dE(o,a,i);var c=a.getItemType();return fE(o,i,c),hE(o,a,i),{type:Da,payload:{targetIds:o,clientOffset:s||null}}}}function uE(e){we(Array.isArray(e),"Expected targetIds to be an array.")}function dE(e,t,r){we(t.isDragging(),"Cannot call hover while not dragging."),we(!t.didDrop(),"Cannot call hover after drop.");for(var n=0;n<e.length;n++){var s=e[n];we(e.lastIndexOf(s)===n,"Expected targetIds to be unique in the passed array.");var o=r.getTarget(s);we(o,"Expected targetIds to be registered.")}}function fE(e,t,r){for(var n=e.length-1;n>=0;n--){var s=e[n],o=t.getTargetType(s);nl(o,r)||e.splice(n,1)}}function hE(e,t,r){e.forEach(function(n){var s=r.getTarget(n);s.hover(t,n)})}function Su(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function xu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Su(Object(r),!0).forEach(function(n){pE(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Su(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function pE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mE(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.getMonitor(),s=e.getRegistry();gE(n);var o=bE(n);o.forEach(function(a,i){var c=vE(a,i,s,n),u={type:ja,payload:{dropResult:xu(xu({},r),c)}};e.dispatch(u)})}}function gE(e){we(e.isDragging(),"Cannot call drop while not dragging."),we(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function vE(e,t,r,n){var s=r.getTarget(e),o=s?s.drop(n,e):void 0;return yE(o),typeof o>"u"&&(o=t===0?{}:n.getDropResult()),o}function yE(e){we(typeof e>"u"||op(e),"Drop result must either be an object or undefined.")}function bE(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function CE(e){return function(){var r=e.getMonitor(),n=e.getRegistry();SE(r);var s=r.getSourceId();if(s!=null){var o=n.getSource(s,!0);o.endDrag(r,s),n.unpinSource()}return{type:Na}}}function SE(e){we(e.isDragging(),"Cannot call endDrag while not dragging.")}function xE(e){return{beginDrag:nE(e),publishDragSource:lE(e),hover:cE(e),drop:mE(e),endDrag:CE(e)}}function _E(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wE(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 TE(e,t,r){return t&&wE(e.prototype,t),e}function ys(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var EE=(function(){function e(t,r){var n=this;_E(this,e),ys(this,"store",void 0),ys(this,"monitor",void 0),ys(this,"backend",void 0),ys(this,"isSetUp",!1),ys(this,"handleRefCountChange",function(){var s=n.store.getState().refCount>0;n.backend&&(s&&!n.isSetUp?(n.backend.setup(),n.isSetUp=!0):!s&&n.isSetUp&&(n.backend.teardown(),n.isSetUp=!1))}),this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}return TE(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 s(a){return function(){for(var i=arguments.length,c=new Array(i),u=0;u<i;u++)c[u]=arguments[u];var d=a.apply(r,c);typeof d<"u"&&n(d)}}var o=xE(this);return Object.keys(o).reduce(function(a,i){var c=o[i];return a[i]=s(c),a},{})}},{key:"dispatch",value:function(r){this.store.dispatch(r)}}]),e})();function Wt(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 _u=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),wu=function(){return Math.random().toString(36).substring(7).split("").join(".")},Tu={INIT:"@@redux/INIT"+wu(),REPLACE:"@@redux/REPLACE"+wu()};function AE(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 kE(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(DE(e))return"date";if(LE(e))return"error";var r=IE(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 IE(e){return typeof e.constructor=="function"?e.constructor.name:null}function LE(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function DE(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function In(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=kE(e)),t}function ap(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"?Wt(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"?Wt(1):"Expected the enhancer to be a function. Instead, received: '"+In(r)+"'");return r(ap)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?Wt(2):"Expected the root reducer to be a function. Instead, received: '"+In(e)+"'");var s=e,o=t,a=[],i=a,c=!1;function u(){i===a&&(i=a.slice())}function d(){if(c)throw new Error(process.env.NODE_ENV==="production"?Wt(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(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?Wt(4):"Expected the listener to be a function. Instead, received: '"+In(h)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?Wt(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 u(),i.push(h),function(){if(v){if(c)throw new Error(process.env.NODE_ENV==="production"?Wt(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,u();var b=i.indexOf(h);i.splice(b,1),a=null}}}function p(h){if(!AE(h))throw new Error(process.env.NODE_ENV==="production"?Wt(7):"Actions must be plain objects. Instead, the actual type was: '"+In(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"?Wt(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"?Wt(9):"Reducers may not dispatch actions.");try{c=!0,o=s(o,h)}finally{c=!1}for(var v=a=i,y=0;y<v.length;y++){var b=v[y];b()}return h}function m(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?Wt(10):"Expected the nextReducer to be a function. Instead, received: '"+In(h));s=h,p({type:Tu.REPLACE})}function C(){var h,v=f;return h={subscribe:function(b){if(typeof b!="object"||b===null)throw new Error(process.env.NODE_ENV==="production"?Wt(11):"Expected the observer to be an object. Instead, received: '"+In(b)+"'");function S(){b.next&&b.next(d())}S();var x=v(S);return{unsubscribe:x}}},h[_u]=function(){return this},h}return p({type:Tu.INIT}),n={dispatch:p,subscribe:f,getState:d,replaceReducer:m},n[_u]=C,n}var jE=function(t,r){return t===r};function NE(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function OE(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:jE;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 Eu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Au(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Eu(Object(r),!0).forEach(function(n){PE(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Eu(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function PE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ku={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function RE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ku,t=arguments.length>1?arguments[1]:void 0,r=t.payload;switch(t.type){case Ul:case La:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case Da:return NE(e.clientOffset,r.clientOffset)?e:Au(Au({},e),{},{clientOffset:r.clientOffset});case Na:case ja:return ku;default:return e}}var Vl="dnd-core/ADD_SOURCE",Hl="dnd-core/ADD_TARGET",Ql="dnd-core/REMOVE_SOURCE",Oa="dnd-core/REMOVE_TARGET";function FE(e){return{type:Vl,payload:{sourceId:e}}}function ME(e){return{type:Hl,payload:{targetId:e}}}function BE(e){return{type:Ql,payload:{sourceId:e}}}function qE(e){return{type:Oa,payload:{targetId:e}}}function Iu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Gt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Iu(Object(r),!0).forEach(function(n){$E(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Iu(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 UE={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function zE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:UE,t=arguments.length>1?arguments[1]:void 0,r=t.payload;switch(t.type){case La:return Gt(Gt({},e),{},{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case zl:return Gt(Gt({},e),{},{isSourcePublic:!0});case Da:return Gt(Gt({},e),{},{targetIds:r.targetIds});case Oa:return e.targetIds.indexOf(r.targetId)===-1?e:Gt(Gt({},e),{},{targetIds:J0(e.targetIds,r.targetId)});case ja:return Gt(Gt({},e),{},{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case Na:return Gt(Gt({},e),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function VE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Vl:case Hl:return e+1;case Ql:case Oa:return e-1;default:return e}}var sa=[],Wl=[];sa.__IS_NONE__=!0;Wl.__IS_ALL__=!0;function HE(e,t){if(e===sa)return!1;if(e===Wl||typeof t>"u")return!0;var r=tE(t,e);return r.length>0}function QE(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case Da:break;case Vl:case Hl:case Oa:case Ql:return sa;case La:case zl:case Na:case ja:default:return Wl}var t=e.payload,r=t.targetIds,n=r===void 0?[]:r,s=t.prevTargetIds,o=s===void 0?[]:s,a=eE(n,o),i=a.length>0||!OE(n,o);if(!i)return sa;var c=o[o.length-1],u=n[n.length-1];return c!==u&&(c&&a.push(c),u&&a.push(u)),a}function WE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e+1}function Lu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Du(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Lu(Object(r),!0).forEach(function(n){GE(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lu(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function GE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function KE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:QE(e.dirtyHandlerIds,{type:t.type,payload:Du(Du({},t.payload),{},{prevTargetIds:X0(e,"dragOperation.targetIds",[])})}),dragOffset:RE(e.dragOffset,t),refCount:VE(e.refCount,t),dragOperation:zE(e.dragOperation,t),stateId:WE(e.stateId)}}function YE(e,t){return{x:e.x+t.x,y:e.y+t.y}}function ip(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ZE(e){var t=e.clientOffset,r=e.initialClientOffset,n=e.initialSourceClientOffset;return!t||!r||!n?null:ip(YE(t,n),r)}function XE(e){var t=e.clientOffset,r=e.initialClientOffset;return!t||!r?null:ip(t,r)}function JE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function eA(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 tA(e,t,r){return t&&eA(e.prototype,t),e}function ju(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var rA=(function(){function e(t,r){JE(this,e),ju(this,"store",void 0),ju(this,"registry",void 0),this.store=t,this.registry=r}return tA(e,[{key:"subscribeToStateChange",value:function(r){var n=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0},o=s.handlerIds;we(typeof r=="function","listener must be a function."),we(typeof o>"u"||Array.isArray(o),"handlerIds, when specified, must be an array of strings.");var a=this.store.getState().stateId,i=function(){var u=n.store.getState(),d=u.stateId;try{var f=d===a||d===a+1&&!HE(u.dirtyHandlerIds,o);f||r()}finally{a=d}};return this.store.subscribe(i)}},{key:"subscribeToOffsetChange",value:function(r){var n=this;we(typeof r=="function","listener must be a function.");var s=this.store.getState().dragOffset,o=function(){var i=n.store.getState().dragOffset;i!==s&&(s=i,r())};return this.store.subscribe(o)}},{key:"canDragSource",value:function(r){if(!r)return!1;var n=this.registry.getSource(r);return we(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(we(n,"Expected to find a valid target. targetId=".concat(r)),!this.isDragging()||this.didDrop())return!1;var s=this.registry.getTargetType(r),o=this.getItemType();return nl(s,o)&&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(we(n,"Expected to find a valid source. sourceId=".concat(r)),!this.isDragging()||!this.isSourcePublic())return!1;var s=this.registry.getSourceType(r),o=this.getItemType();return s!==o?!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 s=n.shallow;if(!this.isDragging())return!1;var o=this.registry.getTargetType(r),a=this.getItemType();if(a&&!nl(o,a))return!1;var i=this.getTargetIds();if(!i.length)return!1;var c=i.indexOf(r);return s?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 ZE(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return XE(this.store.getState().dragOffset)}}]),e})(),nA=0;function sA(){return nA++}function qo(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?qo=function(r){return typeof r}:qo=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},qo(e)}function oA(e){we(typeof e.canDrag=="function","Expected canDrag to be a function."),we(typeof e.beginDrag=="function","Expected beginDrag to be a function."),we(typeof e.endDrag=="function","Expected endDrag to be a function.")}function aA(e){we(typeof e.canDrop=="function","Expected canDrop to be a function."),we(typeof e.hover=="function","Expected hover to be a function."),we(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}we(typeof e=="string"||qo(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 Nu=typeof global<"u"?global:self,lp=Nu.MutationObserver||Nu.WebKitMutationObserver;function cp(e){return function(){const r=setTimeout(s,0),n=setInterval(s,50);function s(){clearTimeout(r),clearInterval(n),e()}}}function iA(e){let t=1;const r=new lp(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const lA=typeof lp=="function"?iA:cp;class cA{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,s=t.length-this.index;n<s;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=lA(this.flush),this.requestErrorThrow=cp(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class uA{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 dA{create(t){const r=this.freeTasks,n=r.length?r.pop():new uA(this.onError,s=>r[r.length]=s);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}const up=new cA,fA=new dA(up.registerPendingError);function hA(e){up.enqueueTask(fA.create(e))}function pA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mA(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 gA(e,t,r){return t&&mA(e.prototype,t),e}function Ln(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vA(e,t){return SA(e)||CA(e,t)||bA(e,t)||yA()}function yA(){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 bA(e,t){if(e){if(typeof e=="string")return Ou(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 Ou(e,t)}}function Ou(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 CA(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,o=!1,a,i;try{for(r=r.call(e);!(s=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));s=!0);}catch(c){o=!0,i=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(o)throw i}}return n}}function SA(e){if(Array.isArray(e))return e}function xA(e){var t=sA().toString();switch(e){case Jt.SOURCE:return"S".concat(t);case Jt.TARGET:return"T".concat(t);default:throw new Error("Unknown Handler Role: ".concat(e))}}function Pu(e){switch(e[0]){case"S":return Jt.SOURCE;case"T":return Jt.TARGET;default:we(!1,"Cannot parse handler ID: ".concat(e))}}function Ru(e,t){var r=e.entries(),n=!1;do{var s=r.next(),o=s.done,a=vA(s.value,2),i=a[1];if(i===t)return!0;n=!!o}while(!n);return!1}var _A=(function(){function e(t){pA(this,e),Ln(this,"types",new Map),Ln(this,"dragSources",new Map),Ln(this,"dropTargets",new Map),Ln(this,"pinnedSourceId",null),Ln(this,"pinnedSource",null),Ln(this,"store",void 0),this.store=t}return gA(e,[{key:"addSource",value:function(r,n){sl(r),oA(n);var s=this.addHandler(Jt.SOURCE,r,n);return this.store.dispatch(FE(s)),s}},{key:"addTarget",value:function(r,n){sl(r,!0),aA(n);var s=this.addHandler(Jt.TARGET,r,n);return this.store.dispatch(ME(s)),s}},{key:"containsHandler",value:function(r){return Ru(this.dragSources,r)||Ru(this.dropTargets,r)}},{key:"getSource",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;we(this.isSourceId(r),"Expected a valid source ID.");var s=n&&r===this.pinnedSourceId,o=s?this.pinnedSource:this.dragSources.get(r);return o}},{key:"getTarget",value:function(r){return we(this.isTargetId(r),"Expected a valid target ID."),this.dropTargets.get(r)}},{key:"getSourceType",value:function(r){return we(this.isSourceId(r),"Expected a valid source ID."),this.types.get(r)}},{key:"getTargetType",value:function(r){return we(this.isTargetId(r),"Expected a valid target ID."),this.types.get(r)}},{key:"isSourceId",value:function(r){var n=Pu(r);return n===Jt.SOURCE}},{key:"isTargetId",value:function(r){var n=Pu(r);return n===Jt.TARGET}},{key:"removeSource",value:function(r){var n=this;we(this.getSource(r),"Expected an existing source."),this.store.dispatch(BE(r)),hA(function(){n.dragSources.delete(r),n.types.delete(r)})}},{key:"removeTarget",value:function(r){we(this.getTarget(r),"Expected an existing target."),this.store.dispatch(qE(r)),this.dropTargets.delete(r),this.types.delete(r)}},{key:"pinSource",value:function(r){var n=this.getSource(r);we(n,"Expected an existing source."),this.pinnedSourceId=r,this.pinnedSource=n}},{key:"unpinSource",value:function(){we(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(r,n,s){var o=xA(r);return this.types.set(o,n),r===Jt.SOURCE?this.dragSources.set(o,s):r===Jt.TARGET&&this.dropTargets.set(o,s),o}}]),e})();function wA(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,s=TA(n),o=new rA(s,new _A(s)),a=new EE(s,o),i=e(a,t,r);return a.receiveBackend(i),a}function TA(e){var t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return ap(KE,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}var EA=["children"];function AA(e,t){return DA(e)||LA(e,t)||IA(e,t)||kA()}function kA(){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 IA(e,t){if(e){if(typeof e=="string")return Fu(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 Fu(e,t)}}function Fu(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 LA(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,o=!1,a,i;try{for(r=r.call(e);!(s=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));s=!0);}catch(c){o=!0,i=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(o)throw i}}return n}}function DA(e){if(Array.isArray(e))return e}function jA(e,t){if(e==null)return{};var r=NA(e,t),n,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)n=o[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function NA(e,t){if(e==null)return{};var r={},n=Object.keys(e),s,o;for(o=0;o<n.length;o++)s=n[o],!(t.indexOf(s)>=0)&&(r[s]=e[s]);return r}var Mu=0,$o=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),OA=g.memo(function(t){var r=t.children,n=jA(t,EA),s=PA(n),o=AA(s,2),a=o[0],i=o[1];return g.useEffect(function(){if(i){var c=dp();return++Mu,function(){--Mu===0&&(c[$o]=null)}}},[]),l.jsx(sp.Provider,Object.assign({value:a},{children:r}),void 0)});function PA(e){if("manager"in e){var t={dragDropManager:e.manager};return[t,!1]}var r=RA(e.backend,e.context,e.options,e.debugMode),n=!e.context;return[r,n]}function RA(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:dp(),r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,s=t;return s[$o]||(s[$o]={dragDropManager:wA(e,t,r,n)}),s[$o]}function dp(){return typeof global<"u"?global:window}function FA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function MA(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 BA(e,t,r){return t&&MA(e.prototype,t),e}function Bu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ei=!1,ti=!1,qA=(function(){function e(t){FA(this,e),Bu(this,"internalMonitor",void 0),Bu(this,"sourceId",null),this.internalMonitor=t.getMonitor()}return BA(e,[{key:"receiveHandlerId",value:function(r){this.sourceId=r}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){we(!ei,"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 ei=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{ei=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;we(!ti,"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 ti=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{ti=!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 $A(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function UA(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 zA(e,t,r){return t&&UA(e.prototype,t),e}function qu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ri=!1,VA=(function(){function e(t){$A(this,e),qu(this,"internalMonitor",void 0),qu(this,"targetId",null),this.internalMonitor=t.getMonitor()}return zA(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;we(!ri,"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 ri=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{ri=!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 HA(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 QA(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(!g.isValidElement(t)){var n=t;return e(n,r),n}var s=t;HA(s);var o=r?function(a){return e(a,r)}:e;return WA(s,o)}}function fp(e){var t={};return Object.keys(e).forEach(function(r){var n=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{var s=QA(n);t[r]=function(){return s}}}),t}function $u(e,t){typeof e=="function"?e(t):e.current=t}function WA(e,t){var r=e.ref;return we(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?g.cloneElement(e,{ref:function(s){$u(r,s),$u(t,s)}}):g.cloneElement(e,{ref:t})}function Uo(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Uo=function(r){return typeof r}:Uo=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Uo(e)}function ol(e){return e!==null&&Uo(e)==="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function al(e,t,r,n){var s=void 0;if(s!==void 0)return!!s;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;var o=Object.keys(e),a=Object.keys(t);if(o.length!==a.length)return!1;for(var i=Object.prototype.hasOwnProperty.bind(t),c=0;c<o.length;c++){var u=o[c];if(!i(u))return!1;var d=e[u],f=t[u];if(s=void 0,s===!1||s===void 0&&d!==f)return!1}return!0}function GA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function KA(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 YA(e,t,r){return t&&KA(e.prototype,t),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 ZA=(function(){function e(t){var r=this;GA(this,e),_t(this,"hooks",fp({dragSource:function(s,o){r.clearDragSource(),r.dragSourceOptions=o||null,ol(s)?r.dragSourceRef=s:r.dragSourceNode=s,r.reconnectDragSource()},dragPreview:function(s,o){r.clearDragPreview(),r.dragPreviewOptions=o||null,ol(s)?r.dragPreviewRef=s:r.dragPreviewNode=s,r.reconnectDragPreview()}})),_t(this,"handlerId",null),_t(this,"dragSourceRef",null),_t(this,"dragSourceNode",void 0),_t(this,"dragSourceOptionsInternal",null),_t(this,"dragSourceUnsubscribe",void 0),_t(this,"dragPreviewRef",null),_t(this,"dragPreviewNode",void 0),_t(this,"dragPreviewOptionsInternal",null),_t(this,"dragPreviewUnsubscribe",void 0),_t(this,"lastConnectedHandlerId",null),_t(this,"lastConnectedDragSource",null),_t(this,"lastConnectedDragSourceOptions",null),_t(this,"lastConnectedDragPreview",null),_t(this,"lastConnectedDragPreviewOptions",null),_t(this,"backend",void 0),this.backend=t}return YA(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!al(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!al(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 XA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function JA(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 ek(e,t,r){return t&&JA(e.prototype,t),e}function hr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var tk=(function(){function e(t){var r=this;XA(this,e),hr(this,"hooks",fp({dropTarget:function(s,o){r.clearDropTarget(),r.dropTargetOptions=o,ol(s)?r.dropTargetRef=s:r.dropTargetNode=s,r.reconnect()}})),hr(this,"handlerId",null),hr(this,"dropTargetRef",null),hr(this,"dropTargetNode",void 0),hr(this,"dropTargetOptionsInternal",null),hr(this,"unsubscribeDropTarget",void 0),hr(this,"lastConnectedHandlerId",null),hr(this,"lastConnectedDropTarget",null),hr(this,"lastConnectedDropTargetOptions",null),hr(this,"backend",void 0),this.backend=t}return ek(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!al(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 rk(e,t,r){var n=r.getRegistry(),s=n.addTarget(e,t);return[s,function(){return n.removeTarget(s)}]}function nk(e,t,r){var n=r.getRegistry(),s=n.addSource(e,t);return[s,function(){return n.removeSource(s)}]}var Cn=typeof window<"u"?g.useLayoutEffect:g.useEffect;function zo(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?zo=function(r){return typeof r}:zo=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},zo(e)}function sk(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ok(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 ak(e,t,r){return t&&ok(e.prototype,t),e}function ni(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ik=(function(){function e(t,r,n){sk(this,e),ni(this,"spec",void 0),ni(this,"monitor",void 0),ni(this,"connector",void 0),this.spec=t,this.monitor=r,this.connector=n}return ak(e,[{key:"beginDrag",value:function(){var r,n=this.spec,s=this.monitor,o=null;return zo(n.item)==="object"?o=n.item:typeof n.item=="function"?o=n.item(s):o={},(r=o)!==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 s=this.spec,o=this.monitor,a=s.isDragging;return a?a(o):n===r.getSourceId()}},{key:"endDrag",value:function(){var r=this.spec,n=this.monitor,s=this.connector,o=r.end;o&&o(n.getItem(),n),s.reconnect()}}]),e})();function lk(e,t,r){var n=g.useMemo(function(){return new ik(e,t,r)},[t,r]);return g.useEffect(function(){n.spec=e},[e]),n}function _n(){var e=g.useContext(sp),t=e.dragDropManager;return we(t!=null,"Expected drag drop context"),t}function ck(e){return g.useMemo(function(){var t=e.type;return we(t!=null,"spec.type must be defined"),t},[e])}function uk(e,t){return pk(e)||hk(e,t)||fk(e,t)||dk()}function dk(){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 fk(e,t){if(e){if(typeof e=="string")return Uu(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 Uu(e,t)}}function Uu(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 hk(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,o=!1,a,i;try{for(r=r.call(e);!(s=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));s=!0);}catch(c){o=!0,i=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(o)throw i}}return n}}function pk(e){if(Array.isArray(e))return e}function mk(e,t,r){var n=_n(),s=lk(e,t,r),o=ck(e);Cn(function(){if(o!=null){var i=nk(o,s,n),c=uk(i,2),u=c[0],d=c[1];return t.receiveHandlerId(u),r.receiveHandlerId(u),d}},[n,t,r,s,o])}function gk(e){return Ck(e)||bk(e)||yk(e)||vk()}function vk(){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 yk(e,t){if(e){if(typeof e=="string")return il(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 il(e,t)}}function bk(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ck(e){if(Array.isArray(e))return il(e)}function il(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 hp(e,t){var r=gk(t||[]);return t==null&&typeof e!="function"&&r.push(e),g.useMemo(function(){return typeof e=="function"?e():e},r)}function Sk(){var e=_n();return g.useMemo(function(){return new qA(e)},[e])}function xk(e,t){var r=_n(),n=g.useMemo(function(){return new ZA(r.getBackend())},[r]);return Cn(function(){return n.dragSourceOptions=e||null,n.reconnect(),function(){return n.disconnectDragSource()}},[n,e]),Cn(function(){return n.dragPreviewOptions=t||null,n.reconnect(),function(){return n.disconnectDragPreview()}},[n,t]),n}var si,zu;function _k(){return zu||(zu=1,si=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,s,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))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(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[s]))return!1;for(s=n;s--!==0;){var a=o[s];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r}),si}var wk=_k();const Tk=Ll(wk);function Ek(e,t){return Lk(e)||Ik(e,t)||kk(e,t)||Ak()}function Ak(){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 kk(e,t){if(e){if(typeof e=="string")return Vu(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 Vu(e,t)}}function Vu(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 Ik(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,o=!1,a,i;try{for(r=r.call(e);!(s=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));s=!0);}catch(c){o=!0,i=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(o)throw i}}return n}}function Lk(e){if(Array.isArray(e))return e}function pp(e,t,r){var n=g.useState(function(){return t(e)}),s=Ek(n,2),o=s[0],a=s[1],i=g.useCallback(function(){var c=t(e);Tk(o,c)||(a(c),r&&r())},[o,e,r]);return Cn(i),[o,i]}function Dk(e,t){return Pk(e)||Ok(e,t)||Nk(e,t)||jk()}function jk(){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 Nk(e,t){if(e){if(typeof e=="string")return Hu(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 Hu(e,t)}}function Hu(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 Ok(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,o=!1,a,i;try{for(r=r.call(e);!(s=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));s=!0);}catch(c){o=!0,i=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(o)throw i}}return n}}function Pk(e){if(Array.isArray(e))return e}function Rk(e,t,r){var n=pp(e,t,r),s=Dk(n,2),o=s[0],a=s[1];return Cn(function(){var c=e.getHandlerId();if(c!=null)return e.subscribeToStateChange(a,{handlerIds:[c]})},[e,a]),o}function mp(e,t,r){return Rk(t,e||function(){return{}},function(){return r.reconnect()})}function Fk(e){return g.useMemo(function(){return e.hooks.dragSource()},[e])}function Mk(e){return g.useMemo(function(){return e.hooks.dragPreview()},[e])}function Bk(e,t){var r=hp(e,t);we(!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=Sk(),s=xk(r.options,r.previewOptions);return mk(r,n,s),[mp(r.collect,n,s),Fk(s),Mk(s)]}function qk(e){var t=e.accept;return g.useMemo(function(){return we(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]},[t])}function $k(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Uk(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 zk(e,t,r){return t&&Uk(e.prototype,t),e}function Qu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Vk=(function(){function e(t,r){$k(this,e),Qu(this,"spec",void 0),Qu(this,"monitor",void 0),this.spec=t,this.monitor=r}return zk(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 Hk(e,t){var r=g.useMemo(function(){return new Vk(e,t)},[t]);return g.useEffect(function(){r.spec=e},[e]),r}function Qk(e,t){return Yk(e)||Kk(e,t)||Gk(e,t)||Wk()}function Wk(){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 Gk(e,t){if(e){if(typeof e=="string")return Wu(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 Wu(e,t)}}function Wu(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 Kk(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,o=!1,a,i;try{for(r=r.call(e);!(s=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));s=!0);}catch(c){o=!0,i=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(o)throw i}}return n}}function Yk(e){if(Array.isArray(e))return e}function Zk(e,t,r){var n=_n(),s=Hk(e,t),o=qk(e);Cn(function(){var i=rk(o,s,n),c=Qk(i,2),u=c[0],d=c[1];return t.receiveHandlerId(u),r.receiveHandlerId(u),d},[n,t,s,r,o.map(function(a){return a.toString()}).join("|")])}function Xk(){var e=_n();return g.useMemo(function(){return new VA(e)},[e])}function Jk(e){var t=_n(),r=g.useMemo(function(){return new tk(t.getBackend())},[t]);return Cn(function(){return r.dropTargetOptions=e||null,r.reconnect(),function(){return r.disconnectDropTarget()}},[e]),r}function eI(e){return g.useMemo(function(){return e.hooks.dropTarget()},[e])}function gp(e,t){var r=hp(e,t),n=Xk(),s=Jk(r.options);return Zk(r,n,s),[mp(r.collect,n,s),eI(s)]}function tI(e,t){return oI(e)||sI(e,t)||nI(e,t)||rI()}function rI(){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 nI(e,t){if(e){if(typeof e=="string")return Gu(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 Gu(e,t)}}function Gu(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 sI(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,o=!1,a,i;try{for(r=r.call(e);!(s=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));s=!0);}catch(c){o=!0,i=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(o)throw i}}return n}}function oI(e){if(Array.isArray(e))return e}function aI(e){var t=_n(),r=t.getMonitor(),n=pp(r,e),s=tI(n,2),o=s[0],a=s[1];return g.useEffect(function(){return r.subscribeToOffsetChange(a)}),g.useEffect(function(){return r.subscribeToStateChange(a)}),o}function vp(e){var t=null,r=function(){return t==null&&(t=e()),t};return r}function iI(e,t){return e.filter(function(r){return r!==t})}function lI(e,t){var r=new Set,n=function(a){return r.add(a)};e.forEach(n),t.forEach(n);var s=[];return r.forEach(function(o){return s.push(o)}),s}function cI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uI(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 dI(e,t,r){return t&&uI(e.prototype,t),e}function Ku(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var fI=(function(){function e(t){cI(this,e),Ku(this,"entered",[]),Ku(this,"isNodeInDocument",void 0),this.isNodeInDocument=t}return dI(e,[{key:"enter",value:function(r){var n=this,s=this.entered.length,o=function(i){return n.isNodeInDocument(i)&&(!i.contains||i.contains(r))};return this.entered=lI(this.entered.filter(o),[r]),s===0&&this.entered.length>0}},{key:"leave",value:function(r){var n=this.entered.length;return this.entered=iI(this.entered.filter(this.isNodeInDocument),r),n>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),e})(),hI=vp(function(){return/firefox/i.test(navigator.userAgent)}),yp=vp(function(){return!!window.safari});function pI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mI(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 gI(e,t,r){return t&&mI(e.prototype,t),e}function bs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Yu=(function(){function e(t,r){pI(this,e),bs(this,"xs",void 0),bs(this,"ys",void 0),bs(this,"c1s",void 0),bs(this,"c2s",void 0),bs(this,"c3s",void 0);for(var n=t.length,s=[],o=0;o<n;o++)s.push(o);s.sort(function(k,N){return t[k]<t[N]?-1:1});for(var a=[],i=[],c,u,d=0;d<n-1;d++)c=t[d+1]-t[d],u=r[d+1]-r[d],a.push(c),i.push(u/c);for(var f=[i[0]],p=0;p<a.length-1;p++){var m=i[p],C=i[p+1];if(m*C<=0)f.push(0);else{c=a[p];var h=a[p+1],v=c+h;f.push(3*v/((v+h)/m+(v+c)/C))}}f.push(i[i.length-1]);for(var y=[],b=[],S,x=0;x<f.length-1;x++){S=i[x];var w=f[x],T=1/a[x],D=w+f[x+1]-S-S;y.push((S-w-D)*T),b.push(D*T*T)}this.xs=t,this.ys=r,this.c1s=f,this.c2s=y,this.c3s=b}return gI(e,[{key:"interpolate",value:function(r){var n=this.xs,s=this.ys,o=this.c1s,a=this.c2s,i=this.c3s,c=n.length-1;if(r===n[c])return s[c];for(var u=0,d=i.length-1,f;u<=d;){f=Math.floor(.5*(u+d));var p=n[f];if(p<r)u=f+1;else if(p>r)d=f-1;else return s[f]}c=Math.max(0,d);var m=r-n[c],C=m*m;return s[c]+o[c]*m+a[c]*C+i[c]*m*C}}]),e})(),vI=1;function bp(e){var t=e.nodeType===vI?e:e.parentElement;if(!t)return null;var r=t.getBoundingClientRect(),n=r.top,s=r.left;return{x:s,y:n}}function Co(e){return{x:e.clientX,y:e.clientY}}function yI(e){var t;return e.nodeName==="IMG"&&(hI()||!((t=document.documentElement)!==null&&t!==void 0&&t.contains(e)))}function bI(e,t,r,n){var s=e?t.width:r,o=e?t.height:n;return yp()&&e&&(o/=window.devicePixelRatio,s/=window.devicePixelRatio),{dragPreviewWidth:s,dragPreviewHeight:o}}function CI(e,t,r,n,s){var o=yI(t),a=o?e:t,i=bp(a),c={x:r.x-i.x,y:r.y-i.y},u=e.offsetWidth,d=e.offsetHeight,f=n.anchorX,p=n.anchorY,m=bI(o,t,u,d),C=m.dragPreviewWidth,h=m.dragPreviewHeight,v=function(){var D=new Yu([0,.5,1],[c.y,c.y/d*h,c.y+h-d]),k=D.interpolate(p);return yp()&&o&&(k+=(window.devicePixelRatio-1)*h),k},y=function(){var D=new Yu([0,.5,1],[c.x,c.x/u*C,c.x+C-u]);return D.interpolate(f)},b=s.offsetX,S=s.offsetY,x=b===0||b,w=S===0||S;return{x:x?b:y(),y:w?S:v()}}var Cp="__NATIVE_FILE__",Sp="__NATIVE_URL__",xp="__NATIVE_TEXT__",_p="__NATIVE_HTML__";const Zu=Object.freeze(Object.defineProperty({__proto__:null,FILE:Cp,HTML:_p,TEXT:xp,URL:Sp},Symbol.toStringTag,{value:"Module"}));function oi(e,t,r){var n=t.reduce(function(s,o){return s||e.getData(o)},"");return n??r}var Dn;function So(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=(Dn={},So(Dn,Cp,{exposeProperties:{files:function(t){return Array.prototype.slice.call(t.files)},items:function(t){return t.items},dataTransfer:function(t){return t}},matchesTypes:["Files"]}),So(Dn,_p,{exposeProperties:{html:function(t,r){return oi(t,r,"")},dataTransfer:function(t){return t}},matchesTypes:["Html","text/html"]}),So(Dn,Sp,{exposeProperties:{urls:function(t,r){return oi(t,r,"").split(`
|
|
545
|
+
`)},dataTransfer:function(t){return t}},matchesTypes:["Url","text/uri-list"]}),So(Dn,xp,{exposeProperties:{text:function(t,r){return oi(t,r,"")},dataTransfer:function(t){return t}},matchesTypes:["Text","text/plain"]}),Dn);function SI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xI(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 _I(e,t,r){return t&&xI(e.prototype,t),e}function Xu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var wI=(function(){function e(t){SI(this,e),Xu(this,"item",void 0),Xu(this,"config",void 0),this.config=t,this.item={},this.initializeExposedProperties()}return _I(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 s={};Object.keys(this.config.exposeProperties).forEach(function(o){s[o]={value:n.config.exposeProperties[o](r,n.config.matchesTypes),configurable:!0,enumerable:!0}}),Object.defineProperties(this.item,s)}}},{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 TI(e,t){var r=new wI(ll[e]);return r.loadDataTransfer(t),r}function ai(e){if(!e)return null;var t=Array.prototype.slice.call(e.types||[]);return Object.keys(ll).filter(function(r){var n=ll[r].matchesTypes;return n.some(function(s){return t.indexOf(s)>-1})})[0]||null}function EI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function AI(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 kI(e,t,r){return t&&AI(e.prototype,t),e}function ii(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var II=(function(){function e(t,r){EI(this,e),ii(this,"ownerDocument",null),ii(this,"globalContext",void 0),ii(this,"optionsArgs",void 0),this.globalContext=t,this.optionsArgs=r}return kI(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 Ju(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function ed(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ju(Object(r),!0).forEach(function(n){Ie(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ju(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function LI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function DI(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 jI(e,t,r){return t&&DI(e.prototype,t),e}function Ie(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var NI=(function(){function e(t,r,n){var s=this;LI(this,e),Ie(this,"options",void 0),Ie(this,"actions",void 0),Ie(this,"monitor",void 0),Ie(this,"registry",void 0),Ie(this,"enterLeaveCounter",void 0),Ie(this,"sourcePreviewNodes",new Map),Ie(this,"sourcePreviewNodeOptions",new Map),Ie(this,"sourceNodes",new Map),Ie(this,"sourceNodeOptions",new Map),Ie(this,"dragStartSourceIds",null),Ie(this,"dropTargetIds",[]),Ie(this,"dragEnterTargetIds",[]),Ie(this,"currentNativeSource",null),Ie(this,"currentNativeHandle",null),Ie(this,"currentDragSourceNode",null),Ie(this,"altKeyPressed",!1),Ie(this,"mouseMoveTimeoutTimer",null),Ie(this,"asyncEndDragFrameId",null),Ie(this,"dragOverTargetIds",null),Ie(this,"lastClientOffset",null),Ie(this,"hoverRafId",null),Ie(this,"getSourceClientOffset",function(o){var a=s.sourceNodes.get(o);return a&&bp(a)||null}),Ie(this,"endDragNativeItem",function(){s.isDraggingNativeItem()&&(s.actions.endDrag(),s.currentNativeHandle&&s.registry.removeSource(s.currentNativeHandle),s.currentNativeHandle=null,s.currentNativeSource=null)}),Ie(this,"isNodeInDocument",function(o){return!!(o&&s.document&&s.document.body&&s.document.body.contains(o))}),Ie(this,"endDragIfSourceWasRemovedFromDOM",function(){var o=s.currentDragSourceNode;o==null||s.isNodeInDocument(o)||s.clearCurrentDragSourceNode()&&s.monitor.isDragging()&&s.actions.endDrag()}),Ie(this,"handleTopDragStartCapture",function(){s.clearCurrentDragSourceNode(),s.dragStartSourceIds=[]}),Ie(this,"handleTopDragStart",function(o){if(!o.defaultPrevented){var a=s.dragStartSourceIds;s.dragStartSourceIds=null;var i=Co(o);s.monitor.isDragging()&&s.actions.endDrag(),s.actions.beginDrag(a||[],{publishSource:!1,getSourceClientOffset:s.getSourceClientOffset,clientOffset:i});var c=o.dataTransfer,u=ai(c);if(s.monitor.isDragging()){if(c&&typeof c.setDragImage=="function"){var d=s.monitor.getSourceId(),f=s.sourceNodes.get(d),p=s.sourcePreviewNodes.get(d)||f;if(p){var m=s.getCurrentSourcePreviewNodeOptions(),C=m.anchorX,h=m.anchorY,v=m.offsetX,y=m.offsetY,b={anchorX:C,anchorY:h},S={offsetX:v,offsetY:y},x=CI(f,p,i,b,S);c.setDragImage(p,x.x,x.y)}}try{c==null||c.setData("application/json",{})}catch{}s.setCurrentDragSourceNode(o.target);var w=s.getCurrentSourcePreviewNodeOptions(),T=w.captureDraggingState;T?s.actions.publishDragSource():setTimeout(function(){return s.actions.publishDragSource()},0)}else if(u)s.beginDragNativeItem(u);else{if(c&&!c.types&&(o.target&&!o.target.hasAttribute||!o.target.hasAttribute("draggable")))return;o.preventDefault()}}}),Ie(this,"handleTopDragEndCapture",function(){s.clearCurrentDragSourceNode()&&s.monitor.isDragging()&&s.actions.endDrag()}),Ie(this,"handleTopDragEnterCapture",function(o){s.dragEnterTargetIds=[];var a=s.enterLeaveCounter.enter(o.target);if(!(!a||s.monitor.isDragging())){var i=o.dataTransfer,c=ai(i);c&&s.beginDragNativeItem(c,i)}}),Ie(this,"handleTopDragEnter",function(o){var a=s.dragEnterTargetIds;if(s.dragEnterTargetIds=[],!!s.monitor.isDragging()){s.altKeyPressed=o.altKey,a.length>0&&s.actions.hover(a,{clientOffset:Co(o)});var i=a.some(function(c){return s.monitor.canDropOnTarget(c)});i&&(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=s.getCurrentDropEffect()))}}),Ie(this,"handleTopDragOverCapture",function(){s.dragOverTargetIds=[]}),Ie(this,"handleTopDragOver",function(o){var a=s.dragOverTargetIds;if(s.dragOverTargetIds=[],!s.monitor.isDragging()){o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none");return}s.altKeyPressed=o.altKey,s.lastClientOffset=Co(o),s.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(s.hoverRafId=requestAnimationFrame(function(){s.monitor.isDragging()&&s.actions.hover(a||[],{clientOffset:s.lastClientOffset}),s.hoverRafId=null}));var i=(a||[]).some(function(c){return s.monitor.canDropOnTarget(c)});i?(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=s.getCurrentDropEffect())):s.isDraggingNativeItem()?o.preventDefault():(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none"))}),Ie(this,"handleTopDragLeaveCapture",function(o){s.isDraggingNativeItem()&&o.preventDefault();var a=s.enterLeaveCounter.leave(o.target);a&&s.isDraggingNativeItem()&&setTimeout(function(){return s.endDragNativeItem()},0)}),Ie(this,"handleTopDropCapture",function(o){if(s.dropTargetIds=[],s.isDraggingNativeItem()){var a;o.preventDefault(),(a=s.currentNativeSource)===null||a===void 0||a.loadDataTransfer(o.dataTransfer)}else ai(o.dataTransfer)&&o.preventDefault();s.enterLeaveCounter.reset()}),Ie(this,"handleTopDrop",function(o){var a=s.dropTargetIds;s.dropTargetIds=[],s.actions.hover(a,{clientOffset:Co(o)}),s.actions.drop({dropEffect:s.getCurrentDropEffect()}),s.isDraggingNativeItem()?s.endDragNativeItem():s.monitor.isDragging()&&s.actions.endDrag()}),Ie(this,"handleSelectStart",function(o){var a=o.target;typeof a.dragDrop=="function"&&(a.tagName==="INPUT"||a.tagName==="SELECT"||a.tagName==="TEXTAREA"||a.isContentEditable||(o.preventDefault(),a.dragDrop()))}),this.options=new II(r,n),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new fI(this.isNodeInDocument)}return jI(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,s){var o=this;return this.sourcePreviewNodeOptions.set(r,s),this.sourcePreviewNodes.set(r,n),function(){o.sourcePreviewNodes.delete(r),o.sourcePreviewNodeOptions.delete(r)}}},{key:"connectDragSource",value:function(r,n,s){var o=this;this.sourceNodes.set(r,n),this.sourceNodeOptions.set(r,s);var a=function(u){return o.handleDragStart(u,r)},i=function(u){return o.handleSelectStart(u)};return n.setAttribute("draggable","true"),n.addEventListener("dragstart",a),n.addEventListener("selectstart",i),function(){o.sourceNodes.delete(r),o.sourceNodeOptions.delete(r),n.removeEventListener("dragstart",a),n.removeEventListener("selectstart",i),n.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(r,n){var s=this,o=function(u){return s.handleDragEnter(u,r)},a=function(u){return s.handleDragOver(u,r)},i=function(u){return s.handleDrop(u,r)};return n.addEventListener("dragenter",o),n.addEventListener("dragover",a),n.addEventListener("drop",i),function(){n.removeEventListener("dragenter",o),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 ed({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 ed({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}},{key:"isDraggingNativeItem",value:function(){var r=this.monitor.getItemType();return Object.keys(Zu).some(function(n){return Zu[n]===r})}},{key:"beginDragNativeItem",value:function(r,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=TI(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 s=1e3;this.mouseMoveTimeoutTimer=setTimeout(function(){var o;return(o=n.rootElement)===null||o===void 0?void 0:o.addEventListener("mousemove",n.endDragIfSourceWasRemovedFromDOM,!0)},s)}},{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})(),xo;function OI(){return xo||(xo=new Image,xo.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),xo}var PI=function(t,r,n){return new NI(t,r,n)};function RI(e,t){return typeof e=="function"?e(t):e??"NODE"}function FI(e){return e.isDraggable&&!e.isEditing}function MI(e){const t=Mt(),r=t.selectedIds,[n,s,o]=Bk(()=>({canDrag:()=>FI(e),type:RI(t.props.dragType,e),item:()=>{const a=t.isSelected(e.id)?Array.from(r):[e.id];return t.dispatch(ss.dragStart(e.id,a)),{id:e.id,dragIds:a,data:e.data}},end:()=>{t.hideCursor(),t.redrawList(),t.dispatch(ss.dragEnd())}}),[r,e,t.props.dragType]);return g.useEffect(()=>{o(OI())},[o]),s}function BI(e,t){const r=e.getBoundingClientRect(),n=t.x-Math.round(r.x),s=t.y-Math.round(r.y),o=r.height,a=s<o/2,i=!a,c=o/4,u=s>c&&s<o-c;return{x:n,inTopHalf:a,inBottomHalf:i,inMiddle:u,atTop:!u&&a,atBottom:!u&&i}}function qI(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 _o(e,t){return{parentId:e||null,index:t}}function jn(e,t){return{type:"line",index:e,level:t}}function $I(e){return{type:"highlight",id:e}}function li(e,t){var r;let n=e;for(;n.parent&&n.level>t;)n=n.parent;const s=((r=n.parent)===null||r===void 0?void 0:r.id)||null,o=Gh(n)+1;return{parentId:s,index:o}}function wp(e){var t;const r=BI(e.element,e.offset),n=e.indent,s=Math.round(Math.max(0,r.x-n)/n),{node:o,nextNode:a,prevNode:i}=e,[c,u]=qI(o,i,a,r);if(o&&o.isInternal&&r.inMiddle)return{drop:_o(o.id,null),cursor:$I(o.id)};if(!c)return{drop:_o((t=u==null?void 0:u.parent)===null||t===void 0?void 0:t.id,0),cursor:jn(0,0)};if(Vh(c)){const d=Ro(s,(u==null?void 0:u.level)||0,c.level);return{drop:li(c,d),cursor:jn(c.rowIndex+1,d)}}if(Hh(c)){const d=Ro(s,(u==null?void 0:u.level)||0,c.level);return{drop:li(c,d),cursor:jn(c.rowIndex+1,d)}}if(Qh(c)){const d=Ro(s,0,c.level+1);return d>c.level?{drop:_o(c.id,0),cursor:jn(c.rowIndex+1,d)}:{drop:li(c,d),cursor:jn(c.rowIndex+1,d)}}return{drop:_o(c==null?void 0:c.id,0),cursor:jn(c.rowIndex+1,c.level+1)}}function UI(e,t){const r=Mt(),[n,s]=gp(()=>({accept:"NODE",canDrop:()=>r.canDrop(),hover:(o,a)=>{const i=a.getClientOffset();if(!e.current||!i)return;const{cursor:c,drop:u}=wp({element:e.current,offset:i,indent:r.indent,node:t,prevNode:t.prev,nextNode:t.next});u&&r.dispatch(ss.hovering(u.parentId,u.index)),a.canDrop()?c&&r.showCursor(c):r.hideCursor()},drop:(o,a)=>{if(!a.canDrop())return null;r.drop()}}),[t,e.current,r.props]);return s}function zI(e){const t=Mt(),r=t.at(e);if(!r)throw new Error(`Could not find node for index: ${e}`);return g.useMemo(()=>{const n=r.clone();return t.visibleNodes[e]=n,n},[...Object.values(r.state),r])}const td=g.memo(function({index:t,style:r}){zh(),a0();const n=Mt(),s=zI(t),o=g.useRef(null),a=MI(s),i=UI(o,s),c=g.useCallback(h=>{o.current=h,i(h)},[i]),u=n.indent*s.level,d=g.useMemo(()=>({paddingLeft:u}),[u]),f=g.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]),p={role:"treeitem","aria-level":s.level+1,"aria-selected":s.isSelected,"aria-expanded":s.isOpen,style:f,tabIndex:-1,className:n.props.rowClassName};g.useEffect(()=>{var h;!s.isEditing&&s.isFocused&&((h=o.current)===null||h===void 0||h.focus({preventScroll:!0}))},[s.isEditing,s.isFocused,o.current]);const m=n.renderNode,C=n.renderRow;return l.jsx(C,{node:s,innerRef:c,attrs:p,children:l.jsx(m,{node:s,tree:n,style:d,dragHandle:a})})});let ci="",rd=null;function Tp(){zh();const e=Mt();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 s=Array.from(e.selectedIds);if(s.length>1){let o=e.mostRecentNode;for(;o&&o.isSelected;)o=o.nextSibling;o||(o=e.lastNode),e.focus(o,{scroll:!1}),e.delete(Array.from(s))}else{const o=e.focusedNode;if(o){const a=o.nextSibling,i=o.parent;e.focus(a||i,{scroll:!1}),e.delete(o)}}return}if(t.key==="Tab"&&!t.shiftKey){t.preventDefault(),Kh(t.currentTarget);return}if(t.key==="Tab"&&t.shiftKey){t.preventDefault(),Yh(t.currentTarget);return}if(t.key==="ArrowDown"){t.preventDefault();const s=e.nextNode;if(t.metaKey){e.select(e.focusedNode),e.activate(e.focusedNode);return}else if(!t.shiftKey||e.props.disableMultiSelection){e.focus(s);return}else{if(!s)return;const o=e.focusedNode;o?o.isSelected?e.selectContiguous(s):e.selectMulti(s):e.focus(e.firstNode);return}}if(t.key==="ArrowUp"){t.preventDefault();const s=e.prevNode;if(!t.shiftKey||e.props.disableMultiSelection){e.focus(s);return}else{if(!s)return;const o=e.focusedNode;o?o.isSelected?e.selectContiguous(s):e.selectMulti(s):e.focus(e.lastNode);return}}if(t.key==="ArrowRight"){const s=e.focusedNode;if(!s)return;s.isInternal&&s.isOpen?e.focus(e.nextNode):s.isInternal&&e.open(s.id);return}if(t.key==="ArrowLeft"){const s=e.focusedNode;if(!s||s.isRoot)return;s.isInternal&&s.isOpen?e.close(s.id):!((r=s.parent)===null||r===void 0)&&r.isRoot||e.focus(s.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 s=e.focusedNode;if(!s||!s.isEditable||!e.props.onRename)return;setTimeout(()=>{s&&e.edit(s)});return}if(t.key===" "){t.preventDefault();const s=e.focusedNode;if(!s)return;s.isLeaf?(s.select(),s.activate()):s.toggle();return}if(t.key==="*"){const s=e.focusedNode;if(!s)return;e.openSiblings(s);return}if(t.key==="PageUp"){t.preventDefault(),e.pageUp();return}t.key==="PageDown"&&(t.preventDefault(),e.pageDown()),clearTimeout(rd),ci+=t.key,rd=setTimeout(()=>{ci=""},600);const n=e.visibleNodes.find(s=>{const o=s.data.name;return typeof o=="string"?o.toLowerCase().startsWith(ci):!1});n&&e.focus(n.id)},children:l.jsx(VI,{})})}function VI(){var e,t;const r=Mt(),n={className:r.props.className,outerRef:r.listEl,itemCount:r.visibleNodes.length,height:r.height,width:r.width,overscanCount:r.overscanCount,itemKey:s=>{var o;return((o=r.visibleNodes[s])===null||o===void 0?void 0:o.id)||s},outerElementType:(e=r.props.outerElementType)!==null&&e!==void 0?e:G0,innerElementType:(t=r.props.innerElementType)!==null&&t!==void 0?t:Z0,onScroll:r.props.onScroll,onItemsRendered:r.onItemsRendered.bind(r)};return typeof r.props.rowHeight=="function"?l.jsx(V0,Object.assign({},n,{itemSize:r.rowHeightAt,ref:r.list,children:td})):l.jsx(H0,Object.assign({},n,{itemSize:r.rowHeight,ref:r.list,children:td}))}function nd(e){return e.isFiltered?QI(e.root,e.isMatch.bind(e)):HI(e.root)}function HI(e){const t=[];function r(n){var s;n.level>=0&&t.push(n),n.isOpen&&((s=n.children)===null||s===void 0||s.forEach(r))}return r(e),t.forEach(Ep),t}function QI(e,t){const r={},n=[];function s(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)s(c)}function o(a){var i;a.level>=0&&r[a.id]&&n.push(a),a.isOpen&&((i=a.children)===null||i===void 0||i.forEach(o))}return s(e),o(e),n.forEach(Ep),n}function Ep(e,t){e.rowIndex=t}const sd=e=>e.reduce((t,r,n)=>(t[r.id]=n,t),{});var ui=function(e,t,r,n){function s(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function i(d){try{u(n.next(d))}catch(f){a(f)}}function c(d){try{u(n.throw(d))}catch(f){a(f)}}function u(d){d.done?o(d.value):s(d.value).then(i,c)}u((n=n.apply(e,t||[])).next())})};const{safeRun:wt}=d0;class Ds{constructor(t,r,n,s){this.store=t,this.props=r,this.list=n,this.listEl=s,this.visibleStartIndex=0,this.visibleStopIndex=0,this.rowOffsets=null,this.rowHeightAt=o=>{const a=this.props.rowHeight;if(typeof a=="function"){const i=this.at(o);return i?a(i):this.rowHeight}return a??24},this.rowTopPosition=o=>{if(typeof this.props.rowHeight!="function")return o*this.rowHeight;const a=this.getRowOffsets(),i=Math.max(0,Math.min(o,a.length-1));return a[i]},this.redrawList=(o=0)=>{this.rowOffsets=null;const a=this.list.current;a&&"resetAfterIndex"in a&&a.resetAfterIndex(Math.max(0,o))},this.root=du(this),this.visibleNodes=nd(this),this.idToIndex=sd(this.visibleNodes)}update(t){this.props=t,this.root=du(this),this.visibleNodes=nd(this),this.idToIndex=sd(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,s)=>JSON.stringify(Object.values(n.data)).toLocaleLowerCase().includes(s.toLocaleLowerCase()));return n=>r(n,this.searchTerm)}accessChildren(t){var r;const n=this.props.childrenAccessor||"children";return(r=Es(t,n))!==null&&r!==void 0?r:null}accessId(t){const r=this.props.idAccessor||"id",n=Es(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 zs)return t.id;const r=this.props.idAccessor||"id";return Es(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 s=(n=this.indexOf(t))!==null&&n!==void 0?n:0,o=this.indexOf(r);if(o===null)return[];const a=Math.min(s,o),i=Math.max(s,o);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 ui(this,arguments,void 0,function*(t={}){var r,n;const s=t.parentId===void 0?ep(this):t.parentId,o=(r=t.index)!==null&&r!==void 0?r:Jh(this),a=(n=t.type)!==null&&n!==void 0?n:"leaf",i=yield wt(this.props.onCreate,{type:a,parentId:s,index:o,parentNode:this.get(s)});i&&(this.focus(i),setTimeout(()=>{this.edit(i).then(()=>{this.select(i),this.activate(i)})}))})}delete(t){return ui(this,void 0,void 0,function*(){if(!t)return;const n=(Array.isArray(t)?t:[t]).map(a=>this.identify(a)),s=n.map(a=>this.get(a)).filter(a=>!!a),o=s.length?Math.min(...s.map(a=>{var i;return(i=a.rowIndex)!==null&&i!==void 0?i:0})):0;yield wt(this.props.onDelete,{nodes:s,ids:n}),this.redrawList(o)})}edit(t){var r,n;const s=this.identify(t);return this.resolveEdit({cancelled:!0}),this.scrollTo(s),this.dispatch(Za(s)),this.redrawList((n=(r=this.get(s))===null||r===void 0?void 0:r.rowIndex)!==null&&n!==void 0?n:0),new Promise(o=>{Ds.editPromise=o})}submit(t,r){return ui(this,void 0,void 0,function*(){var n,s;if(!t)return;const o=this.identify(t);yield wt(this.props.onRename,{id:o,name:r,node:this.get(o)}),this.dispatch(Za(null)),this.resolveEdit({cancelled:!1,value:r}),this.redrawList((s=(n=this.get(o))===null||n===void 0?void 0:n.rowIndex)!==null&&s!==void 0?s:0),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(Za(null)),this.resolveEdit({cancelled:!0}),this.redrawList(),setTimeout(()=>this.onFocus())}activate(t){const r=this.get(this.identifyNull(t));r&&wt(this.props.onActivate,r)}resolveEdit(t){const r=Ds.editPromise;r&&r(t),Ds.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(An(this.identify(t))),r.scroll!==!1&&this.scrollTo(t),this.focusedNode&&wt(this.props.onFocus,this.focusedNode)))}pageUp(){var t,r;const n=this.visibleStartIndex,o=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-o,0),this.focus(this.at(a))}pageDown(){var t,r;const n=this.visibleStartIndex,s=this.visibleStopIndex,o=s-n;let a=(r=(t=this.focusedNode)===null||t===void 0?void 0:t.rowIndex)!==null&&r!==void 0?r:0;a<s?a=s:a=Math.min(a+o,this.visibleNodes.length-1),this.focus(this.at(a))}select(t,r={}){var n;if(!t)return;const s=r.focus!==!1,o=this.identify(t);s&&this.dispatch(An(o)),!((n=this.get(o))===null||n===void 0)&&n.isSelectable&&this.setSelection({ids:[o],anchor:o,mostRecent:o}),this.scrollTo(o,r.align),this.focusedNode&&s&&wt(this.props.onFocus,this.focusedNode)}deselect(t){if(!t)return;const r=this.identify(t);this.dispatch(jr.remove(r)),wt(this.props.onSelect,this.selectedNodes)}selectMulti(t,r={}){const n=this.get(this.identifyNull(t));if(!n)return;const s=r.focus!==!1;s&&this.dispatch(An(n.id)),n.isSelectable&&(this.dispatch(jr.add(n.id)),this.dispatch(jr.anchor(n.id)),this.dispatch(jr.mostRecent(n.id))),this.scrollTo(n,r.align),this.focusedNode&&s&&wt(this.props.onFocus,this.focusedNode),wt(this.props.onSelect,this.selectedNodes)}selectContiguous(t){var r;if(!t)return;const n=this.identify(t);if(this.dispatch(An(n)),!((r=this.get(n))===null||r===void 0)&&r.isSelectable){const{anchor:s,mostRecent:o}=this.state.nodes.selection,a=this.filterSelectableNodes(this.nodesBetween(s,this.identifyNull(n)));this.dispatch(jr.remove(this.nodesBetween(s,o))),this.dispatch(jr.add(a)),this.dispatch(jr.mostRecent(n))}this.scrollTo(n),this.focusedNode&&wt(this.props.onFocus,this.focusedNode),wt(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null})}selectAll(){var t,r,n;const s=this.filterSelectableNodes(Object.keys(this.idToIndex));this.setSelection({ids:s,anchor:(t=s[0])!==null&&t!==void 0?t:null,mostRecent:(r=s[s.length-1])!==null&&r!==void 0?r:null}),this.dispatch(An((n=this.lastNode)===null||n===void 0?void 0:n.id)),this.focusedNode&&wt(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))),s=this.identifyNull(t.anchor),o=this.identifyNull(t.mostRecent);this.dispatch(jr.set({ids:n,anchor:s,mostRecent:o})),wt(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,s=this.props.disableDrop;for(const o of n)if(!o||!r||o.isInternal&&Wh(r,o))return!1;return typeof s=="function"?!s({parentNode:r,dragNodes:this.dragNodes,index:this.state.dnd.index||0}):typeof s=="string"?!r.data[s]:typeof s=="boolean"?!s:!0}drop(){const{parentId:t,index:r,dragIds:n}=this.state.dnd;wt(this.props.onMove,{dragIds:n,parentId:t===Us?null:t,index:r===null?0:r,dragNodes:this.dragNodes,parentNode:this.get(t)}),this.open(t)}hideCursor(){this.dispatch(ss.cursor({type:"none"}))}showCursor(t){this.dispatch(ss.cursor(t))}open(t,r=!0){var n,s;const o=this.identifyNull(t);o&&(this.isOpen(o)||(this.dispatch(el.open(o,this.isFiltered)),r&&this.redrawList((s=(n=this.get(o))===null||n===void 0?void 0:n.rowIndex)!==null&&s!==void 0?s:0),wt(this.props.onToggle,o)))}close(t,r=!0){var n,s;const o=this.identifyNull(t);o&&this.isOpen(o)&&(this.dispatch(el.close(o,this.isFiltered)),r&&this.redrawList((s=(n=this.get(o))===null||n===void 0?void 0:n.rowIndex)!==null&&s!==void 0?s:0),wt(this.props.onToggle,o))}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=$l(this.root,r);let s=n==null?void 0:n.parent;for(;s;)this.open(s.id,!1),s=s.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 s of r.children)s.isInternal&&(n?this.close(s.id,!1):this.open(s.id,!1));this.redrawList(),this.scrollTo(this.focusedNode)}}openAll(){na(this.root,t=>{t.isInternal&&this.open(t.id,!1)}),this.redrawList()}closeAll(){na(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),Xh(()=>n in this.idToIndex).then(()=>{var s;const o=this.idToIndex[n];o!==void 0&&((s=this.list.current)===null||s===void 0||s.scrollToItem(o,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,s;if(!t)return!1;if(t===Us)return!0;const o=(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:(s=this.state.nodes.open.unfiltered[t])!==null&&s!==void 0?s:o}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!Es(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:s}=this.state.nodes.drag;return r===n&&s===null}onFocus(){const t=this.focusedNode||this.firstNode;t&&this.dispatch(An(t.id))}onBlur(){this.dispatch(S0())}onItemsRendered(t){this.visibleStartIndex=t.visibleStartIndex,this.visibleStopIndex=t.visibleStopIndex}get renderContainer(){return this.props.renderContainer||Tp}get renderRow(){return this.props.renderRow||g0}get renderNode(){return this.props.children||v0}get renderDragPreview(){return this.props.renderDragPreview||tp}get renderCursor(){return this.props.renderCursor||m0}}function Et(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 WI=typeof Symbol=="function"&&Symbol.observable||"@@observable",od=WI,di=()=>Math.random().toString(36).substring(7).split("").join("."),GI={INIT:`@@redux/INIT${di()}`,REPLACE:`@@redux/REPLACE${di()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${di()}`},gn=GI;function Ap(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 KI(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(XI(e))return"date";if(ZI(e))return"error";const r=YI(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 YI(e){return typeof e.constructor=="function"?e.constructor.name:null}function ZI(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function XI(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Pr(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=KI(e)),t}function kp(e,t,r){if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?Et(2):`Expected the root reducer to be a function. Instead, received: '${Pr(e)}'`);if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?Et(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"?Et(1):`Expected the enhancer to be a function. Instead, received: '${Pr(r)}'`);return r(kp)(e,t)}let n=e,s=t,o=new Map,a=o,i=0,c=!1;function u(){a===o&&(a=new Map,o.forEach((v,y)=>{a.set(y,v)}))}function d(){if(c)throw new Error(process.env.NODE_ENV==="production"?Et(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(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?Et(4):`Expected the listener to be a function. Instead, received: '${Pr(v)}'`);if(c)throw new Error(process.env.NODE_ENV==="production"?Et(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;u();const b=i++;return a.set(b,v),function(){if(y){if(c)throw new Error(process.env.NODE_ENV==="production"?Et(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,u(),a.delete(b),o=null}}}function p(v){if(!Ap(v))throw new Error(process.env.NODE_ENV==="production"?Et(7):`Actions must be plain objects. Instead, the actual type was: '${Pr(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"?Et(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"?Et(17):`Action "type" property must be a string. Instead, the actual type was: '${Pr(v.type)}'. Value was: '${v.type}' (stringified)`);if(c)throw new Error(process.env.NODE_ENV==="production"?Et(9):"Reducers may not dispatch actions.");try{c=!0,s=n(s,v)}finally{c=!1}return(o=a).forEach(b=>{b()}),v}function m(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?Et(10):`Expected the nextReducer to be a function. Instead, received: '${Pr(v)}`);n=v,p({type:gn.REPLACE})}function C(){const v=f;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(process.env.NODE_ENV==="production"?Et(11):`Expected the observer to be an object. Instead, received: '${Pr(y)}'`);function b(){const x=y;x.next&&x.next(d())}return b(),{unsubscribe:v(b)}},[od](){return this}}}return p({type:gn.INIT}),{dispatch:p,subscribe:f,getState:d,replaceReducer:m,[od]:C}}function ad(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function JI(e,t,r,n){const s=Object.keys(t),o=r&&r.type===gn.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(s.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(!Ap(e))return`The ${o} has unexpected type of "${Pr(e)}". Expected argument to be an object with the following keys: "${s.join('", "')}"`;const a=Object.keys(e).filter(i=>!t.hasOwnProperty(i)&&!n[i]);if(a.forEach(i=>{n[i]=!0}),!(r&&r.type===gn.REPLACE)&&a.length>0)return`Unexpected ${a.length>1?"keys":"key"} "${a.join('", "')}" found in ${o}. Expected to find one of the known reducer keys instead: "${s.join('", "')}". Unexpected keys will be ignored.`}function eL(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:gn.INIT})>"u")throw new Error(process.env.NODE_ENV==="production"?Et(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:gn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?Et(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${gn.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 id(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"&&ad(`No reducer provided for key "${i}"`),typeof e[i]=="function"&&(r[i]=e[i])}const n=Object.keys(r);let s;process.env.NODE_ENV!=="production"&&(s={});let o;try{eL(r)}catch(a){o=a}return function(i={},c){if(o)throw o;if(process.env.NODE_ENV!=="production"){const f=JI(i,r,c,s);f&&ad(f)}let u=!1;const d={};for(let f=0;f<n.length;f++){const p=n[f],m=r[p],C=i[p],h=m(C,c);if(typeof h>"u"){const v=c&&c.type;throw new Error(process.env.NODE_ENV==="production"?Et(14):`When called with an action of type ${v?`"${String(v)}"`:"(unknown type)"}, the slice reducer for key "${p}" 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.`)}d[p]=h,u=u||h!==C}return u=u||n.length!==Object.keys(i).length,u?d:i}}function tL(e=ns().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 rL=id({nodes:id({focus:x0,edit:C0,open:_0,selection:w0,drag:tL}),dnd:T0}),nL=ns();function sL({treeProps:e,imperativeHandle:t,children:r}){const n=g.useRef(null),s=g.useRef(null),o=g.useRef(kp(rL,ns(e))),a=o0.useSyncExternalStore(o.current.subscribe,o.current.getState,()=>nL),i=g.useMemo(()=>new Ds(o.current,e,n,s),[]),c=g.useRef(0);return g.useMemo(()=>{c.current+=1,i.update(e)},Object.values(e)),g.useMemo(()=>{c.current+=1,i.update(i.props)},[a.nodes.open]),g.useImperativeHandle(t,()=>i),g.useEffect(()=>{i.props.selection?i.select(i.props.selection,{focus:!1}):i.deselectAll()},[i.props.selection]),g.useEffect(()=>{i.props.searchTerm||o.current.dispatch(el.clear(!0))},[i.props.searchTerm]),l.jsx(Bh.Provider,{value:i,children:l.jsx(Uh.Provider,{value:c.current,children:l.jsx(qh.Provider,{value:a.nodes,children:l.jsx($h.Provider,{value:a.dnd,children:l.jsx(OA,Object.assign({},e.dndManager?{manager:e.dndManager}:{backend:e.dndBackend||PI,options:{rootElement:i.props.dndRootElement||void 0}},{children:r}))})})})})}function oL(){const e=Mt(),[,t]=gp(()=>({accept:"NODE",canDrop:(r,n)=>n.isOver({shallow:!0})?e.canDrop():!1,hover:(r,n)=>{if(!n.isOver({shallow:!0}))return;const s=n.getClientOffset();if(!e.listEl.current||!s)return;const{cursor:o,drop:a}=wp({element:e.listEl.current,offset:s,indent:e.indent,node:null,prevNode:e.visibleNodes[e.visibleNodes.length-1],nextNode:null});a&&e.dispatch(ss.hovering(a.parentId,a.index)),n.canDrop()?o&&e.showCursor(o):e.hideCursor()},drop:(r,n)=>{if(!n.isOver({shallow:!0})||!n.canDrop())return null;e.drop()}}),[e]);t(e.listEl)}function aL(e){return oL(),e.children}function iL(){const t=Mt().props.renderContainer||Tp;return l.jsx(l.Fragment,{children:l.jsx(t,{})})}function lL(){const e=Mt(),{offset:t,mouse:r,item:n,isDragging:s}=aI(a=>({offset:a.getSourceClientOffset(),mouse:a.getClientOffset(),item:a.getItem(),isDragging:a.isDragging()})),o=e.props.renderDragPreview||tp;return l.jsx(o,{offset:t,mouse:r,id:(n==null?void 0:n.id)||null,dragIds:(n==null?void 0:n.dragIds)||[],isDragging:s})}function cL(e={}){var t,r;const n=(t=e.idAccessor)!==null&&t!==void 0?t:"id",s=(r=e.childrenAccessor)!==null&&r!==void 0?r:"children";return{getId:typeof n=="function"?n:o=>o[n],getChildren:typeof s=="function"?s:o=>o[s],childrenKey:typeof s=="string"?s:"children"}}class uL{constructor(t,r={}){this.accessors=cL(r),this.root=dL(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 s=this.find(t,n);if(s)return s}return null}return null}}function dL(e,t){const r=new Ip({},null,t,"ROOT");return r.children=e.map(n=>Gl(n,r,t)),r}function Gl(e,t,r){const n=new Ip(e,t,r),s=r.getChildren(e);return s&&(n.children=s.map(o=>Gl(o,n,r))),n}class Ip{constructor(t,r,n,s){this.data=t,this.parent=r,this.accessors=n,this.id=s??n.getId(t)}hasParent(){return!!this.parent}get childIndex(){return this.hasParent()?this.parent.children.indexOf(this):-1}addChild(t,r){var n,s;const o=Gl(t,this,this.accessors);this.children=(n=this.children)!==null&&n!==void 0?n:[],this.children.splice(r,0,o);const a=this.accessors.childrenKey,i=this.data;i[a]=(s=i[a])!==null&&s!==void 0?s:[],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 fL=0;function hL(e,t={}){const[r,n]=g.useState(e),s=t.idAccessor,o=t.childrenAccessor,a=g.useMemo(()=>new uL(r,{idAccessor:s,childrenAccessor:o}),[r,s,o]),i=C=>{for(const h of C.dragIds)a.move({id:h,parentId:C.parentId,index:C.index});n(a.data)},c=({name:C,id:h})=>{a.update({id:h,changes:{name:C}}),n(a.data)},u=typeof s=="string"?s:"id",d=typeof o=="string"?o:"children";return[r,{onMove:i,onRename:c,onCreate:({parentId:C,index:h,type:v})=>{if(typeof s=="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 o=="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={[u]:`simple-tree-id-${fL++}`,name:""};return v==="internal"&&(y[d]=[]),a.create({parentId:C,index:h,data:y}),n(a.data),y},onDelete:C=>{C.ids.forEach(h=>a.drop({id:h})),n(a.data)}}]}function pL(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]=hL(e.initialData,{idAccessor:e.idAccessor,childrenAccessor:e.childrenAccessor});return Object.assign(Object.assign(Object.assign({},e),r),{data:t})}else return e}function mL(e,t){const r=pL(e);return l.jsxs(sL,{treeProps:r,imperativeHandle:t,children:[l.jsx(aL,{children:l.jsx(iL,{})}),l.jsx(lL,{})]})}const gL=g.forwardRef(mL);function Kl(){return oe(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 vL(){return oe(e=>{var s;if(!e.selectedNodeId)return!1;const t=(s=e.treeData[0])==null?void 0:s.id,r=o=>{var a;for(const i of o){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 ld={video:"#EA580C",pdf:"#DC2626",h5p:"#0D9488",scorm:"#7C3AED",audio:"#DB2777",quiz:"#16A34A",course:"#A85236",default:"#6B7280"},cd={video:"Video",pdf:"FileText",h5p:"Layers",scorm:"Package",audio:"Music",quiz:"HelpCircle",course:"BookOpen",default:"File"},ud=["Course Assessment","eTextbook","Exam Question","Explanation Content","Learning Resource","Practice Question Set","SCORM Content","Teacher Resource"],fi=[{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 yL(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 lo(e){const t=yL(e);return{key:t,color:ld[t]??ld.default,bgClass:`sbx-ct-sq--${t}`,badgeClass:`sbx-ct-badge--${t}`,tintClass:`sbx-ct-tint--${t}`,iconName:cd[t]??cd.default,label:t.charAt(0).toUpperCase()+t.slice(1)}}const bL="_row_1yoqj_1",CL="_grip_1yoqj_16",SL="_menuBtn_1yoqj_19",xL="_rowLp_1yoqj_23",_L="_selected_1yoqj_27",wL="_title_1yoqj_32",TL="_dropTarget_1yoqj_41",EL="_toggle_1yoqj_58",AL="_ctIcon_1yoqj_73",kL="_ctIconLp_1yoqj_85",IL="_folderIcon_1yoqj_89",LL="_rootIcon_1yoqj_94",DL="_titleLp_1yoqj_110",jL="_levelTitle_1yoqj_114",NL="_renameInput_1yoqj_119",OL="_dropHere_1yoqj_128",PL="_menuWrap_1yoqj_138",RL="_menu_1yoqj_19",FL="_dangerItem_1yoqj_190",it={row:bL,grip:CL,menuBtn:SL,rowLp:xL,selected:_L,title:wL,dropTarget:TL,toggle:EL,ctIcon:AL,ctIconLp:kL,folderIcon:IL,rootIcon:LL,titleLp:DL,levelTitle:jL,renameInput:NL,dropHere:OL,menuWrap:PL,menu:RL,dangerItem:FL},ML={video:_a,pdf:to,h5p:Ca,scorm:xa,audio:Sa,quiz:ba,course:Cr,default:Gr},BL=({node:e,style:t,dragHandle:r,editorMode:n})=>{var R;const[s,o]=g.useState(!1),[a,i]=g.useState(!1),[c,u]=g.useState(e.data.name),d=g.useRef(null),f=ie(),p=X(O=>O.editorProfile),m=n==="edit",C=Kl(),h=lo(e.data),v=ML[h.key]??Gr,y=e.isSelected,b=e.level===0,S=e.data.isFolder??(e.children&&e.children.length>0),x=p.key==="learningPath",w=b?x?Rh:Ey:S?x?Ry:Vf:v,T=x&&S&&!b&&!nt(e.data),D=x&&!!((R=e.data.metadata)!=null&&R.isAssessmentCourse),k=e.level+1<=p.maxDepth,N=x?f.learningPath.addLevelButton:f.treeNode.addSubunitMenuItem,F=x?f.learningPath.addLevelButton:f.treeNode.addSiblingMenuItem;g.useEffect(()=>{if(!s)return;const O=U=>{var re;(re=d.current)!=null&&re.contains(U.target)||o(!1)};return document.addEventListener("mousedown",O),()=>document.removeEventListener("mousedown",O)},[s]);const A=g.useCallback(()=>{c.trim()&&e.submit(c.trim()),i(!1)},[c,e]),P=g.useCallback(O=>{O.key==="Enter"&&A(),O.key==="Escape"&&(u(e.data.name),i(!1))},[A,e.data.name]);return l.jsxs("div",{className:[it.row,x?it.rowLp:"",y?it.selected:"",e.state.isOver&&S?it.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:[m&&l.jsx("span",{ref:r,className:it.grip,"aria-hidden":"true",children:l.jsx(Il,{size:14})}),l.jsx("button",{className:it.toggle,onClick:O=>{O.stopPropagation(),e.toggle()},"aria-label":e.isClosed?f.treeNode.expandAriaLabel:f.treeNode.collapseAriaLabel,style:{visibility:S?"visible":"hidden"},children:e.isClosed?l.jsx(kl,{size:14}):l.jsx(xn,{size:14})}),l.jsx("span",{className:[it.ctIcon,b||S||D?it.folderIcon:h.bgClass,x?it.ctIconLp:"",b&&x?it.rootIcon:""].filter(Boolean).join(" "),"aria-hidden":"true",children:l.jsx(w,{size:b&&x?15:12})}),a?l.jsx("input",{className:it.renameInput,value:c,autoFocus:!0,onChange:O=>u(O.target.value),onBlur:A,onKeyDown:P,onClick:O=>O.stopPropagation()}):l.jsx("span",{className:[it.title,x?it.titleLp:"",T?it.levelTitle:""].filter(Boolean).join(" "),title:e.data.name,onDoubleClick:()=>m&&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:it.dropHere,"aria-hidden":"true",children:f.treeNode.dropHereLabel}),m&&l.jsxs("div",{className:it.menuWrap,ref:d,children:[l.jsx("button",{className:it.menuBtn,onClick:O=>{O.stopPropagation(),o(U=>!U)},"aria-label":f.treeNode.nodeOptionsAriaLabel,children:l.jsx(Uf,{size:14})}),s&&l.jsxs("div",{className:it.menu,role:"menu",children:[l.jsxs("button",{role:"menuitem",onClick:()=>{i(!0),o(!1)},children:[l.jsx(qy,{size:13})," ",f.treeNode.renameMenuItem]}),S&&C&&k&&l.jsxs("button",{role:"menuitem",onClick:()=>{e.tree.create({parentId:e.id}),o(!1)},children:[l.jsx(zf,{size:13})," ",N]}),e.data.parent&&C&&!x&&l.jsxs("button",{role:"menuitem",onClick:()=>{e.tree.create({parentId:e.data.parent}),o(!1)},children:[l.jsx(kr,{size:13})," ",F]}),!b&&l.jsxs("button",{role:"menuitem",className:it.dangerItem,onClick:()=>{e.tree.delete(e.id),o(!1)},children:[l.jsx(ls,{size:13})," ",f.treeNode.deleteMenuItem]})]})]})]})};async function qL(e,t){var o,a;const n=((o=(await Fe.post(`/action/content/v3/upload/url/${e}?type=hierarchy`,{request:{content:{fileName:t}}})).data)==null?void 0:o.result)??{},s=((a=n.content)==null?void 0:a.preSignedURL)??n.pre_signed_url??n.preSignedUrl;if(!s)throw new Error("Could not obtain an upload URL");return s}async function $L(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 UL(e,t){var i;const r=await qL(e,t.name),n=await $L(r,t),s=new FormData;return s.append("fileUrl",n),s.append("mimeType",t.type||"text/csv"),{processId:(((i=(await Fe.post(`/action/collection/v1/import/${e}`,s)).data)==null?void 0:i.result)??{}).processId??""}}async function zL(e){var r;return((r=(await Fe.get(`/action/collection/v1/import/status/${e}`)).data)==null?void 0:r.result)??{status:"PENDING"}}async function Lp(e){var n,s,o;const r=(o=(s=(n=(await Fe.get(`/action/collection/v1/export/${e}`)).data)==null?void 0:n.result)==null?void 0:s.collection)==null?void 0:o.tocUrl;if(!r)throw new Error("No export URL returned");return r}async function VL(e){return Lp(e)}const HL="_container_jr3ij_1",QL="_header_jr3ij_13",WL="_title_jr3ij_22",GL="_closeBtn_jr3ij_29",KL="_body_jr3ij_45",YL="_dropZone_jr3ij_54",ZL="_dragOver_jr3ij_67",XL="_hasFile_jr3ij_72",JL="_hiddenInput_jr3ij_78",eD="_fileInfo_jr3ij_82",tD="_fileIcon_jr3ij_89",rD="_fileName_jr3ij_93",nD="_fileSize_jr3ij_100",sD="_dropHint_jr3ij_105",oD="_dropIcon_jr3ij_112",aD="_dropText_jr3ij_117",iD="_dropSubtext_jr3ij_124",lD="_sampleLink_jr3ij_130",cD="_statusBar_jr3ij_145",uD="_status_uploading_jr3ij_154",dD="_status_processing_jr3ij_154",fD="_status_done_jr3ij_159",hD="_status_error_jr3ij_164",pD="_successDetail_jr3ij_170",mD="_spinner_jr3ij_175",gD="_spin_jr3ij_175",vD="_errorMsg_jr3ij_191",yD="_failedSection_jr3ij_197",bD="_failedTitle_jr3ij_203",CD="_tableWrap_jr3ij_213",SD="_failedTable_jr3ij_219",xD="_reasonCell_jr3ij_244",_D="_footer_jr3ij_248",Ue={container:HL,header:QL,title:WL,closeBtn:GL,body:KL,dropZone:YL,dragOver:ZL,hasFile:XL,hiddenInput:JL,fileInfo:eD,fileIcon:tD,fileName:rD,fileSize:nD,dropHint:sD,dropIcon:oD,dropText:aD,dropSubtext:iD,sampleLink:lD,statusBar:cD,status_uploading:uD,status_processing:dD,status_done:fD,status_error:hD,successDetail:pD,spinner:mD,spin:gD,errorMsg:vD,failedSection:yD,failedTitle:bD,tableWrap:CD,failedTable:SD,reasonCell:xD,footer:_D},wD=({contentId:e,onComplete:t,onClose:r,mode:n="create"})=>{const s=ie(),[o,a]=g.useState(null),[i,c]=g.useState(!1),[u,d]=g.useState("idle"),[f,p]=g.useState(""),[m,C]=g.useState([]),[h,v]=g.useState(null),y=g.useRef(null),b=g.useRef(null),S=g.useCallback(()=>{b.current!==null&&(clearInterval(b.current),b.current=null)},[]);g.useEffect(()=>()=>S(),[S]);const x=A=>A.name.toLowerCase().endsWith(".csv")?A.size>50*1024*1024?(p(s.csvUpload.fileTooLarge),!1):!0:(p(s.csvUpload.invalidFileType),!1),w=g.useCallback(A=>{p(""),C([]),v(null),d("idle"),x(A)&&a(A)},[]),T=g.useCallback(A=>{A.preventDefault(),c(!1);const P=A.dataTransfer.files[0];P&&w(P)},[w]),D=g.useCallback(A=>{var R;const P=(R=A.target.files)==null?void 0:R[0];P&&w(P),A.target.value=""},[w]),k=g.useCallback(async()=>{try{const A=await VL(e),P=document.createElement("a");P.href=A,P.download="sample_hierarchy.csv",P.target="_blank",P.click()}catch{p(s.csvUpload.downloadSampleFailed)}},[e,s.csvUpload.downloadSampleFailed]),N=g.useCallback(async()=>{if(o){d("uploading"),p(""),C([]);try{const{processId:A}=await UL(e,o);if(!A){d("done"),v(null),setTimeout(t,1500);return}d("processing"),b.current=setInterval(async()=>{try{const P=await zL(A);P.status==="COMPLETED"?(S(),d("done"),v(P.successCount??null),P.failedRecords&&P.failedRecords.length>0?C(P.failedRecords):setTimeout(t,1500)):P.status==="FAILED"&&(S(),d("error"),p(s.csvUpload.processingFailed),P.failedRecords&&C(P.failedRecords))}catch{S(),d("error"),p(s.csvUpload.connectionLost)}},2e3)}catch{d("error"),p(s.csvUpload.uploadFailed)}}},[e,o,t,S,s.csvUpload.processingFailed,s.csvUpload.connectionLost,s.csvUpload.uploadFailed]),F={idle:"",uploading:s.csvUpload.statusUploading,processing:s.csvUpload.statusProcessing,done:s.csvUpload.statusDone,error:s.csvUpload.statusError};return l.jsxs("div",{className:Ue.container,children:[l.jsxs("div",{className:Ue.header,children:[l.jsx("h2",{className:Ue.title,children:n==="update"?s.csvUpload.titleUpdate:s.csvUpload.titleCreate}),l.jsx("button",{className:Ue.closeBtn,onClick:r,"aria-label":s.csvUpload.closeAriaLabel,children:l.jsx(lr,{size:18})})]}),l.jsxs("div",{className:Ue.body,children:[l.jsxs("div",{className:`${Ue.dropZone} ${i?Ue.dragOver:""} ${o?Ue.hasFile:""}`,onDragEnter:A=>{A.preventDefault(),c(!0)},onDragOver:A=>{A.preventDefault(),c(!0)},onDragLeave:A=>{A.preventDefault(),c(!1)},onDrop:T,onClick:()=>{var A;return(A=y.current)==null?void 0:A.click()},role:"button",tabIndex:0,"aria-label":s.csvUpload.dropZoneAriaLabel,onKeyDown:A=>{var P;return A.key==="Enter"&&((P=y.current)==null?void 0:P.click())},children:[l.jsx("input",{ref:y,type:"file",accept:".csv",className:Ue.hiddenInput,onChange:D,"aria-hidden":"true"}),o?l.jsxs("div",{className:Ue.fileInfo,children:[l.jsx(to,{size:24,className:Ue.fileIcon}),l.jsx("span",{className:Ue.fileName,children:o.name}),l.jsxs("span",{className:Ue.fileSize,children:["(",(o.size/1024).toFixed(1)," KB)"]})]}):l.jsxs("div",{className:Ue.dropHint,children:[l.jsx(Ui,{size:32,className:Ue.dropIcon}),l.jsx("p",{className:Ue.dropText,children:s.csvUpload.dropText}),l.jsx("p",{className:Ue.dropSubtext,children:s.csvUpload.dropSubtext})]})]}),l.jsx("button",{className:Ue.sampleLink,onClick:k,type:"button",children:s.csvUpload.downloadSample}),u!=="idle"&&l.jsxs("div",{className:`${Ue.statusBar} ${Ue[`status_${u}`]}`,role:"status","aria-live":"polite",children:[u==="processing"&&l.jsx("span",{className:Ue.spinner,"aria-hidden":"true"}),F[u],u==="done"&&h!==null&&l.jsx("span",{className:Ue.successDetail,children:s.csvUpload.itemsImportedSuffix.replace("{count}",String(h))})]}),f&&l.jsx("p",{className:Ue.errorMsg,role:"alert",children:f}),m.length>0&&l.jsxs("div",{className:Ue.failedSection,children:[l.jsx("h4",{className:Ue.failedTitle,children:s.csvUpload.failedRowsTitle.replace("{count}",String(m.length))}),l.jsx("div",{className:Ue.tableWrap,children:l.jsxs("table",{className:Ue.failedTable,children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:s.csvUpload.rowHeader}),l.jsx("th",{children:s.csvUpload.nameHeader}),l.jsx("th",{children:s.csvUpload.reasonHeader})]})}),l.jsx("tbody",{children:m.map((A,P)=>l.jsxs("tr",{children:[l.jsx("td",{children:A.rowNumber??P+1}),l.jsx("td",{children:A.name??"—"}),l.jsx("td",{className:Ue.reasonCell,children:A.reason??s.csvUpload.unknownError})]},P))})]})})]})]}),l.jsxs("div",{className:Ue.footer,children:[l.jsx(Re,{variant:"ghost",onClick:r,disabled:u==="uploading"||u==="processing",children:s.csvUpload.cancel}),l.jsx(Re,{variant:"primary",isLoading:u==="uploading"||u==="processing",disabled:!o||u==="done",onClick:N,children:u==="done"?s.csvUpload.uploaded:s.csvUpload.upload})]})]})};function Yl(){var v,y,b,S,x,w,T;const e=ie(),t=oe(D=>D.treeData),r=oe(D=>D.treeCache),n=oe(D=>D.deleteNode),s=rt(D=>D.activeAssessmentSlot),o=rt(D=>D.setActiveAssessmentSlot),a=rt(D=>D.openModal),i=((v=t[0])==null?void 0:v.children)??[],c=i[0],u=i.length>1?i[i.length-1]:void 0,d=nt(c),f=nt(u),p=t[0],m=p?((y=r[p.id])==null?void 0:y.policy)??((b=p.metadata)==null?void 0:b.policy):void 0,C=!!m&&Dh.has(m),h=D=>{const k=D==="pre"?c:u;if(!k)return;const N=D==="pre"&&C?e.learningPath.deletePriorAssessmentConfirm:e.learningPath.deleteAssessmentSlotConfirm;a("confirmDelete",{message:N,onConfirm:()=>n(k.id)})};return{pre:{level:c,filled:d,courseName:d?(x=(S=c==null?void 0:c.children)==null?void 0:S[0])==null?void 0:x.name:void 0,required:C},post:{level:u,filled:f,courseName:f?(T=(w=u==null?void 0:u.children)==null?void 0:w[0])==null?void 0:T.name:void 0,required:!1},activeAssessmentSlot:s,setActiveAssessmentSlot:o,deleteSlot:h}}const TD="_container_1ghxo_1",ED="_header_1ghxo_8",AD="_sectionLabel_1ghxo_18",kD="_headerActions_1ghxo_26",ID="_iconBtn_1ghxo_33",LD="_menuWrap_1ghxo_51",DD="_dropdownMenu_1ghxo_55",jD="_treeWrapper_1ghxo_87",ND="_csvModal_1ghxo_103",OD="_footer_1ghxo_113",rr={container:TD,header:ED,sectionLabel:AD,headerActions:kD,iconBtn:ID,menuWrap:LD,dropdownMenu:DD,treeWrapper:jD,csvModal:ND,footer:OD},PD=({editorMode:e,collapsed:t=!1,onToggleCollapse:r})=>{var Ae;const n=ie(),s=g.useRef(null),o=g.useRef(null),a=g.useRef(null),[i,c]=g.useState(400),[u,d]=g.useState(!1),[f,p]=g.useState(!1),[m,C]=g.useState("create"),{treeData:h,selectedNodeId:v,selectNode:y,addNode:b,deleteNode:S,getNodeById:x,reorderChildren:w,moveNode:T,setTreeData:D}=oe(),k=rt(J=>J.openModal),N=X(J=>J.editorProfile),F=N.key==="learningPath",A=e==="edit",P=Kl(),R=A&&P,O=F?n.learningPath.addLevelButton:n.outlineTree.addUnitButton,U=N.maxDepth>1,re=(((Ae=h[0])==null?void 0:Ae.children)??[]).some(J=>J.isFolder),{pre:W,post:pe,deleteSlot:ge}=Yl(),{level:G}=W,{level:le}=pe,te=X(J=>{var he,H,be,qe;return((H=(he=J.editorConfig)==null?void 0:he.context)==null?void 0:H.contentId)??((qe=(be=J.editorConfig)==null?void 0:be.context)==null?void 0:qe.identifier)??""}),xe=X(J=>{var H,be;const he=(be=(H=J.categoryMeta)==null?void 0:H.sourcingSettings)==null?void 0:be.collection;return(he==null?void 0:he.enableBulkUpload)!==!1}),ve=N.features.csvUpload&&xe;g.useEffect(()=>{const J=o.current;if(!J)return;const he=new ResizeObserver(()=>{c(J.clientHeight||400)});return he.observe(J),c(J.clientHeight||400),()=>he.disconnect()},[]),g.useEffect(()=>{if(!u)return;const J=he=>{var H;(H=a.current)!=null&&H.contains(he.target)||d(!1)};return document.addEventListener("mousedown",J),()=>document.removeEventListener("mousedown",J)},[u]);const q=g.useCallback(J=>{J.length>0&&y(J[0].data.id)},[y]),M=g.useCallback(({parentId:J,index:he,dragIds:H})=>{if(!J)return;const be=H[0],qe=cl(h,be);if(!qe)return;const et=qe.parent;if(et===J){const $e=cl(h,J);if(!($e!=null&&$e.children))return;const We=$e.children.findIndex(tt=>tt.id===be);if(We<0)return;w(J,We,he>We?he-1:he)}else T(be,et??"",J)},[h,w,T]),$=g.useCallback(({ids:J})=>{if(!F){for(const H of J)S(H);return}if(J.length===1){const H=J[0];if((G==null?void 0:G.id)===H){ge("pre");return}if((le==null?void 0:le.id)===H){ge("post");return}const be=x(H),qe=be!=null&&be.isFolder?n.learningPath.deleteLevelConfirm.replace("{name}",be.name):n.learningPath.deleteCourseConfirm;k("confirmDelete",{message:qe,onConfirm:()=>{S(H)||me.error(n.learningPath.cannotRemoveLastRegularCourseToast)}});return}const he=n.learningPath.deleteMultipleConfirm.replace("{count}",String(J.length));k("confirmDelete",{message:he,onConfirm:()=>{let H=!1;for(const be of J)S(be)||(H=!0);H&&me.error(n.learningPath.cannotRemoveLastRegularCourseToast)}})},[S,ge,F,G,le,x,k,n]),se=g.useCallback(({parentId:J})=>{var be;const he=J??((be=h[0])==null?void 0:be.id)??"";if(!he)return{id:crypto.randomUUID()};const H=b(he,"unit");return H?{id:H}:(me.error(n.outlineTree.maxDepthReachedToast),{id:crypto.randomUUID()})},[b,h,n]),ae=g.useCallback(()=>{var he;const J=(he=h[0])==null?void 0:he.id;J&&(b(J,"unit")||me.error(n.outlineTree.maxDepthReachedToast))},[h,b,n]),Se=g.useCallback(()=>{v&&(b(v,"subunit")||me.error(n.outlineTree.maxDepthReachedToast))},[v,b,n]),fe=g.useCallback(async()=>{if(d(!1),!!te)try{const J=await Lp(te),he=await fetch(J).then(qe=>qe.blob()),H=URL.createObjectURL(he),be=document.createElement("a");be.href=H,be.download=`${te}-folders.csv`,be.style.display="none",document.body.appendChild(be),be.click(),document.body.removeChild(be),URL.revokeObjectURL(H)}catch{me.error(n.outlineTree.downloadCsvFailedToast)}},[te,n]),ye=g.useCallback(async()=>{if(p(!1),!!te)try{const{rootNode:J}=await _h(te);D([J]),me.success(n.outlineTree.outlineRefreshedToast)}catch{me.error(n.outlineTree.outlineRefreshFailedToast)}},[te,D,n]);return l.jsxs("div",{className:rr.container,children:[l.jsxs("div",{className:rr.header,children:[F&&l.jsx("span",{className:rr.sectionLabel,children:n.learningPath.pathStructureLabel}),l.jsxs("div",{className:rr.headerActions,children:[A&&ve&&l.jsxs("div",{className:rr.menuWrap,ref:a,children:[l.jsx("button",{type:"button",className:rr.iconBtn,onClick:()=>d(J=>!J),"aria-label":n.outlineTree.moreOptionsAriaLabel,title:n.outlineTree.moreOptionsTitle,"aria-haspopup":"true","aria-expanded":u,children:l.jsx(Uf,{size:15})}),u&&l.jsxs("div",{className:rr.dropdownMenu,role:"menu",children:[l.jsx("button",{role:"menuitem",type:"button",disabled:re,title:re?n.outlineTree.foldersExistTitle:void 0,onClick:()=>{d(!1),C("create"),p(!0)},children:n.outlineTree.createFoldersCsvButton}),l.jsx("button",{role:"menuitem",type:"button",disabled:!re,title:re?void 0:n.outlineTree.noFoldersYetTitle,onClick:fe,children:n.outlineTree.downloadFoldersCsvButton}),l.jsx("button",{role:"menuitem",type:"button",disabled:!re,title:re?void 0:n.outlineTree.noFoldersYetTitle,onClick:()=>{d(!1),C("update"),p(!0)},children:n.outlineTree.updateFoldersCsvButton})]})]}),r&&l.jsx("button",{type:"button",className:rr.iconBtn,onClick:r,"aria-label":t?n.outlineTree.expandOutlineAriaLabel:n.outlineTree.collapseOutlineAriaLabel,title:t?n.outlineTree.expandOutlineAriaLabel:n.outlineTree.collapseOutlineAriaLabel,children:t?l.jsx(My,{size:15}):l.jsx(Fy,{size:15})})]})]}),l.jsx("div",{className:rr.treeWrapper,ref:o,children:l.jsx(gL,{ref:s,data:h,idAccessor:"id",childrenAccessor:"children",onSelect:q,onMove:A?M:void 0,onDelete:A?$:void 0,onCreate:A?se:void 0,disableEdit:!A,disableDrop:!A,selection:v??void 0,rowHeight:40,indent:20,paddingBottom:16,height:i,width:"100%",children:J=>l.jsx(BL,{...J,editorMode:e})})}),A&&l.jsxs("div",{className:rr.footer,children:[l.jsxs(Re,{variant:"ghost",size:"sm",onClick:ae,disabled:!R,children:[l.jsx(kr,{size:14})," ",O]}),U&&l.jsxs(Re,{variant:"ghost",size:"sm",onClick:Se,disabled:!R||!v,children:[l.jsx(zf,{size:14})," ",n.outlineTree.addSubunitButton]})]}),f&&l.jsx("div",{className:rr.csvModal,children:l.jsx(wD,{contentId:te,mode:m,onComplete:ye,onClose:()=>p(!1)})})]})};function cl(e,t){for(const r of e){if(r.id===t)return r;if(r.children){const n=cl(r.children,t);if(n)return n}}}const RD="_breadcrumb_zd1aj_1",FD="_crumb_zd1aj_10",MD="_sep_zd1aj_26",BD="_current_zd1aj_31",Cs={breadcrumb:RD,crumb:FD,sep:MD,current:BD},qD=({crumbs:e})=>{const t=oe(n=>n.selectNode),r=ie();return e.length?l.jsxs("nav",{className:Cs.breadcrumb,"aria-label":r.breadcrumb.nodePathAriaLabel,children:[l.jsx("button",{className:Cs.crumb,onClick:()=>t(e[0].id),"aria-label":r.breadcrumb.homeAriaLabel,children:l.jsx(Oy,{size:13})}),e.map((n,s)=>l.jsxs(g.Fragment,{children:[l.jsx(kl,{size:13,className:Cs.sep}),s<e.length-1?l.jsx("button",{className:Cs.crumb,onClick:()=>t(n.id),children:n.name}):l.jsx("span",{className:Cs.current,children:n.name})]},n.id))]}):null},$D="_tabBar_qhks1_1",UD="_tab_qhks1_1",zD="_active_qhks1_29",VD="_error_qhks1_35",HD="_errorDot_qhks1_39",Ss={tabBar:$D,tab:UD,active:zD,error:VD,errorDot:HD},QD=({activeTab:e,onChange:t,errorTabs:r=[],visibleTabs:n})=>{const s=ie(),o=[{id:"details",label:s.tabBar.detailsTab},{id:"audience",label:s.tabBar.audienceCurriculumTab},{id:"licensing",label:s.tabBar.licensingTab}],a=n?o.filter(i=>n.includes(i.id)):o;return l.jsx("div",{className:Ss.tabBar,role:"tablist","aria-label":s.tabBar.metadataSectionsAriaLabel,children:a.map(i=>l.jsxs("button",{role:"tab","aria-selected":e===i.id,"aria-controls":`panel-${i.id}`,className:[Ss.tab,e===i.id?Ss.active:"",r.includes(i.id)?Ss.error:""].join(" "),onClick:()=>t(i.id),children:[i.label,r.includes(i.id)&&l.jsx("span",{className:Ss.errorDot,"aria-label":s.tabBar.hasErrorsAriaLabel})]},i.id))})};var co=e=>e.type==="checkbox",rn=e=>e instanceof Date,yt=e=>e==null;const Dp=e=>typeof e=="object";var Ze=e=>!yt(e)&&!Array.isArray(e)&&Dp(e)&&!rn(e),ul=e=>Ze(e)&&e.target?co(e.target)?e.target.checked:e.target.value:e,jp=(e,t)=>t.split(".").some((r,n,s)=>!isNaN(Number(r))&&e.has(s.slice(0,n).join("."))),Np=e=>{const t=e.constructor&&e.constructor.prototype;return Ze(t)&&t.hasOwnProperty("isPrototypeOf")},Pa=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Xe(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(Pa&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(Ze(e)&&Np(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=Xe(e[s]));return n}const Fr={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},or={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},nr={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},hi="form",Op="root",Pp=["__proto__","constructor","prototype"];var uo=e=>/^\w*$/.test(e),Qe=e=>e===void 0,Ra=e=>e.split(/[.[\]'"]/g).filter(Boolean),Z=(e,t,r)=>{if(!t||!Ze(e))return r;const n=uo(t)?[t]:Ra(t);if(n.some(o=>Pp.includes(o)))return r;const s=n.reduce((o,a)=>yt(o)?void 0:o[a],e);return Qe(s)||s===e?Qe(e[t])?r:e[t]:s},zt=e=>typeof e=="boolean",kt=e=>typeof e=="function",Ve=(e,t,r)=>{let n=-1;const s=uo(t)?[t]:Ra(t),o=s.length,a=o-1;for(;++n<o;){const i=s[n];let c=r;if(n!==a){const u=e[i];c=Ze(u)||Array.isArray(u)?u:isNaN(+s[n+1])?{}:[]}if(Pp.includes(i))return;e[i]=c,e=e[i]}};const Zl=g.createContext(null);Zl.displayName="HookFormControlContext";const Xl=()=>g.useContext(Zl);var Rp=(e,t,r,n=!0)=>{const s={};for(const o in e)Object.defineProperty(s,o,{get:()=>{const a=o;return t._proxyFormState[a]!==or.all&&(t._proxyFormState[a]=!n||or.all),r&&(r[a]=!0),e[a]}});return s};const Jl=Pa?g.useLayoutEffect:g.useEffect;function WD(e){const t=Xl(),{control:r=t,disabled:n,name:s,exact:o}=e||{},[a,i]=g.useState(()=>({...r._formState,defaultValues:r._defaultValues})),c=g.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Jl(()=>r._subscribe({name:s,formState:c.current,exact:o,callback:u=>{!n&&i({...r._formState,...u,defaultValues:r._defaultValues})}}),[s,n,o]),g.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),g.useMemo(()=>Rp(a,r,c.current,!1),[a,r])}var It=e=>typeof e=="string",dl=(e,t,r,n,s)=>It(e)?(n&&t.watch.add(e),Z(r,e,s)):Array.isArray(e)?e.map(o=>(n&&t.watch.add(o),Z(r,o))):(n&&(t.watchAll=!0),r),fl=e=>yt(e)||!Dp(e);const dd=(e,t)=>t.length===0&&!Array.isArray(e)&&!Np(e);function Vt(e,t,r=new WeakMap){if(e===t)return!0;if(fl(e)||fl(t))return Object.is(e,t);if(rn(e)&&rn(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;if(dd(e,n)||dd(t,s))return Object.is(e,t);const o=r.get(e);if(o&&o.has(t))return!0;o?o.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(rn(i)&&rn(c)||(Ze(i)||Array.isArray(i))&&(Ze(c)||Array.isArray(c))?!Vt(i,c,r):!Object.is(i,c))return!1}}return!0}function GD(e){const t=Xl(),{control:r=t,name:n,defaultValue:s,disabled:o,exact:a,compute:i}=e||{},c=g.useRef(s),u=g.useRef(i),d=g.useRef(void 0),f=g.useRef(r),p=g.useRef(n);u.current=i;const[m,C]=g.useState(()=>{const x=r._getWatch(n,c.current);return u.current?u.current(x):x}),h=g.useCallback(x=>{const w=dl(n,r._names,x||r._formValues,!1,c.current);return u.current?u.current(w):w},[r._formValues,r._names,n]),v=g.useCallback(x=>{if(!o){const w=dl(n,r._names,x||r._formValues,!1,c.current);if(u.current){const T=u.current(w);Vt(T,d.current)||(C(T),d.current=T)}else C(w)}},[r._formValues,r._names,o,n]);Jl(()=>((f.current!==r||!Vt(p.current,n))&&(f.current=r,p.current=n,v()),r._subscribe({name:n,formState:{values:!0},exact:a,callback:x=>{v(x.values)}})),[r,a,n,v]),g.useEffect(()=>r._removeUnmounted());const y=f.current!==r,b=p.current,S=g.useMemo(()=>{if(o)return null;const x=!y&&!Vt(b,n);return y||x?h():null},[o,y,n,b,h]);return S!==null?S:m}function fo(e){const t=Xl(),{name:r,disabled:n,control:s=t,shouldUnregister:o,defaultValue:a,exact:i=!0}=e,c=jp(s._names.array,r),u=g.useMemo(()=>Z(s._formValues,r,Z(s._defaultValues,r,a)),[s,r,a]),d=GD({control:s,name:r,defaultValue:u,exact:i}),f=WD({control:s,name:r,exact:i}),p=g.useRef(e),m=g.useRef(null),C=g.useRef(s.register(r,{...e.rules,value:d,...zt(e.disabled)?{disabled:e.disabled}:{}}));p.current=e;const h=g.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Z(f.errors,r)},isDirty:{enumerable:!0,get:()=>!!Z(f.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!Z(f.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!Z(f.validatingFields,r)},error:{enumerable:!0,get:()=>Z(f.errors,r)}}),[f,r]),v=g.useCallback(x=>{const w=ul(x);return Z(s._fields,r)||(C.current=s.register(r,{...p.current.rules,value:w})),C.current.onChange({target:{value:ul(x),name:r},type:Fr.CHANGE})},[r,s]),y=g.useCallback(()=>C.current.onBlur({target:{value:Z(s._formValues,r),name:r},type:Fr.BLUR}),[r,s._formValues]),b=g.useCallback(x=>{x&&(m.current={focus:()=>kt(x.focus)&&x.focus(),select:()=>kt(x.select)&&x.select(),setCustomValidity:T=>kt(x.setCustomValidity)&&x.setCustomValidity(T),reportValidity:()=>kt(x.reportValidity)&&x.reportValidity()});const w=Z(s._fields,r);w&&w._f&&x&&(w._f.ref=m.current)},[s._fields,r]),S=g.useMemo(()=>({name:r,value:d,...zt(n)||f.disabled?{disabled:f.disabled||n}:{},onChange:v,onBlur:y,ref:b}),[r,n,f.disabled,v,y,b,d]);return g.useEffect(()=>{const x=s._options.shouldUnregister||o;s.register(r,{...p.current.rules,...zt(p.current.disabled)?{disabled:p.current.disabled}:{}});const w=(T,D)=>{const k=Z(s._fields,T);k&&k._f&&(k._f.mount=D)};if(w(r,!0),x){const T=Xe(Z(o?s._defaultValues:s._options.values||s._defaultValues,r,Z(s._options.defaultValues,r,p.current.defaultValue)));Ve(s._defaultValues,r,T),Qe(Z(s._formValues,r))&&Ve(s._formValues,r,T)}if(!c&&s.register(r),m.current){const T=Z(s._fields,r);T&&T._f&&(T._f.ref=m.current)}return()=>{(c?x&&!s._state.action:x)?s.unregister(r):w(r,!1)}},[r,s,c,o]),g.useEffect(()=>{s._setDisabledField({disabled:n,name:r})},[n,r,s]),g.useMemo(()=>({field:S,formState:f,fieldState:h}),[S,f,h])}const KD=e=>e.render(fo(e)),ec=g.createContext(null);ec.displayName="HookFormContext";const er=()=>g.useContext(ec),YD=({children:e,watch:t,getValues:r,getFieldState:n,setError:s,clearErrors:o,setValue:a,setValues:i,trigger:c,formState:u,resetField:d,reset:f,handleSubmit:p,unregister:m,control:C,register:h,setFocus:v,subscribe:y})=>{const b=g.useMemo(()=>({watch:t,getValues:r,getFieldState:n,setError:s,clearErrors:o,setValue:a,setValues:i,trigger:c,formState:u,resetField:d,reset:f,handleSubmit:p,unregister:m,control:C,register:h,setFocus:v,subscribe:y}),[o,C,u,n,r,p,h,f,d,s,v,a,i,y,c,m,t]);return g.createElement(ec.Provider,{value:b},g.createElement(Zl.Provider,{value:b.control},e))};var ZD=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},Fp=e=>Array.isArray(e)?e.filter(Boolean):[],Vo=e=>Array.isArray(e)?e:[e],fd=()=>{let e=[];return{get observers(){return e},next:s=>{for(const o of e)o.next&&o.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(o=>o!==s)}}),unsubscribe:()=>{e=[]}}};function Mp(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const s=e[n],o=t[n];if(s&&Ze(s)&&o){const a=Mp(s,o);Ze(a)&&(r[n]=a)}else e[n]&&(r[n]=o)}return r}var ht=e=>Ze(e)&&!Object.keys(e).length,tc=e=>e.type==="file",oa=e=>{if(!Pa)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Bp=e=>e.type==="select-multiple",rc=e=>e.type==="radio",XD=e=>rc(e)||co(e),pi=e=>oa(e)&&e.isConnected;function JD(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;){if(yt(e)){e=void 0;break}e=e[t[n]],n++}return e}function ej(e){for(const t in e)if(e.hasOwnProperty(t)&&!Qe(e[t]))return!1;return!0}function ot(e,t){if(It(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;const r=Array.isArray(t)?t:uo(t)?[t]:Ra(t),n=r.length===1?e:JD(e,r),s=r.length-1,o=r[s];return n&&delete n[o],s!==0&&(Ze(n)&&ht(n)||Array.isArray(n)&&ej(n))&&ot(e,r.slice(0,-1)),e}var tj=e=>{for(const t in e)if(kt(e[t]))return!0;return!1};function qp(e){return Array.isArray(e)||Ze(e)&&!tj(e)}function hl(e,t={}){for(const r in e){const n=e[r];qp(n)?(t[r]=Array.isArray(n)?[]:{},hl(n,t[r])):Qe(n)||(t[r]=!0)}return t}function pl(e){if(e!==!1){if(e===!0)return!0;if(Array.isArray(e)){const t=e.map(r=>pl(r));return t.some(r=>r!==void 0)?t:void 0}if(Ze(e)){const t={};for(const r in e){const n=pl(e[r]);Qe(n)||(t[r]=n)}return Object.keys(t).length?t:void 0}}}function Jr(e,t,r){r||(r=hl(t));for(const n in e){const s=e[n];if(qp(s))Qe(t)||fl(r[n])?r[n]=hl(s,Array.isArray(s)?[]:{}):Jr(s,yt(t)?{}:t[n],r[n]);else{const o=t[n];r[n]=!Vt(s,o)}}return pl(r)||{}}const hd={value:!1,isValid:!1},pd={value:!0,isValid:!0};var $p=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&&!Qe(e[0].attributes.value)?Qe(e[0].value)||e[0].value===""?pd:{value:e[0].value,isValid:!0}:pd:hd}return hd},Up=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Qe(e)?e:t?e===""?NaN:e&&+e:r&&It(e)?new Date(e):n?n(e):e;const md={isValid:!1,value:null};var zp=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,md):md;function gd(e){const t=e.ref;return tc(t)?t.files:rc(t)?zp(e.refs).value:Bp(t)?[...t.selectedOptions].map(({value:r})=>r):co(t)?$p(e.refs).value:Up(Qe(t.value)?e.ref.value:t.value,e)}var rj=(e,t,r,n)=>{const s={};for(const o of e){const a=Z(t,o);a&&Ve(s,o,a._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},aa=e=>e instanceof RegExp,xs=e=>Qe(e)?e:aa(e)?e.source:Ze(e)?aa(e.value)?e.value.source:e.value:e,vd=e=>({isOnSubmit:!e||e===or.onSubmit,isOnBlur:e===or.onBlur,isOnChange:e===or.onChange,isOnAll:e===or.all,isOnTouch:e===or.onTouched});const yd="AsyncFunction";var nj=e=>!!e&&!!e.validate&&!!(kt(e.validate)&&e.validate.constructor.name===yd||Ze(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===yd)),sj=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),mi=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(`${n}.`)));const js=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const o=Z(e,s);if(o){const{_f:a,...i}=o;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],s)&&!n)return!0;if(a.ref&&t(a.ref,a.name)&&!n)return!0;if(js(i,t))break}else if(Ze(i)&&js(i,t))break}}};function bd(e,t,r){const n=Z(e,r);if(n||uo(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const o=s.join("."),a=Z(t,o),i=Z(e,o);if(a&&!Array.isArray(a)&&r!==o)return{name:r};if(i&&i.type)return{name:o,error:i};if(i&&i.root&&i.root.type)return{name:`${o}.root`,error:i.root};s.pop()}return{name:r}}var oj=(e,t,r,n)=>{r(e);const{name:s,...o}=e;return ht(o)||n&&Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(a=>t[a]===(!n||or.all))},aj=(e,t,r)=>!e||!t||e===t||Vo(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),ij=(e,t,r,n,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:(r?n.isOnChange:s.isOnChange)?e:!0,lj=(e,t)=>!Fp(Z(e,t)).length&&ot(e,t),Cd=(e,t,r)=>{const n=Z(e,r),s=Array.isArray(n)?n:[];return Ve(s,Op,t[r]),Ve(e,r,s),e};function Sd(e,t,r="validate"){if(It(e)||Array.isArray(e)&&e.every(It)||zt(e)&&!e)return{type:r,message:It(e)?e:"",ref:t}}var Nn=e=>Ze(e)&&!aa(e)?e:{value:e,message:""},xd=async(e,t,r,n,s,o)=>{const{ref:a,refs:i,required:c,maxLength:u,minLength:d,min:f,max:p,pattern:m,validate:C,name:h,valueAsNumber:v,mount:y}=e._f,b=Z(r,h);if(!y||t.has(h))return{};const S=i?i[0]:a,x=P=>{if(s&&S.reportValidity){const R=zt(P)?"":P||"";i?i.forEach(O=>O.setCustomValidity(R)):S.setCustomValidity(R),S.reportValidity()}},w={},T=rc(a),D=co(a),k=T||D,N=(v||tc(a))&&Qe(a.value)&&Qe(b)||oa(a)&&a.value===""||b===""||Array.isArray(b)&&!b.length,F=ZD.bind(null,h,n,w),A=(P,R,O,U=nr.maxLength,re=nr.minLength)=>{const W=P?R:O;w[h]={type:P?U:re,message:W,ref:a,...F(P?U:re,W)}};if(o?!Array.isArray(b)||!b.length:c&&(!k&&(N||yt(b))||zt(b)&&!b||D&&!$p(i).isValid||T&&!zp(i).isValid)){const{value:P,message:R}=It(c)?{value:!!c,message:c}:Nn(c);if(P&&(w[h]={type:nr.required,message:R,ref:S,...F(nr.required,R)},!n))return x(R),w}if(!N&&(!yt(f)||!yt(p))){let P,R;const O=Nn(p),U=Nn(f);if(!yt(b)&&!isNaN(b)){const re=a.valueAsNumber||b&&+b;yt(O.value)||(P=re>O.value),yt(U.value)||(R=re<U.value)}else{const re=a.valueAsDate||new Date(b),W=G=>new Date(new Date().toDateString()+" "+G),pe=a.type=="time",ge=a.type=="week";It(O.value)&&b&&(P=pe?W(b)>W(O.value):ge?b>O.value:re>new Date(O.value)),It(U.value)&&b&&(R=pe?W(b)<W(U.value):ge?b<U.value:re<new Date(U.value))}if((P||R)&&(A(!!P,O.message,U.message,nr.max,nr.min),!n))return x(w[h].message),w}if((u||d)&&!N&&(It(b)||o&&Array.isArray(b))){const P=Nn(u),R=Nn(d),O=!yt(P.value)&&b.length>+P.value,U=!yt(R.value)&&b.length<+R.value;if((O||U)&&(A(O,P.message,R.message),!n))return x(w[h].message),w}if(m&&!N&&It(b)){const{value:P,message:R}=Nn(m);if(aa(P)&&!b.match(P)&&(w[h]={type:nr.pattern,message:R,ref:a,...F(nr.pattern,R)},!n))return x(R),w}if(C){if(kt(C)){const P=await C(b,r),R=Sd(P,S);if(R&&(w[h]={...R,...F(nr.validate,R.message)},!n))return x(R.message),w}else if(Ze(C)){let P={};for(const R in C){if(!ht(P)&&!n)break;const O=Sd(await C[R](b,r),S,R);O&&(P={...O,...F(R,O.message)},x(O.message),n&&(w[h]=P))}if(!ht(P)&&(w[h]={ref:S,...P},!n))return w}}return x(!0),w};const cj={mode:or.onSubmit,reValidateMode:or.onChange,shouldFocusError:!0},Vp={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function uj(e={}){let t={...cj,...e},r={...Xe(Vp),isLoading:kt(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},n={},s=Ze(t.defaultValues)||Ze(t.values)?Xe(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:Xe(s),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,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={...d};let p={...f};const m={array:fd(),state:fd()},C=t.criteriaMode===or.all,h=_=>E=>{clearTimeout(u),u=setTimeout(_,E)},v=async _=>{if(!a.keepIsValid&&!t.disabled&&(f.isValid||p.isValid||_)){let E;t.resolver?(E=ht((await F()).errors),y()):E=await R({fields:n,onlyCheckValid:!0,eventType:Fr.VALID}),E!==r.isValid&&m.state.next({isValid:E})}},y=(_,E)=>{!t.disabled&&(f.isValidating||f.validatingFields||p.isValidating||p.validatingFields)&&((_||Array.from(i.mount)).forEach(L=>{L&&(E?Ve(r.validatingFields,L,E):ot(r.validatingFields,L))}),m.state.next({validatingFields:r.validatingFields,isValidating:!ht(r.validatingFields)}))},b=()=>{r.dirtyFields=Jr(s,o)},S=(_,E=[],L,z,V=!0,Y=!0)=>{if(z&&L&&!t.disabled){if(a.action=!0,Y&&Array.isArray(Z(n,_))){const Q=L(Z(n,_),z.argA,z.argB);V&&Ve(n,_,Q)}if(Y&&Array.isArray(Z(r.errors,_))){const Q=L(Z(r.errors,_),z.argA,z.argB);V&&Ve(r.errors,_,Q),lj(r.errors,_)}if((f.touchedFields||p.touchedFields)&&Y&&Array.isArray(Z(r.touchedFields,_))){const Q=L(Z(r.touchedFields,_),z.argA,z.argB);V&&Ve(r.touchedFields,_,Q)}(f.dirtyFields||p.dirtyFields)&&b(),m.state.next({name:_,isDirty:U(_,E),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Ve(o,_,E)},x=(_,E)=>{Ve(r.errors,_,E),r.errors={...r.errors},m.state.next({errors:r.errors})},w=_=>{r.errors=_,m.state.next({errors:r.errors,isValid:!1})},T=_=>{const E=uo(_)?[_]:Ra(_);let L=o,z=s;for(let V=0;V<E.length-1;V++){const Y=E[V];if(L=yt(L)?L:L[Y],z=yt(z)?z:z[Y],L===null&&z!==null)return!0}return!1},D=(_,E,L,z)=>{const V=Z(n,_);if(V){if(T(_))return;const Y=Qe(Z(o,_)),Q=Z(o,_,Qe(L)?Z(s,_):L);Qe(Q)||z&&z.defaultChecked||E?Ve(o,_,E?Q:gd(V._f)):pe(_,Q),a.mount&&!a.action&&(v(),Y&&r.isDirty&&(f.isDirty||p.isDirty)&&(U()||(r.isDirty=!1,m.state.next({...r}))),e.shouldUnregister&&Y&&!Qe(Z(o,_))&&mi(_,i)&&(a.watch=!0))}},k=(_,E,L,z,V)=>{let Y=!1,Q=!1;const ce={name:_};if(!t.disabled){if(!L||z){(f.isDirty||p.isDirty)&&(Q=r.isDirty,r.isDirty=ce.isDirty=U(),Y=Q!==ce.isDirty);const ue=Vt(Z(s,_),E);Q=!!Z(r.dirtyFields,_),ue!==r.isDirty?r.dirtyFields=Jr(s,o):ue?ot(r.dirtyFields,_):Ve(r.dirtyFields,_,!0),ce.dirtyFields=r.dirtyFields,Y=Y||(f.dirtyFields||p.dirtyFields)&&Q!==!ue}if(L){const ue=Z(r.touchedFields,_);ue||(Ve(r.touchedFields,_,L),ce.touchedFields=r.touchedFields,Y=Y||(f.touchedFields||p.touchedFields)&&ue!==L)}Y&&V&&m.state.next(ce)}return Y?ce:{}},N=(_,E,L,z)=>{const V=Z(r.errors,_),Y=(f.isValid||p.isValid)&&zt(E)&&r.isValid!==E;if(t.delayError&&L?(c=h(()=>x(_,L)),c(t.delayError)):(clearTimeout(u),c=null,L?Ve(r.errors,_,L):ot(r.errors,_),r.errors={...r.errors}),(L?!Vt(V,L):V)||!ht(z)||Y){const Q={...z,...Y&&zt(E)?{isValid:E}:{},errors:r.errors,name:_};r={...r,...Q},m.state.next(Q)}},F=async _=>(y(_,!0),await t.resolver(o,t.context,rj(_||i.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),A=async _=>{const{errors:E}=await F(_);if(y(_),_){for(const L of _){const z=Z(E,L);z?i.array.has(L)&&Ze(z)&&!Object.keys(z).some(V=>!Number.isNaN(Number(V)))?Cd(r.errors,{[L]:z},L):Ve(r.errors,L,z):ot(r.errors,L)}r.errors={...r.errors}}else r.errors=E;return E},P=async({name:_,eventType:E})=>{if(e.validate){const L=await e.validate({formValues:o,formState:r,name:_,eventType:E});if(Ze(L))for(const z in L){const V=L[z];V&&ae(`${hi}.${z}`,{message:It(V.message)?V.message:"",type:V.type||nr.validate})}else It(L)||!L?ae(hi,{message:L||"",type:nr.validate}):se(hi);return L}return!0},R=async({fields:_,onlyCheckValid:E,name:L,eventType:z,context:V={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(V.runRootValidation=!0,!await P({name:L,eventType:z})&&(V.valid=!1,E)))return V.valid;for(const Y in _){const Q=_[Y];if(Q){const{_f:ce,...ue}=Q;if(ce){const Oe=i.array.has(ce.name),Ke=Q._f&&nj(Q._f),at=f.validatingFields||f.isValidating||p.validatingFields||p.isValidating;Ke&&at&&y([ce.name],!0);const Ht=await xd(Q,i.disabled,o,C,t.shouldUseNativeValidation&&!E,Oe);if(Ke&&at&&y([ce.name]),Ht[ce.name]&&(V.valid=!1,E)||(!E&&(Z(Ht,ce.name)?Oe?Cd(r.errors,Ht,ce.name):Ve(r.errors,ce.name,Ht[ce.name]):ot(r.errors,ce.name)),e.shouldUseNativeValidation&&Ht[ce.name]))break}!ht(ue)&&await R({context:V,onlyCheckValid:E,fields:ue,name:Y,eventType:z})}}return V.valid},O=()=>{for(const _ of i.unMount){const E=Z(n,_);E&&(E._f.refs?E._f.refs.every(L=>!pi(L)):!pi(E._f.ref))&&Ae(_)}i.unMount=new Set},U=(_,E)=>!t.disabled&&(_&&E&&Ve(o,_,E),!Vt(M(),s)),re=(_,E,L)=>dl(_,i,{...a.mount?o:Qe(E)?s:It(_)?{[_]:E}:E},L,E),W=_=>Fp(Z(a.mount?o:s,_,t.shouldUnregister?Z(s,_,[]):[])),pe=(_,E,L={},z=!1)=>{const V=Z(n,_);let Y=E;if(V){const Q=V._f;Q&&(!Q.disabled&&Ve(o,_,Up(E,Q)),Y=oa(Q.ref)&&yt(E)?"":E,Bp(Q.ref)?[...Q.ref.options].forEach(ce=>ce.selected=Y.includes(ce.value)):Q.refs?co(Q.ref)?Q.refs.forEach(ce=>{(!ce.defaultChecked||!ce.disabled)&&(Array.isArray(Y)?ce.checked=!!Y.find(ue=>ue===ce.value):ce.checked=Y===ce.value||!!Y)}):Q.refs.forEach(ce=>ce.checked=ce.value===Y):tc(Q.ref)?Q.ref.value="":(Q.ref.value=Y,Q.ref.type||m.state.next({name:_,values:z?o:Xe(o)})))}(L.shouldDirty||L.shouldTouch)&&k(_,Y,L.shouldTouch,L.shouldDirty,!0),L.shouldValidate&&q(_)},ge=(_,E,L,z=!1)=>{for(const V in E){if(!E.hasOwnProperty(V))return;const Y=E[V],Q=_+"."+V,ce=Z(n,Q);(i.array.has(_)||Ze(Y)||ce&&!ce._f)&&!rn(Y)?ge(Q,Y,L,z):pe(Q,Y,L,z)}},G=(_,E,L,z)=>{const V=Z(n,_),Y=i.array.has(_),Q=z?E:Xe(E),ce=Z(o,_),ue=Vt(ce,Q);if(ue||Ve(o,_,Q),Y)m.array.next({name:_,values:z?o:Xe(o)}),(f.isDirty||f.dirtyFields||p.isDirty||p.dirtyFields)&&L.shouldDirty&&(b(),m.state.next({name:_,dirtyFields:r.dirtyFields,isDirty:U(_,Q)}));else{const Oe=Array.isArray(Q)&&!Q.length||ht(Q);!V||V._f||yt(Q)||Oe?pe(_,Q,L,z):ge(_,Q,L,z)}if(!ue){const Oe=mi(_,i),Ke=z?o:Xe(o);m.state.next({...Oe&&r,name:a.mount||Oe?_:void 0,values:Ke})}},le=(_,E,L={})=>G(_,E,L,!1),te=(_,E={})=>{const L=kt(_)?_(o):_;if(!Vt(o,L)){o={...o,...L};for(const z of i.mount)G(z,Z(L,z),E,!0);m.state.next({...r,name:void 0,type:void 0,values:o}),E.shouldValidate&&v()}},xe=async _=>{a.mount=!0;const E=_.target;let L=E.name,z=!0;const V=Z(n,L),Y=ue=>{z=Number.isNaN(ue)||rn(ue)&&isNaN(ue.getTime())||Vt(ue,Z(o,L,ue))},Q=vd(t.mode),ce=vd(t.reValidateMode);if(V){let ue,Oe;const Ke=E.type?gd(V._f):ul(_),at=_.type===Fr.BLUR||_.type===Fr.FOCUS_OUT,Ht=!sj(V._f)&&!e.validate&&!t.resolver&&!Z(r.errors,L)&&!V._f.deps||ij(at,Z(r.touchedFields,L),r.isSubmitted,ce,Q),fs=mi(L,i,at);Ve(o,L,Ke),at?(!E||!E.readOnly)&&(V._f.onBlur&&V._f.onBlur(_),c&&c(0)):V._f.onChange&&V._f.onChange(_);const Zr=k(L,Ke,at),ut=!ht(Zr)||fs;if(!at&&m.state.next({name:L,type:_.type,values:Xe(o)}),Ht)return(f.isValid||p.isValid)&&(t.mode==="onBlur"?at&&v():at||v()),ut&&m.state.next({name:L,...fs?{}:Zr});if(!t.resolver&&e.validate&&await P({name:L,eventType:_.type}),!at&&fs&&m.state.next({...r}),t.resolver){const{errors:St}=await F([L]);if(y([L]),Y(Ke),!z){!ht(Zr)&&m.state.next(Zr);return}const Dt=bd(r.errors,n,L),tr=bd(St,n,Dt.name||L);ue=tr.error,L=tr.name,Oe=ht(St)}else y([L],!0),ue=(await xd(V,i.disabled,o,C,t.shouldUseNativeValidation))[L],y([L]),Y(Ke),z&&(ue?Oe=!1:(f.isValid||p.isValid)&&(Oe=await R({fields:n,onlyCheckValid:!0,name:L,eventType:_.type})));z&&(V._f.deps&&(!Array.isArray(V._f.deps)||V._f.deps.length>0)&&q(V._f.deps),N(L,Oe,ue,Zr))}},ve=(_,E)=>{if(Z(r.errors,E)&&_.focus)return _.focus(),1},q=async(_,E={})=>{let L,z;const V=Vo(_);if(t.resolver){const Y=await A(Qe(_)?_:V);L=ht(Y),z=_?!V.some(Q=>Z(Y,Q)):L}else _?(z=(await Promise.all(V.map(async Y=>{const Q=Z(n,Y);return await R({fields:Q&&Q._f?{[Y]:Q}:Q,eventType:Fr.TRIGGER})}))).every(Boolean),!(!z&&!r.isValid)&&v()):z=L=await R({fields:n,name:_,eventType:Fr.TRIGGER});return m.state.next({...!It(_)||(f.isValid||p.isValid)&&L!==r.isValid?{}:{name:_},...t.resolver||!_?{isValid:L}:{},errors:r.errors}),E.shouldFocus&&!z&&js(n,ve,_?V:i.mount),z},M=(_,E)=>{let L={...a.mount?o:s};return E&&(L=Mp(E.dirtyFields?r.dirtyFields:r.touchedFields,L)),Qe(_)?L:It(_)?Z(L,_):_.map(z=>Z(L,z))},$=(_,E)=>({invalid:!!Z((E||r).errors,_),isDirty:!!Z((E||r).dirtyFields,_),error:Z((E||r).errors,_),isValidating:!!Z(r.validatingFields,_),isTouched:!!Z((E||r).touchedFields,_)}),se=_=>{const E=_?Vo(_):void 0;E==null||E.forEach(L=>ot(r.errors,L)),E?E.forEach(L=>{m.state.next({name:L,errors:r.errors})}):m.state.next({errors:{}})},ae=(_,E,L)=>{const z=(Z(n,_,{_f:{}})._f||{}).ref,V=Z(r.errors,_)||{},{ref:Y,message:Q,type:ce,...ue}=V;Ve(r.errors,_,{...ue,...E,ref:z}),m.state.next({name:_,errors:r.errors,isValid:!1}),L&&L.shouldFocus&&z&&z.focus&&z.focus()},Se=(_,E)=>kt(_)?m.state.subscribe({next:L=>"values"in L&&_(L.values||re(void 0,E),L)}):re(_,E,!0),fe=_=>m.state.subscribe({next:E=>{if(aj(_.name,E.name,_.exact)&&oj(E,_.formState||f,Kr,_.reRenderRoot)){const L={...o};_.callback({values:L,...r,...E,defaultValues:s})}}}).unsubscribe,ye=_=>(a.mount=!0,p={...p,..._.formState},fe({..._,formState:{...d,..._.formState}})),Ae=(_,E={})=>{for(const L of _?Vo(_):i.mount)i.mount.delete(L),i.array.delete(L),E.keepValue||(ot(n,L),ot(o,L)),!E.keepError&&ot(r.errors,L),!E.keepDirty&&ot(r.dirtyFields,L),!E.keepTouched&&ot(r.touchedFields,L),!E.keepIsValidating&&ot(r.validatingFields,L),!t.shouldUnregister&&!E.keepDefaultValue&&ot(s,L);m.state.next({values:Xe(o)}),m.state.next({...r,...E.keepDirty?{isDirty:U()}:{}}),!E.keepIsValid&&v()},J=({disabled:_,name:E})=>{if(zt(_)&&a.mount||_||i.disabled.has(E)){const V=i.disabled.has(E)!==!!_;_?i.disabled.add(E):i.disabled.delete(E),V&&a.mount&&!a.action&&v()}},he=(_,E={})=>{let L=Z(n,_);const z=zt(E.disabled)||zt(t.disabled),V=!i.registerName.has(_)&&L&&L._f&&!L._f.mount;return Ve(n,_,{...L||{},_f:{...L&&L._f?L._f:{ref:{name:_}},name:_,mount:!0,...E}}),i.mount.add(_),L&&!V?J({disabled:zt(E.disabled)?E.disabled:t.disabled,name:_}):D(_,!0,E.value),{...z?{disabled:E.disabled||t.disabled}:{},...t.progressive?{required:!!E.required,min:xs(E.min),max:xs(E.max),minLength:xs(E.minLength),maxLength:xs(E.maxLength),pattern:xs(E.pattern)}:{},name:_,onChange:xe,onBlur:xe,ref:Y=>{if(Y){i.registerName.add(_),he(_,E),i.registerName.delete(_),L=Z(n,_);const Q=Qe(Y.value)&&Y.querySelectorAll&&Y.querySelectorAll("input,select,textarea")[0]||Y,ce=XD(Q),ue=L._f.refs||[];if(ce?ue.find(Oe=>Oe===Q):Q===L._f.ref)return;Ve(n,_,{_f:{...L._f,...ce?{refs:[...ue.filter(pi),Q,...Array.isArray(Z(s,_))?[{}]:[]],ref:{type:Q.type,name:_}}:{ref:Q}}}),D(_,!1,void 0,Q)}else L=Z(n,_,{}),L._f&&(L._f.mount=!1),(t.shouldUnregister||E.shouldUnregister)&&!(jp(i.array,_)&&a.action)&&i.unMount.add(_)}}},H=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&js(n,ve,i.mount),be=_=>{zt(_)&&(m.state.next({disabled:_}),js(n,(E,L)=>{const z=Z(n,L);z&&(E.disabled=z._f.disabled||_,Array.isArray(z._f.refs)&&z._f.refs.forEach(V=>{V.disabled=z._f.disabled||_}))},0,!1))},qe=(_,E)=>async L=>{let z;L&&(L.preventDefault&&L.preventDefault(),L.persist&&L.persist());let V=Xe(o);if(m.state.next({isSubmitting:!0}),t.resolver){const{errors:Y,values:Q}=await F();y(),r.errors=Y,V=Xe(Q)}else await R({fields:n,eventType:Fr.SUBMIT});if(i.disabled.size)for(const Y of i.disabled)ot(V,Y);if(ot(r.errors,Op),ht(r.errors)){m.state.next({errors:{}});try{await _(V,L)}catch(Y){z=Y}}else E&&await E({...r.errors},L),H(),setTimeout(H);if(m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ht(r.errors)&&!z,submitCount:r.submitCount+1,errors:r.errors}),z)throw z},et=(_,E={})=>{Z(n,_)&&(Qe(E.defaultValue)?le(_,Xe(Z(s,_))):(le(_,E.defaultValue),Ve(s,_,Xe(E.defaultValue))),E.keepTouched||ot(r.touchedFields,_),E.keepDirty||(ot(r.dirtyFields,_),r.isDirty=E.defaultValue?U(_,Xe(Z(s,_))):U()),E.keepError||(ot(r.errors,_),f.isValid&&v()),m.state.next({...r}))},$e=(_,E={})=>{const L=_?Xe(_):s,z=Xe(L),V=ht(_),Y=z;if(E.keepDefaultValues||(s=L),!E.keepValues){if(E.keepDirtyValues){const Q=new Set([...i.mount,...Object.keys(Jr(s,o))]);for(const ce of Array.from(Q)){const ue=Z(r.dirtyFields,ce),Oe=Z(o,ce),Ke=Z(Y,ce);ue&&!Qe(Oe)?Ve(Y,ce,Oe):!ue&&!Qe(Ke)&&le(ce,Ke)}}else{if(Pa&&Qe(_))for(const Q of i.mount){const ce=Z(n,Q);if(ce&&ce._f){const ue=Array.isArray(ce._f.refs)?ce._f.refs[0]:ce._f.ref;if(oa(ue)){const Oe=ue.closest("form");if(Oe){Oe.reset();break}}}}if(E.keepFieldsRef)for(const Q of i.mount)le(Q,Z(Y,Q));else n={}}if(t.shouldUnregister){if(o=E.keepDefaultValues?Xe(s):{},E.keepFieldsRef)for(const Q of i.mount)Ve(o,Q,Z(Y,Q))}else o=Xe(Y);m.array.next({values:{...Y}}),m.state.next({values:{...Y}})}i={mount:E.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||!!E.keepIsValid||!!E.keepDirtyValues||!t.shouldUnregister&&!ht(Y),a.watch=!!t.shouldUnregister,a.keepIsValid=!!E.keepIsValid,a.action=!1,E.keepErrors||(r.errors={}),m.state.next({submitCount:E.keepSubmitCount?r.submitCount:0,isDirty:V?!1:E.keepDirty?r.isDirty:E.keepValues?U():!!(E.keepDefaultValues&&!Vt(_,s)),isSubmitted:E.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:V?{}:E.keepDirtyValues?E.keepDefaultValues&&o?Jr(s,o):r.dirtyFields:E.keepDefaultValues&&_?Jr(s,_):E.keepDirty?r.dirtyFields:{},touchedFields:E.keepTouched?r.touchedFields:{},errors:E.keepErrors?r.errors:{},isSubmitSuccessful:E.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},We=(_,E)=>$e(kt(_)?_(o):_,{...t.resetOptions,...E}),tt=(_,E={})=>{const L=Z(n,_),z=L&&L._f;if(z){const V=z.refs?z.refs[0]:z.ref;V.focus&&setTimeout(()=>{V.focus(),E.shouldSelect&&kt(V.select)&&V.select()})}},Kr=_=>{r={...r,..._}},Yr={control:{register:he,unregister:Ae,getFieldState:$,handleSubmit:qe,setError:ae,_subscribe:fe,_runSchema:F,_updateIsValidating:y,_focusError:H,_getWatch:re,_getDirty:U,_setValid:v,_setFieldArray:S,_setDisabledField:J,_setErrors:w,_getFieldArray:W,_reset:$e,_resetDefaultValues:()=>kt(t.defaultValues)&&t.defaultValues().then(_=>{We(_,t.resetOptions),m.state.next({isLoading:!1})}),_removeUnmounted:O,_disableForm:be,_subjects:m,_proxyFormState:f,get _fields(){return n},get _formValues(){return o},get _state(){return a},set _state(_){a=_},get _defaultValues(){return s},get _names(){return i},set _names(_){i=_},get _formState(){return r},get _options(){return t},set _options(_){t={...t,..._}}},subscribe:ye,trigger:q,register:he,handleSubmit:qe,watch:Se,setValue:le,setValues:te,getValues:M,reset:We,resetField:et,resetDefaultValues:(_,E={})=>{if(s=Xe(_),!E.keepDirty){const L=Jr(s,o);r.dirtyFields=L,r.isDirty=!ht(L)}E.keepIsValid||v(),m.state.next({...r,defaultValues:s})},clearErrors:se,unregister:Ae,setError:ae,setFocus:tt,getFieldState:$};return{...Yr,formControl:Yr}}function dj(e={}){const t=g.useRef(void 0),r=g.useRef(void 0),n=g.useRef(e.formControl),[s,o]=g.useState(()=>({...Xe(Vp),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:s},e.defaultValues&&!kt(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:i,...c}=uj(e);t.current={...c,formState:s}}const a=t.current.control;return a._options=e,Jl(()=>{const i=a._subscribe({formState:a._proxyFormState,callback:()=>o({...a._formState,defaultValues:a._defaultValues}),reRenderRoot:!0});return o(c=>({...c,isReady:!0})),a._formState.isReady=!0,i},[a]),g.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),g.useEffect(()=>{e.mode&&(a._options.mode=e.mode),e.reValidateMode&&(a._options.reValidateMode=e.reValidateMode)},[a,e.mode,e.reValidateMode]),g.useEffect(()=>{e.errors&&(a._setErrors(e.errors),a._focusError())},[a,e.errors]),g.useEffect(()=>{e.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,e.shouldUnregister]),g.useEffect(()=>{if(a._proxyFormState.isDirty){const i=a._getDirty();i!==s.isDirty&&a._subjects.state.next({isDirty:i})}},[a,s.isDirty]),g.useEffect(()=>{var i;e.values&&!Vt(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,o(c=>({...c}))):a._resetDefaultValues()},[a,e.values]),g.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=g.useMemo(()=>Rp(s,a),[a,s]),t.current}function fj(e,t,r){const n=e??[],s=new Set(n.map(d=>d.type).filter(Boolean)),o=(t??[]).filter(d=>!s.has(d)),{data:a}=es({queryKey:["framework-search",o.sort().join(","),r],queryFn:()=>ET({type:o,systemDefault:"Yes"}),enabled:o.length>0,staleTime:600*1e3}),i=t&&t.length?n.filter(d=>d.type&&t.includes(d.type)):n,c=[...(a??[]).map(d=>({label:d.name,value:d.identifier})),...i.map(d=>({label:d.name,value:d.identifier}))],u=new Set;return c.filter(d=>u.has(d.value)?!1:(u.add(d.value),!0))}async function Hp(e){var r,n;return(n=(r=(await Fe.get(`/action/channel/v1/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.channel}function hj(e){var r,n,s,o,a,i,c;const t=es({queryKey:["channel",e],queryFn:()=>Hp(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:(s=t.data)==null?void 0:s.frameworks,collectionAdditionalCategories:(o=t.data)==null?void 0:o.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 pj(e){const{data:t}=es({queryKey:["user","read",e],enabled:!!e,staleTime:1/0,queryFn:()=>GT(e)});return t&&([t.firstName,t.lastName].filter(Boolean).join(" ").trim()||t.userName)||void 0}const Qp=[{label:"Strict",value:"strict"},{label:"Adaptive",value:"adaptive"},{label:"Prior learning",value:"priorLearning"}],mj={"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."}},gj=new Set(["review","read","sourcingreview","orgreview"]),wo={"First Section":"details","Second Section":"details","Third Section":"details","Organisation Framework Terms":"details","Target Framework Terms":"audience","Fourth Section":"licensing","Sixth Section":"licensing"},vj={Categorisation:"Second Section","Basic Information":"First Section","Licensing & Attribution":"Fourth Section",Curriculum:"Organisation Framework Terms","Target Audience":"Target Framework Terms"},yj={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"},ho={board:"board",boardIds:"board",medium:"medium",gradeLevel:"gradeLevel",subject:"subject",subjectIds:"subject",topicsIds:"topic",topic:"topic",targetBoardIds:"board",targetMediumIds:"medium",targetGradeLevelIds:"gradeLevel",targetSubjectIds:"subject"},nc=new Set(["targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds"]);function Wp(e,t,r,n,s={}){if(!(e!=null&&e.length))return _d(Fj(t,n,r,s),r,t,n,s);const o=new Map;for(const c of e){const u=c.code;u&&!o.has(u)&&o.set(u,c)}const a=new Set,i=e.filter(c=>{var d;if(n&&(c.code==="dialCode"||c.code==="dialcode")||((d=s.profile)==null?void 0:d.key)==="learningPath"&&nc.has(c.code)||c.visible===!1)return!1;const u=c.code;return a.has(u)?!1:(a.add(u),!0)}).map(c=>{const u=c.code??"",d=Tj(c),f=Ej(c,r,t,o,s),p=t[u],m=Cj(u,Gp(p,d),d,t,s),C={code:u,label:c.label??u,inputType:d,required:!!(c.required===!0||Array.isArray(c.validations)&&c.validations.some(h=>h.type==="required")),editable:bj(u,c.editable!==!1,s),placeholder:c.placeholder,maxLength:c.maxLength,options:_j(f,m,d,r),depends:c.depends,tab:wj(c),section:c.section,sourceCategory:c.sourceCategory,defaultValue:c.defaultValue??c.default,currentValue:m};if(u==="dialcodes"){const h=t.dialcodeRequired==="Yes";return{...C,required:h,visible:h}}return C});return _d(i,r,t,n,s)}function _d(e,t,r,n,s){var o;return((o=s.profile)==null?void 0:o.key)==="learningPath"?Rj(e,t,r,n):Pj(e,t,r,n)}function bj(e,t,r){var o;const n=r.editorMode??"edit";if(!gj.has(n))return t!==!1;const s=(o=r.editableFields)==null?void 0:o[n];return!!(s&&s.includes(e))}function Cj(e,t,r,n,s){const o=t==null||t===""||Array.isArray(t)&&t.length===0;switch(e){case"license":return o?s.defaultLicense??"":t;case"copyright":return o&&s.channelName?s.channelName:t;case"copyrightYear":return o?String(new Date().getFullYear()):t;case"author":case"creator":return o&&s.userFullName?s.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(!o)return t;const a=n.timeLimits,i=a==null?void 0:a[e];return i!=null&&i!==""?Sj(Number(i)):t}default:return t}}function Sj(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),s=o=>String(o).padStart(2,"0");return n>0?`${s(n)}:${s(r)}:${s(t)}`:`${s(r)}:${s(t)}`}function xj(e){var n,s,o;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(s=(n=e.organisationFramework)==null?void 0:n.categories)==null||s.forEach(a=>r(a.terms)),(o=e.targetFrameworks)==null||o.forEach(a=>{var i;return(i=a.categories)==null?void 0:i.forEach(c=>r(c.terms))}),t}function _j(e,t,r,n){if(r!=="select"&&r!=="multiselect"&&r!=="radio")return e;const s=Array.isArray(t)?t:t!=null&&t!==""?[t]:[];if(!s.length)return e;const o=e?[...e]:[],a=new Set(o.map(c=>c.value)),i=xj(n);for(const c of s){const u=String(c);a.has(u)||(o.push({label:i.get(u)??u,value:u}),a.add(u))}return o}function wj(e){const t=e.section;if(t){if(wo[t])return wo[t];const n=vj[t];if(n&&wo[n])return wo[n]}const r=e.code??"";return yj[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 Tj(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 Ej(e,t,r,n,s){var u;const o=e.code??"";if(((u=s.profile)==null?void 0:u.key)==="learningPath"&&o==="policy")return Qp;if(o==="maxQuestions"){const d=s.childCount??0;if(d>0)return Array.from({length:d},(f,p)=>({label:String(p+1),value:String(p+1)}))}const a=e.range;if(Array.isArray(a)&&a.length)return typeof a[0]=="string"?a.map(d=>({label:d,value:d})):a.map(d=>({label:d.name,value:d.identifier}));const i=e.enum;if(i!=null&&i.length)return i.map(d=>({label:d,value:d}));if(o==="framework")return t.orgFrameworks;if(o==="additionalCategories"){const f=(s.objectType??"")==="QuestionSet"?s.contentAdditionalCategories??s.collectionAdditionalCategories:s.collectionAdditionalCategories??s.contentAdditionalCategories,p=(f&&f.length?f:s.contextAdditionalCategories)??t.channelAdditionalCategories;return p!=null&&p.length?Lj(p).map(m=>({label:m,value:m})):void 0}const c=e.sourceCategory??ho[o];if(c)return Kp(o,c,e,t,r,n)}function Aj(e,t){return nc.has(e)||t.output==="identifier"||typeof t.section=="string"&&t.section.includes("Target")}function kj(e,t){return nc.has(e)||typeof t.section=="string"&&t.section.includes("Target")}function gi(e,t,r){var o,a,i,c,u;const n=(a=(o=e.organisationFramework)==null?void 0:o.categories)==null?void 0:a.find(d=>d.code===t),s=(u=(c=(i=e.targetFrameworks)==null?void 0:i[0])==null?void 0:c.categories)==null?void 0:u.find(d=>d.code===t);return r?(s==null?void 0:s.terms)??(n==null?void 0:n.terms)??[]:(n==null?void 0:n.terms)??(s==null?void 0:s.terms)??[]}function Ij(e){const t=new Set,r=[];for(const n of e){const s=n.identifier??n.name;s&&!t.has(s)&&(t.add(s),r.push(n))}return r}function Lj(e){return Array.from(new Set(e))}function Dj(e){return Array.isArray(e)?e:e!=null&&e!==""?[e]:[]}function Kp(e,t,r,n,s,o){const a=Aj(e,r),i=kj(e,r),c=h=>({label:h.name,value:a?h.identifier:h.name}),u=r.depends;if(!(u!=null&&u.length))return gi(n,t,i).map(c);const d=u.flatMap(h=>Dj(s[h])).map(String);if(!d.length)return[];const f=[];for(const h of u){const v=o.get(h),y=(v==null?void 0:v.sourceCategory)??ho[h]??h;f.push(...gi(n,y,i))}const m=f.filter(h=>d.includes(String(h.name))||d.includes(String(h.identifier))||d.includes(String(h.code))).flatMap(h=>h.associations??[]).filter(h=>String(h.category??"").toLowerCase()===t.toLowerCase()),C=Ij(m);return C.length?C.map(c):gi(n,t,i).map(c)}function _s(e,t){const r=ho[e];if(r)return Kp(e,r,{},t,{},new Map)}function Ge(e,t,r){return Gp(e[t],r)}const jj=["board","medium","gradeLevel","subject"];function Nj(e){var r;const t=((r=e.organisationFramework)==null?void 0:r.categories)??[];return t.length?t.some(n=>jj.includes(n.code)):!0}function Oj(e,t){var r,n,s;return!!((n=(r=e.organisationFramework)==null?void 0:r.categories)!=null&&n.some(o=>o.code===t)||(s=e.targetFrameworks)!=null&&s.some(o=>{var a;return(a=o.categories)==null?void 0:a.some(i=>i.code===t)}))}function Pj(e,t,r,n){var c;if(!n||Nj(t))return e;const s=e.filter(u=>{const d=u.sourceCategory??ho[u.code];return!d||Oj(t,d)}),o=new Set(s.map(u=>u.code)),a=[];for(const u of((c=t.organisationFramework)==null?void 0:c.categories)??[])o.has(u.code)||a.push({code:u.code,label:u.name,inputType:"multiselect",editable:!0,tab:"details",section:"Organisation Framework Terms",options:(u.terms??[]).map(d=>({label:d.name,value:d.name})),currentValue:Ge(r,u.code,"multiselect")});if(!a.length)return s;const i=s.findIndex(u=>u.code==="framework");return i>=0?[...s.slice(0,i+1),...a,...s.slice(i+1)]:[...s,...a]}const vi="Organisation Framework Terms";function Rj(e,t,r,n){var m,C;if(!n)return e;const s=[...((m=t.organisationFramework)==null?void 0:m.categories)??[]].sort((h,v)=>(h.index??1/0)-(v.index??1/0));if(!s.length)return e;const o=(C=Fh(s))==null?void 0:C.code,a=h=>h.sourceCategory??ho[h.code];let c=e.filter(h=>{const v=a(h);return v?v!==o&&s.some(y=>y.code===v):!0}).map(h=>a(h)?{...h,section:vi,required:!0,inputType:"select",currentValue:Ge(r,h.code,"select")}:h),u=c.findIndex(h=>h.code==="framework");if(u===-1){const h={code:"framework",label:"Curriculum",inputType:"select",required:!0,editable:!0,tab:"details",section:vi,options:t.orgFrameworks,currentValue:Ge(r,"framework","select")},v=c.findIndex(y=>!!a(y));u=v>=0?v:c.length,c=[...c.slice(0,u),h,...c.slice(u)]}if(!!!Ge(r,"framework","select"))return c.filter(h=>h.code==="framework"||!a(h));const f=new Set(c.map(h=>h.code)),p=s.filter(h=>h.code!==o&&!f.has(h.code)).map(h=>({code:h.code,label:h.name,inputType:"select",required:!0,editable:!0,tab:"details",section:vi,options:(h.terms??[]).map(v=>({label:v.name,value:v.name})),currentValue:Ge(r,h.code,"select")}));return p.length?[...c.slice(0,u+1),...p,...c.slice(u+1)]:c}function Fj(e,t,r,n={}){var o,a;const s=[{code:"name",label:"Title",inputType:"text",required:!0,editable:!0,tab:"details",section:"First Section",maxLength:200,currentValue:Ge(e,"name","text")},{code:"description",label:"Description",inputType:"textarea",editable:!0,tab:"details",section:"First Section",maxLength:2e3,currentValue:Ge(e,"description","textarea")},{code:"keywords",label:"Keywords",inputType:"chips",editable:!0,tab:"details",section:"First Section",currentValue:Ge(e,"keywords","chips")}];return t?((o=n.profile)==null?void 0:o.key)==="learningPath"?(s.push({code:"framework",label:"Curriculum",inputType:"select",required:!0,editable:!0,tab:"details",section:"Organisation Framework Terms",options:r.orgFrameworks,currentValue:Ge(e,"framework","select")},{code:"policy",label:"Consumption policy",inputType:"select",required:!0,editable:!0,tab:"details",section:"Consumption policy",options:Qp,currentValue:Ge(e,"policy","select")||"strict"}),s):(s.push({code:"primaryCategory",label:"Category",inputType:"select",editable:!1,tab:"details",section:"Second Section",currentValue:Ge(e,"primaryCategory","select")},{code:"additionalCategories",label:"Additional Category",inputType:"multiselect",editable:!0,tab:"details",section:"Second Section",currentValue:Ge(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:Ge(e,"framework","select")},{code:"subjectIds",label:"Subjects covered",inputType:"multiselect",required:!0,editable:!0,tab:"details",section:"Organisation Framework Terms",options:_s("subjectIds",r),currentValue:Ge(e,"subjectIds","multiselect")}),s.push({code:"audience",label:"Audience Type",inputType:"multiselect",editable:!0,tab:"audience",section:"Target Framework Terms",currentValue:Ge(e,"audience","multiselect")},{code:"targetBoardIds",label:"Board/Syllabus of the audience",inputType:"select",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",options:_s("targetBoardIds",r),currentValue:Ge(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:_s("targetMediumIds",r),currentValue:Ge(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:_s("targetGradeLevelIds",r),currentValue:Ge(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:_s("targetSubjectIds",r),currentValue:Ge(e,"targetSubjectIds","multiselect")}),s.push({code:"creator",label:"Author",inputType:"text",editable:!0,tab:"licensing",section:"Fourth Section",currentValue:Ge(e,"creator","text")},{code:"attributions",label:"Attributions",inputType:"text",editable:!0,tab:"licensing",section:"Fourth Section",currentValue:Ge(e,"attributions","text")},{code:"copyright",label:"Copyright",inputType:"text",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:Ge(e,"copyright","text")},{code:"copyrightYear",label:"Copyright Year",inputType:"text",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:Ge(e,"copyrightYear","text")},{code:"license",label:"License",inputType:"select",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:Ge(e,"license","select")}),s):s}const Mj=["allowECM","levels","setPeriod","instances"];function Yp(e){const t={};return e.forEach((r,n)=>{t[`L${n+1}`]={label:r}}),t}function Bj(e,t={}){const r={...e};for(const o of Mj)delete r[o];const n=e.levels;Array.isArray(n)&&n.length&&(r.outcomeDeclaration={levels:Yp(n)});const s=e.instances;return s!=null&&s!==""&&(r.instances={label:s}),t.isReview&&(r.name===void 0||r.name===null||r.name==="")&&t.nodeTitle&&(r.name=t.nodeTitle),r}function qj(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 $j(e,t){const{watch:r,setValue:n}=e,s=g.useRef(!1);g.useEffect(()=>{const o=r((a,{name:i})=>{var c;if(!(!i||s.current)){s.current=!0;try{const u=new Set([i]);let d=!0;for(;d;){d=!1;for(const f of t)u.has(f.code)||(c=f.depends)!=null&&c.some(p=>u.has(p))&&(n(f.code,f.inputType==="multiselect"||f.inputType==="chips"?[]:"",{shouldDirty:!0}),u.add(f.code),d=!0)}}finally{s.current=!1}}});return()=>o.unsubscribe()},[r,n,t])}const Uj="_section_ylgu8_1",zj="_header_ylgu8_11",Vj="_title_ylgu8_17",Hj="_description_ylgu8_24",Qj="_divider_ylgu8_30",Wj="_fields_ylgu8_36",On={section:Uj,header:zj,title:Vj,description:Hj,divider:Qj,fields:Wj},Gj=({title:e,description:t,children:r})=>l.jsxs("div",{className:On.section,children:[l.jsxs("div",{className:On.header,children:[l.jsx("h3",{className:On.title,children:e}),t&&l.jsx("p",{className:On.description,children:t})]}),l.jsx("hr",{className:On.divider}),l.jsx("div",{className:On.fields,children:r})]}),Kj="_field_1s288_1",Yj="_fullWidth_1s288_7",Zj="_label_1s288_11",Xj="_required_1s288_19",Jj="_input_1s288_24",eN="_textarea_1s288_45",tN="_inputError_1s288_50",rN="_error_1s288_54",nN="_selectBtn_1s288_59",sN="_selectOpen_1s288_83",oN="_placeholder_1s288_87",aN="_selectedVal_1s288_91",iN="_chevronUp_1s288_95",lN="_dropdown_1s288_100",cN="_option_1s288_116",uN="_optionSelected_1s288_134",dN="_noOpts_1s288_139",fN="_chipGroup_1s288_146",hN="_chipInput_1s288_158",pN="_addChipBtn_1s288_167",mN="_radioGroup_1s288_184",gN="_radioLabel_1s288_191",vN="_iconWrap_1s288_199",yN="_iconPreview_1s288_214",bN="_iconPlaceholder_1s288_220",CN="_removeIconBtn_1s288_233",SN="_tagChip_1s288_252",xN="_tagChipRemove_1s288_264",_N="_nestedSelectRow_1s288_278",wN="_dialcodeRow_1s288_287",TN="_validateBtn_1s288_293",EN="_dialcodeValid_1s288_315",AN="_dialcodeSpinner_1s288_325",B={field:Kj,fullWidth:Yj,label:Zj,required:Xj,input:Jj,textarea:eN,inputError:tN,error:rN,selectBtn:nN,selectOpen:sN,placeholder:oN,selectedVal:aN,chevronUp:iN,dropdown:lN,option:cN,optionSelected:uN,noOpts:dN,chipGroup:fN,chipInput:hN,addChipBtn:pN,radioGroup:mN,radioLabel:gN,iconWrap:vN,iconPreview:yN,iconPlaceholder:bN,removeIconBtn:CN,tagChip:SN,tagChipRemove:xN,nestedSelectRow:_N,dialcodeRow:wN,validateBtn:TN,dialcodeValid:EN,dialcodeSpinner:AN},wd=({name:e,label:t,required:r,disabled:n,multiline:s,maxLength:o,placeholder:a})=>{const i=ie(),{register:c,formState:{errors:u}}=er(),d=u[e],f={required:r?i.textField.requiredError.replace("{field}",t):!1,maxLength:o?{value:o,message:i.textField.maxLengthError.replace("{max}",String(o))}:void 0};return l.jsxs("div",{className:[B.field,s?B.fullWidth:""].join(" "),children:[l.jsxs("label",{className:B.label,htmlFor:e,children:[t,r&&l.jsx("span",{className:B.required,children:"*"})]}),s?l.jsx("textarea",{id:e,className:[B.input,B.textarea,d?B.inputError:""].join(" "),disabled:n,placeholder:a,rows:3,...c(e,f)}):l.jsx("input",{id:e,type:"text",className:[B.input,d?B.inputError:""].join(" "),disabled:n,placeholder:a,...c(e,f)}),d&&l.jsx("span",{className:B.error,children:String(d.message)})]})},kN=({name:e,label:t,options:r,required:n,disabled:s})=>{var v;const o=ie(),[a,i]=g.useState(!1),c=g.useRef(null),{register:u,watch:d,setValue:f,formState:{errors:p}}=er(),m=d(e),C=((v=r.find(y=>y.value===m))==null?void 0:v.label)??o.selectField.selectPlaceholder,h=p[e];return g.useEffect(()=>{if(!a)return;const y=b=>{var S;(S=c.current)!=null&&S.contains(b.target)||i(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[a]),l.jsxs("div",{className:B.field,ref:c,style:{position:"relative"},children:[l.jsxs("label",{className:B.label,children:[t,n&&l.jsx("span",{className:B.required,children:"*"})]}),l.jsx("input",{type:"hidden",...u(e,{required:n?o.selectField.requiredError.replace("{field}",t):!1})}),l.jsxs("button",{type:"button",disabled:s,className:[B.selectBtn,h?B.inputError:"",a?B.selectOpen:""].join(" "),onClick:()=>i(y=>!y),children:[l.jsx("span",{className:m?B.selectedVal:B.placeholder,children:C}),l.jsx(xn,{size:14,className:a?B.chevronUp:""})]}),a&&l.jsxs("div",{className:B.dropdown,children:[r.map(y=>l.jsxs("button",{type:"button",className:[B.option,m===y.value?B.optionSelected:""].join(" "),onClick:()=>{f(e,y.value,{shouldDirty:!0,shouldValidate:!0}),i(!1)},children:[l.jsx("span",{children:y.label}),m===y.value&&l.jsx(Sn,{size:13})]},y.value)),!r.length&&l.jsx("span",{className:B.noOpts,children:o.selectField.noOptionsMessage})]}),h&&l.jsx("span",{className:B.error,children:String(h.message)})]})},IN=({name:e,label:t,options:r,required:n,disabled:s})=>{const o=ie(),[a,i]=g.useState(!1),c=g.useRef(null),{register:u,watch:d,setValue:f,formState:{errors:p}}=er(),m=d(e)??[],C=p[e],h=m.length?`${m.length} ${o.multiSelectField.selectedCountSuffix}`:o.multiSelectField.selectPlaceholder;g.useEffect(()=>{if(!a)return;const y=b=>{var S;(S=c.current)!=null&&S.contains(b.target)||i(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[a]);const v=y=>{const b=m.includes(y)?m.filter(S=>S!==y):[...m,y];f(e,b,{shouldDirty:!0,shouldValidate:!0})};return l.jsxs("div",{className:B.field,ref:c,style:{position:"relative"},children:[l.jsxs("label",{className:B.label,children:[t,n&&l.jsx("span",{className:B.required,children:"*"})]}),l.jsx("input",{type:"hidden",...u(e,{required:n?o.multiSelectField.requiredError.replace("{field}",t):!1})}),l.jsxs("button",{type:"button",disabled:s,className:[B.selectBtn,C?B.inputError:"",a?B.selectOpen:""].join(" "),onClick:()=>i(y=>!y),children:[l.jsx("span",{className:m.length?B.selectedVal:B.placeholder,children:h}),l.jsx(xn,{size:14,className:a?B.chevronUp:""})]}),a&&l.jsxs("div",{className:B.dropdown,children:[r.map(y=>l.jsxs("button",{type:"button",className:[B.option,m.includes(y.value)?B.optionSelected:""].join(" "),onClick:()=>v(y.value),children:[l.jsx(Sn,{size:13,style:{opacity:m.includes(y.value)?1:0}}),l.jsx("span",{children:y.label})]},y.value)),!r.length&&l.jsx("span",{className:B.noOpts,children:o.multiSelectField.noOptionsMessage})]}),C&&l.jsx("span",{className:B.error,children:String(C.message)})]})},LN=({name:e,label:t,required:r,disabled:n,placeholder:s})=>{const o=ie(),a=s??o.chipGroupField.addPlaceholder,[i,c]=g.useState(""),[u,d]=g.useState(!1),f=g.useRef(null),{watch:p,setValue:m,formState:{errors:C}}=er(),h=p(e)??[],v=C[e],y=()=>{const S=i.trim();S&&!h.includes(S)&&m(e,[...h,S],{shouldDirty:!0}),c(""),d(!1)},b=S=>m(e,h.filter(x=>x!==S),{shouldDirty:!0});return l.jsxs("div",{className:[B.field,B.fullWidth].join(" "),children:[l.jsxs("label",{className:B.label,children:[t,r&&l.jsx("span",{className:B.required,children:"*"})]}),l.jsxs("div",{className:B.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:()=>b(S),"aria-label":`Remove ${S}`,children:"×"})]},S)),!n&&(u?l.jsx("input",{ref:f,autoFocus:!0,className:B.chipInput,value:i,onChange:S=>c(S.target.value),onKeyDown:S=>{S.key==="Enter"&&(S.preventDefault(),y()),S.key==="Escape"&&(c(""),d(!1))},onBlur:y,placeholder:a}):l.jsxs("button",{type:"button",className:B.addChipBtn,onClick:()=>{d(!0),setTimeout(()=>{var S;return(S=f.current)==null?void 0:S.focus()},50)},children:[l.jsx(kr,{size:12})," ",o.chipGroupField.addButtonLabel]}))]}),v&&l.jsx("span",{className:B.error,children:String(v.message)})]})},DN=({name:e,label:t,options:r,required:n,disabled:s})=>{const o=ie(),{register:a,formState:{errors:i}}=er(),c=i[e];return l.jsxs("div",{className:B.field,children:[l.jsxs("label",{className:B.label,children:[t,n&&l.jsx("span",{className:B.required,children:"*"})]}),l.jsx("div",{className:B.radioGroup,children:r.map(u=>l.jsxs("label",{className:B.radioLabel,children:[l.jsx("input",{type:"radio",value:u.value,disabled:s,...a(e,{required:n?o.radioField.requiredError.replace("{field}",t):!1})}),u.label]},u.value))}),c&&l.jsx("span",{className:B.error,children:String(c.message)})]})};async function jN(e,t,r,n){var a,i;const o=(i=(a=(await Fe.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(!o)throw new Error("Asset creation failed: no node_id returned");return o}async function NN(e,t){var s,o;const n=(o=(s=(await Fe.post(`/action/content/v3/upload/url/${e}`,{request:{content:{fileName:t}}})).data)==null?void 0:s.result)==null?void 0:o.pre_signed_url;if(!n)throw new Error("Pre-signed URL fetch failed");return n}async function ON(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 PN(e,t,r){var a,i;const n=new FormData;n.append("fileUrl",t),n.append("mimeType",r);const o=(i=(a=(await Fe.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(!o)throw new Error("Asset finalize failed: no content_url returned");return o}const RN="_overlay_ga6eh_1",FN="_modal_ga6eh_12",MN="_header_ga6eh_24",BN="_title_ga6eh_33",qN="_closeBtn_ga6eh_39",$N="_tabs_ga6eh_57",UN="_tab_ga6eh_57",zN="_activeTab_ga6eh_83",VN="_body_ga6eh_88",HN="_searchWrap_ga6eh_99",QN="_searchIcon_ga6eh_104",WN="_searchInput_ga6eh_113",GN="_grid_ga6eh_132",KN="_imgCell_ga6eh_148",YN="_imgCellSelected_ga6eh_166",ZN="_thumb_ga6eh_171",XN="_noThumb_ga6eh_177",JN="_checkBadge_ga6eh_183",eO="_loadMoreBtn_ga6eh_198",tO="_loadingRow_ga6eh_220",rO="_empty_ga6eh_230",nO="_spinner_ga6eh_237",sO="_uploadArea_ga6eh_247",oO="_dropZone_ga6eh_256",aO="_uploadIcon_ga6eh_277",iO="_dropText_ga6eh_281",lO="_dropSubtext_ga6eh_288",cO="_uploadPreview_ga6eh_294",uO="_hiddenInput_ga6eh_301",dO="_fileName_ga6eh_305",fO="_errorText_ga6eh_311",hO="_footer_ga6eh_318",pO="_cancelBtn_ga6eh_328",mO="_confirmBtn_ga6eh_345",Te={overlay:RN,modal:FN,header:MN,title:BN,closeBtn:qN,tabs:$N,tab:UN,activeTab:zN,body:VN,searchWrap:HN,searchIcon:QN,searchInput:WN,grid:GN,imgCell:KN,imgCellSelected:YN,thumb:ZN,noThumb:XN,checkBadge:JN,loadMoreBtn:eO,loadingRow:tO,empty:rO,spinner:nO,uploadArea:sO,dropZone:oO,uploadIcon:aO,dropText:iO,dropSubtext:lO,uploadPreview:cO,hiddenInput:uO,fileName:dO,errorText:fO,footer:hO,cancelBtn:pO,confirmBtn:mO},Td=18,Zp=({nodeId:e,currentValue:t,onSelect:r,onClose:n})=>{const s=ie(),[o,a]=g.useState("my"),[i,c]=g.useState(""),[u,d]=g.useState([]),[f,p]=g.useState(0),[m,C]=g.useState(!1),[h,v]=g.useState(null),[y,b]=g.useState(0),[S,x]=g.useState(null),[w,T]=g.useState(""),[D,k]=g.useState(!1),[N,F]=g.useState(""),A=g.useRef(null),P=X(q=>{var M,$;return(($=(M=q.editorConfig)==null?void 0:M.context)==null?void 0:$.channel)??""}),R=X(q=>{var M,$;return(($=(M=q.editorConfig)==null?void 0:M.context)==null?void 0:$.uid)??""}),O=X(q=>{var M,$,se;return((se=($=(M=q.editorConfig)==null?void 0:M.context)==null?void 0:$.cloudStorage)==null?void 0:se.presigned_headers)??{}}),U=X(q=>{var M,$,se;return((se=($=(M=q.editorConfig)==null?void 0:M.config)==null?void 0:$.assetConfig)==null?void 0:se.size)??1*1024*1024}),re=X(q=>{var M,$,se;return((se=($=(M=q.editorConfig)==null?void 0:M.config)==null?void 0:$.assetConfig)==null?void 0:se.accepted)??"image/png,image/jpeg"}),W=g.useCallback(async(q,M,$=!1)=>{var se;C(!0);try{const ae={status:["Live"],mediaType:["image"],mimeType:["image/png","image/jpeg","image/jpg","image/gif","image/svg+xml"]};o==="my"&&R&&(ae.createdBy=R),P&&(ae.channel=P);const fe=((se=(await Fe.post("/action/composite/v3/search",{request:{filters:ae,query:q,limit:Td,offset:M,sort_by:{createdOn:"desc"},fields:["identifier","name","appIcon","artifactUrl","downloadUrl"]}},{headers:{"X-Source":"web"}})).data)==null?void 0:se.result)??{},ye=fe.content??[];p(fe.count??0),d(Ae=>$?[...Ae,...ye]:ye)}catch{}finally{C(!1)}},[o,R,P]);g.useEffect(()=>{o!=="upload"&&(d([]),b(0),W(i,0))},[o]);const pe=g.useRef(),ge=q=>{c(q),clearTimeout(pe.current),pe.current=setTimeout(()=>{d([]),b(0),W(q,0)},400)},G=()=>{const q=y+Td;b(q),W(i,q,!0)},le=()=>{const q=(h==null?void 0:h.artifactUrl)??(h==null?void 0:h.appIcon)??(h==null?void 0:h.downloadUrl)??"";q&&r(q)};g.useEffect(()=>()=>{w&&URL.revokeObjectURL(w)},[w]);const te=q=>{var se;const M=(se=q.target.files)==null?void 0:se[0];if(q.target.value="",!M)return;const $=re.split(",").map(ae=>ae.trim());if(!$.includes(M.type)){const ae=$.map(Se=>Se.replace("image/","").toUpperCase()).join(", ");F(s.appIconPickerModal.invalidFileTypeError.replace("{types}",ae));return}if(M.size>U){const ae=(U/1048576).toFixed(0);F(s.appIconPickerModal.fileTooLargeError.replace("{size}",ae));return}w&&URL.revokeObjectURL(w),x(M),T(URL.createObjectURL(M)),F("")},xe=async()=>{if(S){k(!0),F("");try{const q=await jN(S.name.split(".").slice(0,-1).join(".")||S.name,S.type,R,P),M=await NN(q,S.name);await ON(M,S,O);const $=M.split("?")[0],se=await PN(q,$,S.type);r(se)}catch(q){F(q instanceof Error?q.message:s.appIconPickerModal.uploadFailedError)}finally{k(!1)}}},ve=u.length<f;return l.jsx("div",{className:Te.overlay,role:"dialog","aria-modal":"true","aria-label":s.appIconPickerModal.dialogAriaLabel,children:l.jsxs("div",{className:Te.modal,children:[l.jsxs("div",{className:Te.header,children:[l.jsx("span",{className:Te.title,children:s.appIconPickerModal.title}),l.jsx("button",{className:Te.closeBtn,onClick:n,"aria-label":s.appIconPickerModal.closeAriaLabel,children:l.jsx(lr,{size:18})})]}),l.jsxs("div",{className:Te.tabs,role:"tablist",children:[l.jsx("button",{role:"tab","aria-selected":o==="my",className:`${Te.tab} ${o==="my"?Te.activeTab:""}`,onClick:()=>a("my"),children:s.appIconPickerModal.myImagesTab}),l.jsx("button",{role:"tab","aria-selected":o==="all",className:`${Te.tab} ${o==="all"?Te.activeTab:""}`,onClick:()=>a("all"),children:s.appIconPickerModal.allImagesTab}),l.jsxs("button",{role:"tab","aria-selected":o==="upload",className:`${Te.tab} ${o==="upload"?Te.activeTab:""}`,onClick:()=>a("upload"),children:[l.jsx(Ui,{size:13,style:{marginRight:4}}),s.appIconPickerModal.uploadTab]})]}),l.jsx("div",{className:Te.body,children:o!=="upload"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:Te.searchWrap,children:[l.jsx(Jo,{size:14,className:Te.searchIcon}),l.jsx("input",{type:"search",className:Te.searchInput,placeholder:s.appIconPickerModal.searchPlaceholder,value:i,onChange:q=>ge(q.target.value)})]}),m&&u.length===0?l.jsxs("div",{className:Te.loadingRow,children:[l.jsx(Do,{size:20,className:Te.spinner}),l.jsx("span",{children:s.appIconPickerModal.loadingText})]}):u.length===0?l.jsx("div",{className:Te.empty,children:s.appIconPickerModal.noImagesFound}):l.jsx("div",{className:Te.grid,children:u.map(q=>{const M=q.appIcon??q.artifactUrl??q.downloadUrl??"",$=(h==null?void 0:h.identifier)===q.identifier;return l.jsxs("button",{type:"button",className:`${Te.imgCell} ${$?Te.imgCellSelected:""}`,onClick:()=>v(q),title:q.name,children:[M?l.jsx("img",{src:M,alt:q.name,className:Te.thumb}):l.jsx("div",{className:Te.noThumb,children:s.appIconPickerModal.noThumbnailText}),$&&l.jsx("div",{className:Te.checkBadge,children:l.jsx(Sn,{size:12})})]},q.identifier)})}),ve&&!m&&l.jsx("button",{className:Te.loadMoreBtn,onClick:G,children:s.appIconPickerModal.loadMoreButton}),m&&u.length>0&&l.jsx("div",{className:Te.loadingRow,children:l.jsx(Do,{size:16,className:Te.spinner})})]}):l.jsxs("div",{className:Te.uploadArea,children:[l.jsx("div",{className:Te.dropZone,onClick:()=>{var q;return(q=A.current)==null?void 0:q.click()},onDragOver:q=>q.preventDefault(),onDrop:q=>{q.preventDefault();const M=q.dataTransfer.files[0];M&&te({target:{files:[M],value:""}})},children:w?l.jsx("img",{src:w,alt:s.appIconPickerModal.previewAlt,className:Te.uploadPreview}):l.jsxs(l.Fragment,{children:[l.jsx(Ui,{size:32,className:Te.uploadIcon}),l.jsx("p",{className:Te.dropText,children:s.appIconPickerModal.dropZoneText}),l.jsx("p",{className:Te.dropSubtext,children:s.appIconPickerModal.acceptedTypesInfo.replace("{types}",re.split(",").map(q=>q.replace("image/","").toUpperCase()).join(", ")).replace("{size}",(U/(1024*1024)).toFixed(0))})]})}),l.jsx("input",{ref:A,type:"file",accept:re,className:Te.hiddenInput,onChange:te}),S&&l.jsx("p",{className:Te.fileName,children:S.name}),N&&l.jsx("p",{className:Te.errorText,children:N})]})}),l.jsxs("div",{className:Te.footer,children:[l.jsx("button",{className:Te.cancelBtn,onClick:n,children:s.appIconPickerModal.cancelButton}),o==="upload"?l.jsx("button",{className:Te.confirmBtn,disabled:!S||D,onClick:xe,children:D?l.jsxs(l.Fragment,{children:[l.jsx(Do,{size:14,className:Te.spinner})," ",s.appIconPickerModal.uploadingText]}):s.appIconPickerModal.uploadAndUseButton}):l.jsx("button",{className:Te.confirmBtn,disabled:!h,onClick:le,children:s.appIconPickerModal.useSelectedButton})]})]})})},gO=({name:e,label:t,nodeId:r,required:n,disabled:s})=>{const o=ie(),[a,i]=g.useState(!1),{watch:c,setValue:u,register:d,formState:{errors:f}}=er(),p=c(e),m=f[e],C=v=>{u(e,v,{shouldDirty:!0,shouldValidate:!0}),i(!1)},h=()=>{u(e,"",{shouldDirty:!0,shouldValidate:!0})};return l.jsxs("div",{className:B.field,children:[l.jsxs("label",{className:B.label,children:[t,n&&l.jsx("span",{className:B.required,children:"*"})]}),l.jsx("input",{type:"hidden",...d(e,{required:n?o.appIconField.requiredError.replace("{field}",t):!1})}),l.jsx("div",{className:B.iconWrap,role:"button",tabIndex:s?-1:0,"aria-label":o.appIconField.selectIconAriaLabel,onClick:()=>!s&&i(!0),onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&!s&&i(!0)},children:p?l.jsx("img",{src:p,alt:o.appIconField.iconAlt,className:B.iconPreview}):l.jsxs("div",{className:B.iconPlaceholder,children:[l.jsx(Hf,{size:20}),l.jsx("span",{children:o.appIconField.selectIconLabel})]})}),p&&!s&&l.jsxs("button",{type:"button",className:B.removeIconBtn,onClick:h,"aria-label":o.appIconField.removeIconAriaLabel,children:[l.jsx(ls,{size:13}),l.jsx("span",{children:o.appIconField.removeLabel})]}),m&&l.jsx("span",{className:B.error,children:String(m.message)}),a&&l.jsx(Zp,{nodeId:r,currentValue:p,onSelect:C,onClose:()=>i(!1)})]})},vO=({name:e,label:t,required:r,disabled:n})=>{const s=ie(),{control:o}=er(),{field:a,fieldState:{error:i}}=fo({name:e,control:o,rules:{required:r?s.dateTimeField.requiredError.replace("{field}",t):!1}});return l.jsxs("div",{className:B.field,children:[l.jsxs("label",{className:B.label,htmlFor:e,children:[t,r&&l.jsx("span",{className:B.required,children:"*"})]}),l.jsx("input",{id:e,type:"datetime-local",className:[B.input,i?B.inputError:""].join(" "),disabled:n,value:a.value??"",onChange:a.onChange,onBlur:a.onBlur,ref:a.ref}),i&&l.jsx("span",{className:B.error,children:String(i.message)})]})},yO=({name:e,label:t,required:r,disabled:n})=>{const s=ie(),{control:o}=er(),{field:a,fieldState:{error:i}}=fo({name:e,control:o,rules:{required:r?s.keywordSuggestField.requiredError.replace("{field}",t):!1},defaultValue:[]}),[c,u]=g.useState(""),d=g.useRef(null),f=a.value??[],p=v=>{const y=v.trim();!y||f.includes(y)||a.onChange([...f,y])},m=v=>{a.onChange(f.filter(y=>y!==v))},C=v=>{v.key==="Enter"||v.key===","?(v.preventDefault(),p(c),u("")):v.key==="Backspace"&&c===""&&f.length>0&&m(f[f.length-1])},h=()=>{c.trim()&&(p(c),u("")),a.onBlur()};return l.jsxs("div",{className:[B.field,B.fullWidth].join(" "),children:[l.jsxs("label",{className:B.label,children:[t,r&&l.jsx("span",{className:B.required,children:"*"})]}),l.jsxs("div",{className:[B.chipGroup,i?B.inputError:""].join(" "),onClick:()=>{var v;return!n&&((v=d.current)==null?void 0:v.focus())},style:{cursor:n?"not-allowed":"text"},children:[f.map(v=>l.jsxs("span",{className:B.tagChip,children:[v,!n&&l.jsx("button",{type:"button",className:B.tagChipRemove,onClick:y=>{y.stopPropagation(),m(v)},"aria-label":`Remove ${v}`,children:l.jsx(lr,{size:11})})]},v)),!n&&l.jsx("input",{ref:d,className:B.chipInput,value:c,onChange:v=>u(v.target.value),onKeyDown:C,onBlur:h,placeholder:f.length===0?s.keywordSuggestField.inputPlaceholder:"",style:{flexGrow:1,minWidth:120}})]}),i&&l.jsx("span",{className:B.error,children:String(i.message)})]})},bO=({name:e,label:t,levels:r,required:n,disabled:s})=>{const o=ie(),{control:a}=er(),{field:i,fieldState:{error:c}}=fo({name:e,control:a,rules:{required:n?o.nestedSelectField.requiredError.replace("{field}",t):!1},defaultValue:{}}),u=i.value??{},d=(f,p,m)=>{const C={};for(let h=0;h<p;h++)C[r[h].code]=u[r[h].code]??"";C[f]=m;for(let h=p+1;h<r.length;h++)C[r[h].code]="";i.onChange(C)};return l.jsxs("div",{className:[B.field,B.fullWidth].join(" "),children:[l.jsxs("label",{className:B.label,children:[t,n&&l.jsx("span",{className:B.required,children:"*"})]}),l.jsx("div",{className:B.nestedSelectRow,children:r.map((f,p)=>{const m=p>0&&!u[r[p-1].code];return l.jsxs("div",{className:B.field,style:{flex:1},children:[l.jsx("label",{className:B.label,htmlFor:`${e}_${f.code}`,children:f.label}),l.jsxs("select",{id:`${e}_${f.code}`,className:[B.input,c?B.inputError:""].join(" "),disabled:s||m,value:u[f.code]??"",onChange:C=>d(f.code,p,C.target.value),onBlur:i.onBlur,children:[l.jsx("option",{value:"",children:o.nestedSelectField.selectPlaceholder}),f.options.map(C=>l.jsx("option",{value:C.value,children:C.label},C.value))]})]},f.code)})}),c&&l.jsx("span",{className:B.error,children:String(c.message)})]})},Ed=[{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"}],CO=({name:e,label:t,required:r,disabled:n})=>{const s=ie(),[o,a]=g.useState(!1),i=g.useRef(null),{register:c,watch:u,setValue:d,formState:{errors:f}}=er(),p=u(e),m=Ed.find(v=>v.value===p),C=(m==null?void 0:m.label)??s.licenseSelectField.selectPlaceholder,h=f[e];return g.useEffect(()=>{if(!o)return;const v=y=>{var b;(b=i.current)!=null&&b.contains(y.target)||a(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[o]),l.jsxs("div",{className:B.field,ref:i,style:{position:"relative"},children:[l.jsxs("label",{className:B.label,children:[t,r&&l.jsx("span",{className:B.required,children:"*"})]}),l.jsx("input",{type:"hidden",...c(e,{required:r?s.licenseSelectField.requiredError.replace("{field}",t):!1})}),l.jsxs("button",{type:"button",disabled:n,className:[B.selectBtn,h?B.inputError:"",o?B.selectOpen:""].join(" "),onClick:()=>a(v=>!v),"aria-haspopup":"listbox","aria-expanded":o,children:[l.jsx("span",{className:p?B.selectedVal:B.placeholder,children:C}),l.jsx(xn,{size:14,className:o?B.chevronUp:""})]}),o&&l.jsx("div",{className:B.dropdown,role:"listbox",children:Ed.map(v=>l.jsxs("button",{type:"button",role:"option","aria-selected":p===v.value,className:[B.option,p===v.value?B.optionSelected:""].join(" "),onClick:()=>{d(e,v.value,{shouldDirty:!0,shouldValidate:!0}),a(!1)},children:[l.jsx("span",{children:v.label}),p===v.value&&l.jsx(Sn,{size:13})]},v.value))}),h&&l.jsx("span",{className:B.error,children:String(h.message)})]})},SO=({name:e,label:t,required:r,disabled:n})=>{const s=ie(),{control:o}=er(),{field:a,fieldState:{error:i}}=fo({name:e,control:o,rules:{required:r?s.dialcodeInputField.requiredError.replace("{field}",t):!1},defaultValue:""}),[c,u]=g.useState("idle"),[d,f]=g.useState(""),p=async()=>{const C=(a.value??"").trim();if(!C){u("invalid"),f(s.dialcodeInputField.enterCodeMessage);return}u("loading"),f("");try{const h=await _1(C),v=h==null?void 0:h.result,y=v==null?void 0:v.dialcodes;Array.isArray(y)&&y.length>0?(u("valid"),f(s.dialcodeInputField.validMessage)):(u("invalid"),f(s.dialcodeInputField.notFoundMessage))}catch{u("invalid"),f(s.dialcodeInputField.validationFailedMessage)}},m=()=>c==="loading"?l.jsx(Do,{size:16,className:B.dialcodeSpinner}):c==="valid"?l.jsx($f,{size:16,color:"var(--sbx-success, #2e7d32)"}):c==="invalid"?l.jsx(ky,{size:16,color:"var(--sbx-error)"}):null;return l.jsxs("div",{className:B.field,children:[l.jsxs("label",{className:B.label,htmlFor:e,children:[t,r&&l.jsx("span",{className:B.required,children:"*"})]}),l.jsxs("div",{className:B.dialcodeRow,children:[l.jsx("input",{id:e,type:"text",className:[B.input,i?B.inputError:""].join(" "),disabled:n,value:a.value??"",onChange:C=>{a.onChange(C),u("idle"),f("")},onBlur:a.onBlur,ref:a.ref,placeholder:s.dialcodeInputField.placeholderExample,style:{flex:1}}),l.jsx("button",{type:"button",className:B.validateBtn,onClick:p,disabled:n||c==="loading","aria-label":s.dialcodeInputField.validateAriaLabel,children:c==="loading"?s.dialcodeInputField.validatingLabel:s.dialcodeInputField.validateButtonLabel}),m()]}),i&&l.jsx("span",{className:B.error,children:String(i.message)}),!i&&d&&l.jsx("span",{className:c==="valid"?B.dialcodeValid:B.error,children:d})]})},xO="_cards_1j7eu_1",_O="_card_1j7eu_1",wO="_cardActive_1j7eu_30",TO="_cardIcon_1j7eu_35",EO="_cardIconPrimary_1j7eu_46",AO="_cardIconHover_1j7eu_50",kO="_radioDot_1j7eu_54",IO="_radioDotActive_1j7eu_65",LO="_cardTitle_1j7eu_70",DO="_cardTitleInk_1j7eu_76",jO="_cardDescription_1j7eu_80",NO="_cardDescriptionCharcoal_1j7eu_86",qt={cards:xO,card:_O,cardActive:wO,cardIcon:TO,cardIconPrimary:EO,cardIconHover:AO,radioDot:kO,radioDotActive:IO,cardTitle:LO,cardTitleInk:DO,cardDescription:jO,cardDescriptionCharcoal:NO},OO=({name:e,label:t,required:r,disabled:n})=>{const s=ie(),{control:o}=er(),a=[{value:"strict",Icon:Qf,iconVariant:qt.cardIconPrimary,title:s.learningPath.policyStrictLabel,titleVariant:"",description:l.jsx(l.Fragment,{children:s.learningPath.policyStrictDescription}),descriptionVariant:""},{value:"adaptive",Icon:Xy,iconVariant:qt.cardIconPrimary,title:s.learningPath.policyAdaptiveLabel,titleVariant:qt.cardTitleInk,description:l.jsxs(l.Fragment,{children:[s.learningPath.policyAdaptiveDescriptionPre,l.jsx("span",{className:B.required,children:"*"}),s.learningPath.policyAdaptiveDescriptionPost]}),descriptionVariant:qt.cardDescriptionCharcoal},{value:"priorLearning",Icon:Hy,iconVariant:qt.cardIconHover,title:s.learningPath.policyPriorLearningLabel,titleVariant:"",description:l.jsx(l.Fragment,{children:s.learningPath.policyPriorLearningDescription}),descriptionVariant:""}];return l.jsxs("div",{className:B.field,children:[l.jsxs("label",{className:B.label,children:[t,r&&l.jsx("span",{className:B.required,children:"*"})]}),l.jsx(KD,{name:e,control:o,rules:{required:r?s.selectField.requiredError.replace("{field}",t):!1},render:({field:i})=>l.jsx("div",{className:qt.cards,children:a.map(({value:c,Icon:u,iconVariant:d,title:f,titleVariant:p,description:m,descriptionVariant:C})=>{const h=i.value===c;return l.jsxs("button",{type:"button",disabled:n,className:[qt.card,h?qt.cardActive:""].join(" "),onClick:()=>i.onChange(c),children:[l.jsx("span",{className:[qt.cardIcon,d].join(" "),children:l.jsx(u,{size:16})}),l.jsx("span",{className:[qt.radioDot,h?qt.radioDotActive:""].join(" ")}),l.jsx("span",{className:[qt.cardTitle,p].join(" "),children:f}),l.jsx("span",{className:[qt.cardDescription,C].join(" "),children:m})]},c)})})})]})},PO="_form_lktqh_1",RO="_formLp_lktqh_7",FO="_ungrouped_lktqh_12",MO="_ungroupedLp_lktqh_23",BO="_fullWidthField_lktqh_27",qO="_noFields_lktqh_31",Pn={form:PO,formLp:RO,ungrouped:FO,ungroupedLp:MO,fullWidthField:BO,noFields:qO},$O=({nodeMetadata:e,activeTab:t,isRoot:r,isFolder:n,editorMode:s,onFormValueChange:o,onFormStatusChange:a})=>{var qe,et,$e,We,tt,Kr,wn,ds,Yr;const i=ie(),c=X(_=>_.editorConfig),u=X(_=>_.editorProfile),d=u.key==="learningPath",f=X(_=>_.rootFormConfig),p=X(_=>_.unitFormConfig),m=X(_=>_.categoryMeta),C=X(_=>_.contentFramework),h=X(_=>_.contentTargetFWIds),{organisationFramework:v,targetFrameworks:y,isLoading:b}=Ia(C??((qe=c==null?void 0:c.context)==null?void 0:qe.framework),h??((et=c==null?void 0:c.context)==null?void 0:et.targetFWIds)),{frameworks:S,collectionAdditionalCategories:x,contentAdditionalCategories:w,defaultLicense:T,name:D}=hj(($e=c==null?void 0:c.context)==null?void 0:$e.channel),k=pj(((We=c==null?void 0:c.context)==null?void 0:We.userId)??((tt=c==null?void 0:c.context)==null?void 0:tt.uid)),N=fj(S,(Kr=m==null?void 0:m.frameworkMetadata)==null?void 0:Kr.orgFWType,(wn=c==null?void 0:c.context)==null?void 0:wn.channel),F={organisationFramework:v,targetFrameworks:y,orgFrameworks:N,channelAdditionalCategories:x},A=oe(_=>_.selectedNodeId),P=oe(_=>_.treeData),R=oe(_=>_.treeCache),O=A?R[A]??{}:{},U={...e,...O},re=g.useMemo(()=>{var E;if(!A)return 0;const _=[...P];for(;_.length;){const L=_.shift();if(L.id===A)return((E=L.children)==null?void 0:E.length)??0;L.children&&_.push(...L.children)}return 0},[P,A]),W=(c==null?void 0:c.config)??{},pe=(c==null?void 0:c.context)??{},ge={editorMode:s,editableFields:W.editableFields,objectType:W.objectType,setDefaultCopyRight:W.setDefaultCopyRight===!0,defaultLicense:pe.defaultLicense??T,contextAdditionalCategories:pe.additionalCategories,userFullName:((ds=pe.user)==null?void 0:ds.fullName)??k,channelName:D,collectionAdditionalCategories:x,contentAdditionalCategories:w,childCount:re,profile:u},G=r?f:p,le=G||(((Yr=c==null?void 0:c.config.hierarchy)==null?void 0:Yr.formConfig)??[]),te=Wp(le,U,F,r,ge),xe=te.filter(_=>_.tab===t&&_.inputType!=="appIcon"&&_.visible!==!1),ve=dj({mode:"onChange",defaultValues:Object.fromEntries(te.map(_=>{const E=["multiselect","chips","keywords","tagsinput"],L=["nestedselect"];return E.includes(_.inputType)?[_.code,_.currentValue??_.defaultValue??[]]:L.includes(_.inputType)?[_.code,_.currentValue??_.defaultValue??{}]:[_.code,_.currentValue??_.defaultValue??""]}))});$j(ve,te);const{updateNode:q}=oe(),M=g.useRef(te);M.current=te;const $=g.useRef(A);$.current=A;const se=g.useRef(o);se.current=o;const ae=g.useRef(a);ae.current=a;const Se=g.useRef(typeof U.shuffle=="boolean"?U.shuffle:void 0),fe=g.useRef(U.name??"");fe.current=U.name??"";const ye=g.useRef(s);ye.current=s;const Ae=ur(),J=g.useRef(Ae==null?void 0:Ae.code);J.current=Ae==null?void 0:Ae.code;const he=["review","read","sourcingreview","orgreview"];g.useEffect(()=>{const _=$.current;if(_){const E=Object.fromEntries(M.current.filter(L=>L.currentValue!==void 0&&L.currentValue!==null).map(L=>[L.code,L.currentValue]));Object.keys(E).length>0&&q(_,E)}ve.trigger().then(()=>{const E=ve.formState.errors,L=M.current,z=Array.from(new Set(Object.keys(E).map(V=>{var Y;return(Y=L.find(Q=>Q.code===V))==null?void 0:Y.tab}).filter(Boolean)));ae.current(Object.keys(E).length===0,z)})},[]),g.useEffect(()=>{const _=ve.watch((E,{name:L})=>{const z=$.current;if(!z)return;const V=M.current,Y=new Set(V.map(ue=>ue.code));if(L&&Y.has(L)){let ue=ve.getValues(L);if(L==="dialcodes"&&(ue=Array.isArray(ue)?ue:ue?[ue]:[]),L==="shuffle"&&(ue===!0&&Se.current===!1&&me(i.sparkMetaForm.shuffleEnabledMessage,{icon:l.jsx(qn,{size:16})}),Se.current=ue),L==="framework"&&r&&typeof ue=="string"&&ue){const Ke=X.getState();if(Ke.setContentFramework(ue,Ke.contentTargetFWIds),d){const at=oe.getState().pruneCoursesByFramework(ue);at>0&&me(i.learningPath.coursesRemovedFrameworkChangeToast.replace("{count}",String(at)),{icon:l.jsx(qn,{size:16}),duration:5e3});const Ht=oe.getState().clearLevelSkills(J.current);Ht>0&&me(i.learningPath.levelSkillsResetFrameworkChangeToast.replace("{count}",String(Ht)),{icon:l.jsx(qn,{size:16}),duration:5e3})}}const Oe=qj(L,ue);Oe&&(q(z,Oe),se.current(Oe))}else if(!L){const ue=ve.getValues(),Oe=Object.fromEntries(Object.entries(ue).filter(([at])=>Y.has(at))),Ke=Bj(Oe,{isReview:he.includes(ye.current),nodeTitle:fe.current});Object.keys(Ke).length>0&&(q(z,Ke),se.current(Ke))}const Q=ve.formState.errors,ce=Array.from(new Set(Object.keys(Q).map(ue=>{var Oe;return(Oe=V.find(Ke=>Ke.code===ue))==null?void 0:Oe.tab}).filter(Boolean)));ae.current(Object.keys(Q).length===0,ce)});return()=>_.unsubscribe()},[ve]),g.useEffect(()=>{for(const _ of["author","creator","copyright","copyrightYear","license"]){const E=M.current.find(z=>z.code===_);if(!E||E.currentValue===void 0||E.currentValue===null||E.currentValue==="")continue;const L=ve.getValues(_);(L==null||L==="")&&ve.setValue(_,E.currentValue,{shouldDirty:!1})}},[k,D,ve]);const H=xe.reduce((_,E)=>{const L=_[_.length-1];return L&&L.section===E.section?L.fields.push(E):_.push({section:E.section,fields:[E]}),_},[]),be=_=>{const E={name:_.code,label:_.label,required:_.required,disabled:_.editable===!1};if(d&&_.code==="policy")return l.jsx("div",{className:Pn.fullWidthField,children:l.jsx(OO,{...E})},_.code);switch(_.inputType){case"textarea":return l.jsx(wd,{...E,multiline:!0,maxLength:_.maxLength},_.code);case"select":return l.jsx(kN,{...E,options:_.options??[]},_.code);case"multiselect":return l.jsx(IN,{...E,options:_.options??[]},_.code);case"chips":return l.jsx(LN,{...E},_.code);case"radio":return l.jsx(DN,{...E,options:_.options??[]},_.code);case"appIcon":return l.jsx(gO,{...E,nodeId:A??""},_.code);case"datepicker":case"datetime":return l.jsx(vO,{...E},_.code);case"keywords":case"tagsinput":return l.jsx(yO,{...E},_.code);case"nestedselect":return l.jsx(bO,{...E,levels:_.levels??[]},_.code);case"license":return l.jsx(CO,{...E},_.code);case"dialcode":return l.jsx(SO,{...E},_.code);default:return l.jsx(wd,{...E,maxLength:_.maxLength},_.code)}};return l.jsx(YD,{...ve,children:l.jsxs("div",{className:[Pn.form,d?Pn.formLp:""].filter(Boolean).join(" "),children:[H.map((_,E)=>{const L=_.section?mj[_.section]:void 0;return L?l.jsx(Gj,{title:L.title,description:L.description,children:_.fields.map(be)},_.section??E):l.jsx("div",{className:[Pn.ungrouped,d?Pn.ungroupedLp:""].filter(Boolean).join(" "),children:_.fields.map(be)},E)}),xe.length===0&&!b&&l.jsx("p",{className:Pn.noFields,children:i.sparkMetaForm.noFieldsMessage})]})})};function Xp(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function UO(e,t){return e.reduce((r,n,s)=>{const o=t.get(n);return o&&(r[s]=o),r},Array(e.length))}function To(e){return e!==null&&e>=0}function zO(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 VO(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Jp=e=>{let{rects:t,activeIndex:r,overIndex:n,index:s}=e;const o=Xp(t,n,r),a=t[s],i=o[s];return!i||!a?null:{x:i.left-a.left,y:i.top-a.top,scaleX:i.width/a.width,scaleY:i.height/a.height}},Eo={scaleX:1,scaleY:1},Ad=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:s,rects:o,overIndex:a}=e;const i=(t=o[r])!=null?t:n;if(!i)return null;if(s===r){const u=o[a];return u?{x:0,y:r<a?u.top+u.height-(i.top+i.height):u.top-i.top,...Eo}:null}const c=HO(o,s,r);return s>r&&s<=a?{x:0,y:-i.height-c,...Eo}:s<r&&s>=a?{x:0,y:i.height+c,...Eo}:{x:0,y:0,...Eo}};function HO(e,t,r){const n=e[t],s=e[t-1],o=e[t+1];return n?r<t?s?n.top-(s.top+s.height):o?o.top-(n.top+n.height):0:o?o.top-(n.top+n.height):s?n.top-(s.top+s.height):0:0}const em="Sortable",tm=g.createContext({activeIndex:-1,containerId:em,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Jp,disabled:{draggable:!1,droppable:!1}});function kd(e){let{children:t,id:r,items:n,strategy:s=Jp,disabled:o=!1}=e;const{active:a,dragOverlay:i,droppableRects:c,over:u,measureDroppableContainers:d}=Bf(),f=Js(em,r),p=i.rect!==null,m=g.useMemo(()=>n.map(T=>typeof T=="object"&&"id"in T?T.id:T),[n]),C=a!=null,h=a?m.indexOf(a.id):-1,v=u?m.indexOf(u.id):-1,y=g.useRef(m),b=!zO(m,y.current),S=v!==-1&&h===-1||b,x=VO(o);ar(()=>{b&&C&&d(m)},[b,m,C,d]),g.useEffect(()=>{y.current=m},[m]);const w=g.useMemo(()=>({activeIndex:h,containerId:f,disabled:x,disableTransforms:S,items:m,overIndex:v,useDragOverlay:p,sortedRects:UO(m,c),strategy:s}),[h,f,x.draggable,x.droppable,S,m,v,c,p,s]);return g.createElement(tm.Provider,{value:w},t)}const QO=e=>{let{id:t,items:r,activeIndex:n,overIndex:s}=e;return Xp(r,n,s).indexOf(t)},WO=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:s,items:o,newIndex:a,previousItems:i,previousContainerId:c,transition:u}=e;return!u||!n||i!==o&&s===a?!1:r?!0:a!==s&&t===c},GO={duration:200,easing:"ease"},rm="transform",KO=Ar.Transition.toString({property:rm,duration:0,easing:"linear"}),YO={roleDescription:"sortable"};function ZO(e){let{disabled:t,index:r,node:n,rect:s}=e;const[o,a]=g.useState(null),i=g.useRef(r);return ar(()=>{if(!t&&r!==i.current&&n.current){const c=s.current;if(c){const u=is(n.current,{ignoreTransform:!0}),d={x:c.left-u.left,y:c.top-u.top,scaleX:c.width/u.width,scaleY:c.height/u.height};(d.x||d.y)&&a(d)}}r!==i.current&&(i.current=r)},[t,r,n,s]),g.useEffect(()=>{o&&a(null)},[o]),o}function nm(e){let{animateLayoutChanges:t=WO,attributes:r,disabled:n,data:s,getNewIndex:o=QO,id:a,strategy:i,resizeObserverConfig:c,transition:u=GO}=e;const{items:d,containerId:f,activeIndex:p,disabled:m,disableTransforms:C,sortedRects:h,overIndex:v,useDragOverlay:y,strategy:b}=g.useContext(tm),S=XO(n,m),x=d.indexOf(a),w=g.useMemo(()=>({sortable:{containerId:f,index:x,items:d},...s}),[f,s,x,d]),T=g.useMemo(()=>d.slice(d.indexOf(a)),[d,a]),{rect:D,node:k,isOver:N,setNodeRef:F}=ay({id:a,data:w,disabled:S.droppable,resizeObserverConfig:{updateMeasurementsFor:T,...c}}),{active:A,activatorEvent:P,activeNodeRect:R,attributes:O,setNodeRef:U,listeners:re,isDragging:W,over:pe,setActivatorNodeRef:ge,transform:G}=Mf({id:a,data:w,attributes:{...YO,...r},disabled:S.draggable}),le=Qg(F,U),te=!!A,xe=te&&!C&&To(p)&&To(v),ve=!y&&W,q=ve&&xe?G:null,$=xe?q??(i??b)({rects:h,activeNodeRect:R,activeIndex:p,overIndex:v,index:x}):null,se=To(p)&&To(v)?o({id:a,items:d,activeIndex:p,overIndex:v}):x,ae=A==null?void 0:A.id,Se=g.useRef({activeId:ae,items:d,newIndex:se,containerId:f}),fe=d!==Se.current.items,ye=t({active:A,containerId:f,isDragging:W,isSorting:te,id:a,index:x,items:d,newIndex:Se.current.newIndex,previousItems:Se.current.items,previousContainerId:Se.current.containerId,transition:u,wasDragging:Se.current.activeId!=null}),Ae=ZO({disabled:!ye,index:x,node:k,rect:D});return g.useEffect(()=>{te&&Se.current.newIndex!==se&&(Se.current.newIndex=se),f!==Se.current.containerId&&(Se.current.containerId=f),d!==Se.current.items&&(Se.current.items=d)},[te,se,f,d]),g.useEffect(()=>{if(ae===Se.current.activeId)return;if(ae&&!Se.current.activeId){Se.current.activeId=ae;return}const he=setTimeout(()=>{Se.current.activeId=ae},50);return()=>clearTimeout(he)},[ae]),{active:A,activeIndex:p,attributes:O,data:w,rect:D,index:x,newIndex:se,items:d,isOver:N,isSorting:te,isDragging:W,listeners:re,node:k,overIndex:v,over:pe,setNodeRef:le,setActivatorNodeRef:ge,setDroppableNodeRef:F,setDraggableNodeRef:U,transform:Ae??$,transition:J()};function J(){if(Ae||fe&&Se.current.newIndex===x)return KO;if(!(ve&&!pa(P)||!u)&&(te||ye))return Ar.Transition.toString({...u,property:rm})}}function XO(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 ia(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 JO=[je.Down,je.Right,je.Up,je.Left],eP=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:s,droppableContainers:o,over:a,scrollableAncestors:i}}=t;if(JO.includes(e.code)){if(e.preventDefault(),!r||!n)return;const c=[];o.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const p=s.get(f.id);if(p)switch(e.code){case je.Down:n.top<p.top&&c.push(f);break;case je.Up:n.top>p.top&&c.push(f);break;case je.Left:n.left>p.left&&c.push(f);break;case je.Right:n.left<p.left&&c.push(f);break}});const u=lv({collisionRect:n,droppableRects:s,droppableContainers:c});let d=xf(u,"id");if(d===(a==null?void 0:a.id)&&u.length>1&&(d=u[1].id),d!=null){const f=o.get(r.id),p=o.get(d),m=p?s.get(p.id):null,C=p==null?void 0:p.node.current;if(C&&m&&f&&p){const v=ma(C).some((T,D)=>i[D]!==T),y=sm(f,p),b=tP(f,p),S=v||!y?{x:0,y:0}:{x:b?n.width-m.width:0,y:b?n.height-m.height:0},x={x:m.left,y:m.top};return S.x&&S.y?x:Fs(x,S)}}}};function sm(e,t){return!ia(e)||!ia(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function tP(e,t){return!ia(e)||!ia(t)||!sm(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const rP="_row_11nth_1",nP="_removeBtn_11nth_14",sP="_grip_11nth_17",oP="_ctIcon_11nth_34",aP="_info_11nth_38",iP="_name_11nth_46",lP="_meta_11nth_55",Xr={row:rP,removeBtn:nP,grip:sP,ctIcon:oP,info:aP,name:iP,meta:lP},cP={video:_a,pdf:to,h5p:Ca,scorm:xa,audio:Sa,quiz:ba,course:Cr,default:Gr},uP=({item:e,onRemove:t,isEditable:r})=>{const n=ie(),s=lo(e),o=cP[s.key]??Gr,{attributes:a,listeners:i,setNodeRef:c,transform:u,transition:d,isDragging:f}=nm({id:e.id,disabled:!r}),p={transform:Ar.Transform.toString(u),transition:d,opacity:f?.5:1};return l.jsxs("div",{ref:c,style:p,className:Xr.row,role:"listitem",children:[r&&l.jsx("span",{className:Xr.grip,...a,...i,"aria-label":n.contentRow.dragToReorderAriaLabel,children:l.jsx(Il,{size:15})}),l.jsx("span",{className:[`sbx-ct-sq--${s.key}`,Xr.ctIcon].join(" "),"aria-hidden":"true",children:l.jsx(o,{size:14})}),l.jsxs("div",{className:Xr.info,children:[l.jsx("span",{className:Xr.name,title:e.name,children:e.name}),l.jsx("span",{className:Xr.meta,children:s.label})]}),l.jsx("span",{className:`sbx-ct-badge--${s.key}`,children:s.label}),r&&l.jsx("button",{type:"button",className:Xr.removeBtn,onClick:()=>t(e.id),"aria-label":n.contentRow.removeAriaLabel.replace("{name}",e.name),children:l.jsx(lr,{size:14})})]})},dP="_container_1assk_1",fP="_header_1assk_7",hP="_heading_1assk_13",pP="_count_1assk_21",mP="_list_1assk_30",gP="_emptyState_1assk_36",vP="_skillPicker_1assk_52",yP="_skillsCovered_1assk_52",bP="_chips_1assk_64",CP="_chip_1assk_64",SP="_skillWarning_1assk_80",xP="_selectedSkills_1assk_85",_P="_skillPill_1assk_91",wP="_skillPillFlagged_1assk_103",TP="_skillPillUncovered_1assk_107",EP="_skillPillRemove_1assk_112",AP="_skillSearchBox_1assk_127",kP="_skillSearchWrap_1assk_132",IP="_searchIcon_1assk_147",LP="_skillSearchInput_1assk_152",DP="_skillDropdown_1assk_165",jP="_skillOption_1assk_179",NP="_skillCheckbox_1assk_201",OP="_skillCheckboxChecked_1assk_213",PP="_skillDropdownEmpty_1assk_218",RP="_skillPickerNote_1assk_224",FP="_emptyHint_1assk_229",MP="_assessmentsCard_1assk_242",BP="_assessmentSlots_1assk_254",qP="_assessmentItemRow_1assk_260",$P="_assessmentItemIcon_1assk_271",UP="_assessmentItemInfo_1assk_283",zP="_assessmentItemTitle_1assk_290",VP="_assessmentItemMeta_1assk_299",HP="_coursesCard_1assk_304",QP="_coursesCardTitle_1assk_315",WP="_coursesCardDescription_1assk_322",GP="_coursesList_1assk_329",KP="_courseRow_1assk_335",YP="_courseDragHandle_1assk_345",ZP="_courseIcon_1assk_357",XP="_courseInfo_1assk_369",JP="_courseTitle_1assk_376",eR="_courseMeta_1assk_385",tR="_addRowIcon_1assk_390",rR="_assessmentItemBadge_1assk_402",nR="_menuWrap_1assk_413",sR="_menuBtn_1assk_418",oR="_dropmenu_1assk_431",aR="_dangerItem_1assk_461",iR="_addRow_1assk_390",lR="_addRowActive_1assk_485",cR="_addRowAssessment_1assk_491",uR="_addRowText_1assk_498",dR="_requiredBadge_1assk_503",K={container:dP,header:fP,heading:hP,count:pP,list:mP,emptyState:gP,skillPicker:vP,skillsCovered:yP,chips:bP,chip:CP,skillWarning:SP,selectedSkills:xP,skillPill:_P,skillPillFlagged:wP,skillPillUncovered:TP,skillPillRemove:EP,skillSearchBox:AP,skillSearchWrap:kP,searchIcon:IP,skillSearchInput:LP,skillDropdown:DP,skillOption:jP,skillCheckbox:NP,skillCheckboxChecked:OP,skillDropdownEmpty:PP,skillPickerNote:RP,emptyHint:FP,assessmentsCard:MP,assessmentSlots:BP,assessmentItemRow:qP,assessmentItemIcon:$P,assessmentItemInfo:UP,assessmentItemTitle:zP,assessmentItemMeta:VP,coursesCard:HP,coursesCardTitle:QP,coursesCardDescription:WP,coursesList:GP,courseRow:KP,courseDragHandle:YP,courseIcon:ZP,courseInfo:XP,courseTitle:JP,courseMeta:eR,addRowIcon:tR,assessmentItemBadge:rR,menuWrap:nR,menuBtn:sR,dropmenu:oR,dangerItem:aR,addRow:iR,addRowActive:lR,addRowAssessment:cR,addRowText:uR,requiredBadge:dR},fR=({options:e,selected:t,outOfScope:r,uncovered:n,onChange:s,isEditable:o,description:a})=>{const i=ie(),[c,u]=g.useState(""),[d,f]=g.useState(!1),p=g.useRef(null);g.useEffect(()=>{if(!d)return;const v=y=>{var b;(b=p.current)!=null&&b.contains(y.target)||f(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[d]);const m=c?e.filter(v=>v.toLowerCase().includes(c.toLowerCase())):e,C=v=>{o&&s(t.includes(v)?t.filter(y=>y!==v):[...t,v])},h=v=>{o&&s(t.filter(y=>y!==v))};return l.jsxs("div",{className:K.skillPicker,children:[l.jsxs("div",{className:K.header,children:[l.jsx("span",{className:K.heading,children:i.learningPath.skillsHeading}),l.jsx("span",{className:K.count,children:t.length})]}),l.jsx("span",{className:K.skillPickerNote,children:a}),r.length>0&&l.jsx("div",{className:K.skillWarning,role:"alert",children:i.learningPath.skillsOutOfScopeWarning.replace("{skills}",r.join(", "))}),n.length>0&&l.jsx("div",{className:K.skillWarning,role:"alert",children:i.learningPath.skillsUncoveredWarning.replace("{skills}",n.join(", "))}),t.length>0&&l.jsx("div",{className:K.selectedSkills,children:t.map(v=>{const y=r.includes(v),b=n.includes(v);return l.jsxs("span",{className:[K.skillPill,y?K.skillPillFlagged:"",b?K.skillPillUncovered:""].filter(Boolean).join(" "),title:b?i.learningPath.skillUncoveredPillTitle:void 0,children:[v,o&&l.jsx("button",{type:"button",className:K.skillPillRemove,onClick:()=>h(v),"aria-label":i.learningPath.removeSkillAriaLabel.replace("{skill}",v),children:l.jsx(lr,{size:11})})]},v)})}),o?l.jsxs("div",{className:K.skillSearchBox,ref:p,children:[l.jsxs("div",{className:K.skillSearchWrap,onClick:()=>f(!0),children:[l.jsx("input",{type:"search",className:K.skillSearchInput,placeholder:i.learningPath.searchSkillsPlaceholder,value:c,onChange:v=>u(v.target.value),onFocus:()=>f(!0),"aria-label":i.learningPath.searchSkillsPlaceholder}),l.jsx(Jo,{size:14,className:K.searchIcon})]}),d&&l.jsx("div",{className:K.skillDropdown,role:"listbox",children:e.length===0?l.jsx("div",{className:K.skillDropdownEmpty,children:i.learningPath.noSkillsAvailable}):m.length===0?l.jsx("div",{className:K.skillDropdownEmpty,children:i.learningPath.noMatchingSkills}):m.map(v=>{const y=t.includes(v);return l.jsxs("button",{type:"button",role:"option","aria-selected":y,className:K.skillOption,onClick:()=>C(v),children:[l.jsx("span",{className:[K.skillCheckbox,y?K.skillCheckboxChecked:""].join(" "),children:y&&l.jsx(Sn,{size:12})}),v]},v)})})]}):t.length===0&&l.jsx("span",{className:K.emptyHint,children:i.learningPath.noSkillsSelectedYet})]})},ml=({slot:e,isEditable:t})=>{const r=ie(),{pre:n,post:s,activeAssessmentSlot:o,setActiveAssessmentSlot:a,deleteSlot:i}=Yl(),c=oe(v=>v.selectNode),[u,d]=g.useState(!1),f=g.useRef(null),p=e==="pre"?n:s,m=e==="pre"?r.learningPath.priorAssessmentLabel:r.learningPath.outcomeAssessmentLabel;if(g.useEffect(()=>{if(!u)return;const v=y=>{var b;(b=f.current)!=null&&b.contains(y.target)||d(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[u]),!p.filled){const v=o===e;return l.jsxs("button",{type:"button",className:[K.addRow,K.addRowAssessment,v?K.addRowActive:""].filter(Boolean).join(" "),disabled:!t,onClick:()=>a(v?null:e),"aria-pressed":v,children:[l.jsx("span",{className:K.addRowIcon,children:l.jsx(kr,{size:16})}),l.jsx("span",{className:K.addRowText,children:r.learningPath.addAssessmentSlotButton.replace("{label}",m)}),p.required&&l.jsx("span",{className:K.requiredBadge,children:r.learningPath.requiredSlotBadge})]})}const C=e==="pre"?r.learningPath.skillCheckBadge:r.learningPath.outcomeCheckBadge,h=()=>p.level&&c(p.level.id);return l.jsxs("div",{className:K.assessmentItemRow,role:"button",tabIndex:0,onClick:h,onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),h())},children:[l.jsx("span",{className:K.assessmentItemIcon,children:l.jsx(Cr,{size:16})}),l.jsxs("div",{className:K.assessmentItemInfo,children:[l.jsx("span",{className:K.assessmentItemTitle,children:p.courseName||r.learningPath.courseNameUnavailable}),l.jsxs("span",{className:K.assessmentItemMeta,children:[m," · ",r.learningPath.assessmentCourseMeta]})]}),l.jsx("span",{className:K.assessmentItemBadge,children:C}),t&&l.jsxs("div",{className:K.menuWrap,ref:f,children:[l.jsx("button",{type:"button",className:K.menuBtn,onClick:v=>{v.stopPropagation(),d(y=>!y)},"aria-label":r.treeNode.nodeOptionsAriaLabel,children:"⋮"}),u&&l.jsxs("div",{className:K.dropmenu,onClick:v=>v.stopPropagation(),children:[l.jsxs("button",{type:"button",onClick:()=>{d(!1),p.level&&c(p.level.id)},children:[l.jsx(Dy,{size:12})," ",r.learningPath.viewCourseMenuItem]}),l.jsxs("button",{type:"button",className:K.dangerItem,onClick:()=>{d(!1),i(e)},children:[l.jsx(ls,{size:12})," ",r.treeNode.deleteMenuItem]})]})]})]})};function hR(e){var p,m;const t=ie(),r=oe(C=>C.treeData),n=oe(C=>C.deleteNode),s=rt(C=>C.activeLevelExamTarget),o=rt(C=>C.setActiveLevelExamTarget),a=rt(C=>C.openModal),i=(m=(p=r[0])==null?void 0:p.children)==null?void 0:m.find(C=>C.id===e),c=Eh(i),u=s===e,d=()=>{e&&o(u?null:e)},f=()=>{c&&a("confirmDelete",{message:t.learningPath.deleteLevelExamConfirm,onConfirm:()=>n(c.id)})};return{course:c,filled:!!c,courseName:c==null?void 0:c.name,isActiveTarget:u,armExam:d,deleteExam:f}}const pR=({levelId:e,isEditable:t})=>{const r=ie(),{filled:n,courseName:s,isActiveTarget:o,armExam:a,deleteExam:i}=hR(e);return n?l.jsxs("div",{className:K.assessmentItemRow,children:[l.jsx("span",{className:K.assessmentItemIcon,children:l.jsx(Cr,{size:16})}),l.jsxs("div",{className:K.assessmentItemInfo,children:[l.jsx("span",{className:K.assessmentItemTitle,children:s||r.learningPath.courseNameUnavailable}),l.jsx("span",{className:K.assessmentItemMeta,children:r.learningPath.levelExamMeta})]}),t&&l.jsx("button",{type:"button",className:K.menuBtn,onClick:i,"aria-label":r.treeNode.deleteMenuItem,children:l.jsx(ls,{size:14})})]}):l.jsxs("button",{type:"button",className:[K.addRow,K.addRowAssessment,o?K.addRowActive:""].filter(Boolean).join(" "),disabled:!t,onClick:a,"aria-pressed":o,children:[l.jsx("span",{className:K.addRowIcon,children:l.jsx(kr,{size:16})}),l.jsx("span",{className:K.addRowText,children:r.learningPath.addLevelExamButton})]})},mR=({item:e,onRemove:t,isEditable:r})=>{const n=ie(),[s,o]=g.useState(!1),a=g.useRef(null),{attributes:i,listeners:c,setNodeRef:u,transform:d,transition:f,isDragging:p}=nm({id:e.id,disabled:!r}),m={transform:Ar.Transform.toString(d),transition:f,opacity:p?.5:1};return g.useEffect(()=>{if(!s)return;const C=h=>{var v;(v=a.current)!=null&&v.contains(h.target)||o(!1)};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[s]),l.jsxs("div",{ref:u,style:m,className:K.courseRow,children:[r&&l.jsx("span",{className:K.courseDragHandle,...i,...c,"aria-label":n.contentRow.dragToReorderAriaLabel,children:l.jsx(Il,{size:16})}),l.jsx("span",{className:K.courseIcon,children:l.jsx(Cr,{size:18})}),l.jsxs("div",{className:K.courseInfo,children:[l.jsx("span",{className:K.courseTitle,title:e.name,children:e.name}),l.jsx("span",{className:K.courseMeta,children:n.learningPath.courseMetaLabel})]}),r&&l.jsxs("div",{className:K.menuWrap,ref:a,children:[l.jsx("button",{type:"button",className:K.menuBtn,onClick:C=>{C.stopPropagation(),o(h=>!h)},"aria-label":n.treeNode.nodeOptionsAriaLabel,children:"⋮"}),s&&l.jsx("div",{className:K.dropmenu,onClick:C=>C.stopPropagation(),children:l.jsxs("button",{type:"button",className:K.dangerItem,onClick:()=>{o(!1),t(e.id)},children:[l.jsx(ls,{size:12})," ",n.learningPath.removeFromLevelMenuItem]})})]})]})},gR=({editorMode:e,isRoot:t=!1})=>{const r=ie(),{selectedNodeId:n,getChildrenOf:s,getNodeById:o,reorderChildren:a,deleteNode:i,activeNodeMeta:c,updateNode:u,treeData:d}=oe(),f=X(G=>G.editorProfile),p=n?s(n):[],m=e==="edit",C=n?o(n):void 0,h=f.competencyScoped,v=h&&!t&&!nt(C),y=h&&t,b=rt(G=>G.activeAssessmentSlot),S=rt(G=>G.activeLevelExamTarget),x=rt(G=>G.setActiveAssessmentSlot),w=!b&&!S,{scope:T,source:D}=io(),k=ur(),N=k&&Array.isArray(c[k.code])?c[k.code]:[],F=D==="prior"?N.filter(G=>!T.includes(G)):[],A=y?Ih(d[0],k==null?void 0:k.code):[],P=v?Lh(C,N,k==null?void 0:k.code):[],R=g.useCallback(G=>{!n||!(k!=null&&k.code)||u(n,{[k.code]:G},[k.code])},[n,k==null?void 0:k.code,u]),O=bf(Fi(ga,{activationConstraint:{distance:5}}),Fi(wl,{coordinateGetter:eP})),U=g.useCallback(G=>{const{active:le,over:te}=G;if(!te||le.id===te.id||!n)return;const xe=oe.getState().getChildrenOf(n),ve=xe.findIndex(M=>M.id===le.id),q=xe.findIndex(M=>M.id===te.id);ve<0||q<0||a(n,ve,q)},[n,a]),re=g.useCallback(G=>{window.confirm(r.unitContentList.removeConfirm)&&i(G)},[i,r.unitContentList.removeConfirm]),W=rt(G=>G.openModal),pe=g.useCallback(G=>{W("confirmDelete",{message:r.learningPath.deleteCourseConfirm,onConfirm:()=>{i(G)||me.error(r.learningPath.cannotRemoveLastRegularCourseToast)}})},[W,i,r.learningPath.deleteCourseConfirm,r.learningPath.cannotRemoveLastRegularCourseToast]),ge=v?p.filter(G=>{var le;return!((le=G.metadata)!=null&&le.isAssessmentCourse)}):[];return n?l.jsxs("div",{className:K.container,children:[y&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:K.skillsCovered,children:[l.jsx("span",{className:K.heading,children:r.learningPath.skillsCoveredHeading}),l.jsx("span",{className:K.emptyHint,children:r.learningPath.skillsCoveredDescription}),A.length>0&&l.jsx("div",{className:K.chips,children:A.map(G=>l.jsx("span",{className:K.chip,children:G},G))}),A.length===0&&l.jsx("span",{className:K.emptyHint,children:r.learningPath.noSkillsYet})]}),l.jsxs("div",{className:K.assessmentsCard,children:[l.jsx("span",{className:K.heading,children:r.learningPath.assessmentsCardHeading}),l.jsx("span",{className:K.emptyHint,children:r.learningPath.assessmentsCardDescription}),l.jsxs("div",{className:K.assessmentSlots,children:[l.jsx(ml,{slot:"pre",isEditable:m}),l.jsx(ml,{slot:"post",isEditable:m})]})]})]}),v&&l.jsx(fR,{options:T,selected:N,outOfScope:F,uncovered:P,onChange:R,isEditable:m,description:D==="prior"?r.learningPath.skillScopeFromPriorNote:r.learningPath.skillScopeManualNote}),v&&l.jsxs("button",{type:"button",className:[K.addRow,K.addRowAssessment,w?K.addRowActive:""].filter(Boolean).join(" "),disabled:!m,onClick:()=>x(null),"aria-pressed":w,children:[l.jsx("span",{className:K.addRowIcon,children:l.jsx(kr,{size:16})}),l.jsx("span",{className:K.addRowText,children:r.learningPath.addCourseToLevelButton})]}),v&&l.jsx(pR,{levelId:n,isEditable:m}),v&&l.jsxs("div",{className:K.coursesCard,children:[l.jsx("h3",{className:K.coursesCardTitle,children:r.learningPath.coursesCardHeading}),l.jsx("p",{className:K.coursesCardDescription,children:r.learningPath.coursesCardDescription}),ge.length>0?l.jsx($i,{sensors:O,collisionDetection:bc,onDragEnd:U,children:l.jsx(kd,{items:ge.map(G=>G.id),strategy:Ad,children:l.jsx("div",{className:K.coursesList,role:"list",children:ge.map(G=>l.jsx(mR,{item:G,onRemove:pe,isEditable:m},G.id))})})}):l.jsx("span",{className:K.emptyHint,children:r.learningPath.coursesEmptyHint})]}),!h&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:K.header,children:[l.jsx("span",{className:K.heading,children:r.unitContentList.heading}),l.jsx("span",{className:K.count,children:p.length})]}),p.length>0?l.jsx($i,{sensors:O,collisionDetection:bc,onDragEnd:U,children:l.jsx(kd,{items:p.map(G=>G.id),strategy:Ad,children:l.jsx("div",{className:K.list,role:"list",children:p.map(G=>l.jsx(uP,{item:G,onRemove:re,isEditable:m},G.id))})})}):l.jsxs("div",{className:K.emptyState,children:[l.jsx("p",{children:r.unitContentList.emptyTitle}),l.jsx("span",{children:r.unitContentList.emptyHint})]}),m&&!nt(C)&&l.jsxs("button",{className:K.addRow,type:"button","aria-label":r.unitContentList.addContentAriaLabel,children:[l.jsx(kr,{size:14})," ",r.unitContentList.addContent]})]})]}):null},vR="_dropZone_ijo5w_1",yR="_active_ijo5w_14",Id={dropZone:vR,active:yR},bR=({isActive:e,label:t,nodeId:r,className:n})=>{const s=ie(),o=t??s.dropZone.dropHere;return l.jsx("div",{className:`${Id.dropZone} ${e?Id.active:""} ${n??""}`,"data-droppable":e?"true":void 0,"data-node-id":r,"aria-label":o,role:"region",children:l.jsx("span",{children:o})})},om=["identifier","name","mimeType","contentType","primaryCategory","appIcon","channel","organisation","pkgVersion"];async function CR(e){var a;const t={status:["Live"],...e.filters??{}};e.channel&&(t.channel=e.channel);const n=((a=(await Fe.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??om}},{headers:{"X-Source":"web","X-msgid":Math.random().toString(36).slice(2)}})).data)==null?void 0:a.result)??{},s=new Set(["count","facets"]);return{content:Object.entries(n).filter(([i])=>!s.has(i)).flatMap(([,i])=>Array.isArray(i)?i:[]),count:n.count??0}}async function SR(e){var r,n;return(n=(r=(await Fe.get(`/action/content/v3/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.content}const Ld="application/vnd.sunbird.question";function Dd(e){return{cardinality:"single",type:"integer",defaultValue:e.maxScore??1}}function am(e,t,r){if(!e)return null;if(e.identifier===t)return{question:e,parent:r};for(const n of e.children??[]){const s=am(n,t,e);if(s)return s}return null}function xR(e,t){const r=am(e,t);if(!r)return null;const{question:n,parent:s}=r,o={...e,children:[n],childNodes:[t],shuffle:s==null?void 0:s.shuffle,showSolutions:(s==null?void 0:s.showSolutions)??"No",showFeedback:(s==null?void 0:s.showFeedback)??"No"};return(s==null?void 0:s.shuffle)===!0?o.maxScore=1:n.qType==="SA"?delete o.maxScore:n.maxScore!=null&&(o.maxScore=n.maxScore),o}function _R(e,t){const r=((t==null?void 0:t.enabled)??!0)&&!!e;return es({queryKey:["quml","questionset",e],enabled:r,queryFn:async()=>{const n=await xh(e),s=d=>{if(!d)return[];const f=d.mimeType===Ld&&d.identifier?[d.identifier]:[],p=(d.children??[]).flatMap(s);return[...f,...p]},o=s(n),a=new Map;o.length&&(await oT(o)).forEach(f=>{const p=f.identifier;p&&a.set(p,f)});const i=d=>{if(!d)return d;if(d.mimeType===Ld&&d.identifier){const f=a.get(d.identifier)??d,p=f.outcomeDeclaration;return p!=null&&p.maxScore||(f.outcomeDeclaration={...p??{},maxScore:Dd(f)}),f}return Array.isArray(d.children)&&(d.children=d.children.map(f=>i(f))),d},c=i(n),u=c.outcomeDeclaration;return u!=null&&u.maxScore||(c.outcomeDeclaration={...u??{},maxScore:Dd(c)}),c}})}const jd="/assets/quml-player/sunbird-quml-player.js",wR="/assets/quml-player/styles.css",Nd="sunbird-quml-player";function TR(e){const t=e.children??[];return t.length?t.every(n=>n.objectType==="Question")?[e]:t:[]}const dt=class dt{constructor(){gs(this,"eventHandlers",new WeakMap)}loadScript(){return dt.scriptLoaded||customElements.get(Nd)?(dt.scriptLoaded=!0,Promise.resolve()):(dt.scriptLoading||(dt.scriptLoading=new Promise((t,r)=>{const n=document.createElement("script");n.src=jd,n.setAttribute("data-quml-player-script","true"),n.onload=()=>{dt.scriptLoaded=!0,dt.scriptLoading=void 0,t()},n.onerror=()=>{dt.scriptLoading=void 0,r(new Error(`Failed to load QuML player script: ${jd}`))},document.body.appendChild(n)})),dt.scriptLoading)}loadStyles(){if(dt.stylesLoaded||document.querySelector('[data-quml-player-styles="true"]')){dt.stylesLoaded=!0;return}const t=document.createElement("link");t.rel="stylesheet",t.href=wR,t.setAttribute("data-quml-player-styles","true"),document.head.appendChild(t),dt.stylesLoaded=!0}static unloadStyles(){var t;(t=document.querySelector('[data-quml-player-styles="true"]'))==null||t.remove(),dt.stylesLoaded=!1}async createConfig(t,r,n){var o,a,i;return await this.loadScript(),{context:{mode:(n==null?void 0:n.mode)??"play",host:"",pdata:{id:((o=r==null?void 0:r.pdata)==null?void 0:o.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:TR(t),identifier:t.identifier??""},metadata:t}}createElement(t){this.loadStyles();const r=document.createElement(Nd);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 s=a=>r==null?void 0:r(a),o=a=>n==null?void 0:n(a.detail);t.addEventListener("playerEvent",s),t.addEventListener("telemetryEvent",o),this.eventHandlers.set(t,{player:s,telemetry:o})}removeEventListeners(t){const r=this.eventHandlers.get(t);r&&(t.removeEventListener("playerEvent",r.player),t.removeEventListener("telemetryEvent",r.telemetry),this.eventHandlers.delete(t))}};gs(dt,"scriptLoaded",!1),gs(dt,"scriptLoading"),gs(dt,"stylesLoaded",!1);let la=dt;const Ao=new la,ER="_contentPlayerRoot_r6xk8_1",AR="_flowLayout_r6xk8_9",kR="_stage_r6xk8_13",IR="_aspectRatio_r6xk8_16",LR="_playerHeader_r6xk8_32",DR="_playerHeaderThumb_r6xk8_46",jR="_playerHeaderTitle_r6xk8_56",NR="_typeBadge_r6xk8_66",OR="_typeDot_r6xk8_105",PR="_playerFrame_r6xk8_125",RR="_coverOverlay_r6xk8_133",FR="_coverHidden_r6xk8_145",MR="_coverThumb_r6xk8_150",BR="_coverPlayRing_r6xk8_159",qR="_coverPlayIcon_r6xk8_172",$R="_coverLabel_r6xk8_181",UR="_coverSkeleton_r6xk8_187",zR="_playerWrapper_r6xk8_213",VR="_infoStrip_r6xk8_223",HR="_infoChip_r6xk8_239",QR="_infoChipLabel_r6xk8_258",WR="_infoChipIcon_r6xk8_267",GR="_playerError_r6xk8_273",KR="_playerErrorIcon_r6xk8_287",YR="_playerErrorMsg_r6xk8_292",ZR="_qumlRoot_r6xk8_299",He={contentPlayerRoot:ER,flowLayout:AR,stage:kR,aspectRatio:IR,playerHeader:LR,playerHeaderThumb:DR,playerHeaderTitle:jR,typeBadge:NR,typeDot:OR,playerFrame:PR,coverOverlay:RR,coverHidden:FR,coverThumb:MR,coverPlayRing:BR,coverPlayIcon:qR,coverLabel:$R,coverSkeleton:UR,playerWrapper:zR,infoStrip:VR,infoChip:HR,infoChipLabel:QR,infoChipIcon:WR,playerError:GR,playerErrorIcon:KR,playerErrorMsg:YR,qumlRoot:ZR},XR="application/vnd.sunbird.questionset";function JR(e,t){const r=new Map,n=o=>{for(const a of o)r.set(a.id,a),a.children&&n(a.children)};n(e);let s=r.get(t);for(;s;){if(s.mimeType===XR)return s.identifier;s=s.parent?r.get(s.parent):void 0}return null}const eF=[{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 tF(e){return eF.find(t=>t.mimes.includes(e))??{key:"other"}}function rF(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 nF={"pdf-player":["application/pdf"],"video-player":["video/mp4","video/webm"],"epub-player":["application/epub"]},sF={"pdf-player":"/assets/sunbird-pdf-player.js","video-player":"/assets/sunbird-video-player.js","epub-player":"/assets/sunbird-epub-player.js"},oF={"pdf-player":"sunbird-pdf-player","video-player":"sunbird-video-player","epub-player":"sunbird-epub-player"},aF="/content/preview/preview.html?webview=true&build_number=2.8.0.e552fcd";function yi(e){for(const[t,r]of Object.entries(nF))if(r.includes(e))return t;return"default-player"}function iF(e,t,r){var o;const n=r==null?void 0:r.context,s=t.mimeType??e.mimeType??"";return{context:{mode:"play",partner:[],pdata:{id:((o=n==null?void 0:n.pdata)==null?void 0:o.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:s==="application/vnd.ekstep.ecml-archive"?t.body??{}:{}}}function lF(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 cF(e,t,r=100){await lF(sF[t]??""),!customElements.get(e)&&await new Promise((n,s)=>{let o=0;const a=setInterval(()=>{o++,customElements.get(e)?(clearInterval(a),n()):o>=r&&(clearInterval(a),s(new Error(`Custom element <${e}> did not register`)))},100)})}const uF=[{key:"author",icon:Yy},{key:"license",icon:Uy},{key:"language",icon:Ny},{key:"gradeLevel",icon:zy},{key:"subject",icon:Cr},{key:"contentType",icon:Gy}];function dF(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 fF({node:e}){const t=ie(),r=e.metadata??{},n=uF.flatMap(s=>{const o=r[s.key];if(!o)return[];const a=Array.isArray(o)?o.join(", "):String(o);return a?[{...s,label:dF(s.key,t),val:a}]:[]});return n.length?l.jsx("div",{className:He.infoStrip,children:n.map(s=>l.jsxs("div",{className:He.infoChip,children:[s.icon&&l.jsx(s.icon,{size:13,className:He.infoChipIcon}),l.jsx("span",{className:He.infoChipLabel,children:s.label}),s.val]},s.key))}):null}function im({node:e,hidden:t}){var s;const r=ie(),n=e.appIcon??((s=e.metadata)==null?void 0:s.appIcon);return l.jsx("div",{className:`${He.coverOverlay} ${t?He.coverHidden:""}`,children:n?l.jsxs(l.Fragment,{children:[l.jsx("img",{src:n,alt:e.name,className:He.coverThumb}),l.jsx("div",{className:He.coverPlayRing,children:l.jsx("div",{className:He.coverPlayIcon})}),l.jsx("span",{className:He.coverLabel,children:r.contentPlayer.loadingPreview})]}):l.jsx("div",{className:He.coverSkeleton})})}function lm({message:e}){return l.jsxs("div",{className:He.playerError,children:[l.jsx(Ky,{size:28,className:He.playerErrorIcon}),l.jsx("span",{className:He.playerErrorMsg,children:e})]})}function hF({mimeType:e}){const t=ie(),r=tF(e);return l.jsxs("span",{className:He.typeBadge,"data-type":r.key,children:[l.jsx("span",{className:He.typeDot}),rF(r.key,t)]})}const gl=({node:e,editorMode:t,type:r,singleQuestion:n,layout:s="fill"})=>{var a;if(r==="quml")return l.jsx(mF,{node:e,editorMode:t,singleQuestion:!!n});const o=e.appIcon??((a=e.metadata)==null?void 0:a.appIcon);return l.jsxs("div",{className:`${He.contentPlayerRoot} ${s==="flow"?He.flowLayout:""}`,children:[l.jsxs("div",{className:He.stage,children:[l.jsxs("div",{className:He.playerHeader,children:[o&&l.jsx("img",{src:o,alt:"",className:He.playerHeaderThumb}),l.jsx("span",{className:He.playerHeaderTitle,children:e.name}),l.jsx(hF,{mimeType:e.mimeType??""})]}),l.jsx(pF,{node:e})]}),l.jsx(fF,{node:e})]})};function pF({node:e}){var y;const t=ie(),r=X(b=>b.editorConfig),[n,s]=g.useState(()=>yi(e.mimeType??"")),[o,a]=g.useState(!1),[i,c]=g.useState(null),[u,d]=g.useState(e.metadata??{}),[f,p]=g.useState(!1),m=g.useRef(null),C=g.useRef(null),h=((y=r==null?void 0:r.config)==null?void 0:y.previewCdnUrl)??aF;g.useEffect(()=>{let b=!1;return p(!1),a(!1),c(null),d(e.metadata??{}),s(yi(e.mimeType??"")),SR(e.identifier).then(S=>{if(b)return;const x={...e.metadata??{},...S};d(x);const w=S.mimeType??e.mimeType??"";s(yi(w)),p(!0)}).catch(()=>{b||p(!0)}),()=>{b=!0}},[e.identifier]);const v=iF(e,u,r);return g.useEffect(()=>{if(!f||n!=="default-player")return;const b=m.current;if(!b)return;b.src=h;const S=()=>{try{const w=b.contentWindow;if(typeof(w==null?void 0:w.initializePreview)!="function"){c(t.contentPlayer.previewPlayerUnavailable);return}w.initializePreview(v),setTimeout(()=>a(!0),300)}catch(w){console.error("[ContentPlayer] initializePreview failed",w),c(t.contentPlayer.failedToInitializePlayer)}},x=()=>c(t.contentPlayer.previewPlayerLoadFailed);return b.addEventListener("load",S),b.addEventListener("error",x),()=>{b.removeEventListener("load",S),b.removeEventListener("error",x),b.src=""}},[e.identifier,n,h,f,t]),g.useEffect(()=>{if(!f||n==="default-player")return;const b=C.current;if(!b)return;const S=oF[n];if(!S)return;const x=v;cF(S,n).then(()=>{if(!C.current)return;if(!customElements.get(S)){s("default-player");return}const w=document.createElement(S);w.setAttribute("player-config",JSON.stringify(x)),w.addEventListener("playerEvent",()=>{}),w.addEventListener("telemetryEvent",()=>{}),b.innerHTML="",b.appendChild(w),setTimeout(()=>{try{w.playerConfig=x}catch{}a(!0)},200)}).catch(()=>{console.warn(`[ContentPlayer] ${n} script unavailable, falling back to iframe`),s("default-player")})},[e.identifier,n,f]),l.jsxs("div",{className:He.aspectRatio,children:[i?l.jsx(lm,{message:i}):l.jsx(im,{node:e,hidden:o}),n==="default-player"?l.jsx("iframe",{ref:m,id:"contentPlayer",title:e.name,className:He.playerFrame,name:"contentPlayer",allowFullScreen:!0}):l.jsx("div",{ref:C,className:He.playerFrame})]})}function mF({node:e,editorMode:t,singleQuestion:r}){const n=ie(),s=X(m=>m.editorConfig),o=oe(m=>m.treeData),a=g.useRef(null),i=r?JR(o,e.id):e.identifier,{data:c,isLoading:u,error:d}=_R(i??"",{enabled:!!i}),f=g.useMemo(()=>c?r?xR(c,e.identifier):c:null,[c,r,e.identifier]);g.useEffect(()=>{const m=a.current;if(!m||!f)return;let C=null,h=!1;return(async()=>{try{const v=await Ao.createConfig(f,s==null?void 0:s.context,{mode:t==="edit"?"edit":"play"});if(h||!a.current)return;const y=Ao.createElement(v);C=y,Ao.attachEventListeners(y,b=>console.debug("[QumlPlayer] playerEvent",b.detail),b=>console.debug("[QumlPlayer] telemetryEvent",b)),m.innerHTML="",m.appendChild(y)}catch(v){console.error("[QumlPlayer] failed to initialize",v)}})(),()=>{h=!0,C&&(Ao.removeEventListeners(C),C.remove()),la.unloadStyles()}},[f,s,t,r]);const p=d?`${n.contentPlayer.unableToLoadQuestionset} ${d.message}`:r&&!i?n.contentPlayer.parentQuestionsetNotResolved:r&&c&&!f?n.contentPlayer.questionNotFoundInQuestionset:null;return l.jsxs("div",{className:He.qumlRoot,children:[p?l.jsx(lm,{message:p}):u||!f?l.jsx(im,{node:e,hidden:!1}):null,l.jsx("div",{ref:a,className:He.playerWrapper})]})}const gF="_overlay_ifddx_1",vF="_modal_ifddx_11",yF="_header_ifddx_21",bF="_body_ifddx_37",CF="_hint_ifddx_43",SF="_list_ifddx_49",xF="_item_ifddx_55",_F="_selected_ifddx_68",wF="_empty_ifddx_73",TF="_footer_ifddx_79",EF="_cancelBtn_ifddx_87",AF="_moveBtn_ifddx_95",Kt={overlay:gF,modal:vF,header:yF,body:bF,hint:CF,list:SF,item:xF,selected:_F,empty:wF,footer:TF,cancelBtn:EF,moveBtn:AF};function kF(e,t,r){const n=[],s=o=>{var a;for(const i of o)i.isFolder&&i.id!==r&&i.id!==t&&n.push(i),(a=i.children)!=null&&a.length&&s(i.children)};return s(e),n}const IF=({resourceId:e,resourceName:t,currentUnitId:r,onClose:n})=>{var f;const s=ie(),{treeData:o,moveNode:a}=oe(),i=kF(o,((f=o[0])==null?void 0:f.id)??"",r),[c,u]=g.useState(null),d=()=>{c&&(a(e,r,c),n())};return l.jsx("div",{className:Kt.overlay,role:"dialog","aria-label":s.resourceReorderDialog.dialogAriaLabel,children:l.jsxs("div",{className:Kt.modal,children:[l.jsxs("div",{className:Kt.header,children:[l.jsxs("span",{children:[s.resourceReorderDialog.moveHeaderPrefix,' "',t,'"']}),l.jsx("button",{onClick:n,"aria-label":s.resourceReorderDialog.closeAriaLabel,children:l.jsx(lr,{size:16})})]}),l.jsxs("div",{className:Kt.body,children:[l.jsx("p",{className:Kt.hint,children:s.resourceReorderDialog.selectUnitHint}),l.jsxs("ul",{className:Kt.list,children:[i.map(p=>l.jsxs("li",{className:`${Kt.item} ${c===p.id?Kt.selected:""}`,onClick:()=>u(p.id),children:[l.jsx(jy,{size:14}),l.jsx("span",{children:p.name})]},p.id)),i.length===0&&l.jsx("li",{className:Kt.empty,children:s.resourceReorderDialog.noUnitsAvailable})]})]}),l.jsxs("div",{className:Kt.footer,children:[l.jsx("button",{className:Kt.cancelBtn,onClick:n,children:s.resourceReorderDialog.cancelButton}),l.jsx("button",{className:Kt.moveBtn,onClick:d,disabled:!c,children:s.resourceReorderDialog.moveButton})]})]})})},LF="_overlay_16at9_1",DF="_modal_16at9_11",jF="_header_16at9_21",NF="_body_16at9_37",OF="_table_16at9_43",PF="_pageInput_16at9_61",RF="_empty_16at9_68",FF="_footer_16at9_74",MF="_cancelBtn_16at9_82",BF="_saveBtn_16at9_90",pr={overlay:LF,modal:DF,header:jF,body:NF,table:OF,pageInput:PF,empty:RF,footer:FF,cancelBtn:MF,saveBtn:BF};function qF(e){const t=[],r=n=>{var s;for(const o of n)!o.isFolder&&(!o.children||o.children.length===0)?t.push(o):(s=o.children)!=null&&s.length&&r(o.children)};return r(e),t}const $F=({onClose:e})=>{const t=ie(),{treeData:r,updateNode:n}=oe(),s=qF(r),[o,a]=g.useState(()=>Object.fromEntries(s.map(c=>{var u;return[c.id,String(((u=c.metadata)==null?void 0:u.pageNumber)??"")]}))),i=g.useCallback(()=>{for(const[c,u]of Object.entries(o))u!==""&&n(c,{pageNumber:parseInt(u,10)||void 0});e()},[o,n,e]);return l.jsx("div",{className:pr.overlay,role:"dialog","aria-label":t.assignPageNumber.dialogAriaLabel,children:l.jsxs("div",{className:pr.modal,children:[l.jsxs("div",{className:pr.header,children:[l.jsx("span",{children:t.assignPageNumber.title}),l.jsx("button",{onClick:e,"aria-label":t.assignPageNumber.closeAriaLabel,children:l.jsx(lr,{size:16})})]}),l.jsx("div",{className:pr.body,children:s.length===0?l.jsx("p",{className:pr.empty,children:t.assignPageNumber.emptyState}):l.jsxs("table",{className:pr.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:s.map(c=>l.jsxs("tr",{children:[l.jsx("td",{children:c.name}),l.jsx("td",{children:l.jsx("input",{type:"number",min:1,value:o[c.id]??"",onChange:u=>a(d=>({...d,[c.id]:u.target.value})),className:pr.pageInput})})]},c.id))})]})}),l.jsxs("div",{className:pr.footer,children:[l.jsx("button",{className:pr.cancelBtn,onClick:e,children:t.assignPageNumber.cancelButton}),l.jsxs("button",{className:pr.saveBtn,onClick:i,children:[l.jsx($y,{size:14})," ",t.assignPageNumber.saveButton]})]})]})})},UF="_container_1a7t2_1",zF="_panelHeader_1a7t2_10",VF="_panelHeaderLeft_1a7t2_19",HF="_panelCollapseBtn_1a7t2_27",QF="_titleRow_1a7t2_46",WF="_field_1a7t2_47",GF="_moveBtn_1a7t2_64",KF="_icon_1a7t2_84",YF="_nameInput_1a7t2_93",ZF="_fieldHeader_1a7t2_118",XF="_label_1a7t2_124",JF="_fieldCount_1a7t2_133",eM="_chips_1a7t2_170",tM="_chip_1a7t2_170",rM="_chipRemove_1a7t2_188",nM="_keywordInput_1a7t2_202",sM="_input_1a7t2_207",oM="_addBtn_1a7t2_220",aM="_radioGroup_1a7t2_234",iM="_radioLabel_1a7t2_239",Ye={container:UF,panelHeader:zF,panelHeaderLeft:VF,panelCollapseBtn:HF,titleRow:QF,field:WF,moveBtn:GF,icon:KF,nameInput:YF,fieldHeader:ZF,label:XF,fieldCount:JF,chips:eM,chip:tM,chipRemove:rM,keywordInput:nM,input:sM,addBtn:oM,radioGroup:aM,radioLabel:iM},lM=({node:e,editorMode:t,onMoveClick:r,reorderDialog:n})=>{var P,R;const{updateNode:s,markDirty:o}=oe(),a=t==="edit",i=lo(e),c=ie(),u=X(O=>O.relationalFormConfig),d=O=>u==null?void 0:u.find(U=>U.code===O),f=O=>!u||!!d(O),p=(O,U)=>{var re;return((re=d(O))==null?void 0:re.label)||U},[m,C]=g.useState(!0),h=((P=e.metadata)==null?void 0:P.relationalMetadata)??{},[v,y]=g.useState(h.name??e.name??""),[b,S]=g.useState(""),[x,w]=g.useState(Array.isArray(h.keywords)?h.keywords:Array.isArray((R=e.metadata)==null?void 0:R.keywords)?e.metadata.keywords:[]),[T,D]=g.useState(!!h.optional);g.useEffect(()=>{var U,re;const O=((U=e.metadata)==null?void 0:U.relationalMetadata)??{};y(O.name??e.name??""),w(Array.isArray(O.keywords)?O.keywords:Array.isArray((re=e.metadata)==null?void 0:re.keywords)?e.metadata.keywords:[]),D(!!O.optional)},[e.id]);const k=()=>{v.trim()&&v!==e.name&&(s(e.id,{name:v.trim()}),o())},N=()=>{const O=b.trim();if(O&&!x.includes(O)){const U=[...x,O];w(U),s(e.id,{keywords:U}),o()}S("")},F=O=>{const U=x.filter(re=>re!==O);w(U),s(e.id,{keywords:U}),o()},A=O=>{D(O),s(e.id,{optional:O}),o()};return l.jsxs("div",{className:Ye.container,children:[l.jsxs("div",{className:Ye.panelHeader,children:[l.jsxs("div",{className:Ye.panelHeaderLeft,children:[l.jsx("span",{className:`sbx-ct-badge--${i.key}`,children:i.label}),a&&l.jsx("button",{type:"button",className:Ye.moveBtn,onClick:r,children:c.contentEditForm.moveToAnotherUnitButton})]}),l.jsx("button",{type:"button",className:Ye.panelCollapseBtn,onClick:()=>C(O=>!O),"aria-expanded":m,"aria-label":m?c.contentEditForm.collapseMetadataPanelAriaLabel:c.contentEditForm.expandMetadataPanelAriaLabel,title:m?c.contentEditForm.collapseTitle:c.contentEditForm.expandTitle,children:m?l.jsx(xn,{size:15}):l.jsx(Ay,{size:15})})]}),m&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:Ye.titleRow,children:[e.appIcon&&l.jsx("img",{src:e.appIcon,alt:c.contentEditForm.iconAlt,className:Ye.icon}),l.jsx("input",{type:"text",className:Ye.nameInput,value:v,disabled:!a,onChange:O=>y(O.target.value),onBlur:k,placeholder:c.contentEditForm.contentNamePlaceholder})]}),f("keywords")&&l.jsxs("div",{className:Ye.field,children:[l.jsx("div",{className:Ye.fieldHeader,children:l.jsxs("label",{className:Ye.label,children:[p("keywords",c.contentEditForm.keywordsLabel),x.length>0&&l.jsx("span",{className:Ye.fieldCount,children:x.length})]})}),x.length>0&&l.jsx("div",{className:Ye.chips,children:x.map(O=>l.jsxs("span",{className:Ye.chip,children:[O,a&&l.jsx("button",{type:"button",className:Ye.chipRemove,onClick:()=>F(O),children:"×"})]},O))}),a&&l.jsxs("div",{className:Ye.keywordInput,children:[l.jsx("input",{type:"text",className:Ye.input,value:b,placeholder:c.contentEditForm.addKeywordPlaceholder,onChange:O=>S(O.target.value),onKeyDown:O=>{O.key==="Enter"&&(O.preventDefault(),N())}}),l.jsx("button",{type:"button",className:Ye.addBtn,onClick:N,children:c.contentEditForm.addButton})]})]}),f("optional")&&l.jsxs("div",{className:Ye.field,children:[l.jsx("label",{className:Ye.label,children:p("optional",c.contentEditForm.optionalInCollectionLabel)}),l.jsxs("div",{className:Ye.radioGroup,children:[l.jsxs("label",{className:Ye.radioLabel,children:[l.jsx("input",{type:"radio",name:`optional-${e.id}`,checked:T===!0,onChange:()=>A(!0),disabled:!a}),c.contentEditForm.yesOption]}),l.jsxs("label",{className:Ye.radioLabel,children:[l.jsx("input",{type:"radio",name:`optional-${e.id}`,checked:T===!1,onChange:()=>A(!1),disabled:!a}),c.contentEditForm.noOption]})]})]})]}),n]})},cM="_iconBtn_64kgu_1",uM="_editable_64kgu_14",dM="_iconImg_64kgu_26",fM="_placeholder_64kgu_34",hM="_removeBtn_64kgu_41",ws={iconBtn:cM,editable:uM,iconImg:dM,placeholder:fM,removeBtn:hM},pM=({nodeId:e,value:t,editable:r})=>{const[n,s]=g.useState(!1),{updateNode:o,markDirty:a}=oe(),i=ie(),c=d=>{o(e,{appIcon:d}),a(),s(!1)},u=d=>{d.stopPropagation(),o(e,{appIcon:""}),a()};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:[ws.iconBtn,r?ws.editable:""].filter(Boolean).join(" "),role:r?"button":void 0,tabIndex:r?0:-1,"aria-label":r?i.titleAppIcon.selectAppIconAriaLabel:i.titleAppIcon.appIconAriaLabel,onClick:()=>r&&s(!0),onKeyDown:d=>{r&&(d.key==="Enter"||d.key===" ")&&s(!0)},children:[t?l.jsx("img",{src:t,alt:i.titleAppIcon.appIconAlt,className:ws.iconImg}):l.jsx("div",{className:ws.placeholder,children:l.jsx(Hf,{size:24})}),t&&r&&l.jsx("button",{type:"button",className:ws.removeBtn,onClick:u,"aria-label":i.titleAppIcon.removeIconAriaLabel,children:l.jsx(ls,{size:11})})]}),n&&l.jsx(Zp,{nodeId:e,currentValue:t,onSelect:c,onClose:()=>s(!1)})]})},mM="_courseDetails_pkcf3_1",gM="_courseDetailsLoading_pkcf3_7",vM="_courseDetailsError_pkcf3_7",yM="_detailsCard_pkcf3_12",bM="_unitsCard_pkcf3_12",CM="_cardTitle_pkcf3_22",SM="_fieldGroup_pkcf3_29",xM="_fieldGroupLast_pkcf3_33",_M="_fieldLabel_pkcf3_37",wM="_fieldValue_pkcf3_47",TM="_fieldValueMultiline_pkcf3_52",EM="_unitsLabel_pkcf3_58",AM="_unitsDescription_pkcf3_68",kM="_unitList_pkcf3_74",IM="_unitCard_pkcf3_80",LM="_unitHeader_pkcf3_86",DM="_unitIcon_pkcf3_99",jM="_unitTitle_pkcf3_111",NM="_unitCount_pkcf3_120",OM="_unitBody_pkcf3_126",PM="_unitDescription_pkcf3_131",RM="_unitKeywords_pkcf3_138",FM="_keywordPill_pkcf3_145",MM="_unitTopicsRow_pkcf3_155",BM="_unitContents_pkcf3_167",qM="_contentRow_pkcf3_174",$M="_contentIcon_pkcf3_180",UM="_contentTitle_pkcf3_185",zM="_contentSkills_pkcf3_193",VM="_skillPill_pkcf3_200",Ne={courseDetails:mM,courseDetailsLoading:gM,courseDetailsError:vM,detailsCard:yM,unitsCard:bM,cardTitle:CM,fieldGroup:SM,fieldGroupLast:xM,fieldLabel:_M,fieldValue:wM,fieldValueMultiline:TM,unitsLabel:EM,unitsDescription:AM,unitList:kM,unitCard:IM,unitHeader:LM,unitIcon:DM,unitTitle:jM,unitCount:NM,unitBody:OM,unitDescription:PM,unitKeywords:RM,keywordPill:FM,unitTopicsRow:MM,unitContents:BM,contentRow:qM,contentIcon:$M,contentTitle:UM,contentSkills:zM,skillPill:VM},HM={video:_a,pdf:to,h5p:Ca,scorm:xa,audio:Sa,quiz:ba,course:Cr,default:Gr};function bi(e){return Array.isArray(e)?e.map(String):e?[String(e)]:[]}const cm=({courseId:e,variant:t="compact",title:r,onLoaded:n})=>{const s=ie(),o=ur(),[a,i]=g.useState(null),[c,u]=g.useState(""),[d,f]=g.useState(null),[p,m]=g.useState({}),C=t==="full";g.useEffect(()=>{let b=!1;return i(null),u(""),f(null),cT(e).then(S=>{if(b)return;const w=(S.children??[]).map(T=>ka(T));i(w),u(S.description??""),m(Object.fromEntries(w.map(T=>[T.id,!0]))),n==null||n({totalContents:w.reduce((T,D)=>{var k;return T+(((k=D.children)==null?void 0:k.length)??0)},0)})}).catch(()=>{b||f(s.learningPath.courseDetailsError)}),()=>{b=!0}},[e,s.learningPath.courseDetailsError]);const h=b=>m(S=>({...S,[b]:!S[b]})),v=b=>{var S;return o?bi((S=b.metadata)==null?void 0:S[o.code]):[]},y=b=>(b===1?s.learningPath.contentCountLabel:s.learningPath.contentCountLabelPlural).replace("{count}",String(b));return l.jsx("div",{className:Ne.courseDetails,children:d?l.jsx("p",{className:Ne.courseDetailsError,children:d}):a===null?l.jsx("p",{className:Ne.courseDetailsLoading,children:s.learningPath.courseDetailsLoading}):l.jsxs(l.Fragment,{children:[C&&l.jsxs("div",{className:Ne.detailsCard,children:[l.jsx("h3",{className:Ne.cardTitle,children:s.learningPath.courseDetailsCardTitle}),l.jsxs("div",{className:Ne.fieldGroup,children:[l.jsx("span",{className:Ne.fieldLabel,children:s.learningPath.courseTitleFieldLabel}),l.jsx("div",{className:Ne.fieldValue,children:r})]}),l.jsxs("div",{className:Ne.fieldGroupLast,children:[l.jsx("span",{className:Ne.fieldLabel,children:s.learningPath.courseDescriptionFieldLabel}),l.jsx("div",{className:Ne.fieldValueMultiline,children:c||s.learningPath.noCourseDescriptionPlaceholder})]})]}),a.length===0?l.jsx("p",{className:Ne.courseDetailsLoading,children:s.learningPath.courseDetailsEmpty}):l.jsxs("div",{className:C?Ne.unitsCard:void 0,children:[l.jsx("span",{className:Ne.unitsLabel,children:s.learningPath.unitsSectionLabel}),C&&l.jsx("p",{className:Ne.unitsDescription,children:s.learningPath.unitsSectionDescription}),l.jsx("div",{className:Ne.unitList,children:a.map(b=>{var D,k;const S=!!p[b.id],x=(b.children??[]).length,w=bi((D=b.metadata)==null?void 0:D.keywords),T=bi((k=b.metadata)==null?void 0:k.topic);return l.jsxs("div",{className:Ne.unitCard,children:[l.jsxs("button",{type:"button",className:Ne.unitHeader,onClick:()=>h(b.id),"aria-expanded":S,children:[S?l.jsx(xn,{size:17}):l.jsx(kl,{size:17}),l.jsx("span",{className:Ne.unitIcon,children:l.jsx(Vf,{size:16})}),l.jsx("span",{className:Ne.unitTitle,children:b.name}),C&&l.jsx("span",{className:Ne.unitCount,children:y(x)})]}),S&&l.jsxs("div",{className:Ne.unitBody,children:[C&&b.description&&l.jsx("p",{className:Ne.unitDescription,children:b.description}),C&&w.length>0&&l.jsx("div",{className:Ne.unitKeywords,children:w.map(N=>l.jsx("span",{className:Ne.keywordPill,children:N},N))}),C&&T.length>0&&l.jsxs("div",{className:Ne.unitTopicsRow,children:[l.jsx("span",{className:Ne.fieldLabel,children:s.learningPath.unitTopicsFieldLabel}),l.jsx("span",{children:T.join(", ")})]}),l.jsx("div",{className:Ne.unitContents,children:(b.children??[]).map(N=>{const F=lo(N),A=HM[F.key]??Gr,P=v(N);return l.jsxs("div",{className:Ne.contentRow,children:[l.jsx(A,{size:16,className:Ne.contentIcon}),l.jsx("span",{className:Ne.contentTitle,children:N.name}),P.length>0&&l.jsx("div",{className:Ne.contentSkills,children:P.map(R=>l.jsx("span",{className:Ne.skillPill,children:R},R))})]},N.id)})})]})]},b.id)})})]})]})})},QM="_backToPathButton_1u4o4_1",WM="_assessmentTitle_1u4o4_15",GM="_slotPills_1u4o4_22",KM="_slotPill_1u4o4_22",YM="_slotPillHint_1u4o4_40",ZM="_slotPillPurpose_1u4o4_45",XM="_slotPillWarning_1u4o4_51",JM="_slotPillPrimary_1u4o4_56",e2="_courseCard_1u4o4_62",t2="_courseCardHeading_1u4o4_72",r2="_courseCardDescription_1u4o4_79",n2="_courseNotAdded_1u4o4_85",s2="_assessmentExplainer_1u4o4_93",o2="_assessmentExplainerHeading_1u4o4_107",a2="_leafContentLayout_1u4o4_117",i2="_container_1u4o4_131",l2="_emptyState_1u4o4_140",c2="_titleRow_1u4o4_150",u2="_titleRowLp_1u4o4_157",d2="_nodeTitle_1u4o4_171",f2="_nodeTitleLpRoot_1u4o4_193",h2="_nodeTitleSub_1u4o4_198",p2="_courseDetailHeader_1u4o4_203",m2="_courseDetailIcon_1u4o4_210",g2="_courseDetailTitle_1u4o4_222",v2="_courseDetailMeta_1u4o4_229",y2="_formArea_1u4o4_234",b2="_contentListArea_1u4o4_238",C2="_contentListAreaLp_1u4o4_242",S2="_dropZone_1u4o4_246",x2="_reviewComment_1u4o4_253",_2="_reviewCommentLabel_1u4o4_266",w2="_reviewCommentText_1u4o4_272",ke={backToPathButton:QM,assessmentTitle:WM,slotPills:GM,slotPill:KM,slotPillHint:YM,slotPillPurpose:ZM,slotPillWarning:XM,slotPillPrimary:JM,courseCard:e2,courseCardHeading:t2,courseCardDescription:r2,courseNotAdded:n2,assessmentExplainer:s2,assessmentExplainerHeading:o2,leafContentLayout:a2,container:i2,emptyState:l2,titleRow:c2,titleRowLp:u2,nodeTitle:d2,nodeTitleLpRoot:f2,nodeTitleSub:h2,courseDetailHeader:p2,courseDetailIcon:m2,courseDetailTitle:g2,courseDetailMeta:v2,formArea:y2,contentListArea:b2,contentListAreaLp:C2,dropZone:S2,reviewComment:x2,reviewCommentLabel:_2,reviewCommentText:w2},T2=({slot:e,isEditable:t})=>{var m;const r=ie(),n=oe(C=>C.treeData),s=oe(C=>C.selectNode),o=(m=n[0])==null?void 0:m.id,{pre:a,post:i}=Yl(),c=(e==="pre"?a:i).filled,u=e==="pre"?r.learningPath.priorAssessmentLabel:r.learningPath.outcomeAssessmentLabel,d=e==="pre"?qn:Ty,f=e==="pre"?r.learningPath.priorAssessmentExplainerTitle:r.learningPath.outcomeAssessmentExplainerTitle,p=e==="pre"?r.learningPath.priorAssessmentExplainerBody:r.learningPath.outcomeAssessmentExplainerBody;return l.jsxs("div",{className:ke.container,children:[l.jsxs("button",{type:"button",className:ke.backToPathButton,onClick:()=>o&&s(o),children:[l.jsx(Al,{size:14})," ",r.learningPath.backToPathButton]}),l.jsx("div",{className:ke.assessmentTitle,children:u}),l.jsx("div",{className:ke.slotPills,children:e==="pre"?l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:`${ke.slotPill} ${ke.slotPillHint}`,children:[l.jsx(Dc,{size:12})," ",r.learningPath.priorAssessmentHint]}),l.jsxs("span",{className:`${ke.slotPill} ${ke.slotPillPurpose}`,children:[l.jsx(_y,{size:12})," ",r.learningPath.priorAssessmentPurposeLabel]})]}):l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:`${ke.slotPill} ${ke.slotPillWarning}`,children:[l.jsx(Qf,{size:12})," ",r.learningPath.outcomeUnlocksHint]}),l.jsxs("span",{className:`${ke.slotPill} ${ke.slotPillPrimary}`,children:[l.jsx(Dc,{size:12})," ",r.learningPath.outcomeAssessmentHint]})]})}),l.jsxs("div",{className:ke.formArea,children:[l.jsxs("div",{className:ke.courseCard,children:[l.jsx("div",{className:ke.courseCardHeading,children:r.learningPath.assessmentCourseSectionTitle}),l.jsx("p",{className:ke.courseCardDescription,children:r.learningPath.assessmentCourseSectionDescription}),c?l.jsx(ml,{slot:e,isEditable:t}):l.jsx("div",{className:ke.courseNotAdded,children:r.learningPath.assessmentNotAddedYet})]}),l.jsxs("div",{className:ke.assessmentExplainer,children:[l.jsxs("div",{className:ke.assessmentExplainerHeading,children:[l.jsx(d,{size:16}),l.jsx("span",{children:f})]}),l.jsx("p",{children:p})]})]})]})},E2="application/vnd.sunbird.questionset",um="application/vnd.sunbird.question",A2=[E2,um];function Od(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 k2=({editorMode:e,onToolbarEvent:t})=>{var G,le,te,xe,ve;const r=ie(),[n,s]=g.useState("details"),[o,a]=g.useState([]),[i,c]=g.useState(null),[u,d]=g.useState(!1),[f,p]=g.useState(null),m=g.useRef(null),C=g.useRef(),{selectedNodeId:h,breadcrumb:v,activeNodeMeta:y,updateNode:b,treeData:S,selectNode:x}=oe(),w=rt(q=>q.activeAssessmentSlot),T=X(q=>{var M,$,se,ae;return(($=(M=q.editorConfig)==null?void 0:M.context)==null?void 0:$.contentId)??((ae=(se=q.editorConfig)==null?void 0:se.context)==null?void 0:ae.identifier)??""}),D=X(q=>q.editorProfile.competencyScoped),k=h?dm(S,h):null;g.useEffect(()=>{p(null)},[k==null?void 0:k.identifier]);const N=!!k&&!k.parent,F=!!(k!=null&&k.isFolder),A=k&&A2.includes(k.mimeType??""),P=(k==null?void 0:k.mimeType)===um,R=k&&!k.isFolder&&!A&&!N,U=D&&F&&nt(k??void 0)?((te=(le=(G=S[0])==null?void 0:G.children)==null?void 0:le[0])==null?void 0:te.id)===(k==null?void 0:k.id)?"pre":"post":D?w:null,re=Od(k)??(N?Od(S[0]):void 0),W=g.useCallback(()=>{const q=m.current;if(!q||!h)return;const M=q.innerText.trim();clearTimeout(C.current),C.current=setTimeout(()=>{b(h,{name:M})},600)},[h,b]),pe=g.useCallback(q=>{t({action:"onFormValueChange",data:q})},[t]),ge=g.useCallback((q,M)=>{a(M),t({action:"onFormStatusChange",data:{isValid:q,nodeId:h}})},[t,h]);if(!k)return l.jsx("div",{className:ke.emptyState,children:l.jsx("p",{children:r.contextualEditor.emptyStateMessage})});if(A)return l.jsx(gl,{node:k,editorMode:e,type:"quml",singleQuestion:P});if(D&&R&&(k.primaryCategory==="Course"||mn(k))){const q=k.parent?mT(((xe=S[0])==null?void 0:xe.children)??[],k.parent):null,M=(q==null?void 0:q.role)==="pre"?r.learningPath.priorAssessmentLabel:(q==null?void 0:q.role)==="post"?r.learningPath.outcomeAssessmentLabel:(q==null?void 0:q.role)==="level"?r.learningPath.levelNumberPrefix.replace("{n}",String(q.levelNumber)):null,$=f===null?"":` · ${(f===1?r.learningPath.contentCountLabel:r.learningPath.contentCountLabelPlural).replace("{count}",String(f))}`;return l.jsxs("div",{className:ke.container,children:[l.jsxs("button",{type:"button",className:ke.backToPathButton,onClick:()=>k.parent&&x(k.parent),children:[l.jsx(Al,{size:14}),M?r.learningPath.backToLevelButton.replace("{label}",M):r.learningPath.backToPathButton]}),l.jsxs("div",{className:ke.courseDetailHeader,children:[l.jsx("span",{className:ke.courseDetailIcon,children:l.jsx(Cr,{size:26})}),l.jsxs("div",{children:[l.jsx("h2",{className:ke.courseDetailTitle,children:k.name}),l.jsxs("span",{className:ke.courseDetailMeta,children:[k.primaryCategory,$]})]})]}),l.jsx(cm,{courseId:k.identifier,variant:"full",title:k.name,onLoaded:({totalContents:se})=>p(se)},k.identifier)]})}return U?l.jsx(T2,{slot:U,isEditable:e==="edit"}):R?l.jsxs("div",{className:ke.leafContentLayout,children:[l.jsx(gl,{node:k,editorMode:e,type:"content",layout:"flow"}),l.jsx(lM,{node:k,editorMode:e,onMoveClick:()=>c(k.identifier),reorderDialog:i?l.jsx(IF,{resourceId:i,resourceName:k.name,currentUnitId:k.parent??"",onClose:()=>c(null)}):null})]}):l.jsxs("div",{className:ke.container,children:[l.jsx(qD,{crumbs:v}),re&&l.jsxs("div",{className:ke.reviewComment,role:"alert",children:[l.jsx("span",{className:ke.reviewCommentLabel,children:r.contextualEditor.reviewCommentLabel}),l.jsx("span",{className:ke.reviewCommentText,children:re})]}),l.jsxs("div",{className:[ke.titleRow,D?ke.titleRowLp:""].filter(Boolean).join(" "),children:[N&&h&&l.jsx(pM,{nodeId:h,value:String(k.appIcon??((ve=k.metadata)==null?void 0:ve.appIcon)??""),editable:e==="edit"}),l.jsx("div",{ref:m,className:[ke.nodeTitle,D&&N?ke.nodeTitleLpRoot:"",D&&!N?ke.nodeTitleSub:""].filter(Boolean).join(" "),contentEditable:e==="edit",suppressContentEditableWarning:!0,onInput:W,onBlur:W,"data-placeholder":r.contextualEditor.untitledPlaceholder,"aria-label":r.contextualEditor.nodeTitleAriaLabel,children:k.name})]}),l.jsx(QD,{activeTab:n,onChange:q=>s(q),errorTabs:o,visibleTabs:N&&!D?void 0:["details"]}),l.jsx("div",{className:ke.formArea,children:l.jsx($O,{nodeMetadata:y,activeTab:n,isRoot:N,isFolder:F,editorMode:e,onFormValueChange:pe,onFormStatusChange:ge},`${h??"none"}:${N?"root":"node"}`)}),(F||N)&&n==="details"&&l.jsx("div",{className:[ke.contentListArea,D?ke.contentListAreaLp:""].filter(Boolean).join(" "),children:l.jsx(gR,{editorMode:e,isRoot:N})}),l.jsx(bR,{isActive:!1,label:r.contextualEditor.dropZoneLabel,nodeId:h??void 0,className:ke.dropZone}),u&&l.jsx($F,{contentId:T,onClose:()=>d(!1)})]})};function dm(e,t){for(const r of e){if(r.id===t)return r;if(r.children){const n=dm(r.children,t);if(n)return n}}}const fm=ro((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 o=[...t().allContent,...r];e({allContent:o,totalCount:n,offset:o.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:s}=t();let o=r;if(n&&n!=="all"){const a=n.toLowerCase();o=o.filter(i=>[i.mimeType??"",i.primaryCategory??"",i.contentType??""].join(" ").toLowerCase().includes(a))}if(s&&s.trim()!==""){const a=s.toLowerCase().trim();o=o.filter(i=>(i.name??"").toLowerCase().includes(a))}e({filteredContent:o})}}));function I2(e,t,r,n,s){const o={primaryCategory:[t?Th:"Course"]};return s&&(o.framework=[s]),!e&&r.length&&n&&(o[n]=r),o}function L2(e,t){if(!(!e||!t))return[...om,t,"framework"]}function D2(e,t,r,n,s,o=!1){return!e||o?null:t?r&&!n&&s.length===0?"noSkills":null:"noCurriculum"}const j2=20,N2=[];function hm(){var d;const e=X(f=>f.editorConfig),t=X(f=>f.editorProfile),r=oe(f=>f.selectedNodeId),n=oe(f=>f.treeData);if(t.restrictedContentCategories)return t.restrictedContentCategories;const s=g.useCallback(()=>{if(!r||!n.length)return 0;function f(p,m,C=0){var h;for(const v of p){if(v.id===m)return C;if((h=v.children)!=null&&h.length){const y=f(v.children,m,C+1);if(y>=0)return y}}return-1}return Math.max(0,f(n,r))},[r,n])(),o=(d=e==null?void 0:e.config)==null?void 0:d.hierarchy;if(!o)return[...ud];const a=`level${s}`,i=o[a],c=i==null?void 0:i.children,u=c==null?void 0:c.Content;return u!=null&&u.length?u:[...ud]}function O2(){const e=fm(),t=X(A=>{var P,R;return((R=(P=A.editorConfig)==null?void 0:P.context)==null?void 0:R.channel)??""}),r=hm(),n=X(A=>A.editorProfile),s=rt(A=>A.activeAssessmentSlot),o=rt(A=>A.activeLevelExamTarget),a=oe(A=>A.activeNodeMeta),i=oe(A=>A.treeData),c=oe(A=>A.treeCache),u=oe(A=>A.selectedNodeId),d=oe(A=>A.getNodeById),f=ur(),p=n.competencyScoped?Ah(i[0],c):void 0,m=g.useRef(),C=f&&Array.isArray(a[f.code])?a[f.code]:N2,h=u?d(u):void 0,v=n.competencyScoped&&!!(h!=null&&h.isFolder)&&!!h.parent&&!nt(h),y=!!s||!!o,b=D2(n.competencyScoped,p,v,s,C,y),S=g.useRef(0),x=g.useCallback(async(A="",P="all",R={},O=!0,U=!1)=>{var W,pe,ge,G,le;const re=++S.current;e.setLoading(!0);try{if(b){if(re!==S.current)return;e.setContent([],0);return}let te;if(n.competencyScoped){const M=I2(s,y,C,f==null?void 0:f.code,p);te={status:["Live"],...M}}else te={status:["Live"],primaryCategory:P&&P!=="all"?[P]:r},(W=R==null?void 0:R.board)!=null&&W.length&&(te.board=R.board),(pe=R==null?void 0:R.medium)!=null&&pe.length&&(te.medium=R.medium),(ge=R==null?void 0:R.gradeLevel)!=null&&ge.length&&(te.gradeLevel=R.gradeLevel),(G=R==null?void 0:R.subject)!=null&&G.length&&(te.subject=R.subject),(le=R==null?void 0:R.primaryCategory)!=null&&le.length&&(te.primaryCategory=R.primaryCategory);const xe=O?0:e.offset,{content:ve,count:q}=await CR({filters:te,query:A,limit:A?50:j2,offset:xe,channel:t||void 0,sortBy:U?{name:"asc"}:{lastUpdatedOn:"desc"},fields:L2(n.competencyScoped,f==null?void 0:f.code)});if(re!==S.current)return;O?e.setContent(ve,q):e.appendContent(ve,q)}catch(te){re===S.current&&console.error("[useLibrary] load error:",te)}finally{re===S.current&&e.setLoading(!1)}},[r,t,n,s,y,C,f,p,b]);g.useEffect(()=>{clearTimeout(m.current),e.setSearch("")},[p]),g.useEffect(()=>{x()},[t,n.key]),g.useEffect(()=>{n.competencyScoped&&x()},[n.competencyScoped,s,o,C.join("|"),p,u]);const w=g.useCallback(A=>{e.setSearch(A),clearTimeout(m.current),m.current=setTimeout(()=>x(A,e.activeFilter,e.advancedFilters,!0,e.sortAZ),300)},[e.activeFilter,e.advancedFilters,e.sortAZ,x]),T=g.useCallback(A=>{e.setFilter(A),x(e.searchQuery,A,e.advancedFilters,!0,e.sortAZ)},[e.searchQuery,e.advancedFilters,e.sortAZ,x]),D=g.useCallback(A=>{e.setAdvancedFilters(A),x(e.searchQuery,e.activeFilter,A,!0,e.sortAZ)},[e.searchQuery,e.activeFilter,e.sortAZ,x]),k=g.useCallback(()=>{const A=!e.sortAZ;e.setSortAZ(A),x(e.searchQuery,e.activeFilter,e.advancedFilters,!0,A)},[e.sortAZ,e.searchQuery,e.activeFilter,e.advancedFilters,x]),N=g.useCallback(()=>{e.isLoading||x(e.searchQuery,e.activeFilter,e.advancedFilters,!1,e.sortAZ)},[e.isLoading,e.searchQuery,e.activeFilter,e.advancedFilters,e.sortAZ,x]),F=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:F,search:w,setFilter:T,applyAdvancedFilters:D,toggleSort:k,loadMore:N,refetch:()=>x(e.searchQuery,e.activeFilter,e.advancedFilters,!0,e.sortAZ),activeAssessmentSlot:s,emptyReason:b}}function pm(){var c;const e=ie(),t=X(u=>u.editorProfile.competencyScoped),r=rt(u=>u.activeAssessmentSlot),n=rt(u=>u.activeLevelExamTarget),s=oe(u=>u.selectedNodeId),o=oe(u=>u.treeData),a=oe(u=>u.getNodeById),i=(c=o[0])==null?void 0:c.id;if(!t)return null;if(r==="pre")return e.learningPath.libraryAddPriorAssessmentCourse;if(r==="post")return e.learningPath.libraryAddOutcomeAssessmentCourse;if(n){const u=a(n);return e.learningPath.libraryAddLevelExamCourse.replace("{level}",(u==null?void 0:u.name)??"")}if(s&&s!==i){const u=a(s);if(u!=null&&u.isFolder)return e.learningPath.libraryAddToLevel.replace("{level}",u.name??"")}return e.learningPath.libraryOpenLevelToAdd}const P2="_card_1o49q_1",R2="_addBtn_1o49q_17",F2="_dragging_1o49q_24",M2="_ctIcon_1o49q_29",B2="_info_1o49q_33",q2="_name_1o49q_41",$2="_meta_1o49q_50",U2="_skillTags_1o49q_58",z2="_skillTag_1o49q_58",V2="_addBtnMuted_1o49q_93",H2="_added_1o49q_102",Q2="_addedBadge_1o49q_111",Yt={card:P2,addBtn:R2,dragging:F2,ctIcon:M2,info:B2,name:q2,meta:$2,skillTags:U2,skillTag:z2,addBtnMuted:V2,added:H2,addedBadge:Q2},W2={video:_a,pdf:to,h5p:Ca,scorm:xa,audio:Sa,quiz:ba,course:Cr,default:Gr},G2=({item:e,onAdd:t,onPreview:r,isDraggable:n,isAdded:s})=>{var S,x;const o=ie(),a=lo(e),i=W2[a.key]??Gr,c=Kl(),u=vL(),d=c&&!s&&u,f=X(w=>w.editorProfile.competencyScoped),p=ur(),m=f&&p?(()=>{const w=e[p.code];return Array.isArray(w)?w:w?[String(w)]:[]})():[],{attributes:C,listeners:h,setNodeRef:v,isDragging:y}=Mf({id:e.identifier,disabled:!n||!c||!u,data:{type:"library-item",item:e}}),b=()=>{r&&r(e)};return l.jsxs("div",{ref:v,className:[Yt.card,y?Yt.dragging:"",s?Yt.added:""].join(" "),"aria-label":e.name,...n?{...C,...h}:{},role:"listitem",onClick:b,children:[l.jsx("span",{className:[`sbx-ct-sq--${a.key}`,Yt.ctIcon].join(" "),"aria-hidden":"true",children:l.jsx(i,{size:14})}),l.jsxs("div",{className:Yt.info,children:[l.jsx("span",{className:Yt.name,title:e.name,children:e.name}),l.jsxs("span",{className:Yt.meta,children:[((S=e.organisation)==null?void 0:S[0])??e.channel??"",(x=e.organisation)!=null&&x[0]&&e.primaryCategory?" · ":"",e.primaryCategory??""]}),m.length>0&&l.jsx("span",{className:Yt.skillTags,children:m.slice(0,3).map(w=>l.jsx("span",{className:Yt.skillTag,children:w},w))})]}),s&&l.jsx("span",{className:Yt.addedBadge,"aria-label":o.libraryCard.alreadyAddedAriaLabel,title:o.libraryCard.alreadyAddedTitle,children:l.jsx(Sn,{size:12})}),!s&&n&&l.jsx("button",{type:"button",className:[Yt.addBtn,!d&&c?Yt.addBtnMuted:""].join(" "),onClick:w=>{w.stopPropagation(),t(e)},disabled:!c,"aria-disabled":!d,"aria-label":o.libraryCard.addItemAriaLabel.replace("{name}",e.name),title:c?u?o.libraryCard.addToUnitTitle:o.libraryCard.selectUnitToAddTitle:o.libraryCard.draftOnlyTitle,children:l.jsx(kr,{size:14})})]})},K2="_chips_xhhaq_1",Y2="_chip_xhhaq_1",Pd={chips:K2,chip:Y2},Z2=({filters:e,active:t,onChange:r})=>{const n=ie();return l.jsx("div",{className:Pd.chips,role:"group","aria-label":n.filterChips.contentTypeFiltersAriaLabel,children:e.map(s=>l.jsx("button",{type:"button",role:"radio","aria-checked":t===s.value,className:["sbx-chip",t===s.value?"filled":"outline",Pd.chip].join(" "),onClick:()=>r(s.value),children:s.label},s.value))})},X2="_panel_1iejx_1",J2="_header_1iejx_10",eB="_headerTitle_1iejx_19",tB="_closeBtn_1iejx_25",rB="_body_1iejx_43",nB="_section_1iejx_59",sB="_sectionLabel_1iejx_65",oB="_chips_1iejx_73",aB="_chip_1iejx_73",iB="_active_1iejx_96",lB="_footer_1iejx_102",cB="_resetBtn_1iejx_112",uB="_applyBtn_1iejx_129",pt={panel:X2,header:J2,headerTitle:eB,closeBtn:tB,body:rB,section:nB,sectionLabel:sB,chips:oB,chip:aB,active:iB,footer:lB,resetBtn:cB,applyBtn:uB},dB=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}],fB=new Set(["board","medium","gradeLevel","subject","topic"]),hB=({local:e,toggle:t})=>{const r=ie(),n=hm();return n.length?l.jsxs("div",{className:pt.section,children:[l.jsx("div",{className:pt.sectionLabel,children:r.libraryFilterPanel.primaryCategoryLabel}),l.jsx("div",{className:pt.chips,children:n.map(s=>l.jsx("button",{type:"button",className:[pt.chip,(e.primaryCategory??[]).includes(s)?pt.active:""].join(" "),onClick:()=>t("primaryCategory",s),children:s},s))})]}):null},pB=({isOpen:e,filters:t,onApply:r,onClose:n})=>{var v,y;const s=ie(),o=X(b=>b.editorConfig),a=X(b=>b.searchFormConfig),i=X(b=>b.contentFramework),c=X(b=>b.contentTargetFWIds),{organisationFramework:u}=Ia(i??((v=o==null?void 0:o.context)==null?void 0:v.framework),c??((y=o==null?void 0:o.context)==null?void 0:y.targetFWIds)),[d,f]=g.useState(t),p=a!=null&&a.length?a.filter(b=>fB.has(b.code)).map(b=>({key:b.code,label:b.label||b.code})):dB(s);g.useEffect(()=>{f(t)},[t]);const m=(b,S)=>{f(x=>{const w=x[b]??[],T=w.includes(S)?w.filter(D=>D!==S):[...w,S];return{...x,[b]:T}})},C=(u==null?void 0:u.categories)??[],h=b=>{var S;return((S=C.find(x=>x.code===b))==null?void 0:S.terms)??[]};return e?l.jsxs("div",{className:pt.panel,role:"dialog","aria-label":s.libraryFilterPanel.filterLibraryAriaLabel,"aria-modal":"true",children:[l.jsxs("div",{className:pt.header,children:[l.jsx("span",{className:pt.headerTitle,children:s.libraryFilterPanel.filtersHeaderTitle}),l.jsx("button",{type:"button",className:pt.closeBtn,onClick:n,"aria-label":s.libraryFilterPanel.closeFiltersAriaLabel,children:l.jsx(lr,{size:16})})]}),l.jsxs("div",{className:pt.body,children:[p.map(({key:b,label:S})=>{const x=h(b);return x.length?l.jsxs("div",{className:pt.section,children:[l.jsx("div",{className:pt.sectionLabel,children:S}),l.jsx("div",{className:pt.chips,children:x.slice(0,20).map(w=>l.jsx("button",{type:"button",className:[pt.chip,(d[b]??[]).includes(w.name)?pt.active:""].join(" "),onClick:()=>m(b,w.name),children:w.name},w.identifier))})]},b):null}),l.jsx(hB,{local:d,toggle:m})]}),l.jsxs("div",{className:pt.footer,children:[l.jsx("button",{type:"button",className:pt.resetBtn,onClick:()=>f({}),children:s.libraryFilterPanel.resetButton}),l.jsx("button",{type:"button",className:pt.applyBtn,onClick:()=>{r(d),n()},children:s.libraryFilterPanel.applyButton})]})]}):null},mB="_header_1n6zo_10",gB="_headerCourse_1n6zo_20",vB="_courseIcon_1n6zo_25",yB="_titleGroup_1n6zo_37",bB="_courseMeta_1n6zo_45",CB="_title_1n6zo_37",SB="_headerActions_1n6zo_67",xB="_iconBtn_1n6zo_74",_B="_playerArea_1n6zo_92",wB="_footer_1n6zo_100",TB="_footerCourse_1n6zo_109",EB="_addBtn_1n6zo_115",AB="_addBtnCourse_1n6zo_134",kB="_modalOverlay_1n6zo_159",IB="_modalOverlayCourse_1n6zo_174",LB="_modalPanel_1n6zo_178",DB="_modalPanelCourse_1n6zo_190",vt={header:mB,headerCourse:gB,courseIcon:vB,titleGroup:yB,courseMeta:bB,title:CB,headerActions:SB,iconBtn:xB,playerArea:_B,footer:wB,footerCourse:TB,addBtn:EB,addBtnCourse:AB,modalOverlay:kB,modalOverlayCourse:IB,modalPanel:LB,modalPanelCourse:DB},jB="application/vnd.sunbird.questionset",NB=({content:e,editorMode:t,onAdd:r,onClose:n})=>{var f;const s=ie(),o=t==="edit",a=X(p=>p.editorProfile.competencyScoped),i=pm();if(!e)return null;const c=a&&(e.primaryCategory==="Course"||mn(e)),u=[((f=e.organisation)==null?void 0:f[0])??e.channel??"",e.primaryCategory??""].filter(Boolean).join(" • "),d={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 Tr.createPortal(l.jsx("div",{className:[vt.modalOverlay,c?vt.modalOverlayCourse:""].filter(Boolean).join(" "),role:"dialog","aria-modal":"true","aria-label":s.libraryPreviewPanel.contentPreviewAriaLabel,onClick:n,children:l.jsxs("div",{className:[vt.modalPanel,c?vt.modalPanelCourse:""].filter(Boolean).join(" "),onClick:p=>p.stopPropagation(),children:[l.jsxs("div",{className:[vt.header,c?vt.headerCourse:""].filter(Boolean).join(" "),children:[c&&l.jsx("span",{className:vt.courseIcon,children:l.jsx(Cr,{size:20})}),l.jsxs("div",{className:vt.titleGroup,children:[l.jsx("span",{className:vt.title,title:e.name,children:e.name}),c&&u&&l.jsx("span",{className:vt.courseMeta,children:u})]}),l.jsx("div",{className:vt.headerActions,children:l.jsx("button",{type:"button",className:vt.iconBtn,onClick:n,"aria-label":s.libraryPreviewPanel.closePreviewAriaLabel,children:l.jsx(lr,{size:16})})})]}),l.jsx("div",{className:vt.playerArea,children:c?l.jsx(cm,{courseId:e.identifier}):l.jsx(gl,{node:d,editorMode:"read",type:e.mimeType===jB?"quml":"content"})}),o&&l.jsx("div",{className:[vt.footer,c?vt.footerCourse:""].filter(Boolean).join(" "),children:c?l.jsxs("button",{type:"button",className:vt.addBtnCourse,onClick:()=>r(e),children:[l.jsx(kr,{size:15})," ",i??s.libraryPreviewPanel.addToUnitButton]}):l.jsx("button",{type:"button",className:vt.addBtn,onClick:()=>r(e),children:s.libraryPreviewPanel.addToUnitButton})})]})}),document.body)},OB="_dock_j39wj_1",PB="_header_j39wj_8",RB="_libraryTargetLabel_j39wj_18",FB="_libraryTargetChip_j39wj_28",MB="_headerLeft_j39wj_46",BB="_headerTitle_j39wj_54",qB="_count_j39wj_60",$B="_searchRow_j39wj_69",UB="_searchWrap_j39wj_77",zB="_searchIcon_j39wj_83",VB="_searchInput_j39wj_92",HB="_filterToggleBtn_j39wj_110",QB="_filterToggleBtnActive_j39wj_129",WB="_filterBadge_j39wj_135",GB="_filters_j39wj_154",KB="_mainArea_j39wj_164",YB="_sidePanelOverlay_j39wj_173",ZB="_cardList_j39wj_182",XB="_skeleton_j39wj_198",JB="_skeletonIcon_j39wj_208",eq="_skeletonText_j39wj_216",tq="_skeletonLine_j39wj_223",rq="_skeletonLineSm_j39wj_230",nq="_loadMoreBtn_j39wj_245",sq="_emptyState_j39wj_270",oq="_collapseBtn_j39wj_290",ze={dock:OB,header:PB,libraryTargetLabel:RB,libraryTargetChip:FB,headerLeft:MB,headerTitle:BB,count:qB,searchRow:$B,searchWrap:UB,searchIcon:zB,searchInput:VB,filterToggleBtn:HB,filterToggleBtnActive:QB,filterBadge:WB,filters:GB,mainArea:KB,sidePanelOverlay:YB,cardList:ZB,skeleton:XB,skeletonIcon:JB,skeletonText:eq,skeletonLine:tq,skeletonLineSm:rq,loadMoreBtn:nq,emptyState:sq,collapseBtn:oq},aq=[{label:"Courses",value:"all"}];function iq(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 lq=({editorMode:e,collapsed:t=!1,onToggleCollapse:r})=>{const n=ie(),{content:s,isLoading:o,totalCount:a,activeFilter:i,searchQuery:c,sortAZ:u,hasMore:d,search:f,setFilter:p,applyAdvancedFilters:m,toggleSort:C,loadMore:h,activeAssessmentSlot:v,emptyReason:y}=O2(),{addResource:b,selectedNodeId:S,treeData:x,treeCache:w}=oe(),T=rt($=>$.setActiveAssessmentSlot),D=rt($=>$.activeLevelExamTarget),k=rt($=>$.setActiveLevelExamTarget),N=X($=>$.editorProfile.competencyScoped),F=X($=>$.editorProfile.restrictedContentCategories),A=e==="edit",P=pm(),[R,O]=g.useState(!1),[U,re]=g.useState({}),[W,pe]=g.useState(null),ge=g.useMemo(()=>iq(x),[x]),G=g.useCallback(($,se)=>{var fe,ye;const ae=(fe=x[0])==null?void 0:fe.id;if(!ae)return;if(qs(((ye=x[0])==null?void 0:ye.children)??[],se)){me.error(se==="pre"?n.learningPath.priorSlotFilledToast:n.learningPath.outcomeSlotFilledToast);return}if(!mn($)){me.error(n.learningPath.notAssessmentCourseToast.replace("{name}",$.name));return}if(b($,ae,{isAssessmentCourse:!0,slot:se})===!1){me.error(n.learningPath.bothSlotsFilledToast);return}me.success(n.libraryDock.itemAddedToast.replace("{name}",$.name)),T(null)},[x,b,T,n]),le=g.useCallback(($,se)=>{var ye;const ae=oe.getState().getNodeById(se);if(!ae)return;if(Eh(ae)){me.error(n.learningPath.levelExamAlreadyFilledToast);return}if(!mn($)){me.error(n.learningPath.notAssessmentCourseToast.replace("{name}",$.name));return}const Se=((ye=x[0])==null?void 0:ye.children)??[];if(iu(Se,ae)){me.error(n.learningPath.levelNeedsMixedContentToast);return}if(b($,se,{isAssessmentCourse:!0})===!1){me.error(n.learningPath.itemAlreadyInPathToast.replace("{name}",$.name));return}me.success(n.libraryDock.itemAddedToast.replace("{name}",$.name)),k(null)},[x,b,k,n]),te=g.useCallback($=>{var fe,ye,Ae,J;if(v){G($,v);return}if(D){le($,D);return}if(N&&!kh(x[0],w)){me.error(n.learningPath.selectCurriculumFirstToast);return}if(!S){me.error(N?n.learningPath.selectLevelFirstToast:n.libraryDock.selectUnitFirstToast);return}const se=(fe=x[0])==null?void 0:fe.id,ae=oe.getState().getNodeById(S);if(N){const he=((ye=x[0])==null?void 0:ye.children)??[],H=ae!=null&&ae.isFolder?ae:ae!=null&&ae.parent?oe.getState().getNodeById(ae.parent):void 0;if(H&&Zi(he,H)){const be=(Ae=he[0])==null?void 0:Ae.id;me.error(H.id===be?n.learningPath.priorSlotFilledToast:n.learningPath.outcomeSlotFilledToast);return}}if(S===se||!(ae!=null&&ae.isFolder)){me(N?n.learningPath.selectLevelFromOutlineToast:n.libraryDock.selectUnitFromOutlineToast,{icon:l.jsx(qn,{size:16}),duration:4e3});return}if(N&&iu(((J=x[0])==null?void 0:J.children)??[],ae)&&mn($)){me.error(n.learningPath.levelNeedsMixedContentToast);return}if(b($,S)===!1){me.error((N?n.learningPath.itemAlreadyInPathToast:n.libraryDock.itemAlreadyAddedToast).replace("{name}",$.name));return}me.success(n.libraryDock.itemAddedToast.replace("{name}",$.name))},[v,G,D,le,S,b,x,w,n,N]),xe=g.useCallback($=>{re($),m($)},[m]),ve=g.useCallback($=>{pe($)},[]),q=g.useCallback($=>{te($),pe(null)},[te]),M=g.useMemo(()=>Object.values(U).reduce(($,se)=>$+((se==null?void 0:se.length)??0),0),[U]);return l.jsxs("div",{className:ze.dock,children:[l.jsxs("div",{className:ze.header,children:[l.jsxs("div",{className:ze.headerLeft,children:[l.jsx("button",{type:"button",className:ze.collapseBtn,onClick:r,"aria-label":n.libraryDock.collapseLibraryPanelAriaLabel,title:n.libraryDock.collapseLibraryTitle,children:l.jsx(By,{size:15})}),l.jsx(Py,{size:16}),l.jsx("span",{className:ze.headerTitle,children:n.libraryDock.headerTitle}),a>0&&l.jsx("span",{className:ze.count,children:a})]}),P&&(v||D?l.jsxs("button",{type:"button",className:ze.libraryTargetChip,onClick:()=>T(null),"aria-label":n.libraryDock.cancelTargetAriaLabel,title:n.libraryDock.cancelTargetAriaLabel,children:[l.jsx("span",{className:ze.libraryTargetLabel,children:P}),l.jsx(lr,{size:11,"aria-hidden":"true"})]}):l.jsx("span",{className:ze.libraryTargetLabel,children:P}))]}),l.jsxs("div",{className:ze.searchRow,children:[l.jsxs("div",{className:ze.searchWrap,children:[l.jsx(Jo,{size:14,className:ze.searchIcon}),l.jsx("input",{type:"search",className:ze.searchInput,placeholder:n.libraryDock.searchPlaceholder,value:c,onChange:$=>f($.target.value),"aria-label":n.libraryDock.searchAriaLabel})]}),l.jsx("button",{type:"button",className:[ze.filterToggleBtn,u?ze.filterToggleBtnActive:""].join(" "),onClick:C,"aria-label":u?n.libraryDock.sortAZAriaLabel:n.libraryDock.sortRecentAriaLabel,title:u?n.libraryDock.sortAZTitle:n.libraryDock.sortRecentTitle,children:u?l.jsx(wy,{size:15}):l.jsx(Iy,{size:15})}),!N&&l.jsxs("button",{type:"button",className:[ze.filterToggleBtn,R?ze.filterToggleBtnActive:""].join(" "),onClick:()=>O($=>!$),"aria-label":n.libraryDock.toggleAdvancedFiltersAriaLabel,"aria-pressed":R,title:n.libraryDock.advancedFiltersTitle,children:[l.jsx(Wy,{size:15}),M>0&&l.jsx("span",{className:ze.filterBadge,children:M})]})]}),l.jsx("div",{className:ze.filters,children:l.jsx(Z2,{filters:N?aq:F?[fi[0],...fi.filter($=>F.includes($.value))]:fi,active:i,onChange:p})}),l.jsxs("div",{className:ze.mainArea,children:[l.jsx("div",{className:ze.cardList,role:"list","aria-label":n.libraryDock.libraryContentAriaLabel,children:o&&s.length===0?Array.from({length:4}).map(($,se)=>l.jsxs("div",{className:ze.skeleton,"aria-hidden":"true",children:[l.jsx("div",{className:ze.skeletonIcon}),l.jsxs("div",{className:ze.skeletonText,children:[l.jsx("div",{className:ze.skeletonLine}),l.jsx("div",{className:ze.skeletonLineSm})]})]},se)):s.length>0?l.jsxs(l.Fragment,{children:[s.map($=>l.jsx(G2,{item:$,onAdd:te,onPreview:ve,isDraggable:A,isAdded:ge.has($.identifier)},$.identifier)),d&&l.jsx("button",{type:"button",className:ze.loadMoreBtn,onClick:h,disabled:o,"aria-label":n.libraryDock.loadMoreAriaLabel,children:o?n.libraryDock.loadingText:n.libraryDock.loadMoreText})]}):l.jsxs("div",{className:ze.emptyState,children:[l.jsx(Jo,{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})]})]})}),R&&l.jsx("div",{className:ze.sidePanelOverlay,children:l.jsx(pB,{isOpen:R,filters:U,onApply:xe,onClose:()=>O(!1)})}),W&&l.jsx(NB,{content:W,editorMode:e,onAdd:q,onClose:()=>pe(null)})]})]})};function cq(e,t,r,n=wa){const s={},o={},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","industry","domain","dialcodes"]),u=new Set(["copyrightYear","compatibilityLevel","version"]);function d(m,C=!1){const h={};for(const[v,y]of Object.entries(m))if(!a.has(v)&&!(C&&i.has(v)))if(c.has(v))Array.isArray(y)?h[v]=y:y!=null&&y!==""?h[v]=[y]:h[v]=[];else if(u.has(v)){const b=Number(y);isNaN(b)||(h[v]=b)}else h[v]=y;return h}function f(m){var h;const C={};for(const v of m.children??[]){if(v.isFolder)continue;const y=t[v.identifier];if(!y)continue;const{isNew:b,...S}=y;if(Object.keys(S).length===0)continue;const x=((h=v.metadata)==null?void 0:h.relationalMetadata)??{};C[v.identifier]={name:v.name,...x,...S}}return C}function p(m,C){var x,w;const h=m.identifier,v=t[h],y=h.startsWith("temp-")||!!(v!=null&&v.isNew),b=!m.isFolder&&!C;if(C||y||v&&!b){let T;if(y)T={mimeType:"application/vnd.ekstep.content-collection",code:h,contentType:((x=m.metadata)==null?void 0:x.contentType)??n.unitContentType,primaryCategory:((w=m.metadata)==null?void 0:w.primaryCategory)??n.unitPrimaryCategory,name:m.name,visibility:"Parent",channel:r,...d(m.metadata??{})};else if(C){const{isNew:D,...k}=v??{};T={...d(m.metadata??{},!0),...d(k,!1),name:m.name}}else{const{isNew:D,...k}=v??{};T={name:m.name,visibility:"Parent",...d(k,!0)}}s[h]={metadata:T,objectType:m.objectType||(m.isFolder?"Collection":"Content"),root:C,isNew:y}}const S=m.isFolder?f(m):{};o[h]={name:m.name,children:(m.children??[]).map(T=>T.identifier),...Object.keys(S).length>0?{relationalMetadata:S}:{},root:C},(m.children??[]).forEach(T=>p(T,!1))}return e.forEach((m,C)=>p(m,C===0)),{nodesModified:s,hierarchy:o}}function uq(){const[e,t]=g.useState(!1),r=oe(d=>d.treeCache),n=oe(d=>d.treeData),s=X(d=>d.isDirty),o=X(d=>d.lastSaved),{setIsDirty:a,setLastSaved:i}=X(),c=X(d=>d.editorConfig);return{save:g.useCallback(async()=>{if(!c||e)return;const d=c.context.contentId??c.context.identifier??"";if(!d)return;if(n.length===0){me.error("Collection is empty. Please reload before saving.");return}const f=c.context.channel??"",p=c.context.userId??c.context.uid??"";t(!0);try{const m=X.getState().editorProfile,{nodesModified:C,hierarchy:h}=cq(n,r,f,m),{identifiers:v}=await iT(d,C,h,p);v&&Object.keys(v).length>0&&oe.getState().replaceNodeIds(v);const y=new Date().toISOString();i(y),a(!1)}catch(m){console.error("[useSaveHierarchy] save failed:",m),me.error("Failed to save. Please try again.")}finally{t(!1)}},[c,e,n,r,a,i]),isSaving:e,isDirty:s,lastSaved:o}}const dq={};function fq(e){return e==null||e===""||Array.isArray(e)&&e.length===0}function hq(e,t,r,n,s,o=dq){const a=[],i=(c,u)=>{var d;for(const f of c){const p=u&&!f.parent,m=p?r:f.isFolder?n:null;if(m&&m.length>0){const C={...f.metadata??{},...t[f.id]??{}},v=Wp(m,C,o,p,s).filter(y=>y.required&&y.visible!==!1&&y.inputType!=="appIcon"&&fq(y.currentValue)).map(y=>y.label);v.length>0&&a.push({nodeId:f.id,nodeName:f.name||"Untitled",missing:v})}(d=f.children)!=null&&d.length&&i(f.children,!1)}};return i(e,!0),a}function pq(e){var S,x;const t=X(w=>w.editorConfig),r=X(w=>w.editorProfile),n=X(w=>w.setButtonLoader),s=X(w=>w.validateAllForms),o=X(w=>w.rootFormConfig),a=X(w=>w.unitFormConfig),i=oe(w=>w.treeData),c=oe(w=>w.treeCache),u=oe(w=>w.selectNode),d=ur(),{scope:f}=io(),p=X(w=>w.contentFramework),m=X(w=>w.contentTargetFWIds),{organisationFramework:C,targetFrameworks:h}=Ia(p??((S=t==null?void 0:t.context)==null?void 0:S.framework),m??((x=t==null?void 0:t.context)==null?void 0:x.targetFWIds)),v=g.useCallback(()=>{var N,F,A;const w={editorMode:"edit",objectType:(N=t==null?void 0:t.config)==null?void 0:N.objectType,userFullName:(A=(F=t==null?void 0:t.context)==null?void 0:F.user)==null?void 0:A.fullName},T=hq(i,c,o,a,w,{organisationFramework:C,targetFrameworks:h});if(T.length===0)return!0;const D=T[0];me.error(`"${D.nodeName}": please fill required field${D.missing.length>1?"s":""} — ${D.missing.join(", ")}`);const{setFormStatus:k}=X.getState();return T.forEach(P=>k(P.nodeId,!1)),u(D.nodeId),!1},[i,c,o,a,t,u,C,h]),y=g.useCallback(()=>{if(r.key!=="learningPath")return!0;const w=ql(i[0],d==null?void 0:d.code,f,c);return w.length===0?!0:(me.error(w[0].message),!1)},[r.key,i,c,d,f]);return{runAction:g.useCallback(async(w,T)=>{var N,F,A,P;const D=((N=t==null?void 0:t.context)==null?void 0:N.contentId)??((F=t==null?void 0:t.context)==null?void 0:F.identifier)??"";if(!D)return me.error("No content identifier found."),!1;const k=((A=t==null?void 0:t.context)==null?void 0:A.userId)??((P=t==null?void 0:t.context)==null?void 0:P.uid)??"";try{switch(w){case"sendForReview":return v()?s(i)?y()?(n("saveCollection",!0),await e(),await uT(D),me.success("Content sent for review"),!0):!1:(me.error("Some units have missing required fields. Please fill them before sending for review."),!1):!1;case"reject":{n("rejectCollection",!0);const R=(T==null?void 0:T.comment)??"";return await dT(D,R),me.success("Content rejected and sent back to the author"),!0}case"publish":return v()?s(i)?y()?(n("publishCollection",!0),await e(),await lT(D,k),me.success("Content published successfully"),!0):!1:(me.error("Some units have missing required fields. Please fill them before publishing."),!1):!1;default:return!1}}catch(R){console.error(`[useToolbarActions] ${w} failed`,R);const O=w==="sendForReview"?"send for review":w==="reject"?"reject":"publish";return me.error(`Failed to ${O}. Please try again.`),!1}finally{n("saveCollection",!1),n("rejectCollection",!1),n("publishCollection",!1)}},[t,e,n,v,y,s,i]),checkRequiredFields:v}}function mq(){const e=ie(),t=X(c=>c.editorProfile.key==="learningPath"),r=oe(c=>c.treeData),n=ur(),{scope:s,source:o}=io(),a=g.useRef(!1),i=g.useRef("");g.useEffect(()=>{if(!t||o!=="prior"||!n)return;const c=bT(r[0],n.code,s),u=c.map(d=>d.id).sort().join(",");a.current?c.length>0&&u!==i.current&&me.error(e.learningPath.priorAssessmentNarrowedScopeToast.replace("{count}",String(c.length))):a.current=!0,i.current=u},[t,o,s.join("|"),n==null?void 0:n.code,r])}function gq(){const e=X(a=>a.editorProfile.key==="learningPath"),t=oe(a=>a.treeData),r=oe(a=>a.treeCache),n=oe(a=>a.updateNode),s=ur(),o=s==null?void 0:s.code;g.useEffect(()=>{if(!e||!o)return;const a=t[0],i=yT(a,o,r);i!==null&&n(a.id,{[o]:i},[o])},[e,t,r,o,n])}const vq="_shell_1k9or_1",yq="_workspace_1k9or_8",bq="_sidebarCollapsed_1k9or_16",Cq="_dockCollapsed_1k9or_19",Sq="_dock_1k9or_19",xq="_outline_1k9or_40",_q="_reopenTab_1k9or_45",wq="_outlineHidden_1k9or_79",Tq="_editor_1k9or_86",Eq="_editorLp_1k9or_92",Aq="_dockHidden_1k9or_105",kq="_dockReopenTab_1k9or_112",Iq="_dragChip_1k9or_137",Lq="_dragChipLabel_1k9or_152",Ot={shell:vq,workspace:yq,sidebarCollapsed:bq,dockCollapsed:Cq,dock:Sq,outline:xq,reopenTab:_q,outlineHidden:wq,editor:Tq,editorLp:Eq,dockHidden:Aq,dockReopenTab:kq,dragChip:Iq,dragChipLabel:Lq},Dq=({editorMode:e,onToolbarEvent:t,onContentAdded:r,onHierarchySaved:n})=>{const s=ie(),[o,a]=g.useState(null),[i,c]=g.useState(!1),[u,d]=g.useState(!1),[f,p]=g.useState(!1);mq(),gq();const{addResource:m,treeData:C,treeCache:h}=oe(),v=X(W=>W.setFormStatus),y=X(W=>W.editorProfile.key==="learningPath"),[b,S]=g.useState(!0),x=oe(W=>W.selectedNodeId),{save:w,isSaving:T,isDirty:D,lastSaved:k}=uq(),{runAction:N,checkRequiredFields:F}=pq(w);g.useEffect(()=>{if(!D)return;const W=pe=>{pe.preventDefault(),pe.returnValue=""};return window.addEventListener("beforeunload",W),()=>window.removeEventListener("beforeunload",W)},[D]);const A=bf(Fi(ga,{activationConstraint:{distance:8}})),P=g.useCallback(W=>{var ge;const pe=(ge=W.active.data.current)==null?void 0:ge.item;pe&&a(pe)},[]),R=g.useCallback(W=>{var q,M,$,se,ae;a(null);const pe=(q=W.active.data.current)==null?void 0:q.item;if(!pe)return;if(y&&!kh(C[0],h)){me.error(s.learningPath.selectCurriculumFirstToast);return}const ge=W.over,G=(ge==null?void 0:ge.id)??x??void 0,le=y?s.learningPath.dropOntoLevelError:s.splitBuilderShell.dropOntoUnitError;if(!G){me.error(le);return}const te=(M=C[0])==null?void 0:M.id;if(G===te){me.error(y?s.learningPath.dropOntoPathError:s.splitBuilderShell.dropOntoCourseError);return}const xe=oe.getState().getNodeById(G);if(!(xe!=null&&xe.isFolder)){me.error(le);return}if(y&&nt(xe)){const Se=(ae=(se=($=C[0])==null?void 0:$.children)==null?void 0:se[0])==null?void 0:ae.id;me.error(xe.id===Se?s.learningPath.priorSlotFilledToast:s.learningPath.outcomeSlotFilledToast);return}if(!m(pe,G)){me.error((y?s.learningPath.itemAlreadyInPathToast:s.splitBuilderShell.alreadyInCollectionError).replace("{name}",pe.name));return}r==null||r(pe,G),me.success((y?s.learningPath.addedToLevelSuccess:s.splitBuilderShell.addedToUnitSuccess).replace("{name}",pe.name))},[x,m,C,h,r,s,y]),O=g.useCallback(async W=>{if(W.action==="onFormStatusChange"){const{isValid:pe,nodeId:ge}=W.data??{},G=pe!==!1;S(G),ge&&v(ge,G);return}if(W.action==="back"&&D&&e==="edit"){p(!0);return}if(W.action==="saveCollection"){if(!b){me.error(s.splitBuilderShell.fillRequiredMetadataError);return}if(!F())return;await w(),n==null||n(C),t==null||t(W);return}if(W.action==="sendForReview"||W.action==="reject"||W.action==="publish"){await N(W.action,W.data)&&(t==null||t(W));return}t==null||t(W)},[w,N,F,t,n,C,D,b,e,s]),U=g.useCallback(async()=>{if(!F()){p(!1);return}await w(),p(!1),n==null||n(C),t==null||t({action:"back"})},[w,F,n,t,C]),re=g.useCallback(()=>{p(!1),t==null||t({action:"back"})},[t]);return l.jsxs($i,{sensors:A,onDragStart:P,onDragEnd:R,children:[l.jsxs("div",{className:Ot.shell,children:[l.jsx(n0,{editorMode:e,isSaving:T,isDirty:D,lastSaved:k,isFormValid:b,onToolbarEvent:O}),l.jsxs("div",{className:[Ot.workspace,i?Ot.sidebarCollapsed:"",u?Ot.dockCollapsed:""].filter(Boolean).join(" "),children:[l.jsx("aside",{className:[Ot.outline,i?Ot.outlineHidden:""].join(" "),"aria-label":s.splitBuilderShell.outlineAriaLabel,"aria-hidden":i,children:l.jsx(PD,{editorMode:e,collapsed:i,onToggleCollapse:()=>c(W=>!W)})}),i&&l.jsx("button",{className:Ot.reopenTab,onClick:()=>c(!1),title:s.splitBuilderShell.showOutlineTitle,type:"button",children:"›"}),l.jsx("main",{className:[Ot.editor,y?Ot.editorLp:""].filter(Boolean).join(" "),role:"main","aria-label":s.splitBuilderShell.editorAriaLabel,children:l.jsx(k2,{editorMode:e,onToolbarEvent:O})}),l.jsx("aside",{className:[Ot.dock,u?Ot.dockHidden:""].filter(Boolean).join(" "),"aria-label":s.splitBuilderShell.libraryAriaLabel,"aria-hidden":u,children:l.jsx(lq,{editorMode:e,collapsed:u,onToggleCollapse:()=>d(W=>!W)})}),u&&l.jsx("button",{className:Ot.dockReopenTab,onClick:()=>d(!1),title:s.splitBuilderShell.showLibraryTitle,type:"button",children:"‹"})]})]}),l.jsx(by,{dropAnimation:null,children:o?l.jsx("div",{className:Ot.dragChip,children:l.jsx("span",{className:Ot.dragChipLabel,children:o.name})}):null}),f&&l.jsx(s0,{onSave:U,onDiscard:re,onCancel:()=>p(!1),isSaving:T})]})},jq="v1";function Nq(e){const t=e.validations,r=t==null?void 0:t.find(s=>s.type==="maxlength"||s.type==="maxLength");if(!r)return e.maxLength;const n=Number(r.value);return Number.isFinite(n)?n:void 0}function Rd(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:Nq(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 Nr(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 s=n.name??void 0,o=n.fields.filter(a=>!!a.code).sort((a,i)=>(a.index??0)-(i.index??0));for(const a of o)r.push(Rd(a,s))}else n.code&&r.push(Rd(n));return r}function Oq(e){const t=e==null?void 0:e.properties;if(!t)return{};const r={};for(const[n,s]of Object.entries(t))s&&"default"in s&&(r[n]=s.default);return r}async function Pq(e,t,r="Collection",n=jq){var u,d;const o=(d=(u=(await Fe.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:u.result)==null?void 0:d.objectCategoryDefinition,a=(o==null?void 0:o.forms)??{},i=(o==null?void 0:o.objectMetadata)??{},c=i.config??{};return{rootForm:Nr(a.create),unitForm:Nr(a.unitMetadata),childForm:Nr(a.childMetadata),searchForm:Nr(a.search??a.searchConfig),relationalForm:Nr(a.relationalMetadata),publishChecklist:Nr(a.publishchecklist),reviewChecklist:Nr(a.review),rfcChecklist:Nr(a.requestforchangeschecklist),schemaDefaults:Oq(i.schema),frameworkMetadata:c.frameworkMetadata??{},sourcingSettings:c.sourcingSettings??{}}}function Fd(e,t,r){return{framework:e.framework??t??r.framework??null,targetFWIds:e.targetFWIds??r.targetFWIds??null}}function Rq({config:e,onError:t}){const[r,n]=g.useState(!0),[s,o]=g.useState(null),[a,i]=g.useState(!1),{setEditorConfig:c,setEditorMode:u,setCategoryDefinition:d,setContentFramework:f,setEditorProfile:p}=X(),{setTreeData:m,selectNode:C}=oe();return g.useEffect(()=>{let h=!1;async function v(){var y,b,S;try{n(!0),o(null),e.apiBaseUrl&&Ch(e.apiBaseUrl),c(e),u(e.config.mode),p(pb(e));const x=e.context.contentId??e.context.identifier??"",w=e.context.channel??"";let T;if(w)try{T=(y=await Hp(w))==null?void 0:y.defaultFramework}catch{}let D=!1;if(x){const k=e.config.objectType==="QuestionSet";let{rootNode:N}=k?await aT(x):await _h(x);if(N&&e.config.primaryCategory==="Learning Path"&&(N=hT(N)),!h&&(m(N?[N]:[]),N)){C(N.id);const{framework:O,targetFWIds:U}=Fd(N.metadata??{},T,e.context);f(O,U),D=!0}const F=e.config.primaryCategory??"Course",A=e.context.channel??"",P=e.config.categoryDefinitionApiVersion??"v1";try{const R=await Pq(F,A,e.config.objectType??"Collection",P);if(!h){d(R);const O=((b=R.sourcingSettings)==null?void 0:b.collection)??{},U={};O.maxDepth&&!e.config.maxDepth&&(U.maxDepth=O.maxDepth),O.children&&!e.config.children&&(U.children=O.children),O.hierarchy&&!((S=e.config.hierarchy)!=null&&S.level1)&&(U.hierarchy={...e.config.hierarchy??{},...O.hierarchy}),Object.keys(U).length>0&&c({...e,config:{...e.config,...U}})}}catch{}}if(!h&&!D){const{framework:k,targetFWIds:N}=Fd({},T,e.context);f(k,N)}h||i(!0)}catch(x){if(!h){const w=x instanceof Error?x:new Error(String(x));o(w),t==null||t(w)}}finally{h||n(!1)}}return v(),()=>{h=!0}},[e.context.contentId,e.context.identifier]),{isLoading:r,error:s,isReady:a}}function Fq(){const e=jl(t=>t.setLanguage);g.useEffect(()=>{e(localStorage.getItem(Vi)||"en",{broadcast:!1});const t=n=>{n.key===Vi&&n.newValue&&e(n.newValue,{broadcast:!1})},r=n=>{var o;const s=(o=n.detail)==null?void 0:o.lang;s&&e(s,{broadcast:!1})};return window.addEventListener("storage",t),window.addEventListener(Hi,r),()=>{window.removeEventListener("storage",t),window.removeEventListener(Hi,r)}},[e])}const Mq="_root_qcpw6_1",Bq="_loadingState_qcpw6_10",qq="_loadingSpinner_qcpw6_20",$q="_errorState_qcpw6_34",As={root:Mq,loadingState:Bq,loadingSpinner:qq,errorState:$q},Uq=new Vm({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});function zq({error:e,onRetry:t}){const r=ie();return l.jsxs("div",{className:As.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 Vq extends g.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(zq,{error:this.state.error,onRetry:()=>this.setState({error:null})}):this.props.children}}function Hq(e){Fq();const t=ie(),{isLoading:r,error:n}=Rq({config:e,onError:e.onError}),s=X(a=>a.editorMode),o=X(a=>a.editorProfile);return r?l.jsxs("div",{className:As.loadingState,children:[l.jsx("div",{className:As.loadingSpinner}),l.jsx("p",{children:t.collectionEditor.loadingMessage})]}):n?l.jsxs("div",{className:As.errorState,children:[l.jsx("h3",{children:t.collectionEditor.loadErrorTitle}),l.jsx("p",{children:n.message})]}):l.jsx("div",{className:["sb-split-builder",As.root,o.key==="learningPath"?"sbx-lp-profile":""].filter(Boolean).join(" "),children:l.jsx(Dq,{editorMode:s,onToolbarEvent:e.onToolbarEvent,onContentAdded:e.onContentAdded,onHierarchySaved:e.onHierarchySaved})})}const mm=e=>l.jsx(Vq,{onError:e.onError,children:l.jsxs(Qm,{client:Uq,children:[l.jsx(Hq,{...e}),l.jsx(Hg,{position:"top-right",toastOptions:{duration:3e3,style:{fontFamily:"var(--sbx-font)"}}})]})}),ca=Symbol.for("r2wc.reactRender"),Md=Symbol.for("r2wc.shouldRender"),ko=Symbol.for("r2wc.root");function Qq(e=""){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Wq(e=""){return e.replace(/-([a-z0-9])/g,function(t){return t[1].toUpperCase()})}var Bd={expando:function(e,t,r){Object.defineProperty(e,t,{enumerable:!0,get:function(){return r},set:function(n){r=n,this[ca]()}}),e[ca]()}};function Gq(e,t,r,n={}){var s={isConnected:"isConnected"in HTMLElement.prototype},o=!1,a=function(){var u=Reflect.construct(HTMLElement,arguments,this.constructor);return typeof n.shadow=="string"?u.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.'),u.attachShadow({mode:"open"})),u},i=Object.create(HTMLElement.prototype);i.constructor=a;var c=new Proxy(i,{has:function(u,d){return d in e.propTypes||d in i},set:function(u,d,f,p){return o&&(s[d]=!0),typeof d=="symbol"||s[d]||d in u?(e.propTypes&&d in e.propTypes&&Bd.expando(p,d,f),Reflect.set(u,d,f,p)):(Bd.expando(p,d,f),!0)},getOwnPropertyDescriptor:function(u,d){var f=Reflect.getOwnPropertyDescriptor(u,d);if(f)return f;if(d in e.propTypes)return{configurable:!0,enumerable:!0,writable:!0,value:void 0}}});return a.prototype=c,i.connectedCallback=function(){this[Md]=!0,this[ca]()},i.disconnectedCallback=function(){typeof r.createRoot=="function"?this[ko].unmount():r.unmountComponentAtNode(this)},i[ca]=function(){if(this[Md]===!0){var u={};Object.keys(this).forEach(function(p){s[p]!==!1&&(u[p]=this[p])},this),o=!0;const d=n.shadow?this.shadowRoot:this,f=t.createElement(e,u);typeof r.createRoot=="function"?(this[ko]||(this[ko]=r.createRoot(d)),this[ko].render(f)):r.render(f,d),o=!1}},e.propTypes&&(a.observedAttributes=n.dashStyleAttributes?Object.keys(e.propTypes).map(function(u){return Qq(u)}):Object.keys(e.propTypes),i.attributeChangedCallback=function(u,d,f){var p=n.dashStyleAttributes?Wq(u):u;this[p]=f}),a}var Rn={},qd;function Kq(){if(qd)return Rn;qd=1;var e=Tr;if(process.env.NODE_ENV==="production")Rn.createRoot=e.createRoot,Rn.hydrateRoot=e.hydrateRoot;else{var t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Rn.createRoot=function(r,n){t.usingClientEntryPoint=!0;try{return e.createRoot(r,n)}finally{t.usingClientEntryPoint=!1}},Rn.hydrateRoot=function(r,n,s){t.usingClientEntryPoint=!0;try{return e.hydrateRoot(r,n,s)}finally{t.usingClientEntryPoint=!1}}}return Rn}var Yq=Kq();const Zq=Ll(Yq);function Xq(){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 Jq(e="sb-collection-editor"){if(Xq(),typeof customElements>"u"||customElements.get(e))return;const t=Gq(mm,g,Zq,{});customElements.define(e,t)}exports.CollectionEditor=mm;exports.registerCollectionEditor=Jq;exports.setApiBaseUrl=Ch;exports.useEditorStore=X;exports.useLibraryStore=fm;exports.useTreeStore=oe;
|