(()=>{var e={6694:function(e,t,r){"use strict";// EXPORTS
r.d(t,{A:()=>/* binding */eO});// CONCATENATED MODULE: ./node_modules/@emotion/sheet/dist/emotion-sheet.esm.js
var n=false;/*

Based off glamor's StyleSheet, thanks Sunil ❤️

high performance StyleSheet for css-in-js systems

- uses multiple style tags behind the scenes for millions of rules
- uses `insertRule` for appending in production for *much* faster performance

// usage

import { StyleSheet } from '@emotion/sheet'

let styleSheet = new StyleSheet({ key: '', container: document.head })

styleSheet.insert('#box { border: 1px solid red; }')
- appends a css rule into the stylesheet

styleSheet.flush()
- empties the stylesheet of all its contents

*/function i(e){if(e.sheet){return e.sheet}// this weirdness brought to you by firefox
/* istanbul ignore next */for(var t=0;t<document.styleSheets.length;t++){if(document.styleSheets[t].ownerNode===e){return document.styleSheets[t]}}// this function should always return with a value
// TS can't understand it though so we make it stop complaining here
return undefined}function a(e){var t=document.createElement("style");t.setAttribute("data-emotion",e.key);if(e.nonce!==undefined){t.setAttribute("nonce",e.nonce)}t.appendChild(document.createTextNode(""));t.setAttribute("data-s","");return t}var o=/*#__PURE__*/function(){// Using Node instead of HTMLElement since container may be a ShadowRoot
function e(e){var t=this;this._insertTag=function(e){var r;if(t.tags.length===0){if(t.insertionPoint){r=t.insertionPoint.nextSibling}else if(t.prepend){r=t.container.firstChild}else{r=t.before}}else{r=t.tags[t.tags.length-1].nextSibling}t.container.insertBefore(e,r);t.tags.push(e)};this.isSpeedy=e.speedy===undefined?!n:e.speedy;this.tags=[];this.ctr=0;this.nonce=e.nonce;// key is the value of the data-emotion attribute, it's used to identify different sheets
this.key=e.key;this.container=e.container;this.prepend=e.prepend;this.insertionPoint=e.insertionPoint;this.before=null}var t=e.prototype;t.hydrate=function e(e){e.forEach(this._insertTag)};t.insert=function e(e){// the max length is how many rules we have per style tag, it's 65000 in speedy mode
// it's 1 in dev because we insert source maps that map a single rule to a location
// and you can only have one source map per style tag
if(this.ctr%(this.isSpeedy?65e3:1)===0){this._insertTag(a(this))}var t=this.tags[this.tags.length-1];if(this.isSpeedy){var r=i(t);try{// this is the ultrafast version, works across browsers
// the big drawback is that the css won't be editable in devtools
r.insertRule(e,r.cssRules.length)}catch(e){}}else{t.appendChild(document.createTextNode(e))}this.ctr++};t.flush=function e(){this.tags.forEach(function(e){var t;return(t=e.parentNode)==null?void 0:t.removeChild(e)});this.tags=[];this.ctr=0};return e}();// CONCATENATED MODULE: ./node_modules/stylis/src/Utility.js
/**
 * @param {number}
 * @return {number}
 */var s=Math.abs;/**
 * @param {number}
 * @return {string}
 */var l=String.fromCharCode;/**
 * @param {object}
 * @return {object}
 */var u=Object.assign;/**
 * @param {string} value
 * @param {number} length
 * @return {number}
 */function c(e,t){return v(e,0)^45?(((t<<2^v(e,0))<<2^v(e,1))<<2^v(e,2))<<2^v(e,3):0}/**
 * @param {string} value
 * @return {string}
 */function d(e){return e.trim()}/**
 * @param {string} value
 * @param {RegExp} pattern
 * @return {string?}
 */function f(e,t){return(e=t.exec(e))?e[0]:e}/**
 * @param {string} value
 * @param {(string|RegExp)} pattern
 * @param {string} replacement
 * @return {string}
 */function p(e,t,r){return e.replace(t,r)}/**
 * @param {string} value
 * @param {string} search
 * @return {number}
 */function h(e,t){return e.indexOf(t)}/**
 * @param {string} value
 * @param {number} index
 * @return {number}
 */function v(e,t){return e.charCodeAt(t)|0}/**
 * @param {string} value
 * @param {number} begin
 * @param {number} end
 * @return {string}
 */function g(e,t,r){return e.slice(t,r)}/**
 * @param {string} value
 * @return {number}
 */function m(e){return e.length}/**
 * @param {any[]} value
 * @return {number}
 */function b(e){return e.length}/**
 * @param {any} value
 * @param {any[]} array
 * @return {any}
 */function y(e,t){return t.push(e),e}/**
 * @param {string[]} array
 * @param {function} callback
 * @return {string}
 */function _(e,t){return e.map(t).join("")};// CONCATENATED MODULE: ./node_modules/stylis/src/Tokenizer.js
var w=1;var x=1;var A=0;var k=0;var E=0;var I="";/**
 * @param {string} value
 * @param {object | null} root
 * @param {object | null} parent
 * @param {string} type
 * @param {string[] | string} props
 * @param {object[] | string} children
 * @param {number} length
 */function C(e,t,r,n,i,a,o){return{value:e,root:t,parent:r,type:n,props:i,children:a,line:w,column:x,length:o,return:""}}/**
 * @param {object} root
 * @param {object} props
 * @return {object}
 */function Y(e,t){return u(C("",null,null,"",null,null,0),e,{length:-e.length},t)}/**
 * @return {number}
 */function T(){return E}/**
 * @return {number}
 */function S(){E=k>0?v(I,--k):0;if(x--,E===10)x=1,w--;return E}/**
 * @return {number}
 */function O(){E=k<A?v(I,k++):0;if(x++,E===10)x=1,w++;return E}/**
 * @return {number}
 */function D(){return v(I,k)}/**
 * @return {number}
 */function F(){return k}/**
 * @param {number} begin
 * @param {number} end
 * @return {string}
 */function R(e,t){return g(I,e,t)}/**
 * @param {number} type
 * @return {number}
 */function P(e){switch(e){// \0 \t \n \r \s whitespace token
case 0:case 9:case 10:case 13:case 32:return 5;// ! + , / > @ ~ isolate token
case 33:case 43:case 44:case 47:case 62:case 64:case 126:// ; { } breakpoint token
case 59:case 123:case 125:return 4;// : accompanied token
case 58:return 3;// " ' ( [ opening delimit token
case 34:case 39:case 40:case 91:return 2;// ) ] closing delimit token
case 41:case 93:return 1}return 0}/**
 * @param {string} value
 * @return {any[]}
 */function M(e){return w=x=1,A=m(I=e),k=0,[]}/**
 * @param {any} value
 * @return {any}
 */function H(e){return I="",e}/**
 * @param {number} type
 * @return {string}
 */function N(e){return d(R(k-1,U(e===91?e+2:e===40?e+1:e)))}/**
 * @param {string} value
 * @return {string[]}
 */function L(e){return H(B(M(e)))}/**
 * @param {number} type
 * @return {string}
 */function K(e){while(E=D())if(E<33)O();else break;return P(e)>2||P(E)>3?"":" "}/**
 * @param {string[]} children
 * @return {string[]}
 */function B(e){while(O())switch(P(E)){case 0:append(V(k-1),e);break;case 2:append(N(E),e);break;default:append(from(E),e)}return e}/**
 * @param {number} index
 * @param {number} count
 * @return {string}
 */function j(e,t){while(--t&&O())// not 0-9 A-F a-f
if(E<48||E>102||E>57&&E<65||E>70&&E<97)break;return R(e,F()+(t<6&&D()==32&&O()==32))}/**
 * @param {number} type
 * @return {number}
 */function U(e){while(O())switch(E){// ] ) " '
case e:return k;// " '
case 34:case 39:if(e!==34&&e!==39)U(E);break;// (
case 40:if(e===41)U(e);break;// \
case 92:O();break}return k}/**
 * @param {number} type
 * @param {number} index
 * @return {number}
 */function q(e,t){while(O())// //
if(e+E===47+10)break;else if(e+E===42+42&&D()===47)break;return"/*"+R(t,k-1)+"*"+l(e===47?e:O())}/**
 * @param {number} index
 * @return {string}
 */function V(e){while(!P(D()))O();return R(e,k)};// CONCATENATED MODULE: ./node_modules/stylis/src/Enum.js
var W="-ms-";var z="-moz-";var G="-webkit-";var Q="comm";var $="rule";var X="decl";var J="@page";var Z="@media";var ee="@import";var et="@charset";var er="@viewport";var en="@supports";var ei="@document";var ea="@namespace";var eo="@keyframes";var es="@font-face";var el="@counter-style";var eu="@font-feature-values";var ec="@layer";// CONCATENATED MODULE: ./node_modules/stylis/src/Serializer.js
/**
 * @param {object[]} children
 * @param {function} callback
 * @return {string}
 */function ed(e,t){var r="";var n=b(e);for(var i=0;i<n;i++)r+=t(e[i],i,e,t)||"";return r}/**
 * @param {object} element
 * @param {number} index
 * @param {object[]} children
 * @param {function} callback
 * @return {string}
 */function ef(e,t,r,n){switch(e.type){case ec:if(e.children.length)break;case ee:case X:return e.return=e.return||e.value;case Q:return"";case eo:return e.return=e.value+"{"+ed(e.children,n)+"}";case $:e.value=e.props.join(",")}return m(r=ed(e.children,n))?e.return=e.value+"{"+r+"}":""};// CONCATENATED MODULE: ./node_modules/stylis/src/Middleware.js
/**
 * @param {function[]} collection
 * @return {function}
 */function ep(e){var t=b(e);return function(r,n,i,a){var o="";for(var s=0;s<t;s++)o+=e[s](r,n,i,a)||"";return o}}/**
 * @param {function} callback
 * @return {function}
 */function eh(e){return function(t){if(!t.root){if(t=t.return)e(t)}}}/**
 * @param {object} element
 * @param {number} index
 * @param {object[]} children
 * @param {function} callback
 */function ev(e,t,r,n){if(e.length>-1){if(!e.return)switch(e.type){case DECLARATION:e.return=prefix(e.value,e.length,r);return;case KEYFRAMES:return serialize([copy(e,{value:replace(e.value,"@","@"+WEBKIT)})],n);case RULESET:if(e.length)return combine(e.props,function(t){switch(match(t,/(::plac\w+|:read-\w+)/)){// :read-(only|write)
case":read-only":case":read-write":return serialize([copy(e,{props:[replace(t,/:(read-\w+)/,":"+MOZ+"$1")]})],n);// :placeholder
case"::placeholder":return serialize([copy(e,{props:[replace(t,/:(plac\w+)/,":"+WEBKIT+"input-$1")]}),copy(e,{props:[replace(t,/:(plac\w+)/,":"+MOZ+"$1")]}),copy(e,{props:[replace(t,/:(plac\w+)/,MS+"input-$1")]})],n)}return""})}}}/**
 * @param {object} element
 * @param {number} index
 * @param {object[]} children
 */function eg(e){switch(e.type){case RULESET:e.props=e.props.map(function(t){return combine(tokenize(t),function(t,r,n){switch(charat(t,0)){// \f
case 12:return substr(t,1,strlen(t));// \0 ( + > ~
case 0:case 40:case 43:case 62:case 126:return t;// :
case 58:if(n[++r]==="global")n[r]="",n[++r]="\f"+substr(n[r],r=1,-1);// \s
case 32:return r===1?"":t;default:switch(r){case 0:e=t;return sizeof(n)>1?"":t;case r=sizeof(n)-1:case 2:return r===2?t+e+e:t+e;default:return t}}})})}};// CONCATENATED MODULE: ./node_modules/stylis/src/Parser.js
/**
 * @param {string} value
 * @return {object[]}
 */function em(e){return H(eb("",null,null,null,[""],e=M(e),0,[0],e))}/**
 * @param {string} value
 * @param {object} root
 * @param {object?} parent
 * @param {string[]} rule
 * @param {string[]} rules
 * @param {string[]} rulesets
 * @param {number[]} pseudo
 * @param {number[]} points
 * @param {string[]} declarations
 * @return {object}
 */function eb(e,t,r,n,i,a,o,s,u){var c=0;var d=0;var f=o;var g=0;var b=0;var _=0;var w=1;var x=1;var A=1;var k=0;var E="";var I=i;var C=a;var Y=n;var T=E;while(x)switch(_=k,k=O()){// (
case 40:if(_!=108&&v(T,f-1)==58){if(h(T+=p(N(k),"&","&\f"),"&\f")!=-1)A=-1;break}// " ' [
case 34:case 39:case 91:T+=N(k);break;// \t \n \r \s
case 9:case 10:case 13:case 32:T+=K(_);break;// \
case 92:T+=j(F()-1,7);continue;// /
case 47:switch(D()){case 42:case 47:y(e_(q(O(),F()),t,r),u);break;default:T+="/"}break;// {
case 123*w:s[c++]=m(T)*A;// } ; \0
case 125*w:case 59:case 0:switch(k){// \0 }
case 0:case 125:x=0;// ;
case 59+d:if(A==-1)T=p(T,/\f/g,"");if(b>0&&m(T)-f)y(b>32?ew(T+";",n,r,f-1):ew(p(T," ","")+";",n,r,f-2),u);break;// @ ;
case 59:T+=";";// { rule/at-rule
default:y(Y=ey(T,t,r,c,d,i,s,E,I=[],C=[],f),a);if(k===123)if(d===0)eb(T,t,Y,Y,I,a,f,s,C);else switch(g===99&&v(T,3)===110?100:g){// d l m s
case 100:case 108:case 109:case 115:eb(e,Y,Y,n&&y(ey(e,Y,Y,0,0,i,s,E,i,I=[],f),C),i,C,f,s,n?I:C);break;default:eb(T,Y,Y,Y,[""],C,0,s,C)}}c=d=b=0,w=A=1,E=T="",f=o;break;// :
case 58:f=1+m(T),b=_;default:if(w<1){if(k==123)--w;else if(k==125&&w++==0&&S()==125)continue}switch(T+=l(k),k*w){// &
case 38:A=d>0?1:(T+="\f",-1);break;// ,
case 44:s[c++]=(m(T)-1)*A,A=1;break;// @
case 64:// -
if(D()===45)T+=N(O());g=D(),d=f=m(E=T+=V(F())),k++;break;// -
case 45:if(_===45&&m(T)==2)w=0}}return a}/**
 * @param {string} value
 * @param {object} root
 * @param {object?} parent
 * @param {number} index
 * @param {number} offset
 * @param {string[]} rules
 * @param {number[]} points
 * @param {string} type
 * @param {string[]} props
 * @param {string[]} children
 * @param {number} length
 * @return {object}
 */function ey(e,t,r,n,i,a,o,l,u,c,f){var h=i-1;var v=i===0?a:[""];var m=b(v);for(var y=0,_=0,w=0;y<n;++y)for(var x=0,A=g(e,h+1,h=s(_=o[y])),k=e;x<m;++x)if(k=d(_>0?v[x]+" "+A:p(A,/&\f/g,v[x])))u[w++]=k;return C(e,t,r,i===0?$:l,u,c,f)}/**
 * @param {number} value
 * @param {object} root
 * @param {object?} parent
 * @return {object}
 */function e_(e,t,r){return C(e,t,r,Q,l(T()),g(e,2,-2),0)}/**
 * @param {string} value
 * @param {object} root
 * @param {object?} parent
 * @param {number} length
 * @return {object}
 */function ew(e,t,r,n){return C(e,t,r,X,g(e,0,n),g(e,n+1,-1),n)};// CONCATENATED MODULE: ./node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js
var ex=function e(e,t,r){var n=0;var i=0;while(true){n=i;i=D();// &\f
if(n===38&&i===12){t[r]=1}if(P(i)){break}O()}return R(e,k)};var eA=function e(e,t){// pretend we've started with a comma
var r=-1;var n=44;do{switch(P(n)){case 0:// &\f
if(n===38&&D()===12){// this is not 100% correct, we don't account for literal sequences here - like for example quoted strings
// stylis inserts \f after & to know when & where it should replace this sequence with the context selector
// and when it should just concatenate the outer and inner selectors
// it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here
t[r]=1}e[r]+=ex(k-1,t,r);break;case 2:e[r]+=N(n);break;case 4:// comma
if(n===44){// colon
e[++r]=D()===58?"&\f":"";t[r]=e[r].length;break}// fallthrough
default:e[r]+=l(n)}}while(n=O())return e};var ek=function e(e,t){return H(eA(M(e),t))};// WeakSet would be more appropriate, but only WeakMap is supported in IE11
var eE=/* #__PURE__ */new WeakMap;var eI=function e(e){if(e.type!=="rule"||!e.parent||// positive .length indicates that this rule contains pseudo
// negative .length indicates that this rule has been already prefixed
e.length<1){return}var t=e.value;var r=e.parent;var n=e.column===r.column&&e.line===r.line;while(r.type!=="rule"){r=r.parent;if(!r)return}// short-circuit for the simplest case
if(e.props.length===1&&t.charCodeAt(0)!==58&&!eE.get(r)){return}// if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)
// then the props has already been manipulated beforehand as they that array is shared between it and its "rule parent"
if(n){return}eE.set(e,true);var i=[];var a=ek(t,i);var o=r.props;for(var s=0,l=0;s<a.length;s++){for(var u=0;u<o.length;u++,l++){e.props[l]=i[s]?a[s].replace(/&\f/g,o[u]):o[u]+" "+a[s]}}};var eC=function e(e){if(e.type==="decl"){var t=e.value;if(t.charCodeAt(0)===108&&// charcode for b
t.charCodeAt(2)===98){// this ignores label
e["return"]="";e.value=""}}};/* eslint-disable no-fallthrough */function eY(e,t){switch(c(e,t)){// color-adjust
case 5103:return G+"print-"+e+e;// animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)
case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return G+e+e;// appearance, user-select, transform, hyphens, text-size-adjust
case 5349:case 4246:case 4810:case 6968:case 2756:return G+e+z+e+W+e+e;// flex, flex-direction
case 6828:case 4268:return G+e+W+e+e;// order
case 6165:return G+e+W+"flex-"+e+e;// align-items
case 5187:return G+e+p(e,/(\w+).+(:[^]+)/,G+"box-$1$2"+W+"flex-$1$2")+e;// align-self
case 5443:return G+e+W+"flex-item-"+p(e,/flex-|-self/,"")+e;// align-content
case 4675:return G+e+W+"flex-line-pack"+p(e,/align-content|flex-|-self/,"")+e;// flex-shrink
case 5548:return G+e+W+p(e,"shrink","negative")+e;// flex-basis
case 5292:return G+e+W+p(e,"basis","preferred-size")+e;// flex-grow
case 6060:return G+"box-"+p(e,"-grow","")+G+e+W+p(e,"grow","positive")+e;// transition
case 4554:return G+p(e,/([^-])(transform)/g,"$1"+G+"$2")+e;// cursor
case 6187:return p(p(p(e,/(zoom-|grab)/,G+"$1"),/(image-set)/,G+"$1"),e,"")+e;// background, background-image
case 5495:case 3959:return p(e,/(image-set\([^]*)/,G+"$1"+"$`$1");// justify-content
case 4968:return p(p(e,/(.+:)(flex-)?(.*)/,G+"box-pack:$3"+W+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+G+e+e;// (margin|padding)-inline-(start|end)
case 4095:case 3583:case 4068:case 2532:return p(e,/(.+)-inline(.+)/,G+"$1$2")+e;// (min|max)?(width|height|inline-size|block-size)
case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:// stretch, max-content, min-content, fill-available
if(m(e)-1-t>6)switch(v(e,t+1)){// (m)ax-content, (m)in-content
case 109:// -
if(v(e,t+4)!==45)break;// (f)ill-available, (f)it-content
case 102:return p(e,/(.+:)(.+)-([^]+)/,"$1"+G+"$2-$3"+"$1"+z+(v(e,t+3)==108?"$3":"$2-$3"))+e;// (s)tretch
case 115:return~h(e,"stretch")?eY(p(e,"stretch","fill-available"),t)+e:e}break;// position: sticky
case 4949:// (s)ticky?
if(v(e,t+1)!==115)break;// display: (flex|inline-flex)
case 6444:switch(v(e,m(e)-3-(~h(e,"!important")&&10))){// stic(k)y
case 107:return p(e,":",":"+G)+e;// (inline-)?fl(e)x
case 101:return p(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+G+(v(e,14)===45?"inline-":"")+"box$3"+"$1"+G+"$2$3"+"$1"+W+"$2box$3")+e}break;// writing-mode
case 5936:switch(v(e,t+11)){// vertical-l(r)
case 114:return G+e+W+p(e,/[svh]\w+-[tblr]{2}/,"tb")+e;// vertical-r(l)
case 108:return G+e+W+p(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;// horizontal(-)tb
case 45:return G+e+W+p(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return G+e+W+e+e}return e}var eT=function e(e,t,r,n){if(e.length>-1){if(!e["return"])switch(e.type){case X:e["return"]=eY(e.value,e.length);break;case eo:return ed([Y(e,{value:p(e.value,"@","@"+G)})],n);case $:if(e.length)return _(e.props,function(t){switch(f(t,/(::plac\w+|:read-\w+)/)){// :read-(only|write)
case":read-only":case":read-write":return ed([Y(e,{props:[p(t,/:(read-\w+)/,":"+z+"$1")]})],n);// :placeholder
case"::placeholder":return ed([Y(e,{props:[p(t,/:(plac\w+)/,":"+G+"input-$1")]}),Y(e,{props:[p(t,/:(plac\w+)/,":"+z+"$1")]}),Y(e,{props:[p(t,/:(plac\w+)/,W+"input-$1")]})],n)}return""})}}};var eS=[eT];var eO=function e(e){var t=e.key;if(t==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");// get SSRed styles out of the way of React's hydration
// document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)
// note this very very intentionally targets all style elements regardless of the key to ensure
// that creating a cache works inside of render of a React component
Array.prototype.forEach.call(r,function(e){// we want to only move elements which have a space in the data-emotion attribute value
// because that indicates that it is an Emotion 11 server-side rendered style elements
// while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector
// Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)
// so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles
// will not result in the Emotion 10 styles being destroyed
var t=e.getAttribute("data-emotion");if(t.indexOf(" ")===-1){return}document.head.appendChild(e);e.setAttribute("data-s","")})}var n=e.stylisPlugins||eS;var i={};var a;var s=[];{a=e.container||document.head;Array.prototype.forEach.call(// means that the style elements we're looking at are only Emotion 11 server-rendered style elements
document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){var t=e.getAttribute("data-emotion").split(" ");for(var r=1;r<t.length;r++){i[t[r]]=true}s.push(e)})}var l;var u=[eI,eC];{var c;var d=[ef,eh(function(e){c.insert(e)})];var f=ep(u.concat(n,d));var p=function e(e){return ed(em(e),f)};l=function e(e,t,r,n){c=r;p(e?e+"{"+t.styles+"}":t.styles);if(n){h.inserted[t.name]=true}}}var h={key:t,sheet:new o({key:t,container:a,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:l};h.sheet.hydrate(s);return h}},8663:function(e,t,r){"use strict";r.d(t,{C:()=>f,E:()=>I,T:()=>v,c:()=>A,h:()=>w,i:()=>c,w:()=>h});/* ESM import */var n=r(1594);/* ESM import */var i=/*#__PURE__*/r.n(n);/* ESM import */var a=r(6694);/* ESM import */var o=r(41);/* ESM import */var s=r(4614);/* ESM import */var l=r(1287);var u=false;var c=typeof document!=="undefined";var d=/* #__PURE__ */n.createContext(// because this module is primarily intended for the browser and node
// but it's also required in react native and similar environments sometimes
// and we could have a special build just for that
// but this is much easier and the native packages
// might use a different theme context in the future anyway
typeof HTMLElement!=="undefined"?/* #__PURE__ */(0,a/* ["default"] */.A)({key:"css"}):null);var f=d.Provider;var p=function e(){return useContext(d)};var h=function e(e){return/*#__PURE__*/(0,n.forwardRef)(function(t,r){// the cache will never be null in the browser
var i=(0,n.useContext)(d);return e(t,i,r)})};if(!c){h=function e(e){return function(t){var r=(0,n.useContext)(d);if(r===null){// yes, we're potentially creating this on every render
// it doesn't actually matter though since it's only on the server
// so there will only every be a single render
// that could change in the future because of suspense and etc. but for now,
// this works and i don't want to optimise for a future thing that we aren't sure about
r=(0,a/* ["default"] */.A)({key:"css"});return /*#__PURE__*/n.createElement(d.Provider,{value:r},e(t,r))}else{return e(t,r)}}}}var v=/* #__PURE__ */n.createContext({});var g=function e(){return React.useContext(v)};var m=function e(e,t){if(typeof t==="function"){var r=t(e);return r}return _extends({},e,t)};var b=/* #__PURE__ *//* unused pure expression or super */null&&weakMemoize(function(e){return weakMemoize(function(t){return m(e,t)})});var y=function e(e){var t=React.useContext(v);if(e.theme!==t){t=b(t)(e.theme)}return /*#__PURE__*/React.createElement(v.Provider,{value:t},e.children)};function _(e){var t=e.displayName||e.name||"Component";var r=/*#__PURE__*/React.forwardRef(function t(t,r){var n=React.useContext(v);return /*#__PURE__*/React.createElement(e,_extends({theme:n,ref:r},t))});r.displayName="WithTheme("+t+")";return hoistNonReactStatics(r,e)}var w={}.hasOwnProperty;var x="__EMOTION_TYPE_PLEASE_DO_NOT_USE__";var A=function e(e,t){var r={};for(var n in t){if(w.call(t,n)){r[n]=t[n]}}r[x]=e;// Runtime labeling is an opt-in feature because:
return r};var k=function e(e){var t=e.cache,r=e.serialized,i=e.isStringTag;(0,o/* .registerStyles */.SF)(t,r,i);var a=(0,l/* .useInsertionEffectAlwaysWithSyncFallback */.s)(function(){return(0,o/* .insertStyles */.sk)(t,r,i)});if(!c&&a!==undefined){var s;var u=r.name;var d=r.next;while(d!==undefined){u+=" "+d.name;d=d.next}return /*#__PURE__*/n.createElement("style",(s={},s["data-emotion"]=t.key+" "+u,s.dangerouslySetInnerHTML={__html:a},s.nonce=t.sheet.nonce,s))}return null};var E=/* #__PURE__ */h(function(e,t,r){var i=e.css;// so that using `css` from `emotion` and passing the result to the css prop works
// not passing the registered cache to serializeStyles because it would
// make certain babel optimisations not possible
if(typeof i==="string"&&t.registered[i]!==undefined){i=t.registered[i]}var a=e[x];var l=[i];var c="";if(typeof e.className==="string"){c=(0,o/* .getRegisteredStyles */.Rk)(t.registered,l,e.className)}else if(e.className!=null){c=e.className+" "}var d=(0,s/* .serializeStyles */.J)(l,undefined,n.useContext(v));c+=t.key+"-"+d.name;var f={};for(var p in e){if(w.call(e,p)&&p!=="css"&&p!==x&&!u){f[p]=e[p]}}f.className=c;if(r){f.ref=r}return /*#__PURE__*/n.createElement(n.Fragment,null,/*#__PURE__*/n.createElement(k,{cache:t,serialized:d,isStringTag:typeof a==="string"}),/*#__PURE__*/n.createElement(a,f))});var I=E},1699:function(e,t,r){"use strict";r.d(t,{AH:()=>h,i7:()=>v,mL:()=>p});/* ESM import */var n=r(8663);/* ESM import */var i=r(1594);/* ESM import */var a=/*#__PURE__*/r.n(i);/* ESM import */var o=r(41);/* ESM import */var s=r(1287);/* ESM import */var l=r(4614);/* ESM import */var u=r(6694);/* ESM import */var c=r(4146);/* ESM import */var d=/*#__PURE__*/r.n(c);var f=function e(e,t){// eslint-disable-next-line prefer-rest-params
var r=arguments;if(t==null||!n.h.call(t,"css")){return i.createElement.apply(undefined,r)}var a=r.length;var o=new Array(a);o[0]=n.E;o[1]=(0,n.c)(e,t);for(var s=2;s<a;s++){o[s]=r[s]}return i.createElement.apply(null,o)};(function(e){var t;(function(e){})(t||(t=e.JSX||(e.JSX={})))})(f||(f={}));// initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild
// initial client-side render from SSR, use place of hydrating tag
var p=/* #__PURE__ */(0,n.w)(function(e,t){var r=e.styles;var a=(0,l/* .serializeStyles */.J)([r],undefined,i.useContext(n.T));if(!n.i){var u;var c=a.name;var d=a.styles;var f=a.next;while(f!==undefined){c+=" "+f.name;d+=f.styles;f=f.next}var p=t.compat===true;var h=t.insert("",{name:c,styles:d},t.sheet,p);if(p){return null}return /*#__PURE__*/i.createElement("style",(u={},u["data-emotion"]=t.key+"-global "+c,u.dangerouslySetInnerHTML={__html:h},u.nonce=t.sheet.nonce,u))}// yes, i know these hooks are used conditionally
// but it is based on a constant that will never change at runtime
// it's effectively like having two implementations and switching them out
// so it's not actually breaking anything
var v=i.useRef();(0,s/* .useInsertionEffectWithLayoutFallback */.i)(function(){var e=t.key+"-global";// use case of https://github.com/emotion-js/emotion/issues/2675
var r=new t.sheet.constructor({key:e,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy});var n=false;var i=document.querySelector('style[data-emotion="'+e+" "+a.name+'"]');if(t.sheet.tags.length){r.before=t.sheet.tags[0]}if(i!==null){n=true;// clear the hash so this node won't be recognizable as rehydratable by other <Global/>s
i.setAttribute("data-emotion",e);r.hydrate([i])}v.current=[r,n];return function(){r.flush()}},[t]);(0,s/* .useInsertionEffectWithLayoutFallback */.i)(function(){var e=v.current;var r=e[0],n=e[1];if(n){e[1]=false;return}if(a.next!==undefined){// insert keyframes
(0,o/* .insertStyles */.sk)(t,a.next,true)}if(r.tags.length){// if this doesn't exist then it will be null so the style element will be appended
var i=r.tags[r.tags.length-1].nextElementSibling;r.before=i;r.flush()}t.insert("",a,r,false)},[t,a.name]);return null});function h(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return(0,l/* .serializeStyles */.J)(t)}function v(){var e=h.apply(void 0,arguments);var t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function e(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}var g=function e(t){var r=t.length;var n=0;var i="";for(;n<r;n++){var a=t[n];if(a==null)continue;var o=void 0;switch(typeof a){case"boolean":break;case"object":{if(Array.isArray(a)){o=e(a)}else{o="";for(var s in a){if(a[s]&&s){o&&(o+=" ");o+=s}}}break}default:{o=a}}if(o){i&&(i+=" ");i+=o}}return i};function m(e,t,r){var n=[];var i=getRegisteredStyles(e,n,r);if(n.length<2){return r}return i+t(n)}var b=function e(e){var t=e.cache,r=e.serializedArr;var n=useInsertionEffectAlwaysWithSyncFallback(function(){var e="";for(var n=0;n<r.length;n++){var i=insertStyles(t,r[n],false);if(!isBrowser&&i!==undefined){e+=i}}if(!isBrowser){return e}});if(!isBrowser&&n.length!==0){var i;return /*#__PURE__*/React.createElement("style",(i={},i["data-emotion"]=t.key+" "+r.map(function(e){return e.name}).join(" "),i.dangerouslySetInnerHTML={__html:n},i.nonce=t.sheet.nonce,i))}return null};var y=/* #__PURE__ *//* unused pure expression or super */null&&withEmotionCache(function(e,t){var r=false;var n=[];var i=function e(){if(r&&isDevelopment){throw new Error("css can only be used during render")}for(var e=arguments.length,i=new Array(e),a=0;a<e;a++){i[a]=arguments[a]}var o=serializeStyles(i,t.registered);n.push(o);// registration has to happen here as the result of this might get consumed by `cx`
registerStyles(t,o,false);return t.key+"-"+o.name};var a=function e(){if(r&&isDevelopment){throw new Error("cx can only be used during render")}for(var e=arguments.length,n=new Array(e),a=0;a<e;a++){n[a]=arguments[a]}return m(t.registered,i,g(n))};var o={css:i,cx:a,theme:React.useContext(ThemeContext)};var s=e.children(o);r=true;return /*#__PURE__*/React.createElement(React.Fragment,null,/*#__PURE__*/React.createElement(b,{cache:t,serializedArr:n}),s)})},3747:function(e,t,r){"use strict";r.d(t,{FD:()=>p,FK:()=>d,Y:()=>f});/* ESM import */var n=r(4848);/* ESM import */var i=r(8663);/* ESM import */var a=r(1594);/* ESM import */var o=/*#__PURE__*/r.n(a);/* ESM import */var s=r(6694);/* ESM import */var l=r(4146);/* ESM import */var u=/*#__PURE__*/r.n(l);/* ESM import */var c=r(1287);var d=n.Fragment;var f=function e(e,t,r){if(!i.h.call(t,"css")){return n.jsx(e,t,r)}return n.jsx(i.E,(0,i.c)(e,t),r)};var p=function e(e,t,r){if(!i.h.call(t,"css")){return n.jsxs(e,t,r)}return n.jsxs(i.E,(0,i.c)(e,t),r)}},4614:function(e,t,r){"use strict";// EXPORTS
r.d(t,{J:()=>/* binding */b});// CONCATENATED MODULE: ./node_modules/@emotion/hash/dist/emotion-hash.esm.js
/* eslint-disable */// Inspired by https://github.com/garycourt/murmurhash-js
// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86
function n(e){// 'm' and 'r' are mixing constants generated offline.
// They're not really 'magic', they just happen to work well.
// const m = 0x5bd1e995;
// const r = 24;
// Initialize the hash
var t=0;// Mix 4 bytes at a time into the hash
var r,n=0,i=e.length;for(;i>=4;++n,i-=4){r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24;r=/* Math.imul(k, m): */(r&65535)*0x5bd1e995+((r>>>16)*59797<<16);r^=/* k >>> r: */r>>>24;t=/* Math.imul(k, m): */(r&65535)*0x5bd1e995+((r>>>16)*59797<<16)^/* Math.imul(h, m): */(t&65535)*0x5bd1e995+((t>>>16)*59797<<16)}// Handle the last few bytes of the input array
switch(i){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255;t=/* Math.imul(h, m): */(t&65535)*0x5bd1e995+((t>>>16)*59797<<16)}// Do a few final mixes of the hash to ensure the last few
// bytes are well-incorporated.
t^=t>>>13;t=/* Math.imul(h, m): */(t&65535)*0x5bd1e995+((t>>>16)*59797<<16);return((t^t>>>15)>>>0).toString(36)};// CONCATENATED MODULE: ./node_modules/@emotion/unitless/dist/emotion-unitless.esm.js
var i={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,// SVG-related properties
fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};// CONCATENATED MODULE: ./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js
function a(e){var t=Object.create(null);return function(r){if(t[r]===undefined)t[r]=e(r);return t[r]}};// CONCATENATED MODULE: ./node_modules/@emotion/serialize/dist/emotion-serialize.esm.js
var o=false;var s=/[A-Z]|^ms/g;var l=/_EMO_([^_]+?)_([^]*?)_EMO_/g;var u=function e(e){return e.charCodeAt(1)===45};var c=function e(e){return e!=null&&typeof e!=="boolean"};var d=/* #__PURE__ */a(function(e){return u(e)?e:e.replace(s,"-$&").toLowerCase()});var f=function e(e,t){switch(e){case"animation":case"animationName":{if(typeof t==="string"){return t.replace(l,function(e,t,r){m={name:t,styles:r,next:m};return t})}}}if(i[e]!==1&&!u(e)&&typeof t==="number"&&t!==0){return t+"px"}return t};var p="Component selectors can only be used in conjunction with "+"@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware "+"compiler transform.";function h(e,t,r){if(r==null){return""}var n=r;if(n.__emotion_styles!==undefined){return n}switch(typeof r){case"boolean":{return""}case"object":{var i=r;if(i.anim===1){m={name:i.name,styles:i.styles,next:m};return i.name}var a=r;if(a.styles!==undefined){var o=a.next;if(o!==undefined){// not the most efficient thing ever but this is a pretty rare case
// and there will be very few iterations of this generally
while(o!==undefined){m={name:o.name,styles:o.styles,next:m};o=o.next}}var s=a.styles+";";return s}return v(e,t,r)}case"function":{if(e!==undefined){var l=m;var u=r(e);m=l;return h(e,t,u)}break}}// finalize string values (regular strings and functions interpolated into css calls)
var c=r;if(t==null){return c}var d=t[c];return d!==undefined?d:c}function v(e,t,r){var n="";if(Array.isArray(r)){for(var i=0;i<r.length;i++){n+=h(e,t,r[i])+";"}}else{for(var a in r){var s=r[a];if(typeof s!=="object"){var l=s;if(t!=null&&t[l]!==undefined){n+=a+"{"+t[l]+"}"}else if(c(l)){n+=d(a)+":"+f(a,l)+";"}}else{if(a==="NO_COMPONENT_SELECTOR"&&o){throw new Error(p)}if(Array.isArray(s)&&typeof s[0]==="string"&&(t==null||t[s[0]]===undefined)){for(var u=0;u<s.length;u++){if(c(s[u])){n+=d(a)+":"+f(a,s[u])+";"}}}else{var v=h(e,t,s);switch(a){case"animation":case"animationName":{n+=d(a)+":"+v+";";break}default:{n+=a+"{"+v+"}"}}}}}}return n}var g=/label:\s*([^\s;{]+)\s*(;|$)/g;// this is the cursor for keyframes
// keyframes are stored on the SerializedStyles object as a linked list
var m;function b(e,t,r){if(e.length===1&&typeof e[0]==="object"&&e[0]!==null&&e[0].styles!==undefined){return e[0]}var i=true;var a="";m=undefined;var o=e[0];if(o==null||o.raw===undefined){i=false;a+=h(r,t,o)}else{var s=o;a+=s[0]}// we start at 1 since we've already handled the first arg
for(var l=1;l<e.length;l++){a+=h(r,t,e[l]);if(i){var u=o;a+=u[l]}}// using a global regex with .exec is stateful so lastIndex has to be reset each time
g.lastIndex=0;var c="";var d;// https://esbench.com/bench/5b809c2cf2949800a0f61fb5
while((d=g.exec(a))!==null){c+="-"+d[1]}var f=n(a)+c;return{name:f,styles:a,next:m}}},1287:function(e,t,r){"use strict";r.d(t,{i:()=>l,s:()=>s});/* ESM import */var n=r(1594);/* ESM import */var i=/*#__PURE__*/r.n(n);var a=function e(e){return e()};var o=n["useInsertion"+"Effect"]?n["useInsertion"+"Effect"]:false;var s=o||a;var l=o||n.useLayoutEffect},41:function(e,t,r){"use strict";r.d(t,{Rk:()=>i,SF:()=>a,sk:()=>o});var n=true;function i(e,t,r){var n="";r.split(" ").forEach(function(r){if(e[r]!==undefined){t.push(e[r]+";")}else if(r){n+=r+" "}});return n}var a=function e(e,t,r){var i=e.key+"-"+t.name;if(// class name could be used further down
// the tree but if it's a string tag, we know it won't
// so we don't have to add it to registered cache.
// this improves memory usage since we can avoid storing the whole style string
(r===false||// we need to always store it if we're in compat mode and
// in node since emotion-server relies on whether a style is in
// the registered cache to know whether a style is global or not
// also, note that this check will be dead code eliminated in the browser
n===false)&&e.registered[i]===undefined){e.registered[i]=t.styles}};var o=function e(e,t,r){a(e,t,r);var n=e.key+"-"+t.name;if(e.inserted[t.name]===undefined){var i=t;do{e.insert(t===i?"."+n:"",i,e.sheet,true);i=i.next}while(i!==undefined)}}},4146:function(e,t,r){"use strict";var n=r(4363);/**
 * Copyright 2015, Yahoo! Inc.
 * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
 */var i={childContextTypes:true,contextType:true,contextTypes:true,defaultProps:true,displayName:true,getDefaultProps:true,getDerivedStateFromError:true,getDerivedStateFromProps:true,mixins:true,propTypes:true,type:true};var a={name:true,length:true,prototype:true,caller:true,callee:true,arguments:true,arity:true};var o={"$$typeof":true,render:true,defaultProps:true,displayName:true,propTypes:true};var s={"$$typeof":true,compare:true,defaultProps:true,displayName:true,propTypes:true,type:true};var l={};l[n.ForwardRef]=o;l[n.Memo]=s;function u(e){// React v16.11 and below
if(n.isMemo(e)){return s}// React v16.12 and above
return l[e["$$typeof"]]||i}var c=Object.defineProperty;var d=Object.getOwnPropertyNames;var f=Object.getOwnPropertySymbols;var p=Object.getOwnPropertyDescriptor;var h=Object.getPrototypeOf;var v=Object.prototype;function g(e,t,r){if(typeof t!=="string"){// don't hoist over string (html) components
if(v){var n=h(t);if(n&&n!==v){g(e,n,r)}}var i=d(t);if(f){i=i.concat(f(t))}var o=u(e);var s=u(t);for(var l=0;l<i.length;++l){var m=i[l];if(!a[m]&&!(r&&r[m])&&!(s&&s[m])&&!(o&&o[m])){var b=p(t,m);try{// Avoid failures from read-only properties
c(e,m,b)}catch(e){}}}}return e}e.exports=g},5338:function(e,t,r){"use strict";var n=r(5206);if(true){t.createRoot=n.createRoot;t.hydrateRoot=n.hydrateRoot}else{var i}},2799:function(e,t){"use strict";/** @license React v16.13.1
 * react-is.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var r="function"===typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,o=r?Symbol.for("react.strict_mode"):60108,s=r?Symbol.for("react.profiler"):60114,l=r?Symbol.for("react.provider"):60109,u=r?Symbol.for("react.context"):60110,c=r?Symbol.for("react.async_mode"):60111,d=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,p=r?Symbol.for("react.suspense"):60113,h=r?Symbol.for("react.suspense_list"):60120,v=r?Symbol.for("react.memo"):60115,g=r?Symbol.for("react.lazy"):60116,m=r?Symbol.for("react.block"):60121,b=r?Symbol.for("react.fundamental"):60117,y=r?Symbol.for("react.responder"):60118,_=r?Symbol.for("react.scope"):60119;function w(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type,e){case c:case d:case a:case s:case o:case p:return e;default:switch(e=e&&e.$$typeof,e){case u:case f:case g:case v:case l:return e;default:return t}}case i:return t}}}function x(e){return w(e)===d}t.AsyncMode=c;t.ConcurrentMode=d;t.ContextConsumer=u;t.ContextProvider=l;t.Element=n;t.ForwardRef=f;t.Fragment=a;t.Lazy=g;t.Memo=v;t.Portal=i;t.Profiler=s;t.StrictMode=o;t.Suspense=p;t.isAsyncMode=function(e){return x(e)||w(e)===c};t.isConcurrentMode=x;t.isContextConsumer=function(e){return w(e)===u};t.isContextProvider=function(e){return w(e)===l};t.isElement=function(e){return"object"===typeof e&&null!==e&&e.$$typeof===n};t.isForwardRef=function(e){return w(e)===f};t.isFragment=function(e){return w(e)===a};t.isLazy=function(e){return w(e)===g};t.isMemo=function(e){return w(e)===v};t.isPortal=function(e){return w(e)===i};t.isProfiler=function(e){return w(e)===s};t.isStrictMode=function(e){return w(e)===o};t.isSuspense=function(e){return w(e)===p};t.isValidElementType=function(e){return"string"===typeof e||"function"===typeof e||e===a||e===d||e===s||e===o||e===p||e===h||"object"===typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===v||e.$$typeof===l||e.$$typeof===u||e.$$typeof===f||e.$$typeof===b||e.$$typeof===y||e.$$typeof===_||e.$$typeof===m)};t.typeOf=w},4363:function(e,t,r){"use strict";if(true){e.exports=r(2799)}else{}},1020:function(e,t,r){"use strict";/**
 * @license React
 * react-jsx-runtime.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var n=r(1594),i=Symbol.for("react.element"),a=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,s=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function u(e,t,r){var n,a={},u=null,c=null;void 0!==r&&(u=""+r);void 0!==t.key&&(u=""+t.key);void 0!==t.ref&&(c=t.ref);for(n in t)o.call(t,n)&&!l.hasOwnProperty(n)&&(a[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)void 0===a[n]&&(a[n]=t[n]);return{$$typeof:i,type:e,key:u,ref:c,props:a,_owner:s.current}}t.Fragment=a;t.jsx=u;t.jsxs=u},4848:function(e,t,r){"use strict";if(true){e.exports=r(1020)}else{}},4131:function(e,t){/*!
 * CSSJanus. https://www.mediawiki.org/wiki/CSSJanus
 *
 * Copyright 2014 Trevor Parscal
 * Copyright 2010 Roan Kattouw
 * Copyright 2008 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */var r;/**
 * Create a tokenizer object.
 *
 * This utility class is used by CSSJanus to protect strings by replacing them temporarily with
 * tokens and later transforming them back.
 *
 * @class
 * @constructor
 * @param {RegExp} regex Regular expression whose matches to replace by a token
 * @param {string} token Placeholder text
 */function n(e,t){var r=[],n=0;/**
	 * Add a match.
	 *
	 * @private
	 * @param {string} match Matched string
	 * @return {string} Token to leave in the matched string's place
	 */function i(e){r.push(e);return t}/**
	 * Get a match.
	 *
	 * @private
	 * @return {string} Original matched string to restore
	 */function a(){return r[n++]}return{/**
		 * Replace matching strings with tokens.
		 *
		 * @param {string} str String to tokenize
		 * @return {string} Tokenized string
		 */tokenize:function(t){return t.replace(e,i)},/**
		 * Restores tokens to their original values.
		 *
		 * @param {string} str String previously run through tokenize()
		 * @return {string} Original string
		 */detokenize:function(e){return e.replace(new RegExp("("+t+")","g"),a)}}}/**
 * Create a CSSJanus object.
 *
 * CSSJanus transforms CSS rules with horizontal relevance so that a left-to-right stylesheet can
 * become a right-to-left stylesheet automatically. Processing can be bypassed for an entire rule
 * or a single property by adding a / * @noflip * / comment above the rule or property.
 *
 * @class
 * @constructor
 */function i(){var // Tokens
e="`TMP`",t="`TMPLTR`",r="`TMPRTL`",i="`NOFLIP_SINGLE`",a="`NOFLIP_CLASS`",o="`COMMENT`",// Patterns
s="[^\\u0020-\\u007e]",l="(?:(?:\\\\[0-9a-f]{1,6})(?:\\r\\n|\\s)?)",u="(?:[0-9]*\\.[0-9]+|[0-9]+)",c="(?:em|ex|px|cm|mm|in|pt|pc|deg|rad|grad|ms|s|hz|khz|%)",d="direction\\s*:\\s*",f="[!#$%&*-~]",p="['\"]?\\s*",h="(^|[^a-zA-Z])",v="[^\\}]*?",g="\\/\\*\\!?\\s*@noflip\\s*\\*\\/",m="\\/\\*[^*]*\\*+([^\\/*][^*]*\\*+)*\\/",b="(?:"+l+"|\\\\[^\\r\\n\\f0-9a-f])",y="(?:[_a-z]|"+s+"|"+b+")",_="(?:[_a-z0-9-]|"+s+"|"+b+")",w="-?"+y+_+"*",x=u+"(?:\\s*"+c+"|"+w+")?",A="((?:-?"+x+")|(?:inherit|auto))",k="(?:-?"+u+"(?:\\s*"+c+")?)",E="(?:\\+|\\-|\\*|\\/)",I="(?:\\(|\\)|\\t| )",C="(?:"+I+"|"+k+"|"+E+"){3,}",Y="(?:calc\\((?:"+C+")\\))",T="((?:-?"+x+")|(?:inherit|auto)|"+Y+")",S="((?:margin|padding|border-width)\\s*:\\s*)",O="((?:-color|border-style)\\s*:\\s*)",D="(#?"+_+"+|(?:rgba?|hsla?)\\([ \\d.,%-]+\\))",// The use of a lazy match ("*?") may cause a backtrack limit to be exceeded before finding
// the intended match. This affects 'urlCharsPattern' and 'lookAheadNotOpenBracePattern'.
// We have not yet found this problem on Node.js, but we have on PHP 7, where it was
// mitigated by using a possessive quantifier ("*+"), which are not supported in JS.
// See <https://phabricator.wikimedia.org/T215746#4944830>.
F="(?:"+f+"|"+s+"|"+b+")*?",R="(?![a-zA-Z])",P="(?!("+_+"|\\r?\\n|\\s|#|\\:|\\.|\\,|\\+|>|~|\\(|\\)|\\[|\\]|=|\\*=|~=|\\^=|'[^']*'|\"[^\"]*\"|"+o+")*?{)",M="(?!"+F+p+"\\))",H="(?="+F+p+"\\))",N="(\\s*(?:!important\\s*)?[;}])",// Regular expressions
L=/`TMP`/g,K=/`TMPLTR`/g,B=/`TMPRTL`/g,j=new RegExp(m,"gi"),U=new RegExp("("+g+P+"[^;}]+;?)","gi"),q=new RegExp("("+g+v+"})","gi"),V=new RegExp("("+d+")ltr","gi"),W=new RegExp("("+d+")rtl","gi"),z=new RegExp(h+"(left)"+R+M+P,"gi"),G=new RegExp(h+"(right)"+R+M+P,"gi"),Q=new RegExp(h+"(left)"+H,"gi"),$=new RegExp(h+"(right)"+H,"gi"),X=/(:dir\( *)ltr( *\))/g,J=/(:dir\( *)rtl( *\))/g,Z=new RegExp(h+"(ltr)"+H,"gi"),ee=new RegExp(h+"(rtl)"+H,"gi"),et=new RegExp(h+"([ns]?)e-resize","gi"),er=new RegExp(h+"([ns]?)w-resize","gi"),en=new RegExp(S+T+"(\\s+)"+T+"(\\s+)"+T+"(\\s+)"+T+N,"gi"),ei=new RegExp(O+D+"(\\s+)"+D+"(\\s+)"+D+"(\\s+)"+D+N,"gi"),ea=new RegExp("(background(?:-position)?\\s*:\\s*(?:[^:;}\\s]+\\s+)*?)("+x+")","gi"),eo=new RegExp("(background-position-x\\s*:\\s*)(-?"+u+"%)","gi"),// border-radius: <length or percentage>{1,4} [optional: / <length or percentage>{1,4} ]
es=new RegExp("(border-radius\\s*:\\s*)"+A+"(?:(?:\\s+"+A+")(?:\\s+"+A+")?(?:\\s+"+A+")?)?"+"(?:(?:(?:\\s*\\/\\s*)"+A+")(?:\\s+"+A+")?(?:\\s+"+A+")?(?:\\s+"+A+")?)?"+N,"gi"),el=new RegExp("(box-shadow\\s*:\\s*(?:inset\\s*)?)"+A,"gi"),eu=new RegExp("(text-shadow\\s*:\\s*)"+A+"(\\s*)"+D,"gi"),ec=new RegExp("(text-shadow\\s*:\\s*)"+D+"(\\s*)"+A,"gi"),ed=new RegExp("(text-shadow\\s*:\\s*)"+A,"gi"),ef=new RegExp("(transform\\s*:[^;}]*)(translateX\\s*\\(\\s*)"+A+"(\\s*\\))","gi"),ep=new RegExp("(transform\\s*:[^;}]*)(translate\\s*\\(\\s*)"+A+"((?:\\s*,\\s*"+A+"){0,2}\\s*\\))","gi");/**
	 * Invert the horizontal value of a background position property.
	 *
	 * @private
	 * @param {string} match Matched property
	 * @param {string} pre Text before value
	 * @param {string} value Horizontal value
	 * @return {string} Inverted property
	 */function eh(e,t,r){var n,i;if(r.slice(-1)==="%"){n=r.indexOf(".");if(n!==-1){// Two off, one for the "%" at the end, one for the dot itself
i=r.length-n-2;r=100-parseFloat(r);r=r.toFixed(i)+"%"}else{r=100-parseFloat(r)+"%"}}return t+r}/**
	 * Invert a set of border radius values.
	 *
	 * @private
	 * @param {Array} values Matched values
	 * @return {string} Inverted values
	 */function ev(e){switch(e.length){case 4:e=[e[1],e[0],e[3],e[2]];break;case 3:e=[e[1],e[0],e[1],e[2]];break;case 2:e=[e[1],e[0]];break;case 1:e=[e[0]];break}return e.join(" ")}/**
	 * Invert a set of border radius values.
	 *
	 * @private
	 * @param {string} match Matched property
	 * @param {string} pre Text before value
	 * @param {string} [firstGroup1]
	 * @param {string} [firstGroup2]
	 * @param {string} [firstGroup3]
	 * @param {string} [firstGroup4]
	 * @param {string} [secondGroup1]
	 * @param {string} [secondGroup2]
	 * @param {string} [secondGroup3]
	 * @param {string} [secondGroup4]
	 * @param {string} [post] Text after value
	 * @return {string} Inverted property
	 */function eg(e,t){var r,n=[].slice.call(arguments),i=n.slice(2,6).filter(function(e){return e}),a=n.slice(6,10).filter(function(e){return e}),o=n[10]||"";if(a.length){r=ev(i)+" / "+ev(a)}else{r=ev(i)}return t+r+o}/**
	 * Flip the sign of a CSS value, possibly with a unit.
	 *
	 * We can't just negate the value with unary minus due to the units.
	 *
	 * @private
	 * @param {string} value
	 * @return {string}
	 */function em(e){if(parseFloat(e)===0){// Don't mangle zeroes
return e}if(e[0]==="-"){return e.slice(1)}return"-"+e}/**
	 * @private
	 * @param {string} match
	 * @param {string} property
	 * @param {string} offset
	 * @return {string}
	 */function eb(e,t,r){return t+em(r)}/**
	 * @private
	 * @param {string} match
	 * @param {string} property
	 * @param {string} prefix
	 * @param {string} offset
	 * @param {string} suffix
	 * @return {string}
	 */function ey(e,t,r,n,i){return t+r+em(n)+i}/**
	 * @private
	 * @param {string} match
	 * @param {string} property
	 * @param {string} color
	 * @param {string} space
	 * @param {string} offset
	 * @return {string}
	 */function e_(e,t,r,n,i){return t+r+n+em(i)}return{/**
		 * Transform a left-to-right stylesheet to right-to-left.
		 *
		 * @param {string} css Stylesheet to transform
		 * @param {Object} options Options
		 * @param {boolean} [options.transformDirInUrl=false] Transform directions in URLs
		 * (e.g. 'ltr', 'rtl')
		 * @param {boolean} [options.transformEdgeInUrl=false] Transform edges in URLs
		 * (e.g. 'left', 'right')
		 * @return {string} Transformed stylesheet
		 */"transform":function(s,l){// Use single quotes in this object literal key for closure compiler.
// Tokenizers
var u=new n(U,i),c=new n(q,a),d=new n(j,o);// Tokenize
s=d.tokenize(c.tokenize(u.tokenize(// We wrap tokens in ` , not ~ like the original implementation does.
// This was done because ` is not a legal character in CSS and can only
// occur in URLs, where we escape it to %60 before inserting our tokens.
s.replace("`","%60"))));// Transform URLs
if(l.transformDirInUrl){// Replace 'ltr' with 'rtl' and vice versa in background URLs
s=s.replace(X,"$1"+t+"$2").replace(J,"$1"+r+"$2").replace(Z,"$1"+e).replace(ee,"$1ltr").replace(L,"rtl").replace(K,"ltr").replace(B,"rtl")}if(l.transformEdgeInUrl){// Replace 'left' with 'right' and vice versa in background URLs
s=s.replace(Q,"$1"+e).replace($,"$1left").replace(L,"right")}// Transform rules
s=s// Replace direction: ltr; with direction: rtl; and vice versa.
.replace(V,"$1"+e).replace(W,"$1ltr").replace(L,"rtl")// Flip rules like left: , padding-right: , etc.
.replace(z,"$1"+e).replace(G,"$1left").replace(L,"right")// Flip East and West in rules like cursor: nw-resize;
.replace(et,"$1$2"+e).replace(er,"$1$2e-resize").replace(L,"w-resize")// Border radius
.replace(es,eg)// Shadows
.replace(el,eb).replace(eu,e_).replace(ec,e_).replace(ed,eb)// Translate
.replace(ef,ey).replace(ep,ey)// Swap the second and fourth parts in four-part notation rules
// like padding: 1px 2px 3px 4px;
.replace(en,"$1$2$3$8$5$6$7$4$9").replace(ei,"$1$2$3$8$5$6$7$4$9")// Flip horizontal background percentages
.replace(ea,eh).replace(eo,eh);// Detokenize
s=u.detokenize(c.detokenize(d.detokenize(s)));return s}}}/* Initialization */r=new i;/* Exports */if(true&&e.exports){/**
	 * Transform a left-to-right stylesheet to right-to-left.
	 *
	 * This function is a static wrapper around the transform method of an instance of CSSJanus.
	 *
	 * @param {string} css Stylesheet to transform
	 * @param {Object|boolean} [options] Options object, or transformDirInUrl option (back-compat)
	 * @param {boolean} [options.transformDirInUrl=false] Transform directions in URLs
	 * (e.g. 'ltr', 'rtl')
	 * @param {boolean} [options.transformEdgeInUrl=false] Transform edges in URLs
	 * (e.g. 'left', 'right')
	 * @param {boolean} [transformEdgeInUrl] Back-compat parameter
	 * @return {string} Transformed stylesheet
	 */t.transform=function(e,t,n){var i;if(typeof t==="object"){i=t}else{i={};if(typeof t==="boolean"){i.transformDirInUrl=t}if(typeof n==="boolean"){i.transformEdgeInUrl=n}}return r.transform(e,i)}}else if(typeof window!=="undefined"){/* global window */// Allow cssjanus to be used in a browser.
// eslint-disable-next-line dot-notation
window["cssjanus"]=r}},2053:function(e,t,r){"use strict";t.__esModule=true;t["default"]=v;var n=o(r(187));var i=o(r(7303));var a=o(r(9677));function o(e){return e&&e.__esModule?e:{"default":e}}var s=/^#[a-fA-F0-9]{6}$/;var l=/^#[a-fA-F0-9]{8}$/;var u=/^#[a-fA-F0-9]{3}$/;var c=/^#[a-fA-F0-9]{4}$/;var d=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i;var f=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;var p=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i;var h=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;/**
 * Returns an RgbColor or RgbaColor object. This utility function is only useful
 * if want to extract a color component. With the color util `toColorString` you
 * can convert a RgbColor or RgbaColor object back to a string.
 *
 * @example
 * // Assigns `{ red: 255, green: 0, blue: 0 }` to color1
 * const color1 = parseToRgb('rgb(255, 0, 0)');
 * // Assigns `{ red: 92, green: 102, blue: 112, alpha: 0.75 }` to color2
 * const color2 = parseToRgb('hsla(210, 10%, 40%, 0.75)');
 */function v(e){if(typeof e!=="string"){throw new a["default"](3)}var t=(0,i["default"])(e);if(t.match(s)){return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16)}}if(t.match(l)){var r=parseFloat((parseInt(""+t[7]+t[8],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16),alpha:r}}if(t.match(u)){return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16)}}if(t.match(c)){var o=parseFloat((parseInt(""+t[4]+t[4],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16),alpha:o}}var v=d.exec(t);if(v){return{red:parseInt(""+v[1],10),green:parseInt(""+v[2],10),blue:parseInt(""+v[3],10)}}var g=f.exec(t.substring(0,50));if(g){return{red:parseInt(""+g[1],10),green:parseInt(""+g[2],10),blue:parseInt(""+g[3],10),alpha:parseFloat(""+g[4])>1?parseFloat(""+g[4])/100:parseFloat(""+g[4])}}var m=p.exec(t);if(m){var b=parseInt(""+m[1],10);var y=parseInt(""+m[2],10)/100;var _=parseInt(""+m[3],10)/100;var w="rgb("+(0,n["default"])(b,y,_)+")";var x=d.exec(w);if(!x){throw new a["default"](4,t,w)}return{red:parseInt(""+x[1],10),green:parseInt(""+x[2],10),blue:parseInt(""+x[3],10)}}var A=h.exec(t.substring(0,50));if(A){var k=parseInt(""+A[1],10);var E=parseInt(""+A[2],10)/100;var I=parseInt(""+A[3],10)/100;var C="rgb("+(0,n["default"])(k,E,I)+")";var Y=d.exec(C);if(!Y){throw new a["default"](4,t,C)}return{red:parseInt(""+Y[1],10),green:parseInt(""+Y[2],10),blue:parseInt(""+Y[3],10),alpha:parseFloat(""+A[4])>1?parseFloat(""+A[4])/100:parseFloat(""+A[4])}}throw new a["default"](5)}e.exports=t["default"]},493:function(e,t,r){"use strict";t.__esModule=true;t["default"]=s;var n=o(r(5622));var i=o(r(3813));var a=o(r(9677));function o(e){return e&&e.__esModule?e:{"default":e}}/**
 * Returns a string value for the color. The returned result is the smallest possible hex notation.
 *
 * @example
 * // Styles as object usage
 * const styles = {
 *   background: rgb(255, 205, 100),
 *   background: rgb({ red: 255, green: 205, blue: 100 }),
 * }
 *
 * // styled-components usage
 * const div = styled.div`
 *   background: ${rgb(255, 205, 100)};
 *   background: ${rgb({ red: 255, green: 205, blue: 100 })};
 * `
 *
 * // CSS in JS Output
 *
 * element {
 *   background: "#ffcd64";
 *   background: "#ffcd64";
 * }
 */function s(e,t,r){if(typeof e==="number"&&typeof t==="number"&&typeof r==="number"){return(0,n["default"])("#"+(0,i["default"])(e)+(0,i["default"])(t)+(0,i["default"])(r))}else if(typeof e==="object"&&t===undefined&&r===undefined){return(0,n["default"])("#"+(0,i["default"])(e.red)+(0,i["default"])(e.green)+(0,i["default"])(e.blue))}throw new a["default"](6)}e.exports=t["default"]},3458:function(e,t,r){"use strict";t.__esModule=true;t["default"]=s;var n=o(r(2053));var i=o(r(493));var a=o(r(9677));function o(e){return e&&e.__esModule?e:{"default":e}}/**
 * Returns a string value for the color. The returned result is the smallest possible rgba or hex notation.
 *
 * Can also be used to fade a color by passing a hex value or named CSS color along with an alpha value.
 *
 * @example
 * // Styles as object usage
 * const styles = {
 *   background: rgba(255, 205, 100, 0.7),
 *   background: rgba({ red: 255, green: 205, blue: 100, alpha: 0.7 }),
 *   background: rgba(255, 205, 100, 1),
 *   background: rgba('#ffffff', 0.4),
 *   background: rgba('black', 0.7),
 * }
 *
 * // styled-components usage
 * const div = styled.div`
 *   background: ${rgba(255, 205, 100, 0.7)};
 *   background: ${rgba({ red: 255, green: 205, blue: 100, alpha: 0.7 })};
 *   background: ${rgba(255, 205, 100, 1)};
 *   background: ${rgba('#ffffff', 0.4)};
 *   background: ${rgba('black', 0.7)};
 * `
 *
 * // CSS in JS Output
 *
 * element {
 *   background: "rgba(255,205,100,0.7)";
 *   background: "rgba(255,205,100,0.7)";
 *   background: "#ffcd64";
 *   background: "rgba(255,255,255,0.4)";
 *   background: "rgba(0,0,0,0.7)";
 * }
 */function s(e,t,r,o){if(typeof e==="string"&&typeof t==="number"){var s=(0,n["default"])(e);return"rgba("+s.red+","+s.green+","+s.blue+","+t+")"}else if(typeof e==="number"&&typeof t==="number"&&typeof r==="number"&&typeof o==="number"){return o>=1?(0,i["default"])(e,t,r):"rgba("+e+","+t+","+r+","+o+")"}else if(typeof e==="object"&&t===undefined&&r===undefined&&o===undefined){return e.alpha>=1?(0,i["default"])(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")"}throw new a["default"](7)}e.exports=t["default"]},9677:function(e,t){"use strict";t.__esModule=true;t["default"]=void 0;function r(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function n(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;l(e,t)}function i(e){var t=typeof Map==="function"?new Map:undefined;i=function e(e){if(e===null||!s(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof t!=="undefined"){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return a(e,arguments,u(this).constructor)}r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:false,writable:true,configurable:true}});return l(r,e)};return i(e)}function a(e,t,r){if(o())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,t);var i=new(e.bind.apply(e,n));return r&&l(i,r.prototype),i}function o(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(o=function t(){return!!e})()}function s(e){try{return Function.toString.call(e).indexOf("[native code]")!==-1}catch(t){return typeof e==="function"}}function l(e,t){l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function e(e,t){e.__proto__=t;return e};return l(e,t)}function u(e){u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function e(e){return e.__proto__||Object.getPrototypeOf(e)};return u(e)}// based on https://github.com/styled-components/styled-components/blob/fcf6f3804c57a14dd7984dfab7bc06ee2edca044/src/utils/error.js
/**
 * Parse errors.md and turn it into a simple hash of code: message
 * @private
 */var c=/* unused pure expression or super */null&&{"1":"Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n","2":"Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n","3":"Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n","4":"Couldn't generate valid rgb string from %s, it returned %s.\n\n","5":"Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n","6":"Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n","7":"Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n","8":"Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n","9":"Please provide a number of steps to the modularScale helper.\n\n","10":"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n","11":'Invalid value passed as base to modularScale, expected number or em string but got "%s"\n\n',"12":'Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.\n\n',"13":'Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.\n\n',"14":'Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',"15":'Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',"16":"You must provide a template to this method.\n\n","17":"You passed an unsupported selector state to this method.\n\n","18":"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n","19":"fromSize and toSize must be provided as stringified numbers with the same units.\n\n","20":"expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n","21":"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n","22":"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n","23":"fontFace expects a name of a font-family.\n\n","24":"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n","25":"fontFace expects localFonts to be an array.\n\n","26":"fontFace expects fileFormats to be an array.\n\n","27":"radialGradient requries at least 2 color-stops to properly render.\n\n","28":"Please supply a filename to retinaImage() as the first argument.\n\n","29":"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n","30":"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n","31":"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n","32":"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n","33":"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n","34":"borderRadius expects a radius value as a string or number as the second argument.\n\n","35":'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',"36":"Property must be a string value.\n\n","37":"Syntax Error at %s.\n\n","38":"Formula contains a function that needs parentheses at %s.\n\n","39":"Formula is missing closing parenthesis at %s.\n\n","40":"Formula has too many closing parentheses at %s.\n\n","41":"All values in a formula must have the same unit or be unitless.\n\n","42":"Please provide a number of steps to the modularScale helper.\n\n","43":"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n","44":"Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n","45":"Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n","46":"Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n","47":"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n","48":"fromSize and toSize must be provided as stringified numbers with the same units.\n\n","49":"Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n","50":"Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n","51":"Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n","52":"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n","53":"fontFace expects localFonts to be an array.\n\n","54":"fontFace expects fileFormats to be an array.\n\n","55":"fontFace expects a name of a font-family.\n\n","56":"linearGradient requries at least 2 color-stops to properly render.\n\n","57":"radialGradient requries at least 2 color-stops to properly render.\n\n","58":"Please supply a filename to retinaImage() as the first argument.\n\n","59":"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n","60":"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n","61":"Property must be a string value.\n\n","62":"borderRadius expects a radius value as a string or number as the second argument.\n\n","63":'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',"64":"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n","65":"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n","66":"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n","67":"You must provide a template to this method.\n\n","68":"You passed an unsupported selector state to this method.\n\n","69":'Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.\n\n',"70":'Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.\n\n',"71":'Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.\n\n',"72":'Passed invalid base value %s to %s(), please pass a value like "12px" or 12.\n\n',"73":"Please provide a valid CSS variable.\n\n","74":"CSS variable not found and no default was provided.\n\n","75":"important requires a valid style object, got a %s instead.\n\n","76":"fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n","77":'remToPx expects a value in "rem" but you provided it in "%s".\n\n',"78":'base must be set in "px" or "%" but you set it in "%s".\n'};/**
 * super basic version of sprintf
 * @private
 */function d(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n=t[0];var i=[];var a;for(a=1;a<t.length;a+=1){i.push(t[a])}i.forEach(function(e){n=n.replace(/%[a-z]/,e)});return n}/**
 * Create an error file out of errors.md for development and a simple web link to the full errors
 * in production mode.
 * @private
 */var f=t["default"]=/*#__PURE__*/function(e){n(t,e);function t(t){var n;if(true){n=e.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+t+" for more information.")||this}else{var i,a,o}return r(n)}return t}(/*#__PURE__*/i(Error));e.exports=t["default"]},187:function(e,t){"use strict";t.__esModule=true;t["default"]=void 0;function r(e){return Math.round(e*255)}function n(e,t,n){return r(e)+","+r(t)+","+r(n)}function i(e,t,r,i){if(i===void 0){i=n}if(t===0){// achromatic
return i(r,r,r)}// formulae from https://en.wikipedia.org/wiki/HSL_and_HSV
var a=(e%360+360)%360/60;var o=(1-Math.abs(2*r-1))*t;var s=o*(1-Math.abs(a%2-1));var l=0;var u=0;var c=0;if(a>=0&&a<1){l=o;u=s}else if(a>=1&&a<2){l=s;u=o}else if(a>=2&&a<3){u=o;c=s}else if(a>=3&&a<4){u=s;c=o}else if(a>=4&&a<5){l=s;c=o}else if(a>=5&&a<6){l=o;c=s}var d=r-o/2;var f=l+d;var p=u+d;var h=c+d;return i(f,p,h)}var a=t["default"]=i;e.exports=t["default"]},7303:function(e,t){"use strict";t.__esModule=true;t["default"]=void 0;var r={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};/**
 * Checks if a string is a CSS named color and returns its equivalent hex value, otherwise returns the original color.
 * @private
 */function n(e){if(typeof e!=="string")return e;var t=e.toLowerCase();return r[t]?"#"+r[t]:e}var i=t["default"]=n;e.exports=t["default"]},3813:function(e,t){"use strict";t.__esModule=true;t["default"]=void 0;function r(e){var t=e.toString(16);return t.length===1?"0"+t:t}var n=t["default"]=r;e.exports=t["default"]},5622:function(e,t){"use strict";t.__esModule=true;t["default"]=void 0;/**
 * Reduces hex values if possible e.g. #ff8866 to #f86
 * @private
 */var r=function e(e){if(e.length===7&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]){return"#"+e[1]+e[3]+e[5]}return e};var n=t["default"]=r;e.exports=t["default"]},4469:function(e){"use strict";// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// If obj.hasOwnProperty has been overridden, then calling
// obj.hasOwnProperty(prop) will break.
// See: https://github.com/joyent/node/issues/1707
function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,r,n,i){r=r||"&";n=n||"=";var a={};if(typeof e!=="string"||e.length===0){return a}var o=/\+/g;e=e.split(r);var s=1e3;if(i&&typeof i.maxKeys==="number"){s=i.maxKeys}var l=e.length;// maxKeys <= 0 means that we should not limit keys count
if(s>0&&l>s){l=s}for(var u=0;u<l;++u){var c=e[u].replace(o,"%20"),d=c.indexOf(n),f,p,h,v;if(d>=0){f=c.substr(0,d);p=c.substr(d+1)}else{f=c;p=""}h=decodeURIComponent(f);v=decodeURIComponent(p);if(!t(a,h)){a[h]=v}else if(Array.isArray(a[h])){a[h].push(v)}else{a[h]=[a[h],v]}}return a}},541:function(e){"use strict";// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,r,n,i){r=r||"&";n=n||"=";if(e===null){e=undefined}if(typeof e==="object"){return Object.keys(e).map(function(i){var a=encodeURIComponent(t(i))+n;if(Array.isArray(e[i])){return e[i].map(function(e){return a+encodeURIComponent(t(e))}).join(r)}else{return a+encodeURIComponent(t(e[i]))}}).filter(Boolean).join(r)}if(!i)return"";return encodeURIComponent(t(i))+n+encodeURIComponent(t(e))}},4059:function(e,t,r){"use strict";var n;n=/* unused reexport */r(4469);n=t.stringify=r(541)},3494:function(e,t,r){"use strict";r.d(t,{A:()=>w});/* ESM import */var n=r(7317);/* ESM import */var i=r(8015);/* ESM import */var a=r(9414);/* ESM import */var o=r(6154);/* ESM import */var s=r(3747);/* ESM import */var l=r(1699);/* ESM import */var u=r(1594);/* ESM import */var c=/*#__PURE__*/r.n(u);/* ESM import */var d=r(6277);/* ESM import */var f=r(4532);/* ESM import */var p=r(6439);/* ESM import */var h=r(8631);/* ESM import */var v=r(6014);function g(){var e=(0,o._)(["\n      color: transparent;\n    "]);g=function t(){return e};return e}function m(){var e=(0,o._)(["\n      margin-right: 0;\n      margin-left: ",";\n    "]);m=function t(){return e};return e}function b(){var e=(0,o._)(["\n      opacity: 0;\n    "]);b=function t(){return e};return e}function y(){var e=(0,o._)(["\n      margin-inline: 0;\n    "]);y=function t(){return e};return e}var _=/*#__PURE__*/c().forwardRef((e,t)=>{var{variant:r="primary",isOutlined:o=false,size:l="regular",loading:u=false,children:c,disabled:f=false,icon:p,iconPosition:h="left",buttonCss:v,buttonContentCss:g,as:m="button",tabIndex:b,isIconOnly:y=false}=e,_=(0,a._)(e,["variant","isOutlined","size","loading","children","disabled","icon","iconPosition","buttonCss","buttonContentCss","as","tabIndex","isIconOnly"]);var w=[E({variant:r,outlined:o?r:"none",size:l,isLoading:u?"true":"false",iconOnly:y?"true":"false"}),v];var x=/*#__PURE__*/(0,s/* .jsxs */.FD)(s/* .Fragment */.FK,{children:[u&&!f&&/*#__PURE__*/(0,s/* .jsx */.Y)("span",{css:k.spinner,children:/*#__PURE__*/(0,s/* .jsx */.Y)(d/* ["default"] */.A,{name:"spinner",width:18,height:18})}),/*#__PURE__*/(0,s/* .jsxs */.FD)("span",{css:[k.buttonContent({loading:u,disabled:f}),g],children:[p&&h==="left"&&/*#__PURE__*/(0,s/* .jsx */.Y)("span",{css:k.buttonIcon({iconPosition:h,loading:u,hasChildren:!!c}),children:p}),c,p&&h==="right"&&/*#__PURE__*/(0,s/* .jsx */.Y)("span",{css:k.buttonIcon({iconPosition:h,loading:u,hasChildren:!!c}),children:p})]})]});if(m==="a"){var{href:A,target:I,rel:C,download:Y,onClick:T}=_,S=(0,a._)(_,["href","target","rel","download","onClick"]);// Auto-add security attributes for external links
var O=typeof A==="string"&&(A.startsWith("http")||A.startsWith("//"));var D=I==="_blank"&&O?"".concat(C?"".concat(C," "):"","noopener noreferrer"):C;return/*#__PURE__*/(0,s/* .jsx */.Y)("a",(0,i._)((0,n._)({ref:t,css:w,href:f||u?undefined:A,target:f||u?undefined:I,rel:D,download:f||u?undefined:Y,tabIndex:f||u?-1:b,"aria-disabled":f||u,onClick:f||u?e=>e.preventDefault():T,role:"button","data-size":l},S),{children:x}))}var{type:F="button",onClick:R,form:P,name:M,value:H}=_,N=(0,a._)(_,["type","onClick","form","name","value"]);return/*#__PURE__*/(0,s/* .jsx */.Y)("button",(0,i._)((0,n._)({ref:t,type:F,css:w,disabled:f||u,tabIndex:b,onClick:R,form:P,name:M,value:H,"data-size":l},N),{children:x}))});_.displayName="Button";/* ESM default export */const w=_;var x=/*#__PURE__*/(0,l/* .keyframes */.i7)("0%{transform:rotate(0);}100%{transform:rotate(360deg);}");var A={notOutlined:/*#__PURE__*/(0,l/* .css */.AH)("&:disabled,&[aria-disabled='true']{background-color:",f/* .colorTokens.action.primary.disable */.I6.action.primary.disable,";color:",f/* .colorTokens.text.disable */.I6.text.disable,";svg{color:",f/* .colorTokens.icon.disable["default"] */.I6.icon.disable["default"],";}}"),outlined:/*#__PURE__*/(0,l/* .css */.AH)("&:disabled,&[aria-disabled='true']{background-color:transparent;border:none;box-shadow:inset 0px 0px 0px 1px ",f/* .colorTokens.action.outline.disable */.I6.action.outline.disable,";color:",f/* .colorTokens.text.disable */.I6.text.disable,";svg{color:",f/* .colorTokens.icon.disable["default"] */.I6.icon.disable["default"],";}}"),text:/*#__PURE__*/(0,l/* .css */.AH)("&:disabled,&[aria-disabled='true']{color:",f/* .colorTokens.text.disable */.I6.text.disable,";svg{color:",f/* .colorTokens.icon.disable["default"] */.I6.icon.disable["default"],";}}")};var k={base:/*#__PURE__*/(0,l/* .css */.AH)(v/* .styleUtils.resetButton */.x.resetButton,";",v/* .styleUtils.display.inlineFlex */.x.display.inlineFlex(),";justify-content:center;align-items:center;",p/* .typography.caption */.I.caption("medium"),";",v/* .styleUtils.text.align.center */.x.text.align.center,";color:",f/* .colorTokens.text.white */.I6.text.white,";text-decoration:none;vertical-align:middle;cursor:pointer;user-select:none;background-color:transparent;border:0;padding:",f/* .spacing["8"] */.YK["8"]," ",f/* .spacing["32"] */.YK["32"],";border-radius:",f/* .borderRadius["6"] */.Vq["6"],";z-index:",f/* .zIndex.level */.fE.level,";transition:all 150ms ease-in-out;position:relative;svg{color:",f/* .colorTokens.icon.white */.I6.icon.white,";}&:disabled,&[aria-disabled='true']{cursor:not-allowed;}&:not(:disabled):not([aria-disabled='true']){&:focus{box-shadow:",f/* .shadow.focus */.r7.focus,";}&:focus-visible{box-shadow:none;outline:2px solid ",f/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:1px;}}"),variant:{primary:/*#__PURE__*/(0,l/* .css */.AH)("background-color:",f/* .colorTokens.action.primary["default"] */.I6.action.primary["default"],";",A.notOutlined,";&:not(:disabled):not([aria-disabled='true']){&:hover,&:focus{color:",f/* .colorTokens.text.white */.I6.text.white,";background-color:",f/* .colorTokens.action.primary.hover */.I6.action.primary.hover,";}&:active{background-color:",f/* .colorTokens.action.primary.active */.I6.action.primary.active,";color:",f/* .colorTokens.text.white */.I6.text.white,";svg{color:",f/* .colorTokens.icon.white */.I6.icon.white,";}}}"),secondary:/*#__PURE__*/(0,l/* .css */.AH)("background-color:",f/* .colorTokens.action.secondary["default"] */.I6.action.secondary["default"],";color:",f/* .colorTokens.text.brand */.I6.text.brand,";svg{color:",f/* .colorTokens.icon.brand */.I6.icon.brand,";}",A.notOutlined,";&:not(:disabled):not([aria-disabled='true']){&:hover,&:focus{background-color:",f/* .colorTokens.action.secondary.hover */.I6.action.secondary.hover,";color:",f/* .colorTokens.text.brand */.I6.text.brand,";}&:active{background-color:",f/* .colorTokens.action.secondary.active */.I6.action.secondary.active,";color:",f/* .colorTokens.text.brand */.I6.text.brand,";}}"),tertiary:/*#__PURE__*/(0,l/* .css */.AH)("box-shadow:inset 0px 0px 0px 1px ",f/* .colorTokens.stroke["default"] */.I6.stroke["default"],";color:",f/* .colorTokens.text.subdued */.I6.text.subdued,";svg{color:",f/* .colorTokens.icon.hints */.I6.icon.hints,";}",A.outlined,";&:not(:disabled):not([aria-disabled='true']){&:hover,&:focus{background-color:",f/* .colorTokens.background.hover */.I6.background.hover,";box-shadow:inset 0px 0px 0px 1px ",f/* .colorTokens.stroke.hover */.I6.stroke.hover,";color:",f/* .colorTokens.text.title */.I6.text.title,";svg{color:",f/* .colorTokens.icon.brand */.I6.icon.brand,";}}&:active{background-color:",f/* .colorTokens.background.active */.I6.background.active,";svg{color:",f/* .colorTokens.icon.hints */.I6.icon.hints,";}}}"),danger:/*#__PURE__*/(0,l/* .css */.AH)("background-color:",f/* .colorTokens.background.status.errorFail */.I6.background.status.errorFail,";color:",f/* .colorTokens.text.error */.I6.text.error,";svg{color:",f/* .colorTokens.icon.error */.I6.icon.error,";}",A.notOutlined,";&:not(:disabled):not([aria-disabled='true']){&:hover,&:focus,&:active{background-color:",f/* .colorTokens.background.status.errorFail */.I6.background.status.errorFail,";color:",f/* .colorTokens.text.error */.I6.text.error,";}}"),WP:/*#__PURE__*/(0,l/* .css */.AH)("background-color:",f/* .colorTokens.action.primary.wp */.I6.action.primary.wp,";",A.notOutlined,";&:not(:disabled):not([aria-disabled='true']){&:hover,&:focus{background-color:",f/* .colorTokens.action.primary.wp_hover */.I6.action.primary.wp_hover,";color:",f/* .colorTokens.text.white */.I6.text.white,";}&:active{background-color:",f/* .colorTokens.action.primary.wp */.I6.action.primary.wp,";}}"),text:/*#__PURE__*/(0,l/* .css */.AH)("background-color:transparent;color:",f/* .colorTokens.text.subdued */.I6.text.subdued,";padding:",f/* .spacing["8"] */.YK["8"],";svg{color:",f/* .colorTokens.icon.hints */.I6.icon.hints,";}",A.text,";&:not(:disabled):not([aria-disabled='true']){&:hover,&:focus{background-color:transparent;color:",f/* .colorTokens.text.brand */.I6.text.brand,";svg{color:",f/* .colorTokens.icon.brand */.I6.icon.brand,";}}&:active{background-color:transparent;color:",f/* .colorTokens.text.subdued */.I6.text.subdued,";}}")},outlined:{primary:/*#__PURE__*/(0,l/* .css */.AH)("background-color:transparent;box-shadow:inset 0px 0px 0px 1px ",f/* .colorTokens.stroke.brand */.I6.stroke.brand,";color:",f/* .colorTokens.text.brand */.I6.text.brand,";svg{color:",f/* .colorTokens.icon.brand */.I6.icon.brand,";}",A.outlined,";&:not(:disabled):not([aria-disabled='true']){&:hover,&:focus{color:",f/* .colorTokens.text.white */.I6.text.white,";svg{color:",f/* .colorTokens.icon.white */.I6.icon.white,";}}}"),secondary:/*#__PURE__*/(0,l/* .css */.AH)("background-color:transparent;box-shadow:inset 0px 0px 0px 1px ",f/* .colorTokens.stroke.brand */.I6.stroke.brand,";color:",f/* .colorTokens.text.brand */.I6.text.brand,";svg{color:",f/* .colorTokens.icon.brand */.I6.icon.brand,";}",A.outlined,";&:not(:disabled):not([aria-disabled='true']){&:hover,&:focus{background-color:",f/* .colorTokens.action.secondary.hover */.I6.action.secondary.hover,";}}"),tertiary:/*#__PURE__*/(0,l/* .css */.AH)("background-color:transparent;",A.outlined,";"),danger:/*#__PURE__*/(0,l/* .css */.AH)("background-color:transparent;border:1px solid ",f/* .colorTokens.stroke.danger */.I6.stroke.danger,";",A.outlined,";&:not(:disabled):not([aria-disabled='true']){&:hover,&:focus{background-color:",f/* .colorTokens.background.status.errorFail */.I6.background.status.errorFail,";}}"),WP:/*#__PURE__*/(0,l/* .css */.AH)("background-color:transparent;border:1px solid ",f/* .colorTokens.action.primary.wp */.I6.action.primary.wp,";color:",f/* .colorTokens.action.primary.wp */.I6.action.primary.wp,";svg{color:",f/* .colorTokens.icon.wp */.I6.icon.wp,";}",A.outlined,";&:not(:disabled):not([aria-disabled='true']){&:hover,&:focus{background-color:",f/* .colorTokens.action.primary.wp_hover */.I6.action.primary.wp_hover,";color:",f/* .colorTokens.text.white */.I6.text.white,";svg{color:",f/* .colorTokens.icon.white */.I6.icon.white,";}}}"),text:/*#__PURE__*/(0,l/* .css */.AH)("background-color:transparent;border:none;color:",f/* .colorTokens.text.primary */.I6.text.primary,";",A.text,";&:not(:disabled):not([aria-disabled='true']){&:hover,&:focus{color:",f/* .colorTokens.text.brand */.I6.text.brand,";}}"),none:/*#__PURE__*/(0,l/* .css */.AH)()},size:{regular:/*#__PURE__*/(0,l/* .css */.AH)("padding:",f/* .spacing["8"] */.YK["8"]," ",f/* .spacing["32"] */.YK["32"],";",p/* .typography.caption */.I.caption("medium"),";color:",f/* .colorTokens.text.white */.I6.text.white,";min-height:40px;"),large:/*#__PURE__*/(0,l/* .css */.AH)("padding:",f/* .spacing["12"] */.YK["12"]," ",f/* .spacing["40"] */.YK["40"],";",p/* .typography.body */.I.body("medium"),";color:",f/* .colorTokens.text.white */.I6.text.white,";min-height:48px;"),small:/*#__PURE__*/(0,l/* .css */.AH)("padding:",f/* .spacing["6"] */.YK["6"]," ",f/* .spacing["16"] */.YK["16"],";",p/* .typography.small */.I.small("medium"),";color:",f/* .colorTokens.text.white */.I6.text.white,";min-height:32px;")},isIconOnly:{true:/*#__PURE__*/(0,l/* .css */.AH)("aspect-ratio:1 / 1;&[data-size='regular']{padding:",f/* .spacing["8"] */.YK["8"],";width:40px;}&[data-size='large']{padding:",f/* .spacing["12"] */.YK["12"],";width:48px;}&[data-size='small']{padding:",f/* .spacing["6"] */.YK["6"],";width:32px;}"),false:/*#__PURE__*/(0,l/* .css */.AH)()},isLoading:{true:/*#__PURE__*/(0,l/* .css */.AH)("opacity:0.8;cursor:wait;"),false:/*#__PURE__*/(0,l/* .css */.AH)()},iconWrapper:{left:/*#__PURE__*/(0,l/* .css */.AH)("order:-1;"),right:/*#__PURE__*/(0,l/* .css */.AH)("order:1;")},buttonContent:e=>{var{loading:t,disabled:r,isIconOnly:n}=e;return/*#__PURE__*/(0,l/* .css */.AH)(v/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;",n&&"justify-content: center;"," ",t&&!r&&(0,l/* .css */.AH)(g()))},buttonIcon:e=>{var{iconPosition:t,loading:r,hasChildren:n=true}=e;return/*#__PURE__*/(0,l/* .css */.AH)("display:grid;place-items:center;margin-right:",f/* .spacing["4"] */.YK["4"],";",t==="right"&&(0,l/* .css */.AH)(m(),f/* .spacing["4"] */.YK["4"])," ",r&&(0,l/* .css */.AH)(b())," ",!n&&(0,l/* .css */.AH)(y()))},spinner:/*#__PURE__*/(0,l/* .css */.AH)("position:absolute;visibility:visible;display:flex;top:50%;left:50%;transform:translateX(-50%) translateY(-50%);& svg{animation:",x," 1s linear infinite;}")};var E=(0,h/* .createVariation */.s)({variants:{size:{regular:k.size.regular,large:k.size.large,small:k.size.small},isLoading:{true:k.isLoading.true,false:k.isLoading.false},iconOnly:{true:k.isIconOnly.true,false:k.isIconOnly.false},variant:{primary:k.variant.primary,secondary:k.variant.secondary,tertiary:k.variant.tertiary,danger:k.variant.danger,WP:k.variant.WP,text:k.variant.text},outlined:{primary:k.outlined.primary,secondary:k.outlined.secondary,tertiary:k.outlined.tertiary,danger:k.outlined.danger,WP:k.outlined.WP,text:k.outlined.text,none:k.outlined.none}},defaultVariants:{variant:"primary",outlined:"none",size:"regular",isLoading:"false",iconOnly:"false"}},k.base)},6277:function(e,t,r){"use strict";r.d(t,{A:()=>g});/* ESM import */var n=r(7317);/* ESM import */var i=r(8015);/* ESM import */var a=r(9414);/* ESM import */var o=r(6154);/* ESM import */var s=r(3747);/* ESM import */var l=r(9568);/* ESM import */var u=r(1699);/* ESM import */var c=r(1594);/* ESM import */var d=/*#__PURE__*/r.n(c);function f(){var e=(0,o._)(["\n      filter: grayscale(100%);\n    "]);f=function t(){return e};return e}var p={};var h=e=>{var{name:t,width:r=16,height:o=16,style:l,isColorIcon:u=false}=e,d=(0,a._)(e,["name","width","height","style","isColorIcon"]);var f,h;var[g,b]=(0,c.useState)(((f=p[t])===null||f===void 0?void 0:f.icon)||null);var[y,_]=(0,c.useState)(!((h=p[t])===null||h===void 0?void 0:h.icon));(0,c.useEffect)(()=>{var e;if((e=p[t])===null||e===void 0?void 0:e.icon){b(p[t].icon);_(false);return}_(true);v(t,r,o).then(e=>{b(e)}).catch(()=>{b(null)}).finally(()=>{_(false)})},[t,r,o]);var w=(0,n._)({},u&&{"data-colorize":true},d);var x=g?g.viewBox:"0 0 ".concat(r," ").concat(o);if(!g&&!y){return/*#__PURE__*/(0,s/* .jsx */.Y)("svg",{viewBox:x,children:/*#__PURE__*/(0,s/* .jsx */.Y)("rect",{width:r,height:o,fill:"transparent"})})}return/*#__PURE__*/(0,s/* .jsx */.Y)("svg",(0,i._)((0,n._)({css:[l,{width:r,height:o},m.svg({isColorIcon:u})],xmlns:"http://www.w3.org/2000/svg",viewBox:x},w),{role:"presentation","aria-hidden":true,dangerouslySetInnerHTML:{__html:g?g.icon:""}}))};function v(e,t,r){var n,i;if((n=p[e])===null||n===void 0?void 0:n.icon){// Icon already loaded
return Promise.resolve(p[e].icon)}if((i=p[e])===null||i===void 0?void 0:i.promise){// Fetch already in progress, return existing promise
return p[e].promise}var a=e.trim().replace(/[A-Z]/g,e=>"-"+e.toLowerCase());var o="".concat(l/* .tutorConfig.tutor_url */.P.tutor_url,"/assets/icons/").concat(a,".svg");var s=fetch(o).then(t=>{if(!t.ok){throw new Error("Failed to load icon: ".concat(e))}return t.text()}).then(n=>{var i=new DOMParser;var a=i.parseFromString(n,"image/svg+xml");var o=a.querySelector("svg");var s=(o===null||o===void 0?void 0:o.getAttribute("viewBox"))||"0 0 ".concat(t," ").concat(r);var l=(o===null||o===void 0?void 0:o.innerHTML)||"";var u={viewBox:s,icon:l};p[e]={icon:u};return u}).catch(t=>{p[e]={error:t};throw t});p[e]={loading:true,promise:s};return s}h.displayName="SVGIcon";/* ESM default export */const g=/*#__PURE__*/(0,c.memo)(h,(e,t)=>{var r,n;return e.name===t.name&&e.height===t.height&&e.width===t.height&&e.isColorIcon===t.isColorIcon&&((r=e.style)===null||r===void 0?void 0:r.name)===((n=t.style)===null||n===void 0?void 0:n.name)});var m={svg:e=>{var{isColorIcon:t=false}=e;return/*#__PURE__*/(0,u/* .css */.AH)("transition:filter 0.3s ease-in-out;",t&&(0,u/* .css */.AH)(f()),";")}}},5226:function(e,t,r){"use strict";// EXPORTS
r.d(t,{A:()=>/* binding */m});// EXTERNAL MODULE: ./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.esm.js
var n=r(3747);// EXTERNAL MODULE: ./node_modules/@emotion/react/dist/emotion-react.esm.js
var i=r(1699);// EXTERNAL MODULE: external "wp.i18n"
var a=r(2470);// EXTERNAL MODULE: external "React"
var o=r(1594);// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/atoms/Button.tsx
var s=r(3494);// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/atoms/SVGIcon.tsx
var l=r(6277);// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/config/config.ts
var u=r(9568);// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/config/styles.ts
var c=r(4532);// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/config/typography.ts
var d=r(6439);// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/controls/Show.tsx
var f=r(1817);// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/utils/style-utils.ts
var p=r(6014);// CONCATENATED MODULE: ../tutor/assets/react/v3/public/images/production-error-2x.webp
const h=r.p+"images/production-error-2x-dc6519df.webp";// CONCATENATED MODULE: ../tutor/assets/react/v3/public/images/production-error.webp
const v=r.p+"images/production-error-24158233.webp";// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/ErrorBoundaryProd.tsx
class g extends o.Component{static getDerivedStateFromError(){return{hasError:true}}componentDidCatch(e,t){// eslint-disable-next-line no-console
console.error(e,t)}render(){if(this.state.hasError){return/*#__PURE__*/(0,n/* .jsx */.Y)("div",{css:b.container,children:/*#__PURE__*/(0,n/* .jsxs */.FD)("div",{css:b.productionErrorWrapper,children:[/*#__PURE__*/(0,n/* .jsxs */.FD)("div",{css:b.productionErrorHeader,children:[/*#__PURE__*/(0,n/* .jsx */.Y)("img",{src:v,srcSet:"".concat(h," 2x"),alt:(0,a.__)("Error","tutor-pro")}),/*#__PURE__*/(0,n/* .jsx */.Y)("h5",{css:d/* .typography.heading5 */.I.heading5("medium"),children:(0,a.__)("Oops! Something went wrong","tutor-pro")}),/*#__PURE__*/(0,n/* .jsxs */.FD)("div",{css:b.instructions,children:[/*#__PURE__*/(0,n/* .jsx */.Y)("p",{children:(0,a.__)("Try the following steps to resolve the issue:","tutor-pro")}),/*#__PURE__*/(0,n/* .jsxs */.FD)("ul",{children:[/*#__PURE__*/(0,n/* .jsx */.Y)("li",{children:(0,a.__)("Refresh the page.","tutor-pro")}),/*#__PURE__*/(0,n/* .jsx */.Y)("li",{children:(0,a.__)("Clear your browser cache.","tutor-pro")}),/*#__PURE__*/(0,n/* .jsx */.Y)(f/* ["default"] */.A,{when:u/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url,children:/*#__PURE__*/(0,n/* .jsx */.Y)("li",{children:(0,a.__)("Ensure the Free and Pro plugins are on the same version.","tutor-pro")})})]})]})]}),/*#__PURE__*/(0,n/* .jsxs */.FD)("div",{css:b.productionFooter,children:[/*#__PURE__*/(0,n/* .jsx */.Y)("div",{children:/*#__PURE__*/(0,n/* .jsx */.Y)(s/* ["default"] */.A,{variant:"secondary",icon:/*#__PURE__*/(0,n/* .jsx */.Y)(l/* ["default"] */.A,{name:"refresh",height:24,width:24}),onClick:()=>window.location.reload(),children:(0,a.__)("Reload","tutor-pro")})}),/*#__PURE__*/(0,n/* .jsxs */.FD)("div",{css:b.support,children:[/*#__PURE__*/(0,n/* .jsx */.Y)("span",{children:(0,a.__)("Still having trouble?","tutor-pro")}),/*#__PURE__*/(0,n/* .jsx */.Y)("span",{children:(0,a.__)("Contact","tutor-pro")}),/*#__PURE__*/(0,n/* .jsx */.Y)("a",{href:u/* ["default"].TUTOR_SUPPORT_PAGE_URL */.A.TUTOR_SUPPORT_PAGE_URL,children:(0,a.__)("Support","tutor-pro")}),/*#__PURE__*/(0,n/* .jsx */.Y)("span",{children:(0,a.__)("for assistance.","tutor-pro")})]})]})]})})}return this.props.children}constructor(e){super(e);this.state={hasError:false}}}/* ESM default export */const m=g;var b={container:/*#__PURE__*/(0,i/* .css */.AH)("width:100%;height:auto;display:flex;justify-content:center;align-items:center;"),productionErrorWrapper:/*#__PURE__*/(0,i/* .css */.AH)(p/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",c/* .spacing["20"] */.YK["20"],";max-width:500px;width:100%;"),productionErrorHeader:/*#__PURE__*/(0,i/* .css */.AH)(p/* .styleUtils.display.flex */.x.display.flex("column"),";align-items:center;padding:",c/* .spacing["32"] */.YK["32"],";background:",c/* .colorTokens.background.white */.I6.background.white,";border-radius:",c/* .borderRadius["12"] */.Vq["12"],";box-shadow:0px -4px 0px 0px #ff0000;gap:",c/* .spacing["16"] */.YK["16"],";h5{text-align:center;}img{height:104px;width:101px;object-position:center;object-fit:contain;}"),instructions:/*#__PURE__*/(0,i/* .css */.AH)("width:100%;max-width:333px;p{width:100%;",d/* .typography.caption */.I.caption(),";margin-bottom:",c/* .spacing["4"] */.YK["4"],";}ul{padding-left:",c/* .spacing["16"] */.YK["16"],";li{",d/* .typography.caption */.I.caption(),";color:",c/* .colorTokens.text.title */.I6.text.title,";list-style:unset;margin-bottom:",c/* .spacing["2"] */.YK["2"],";&::marker{color:",c/* .colorTokens.icon["default"] */.I6.icon["default"],";}}}"),productionFooter:/*#__PURE__*/(0,i/* .css */.AH)(p/* .styleUtils.display.flex */.x.display.flex("column"),";align-items:center;gap:",c/* .spacing["12"] */.YK["12"],";"),support:/*#__PURE__*/(0,i/* .css */.AH)(p/* .styleUtils.flexCenter */.x.flexCenter("row"),";text-align:center;flex-wrap:wrap;gap:",c/* .spacing["4"] */.YK["4"],";",d/* .typography.caption */.I.caption(),";color:",c/* .colorTokens.text.title */.I6.text.title,";a{color:",c/* .colorTokens.text.brand */.I6.text.brand,";text-decoration:none;}")}},9568:function(e,t,r){"use strict";r.d(t,{A:()=>l,P:()=>o});var n,i;var a={ID:0,ajaxurl:"",site_url:"",home_url:"",site_title:"",base_path:"",tutor_url:"",tutor_pro_url:"",dashboard_url:"",nonce_key:"",_tutor_nonce:"",loading_icon_url:"",placeholder_img_src:"",enable_lesson_classic_editor:"",tutor_frontend_dashboard_url:"",backend_course_list_url:"",backend_bundle_list_url:"",frontend_course_list_url:"",frontend_bundle_list_url:"",wp_date_format:"",wp_rest_nonce:"",is_admin:"",is_admin_bar_showing:"",max_upload_size:"",content_change_event:"",is_tutor_course_edit:"",assignment_max_file_allowed:"",current_page:"",quiz_answer_display_time:"",is_ssl:"",course_list_page_url:"",course_post_type:"",local:"",difficulty_levels:[],supported_video_sources:[],edd_products:[],bp_groups:[],timezones:{},addons_data:[],current_user:{data:{id:"",user_login:"",user_pass:"",user_nicename:"",user_email:"",user_url:"",user_registered:"",user_activation_key:"",user_status:"",display_name:""},caps:{},cap_key:"",roles:[],allcaps:{},filter:null},settings:{monetize_by:"tutor-pro",enable_course_marketplace:"off",course_permalink_base:"",supported_video_sources:"",enrollment_expiry_enabled:"off",enable_q_and_a_on_course:"off",instructor_can_delete_course:"off",instructor_can_change_course_author:"off",instructor_can_manage_co_instructors:"off",chatgpt_enable:"off",course_builder_logo_url:"",chatgpt_key_exist:false,hide_admin_bar_for_users:"off",enable_redirect_on_course_publish_from_frontend:"off",instructor_can_publish_course:"off",youtube_api_key_exist:false,membership_only_mode:false,enable_tax:false,enable_individual_tax_control:false,is_tax_included_in_price:false},tutor_currency:{symbol:"",currency:"",position:"",thousand_separator:"",decimal_separator:"",no_of_decimal:""},visibility_control:{course_builder:{}}};var o=window._tutorobject||a;window.ajaxurl=o.ajaxurl;var s={TUTOR_SITE_URL:o.site_url,WP_AJAX_BASE_URL:o.ajaxurl,WP_API_BASE_URL:"".concat(((n=window.wpApiSettings)===null||n===void 0?void 0:n.root)||"").concat(((i=window.wpApiSettings)===null||i===void 0?void 0:i.versionString)||""),VIDEO_SOURCES_SETTINGS_URL:"".concat(o.site_url,"/wp-admin/admin.php?page=tutor_settings&tab_page=course#field_supported_video_sources"),MONETIZATION_SETTINGS_URL:"".concat(o.site_url,"/wp-admin/admin.php?page=tutor_settings&tab_page=monetization"),TUTOR_PRICING_PAGE:"https://tutorlms.com/pricing/",TUTOR_ADDONS_PAGE:"".concat(o.site_url,"/wp-admin/admin.php?page=tutor-addons"),CHATGPT_PLATFORM_URL:"https://platform.openai.com/account/api-keys",TUTOR_MY_COURSES_PAGE_URL:"".concat(o.tutor_frontend_dashboard_url,"/my-courses"),TUTOR_SUPPORT_PAGE_URL:"https://tutorlms.com/support",TUTOR_SUBSCRIPTIONS_PAGE:"".concat(o.site_url,"/wp-admin/admin.php?page=tutor-subscriptions"),TUTOR_ENROLLMENTS_PAGE:"".concat(o.site_url,"/wp-admin/admin.php?page=enrollments"),TUTOR_COUPONS_PAGE:"".concat(o.site_url,"/wp-admin/admin.php?page=tutor_coupons"),TUTOR_IMPORT_EXPORT_PAGE:"".concat(o.site_url,"/wp-admin/admin.php?page=tutor-tools&sub_page=import_export")};/* ESM default export */const l=s},5781:function(e,t,r){"use strict";r.d(t,{I4:()=>g,TF:()=>m,UA:()=>k,V8:()=>v,cW:()=>T,gt:()=>x,j8:()=>I,oW:()=>E,re:()=>l,vN:()=>y,yl:()=>_});/* ESM import */var n=r(2470);/* ESM import */var i=/*#__PURE__*/r.n(n);/* ESM import */var a=r(4532);var o=/* unused pure expression or super */null&&5*1024*1024;var s=/* unused pure expression or super */null&&["image/jpeg","image/png","image/gif"];var l=10;var u=48;var c=7;var d=3;var f="/product";var p="/category";var h="/tag";var v=document.dir==="rtl";var g="32px";var m="46px";var b=window.innerWidth;var y={isAboveDesktop:b>=a/* .DesktopBreakpoint */.cH,isAboveTablet:b>=a/* .TabletBreakpoint */.uh,isAboveMobile:b>=a/* .MobileBreakpoint */.G2,isAboveSmallMobile:b>=a/* .SmallMobileBreakpoint */.PB};var _={HEADER_HEIGHT:56,MARGIN_TOP:88,BASIC_MODAL_HEADER_HEIGHT:50,BASIC_MODAL_MAX_WIDTH:1218};var w=/* unused pure expression or super */null&&{MIN_NOTEBOOK_HEIGHT:430,MIN_NOTEBOOK_WIDTH:360,NOTEBOOK_HEADER:50};var x={ADMINISTRATOR:"administrator",TUTOR_INSTRUCTOR:"tutor_instructor",SUBSCRIBER:"subscriber"};var A=/*#__PURE__*//* unused pure expression or super */null&&function(e){e["notebook"]="tutor_course_builder_notebook";return e}({});var k=/*#__PURE__*/function(e){e["day"]="dd";e["month"]="MMM";e["year"]="yyyy";e["yearMonthDay"]="yyyy-LL-dd";e["monthDayYear"]="MMM dd, yyyy";e["hoursMinutes"]="hh:mm a";e["yearMonthDayHourMinuteSecond"]="yyyy-MM-dd hh:mm:ss";e["yearMonthDayHourMinuteSecond24H"]="yyyy-MM-dd HH:mm:ss";e["monthDayYearHoursMinutes"]="MMM dd, yyyy, hh:mm a";e["localMonthDayYearHoursMinutes"]="PPp";e["activityDate"]="MMM dd, yyyy hh:mm aa";e["validityDate"]="dd MMMM yyyy";e["dayMonthYear"]="do MMMM, yyyy";return e}({});var E=/*#__PURE__*/function(e){e["COURSE_BUNDLE"]="course-bundle";e["SUBSCRIPTION"]="subscription";e["SOCIAL_LOGIN"]="social-login";e["CONTENT_DRIP"]="content-drip";e["TUTOR_MULTI_INSTRUCTORS"]="tutor-multi-instructors";e["TUTOR_ASSIGNMENTS"]="tutor-assignments";e["TUTOR_COURSE_PREVIEW"]="tutor-course-preview";e["TUTOR_COURSE_ATTACHMENTS"]="tutor-course-attachments";e["TUTOR_GOOGLE_MEET_INTEGRATION"]="google-meet";e["TUTOR_REPORT"]="tutor-report";e["EMAIL"]="tutor-email";e["CALENDAR"]="calendar";e["NOTIFICATIONS"]="tutor-notifications";e["GOOGLE_CLASSROOM_INTEGRATION"]="google-classroom";e["TUTOR_ZOOM_INTEGRATION"]="tutor-zoom";e["QUIZ_EXPORT_IMPORT"]="quiz-import-export";e["ENROLLMENT"]="enrollments";e["TUTOR_CERTIFICATE"]="tutor-certificate";e["GRADEBOOK"]="gradebook";e["TUTOR_PREREQUISITES"]="tutor-prerequisites";e["BUDDYPRESS"]="buddypress";e["WOOCOMMERCE_SUBSCRIPTIONS"]="wc-subscriptions";e["PAID_MEMBERSHIPS_PRO"]="pmpro";e["RESTRICT_CONTENT_PRO"]="restrict-content-pro";e["WEGLOT"]="tutor-weglot";e["WPML_MULTILINGUAL_CMS"]="tutor-wpml";e["H5P_INTEGRATION"]="h5p";e["CONTENT_BANK"]="content-bank";return e}({});var I={YOUTUBE:/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&?]*).*/,VIMEO:/^.*(vimeo\.com\/)((channels\/[A-z]+\/)|(groups\/[A-z]+\/videos\/))?([0-9]+)/,// eslint-disable-next-line no-useless-escape
EXTERNAL_URL:/(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/,SHORTCODE:/^\[.*\]$/};var C=[{label:(0,n.__)("Public","tutor-pro"),value:"publish"},{label:(0,n.__)("Password Protected","tutor-pro"),value:"password_protected"},{label:(0,n.__)("Private","tutor-pro"),value:"private"}];var Y={COURSE_BUILDER:{BASICS:{FEATURED_IMAGE:"course_builder.basics_featured_image",INTRO_VIDEO:"course_builder.basics_intro_video",SCHEDULING_OPTIONS:"course_builder.basics_scheduling_options",PRICING_OPTIONS:"course_builder.basics_pricing_options",CATEGORIES:"course_builder.basics_categories",TAGS:"course_builder.basics_tags",AUTHOR:"course_builder.basics_author",INSTRUCTORS:"course_builder.basics_instructors",OPTIONS:{GENERAL:"course_builder.basics_options_general",CONTENT_DRIP:"course_builder.basics_options_content_drip",ENROLLMENT:"course_builder.basics_options_enrollment"}},CURRICULUM:{LESSON:{FEATURED_IMAGE:"course_builder.curriculum_lesson_featured_image",VIDEO:"course_builder.curriculum_lesson_video",VIDEO_PLAYBACK_TIME:"course_builder.curriculum_lesson_video_playback_time",EXERCISE_FILES:"course_builder.curriculum_lesson_exercise_files",LESSON_PREVIEW:"course_builder.curriculum_lesson_lesson_preview"}},ADDITIONAL:{COURSE_BENEFITS:"course_builder.additional_course_benefits",COURSE_TARGET_AUDIENCE:"course_builder.additional_course_target_audience",TOTAL_COURSE_DURATION:"course_builder.additional_total_course_duration",COURSE_MATERIALS_INCLUDES:"course_builder.additional_course_material_includes",COURSE_REQUIREMENTS:"course_builder.additional_course_requirements",CERTIFICATES:"course_builder.additional_certificate",ATTACHMENTS:"course_builder.additional_attachments",SCHEDULE_LIVE_CLASS:"course_builder.additional_schedule_live_class"}}};var T={NEW:"new",UPDATE:"update",NO_CHANGE:"no_change"};var S=/* unused pure expression or super */null&&{name:"checkbox",// eslint-disable-next-line @typescript-eslint/no-explicit-any
value:"",onChange:()=>{},onBlur:()=>{},ref:()=>{}};var O=/* unused pure expression or super */null&&{invalid:false,isTouched:false,isDirty:false,isValidating:false,error:undefined}},4532:function(e,t,r){"use strict";r.d(t,{EA:()=>x,G2:()=>y,I6:()=>u,J:()=>d,K_:()=>p,PB:()=>b,Vq:()=>g,Wy:()=>f,YK:()=>c,cH:()=>w,fE:()=>m,iL:()=>A,mw:()=>l,r7:()=>v,uh:()=>_});/* ESM import */var n=r(3458);/* ESM import */var i=/*#__PURE__*/r.n(n);var a=64;var o=355;var s=56;var l={inter:"'Inter', sans-serif;",roboto:"'Roboto', sans-serif;",sfProDisplay:"'SF Pro Display', sans-serif;"};var u={brand:{blue:"#0049f8",black:"#092844"},ai:{gradient_1:"linear-gradient(73.09deg, #FF9645 18.05%, #FF6471 30.25%, #CF6EBD 55.42%, #A477D1 71.66%, #3E64DE 97.9%)",gradient_1_rtl:"linear-gradient(73.09deg, #3E64DE 97.9%, #A477D1 28.34%, #CF6EBD 44.58%, #FF6471 69.75%, #FF9645 81.95%)",gradient_2:"linear-gradient(71.97deg, #FF9645 18.57%, #FF6471 63.71%, #CF6EBD 87.71%, #9B62D4 107.71%, #3E64DE 132.85%)",gradient_2_rtl:"linear-gradient(71.97deg, #3E64DE -67.15%, #9B62D4 -92.29%, #CF6EBD 87.71%, #FF6471 36.29%, #FF9645 81.43%)"},text:{primary:"#212327",title:"#41454f",subdued:"#5b616f",hints:"#767c8e",disable:"#a4a8b2",white:"#ffffff",brand:"#3a62e0",success:"#239c46",warning:"#bd7e00",error:"#f44337",status:{processing:"#007a66",pending:"#a8710d",failed:"#cc1213",completed:"#097336",onHold:"#ac0640",cancelled:"#6f7073",primary:"#3e64de"},wp:"#2271b1",magicAi:"#484F66",ai:{purple:"#9D50FF",gradient:"linear-gradient(73.09deg, #FF9645 18.05%, #FF6471 30.25%, #CF6EBD 55.42%, #A477D1 71.66%, #3E64DE 97.9%)"}},surface:{tutor:"#ffffff",اكاديمية الغيث التعليمية:"#f1f1f1",navbar:"#F5F5F5",courseBuilder:"#F8F8F8"},background:{brand:"#3e64de",white:"#ffffff",black:"#000000",default:"#f4f6f9",hover:"#f5f6fa",active:"#f0f1f5",disable:"#ebecf0",modal:"#161616",dark10:"#212327",dark20:"#31343b",dark30:"#41454f",null:"#ffffff",success:{fill30:"#F5FBF7",fill40:"#E5F5EB"},warning:{fill40:"#FDF4E3"},status:{success:"#e5f5eb",warning:"#fdf4e3",drip:"#e9edfb",onHold:"#fae8ef",processing:"#e5f9f6",errorFail:"#ffebeb",cancelled:"#eceef2",refunded:"#e5f5f5"},magicAi:{default:"#FBF6FF",skeleton:"#FEF4FF",8:i()("#C984FE",.08)}},icon:{default:"#9197a8",hover:"#4b505c",subdued:"#7e838f",hints:"#b6b9c2",disable:{default:"#b8bdcc",background:"#cbced6",muted:"#dedede"},white:"#ffffff",brand:"#446ef5",wp:"#007cba",error:"#f55e53",warning:"#ffb505",success:"#22a848",drop:"#4761b8",processing:"#00a388"},stroke:{default:"#c3c5cb",hover:"#9095a3",bold:"#41454f",disable:"#dcdfe5",divider:"#e0e2ea",border:"#cdcfd5",white:"#ffffff",brand:"#577fff",neutral:"#7391f0",success:{default:"#4eba6d",fill70:"#6AC088"},warning:"#f5ba63",danger:"#ff9f99",status:{success:"#c8e5d2",warning:"#fae5c5",processing:"#c3e5e0",onHold:"#f1c1d2",cancelled:"#e1e1e8",refunded:"#ccebea",fail:"#fdd9d7"},magicAi:"#C984FE"},border:{neutral:"#C8C8C8",tertiary:"#F5F5F5"},action:{primary:{default:"#3e64de",hover:"#3a5ccc",focus:"#00cceb",active:"#3453b8",disable:"#e3e6eb",wp:"#2271b1",wp_hover:"#135e96"},secondary:{default:"#e9edfb",hover:"#d6dffa",active:"#d0d9f2"},outline:{default:"#ffffff",hover:"#e9edfb",active:"#e1e7fa",disable:"#cacfe0"}},اكاديمية الغيث التعليمية:{primary:"#2271b1",primaryLight:"#007cba",hoverShape:"#7faee6",sidebarChildText:"#4ea2e6",childBg:"#2d3337",mainBg:"#1e2327",text:"#b5bcc2"},design:{dark:"#1a1b1e",grey:"#41454f",white:"#ffffff",brand:"#3e64de",success:"#24a148",warning:"#ed9700",error:"#f44337"},primary:{main:"#3e64de",100:"#28408e",90:"#395bca",80:"#6180e4",70:"#95aaed",60:"#bdcaf1",50:"#d2dbf5",40:"#e9edfb",30:"#f6f8fd"},color:{black:{main:"#212327",100:"#0b0c0e",90:"#1a1b1e",80:"#31343b",70:"#41454f",60:"#5b616f",50:"#727889",40:"#9ca0ac",30:"#b4b7c0",20:"#c0c3cb",10:"#cdcfd5",8:"#e3e6eb",5:"#eff1f6",3:"#f4f6f9",2:"#fcfcfd",0:"#ffffff"},danger:{main:"#f44337",100:"#c62828",90:"#e53935",80:"#ef5350",70:"#e57373",60:"#fbb4af",50:"#fdd9d7",40:"#feeceb",30:"#fff7f7"},success:{main:"#24a148",100:"#075a2a",90:"#007a38",80:"#3aaa5a",70:"#6ac088",60:"#99d4ae",50:"#cbe9d5",40:"#e5f5eb",30:"#f5fbf7"},warning:{main:"#ed9700",100:"#895800",90:"#e08e00",80:"#f3a33c",70:"#f5ba63",60:"#f9d093",50:"#fce7c7",40:"#fdf4e3",30:"#fefbf4"}},bg:{gray20:"#e3e5eb",white:"#ffffff",error:"#f46363",success:"#24a148",light:"#f9fafc",brand:"#E6ECFF"},ribbon:{red:"linear-gradient(to bottom, #ee0014 0%,#c10010 12.23%,#ee0014 100%)",orange:"linear-gradient(to bottom, #ff7c02 0%,#df6c00 12.23%,#f78010 100%)",green:"linear-gradient(to bottom, #02ff49 0%,#00bb35 12.23%,#04ca3c 100%)",blue:"linear-gradient(to bottom, #0267ff 3.28%,#004bbb 12.23%,#0453ca 100%)"},additionals:{lightMint:"#ebfffb",lightPurple:"#f4e8f8",lightRed:"#ffebeb",lightYellow:"#fffaeb",lightCoffee:"#fcf4ee",lightPurple2:"#f7ebfe",lightBlue:"#edf1fd"}};var c={0:"0",2:"2px",4:"4px",6:"6px",8:"8px",10:"10px",12:"12px",16:"16px",20:"20px",24:"24px",28:"28px",32:"32px",36:"36px",40:"40px",48:"48px",56:"56px",64:"64px",72:"72px",96:"96px",128:"128px",256:"256px",512:"512px"};var d={10:"0.625rem",11:"0.688rem",12:"0.75rem",13:"0.813rem",14:"0.875rem",15:"0.938rem",16:"1rem",18:"1.125rem",20:"1.25rem",24:"1.5rem",28:"1.75rem",30:"1.875rem",32:"2rem",36:"2.25rem",40:"2.5rem",48:"3rem",56:"3.5rem",60:"3.75rem",64:"4rem",80:"5rem"};var f={thin:100,extraLight:200,light:300,regular:400,medium:500,semiBold:600,bold:700,extraBold:800,black:900};var p={12:"0.5rem",14:"0.75rem",15:"0.90rem",16:"1rem",18:"1.125rem",20:"1.25rem",21:"1.313rem",22:"1.375rem",24:"1.5rem",26:"1.625rem",28:"1.75rem",32:"2rem",30:"1.875rem",34:"2.125rem",36:"2.25rem",40:"2.5rem",44:"2.75rem",48:"3rem",56:"3.5rem",58:"3.625rem",64:"4rem",70:"4.375rem",81:"5.063rem"};var h=/* unused pure expression or super */null&&{tight:"-0.05em",normal:"0",wide:"0.05em",extraWide:"0.1em"};var v={focus:"0px 0px 0px 0px rgba(255, 255, 255, 1), 0px 0px 0px 3px rgba(0, 73, 248, 0.9)",button:"0px 1px 0.25px rgba(17, 18, 19, 0.08), inset 0px -1px 0.25px rgba(17, 18, 19, 0.24)",combinedButton:"0px 1px 0px rgba(0, 0, 0, 0.05), inset 0px -1px 0px #bcbfc3, inset 1px 0px 0px #bbbfc3, inset 0px 1px 0px #bbbfc3",combinedButtonExtend:"0px 1px 0px rgba(0, 0, 0, 0.05), inset 0px -1px 0px #bcbfc3, inset 1px 0px 0px #bbbfc3, inset 0px 1px 0px #bbbfc3, inset -1px 0px 0px #bbbfc3",insetButtonPressed:"inset 0px 2px 0px rgba(17, 18, 19, 0.08)",card:"0px 2px 1px rgba(17, 18, 19, 0.05), 0px 0px 1px rgba(17, 18, 19, 0.25)",popover:"0px 6px 22px rgba(17, 18, 19, 0.08), 0px 4px 10px rgba(17, 18, 19, 0.1)",modal:"0px 0px 2px rgba(17, 18, 19, 0.2), 0px 30px 72px rgba(17, 18, 19, 0.2)",base:"0px 1px 3px rgba(17, 18, 19, 0.15)",input:"0px 1px 0px rgba(17, 18, 19, 0.05)",switch:"0px 2px 4px 0px #0000002A",tabs:"inset 0px -1px 0px #dbdcdf",dividerTop:"inset 0px 1px 0px #E4E5E7",underline:"0px 1px 0px #C9CBCF",drag:"3px 7px 8px 0px #00000014",dropList:"0px 6px 20px 0px rgba(28, 49, 104, 0.1)",notebook:"0 0 4px 0 rgba(0, 30, 43, 0.16)",scrollable:"0px -2px 2px 0px #00000014",footer:"0px 1px 0px 0px #E4E5E7 inset"};var g={2:"2px",4:"4px",5:"5px",6:"6px",8:"8px",10:"10px",12:"12px",14:"14px",20:"20px",24:"24px",30:"30px",40:"40px",50:"50px",54:"54px",circle:"50%",card:"8px",min:"4px",input:"6px"};var m={negative:-1,positive:1,dropdown:2,level:0,sidebar:9,header:10,footer:10,modal:25,notebook:1e5,highest:99999};var b=480;var y=782;var _=992;var w=1280;var x={smallMobile:"@media(max-width: ".concat(b,"px)"),mobile:"@media(max-width: ".concat(y,"px)"),smallTablet:"@media(max-width: ".concat(_-1,"px)"),tablet:"@media(max-width: ".concat(w-1,"px)"),desktop:"@media(min-width: ".concat(w,"px)")};var A=1006},6439:function(e,t,r){"use strict";r.d(t,{I:()=>a});/* ESM import */var n=r(4532);/* ESM import */var i=r(1699);var a={heading1:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"regular";return/*#__PURE__*/(0,i/* .css */.AH)("font-size:",n/* .fontSize["80"] */.J["80"],";line-height:",n/* .lineHeight["81"] */.K_["81"],";color:",n/* .colorTokens.text.primary */.I6.text.primary,";font-weight:",n/* .fontWeight */.Wy[e],";font-family:",n/* .fontFamily.inter */.mw.inter,";")},heading2:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"regular";return/*#__PURE__*/(0,i/* .css */.AH)("font-size:",n/* .fontSize["60"] */.J["60"],";line-height:",n/* .lineHeight["70"] */.K_["70"],";color:",n/* .colorTokens.text.primary */.I6.text.primary,";font-weight:",n/* .fontWeight */.Wy[e],";font-family:",n/* .fontFamily.inter */.mw.inter,";")},heading3:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"regular";return/*#__PURE__*/(0,i/* .css */.AH)("font-size:",n/* .fontSize["40"] */.J["40"],";line-height:",n/* .lineHeight["48"] */.K_["48"],";color:",n/* .colorTokens.text.primary */.I6.text.primary,";font-weight:",n/* .fontWeight */.Wy[e],";font-family:",n/* .fontFamily.inter */.mw.inter,";")},heading4:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"regular";return/*#__PURE__*/(0,i/* .css */.AH)("font-size:",n/* .fontSize["30"] */.J["30"],";line-height:",n/* .lineHeight["40"] */.K_["40"],";color:",n/* .colorTokens.text.primary */.I6.text.primary,";font-weight:",n/* .fontWeight */.Wy[e],";font-family:",n/* .fontFamily.inter */.mw.inter,";")},heading5:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"regular";return/*#__PURE__*/(0,i/* .css */.AH)("font-size:",n/* .fontSize["24"] */.J["24"],";line-height:",n/* .lineHeight["34"] */.K_["34"],";color:",n/* .colorTokens.text.primary */.I6.text.primary,";font-weight:",n/* .fontWeight */.Wy[e],";font-family:",n/* .fontFamily.inter */.mw.inter,";")},heading6:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"regular";return/*#__PURE__*/(0,i/* .css */.AH)("font-size:",n/* .fontSize["20"] */.J["20"],";line-height:",n/* .lineHeight["30"] */.K_["30"],";color:",n/* .colorTokens.text.primary */.I6.text.primary,";font-weight:",n/* .fontWeight */.Wy[e],";font-family:",n/* .fontFamily.inter */.mw.inter,";")},body:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"regular";return/*#__PURE__*/(0,i/* .css */.AH)("font-size:",n/* .fontSize["16"] */.J["16"],";line-height:",n/* .lineHeight["26"] */.K_["26"],";color:",n/* .colorTokens.text.primary */.I6.text.primary,";font-weight:",n/* .fontWeight */.Wy[e],";font-family:",n/* .fontFamily.inter */.mw.inter,";")},caption:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"regular";return/*#__PURE__*/(0,i/* .css */.AH)("font-size:",n/* .fontSize["15"] */.J["15"],";line-height:",n/* .lineHeight["24"] */.K_["24"],";color:",n/* .colorTokens.text.primary */.I6.text.primary,";font-weight:",n/* .fontWeight */.Wy[e],";font-family:",n/* .fontFamily.inter */.mw.inter,";")},small:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"regular";return/*#__PURE__*/(0,i/* .css */.AH)("font-size:",n/* .fontSize["13"] */.J["13"],";line-height:",n/* .lineHeight["18"] */.K_["18"],";color:",n/* .colorTokens.text.primary */.I6.text.primary,";font-weight:",n/* .fontWeight */.Wy[e],";font-family:",n/* .fontFamily.inter */.mw.inter,";")},tiny:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"regular";return/*#__PURE__*/(0,i/* .css */.AH)("font-size:",n/* .fontSize["11"] */.J["11"],";line-height:",n/* .lineHeight["16"] */.K_["16"],";color:",n/* .colorTokens.text.primary */.I6.text.primary,";font-weight:",n/* .fontWeight */.Wy[e],";font-family:",n/* .fontFamily.inter */.mw.inter,";")}}},1817:function(e,t,r){"use strict";r.d(t,{A:()=>o});/* ESM import */var n=r(7150);var i=e=>{return(0,n/* .isDefined */.O9)(e)&&!!e};var a=e=>{var{when:t,children:r,fallback:n=null}=e;var a=i(t);if(a){return typeof r==="function"?r(t):r}return n};/* ESM default export */const o=a},8631:function(e,t,r){"use strict";r.d(t,{s:()=>a});/* ESM import */var n=r(7150);/* ESM import */var i=r(6208);var a=(e,t)=>{return r=>{var{variants:a,defaultVariants:o}=e;var s=[];if((0,n/* .isDefined */.O9)(t)){s.push(t)}var l=(0,i/* .getObjectKeys */.Co)(a).map(e=>{var t=r[e];var n=o[e];if(t===null){return null}var i=t||n;return a[e][i]});s.push(...l.filter(n/* .isDefined */.O9));return s}}},6014:function(e,t,r){"use strict";r.d(t,{v:()=>c,x:()=>d});/* ESM import */var n=r(6154);/* ESM import */var i=r(4532);/* ESM import */var a=r(1699);/* ESM import */var o=r(6439);function s(){var e=(0,n._)(["\n      flex-direction: column;\n    "]);s=function t(){return e};return e}function l(){var e=(0,n._)(["\n      background-color: ",";\n    "]);l=function t(){return e};return e}function u(){var e=(0,n._)(["\n      cursor: grabbing;\n    "]);u=function t(){return e};return e}var c=()=>/*#__PURE__*/(0,a/* .css */.AH)("body.tutor-backend-tutor-content-bank{@media screen and (max-width:600px){#wpadminbar{position:fixed;}}}*,::after,::before{box-sizing:border-box;}html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0;font-family:",i/* .fontFamily.inter */.mw.inter,";height:100%;}main{display:block;}h1{font-size:2em;margin:0.67em 0;}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace,monospace;font-size:1em;}a{background-color:transparent;&:hover{color:inherit;}}li{list-style:none;margin:0;}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted;}b,strong{font-weight:bolder;}code,kbd,samp{font-family:monospace,monospace;font-size:1em;}small{font-size:80%;}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;}sub{bottom:-0.25em;}sup{top:-0.5em;}img{border-style:none;}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible;}button,select{text-transform:none;}button,[type='button'],[type='reset'],[type='submit']{-webkit-appearance:button;}button::-moz-focus-inner,[type='button']::-moz-focus-inner,[type='reset']::-moz-focus-inner,[type='submit']::-moz-focus-inner{border-style:none;padding:0;}button:-moz-focusring,[type='button']:-moz-focusring,[type='reset']:-moz-focusring,[type='submit']:-moz-focusring{outline:1px dotted ButtonText;}fieldset{padding:0.35em 0.75em 0.625em;}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline;}textarea{overflow:auto;height:auto;}[type='checkbox'],[type='radio']{box-sizing:border-box;padding:0;}[type='number']::-webkit-inner-spin-button,[type='number']::-webkit-outer-spin-button{height:auto;}[type='search']{-webkit-appearance:textfield;outline-offset:-2px;}[type='search']::-webkit-search-decoration{-webkit-appearance:none;}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block;}summary{display:list-item;}template{display:none;}[hidden]{display:none;}:is(h1,h2,h3,h4,h5,h6,p){padding:0;margin:0;text-transform:unset;}table{th{text-align:-webkit-match-parent;}}");var d={centeredFlex:/*#__PURE__*/(0,a/* .css */.AH)("display:flex;justify-content:center;align-items:center;width:100%;height:100%;"),flexCenter:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"row";return/*#__PURE__*/(0,a/* .css */.AH)("display:flex;justify-content:center;align-items:center;flex-direction:row;",e==="column"&&(0,a/* .css */.AH)(s()))},boxReset:/*#__PURE__*/(0,a/* .css */.AH)("padding:0;"),ulReset:/*#__PURE__*/(0,a/* .css */.AH)("list-style:none;padding:0;margin:0;"),resetButton:/*#__PURE__*/(0,a/* .css */.AH)("background:none;border:none;outline:none;box-shadow:none;padding:0;margin:0;text-align:inherit;font-family:",i/* .fontFamily.inter */.mw.inter,";cursor:pointer;"),cardInnerSection:/*#__PURE__*/(0,a/* .css */.AH)("padding:",i/* .spacing["20"] */.YK["20"]," ",i/* .spacing["20"] */.YK["20"]," ",i/* .spacing["24"] */.YK["24"]," ",i/* .spacing["20"] */.YK["20"],";display:flex;flex-direction:column;gap:",i/* .spacing["24"] */.YK["24"],";"),fieldGroups:e=>/*#__PURE__*/(0,a/* .css */.AH)("display:flex;flex-direction:column;gap:",i/* .spacing */.YK[e],";"),titleAliasWrapper:/*#__PURE__*/(0,a/* .css */.AH)("display:flex;flex-direction:column;gap:",i/* .spacing["12"] */.YK["12"],";"),inlineSwitch:/*#__PURE__*/(0,a/* .css */.AH)("display:flex;justify-content:space-between;align-items:center;"),overflowYAuto:/*#__PURE__*/(0,a/* .css */.AH)("overflow-y:auto;scrollbar-gutter:stable;::-webkit-scrollbar{background-color:",i/* .colorTokens.primary["40"] */.I6.primary["40"],";width:3px;}::-webkit-scrollbar-thumb{background-color:",i/* .colorTokens.design.brand */.I6.design.brand,";border-radius:",i/* .borderRadius["30"] */.Vq["30"],";}"),overflowXAuto:/*#__PURE__*/(0,a/* .css */.AH)("overflow-x:auto;scrollbar-gutter:stable;::-webkit-scrollbar{background-color:",i/* .colorTokens.primary["40"] */.I6.primary["40"],";height:3px;}::-webkit-scrollbar-thumb{background-color:",i/* .colorTokens.design.brand */.I6.design.brand,";border-radius:",i/* .borderRadius["30"] */.Vq["30"],";}"),textEllipsis:/*#__PURE__*/(0,a/* .css */.AH)("text-overflow:ellipsis;overflow:hidden;white-space:nowrap;"),container:/*#__PURE__*/(0,a/* .css */.AH)("width:",i/* .containerMaxWidth */.iL,"px;margin:0 auto;"),display:{flex:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"row";return/*#__PURE__*/(0,a/* .css */.AH)("display:flex;flex-direction:",e,";")},inlineFlex:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"row";return/*#__PURE__*/(0,a/* .css */.AH)("display:inline-flex;flex-direction:",e,";")},none:/*#__PURE__*/(0,a/* .css */.AH)("display:none;"),block:/*#__PURE__*/(0,a/* .css */.AH)("display:block;"),inlineBlock:/*#__PURE__*/(0,a/* .css */.AH)("display:inline-block;")},text:{ellipsis:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;return/*#__PURE__*/(0,a/* .css */.AH)("white-space:normal;display:-webkit-box;-webkit-line-clamp:",e,";-webkit-box-orient:vertical;overflow:hidden;-webkit-box-pack:end;")},align:{center:/*#__PURE__*/(0,a/* .css */.AH)("text-align:center;"),left:/*#__PURE__*/(0,a/* .css */.AH)("text-align:left;"),right:/*#__PURE__*/(0,a/* .css */.AH)("text-align:right;"),justify:/*#__PURE__*/(0,a/* .css */.AH)("text-align:justify;")}},inputFocus:/*#__PURE__*/(0,a/* .css */.AH)("box-shadow:none;border-color:",i/* .colorTokens.stroke["default"] */.I6.stroke["default"],";outline:2px solid ",i/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:1px;"),dateAndTimeWrapper:/*#__PURE__*/(0,a/* .css */.AH)("display:grid;grid-template-columns:5.5fr 4.5fr;border-radius:",i/* .borderRadius["6"] */.Vq["6"],";position:relative;&::before{content:'';position:absolute;top:0;left:0;right:0;height:40px;outline:2px solid transparent;outline-offset:1px;border-radius:",i/* .borderRadius["6"] */.Vq["6"],";pointer-events:none;z-index:1;transition:outline-color 0.2s ease-in-out;}&:focus-within::before{outline-color:",i/* .colorTokens.stroke.brand */.I6.stroke.brand,";}> div{&:first-of-type{input{border-top-right-radius:0;border-bottom-right-radius:0;&:focus{box-shadow:none;outline:none;}}}&:last-of-type{input{border-top-left-radius:0;border-bottom-left-radius:0;border-left:none;&:focus{box-shadow:none;outline:none;}}}}"),inputCurrencyStyle:/*#__PURE__*/(0,a/* .css */.AH)("font-size:",i/* .fontSize["18"] */.J["18"],";color:",i/* .colorTokens.icon.subdued */.I6.icon.subdued,";"),crossButton:/*#__PURE__*/(0,a/* .css */.AH)("border:none;outline:none;padding:0;margin:0;text-align:inherit;cursor:pointer;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:",i/* .borderRadius.circle */.Vq.circle,";background:",i/* .colorTokens.background.white */.I6.background.white,";transition:opacity 0.3s ease-in-out;svg{color:",i/* .colorTokens.icon["default"] */.I6.icon["default"],";transition:color 0.3s ease-in-out;}:hover{svg{color:",i/* .colorTokens.icon.hover */.I6.icon.hover,";}}:focus{box-shadow:",i/* .shadow.focus */.r7.focus,";}"),aiGradientText:/*#__PURE__*/(0,a/* .css */.AH)("background:",i/* .colorTokens.text.ai.gradient */.I6.text.ai.gradient,";background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;"),actionButton:/*#__PURE__*/(0,a/* .css */.AH)("background:none;border:none;outline:none;padding:0;margin:0;text-align:inherit;color:",i/* .colorTokens.icon["default"] */.I6.icon["default"],";display:flex;cursor:pointer;transition:color 0.3s ease-in-out;:hover:not(:disabled),:focus:not(:disabled),:active:not(:disabled){background:none;color:",i/* .colorTokens.icon.brand */.I6.icon.brand,";}:disabled{color:",i/* .colorTokens.icon.disable.background */.I6.icon.disable.background,";cursor:not-allowed;}:focus-visible{outline:2px solid ",i/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:1px;border-radius:",i/* .borderRadius["2"] */.Vq["2"],";}"),backButton:/*#__PURE__*/(0,a/* .css */.AH)("background-color:transparent;width:32px;height:32px;padding:0;margin:0;flex-shrink:0;display:flex;align-items:center;justify-content:center;border:1px solid ",i/* .colorTokens.border.neutral */.I6.border.neutral,";border-radius:",i/* .borderRadius["4"] */.Vq["4"],";outline:none;color:",i/* .colorTokens.icon["default"] */.I6.icon["default"],";transition:color 0.3s ease-in-out;cursor:pointer;:hover{color:",i/* .colorTokens.icon.hover */.I6.icon.hover,";}&:focus-visible{outline:2px solid ",i/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:1px;}"),optionCheckButton:/*#__PURE__*/(0,a/* .css */.AH)("background:none;border:none;outline:none;padding:0;margin:0;text-align:inherit;font-family:",i/* .fontFamily.inter */.mw.inter,";cursor:pointer;height:32px;width:32px;border-radius:",i/* .borderRadius.circle */.Vq.circle,";opacity:0;:focus-visible{outline:2px solid ",i/* .colorTokens.stroke.brand */.I6.stroke.brand,";}"),optionCounter:e=>{var{isEditing:t,isSelected:r=false}=e;return/*#__PURE__*/(0,a/* .css */.AH)("height:",i/* .spacing["24"] */.YK["24"],";width:",i/* .spacing["24"] */.YK["24"],";border-radius:",i/* .borderRadius.min */.Vq.min,";",o/* .typography.caption */.I.caption("medium"),";color:",i/* .colorTokens.text.subdued */.I6.text.subdued,";background-color:",i/* .colorTokens.background["default"] */.I6.background["default"],";text-align:center;",r&&!t&&(0,a/* .css */.AH)(l(),i/* .colorTokens.bg.white */.I6.bg.white))},optionDragButton:e=>{var{isOverlay:t}=e;return/*#__PURE__*/(0,a/* .css */.AH)("background:none;border:none;outline:none;padding:0;margin:0;text-align:inherit;font-family:",i/* .fontFamily.inter */.mw.inter,";cursor:grab;display:flex;align-items:center;justify-content:center;transform:rotate(90deg);color:",i/* .colorTokens.icon["default"] */.I6.icon["default"],";cursor:grab;place-self:center center;border-radius:",i/* .borderRadius["2"] */.Vq["2"],";&:focus,&:active,&:hover{background:none;color:",i/* .colorTokens.icon["default"] */.I6.icon["default"],";}:focus-visible{outline:2px solid ",i/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:1px;}",t&&(0,a/* .css */.AH)(u()))},optionInputWrapper:/*#__PURE__*/(0,a/* .css */.AH)("display:flex;flex-direction:column;width:100%;gap:",i/* .spacing["12"] */.YK["12"],";input,textarea{background:none;border:none;outline:none;padding:0;margin:0;text-align:inherit;font-family:",i/* .fontFamily.inter */.mw.inter,";",o/* .typography.caption */.I.caption(),";flex:1;color:",i/* .colorTokens.text.subdued */.I6.text.subdued,";padding:",i/* .spacing["4"] */.YK["4"]," ",i/* .spacing["10"] */.YK["10"],";border:1px solid ",i/* .colorTokens.stroke["default"] */.I6.stroke["default"],";border-radius:",i/* .borderRadius["6"] */.Vq["6"],";resize:vertical;cursor:text;&:focus{box-shadow:none;border-color:",i/* .colorTokens.stroke["default"] */.I6.stroke["default"],";outline:2px solid ",i/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:1px;}}"),objectFit:function(){var{fit:e,position:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{fit:"cover",position:"center"};return/*#__PURE__*/(0,a/* .css */.AH)("object-fit:",e,";object-position:",t,";")},inputClearButton:/*#__PURE__*/(0,a/* .css */.AH)("position:absolute;top:50%;right:",i/* .spacing["4"] */.YK["4"],";transform:translateY(-50%);background-color:",i/* .colorTokens.background.white */.I6.background.white,";border-radius:",i/* .borderRadius["2"] */.Vq["2"],";&:not(:disabled):not([aria-disabled='true']):hover,&:not(:disabled):not([aria-disabled='true']):focus{background-color:",i/* .colorTokens.background.hover */.I6.background.hover,";}")}},7150:function(e,t,r){"use strict";r.d(t,{Et:()=>u,Gv:()=>d,Kg:()=>o,Lm:()=>c,O9:()=>a,cW:()=>f});var n=(e,t)=>{return t in e};var i=e=>{return e.isAxiosError};var a=e=>{return e!==undefined&&e!==null};function o(e){return typeof e==="string"||e instanceof String}function s(e){return!!e&&Array.isArray(e)&&(!e.length||typeof e[0]!=="object")}function l(e){return s(e)&&(!e.length||typeof e[0]==="string"||e[0]instanceof String)}function u(e){return typeof e==="number"||e instanceof Number}function c(e){return typeof e==="boolean"||e instanceof Boolean}function d(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var f={NEW:"new",UPDATE:"update",NO_CHANGE:"no_change"}},6208:function(e,t,r){"use strict";// EXPORTS
r.d(t,{$X:()=>/* binding */x,lQ:()=>/* binding */y,Ak:()=>/* binding */k,y1:()=>/* binding */_,G0:()=>/* binding */F,EW:()=>/* binding */$,uu:()=>/* binding */es,GR:()=>/* binding */et,TW:()=>/* binding */K,Co:()=>/* binding */q,lW:()=>/* binding */X,w9:()=>/* binding */W,EL:()=>/* binding */J});// UNUSED EXPORTS: generateCouponCode, formatBytes, fetchImageUrlAsBase64, getCategoryLeftBarHeight, convertToGMT, makeFirstCharacterUpperCase, arrayRange, transformParams, arrayIntersect, extractIdOnly, assertIsDefined, findSlotFields, mapInBetween, objectToQueryParams, formatSeconds, convertToSlug, generateTree, jsonParse, getValueInArray, wait, formatSubscriptionRepeatUnit, determinePostStatus, getFileExtensionFromName, convertGMTtoLocalDate, formatReadAbleBytesToBytes, hasDuplicateEntries, moveTo, decodeHtmlEntities, throttle, getObjectValues
// EXTERNAL MODULE: external "wp.i18n"
var n=r(2470);// CONCATENATED MODULE: ../tutor/node_modules/uuid/dist/esm-browser/native.js
const i=typeof crypto!=="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);/* ESM default export */const a={randomUUID:i};// CONCATENATED MODULE: ../tutor/node_modules/uuid/dist/esm-browser/rng.js
// Unique ID creation requires a high quality random # generator. In the browser we therefore
// require the crypto API and do not support built-in fallback to lower quality random number
// generators (like Math.random()).
let o;const s=new Uint8Array(16);function l(){// lazy load so that environments that need to polyfill have a chance to do so
if(!o){// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
o=typeof crypto!=="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto);if(!o){throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported")}}return o(s)};// CONCATENATED MODULE: ../tutor/node_modules/uuid/dist/esm-browser/stringify.js
/**
 * Convert array of 16 byte values to UUID string format of the form:
 * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
 */const u=[];for(let e=0;e<256;++e){u.push((e+256).toString(16).slice(1))}function c(e,t=0){// Note: Be careful editing this code!  It's been tuned for performance
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
return u[e[t+0]]+u[e[t+1]]+u[e[t+2]]+u[e[t+3]]+"-"+u[e[t+4]]+u[e[t+5]]+"-"+u[e[t+6]]+u[e[t+7]]+"-"+u[e[t+8]]+u[e[t+9]]+"-"+u[e[t+10]]+u[e[t+11]]+u[e[t+12]]+u[e[t+13]]+u[e[t+14]]+u[e[t+15]]}function d(e,t=0){const r=c(e,t);// Consistency check for valid UUID.  If this throws, it's likely due to one
// of the following:
// - One or more input array values don't map to a hex octet (leading to
// "undefined" in the uuid)
// - Invalid input values for the RFC `version` or `variant` fields
if(!validate(r)){throw TypeError("Stringified UUID is invalid")}return r}/* ESM default export */const f=/* unused pure expression or super */null&&d;// CONCATENATED MODULE: ../tutor/node_modules/uuid/dist/esm-browser/v4.js
function p(e,t,r){if(a.randomUUID&&!t&&!e){return a.randomUUID()}e=e||{};const n=e.random||(e.rng||l)();// Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
n[6]=n[6]&15|64;n[8]=n[8]&63|128;// Copy bytes to buffer, if provided
if(t){r=r||0;for(let e=0;e<16;++e){t[r+e]=n[e]}return t}return c(n)}/* ESM default export */const h=p;// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/config/config.ts
var v=r(9568);// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/config/constants.ts
var g=r(5781);// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/utils/types.ts
var m=r(7150);// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/utils/util.ts
function b(e,t){if(e===undefined||e===null){throw new Error(t)}}var y=()=>{};var _=e=>Array.from(Array(e).keys());var w=(e,t)=>Array.from({length:t-e},(t,r)=>r+e);var x=e=>{return e instanceof Blob||e instanceof File};var A=e=>{return Array.isArray(e)?e:e?[e]:[]};// Generate unique id
var k=()=>h();// Generate coupon code
var E=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:8;var t=e;var r="MSOP0123456789ABCDEFGHNRVUKYTJLZXIW";var n="";while(t--){n+=r[Math.random()*35|0]}return n};// Useful for mock api call
var I=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return new Promise(t=>setTimeout(t,e))};/**
 * Move one array item from one index to another index
 * (don't change the original array) instead return a new one.
 *
 * @param arr Array
 * @param fromIndex Number
 * @param toIndex Number
 * @returns new Array
 */var C=(e,t,r)=>{var n=[...e];var i=t;var a=r;if(t<0){i=e.length+t}if(t>=0&&t<e.length){if(r<0){a=e.length+r}var[o]=n.splice(i,1);if(o){n.splice(a,0,o)}}return n};var Y=e=>{var t=e.split(".");var r=t.pop();return r?".".concat(r):""};var T=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:true;var n={};for(var i of e){var a,o;var s=t(i);s=r?s:s.toString().toLowerCase();(a=n)[o=s]||(a[o]=0);n[s]++;var l=n[s];if(l&&l>1){return true}}return false};var S=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Set;var n=new Set(e.map(e=>e.id));var i=e.filter(e=>{if(r.has(e.id)){return false}if(t===0){return e.parent===0||!n.has(e.parent)}return e.parent===t});return i.reduce((t,n)=>{r.add(n.id);var i=S(e,n.id,r);return[...t,_object_spread_props(_object_spread({},n),{children:i})]},[])};var O=(e,t)=>{var r="0";if(!e){r="100%"}else if(e&&t>0){if(t>1){r="".concat(23+32*(t-1),"px")}else{r="23px"}}return r};var D=e=>{var t,r;var n=((t=e.sort)===null||t===void 0?void 0:t.direction)==="desc"?"-":"";return _object_spread({limit:e.limit,offset:e.offset,sort:((r=e.sort)===null||r===void 0?void 0:r.property)&&"".concat(n).concat(e.sort.property)},e.filter)};var F=(e,t)=>Math.floor(Math.random()*(t-e))+e;var R=(e,t,r,n,i)=>{return(e-t)*(i-n)/(r-t)+n};var P=e=>{return e.map(e=>e.id)};var M=(e,t)=>{var r=new Set(e);var n=new Set(t);var i=[];for(var a of r){if(n.has(a)){i.push(a)}}return i};var H=e=>{if(!e)return e;var t=e.charAt(0).toUpperCase();var r=e.slice(1);return"".concat(t).concat(r)};var N=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;if(!e||e<=1){return"0 Bytes"}var r=1024;var n=Math.max(0,t);var i=[__("Bytes","tutor-pro"),__("KB","tutor-pro"),__("MB","tutor-pro"),__("GB","tutor-pro"),__("TB","tutor-pro"),__("PB","tutor-pro"),__("EB","tutor-pro"),__("ZB","tutor-pro"),__("YB","tutor-pro")];var a=Math.floor(Math.log(e)/Math.log(r));return"".concat(Number.parseFloat((e/r**a).toFixed(n))," ").concat(i[a])};var L=e=>{if(!e||typeof e!=="string"){return 0}var[t,r]=e.split(" ");var n=parseFloat(t);var i=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"];var a=i.indexOf(r);if(a===-1){return 0}return n*1024**a};var K=(e,t)=>{return e.replace(t?/[^0-9.-]/g:/[^0-9.]/g,"").replace(/(?!^)-/g,"").replace(/(\..*)\./g,"$1")};var B=(e,t)=>{var r=false;return function n(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++){i[a]=arguments[a]}if(!r){e.apply(this,i);r=true;setTimeout(()=>{r=false},t)}}};var j=e=>{return JSON.parse(e)};var U=e=>{var t=Math.floor(e/3600).toString().padStart(2,"0");var r=Math.floor(e%3600/60).toString().padStart(2,"0");var n=Math.floor(e%60);if(t==="00"){return"".concat(r,":").concat(n," mins")}return"".concat(t,":").concat(r,":").concat(n," hrs")};var q=e=>{if(!(0,m/* .isDefined */.O9)(e)||!(0,m/* .isObject */.Gv)(e)){return[]}return Object.keys(e)};var V=e=>{return Object.values(e)};var W=e=>{return Object.entries(e)};function z(e){var t=new URLSearchParams;for(var r in e){if(r in e){t.append(r,e[r])}}return t.toString()}var G=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:DateFormats.yearMonthDayHourMinuteSecond24H;var r=e.getTimezoneOffset();var n=addMinutes(e,r);return format(n,t)};var Q=e=>{var t=new Date(e);var r=t.getTimezoneOffset();return addMinutes(t,-r)};var $=e=>{return(e||"").replace(/\r\n/g,"\n")};var X=e=>{return new Promise((t,r)=>{if(navigator.clipboard&&window.isSecureContext){navigator.clipboard.writeText(e).then(()=>t()).catch(e=>r(e))}else{var n=document.createElement("textarea");n.value=e;document.body.appendChild(n);n.select();try{// if navigator.clipboard is not available, use document.execCommand('copy')
document.execCommand("copy");t()}catch(e){r(e)}finally{document.body.removeChild(n);// Clean up
}}})};var J=e=>{if(!e||!e.response||!e.response.data){return(0,n.__)("Something went wrong","tutor-pro")}var t=e.response.data.message;if(e.response.data.status_code===422&&e.response.data.data){t=e.response.data.data[Object.keys(e.response.data.data)[0]]}return t||(0,n.__)("Something went wrong","tutor-pro")};var Z=e=>_async_to_generator(function*(){try{var t=yield fetch(e);var r=yield t.blob();var n=new FileReader;return new Promise((e,t)=>{n.readAsDataURL(r);n.onload=()=>e(n.result);n.onerror=e=>t(e)})}catch(e){throw new Error("Failed to fetch and convert image: ".concat(e))}})();var ee=(e,t)=>{if(e==="trash"){return"trash"}if(t==="private"){return"private"}if(e==="future"){return"future"}if(t==="password_protected"&&e!=="draft"){return"publish"}return e};var et=e=>{var t;return!!((t=v/* .tutorConfig.addons_data.find */.P.addons_data.find(t=>t.base_name===e))===null||t===void 0?void 0:t.is_enabled)};var er=e=>{if(!e||typeof e!=="string"){return""}return e.normalize("NFKD")// Normalize accented characters into base forms + diacritics
.replace(/[\u0300-\u036f]/g,"")// Remove combining diacritical marks
.toLowerCase()// Remove special characters !~@#$%^&*(){}[]|\;:"',./?
// Remove characters that are NOT:
// - Basic Latin letters and numbers (a-z, 0-9)
// - Spaces and hyphens
// - Latin Extended (À-ž, etc.)
// - Greek and Coptic (Α-ω)
// - Cyrillic (А-я)
// - Hebrew (א-ת)
// - Arabic (ا-ي)
// - Devanagari (Hindi)
// - Thai
// - Tamil
// - Georgian
// - Hangul Jamo (Korean building blocks)
// - Hiragana (Japanese)
// - Katakana (Japanese)
// - CJK Unified Ideographs (Chinese/Japanese/Korean characters)
// - Hangul Syllables (Korean)
// - Hangul Compatibility Jamo
// - Hangul Jamo Extended-A
// - Hangul Jamo Extended-B
.replace(/[^a-z0-9\s\-\u00C0-\u024F\u0370-\u03FF\u0400-\u04FF\u0590-\u05FF\u0600-\u06FF\u0900-\u097F\u0E00-\u0E7F\u0B80-\u0BFF\u10A0-\u10FF\u1100-\u11FF\u3130-\u318F\u3040-\u309F\u30A0-\u30FF\u4E00-\u9FFF\uA960-\uA97F\uAC00-\uD7AF\uD7B0-\uD7FF]/g,"").replace(/\s+/g,"-")// Replace multiple spaces with single dash
.replace(/-+/g,"-")// Replace multiple dashes with single dash
.replace(/^-+|-+$/g,"")// Remove leading and trailing dashes
};var en=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n=[];t.forEach(e=>{if(e.slotKey){e.fields[e.slotKey].forEach(e=>{n.push(e.name)})}else{Object.keys(e.fields).forEach(t=>{e.fields[t].forEach(e=>{n.push(e.name)})})}});return n};var ei=e=>{var t=new DOMParser;var r=t.parseFromString(e,"text/html");return r.body.textContent||""};var ea=e=>{var{unit:t="hour",value:r,useLySuffix:n=false,capitalize:i=true,showSingular:a=false}=e;if(t==="until_cancellation"){var o=__("Until Cancellation","tutor-pro");return i?eo(o):o}var s={hour:{// translators: %d is the number of hours
plural:__("%d hours","tutor-pro"),// translators: %d is the number of hours
singular:__("%d hour","tutor-pro"),suffix:__("hourly","tutor-pro"),base:__("hour","tutor-pro")},day:{// translators: %d is the number of days
plural:__("%d days","tutor-pro"),// translators: %d is the number of days
singular:__("%d day","tutor-pro"),suffix:__("daily","tutor-pro"),base:__("day","tutor-pro")},week:{// translators: %d is the number of weeks
plural:__("%d weeks","tutor-pro"),// translators: %d is the number of weeks
singular:__("%d week","tutor-pro"),suffix:__("weekly","tutor-pro"),base:__("week","tutor-pro")},month:{// translators: %d is the number of months
plural:__("%d months","tutor-pro"),// translators: %d is the number of months
singular:__("%d month","tutor-pro"),suffix:__("monthly","tutor-pro"),base:__("month","tutor-pro")},year:{// translators: %d is the number of years
plural:__("%d years","tutor-pro"),// translators: %d is the number of years
singular:__("%d year","tutor-pro"),suffix:__("yearly","tutor-pro"),base:__("year","tutor-pro")}};if(!s[t]){return""}var l="";if(r>1){l=sprintf(s[t].plural,r)}else if(a){l=sprintf(s[t].singular,r)}else if(n){l=s[t].suffix}else{l=s[t].base}return i?eo(l):l};var eo=e=>{return e.split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")};var es=e=>{var t=Math.floor(e/3600);var r=Math.floor(e%3600/60);var n=e%60;return{hours:t,minutes:r,seconds:n}}},1594:function(e){"use strict";e.exports=React},5206:function(e){"use strict";e.exports=ReactDOM},2470:function(e){"use strict";e.exports=wp.i18n},7317:function(e,t,r){"use strict";// EXPORTS
r.d(t,{_:()=>/* binding */i});// CONCATENATED MODULE: ../tutor/node_modules/@swc/helpers/esm/_define_property.js
function n(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else e[t]=r;return e};// CONCATENATED MODULE: ../tutor/node_modules/@swc/helpers/esm/_object_spread.js
function i(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};var i=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){i=i.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))}i.forEach(function(t){n(e,t,r[t])})}return e}},8015:function(e,t,r){"use strict";r.d(t,{_:()=>i});function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(t){n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}r.push.apply(r,n)}return r}function i(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors)Object.defineProperties(e,Object.getOwnPropertyDescriptors(t));else{n(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}},9414:function(e,t,r){"use strict";// EXPORTS
r.d(t,{_:()=>/* binding */i});// CONCATENATED MODULE: ../tutor/node_modules/@swc/helpers/esm/_object_without_properties_loose.js
function n(e,t){if(e==null)return{};var r={};var n=Object.keys(e);var i,a;for(a=0;a<n.length;a++){i=n[a];if(t.indexOf(i)>=0)continue;r[i]=e[i]}return r};// CONCATENATED MODULE: ../tutor/node_modules/@swc/helpers/esm/_object_without_properties.js
function i(e,t){if(e==null)return{};var r=n(e,t);var i,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++){i=o[a];if(t.indexOf(i)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,i))continue;r[i]=e[i]}}return r}},6154:function(e,t,r){"use strict";r.d(t,{_:()=>n});function n(e,t){if(!t)t=e.slice(0);return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}}};/************************************************************************/// The module cache
var t={};// The require function
function r(n){// Check if module is in cache
var i=t[n];if(i!==undefined){return i.exports}// Create a new module (and put it into the cache)
var a=t[n]={exports:{}};// Execute the module function
e[n](a,a.exports,r);// Return the exports of the module
return a.exports}/************************************************************************/// webpack/runtime/compat_get_default_export
(()=>{// getDefaultExport function for compatibility with non-ESM modules
r.n=e=>{var t=e&&e.__esModule?()=>e["default"]:()=>e;r.d(t,{a:t});return t}})();// webpack/runtime/define_property_getters
(()=>{r.d=(e,t)=>{for(var n in t){if(r.o(t,n)&&!r.o(e,n)){Object.defineProperty(e,n,{enumerable:true,get:t[n]})}}}})();// webpack/runtime/global
(()=>{r.g=(()=>{if(typeof globalThis==="object")return globalThis;try{return this||new Function("return this")()}catch(e){if(typeof window==="object")return window}})()})();// webpack/runtime/has_own_property
(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})();// webpack/runtime/make_namespace_object
(()=>{// define __esModule on exports
r.r=e=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})}})();// webpack/runtime/rspack_version
(()=>{r.rv=()=>"1.5.7"})();// webpack/runtime/auto_public_path
(()=>{var e;if(r.g.importScripts)e=r.g.location+"";var t=r.g.document;if(!e&&t){// Technically we could use `document.currentScript instanceof window.HTMLScriptElement`,
// but an attacker could try to inject `<script>HTMLScriptElement = HTMLImageElement</script>`
// and use `<img name="currentScript" src="https://attacker.controlled.server/"></img>`
if(t.currentScript&&t.currentScript.tagName.toUpperCase()==="SCRIPT")e=t.currentScript.src;if(!e){var n=t.getElementsByTagName("script");if(n.length){var i=n.length-1;while(i>-1&&(!e||!/^http(s?):/.test(e)))e=n[i--].src}}}// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration",
// or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.',
if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");r.p=e})();// webpack/runtime/rspack_unique_id
(()=>{r.ruid="bundler=rspack@1.5.7"})();/************************************************************************/var n={};// This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
(()=>{"use strict";// NAMESPACE OBJECT: ../tutor/node_modules/axios/lib/platform/common/utils.js
var e={};r.r(e);r.d(e,{hasBrowserEnv:()=>gb,hasStandardBrowserEnv:()=>g_,hasStandardBrowserWebWorkerEnv:()=>gw,navigator:()=>gy,origin:()=>gx});// EXTERNAL MODULE: ./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.esm.js
var t=r(3747);// EXTERNAL MODULE: external "React"
var n=r(1594);var i=/*#__PURE__*/r.n(n);// EXTERNAL MODULE: ./node_modules/react-dom/client.js
var a=r(5338);// EXTERNAL MODULE: ./node_modules/@emotion/react/dist/emotion-react.esm.js
var o=r(1699);// CONCATENATED MODULE: ./node_modules/@tanstack/query-core/build/modern/utils.js
// src/utils.ts
var s=typeof window==="undefined"||"Deno"in globalThis;function l(){}function u(e,t){return typeof e==="function"?e(t):e}function c(e){return typeof e==="number"&&e>=0&&e!==Infinity}function d(e,t){return Math.max(e+(t||0)-Date.now(),0)}function f(e,t){return typeof e==="function"?e(t):e}function p(e,t){return typeof e==="function"?e(t):e}function h(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(n){if(t.queryHash!==g(o,t.options)){return false}}else if(!b(t.queryKey,o)){return false}}if(r!=="all"){const e=t.isActive();if(r==="active"&&!e){return false}if(r==="inactive"&&e){return false}}if(typeof s==="boolean"&&t.isStale()!==s){return false}if(i&&i!==t.state.fetchStatus){return false}if(a&&!a(t)){return false}return true}function v(e,t){const{exact:r,status:n,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey){return false}if(r){if(m(t.options.mutationKey)!==m(a)){return false}}else if(!b(t.options.mutationKey,a)){return false}}if(n&&t.state.status!==n){return false}if(i&&!i(t)){return false}return true}function g(e,t){const r=t?.queryKeyHashFn||m;return r(e)}function m(e){return JSON.stringify(e,(e,t)=>x(t)?Object.keys(t).sort().reduce((e,r)=>{e[r]=t[r];return e},{}):t)}function b(e,t){if(e===t){return true}if(typeof e!==typeof t){return false}if(e&&t&&typeof e==="object"&&typeof t==="object"){return Object.keys(t).every(r=>b(e[r],t[r]))}return false}function y(e,t){if(e===t){return e}const r=w(e)&&w(t);if(r||x(e)&&x(t)){const n=r?e:Object.keys(e);const i=n.length;const a=r?t:Object.keys(t);const o=a.length;const s=r?[]:{};const l=new Set(n);let u=0;for(let n=0;n<o;n++){const i=r?n:a[n];if((!r&&l.has(i)||r)&&e[i]===void 0&&t[i]===void 0){s[i]=void 0;u++}else{s[i]=y(e[i],t[i]);if(s[i]===e[i]&&e[i]!==void 0){u++}}}return i===o&&u===i?e:s}return t}function _(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length){return false}for(const r in e){if(e[r]!==t[r]){return false}}return true}function w(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function x(e){if(!A(e)){return false}const t=e.constructor;if(t===void 0){return true}const r=t.prototype;if(!A(r)){return false}if(!r.hasOwnProperty("isPrototypeOf")){return false}if(Object.getPrototypeOf(e)!==Object.prototype){return false}return true}function A(e){return Object.prototype.toString.call(e)==="[object Object]"}function k(e){return new Promise(t=>{setTimeout(t,e)})}function E(e,t,r){if(typeof r.structuralSharing==="function"){return r.structuralSharing(e,t)}else if(r.structuralSharing!==false){if(false){}return y(e,t)}return t}function I(e){return e}function C(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function Y(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var T=Symbol();function S(e,t){if(false){}if(!e.queryFn&&t?.initialPromise){return()=>t.initialPromise}if(!e.queryFn||e.queryFn===T){return()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`))}return e.queryFn}function O(e,t){if(typeof e==="function"){return e(...t)}return!!e}//# sourceMappingURL=utils.js.map
;// CONCATENATED MODULE: ./node_modules/@tanstack/query-core/build/modern/notifyManager.js
// src/notifyManager.ts
var D=e=>setTimeout(e,0);function F(){let e=[];let t=0;let r=e=>{e()};let n=e=>{e()};let i=D;const a=n=>{if(t){e.push(n)}else{i(()=>{r(n)})}};const o=()=>{const t=e;e=[];if(t.length){i(()=>{n(()=>{t.forEach(e=>{r(e)})})})}};return{batch:e=>{let r;t++;try{r=e()}finally{t--;if(!t){o()}}return r},/**
     * All calls to the wrapped function will be batched.
     */batchCalls:e=>{return(...t)=>{a(()=>{e(...t)})}},schedule:a,/**
     * Use this method to set a custom notify function.
     * This can be used to for example wrap notifications with `React.act` while running tests.
     */setNotifyFunction:e=>{r=e},/**
     * Use this method to set a custom function to batch notifications together into a single tick.
     * By default React Query will use the batch function provided by ReactDOM or React Native.
     */setBatchNotifyFunction:e=>{n=e},setScheduler:e=>{i=e}}}var R=F();//# sourceMappingURL=notifyManager.js.map
;// CONCATENATED MODULE: ./node_modules/@tanstack/query-core/build/modern/subscribable.js
// src/subscribable.ts
var P=class{constructor(){this.listeners=/* @__PURE__ */new Set;this.subscribe=this.subscribe.bind(this)}subscribe(e){this.listeners.add(e);this.onSubscribe();return()=>{this.listeners.delete(e);this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};//# sourceMappingURL=subscribable.js.map
;// CONCATENATED MODULE: ./node_modules/@tanstack/query-core/build/modern/focusManager.js
// src/focusManager.ts
var M=class extends P{#e;#t;#r;constructor(){super();this.#r=e=>{if(!s&&window.addEventListener){const t=()=>e();window.addEventListener("visibilitychange",t,false);return()=>{window.removeEventListener("visibilitychange",t)}}return}}onSubscribe(){if(!this.#t){this.setEventListener(this.#r)}}onUnsubscribe(){if(!this.hasListeners()){this.#t?.();this.#t=void 0}}setEventListener(e){this.#r=e;this.#t?.();this.#t=e(e=>{if(typeof e==="boolean"){this.setFocused(e)}else{this.onFocus()}})}setFocused(e){const t=this.#e!==e;if(t){this.#e=e;this.onFocus()}}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){if(typeof this.#e==="boolean"){return this.#e}return globalThis.document?.visibilityState!=="hidden"}};var H=new M;//# sourceMappingURL=focusManager.js.map
;// CONCATENATED MODULE: ./node_modules/@tanstack/query-core/build/modern/onlineManager.js
// src/onlineManager.ts
var N=class extends P{#n=true;#t;#r;constructor(){super();this.#r=e=>{if(!s&&window.addEventListener){const t=()=>e(true);const r=()=>e(false);window.addEventListener("online",t,false);window.addEventListener("offline",r,false);return()=>{window.removeEventListener("online",t);window.removeEventListener("offline",r)}}return}}onSubscribe(){if(!this.#t){this.setEventListener(this.#r)}}onUnsubscribe(){if(!this.hasListeners()){this.#t?.();this.#t=void 0}}setEventListener(e){this.#r=e;this.#t?.();this.#t=e(this.setOnline.bind(this))}setOnline(e){const t=this.#n!==e;if(t){this.#n=e;this.listeners.forEach(t=>{t(e)})}}isOnline(){return this.#n}};var L=new N;//# sourceMappingURL=onlineManager.js.map
;// CONCATENATED MODULE: ./node_modules/@tanstack/query-core/build/modern/thenable.js
// src/thenable.ts
function K(){let e;let t;const r=new Promise((r,n)=>{e=r;t=n});r.status="pending";r.catch(()=>{});function n(e){Object.assign(r,e);delete r.resolve;delete r.reject}r.resolve=t=>{n({status:"fulfilled",value:t});e(t)};r.reject=e=>{n({status:"rejected",reason:e});t(e)};return r}function B(e){let t;e.then(e=>{t=e;return e},noop)?.catch(noop);if(t!==void 0){return{data:t}}return void 0}//# sourceMappingURL=thenable.js.map
;// CONCATENATED MODULE: ./node_modules/@tanstack/query-core/build/modern/retryer.js
// src/retryer.ts
function j(e){return Math.min(1e3*2**e,3e4)}function U(e){return(e??"online")==="online"?L.isOnline():true}var q=class extends Error{constructor(e){super("CancelledError");this.revert=e?.revert;this.silent=e?.silent}};function V(e){return e instanceof q}function W(e){let t=false;let r=0;let n=false;let i;const a=K();const o=t=>{if(!n){p(new q(t));e.abort?.()}};const l=()=>{t=true};const u=()=>{t=false};const c=()=>H.isFocused()&&(e.networkMode==="always"||L.isOnline())&&e.canRun();const d=()=>U(e.networkMode)&&e.canRun();const f=t=>{if(!n){n=true;e.onSuccess?.(t);i?.();a.resolve(t)}};const p=t=>{if(!n){n=true;e.onError?.(t);i?.();a.reject(t)}};const h=()=>{return new Promise(t=>{i=e=>{if(n||c()){t(e)}};e.onPause?.()}).then(()=>{i=void 0;if(!n){e.onContinue?.()}})};const v=()=>{if(n){return}let i;const a=r===0?e.initialPromise:void 0;try{i=a??e.fn()}catch(e){i=Promise.reject(e)}Promise.resolve(i).then(f).catch(i=>{if(n){return}const a=e.retry??(s?0:3);const o=e.retryDelay??j;const l=typeof o==="function"?o(r,i):o;const u=a===true||typeof a==="number"&&r<a||typeof a==="function"&&a(r,i);if(t||!u){p(i);return}r++;e.onFail?.(r,i);k(l).then(()=>{return c()?void 0:h()}).then(()=>{if(t){p(i)}else{v()}})})};return{promise:a,cancel:o,continue:()=>{i?.();return a},cancelRetry:l,continueRetry:u,canStart:d,start:()=>{if(d()){v()}else{h().then(v)}return a}}}//# sourceMappingURL=retryer.js.map
;// CONCATENATED MODULE: ./node_modules/@tanstack/query-core/build/modern/removable.js
// src/removable.ts
var z=class{#i;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout();if(c(this.gcTime)){this.#i=setTimeout(()=>{this.optionalRemove()},this.gcTime)}}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(s?Infinity:5*60*1e3))}clearGcTimeout(){if(this.#i){clearTimeout(this.#i);this.#i=void 0}}};//# sourceMappingURL=removable.js.map
;// CONCATENATED MODULE: ./node_modules/@tanstack/query-core/build/modern/query.js
// src/query.ts
var G=class extends z{#a;#o;#s;#l;#u;#c;#d;constructor(e){super();this.#d=false;this.#c=e.defaultOptions;this.setOptions(e.options);this.observers=[];this.#l=e.client;this.#s=this.#l.getQueryCache();this.queryKey=e.queryKey;this.queryHash=e.queryHash;this.#a=$(this.options);this.state=e.state??this.#a;this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#u?.promise}setOptions(e){this.options={...this.#c,...e};this.updateGcTime(this.options.gcTime)}optionalRemove(){if(!this.observers.length&&this.state.fetchStatus==="idle"){this.#s.remove(this)}}setData(e,t){const r=E(this.state.data,e,this.options);this.#f({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual});return r}setState(e,t){this.#f({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#u?.promise;this.#u?.cancel(e);return t?t.then(l).catch(l):Promise.resolve()}destroy(){super.destroy();this.cancel({silent:true})}reset(){this.destroy();this.setState(this.#a)}isActive(){return this.observers.some(e=>p(e.options.enabled,this)!==false)}isDisabled(){if(this.getObserversCount()>0){return!this.isActive()}return this.options.queryFn===T||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){if(this.getObserversCount()>0){return this.observers.some(e=>f(e.options.staleTime,this)==="static")}return false}isStale(){if(this.getObserversCount()>0){return this.observers.some(e=>e.getCurrentResult().isStale)}return this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){if(this.state.data===void 0){return true}if(e==="static"){return false}if(this.state.isInvalidated){return true}return!d(this.state.dataUpdatedAt,e)}onFocus(){const e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:false});this.#u?.continue()}onOnline(){const e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:false});this.#u?.continue()}addObserver(e){if(!this.observers.includes(e)){this.observers.push(e);this.clearGcTimeout();this.#s.notify({type:"observerAdded",query:this,observer:e})}}removeObserver(e){if(this.observers.includes(e)){this.observers=this.observers.filter(t=>t!==e);if(!this.observers.length){if(this.#u){if(this.#d){this.#u.cancel({revert:true})}else{this.#u.cancelRetry()}}this.scheduleGc()}this.#s.notify({type:"observerRemoved",query:this,observer:e})}}getObserversCount(){return this.observers.length}invalidate(){if(!this.state.isInvalidated){this.#f({type:"invalidate"})}}fetch(e,t){if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&t?.cancelRefetch){this.cancel({silent:true})}else if(this.#u){this.#u.continueRetry();return this.#u.promise}}if(e){this.setOptions(e)}if(!this.options.queryFn){const e=this.observers.find(e=>e.options.queryFn);if(e){this.setOptions(e.options)}}if(false){}const r=new AbortController;const n=e=>{Object.defineProperty(e,"signal",{enumerable:true,get:()=>{this.#d=true;return r.signal}})};const i=()=>{const e=S(this.options,t);const r=()=>{const e={client:this.#l,queryKey:this.queryKey,meta:this.meta};n(e);return e};const i=r();this.#d=false;if(this.options.persister){return this.options.persister(e,i,this)}return e(i)};const a=()=>{const e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#l,state:this.state,fetchFn:i};n(e);return e};const o=a();this.options.behavior?.onFetch(o,this);this.#o=this.state;if(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta){this.#f({type:"fetch",meta:o.fetchOptions?.meta})}const s=e=>{if(!(V(e)&&e.silent)){this.#f({type:"error",error:e})}if(!V(e)){this.#s.config.onError?.(e,this);this.#s.config.onSettled?.(this.state.data,e,this)}this.scheduleGc()};this.#u=W({initialPromise:t?.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:e=>{if(e===void 0){if(false){}s(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(e)}catch(e){s(e);return}this.#s.config.onSuccess?.(e,this);this.#s.config.onSettled?.(e,this.state.error,this);this.scheduleGc()},onError:s,onFail:(e,t)=>{this.#f({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#f({type:"pause"})},onContinue:()=>{this.#f({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>true});return this.#u.start()}#f(e){const t=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...Q(t.data,this.options),fetchMeta:e.meta??null};case"success":this.#o=void 0;return{...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:false,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const r=e.error;if(V(r)&&r.revert&&this.#o){return{...this.#o,fetchStatus:"idle"}}return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:true};case"setState":return{...t,...e.state}}};this.state=t(this.state);R.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()});this.#s.notify({query:this,type:"updated",action:e})})}};function Q(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:U(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function $(e){const t=typeof e.initialData==="function"?e.initialData():e.initialData;const r=t!==void 0;const 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:false,status:r?"success":"pending",fetchStatus:"idle"}}//# sourceMappingURL=query.js.map
;// CONCATENATED MODULE: ./node_modules/@tanstack/query-core/build/modern/queryCache.js
// src/queryCache.ts
var X=class extends P{constructor(e={}){super();this.config=e;this.#p=/* @__PURE__ */new Map}#p;build(e,t,r){const n=t.queryKey;const i=t.queryHash??g(n,t);let a=this.get(i);if(!a){a=new G({client:e,queryKey:n,queryHash:i,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(n)});this.add(a)}return a}add(e){if(!this.#p.has(e.queryHash)){this.#p.set(e.queryHash,e);this.notify({type:"added",query:e})}}remove(e){const t=this.#p.get(e.queryHash);if(t){e.destroy();if(t===e){this.#p.delete(e.queryHash)}this.notify({type:"removed",query:e})}}clear(){R.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#p.get(e)}getAll(){return[...this.#p.values()]}find(e){const t={exact:true,...e};return this.getAll().find(e=>h(t,e))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(t=>h(e,t)):t}notify(e){R.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){R.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){R.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}};//# sourceMappingURL=queryCache.js.map
;// CONCATENATED MODULE: ./node_modules/@tanstack/query-core/build/modern/mutation.js
// src/mutation.ts
var J=class extends z{#h;#v;#u;constructor(e){super();this.mutationId=e.mutationId;this.#v=e.mutationCache;this.#h=[];this.state=e.state||Z();this.setOptions(e.options);this.scheduleGc()}setOptions(e){this.options=e;this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){if(!this.#h.includes(e)){this.#h.push(e);this.clearGcTimeout();this.#v.notify({type:"observerAdded",mutation:this,observer:e})}}removeObserver(e){this.#h=this.#h.filter(t=>t!==e);this.scheduleGc();this.#v.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){if(!this.#h.length){if(this.state.status==="pending"){this.scheduleGc()}else{this.#v.remove(this)}}}continue(){return this.#u?.continue()??// continuing a mutation assumes that variables are set, mutation must have been dehydrated before
this.execute(this.state.variables)}async execute(e){const t=()=>{this.#f({type:"continue"})};this.#u=W({fn:()=>{if(!this.options.mutationFn){return Promise.reject(new Error("No mutationFn found"))}return this.options.mutationFn(e)},onFail:(e,t)=>{this.#f({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#f({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#v.canRun(this)});const r=this.state.status==="pending";const n=!this.#u.canStart();try{if(r){t()}else{this.#f({type:"pending",variables:e,isPaused:n});await this.#v.config.onMutate?.(e,this);const t=await this.options.onMutate?.(e);if(t!==this.state.context){this.#f({type:"pending",context:t,variables:e,isPaused:n})}}const i=await this.#u.start();await this.#v.config.onSuccess?.(i,e,this.state.context,this);await this.options.onSuccess?.(i,e,this.state.context);await this.#v.config.onSettled?.(i,null,this.state.variables,this.state.context,this);await this.options.onSettled?.(i,null,e,this.state.context);this.#f({type:"success",data:i});return i}catch(t){try{await this.#v.config.onError?.(t,e,this.state.context,this);await this.options.onError?.(t,e,this.state.context);await this.#v.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this);await this.options.onSettled?.(void 0,t,e,this.state.context);throw t}finally{this.#f({type:"error",error:t})}}finally{this.#v.runNext(this)}}#f(e){const t=t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:true};case"continue":return{...t,isPaused:false};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:false};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:false,status:"error"}}};this.state=t(this.state);R.batch(()=>{this.#h.forEach(t=>{t.onMutationUpdate(e)});this.#v.notify({mutation:this,type:"updated",action:e})})}};function Z(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:false,status:"idle",variables:void 0,submittedAt:0}}//# sourceMappingURL=mutation.js.map
;// CONCATENATED MODULE: ./node_modules/@tanstack/query-core/build/modern/mutationCache.js
// src/mutationCache.ts
var ee=class extends P{constructor(e={}){super();this.config=e;this.#g=/* @__PURE__ */new Set;this.#m=/* @__PURE__ */new Map;this.#b=0}#g;#m;#b;build(e,t,r){const n=new J({mutationCache:this,mutationId:++this.#b,options:e.defaultMutationOptions(t),state:r});this.add(n);return n}add(e){this.#g.add(e);const t=et(e);if(typeof t==="string"){const r=this.#m.get(t);if(r){r.push(e)}else{this.#m.set(t,[e])}}this.notify({type:"added",mutation:e})}remove(e){if(this.#g.delete(e)){const t=et(e);if(typeof t==="string"){const r=this.#m.get(t);if(r){if(r.length>1){const t=r.indexOf(e);if(t!==-1){r.splice(t,1)}}else if(r[0]===e){this.#m.delete(t)}}}}this.notify({type:"removed",mutation:e})}canRun(e){const t=et(e);if(typeof t==="string"){const r=this.#m.get(t);const n=r?.find(e=>e.state.status==="pending");return!n||n===e}else{return true}}runNext(e){const t=et(e);if(typeof t==="string"){const r=this.#m.get(t)?.find(t=>t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}else{return Promise.resolve()}}clear(){R.batch(()=>{this.#g.forEach(e=>{this.notify({type:"removed",mutation:e})});this.#g.clear();this.#m.clear()})}getAll(){return Array.from(this.#g)}find(e){const t={exact:true,...e};return this.getAll().find(e=>v(t,e))}findAll(e={}){return this.getAll().filter(t=>v(e,t))}notify(e){R.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(e=>e.state.isPaused);return R.batch(()=>Promise.all(e.map(e=>e.continue().catch(l))))}};function et(e){return e.options.scope?.id}//# sourceMappingURL=mutationCache.js.map
;// CONCATENATED MODULE: ./node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js
// src/infiniteQueryBehavior.ts
function er(e){return{onFetch:(t,r)=>{const n=t.options;const i=t.fetchOptions?.meta?.fetchMore?.direction;const a=t.state.data?.pages||[];const o=t.state.data?.pageParams||[];let s={pages:[],pageParams:[]};let l=0;const u=async()=>{let r=false;const u=e=>{Object.defineProperty(e,"signal",{enumerable:true,get:()=>{if(t.signal.aborted){r=true}else{t.signal.addEventListener("abort",()=>{r=true})}return t.signal}})};const c=S(t.options,t.fetchOptions);const d=async(e,n,i)=>{if(r){return Promise.reject()}if(n==null&&e.pages.length){return Promise.resolve(e)}const a=()=>{const e={client:t.client,queryKey:t.queryKey,pageParam:n,direction:i?"backward":"forward",meta:t.options.meta};u(e);return e};const o=a();const s=await c(o);const{maxPages:l}=t.options;const d=i?Y:C;return{pages:d(e.pages,s,l),pageParams:d(e.pageParams,n,l)}};if(i&&a.length){const e=i==="backward";const t=e?ei:en;const r={pages:a,pageParams:o};const l=t(n,r);s=await d(r,l,e)}else{const t=e??a.length;do{const e=l===0?o[0]??n.initialPageParam:en(n,s);if(l>0&&e==null){break}s=await d(s,e);l++}while(l<t)}return s};if(t.options.persister){t.fetchFn=()=>{return t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}}else{t.fetchFn=u}}}}function en(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 ei(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}function ea(e,t){if(!t)return false;return en(e,t)!=null}function eo(e,t){if(!t||!e.getPreviousPageParam)return false;return ei(e,t)!=null}//# sourceMappingURL=infiniteQueryBehavior.js.map
;// CONCATENATED MODULE: ./node_modules/@tanstack/query-core/build/modern/queryClient.js
// src/queryClient.ts
var es=class{#y;#v;#c;#_;#w;#x;#A;#k;constructor(e={}){this.#y=e.queryCache||new X;this.#v=e.mutationCache||new ee;this.#c=e.defaultOptions||{};this.#_=/* @__PURE__ */new Map;this.#w=/* @__PURE__ */new Map;this.#x=0}mount(){this.#x++;if(this.#x!==1)return;this.#A=H.subscribe(async e=>{if(e){await this.resumePausedMutations();this.#y.onFocus()}});this.#k=L.subscribe(async e=>{if(e){await this.resumePausedMutations();this.#y.onOnline()}})}unmount(){this.#x--;if(this.#x!==0)return;this.#A?.();this.#A=void 0;this.#k?.();this.#k=void 0}isFetching(e){return this.#y.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#v.findAll({...e,status:"pending"}).length}/**
   * Imperative (non-reactive) way to retrieve data for a QueryKey.
   * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates.
   *
   * Hint: Do not use this function inside a component, because it won't receive updates.
   * Use `useQuery` to create a `QueryObserver` that subscribes to changes.
   */getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#y.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e);const r=this.#y.build(this,t);const n=r.state.data;if(n===void 0){return this.fetchQuery(e)}if(e.revalidateIfStale&&r.isStaleByTime(f(t.staleTime,r))){void this.prefetchQuery(t)}return Promise.resolve(n)}getQueriesData(e){return this.#y.findAll(e).map(({queryKey:e,state:t})=>{const r=t.data;return[e,r]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e});const i=this.#y.get(n.queryHash);const a=i?.state.data;const o=u(t,a);if(o===void 0){return void 0}return this.#y.build(this,n).setData(o,{...r,manual:true})}setQueriesData(e,t,r){return R.batch(()=>this.#y.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#y.get(t.queryHash)?.state}removeQueries(e){const t=this.#y;R.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){const r=this.#y;return R.batch(()=>{r.findAll(e).forEach(e=>{e.reset()});return this.refetchQueries({type:"active",...e},t)})}cancelQueries(e,t={}){const r={revert:true,...t};const n=R.batch(()=>this.#y.findAll(e).map(e=>e.cancel(r)));return Promise.all(n).then(l).catch(l)}invalidateQueries(e,t={}){return R.batch(()=>{this.#y.findAll(e).forEach(e=>{e.invalidate()});if(e?.refetchType==="none"){return Promise.resolve()}return this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)})}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??true};const n=R.batch(()=>this.#y.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,r);if(!r.throwOnError){t=t.catch(l)}return e.state.fetchStatus==="paused"?Promise.resolve():t}));return Promise.all(n).then(l)}fetchQuery(e){const t=this.defaultQueryOptions(e);if(t.retry===void 0){t.retry=false}const r=this.#y.build(this,t);return r.isStaleByTime(f(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(l).catch(l)}fetchInfiniteQuery(e){e.behavior=er(e.pages);return this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(l).catch(l)}ensureInfiniteQueryData(e){e.behavior=er(e.pages);return this.ensureQueryData(e)}resumePausedMutations(){if(L.isOnline()){return this.#v.resumePausedMutations()}return Promise.resolve()}getQueryCache(){return this.#y}getMutationCache(){return this.#v}getDefaultOptions(){return this.#c}setDefaultOptions(e){this.#c=e}setQueryDefaults(e,t){this.#_.set(m(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#_.values()];const r={};t.forEach(t=>{if(b(e,t.queryKey)){Object.assign(r,t.defaultOptions)}});return r}setMutationDefaults(e,t){this.#w.set(m(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#w.values()];const r={};t.forEach(t=>{if(b(e,t.mutationKey)){Object.assign(r,t.defaultOptions)}});return r}defaultQueryOptions(e){if(e._defaulted){return e}const t={...this.#c.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:true};if(!t.queryHash){t.queryHash=g(t.queryKey,t)}if(t.refetchOnReconnect===void 0){t.refetchOnReconnect=t.networkMode!=="always"}if(t.throwOnError===void 0){t.throwOnError=!!t.suspense}if(!t.networkMode&&t.persister){t.networkMode="offlineFirst"}if(t.queryFn===T){t.enabled=false}return t}defaultMutationOptions(e){if(e?._defaulted){return e}return{...this.#c.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:true}}clear(){this.#y.clear();this.#v.clear()}};//# sourceMappingURL=queryClient.js.map
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
var el=r(4848);// CONCATENATED MODULE: ./node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.js
"use client";// src/QueryClientProvider.tsx
var eu=n.createContext(void 0);var ec=e=>{const t=n.useContext(eu);if(e){return e}if(!t){throw new Error("No QueryClient set, use QueryClientProvider to set one")}return t};var ed=({client:e,children:t})=>{n.useEffect(()=>{e.mount();return()=>{e.unmount()}},[e]);return/* @__PURE__ */(0,el.jsx)(eu.Provider,{value:e,children:t})};//# sourceMappingURL=QueryClientProvider.js.map
;// CONCATENATED MODULE: ./node_modules/@swc/helpers/esm/_define_property.js
function ef(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else e[t]=r;return e};// CONCATENATED MODULE: ./node_modules/@swc/helpers/esm/_object_spread.js
function ep(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};var n=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))}n.forEach(function(t){ef(e,t,r[t])})}return e};// CONCATENATED MODULE: ./node_modules/@swc/helpers/esm/_object_spread_props.js
function eh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(t){n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}r.push.apply(r,n)}return r}function ev(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors)Object.defineProperties(e,Object.getOwnPropertyDescriptors(t));else{eh(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e};// CONCATENATED MODULE: ./node_modules/@swc/helpers/esm/_tagged_template_literal.js
function eg(e,t){if(!t)t=e.slice(0);return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}// EXTERNAL MODULE: external "wp.i18n"
var em=r(2470);// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/atoms/Button.tsx
var eb=r(3494);// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/config/styles.ts
var ey=r(4532);// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/atoms/LoadingSpinner.tsx
var e_=/*#__PURE__*/(0,o/* .keyframes */.i7)("0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}");var ew=/*#__PURE__*/(0,o/* .keyframes */.i7)("0%{stroke-dashoffset:180;transform:rotate(0deg);}50%{stroke-dashoffset:",180/4,";transform:rotate(135deg);}100%{stroke-dashoffset:180;transform:rotate(360deg);}");var ex=/*#__PURE__*/(0,o/* .keyframes */.i7)("	0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}");var eA={fullscreen:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;align-items:center;justify-content:center;height:100vh;width:100vw;"),loadingOverlay:/*#__PURE__*/(0,o/* .css */.AH)("position:absolute;top:0;bottom:0;right:0;left:0;display:flex;align-items:center;justify-content:center;"),loadingSection:/*#__PURE__*/(0,o/* .css */.AH)("width:100%;height:100px;display:flex;justify-content:center;align-items:center;"),svg:/*#__PURE__*/(0,o/* .css */.AH)("animation:",e_," 1.4s linear infinite;"),spinnerPath:/*#__PURE__*/(0,o/* .css */.AH)("stroke-dasharray:180;stroke-dashoffset:0;transform-origin:center;animation:",ew," 1.4s linear infinite;"),spinGradient:/*#__PURE__*/(0,o/* .css */.AH)("transition:transform;transform-origin:center;animation:",ex," 1s infinite linear;")};var ek=e=>{var{size:r=30,color:n=ey/* .colorTokens.icon.disable["default"] */.I6.icon.disable["default"]}=e;return/*#__PURE__*/(0,t/* .jsx */.Y)("svg",{width:r,height:r,css:eA.svg,viewBox:"0 0 86 86",xmlns:"http://www.w3.org/2000/svg",children:/*#__PURE__*/(0,t/* .jsx */.Y)("circle",{css:eA.spinnerPath,fill:"none",stroke:n,strokeWidth:"6",strokeLinecap:"round",cx:"43",cy:"43",r:"30"})})};var eE=()=>{return/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:eA.loadingOverlay,children:/*#__PURE__*/(0,t/* .jsx */.Y)(ek,{})})};var eI=()=>{return/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:eA.loadingSection,children:/*#__PURE__*/(0,t/* .jsx */.Y)(ek,{})})};var eC=()=>{return /*#__PURE__*/_jsx("div",{css:eA.fullscreen,children:/*#__PURE__*/_jsx(ek,{})})};var eY=e=>{var{size:t=24}=e;return /*#__PURE__*/_jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[/*#__PURE__*/_jsx("path",{d:"M12 3C10.22 3 8.47991 3.52784 6.99987 4.51677C5.51983 5.50571 4.36628 6.91131 3.68509 8.55585C3.0039 10.2004 2.82567 12.01 3.17294 13.7558C3.5202 15.5016 4.37737 17.1053 5.63604 18.364C6.89472 19.6226 8.49836 20.4798 10.2442 20.8271C11.99 21.1743 13.7996 20.9961 15.4442 20.3149C17.0887 19.6337 18.4943 18.4802 19.4832 17.0001C20.4722 15.5201 21 13.78 21 12",stroke:"url(#paint0_linear_2402_3559)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",css:eA.spinGradient}),/*#__PURE__*/_jsx("defs",{children:/*#__PURE__*/_jsxs("linearGradient",{id:"paint0_linear_2402_3559",x1:"4.50105",y1:"12",x2:"21.6571",y2:"6.7847",gradientUnits:"userSpaceOnUse",children:[/*#__PURE__*/_jsx("stop",{stopColor:"#FF9645"}),/*#__PURE__*/_jsx("stop",{offset:"0.152804",stopColor:"#FF6471"}),/*#__PURE__*/_jsx("stop",{offset:"0.467993",stopColor:"#CF6EBD"}),/*#__PURE__*/_jsx("stop",{offset:"0.671362",stopColor:"#A477D1"}),/*#__PURE__*/_jsx("stop",{offset:"1",stopColor:"#3E64DE"})]})})]})};/* ESM default export */const eT=ek;// EXTERNAL MODULE: ../tutor/node_modules/@swc/helpers/esm/_tagged_template_literal.js
var eS=r(6154);// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/utils/types.ts
var eO=r(7150);// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/atoms/Skeleton.tsx
function eD(){var e=(0,eS._)(["\n      border-radius: ",";\n    "]);eD=function t(){return e};return e}function eF(){var e=(0,eS._)(["\n          background: linear-gradient(89.17deg, #fef4ff 0.2%, #f9d3ff 50.09%, #fef4ff 96.31%);\n        "]);eF=function t(){return e};return e}function eR(){var e=(0,eS._)(["\n      :after {\n        content: '';\n        background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.05), transparent);\n        position: absolute;\n        transform: translateX(-100%);\n        inset: 0;\n        ","\n\n        animation: ","s linear 0.5s infinite normal none running ",";\n      }\n    "]);eR=function t(){return e};return e}var eP=/*#__PURE__*/(0,n.forwardRef)((e,r)=>{var{width:n="100%",height:i=16,animation:a=false,isMagicAi:o=false,isRound:s=false,animationDuration:l=1.6,className:u}=e;return/*#__PURE__*/(0,t/* .jsx */.Y)("span",{ref:r,css:eN.skeleton(n,i,a,o,s,l),className:u})});/* ESM default export */const eM=eP;var eH={wave:/*#__PURE__*/(0,o/* .keyframes */.i7)("0%{transform:translateX(-100%);}50%{transform:translateX(0%);}100%{transform:translateX(100%);}")};var eN={skeleton:(e,t,r,n,i,a)=>/*#__PURE__*/(0,o/* .css */.AH)("display:block;width:",(0,eO/* .isNumber */.Et)(e)?"".concat(e,"px"):e,";height:",(0,eO/* .isNumber */.Et)(t)?"".concat(t,"px"):t,";border-radius:",ey/* .borderRadius["6"] */.Vq["6"],";background-color:",!n?"rgba(0, 0, 0, 0.11)":ey/* .colorTokens.background.magicAi.skeleton */.I6.background.magicAi.skeleton,";position:relative;-webkit-mask-image:-webkit-radial-gradient(center,white,black);overflow:hidden;",i&&(0,o/* .css */.AH)(eD(),ey/* .borderRadius.circle */.Vq.circle)," ",r&&(0,o/* .css */.AH)(eR(),n&&(0,o/* .css */.AH)(eF()),a,eH.wave))};// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/atoms/SVGIcon.tsx
var eL=r(6277);// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/config/typography.ts
var eK=r(6439);// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/utils/style-utils.ts
var eB=r(6014);// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/utils/util.ts + 4 modules
var ej=r(6208);// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/atoms/TextInput.tsx
function eU(){var e=(0,eS._)(["\n      flex-direction: row;\n      align-items: center;\n      gap: ",";\n      justify-content: space-between;\n      height: 32px;\n    "]);eU=function t(){return e};return e}function eq(){var e=(0,eS._)(["\n      color: ",";\n    "]);eq=function t(){return e};return e}function eV(){var e=(0,eS._)(["\n        padding-left: ",";\n      "]);eV=function t(){return e};return e}function eW(){var e=(0,eS._)(["\n        height: 32px;\n        min-height: 32px;\n      "]);eW=function t(){return e};return e}var ez=e=>{var{label:r,isInlineLabel:i,type:a="text",value:o,disabled:s,readOnly:l,placeholder:u,onChange:c,onBlur:d,onKeyDown:f,onFocus:p,isClearable:h,handleMediaIconClick:v,variant:g="regular",focusOnMount:m=false,inputCss:b,autoFocus:y=false,size:_="regular"}=e;var w=(0,n.useId)();var x=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(!m||!x.current){return}x.current.focus()},[m]);return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:eQ.inputContainer(i),children:[!!r&&/*#__PURE__*/(0,t/* .jsx */.Y)("label",{htmlFor:w,css:eQ.label(i),children:r}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:eQ.inputWrapper,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("input",{ref:x,id:w,type:"text",css:[eQ.input(g,_),b],value:o||"",autoFocus:y,onChange:e=>{var{value:t}=e.target;var r=a==="number"?(0,ej/* .parseNumberOnly */.TW)(t):t;c(r)},onKeyDown:e=>{f===null||f===void 0?void 0:f(e.key,e)},onBlur:e=>{var{value:t}=e.target;var r=a==="number"?(0,ej/* .parseNumberOnly */.TW)(t):t;d===null||d===void 0?void 0:d(r)},onFocus:e=>{p===null||p===void 0?void 0:p(e)},placeholder:u,readOnly:l,disabled:s,autoComplete:"off","data-input":true}),g==="search"&&/*#__PURE__*/(0,t/* .jsx */.Y)("span",{css:eQ.searchIcon,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"search",width:24,height:24})}),h&&!!o&&/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:eQ.rightIconButton,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"text",size:"small",onClick:()=>c(""),children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"cross",width:24,height:24})})}),!!v&&g!=="search"&&!o&&/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:eQ.rightIconButton,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"text",size:"small",onClick:v,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"upload"})})})]})]})};/* ESM default export */const eG=ez;var eQ={inputContainer:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:false;return/*#__PURE__*/(0,o/* .css */.AH)("display:flex;flex-direction:column;gap:",ey/* .spacing["4"] */.YK["4"],";width:100%;",e&&(0,o/* .css */.AH)(eU(),ey/* .spacing["12"] */.YK["12"]))},label:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:false;return/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.caption */.I.caption()," ",e&&(0,o/* .css */.AH)(eq(),ey/* .colorTokens.text.primary */.I6.text.primary))},inputWrapper:/*#__PURE__*/(0,o/* .css */.AH)("position:relative;"),input:(e,t)=>/*#__PURE__*/(0,o/* .css */.AH)("&[data-input]{",eK/* .typography.body */.I.body(),"      width:100%;height:40px;min-height:auto;border-radius:",ey/* .borderRadius["5"] */.Vq["5"],";border:1px solid ",ey/* .colorTokens.stroke["default"] */.I6.stroke["default"],";padding:0 ",ey/* .spacing["32"] */.YK["32"]," 0 ",ey/* .spacing["12"] */.YK["12"],";color:",ey/* .colorTokens.text.primary */.I6.text.primary,";appearance:textfield;:focus{",eB/* .styleUtils.inputFocus */.x.inputFocus,";}::-webkit-outer-spin-button,::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}::placeholder{color:",ey/* .colorTokens.text.subdued */.I6.text.subdued,";}",e==="search"&&(0,o/* .css */.AH)(eV(),ey/* .spacing["36"] */.YK["36"])," ",t==="small"&&(0,o/* .css */.AH)(eW()),"}"),rightIconButton:/*#__PURE__*/(0,o/* .css */.AH)("position:absolute;right:",ey/* .spacing["4"] */.YK["4"],";top:",ey/* .spacing["4"] */.YK["4"],";button{padding:",ey/* .spacing["4"] */.YK["4"],";border-radius:",ey/* .borderRadius["2"] */.Vq["2"],";}"),searchIcon:/*#__PURE__*/(0,o/* .css */.AH)("position:absolute;top:50%;left:",ey/* .spacing["8"] */.YK["8"],";transform:translateY(-50%);color:",ey/* .colorTokens.icon["default"] */.I6.icon["default"],";line-height:0;")};// EXTERNAL MODULE: ../tutor/node_modules/@swc/helpers/esm/_object_spread.js + 1 modules
var e$=r(7317);// EXTERNAL MODULE: ../tutor/node_modules/@swc/helpers/esm/_object_spread_props.js
var eX=r(8015);// EXTERNAL MODULE: ../tutor/node_modules/@swc/helpers/esm/_object_without_properties.js + 1 modules
var eJ=r(9414);// CONCATENATED MODULE: ../tutor/node_modules/@react-spring/rafz/dist/react-spring_rafz.modern.mjs
// src/index.ts
var eZ=to();var e0=e=>tt(e,eZ);var e1=to();e0.write=e=>tt(e,e1);var e2=to();e0.onStart=e=>tt(e,e2);var e6=to();e0.onFrame=e=>tt(e,e6);var e4=to();e0.onFinish=e=>tt(e,e4);var e5=[];e0.setTimeout=(e,t)=>{const r=e0.now()+t;const n=()=>{const e=e5.findIndex(e=>e.cancel==n);if(~e)e5.splice(e,1);e7-=~e?1:0};const i={time:r,handler:e,cancel:n};e5.splice(e3(r),0,i);e7+=1;tr();return i};var e3=e=>~(~e5.findIndex(t=>t.time>e)||~e5.length);e0.cancel=e=>{e2.delete(e);e6.delete(e);e4.delete(e);eZ.delete(e);e1.delete(e)};e0.sync=e=>{te=true;e0.batchedUpdates(e);te=false};e0.throttle=e=>{let t;function r(){try{e(...t)}finally{t=null}}function n(...e){t=e;e0.onStart(r)}n.handler=e;n.cancel=()=>{e2.delete(r);t=null};return n};var e8=typeof window!="undefined"?window.requestAnimationFrame:// eslint-disable-next-line @typescript-eslint/no-empty-function
()=>{};e0.use=e=>e8=e;e0.now=typeof performance!="undefined"?()=>performance.now():Date.now;e0.batchedUpdates=e=>e();e0.catch=console.error;e0.frameLoop="always";e0.advance=()=>{if(e0.frameLoop!=="demand"){console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand")}else{ta()}};var e9=-1;var e7=0;var te=false;function tt(e,t){if(te){t.delete(e);e(0)}else{t.add(e);tr()}}function tr(){if(e9<0){e9=0;if(e0.frameLoop!=="demand"){e8(ti)}}}function tn(){e9=-1}function ti(){if(~e9){e8(ti);e0.batchedUpdates(ta)}}function ta(){const e=e9;e9=e0.now();const t=e3(e9);if(t){ts(e5.splice(0,t),e=>e.handler());e7-=t}if(!e7){tn();return}e2.flush();eZ.flush(e?Math.min(64,e9-e):16.667);e6.flush();e1.flush();e4.flush()}function to(){let e=/* @__PURE__ */new Set;let t=e;return{add(r){e7+=t==e&&!e.has(r)?1:0;e.add(r)},delete(r){e7-=t==e&&e.has(r)?1:0;return e.delete(r)},flush(r){if(t.size){e=/* @__PURE__ */new Set;e7-=t.size;ts(t,t=>t(r)&&e.add(t));e7+=e.size;t=e}}}}function ts(e,t){e.forEach(e=>{try{t(e)}catch(e){e0.catch(e)}})}var tl=/* unused pure expression or super */null&&{/** The number of pending tasks */count(){return e7},/** Whether there's a raf update loop running */isRunning(){return e9>=0},/** Clear internal state. Never call from update loop! */clear(){e9=-1;e5=[];e2=to();eZ=to();e6=to();e1=to();e4=to();e7=0}};//# sourceMappingURL=react-spring_rafz.modern.mjs.map
;// CONCATENATED MODULE: ../tutor/node_modules/@react-spring/shared/dist/react-spring_shared.modern.mjs
var tu=Object.defineProperty;var tc=(e,t)=>{for(var r in t)tu(e,r,{get:t[r],enumerable:true})};// src/globals.ts
var td={};tc(td,{assign:()=>tC,colors:()=>tk,createStringInterpolator:()=>tx,skipAnimation:()=>tE,to:()=>tA,willAdvance:()=>tI});// src/helpers.ts
function tf(){}var tp=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:true,configurable:true});var th={arr:Array.isArray,obj:e=>!!e&&e.constructor.name==="Object",fun:e=>typeof e==="function",str:e=>typeof e==="string",num:e=>typeof e==="number",und:e=>e===void 0};function tv(e,t){if(th.arr(e)){if(!th.arr(t)||e.length!==t.length)return false;for(let r=0;r<e.length;r++){if(e[r]!==t[r])return false}return true}return e===t}var tg=(e,t)=>e.forEach(t);function tm(e,t,r){if(th.arr(e)){for(let n=0;n<e.length;n++){t.call(r,e[n],`${n}`)}return}for(const n in e){if(e.hasOwnProperty(n)){t.call(r,e[n],n)}}}var tb=e=>th.und(e)?[]:th.arr(e)?e:[e];function ty(e,t){if(e.size){const r=Array.from(e);e.clear();tg(r,t)}}var t_=(e,...t)=>ty(e,e=>e(...t));var tw=()=>typeof window==="undefined"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);// src/globals.ts
var tx;var tA;var tk=null;var tE=false;var tI=tf;var tC=e=>{if(e.to)tA=e.to;if(e.now)e0.now=e.now;if(e.colors!==void 0)tk=e.colors;if(e.skipAnimation!=null)tE=e.skipAnimation;if(e.createStringInterpolator)tx=e.createStringInterpolator;if(e.requestAnimationFrame)e0.use(e.requestAnimationFrame);if(e.batchedUpdates)e0.batchedUpdates=e.batchedUpdates;if(e.willAdvance)tI=e.willAdvance;if(e.frameLoop)e0.frameLoop=e.frameLoop};// src/FrameLoop.ts
var tY=/* @__PURE__ */new Set;var tT=[];var tS=[];var tO=0;var tD={get idle(){return!tY.size&&!tT.length},/** Advance the given animation on every frame until idle. */start(e){if(tO>e.priority){tY.add(e);e0.onStart(tF)}else{tR(e);e0(tM)}},/** Advance all animations by the given time. */advance:tM,/** Call this when an animation's priority changes. */sort(e){if(tO){e0.onFrame(()=>tD.sort(e))}else{const t=tT.indexOf(e);if(~t){tT.splice(t,1);tP(e)}}},/**
   * Clear all animations. For testing purposes.
   *
   * ☠️ Never call this from within the frameloop.
   */clear(){tT=[];tY.clear()}};function tF(){tY.forEach(tR);tY.clear();e0(tM)}function tR(e){if(!tT.includes(e))tP(e)}function tP(e){tT.splice(tH(tT,t=>t.priority>e.priority),0,e)}function tM(e){const t=tS;for(let r=0;r<tT.length;r++){const n=tT[r];tO=n.priority;if(!n.idle){tI(n);n.advance(e);if(!n.idle){t.push(n)}}}tO=0;tS=tT;tS.length=0;tT=t;return tT.length>0}function tH(e,t){const r=e.findIndex(t);return r<0?e.length:r}// src/clamp.ts
var tN=(e,t,r)=>Math.min(Math.max(r,e),t);// src/colors.ts
var tL={transparent:0,aliceblue:0xf0f8ffff,antiquewhite:0xfaebd7ff,aqua:0xffffff,aquamarine:0x7fffd4ff,azure:0xf0ffffff,beige:0xf5f5dcff,bisque:0xffe4c4ff,black:255,blanchedalmond:0xffebcdff,blue:65535,blueviolet:0x8a2be2ff,brown:0xa52a2aff,burlywood:0xdeb887ff,burntsienna:0xea7e5dff,cadetblue:0x5f9ea0ff,chartreuse:0x7fff00ff,chocolate:0xd2691eff,coral:0xff7f50ff,cornflowerblue:0x6495edff,cornsilk:0xfff8dcff,crimson:0xdc143cff,cyan:0xffffff,darkblue:35839,darkcyan:9145343,darkgoldenrod:0xb8860bff,darkgray:0xa9a9a9ff,darkgreen:6553855,darkgrey:0xa9a9a9ff,darkkhaki:0xbdb76bff,darkmagenta:0x8b008bff,darkolivegreen:0x556b2fff,darkorange:0xff8c00ff,darkorchid:0x9932ccff,darkred:0x8b0000ff,darksalmon:0xe9967aff,darkseagreen:0x8fbc8fff,darkslateblue:0x483d8bff,darkslategray:0x2f4f4fff,darkslategrey:0x2f4f4fff,darkturquoise:0xced1ff,darkviolet:0x9400d3ff,deeppink:0xff1493ff,deepskyblue:0xbfffff,dimgray:0x696969ff,dimgrey:0x696969ff,dodgerblue:0x1e90ffff,firebrick:0xb22222ff,floralwhite:0xfffaf0ff,forestgreen:0x228b22ff,fuchsia:0xff00ffff,gainsboro:0xdcdcdcff,ghostwhite:0xf8f8ffff,gold:0xffd700ff,goldenrod:0xdaa520ff,gray:0x808080ff,green:8388863,greenyellow:0xadff2fff,grey:0x808080ff,honeydew:0xf0fff0ff,hotpink:0xff69b4ff,indianred:0xcd5c5cff,indigo:0x4b0082ff,ivory:0xfffff0ff,khaki:0xf0e68cff,lavender:0xe6e6faff,lavenderblush:0xfff0f5ff,lawngreen:0x7cfc00ff,lemonchiffon:0xfffacdff,lightblue:0xadd8e6ff,lightcoral:0xf08080ff,lightcyan:0xe0ffffff,lightgoldenrodyellow:0xfafad2ff,lightgray:0xd3d3d3ff,lightgreen:0x90ee90ff,lightgrey:0xd3d3d3ff,lightpink:0xffb6c1ff,lightsalmon:0xffa07aff,lightseagreen:0x20b2aaff,lightskyblue:0x87cefaff,lightslategray:0x778899ff,lightslategrey:0x778899ff,lightsteelblue:0xb0c4deff,lightyellow:0xffffe0ff,lime:0xff00ff,limegreen:0x32cd32ff,linen:0xfaf0e6ff,magenta:0xff00ffff,maroon:0x800000ff,mediumaquamarine:0x66cdaaff,mediumblue:52735,mediumorchid:0xba55d3ff,mediumpurple:0x9370dbff,mediumseagreen:0x3cb371ff,mediumslateblue:0x7b68eeff,mediumspringgreen:0xfa9aff,mediumturquoise:0x48d1ccff,mediumvioletred:0xc71585ff,midnightblue:0x191970ff,mintcream:0xf5fffaff,mistyrose:0xffe4e1ff,moccasin:0xffe4b5ff,navajowhite:0xffdeadff,navy:33023,oldlace:0xfdf5e6ff,olive:0x808000ff,olivedrab:0x6b8e23ff,orange:0xffa500ff,orangered:0xff4500ff,orchid:0xda70d6ff,palegoldenrod:0xeee8aaff,palegreen:0x98fb98ff,paleturquoise:0xafeeeeff,palevioletred:0xdb7093ff,papayawhip:0xffefd5ff,peachpuff:0xffdab9ff,peru:0xcd853fff,pink:0xffc0cbff,plum:0xdda0ddff,powderblue:0xb0e0e6ff,purple:0x800080ff,rebeccapurple:0x663399ff,red:0xff0000ff,rosybrown:0xbc8f8fff,royalblue:0x4169e1ff,saddlebrown:0x8b4513ff,salmon:0xfa8072ff,sandybrown:0xf4a460ff,seagreen:0x2e8b57ff,seashell:0xfff5eeff,sienna:0xa0522dff,silver:0xc0c0c0ff,skyblue:0x87ceebff,slateblue:0x6a5acdff,slategray:0x708090ff,slategrey:0x708090ff,snow:0xfffafaff,springgreen:0xff7fff,steelblue:0x4682b4ff,tan:0xd2b48cff,teal:8421631,thistle:0xd8bfd8ff,tomato:0xff6347ff,turquoise:0x40e0d0ff,violet:0xee82eeff,wheat:0xf5deb3ff,white:0xffffffff,whitesmoke:0xf5f5f5ff,yellow:0xffff00ff,yellowgreen:0x9acd32ff};// src/colorMatchers.ts
var tK="[-+]?\\d*\\.?\\d+";var tB=tK+"%";function tj(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var tU=new RegExp("rgb"+tj(tK,tK,tK));var tq=new RegExp("rgba"+tj(tK,tK,tK,tK));var tV=new RegExp("hsl"+tj(tK,tB,tB));var tW=new RegExp("hsla"+tj(tK,tB,tB,tK));var tz=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;var tG=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;var tQ=/^#([0-9a-fA-F]{6})$/;var t$=/^#([0-9a-fA-F]{8})$/;// src/normalizeColor.ts
function tX(e){let t;if(typeof e==="number"){return e>>>0===e&&e>=0&&e<=0xffffffff?e:null}if(t=tQ.exec(e))return parseInt(t[1]+"ff",16)>>>0;if(tk&&tk[e]!==void 0){return tk[e]}if(t=tU.exec(e)){return(t0(t[1])<<24|// r
t0(t[2])<<16|// g
t0(t[3])<<8|// b
255)>>>// a
0}if(t=tq.exec(e)){return(t0(t[1])<<24|// r
t0(t[2])<<16|// g
t0(t[3])<<8|// b
t2(t[4]))>>>// a
0}if(t=tz.exec(e)){return parseInt(t[1]+t[1]+// r
t[2]+t[2]+// g
t[3]+t[3]+// b
"ff",// a
16)>>>0}if(t=t$.exec(e))return parseInt(t[1],16)>>>0;if(t=tG.exec(e)){return parseInt(t[1]+t[1]+// r
t[2]+t[2]+// g
t[3]+t[3]+// b
t[4]+t[4],// a
16)>>>0}if(t=tV.exec(e)){return(tZ(t1(t[1]),// h
t6(t[2]),// s
t6(t[3]))|255)>>>// a
0}if(t=tW.exec(e)){return(tZ(t1(t[1]),// h
t6(t[2]),// s
t6(t[3]))|t2(t[4]))>>>// a
0}return null}function tJ(e,t,r){if(r<0)r+=1;if(r>1)r-=1;if(r<1/6)return e+(t-e)*6*r;if(r<1/2)return t;if(r<2/3)return e+(t-e)*(2/3-r)*6;return e}function tZ(e,t,r){const n=r<.5?r*(1+t):r+t-r*t;const i=2*r-n;const a=tJ(i,n,e+1/3);const o=tJ(i,n,e);const s=tJ(i,n,e-1/3);return Math.round(a*255)<<24|Math.round(o*255)<<16|Math.round(s*255)<<8}function t0(e){const t=parseInt(e,10);if(t<0)return 0;if(t>255)return 255;return t}function t1(e){const t=parseFloat(e);return(t%360+360)%360/360}function t2(e){const t=parseFloat(e);if(t<0)return 0;if(t>1)return 255;return Math.round(t*255)}function t6(e){const t=parseFloat(e);if(t<0)return 0;if(t>100)return 1;return t/100}// src/colorToRgba.ts
function t4(e){let t=tX(e);if(t===null)return e;t=t||0;const r=(t&0xff000000)>>>24;const n=(t&0xff0000)>>>16;const i=(t&65280)>>>8;const a=(t&255)/255;return`rgba(${r}, ${n}, ${i}, ${a})`}// src/createInterpolator.ts
var t5=(e,t,r)=>{if(th.fun(e)){return e}if(th.arr(e)){return t5({range:e,output:t,extrapolate:r})}if(th.str(e.output[0])){return tx(e)}const n=e;const i=n.output;const a=n.range||[0,1];const o=n.extrapolateLeft||n.extrapolate||"extend";const s=n.extrapolateRight||n.extrapolate||"extend";const l=n.easing||(e=>e);return e=>{const t=t8(e,a);return t3(e,a[t],a[t+1],i[t],i[t+1],l,o,s,n.map)}};function t3(e,t,r,n,i,a,o,s,l){let u=l?l(e):e;if(u<t){if(o==="identity")return u;else if(o==="clamp")u=t}if(u>r){if(s==="identity")return u;else if(s==="clamp")u=r}if(n===i)return n;if(t===r)return e<=t?n:i;if(t===-Infinity)u=-u;else if(r===Infinity)u=u-t;else u=(u-t)/(r-t);u=a(u);if(n===-Infinity)u=-u;else if(i===Infinity)u=u+n;else u=u*(i-n)+n;return u}function t8(e,t){for(var r=1;r<t.length-1;++r)if(t[r]>=e)break;return r-1}// src/easings.ts
var t9=(e,t="end")=>r=>{r=t==="end"?Math.min(r,.999):Math.max(r,.001);const n=r*e;const i=t==="end"?Math.floor(n):Math.ceil(n);return tN(0,1,i/e)};var t7=1.70158;var re=t7*1.525;var rt=t7+1;var rr=2*Math.PI/3;var rn=2*Math.PI/4.5;var ri=e=>{const t=7.5625;const r=2.75;if(e<1/r){return t*e*e}else if(e<2/r){return t*(e-=1.5/r)*e+.75}else if(e<2.5/r){return t*(e-=2.25/r)*e+.9375}else{return t*(e-=2.625/r)*e+.984375}};var ra={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-Math.pow(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-Math.pow(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>e===0?0:Math.pow(2,10*e-10),easeOutExpo:e=>e===1?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>e===0?0:e===1?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-Math.pow(e,2)),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,easeInBack:e=>rt*e*e*e-t7*e*e,easeOutBack:e=>1+rt*Math.pow(e-1,3)+t7*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*((re+1)*2*e-re)/2:(Math.pow(2*e-2,2)*((re+1)*(e*2-2)+re)+2)/2,easeInElastic:e=>e===0?0:e===1?1:-Math.pow(2,10*e-10)*Math.sin((e*10-10.75)*rr),easeOutElastic:e=>e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e*10-.75)*rr)+1,easeInOutElastic:e=>e===0?0:e===1?1:e<.5?-(Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*rn))/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*rn)/2+1,easeInBounce:e=>1-ri(1-e),easeOutBounce:ri,easeInOutBounce:e=>e<.5?(1-ri(1-2*e))/2:(1+ri(2*e-1))/2,steps:t9};// src/fluids.ts
var ro=Symbol.for("FluidValue.get");var rs=Symbol.for("FluidValue.observers");var rl=e=>Boolean(e&&e[ro]);var ru=e=>e&&e[ro]?e[ro]():e;var rc=e=>e[rs]||null;function rd(e,t){if(e.eventObserved){e.eventObserved(t)}else{e(t)}}function rf(e,t){const r=e[rs];if(r){r.forEach(e=>{rd(e,t)})}}var rp=class{constructor(e){if(!e&&!(e=this.get)){throw Error("Unknown getter")}rh(this,e)}};ro,rs;var rh=(e,t)=>rm(e,ro,t);function rv(e,t){if(e[ro]){let r=e[rs];if(!r){rm(e,rs,r=/* @__PURE__ */new Set)}if(!r.has(t)){r.add(t);if(e.observerAdded){e.observerAdded(r.size,t)}}}return t}function rg(e,t){const r=e[rs];if(r&&r.has(t)){const n=r.size-1;if(n){r.delete(t)}else{e[rs]=null}if(e.observerRemoved){e.observerRemoved(n,t)}}}var rm=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:true,configurable:true});// src/regexs.ts
var rb=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g;var ry=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi;var r_=new RegExp(`(${rb.source})(%|[a-z]+)`,"i");var rw=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi;var rx=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;// src/variableToRgba.ts
var rA=e=>{const[t,r]=rk(e);if(!t||tw()){return e}const n=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(n){return n.trim()}else if(r&&r.startsWith("--")){const t=window.getComputedStyle(document.documentElement).getPropertyValue(r);if(t){return t}else{return e}}else if(r&&rx.test(r)){return rA(r)}else if(r){return r}return e};var rk=e=>{const t=rx.exec(e);if(!t)return[,];const[,r,n]=t;return[r,n]};// src/stringInterpolation.ts
var rE;var rI=(e,t,r,n,i)=>`rgba(${Math.round(t)}, ${Math.round(r)}, ${Math.round(n)}, ${i})`;var rC=e=>{if(!rE)rE=tk?// match color names, ignore partial matches
new RegExp(`(${Object.keys(tk).join("|")})(?!\\w)`,"g"):// never match
/^\b$/;const t=e.output.map(e=>{return ru(e).replace(rx,rA).replace(ry,t4).replace(rE,t4)});const r=t.map(e=>e.match(rb).map(Number));const n=r[0].map((e,t)=>r.map(e=>{if(!(t in e)){throw Error('The arity of each "output" value must be equal')}return e[t]}));const i=n.map(t=>t5({...e,output:t}));return e=>{const r=!r_.test(t[0])&&t.find(e=>r_.test(e))?.replace(rb,"");let n=0;return t[0].replace(rb,()=>`${i[n++](e)}${r||""}`).replace(rw,rI)}};// src/deprecations.ts
var rY="react-spring: ";var rT=e=>{const t=e;let r=false;if(typeof t!="function"){throw new TypeError(`${rY}once requires a function parameter`)}return(...e)=>{if(!r){t(...e);r=true}}};var rS=rT(console.warn);function rO(){rS(`${rY}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var rD=rT(console.warn);function rF(){rD(`${rY}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}// src/isAnimatedString.ts
function rR(e){return th.str(e)&&(e[0]=="#"||/\d/.test(e)||// Do not identify a CSS variable as an AnimatedString if its SSR
!tw()&&rx.test(e)||e in(tk||{}))}// src/dom-events/scroll/index.ts
// src/dom-events/resize/resizeElement.ts
var rP;var rM=/* @__PURE__ */new WeakMap;var rH=e=>e.forEach(({target:e,contentRect:t})=>{return rM.get(e)?.forEach(e=>e(t))});function rN(e,t){if(!rP){if(typeof ResizeObserver!=="undefined"){rP=new ResizeObserver(rH)}}let r=rM.get(t);if(!r){r=/* @__PURE__ */new Set;rM.set(t,r)}r.add(e);if(rP){rP.observe(t)}return()=>{const r=rM.get(t);if(!r)return;r.delete(e);if(!r.size&&rP){rP.unobserve(t)}}}// src/dom-events/resize/resizeWindow.ts
var rL=/* @__PURE__ */new Set;var rK;var rB=()=>{const e=()=>{rL.forEach(e=>e({width:window.innerWidth,height:window.innerHeight}))};window.addEventListener("resize",e);return()=>{window.removeEventListener("resize",e)}};var rj=e=>{rL.add(e);if(!rK){rK=rB()}return()=>{rL.delete(e);if(!rL.size&&rK){rK();rK=void 0}}};// src/dom-events/resize/index.ts
var rU=(e,{container:t=document.documentElement}={})=>{if(t===document.documentElement){return rj(e)}else{return rN(e,t)}};// src/progress.ts
var rq=(e,t,r)=>t-e===0?1:(r-e)/(t-e);// src/dom-events/scroll/ScrollHandler.ts
var rV=/* unused pure expression or super */null&&{x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};var rW=class{constructor(e,t){this.createAxis=()=>({current:0,progress:0,scrollLength:0});this.updateAxis=e=>{const t=this.info[e];const{length:r,position:n}=rV[e];t.current=this.container[`scroll${n}`];t.scrollLength=this.container[`scroll${r}`]-this.container[`client${r}`];t.progress=rq(0,t.scrollLength,t.current)};this.update=()=>{this.updateAxis("x");this.updateAxis("y")};this.sendEvent=()=>{this.callback(this.info)};this.advance=()=>{this.update();this.sendEvent()};this.callback=e;this.container=t;this.info={time:0,x:this.createAxis(),y:this.createAxis()}}};// src/dom-events/scroll/index.ts
var rz=/* @__PURE__ */new WeakMap;var rG=/* @__PURE__ */new WeakMap;var rQ=/* @__PURE__ */new WeakMap;var r$=e=>e===document.documentElement?window:e;var rX=(e,{container:t=document.documentElement}={})=>{let r=rQ.get(t);if(!r){r=/* @__PURE__ */new Set;rQ.set(t,r)}const n=new rW(e,t);r.add(n);if(!rz.has(t)){const e=()=>{r?.forEach(e=>e.advance());return true};rz.set(t,e);const n=r$(t);window.addEventListener("resize",e,{passive:true});if(t!==document.documentElement){rG.set(t,rU(e,{container:t}))}n.addEventListener("scroll",e,{passive:true})}const i=rz.get(t);raf3(i);return()=>{raf3.cancel(i);const e=rQ.get(t);if(!e)return;e.delete(n);if(e.size)return;const r=rz.get(t);rz.delete(t);if(r){r$(t).removeEventListener("scroll",r);window.removeEventListener("resize",r);rG.get(t)?.()}}};// src/hooks/useConstant.ts
function rJ(e){const t=useRef(null);if(t.current===null){t.current=e()}return t.current}// src/hooks/useForceUpdate.ts
// src/hooks/useIsMounted.ts
// src/hooks/useIsomorphicLayoutEffect.ts
var rZ=tw()?n.useEffect:n.useLayoutEffect;// src/hooks/useIsMounted.ts
var r0=()=>{const e=(0,n.useRef)(false);rZ(()=>{e.current=true;return()=>{e.current=false}},[]);return e};// src/hooks/useForceUpdate.ts
function r1(){const e=(0,n.useState)()[1];const t=r0();return()=>{if(t.current){e(Math.random())}}}// src/hooks/useMemoOne.ts
function r2(e,t){const[r]=(0,n.useState)(()=>({inputs:t,result:e()}));const i=(0,n.useRef)();const a=i.current;let o=a;if(o){const r=Boolean(t&&o.inputs&&r6(t,o.inputs));if(!r){o={inputs:t,result:e()}}}else{o=r}(0,n.useEffect)(()=>{i.current=o;if(a==r){r.inputs=r.result=void 0}},[o]);return o.result}function r6(e,t){if(e.length!==t.length){return false}for(let r=0;r<e.length;r++){if(e[r]!==t[r]){return false}}return true}// src/hooks/useOnce.ts
var r4=e=>(0,n.useEffect)(e,r5);var r5=[];// src/hooks/usePrev.ts
function r3(e){const t=(0,n.useRef)();(0,n.useEffect)(()=>{t.current=e});return t.current}// src/hooks/useReducedMotion.ts
var r8=()=>{const[e,t]=useState3(null);rZ(()=>{const e=window.matchMedia("(prefers-reduced-motion)");const r=e=>{t(e.matches);tC({skipAnimation:e.matches})};r(e);if(e.addEventListener){e.addEventListener("change",r)}else{e.addListener(r)}return()=>{if(e.removeEventListener){e.removeEventListener("change",r)}else{e.removeListener(r)}}},[]);return e};// src/index.ts
//# sourceMappingURL=react-spring_shared.modern.mjs.map
;// CONCATENATED MODULE: ../tutor/node_modules/@react-spring/animated/dist/react-spring_animated.modern.mjs
// src/Animated.ts
var r9=Symbol.for("Animated:node");var r7=e=>!!e&&e[r9]===e;var ne=e=>e&&e[r9];var nt=(e,t)=>tp(e,r9,t);var nr=e=>e&&e[r9]&&e[r9].getPayload();var nn=class{constructor(){nt(this,this)}/** Get every `AnimatedValue` used by this node. */getPayload(){return this.payload||[]}};// src/AnimatedValue.ts
var ni=class extends nn{constructor(e){super();this._value=e;this.done=true;this.durationProgress=0;if(th.num(this._value)){this.lastPosition=this._value}}/** @internal */static create(e){return new ni(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){if(th.num(e)){this.lastPosition=e;if(t){e=Math.round(e/t)*t;if(this.done){this.lastPosition=e}}}if(this._value===e){return false}this._value=e;return true}reset(){const{done:e}=this;this.done=false;if(th.num(this._value)){this.elapsedTime=0;this.durationProgress=0;this.lastPosition=this._value;if(e)this.lastVelocity=null;this.v0=null}}};// src/AnimatedString.ts
var na=class extends ni{constructor(e){super(0);this._string=null;this._toString=t5({output:[e,e]})}/** @internal */static create(e){return new na(e)}getValue(){const e=this._string;return e==null?this._string=this._toString(this._value):e}setValue(e){if(th.str(e)){if(e==this._string){return false}this._string=e;this._value=1}else if(super.setValue(e)){this._string=null}else{return false}return true}reset(e){if(e){this._toString=t5({output:[this.getValue(),e]})}this._value=0;super.reset()}};// src/AnimatedArray.ts
// src/AnimatedObject.ts
// src/context.ts
var no={dependencies:null};// src/AnimatedObject.ts
var ns=class extends nn{constructor(e){super();this.source=e;this.setValue(e)}getValue(e){const t={};tm(this.source,(r,n)=>{if(r7(r)){t[n]=r.getValue(e)}else if(rl(r)){t[n]=ru(r)}else if(!e){t[n]=r}});return t}/** Replace the raw object data */setValue(e){this.source=e;this.payload=this._makePayload(e)}reset(){if(this.payload){tg(this.payload,e=>e.reset())}}/** Create a payload set. */_makePayload(e){if(e){const t=/* @__PURE__ */new Set;tm(e,this._addToPayload,t);return Array.from(t)}}/** Add to a payload set. */_addToPayload(e){if(no.dependencies&&rl(e)){no.dependencies.add(e)}const t=nr(e);if(t){tg(t,e=>this.add(e))}}};// src/AnimatedArray.ts
var nl=class extends ns{constructor(e){super(e)}/** @internal */static create(e){return new nl(e)}getValue(){return this.source.map(e=>e.getValue())}setValue(e){const t=this.getPayload();if(e.length==t.length){return t.map((t,r)=>t.setValue(e[r])).some(Boolean)}super.setValue(e.map(nu));return true}};function nu(e){const t=rR(e)?na:ni;return t.create(e)}// src/getAnimatedType.ts
function nc(e){const t=ne(e);return t?t.constructor:th.arr(e)?nl:rR(e)?na:ni}// src/createHost.ts
// src/withAnimated.tsx
var nd=(e,t)=>{const r=// Function components must use "forwardRef" to avoid being
// re-rendered on every animation frame.
!th.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,n.forwardRef)((i,a)=>{const o=(0,n.useRef)(null);const s=r&&// eslint-disable-next-line react-hooks/rules-of-hooks
(0,n.useCallback)(e=>{o.current=nh(a,e)},[a]);const[l,u]=np(i,t);const c=r1();const d=()=>{const e=o.current;if(r&&!e){return}const n=e?t.applyAnimatedValues(e,l.getValue(true)):false;if(n===false){c()}};const f=new nf(d,u);const p=(0,n.useRef)();rZ(()=>{p.current=f;tg(u,e=>rv(e,f));return()=>{if(p.current){tg(p.current.deps,e=>rg(e,p.current));e0.cancel(p.current.update)}}});(0,n.useEffect)(d,[]);r4(()=>()=>{const e=p.current;tg(e.deps,t=>rg(t,e))});const h=t.getComponentProps(l.getValue());return /* @__PURE__ */n.createElement(e,{...h,ref:s})})};var nf=class{constructor(e,t){this.update=e;this.deps=t}eventObserved(e){if(e.type=="change"){e0.write(this.update)}}};function np(e,t){const r=/* @__PURE__ */new Set;no.dependencies=r;if(e.style)e={...e,style:t.createAnimatedStyle(e.style)};e=new ns(e);no.dependencies=null;return[e,r]}function nh(e,t){if(e){if(th.fun(e))e(t);else e.current=t}return t}// src/createHost.ts
var nv=Symbol.for("AnimatedComponent");var ng=(e,{applyAnimatedValues:t=()=>false,createAnimatedStyle:r=e=>new ns(e),getComponentProps:n=e=>e}={})=>{const i={applyAnimatedValues:t,createAnimatedStyle:r,getComponentProps:n};const a=e=>{const t=nm(e)||"Anonymous";if(th.str(e)){e=a[e]||(a[e]=nd(e,i))}else{e=e[nv]||(e[nv]=nd(e,i))}e.displayName=`Animated(${t})`;return e};tm(e,(t,r)=>{if(th.arr(e)){r=nm(t)}a[r]=a(t)});return{animated:a}};var nm=e=>th.str(e)?e:e&&th.str(e.displayName)?e.displayName:th.fun(e)&&e.name||null;//# sourceMappingURL=react-spring_animated.modern.mjs.map
;// CONCATENATED MODULE: ../tutor/node_modules/@react-spring/core/dist/react-spring_core.modern.mjs
// src/hooks/useChain.ts
// src/helpers.ts
function nb(e,...t){return th.fun(e)?e(...t):e}var ny=(e,t)=>e===true||!!(t&&e&&(th.fun(e)?e(t):tb(e).includes(t)));var n_=(e,t)=>th.obj(e)?t&&e[t]:e;var nw=(e,t)=>e.default===true?e[t]:e.default?e.default[t]:void 0;var nx=e=>e;var nA=(e,t=nx)=>{let r=nk;if(e.default&&e.default!==true){e=e.default;r=Object.keys(e)}const n={};for(const i of r){const r=t(e[i],i);if(!th.und(r)){n[i]=r}}return n};var nk=["config","onProps","onStart","onChange","onPause","onResume","onRest"];var nE={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,// Transition props
items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,// Internal props
keys:1,callId:1,parentId:1};function nI(e){const t={};let r=0;tm(e,(e,n)=>{if(!nE[n]){t[n]=e;r++}});if(r){return t}}function nC(e){const t=nI(e);if(t){const r={to:t};tm(e,(e,n)=>n in t||(r[n]=e));return r}return{...e}}function nY(e){e=ru(e);return th.arr(e)?e.map(nY):rR(e)?td.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function nT(e){for(const t in e)return true;return false}function nS(e){return th.fun(e)||th.arr(e)&&th.obj(e[0])}function nO(e,t){e.ref?.delete(e);t?.delete(e)}function nD(e,t){if(t&&e.ref!==t){e.ref?.delete(e);t.add(e);e.ref=t}}// src/hooks/useChain.ts
function nF(e,t,r=1e3){useIsomorphicLayoutEffect(()=>{if(t){let n=0;each(e,(e,i)=>{const a=e.current;if(a.length){let o=r*t[i];if(isNaN(o))o=n;else n=o;each(a,e=>{each(e.queue,e=>{const t=e.delay;e.delay=e=>o+nb(t||0,e)})});e.start()}})}else{let t=Promise.resolve();each(e,e=>{const r=e.current;if(r.length){const n=r.map(e=>{const t=e.queue;e.queue=[];return t});t=t.then(()=>{each(r,(e,t)=>each(n[t]||[],t=>e.queue.push(t)));return Promise.all(e.start())})}})}})}// src/hooks/useSpring.ts
// src/hooks/useSprings.ts
// src/SpringValue.ts
// src/AnimationConfig.ts
// src/constants.ts
var nR={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}};// src/AnimationConfig.ts
var nP={...nR.default,mass:1,damping:1,easing:ra.linear,clamp:false};var nM=class{constructor(){/**
     * The initial velocity of one or more values.
     *
     * @default 0
     */this.velocity=0;Object.assign(this,nP)}};function nH(e,t,r){if(r){r={...r};nN(r,t);t={...r,...t}}nN(e,t);Object.assign(e,t);for(const t in nP){if(e[t]==null){e[t]=nP[t]}}let{frequency:n,damping:i}=e;const{mass:a}=e;if(!th.und(n)){if(n<.01)n=.01;if(i<0)i=0;e.tension=Math.pow(2*Math.PI/n,2)*a;e.friction=4*Math.PI*i*a/n}return e}function nN(e,t){if(!th.und(t.decay)){e.duration=void 0}else{const r=!th.und(t.tension)||!th.und(t.friction);if(r||!th.und(t.frequency)||!th.und(t.damping)||!th.und(t.mass)){e.duration=void 0;e.decay=void 0}if(r){e.frequency=void 0}}}// src/Animation.ts
var nL=[];var nK=class{constructor(){this.changed=false;this.values=nL;this.toValues=null;this.fromValues=nL;this.config=new nM;this.immediate=false}};// src/scheduleProps.ts
function nB(e,{key:t,props:r,defaultProps:n,state:i,actions:a}){return new Promise((o,s)=>{let l;let u;let c=ny(r.cancel??n?.cancel,t);if(c){p()}else{if(!th.und(r.pause)){i.paused=ny(r.pause,t)}let e=n?.pause;if(e!==true){e=i.paused||ny(e,t)}l=nb(r.delay||0,t);if(e){i.resumeQueue.add(f);a.pause()}else{a.resume();f()}}function d(){i.resumeQueue.add(f);i.timeouts.delete(u);u.cancel();l=u.time-e0.now()}function f(){if(l>0&&!td.skipAnimation){i.delayed=true;u=e0.setTimeout(p,l);i.pauseQueue.add(d);i.timeouts.add(u)}else{p()}}function p(){if(i.delayed){i.delayed=false}i.pauseQueue.delete(d);i.timeouts.delete(u);if(e<=(i.cancelId||0)){c=true}try{a.start({...r,callId:e,cancel:c},o)}catch(e){s(e)}}})}// src/runAsync.ts
// src/AnimationResult.ts
var nj=(e,t)=>t.length==1?t[0]:t.some(e=>e.cancelled)?nV(e.get()):t.every(e=>e.noop)?nU(e.get()):nq(e.get(),t.every(e=>e.finished));var nU=e=>({value:e,noop:true,finished:true,cancelled:false});var nq=(e,t,r=false)=>({value:e,finished:t,cancelled:r});var nV=e=>({value:e,cancelled:true,finished:false});// src/runAsync.ts
function nW(e,t,r,n){const{callId:i,parentId:a,onRest:o}=t;const{asyncTo:s,promise:l}=r;if(!a&&e===s&&!t.reset){return l}return r.promise=(async()=>{r.asyncId=i;r.asyncTo=e;const u=nA(t,(e,t)=>// The `onRest` prop is only called when the `runAsync` promise is resolved.
    t==="onRest"?void 0:e);let c;let d;const f=new Promise((e,t)=>(c=e,d=t));const p=e=>{const t=// The `cancel` prop or `stop` method was used.
i<=(r.cancelId||0)&&nV(n)||// The async `to` prop was replaced.
i!==r.asyncId&&nq(n,false);if(t){e.result=t;d(e);throw e}};const h=(e,t)=>{const a=new nG;const o=new nQ;return(async()=>{if(td.skipAnimation){nz(r);o.result=nq(n,false);d(o);throw o}p(a);const s=th.obj(e)?{...e}:{...t,to:e};s.parentId=i;tm(u,(e,t)=>{if(th.und(s[t])){s[t]=e}});const l=await n.start(s);p(a);if(r.paused){await new Promise(e=>{r.resumeQueue.add(e)})}return l})()};let v;if(td.skipAnimation){nz(r);return nq(n,false)}try{let t;if(th.arr(e)){t=(async e=>{for(const t of e){await h(t)}})(e)}else{t=Promise.resolve(e(h,n.stop.bind(n)))}await Promise.all([t.then(c),f]);v=nq(n.get(),true,false)}catch(e){if(e instanceof nG){v=e.result}else if(e instanceof nQ){v=e.result}else{throw e}}finally{if(i==r.asyncId){r.asyncId=a;r.asyncTo=a?s:void 0;r.promise=a?l:void 0}}if(th.fun(o)){e0.batchedUpdates(()=>{o(v,n,n.item)})}return v})()}function nz(e,t){ty(e.timeouts,e=>e.cancel());e.pauseQueue.clear();e.resumeQueue.clear();e.asyncId=e.asyncTo=e.promise=void 0;if(t)e.cancelId=t}var nG=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}};var nQ=class extends Error{constructor(){super("SkipAnimationSignal")}};// src/FrameValue.ts
var n$=e=>e instanceof nJ;var nX=1;var nJ=class extends rp{constructor(){super(...arguments);this.id=nX++;this._priority=0}get priority(){return this._priority}set priority(e){if(this._priority!=e){this._priority=e;this._onPriorityChange(e)}}/** Get the current value */get(){const e=ne(this);return e&&e.getValue()}/** Create a spring that maps our value to another value */to(...e){return td.to(this,e)}/** @deprecated Use the `to` method instead. */interpolate(...e){rO();return td.to(this,e)}toJSON(){return this.get()}observerAdded(e){if(e==1)this._attach()}observerRemoved(e){if(e==0)this._detach()}/** Called when the first child is added. */_attach(){}/** Called when the last child is removed. */_detach(){}/** Tell our children about our new value */_onChange(e,t=false){rf(this,{type:"change",parent:this,value:e,idle:t})}/** Tell our children about our new priority */_onPriorityChange(e){if(!this.idle){tD.sort(this)}rf(this,{type:"priority",parent:this,priority:e})}};// src/SpringPhase.ts
var nZ=Symbol.for("SpringPhase");var n0=1;var n1=2;var n2=4;var n6=e=>(e[nZ]&n0)>0;var n4=e=>(e[nZ]&n1)>0;var n5=e=>(e[nZ]&n2)>0;var n3=(e,t)=>t?e[nZ]|=n1|n0:e[nZ]&=~n1;var n8=(e,t)=>t?e[nZ]|=n2:e[nZ]&=~n2;// src/SpringValue.ts
var n9=class extends nJ{constructor(e,t){super();/** The animation state */this.animation=new nK;/** Some props have customizable default values */this.defaultProps={};/** The state for `runAsync` calls */this._state={paused:false,delayed:false,pauseQueue:/* @__PURE__ */new Set,resumeQueue:/* @__PURE__ */new Set,timeouts:/* @__PURE__ */new Set};/** The promise resolvers of pending `start` calls */this._pendingCalls=/* @__PURE__ */new Set;/** The counter for tracking `scheduleProps` calls */this._lastCallId=0;/** The last `scheduleProps` call that changed the `to` prop */this._lastToId=0;this._memoizedDuration=0;if(!th.und(e)||!th.und(t)){const r=th.obj(e)?{...e}:{...t,from:e};if(th.und(r.default)){r.default=true}this.start(r)}}/** Equals true when not advancing on each frame. */get idle(){return!(n4(this)||this._state.asyncTo)||n5(this)}get goal(){return ru(this.animation.to)}get velocity(){const e=ne(this);return e instanceof ni?e.lastVelocity||0:e.getPayload().map(e=>e.lastVelocity||0)}/**
   * When true, this value has been animated at least once.
   */get hasAnimated(){return n6(this)}/**
   * When true, this value has an unfinished animation,
   * which is either active or paused.
   */get isAnimating(){return n4(this)}/**
   * When true, all current and future animations are paused.
   */get isPaused(){return n5(this)}/**
   *
   *
   */get isDelayed(){return this._state.delayed}/** Advance the current animation by a number of milliseconds */advance(e){let t=true;let r=false;const n=this.animation;let{toValues:i}=n;const{config:a}=n;const o=nr(n.to);if(!o&&rl(n.to)){i=tb(ru(n.to))}n.values.forEach((s,l)=>{if(s.done)return;const u=// Animated strings always go from 0 to 1.
s.constructor==na?1:o?o[l].lastPosition:i[l];let c=n.immediate;let d=u;if(!c){d=s.lastPosition;if(a.tension<=0){s.done=true;return}let t=s.elapsedTime+=e;const r=n.fromValues[l];const i=s.v0!=null?s.v0:s.v0=th.arr(a.velocity)?a.velocity[l]:a.velocity;let o;const f=a.precision||(r==u?.005:Math.min(1,Math.abs(u-r)*.001));if(!th.und(a.duration)){let n=1;if(a.duration>0){if(this._memoizedDuration!==a.duration){this._memoizedDuration=a.duration;if(s.durationProgress>0){s.elapsedTime=a.duration*s.durationProgress;t=s.elapsedTime+=e}}n=(a.progress||0)+t/this._memoizedDuration;n=n>1?1:n<0?0:n;s.durationProgress=n}d=r+a.easing(n)*(u-r);o=(d-s.lastPosition)/e;c=n==1}else if(a.decay){const e=a.decay===true?.998:a.decay;const n=Math.exp(-(1-e)*t);d=r+i/(1-e)*(1-n);c=Math.abs(s.lastPosition-d)<=f;o=i*n}else{o=s.lastVelocity==null?i:s.lastVelocity;const t=a.restVelocity||f/10;const n=a.clamp?0:a.bounce;const l=!th.und(n);const p=r==u?s.v0>0:r<u;let h;let v=false;const g=1;const m=Math.ceil(e/g);for(let e=0;e<m;++e){h=Math.abs(o)>t;if(!h){c=Math.abs(u-d)<=f;if(c){break}}if(l){v=d==u||d>u==p;if(v){o=-o*n;d=u}}const e=-a.tension*1e-6*(d-u);const r=-a.friction*.001*o;const i=(e+r)/a.mass;o=o+i*g;d=d+o*g}}s.lastVelocity=o;if(Number.isNaN(d)){console.warn(`Got NaN while animating:`,this);c=true}}if(o&&!o[l].done){c=false}if(c){s.done=true}else{t=false}if(s.setValue(d,a.round)){r=true}});const s=ne(this);const l=s.getValue();if(t){const e=ru(n.to);if((l!==e||r)&&!a.decay){s.setValue(e);this._onChange(e)}else if(r&&a.decay){this._onChange(l)}this._stop()}else if(r){this._onChange(l)}}/** Set the current value, while stopping the current animation */set(e){e0.batchedUpdates(()=>{this._stop();this._focus(e);this._set(e)});return this}/**
   * Freeze the active animation in time, as well as any updates merged
   * before `resume` is called.
   */pause(){this._update({pause:true})}/** Resume the animation if paused. */resume(){this._update({pause:false})}/** Skip to the end of the current animation. */finish(){if(n4(this)){const{to:e,config:t}=this.animation;e0.batchedUpdates(()=>{this._onStart();if(!t.decay){this._set(e,false)}this._stop()})}return this}/** Push props into the pending queue. */update(e){const t=this.queue||(this.queue=[]);t.push(e);return this}start(e,t){let r;if(!th.und(e)){r=[th.obj(e)?e:{...t,to:e}]}else{r=this.queue||[];this.queue=[]}return Promise.all(r.map(e=>{const t=this._update(e);return t})).then(e=>nj(this,e))}/**
   * Stop the current animation, and cancel any delayed updates.
   *
   * Pass `true` to call `onRest` with `cancelled: true`.
   */stop(e){const{to:t}=this.animation;this._focus(this.get());nz(this._state,e&&this._lastCallId);e0.batchedUpdates(()=>this._stop(t,e));return this}/** Restart the animation. */reset(){this._update({reset:true})}/** @internal */eventObserved(e){if(e.type=="change"){this._start()}else if(e.type=="priority"){this.priority=e.priority+1}}/**
   * Parse the `to` and `from` range from the given `props` object.
   *
   * This also ensures the initial value is available to animated components
   * during the render phase.
   */_prepareNode(e){const t=this.key||"";let{to:r,from:n}=e;r=th.obj(r)?r[t]:r;if(r==null||nS(r)){r=void 0}n=th.obj(n)?n[t]:n;if(n==null){n=void 0}const i={to:r,from:n};if(!n6(this)){if(e.reverse)[r,n]=[n,r];n=ru(n);if(!th.und(n)){this._set(n)}else if(!ne(this)){this._set(r)}}return i}/** Every update is processed by this method before merging. */_update({...e},t){const{key:r,defaultProps:n}=this;if(e.default)Object.assign(n,nA(e,(e,t)=>/^on/.test(t)?n_(e,r):e));io(this,e,"onProps");is(this,"onProps",e,this);const i=this._prepareNode(e);if(Object.isFrozen(this)){throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?")}const a=this._state;return nB(++this._lastCallId,{key:r,props:e,defaultProps:n,state:a,actions:{pause:()=>{if(!n5(this)){n8(this,true);t_(a.pauseQueue);is(this,"onPause",nq(this,n7(this,this.animation.to)),this)}},resume:()=>{if(n5(this)){n8(this,false);if(n4(this)){this._resume()}t_(a.resumeQueue);is(this,"onResume",nq(this,n7(this,this.animation.to)),this)}},start:this._merge.bind(this,i)}}).then(r=>{if(e.loop&&r.finished&&!(t&&r.noop)){const t=ie(e);if(t){return this._update(t,true)}}return r})}/** Merge props into the current animation */_merge(e,t,r){if(t.cancel){this.stop(true);return r(nV(this))}const n=!th.und(e.to);const i=!th.und(e.from);if(n||i){if(t.callId>this._lastToId){this._lastToId=t.callId}else{return r(nV(this))}}const{key:a,defaultProps:o,animation:s}=this;const{to:l,from:u}=s;let{to:c=l,from:d=u}=e;if(i&&!n&&(!t.default||th.und(c))){c=d}if(t.reverse)[c,d]=[d,c];const f=!tv(d,u);if(f){s.from=d}d=ru(d);const p=!tv(c,l);if(p){this._focus(c)}const h=nS(t.to);const{config:v}=s;const{decay:g,velocity:m}=v;if(n||i){v.velocity=0}if(t.config&&!h){nH(v,nb(t.config,a),// Avoid calling the same "config" prop twice.
t.config!==o.config?nb(o.config,a):void 0)}let b=ne(this);if(!b||th.und(c)){return r(nq(this,true))}const y=// When `reset` is undefined, the `from` prop implies `reset: true`,
// except for declarative updates. When `reset` is defined, there
// must exist a value to animate from.
th.und(t.reset)?i&&!t.default:!th.und(d)&&ny(t.reset,a);const _=y?d:this.get();const w=nY(c);const x=th.num(w)||th.arr(w)||rR(w);const A=!h&&(!x||ny(o.immediate||t.immediate,a));if(p){const e=nc(c);if(e!==b.constructor){if(A){b=this._set(w)}else throw Error(`Cannot animate between ${b.constructor.name} and ${e.name}, as the "to" prop suggests`)}}const k=b.constructor;let E=rl(c);let I=false;if(!E){const e=y||!n6(this)&&f;if(p||e){I=tv(nY(_),w);E=!I}if(!tv(s.immediate,A)&&!A||!tv(v.decay,g)||!tv(v.velocity,m)){E=true}}if(I&&n4(this)){if(s.changed&&!y){E=true}else if(!E){this._stop(l)}}if(!h){if(E||rl(l)){s.values=b.getPayload();s.toValues=rl(c)?null:k==na?[1]:tb(w)}if(s.immediate!=A){s.immediate=A;if(!A&&!y){this._set(l)}}if(E){const{onRest:e}=s;tg(ia,e=>io(this,t,e));const n=nq(this,n7(this,l));t_(this._pendingCalls,n);this._pendingCalls.add(r);if(s.changed)e0.batchedUpdates(()=>{s.changed=!y;e?.(n,this);if(y){nb(o.onRest,n)}else{s.onStart?.(n,this)}})}}if(y){this._set(_)}if(h){r(nW(t.to,t,this._state,this))}else if(E){this._start()}else if(n4(this)&&!p){this._pendingCalls.add(r)}else{r(nU(_))}}/** Update the `animation.to` value, which might be a `FluidValue` */_focus(e){const t=this.animation;if(e!==t.to){if(rc(this)){this._detach()}t.to=e;if(rc(this)){this._attach()}}}_attach(){let e=0;const{to:t}=this.animation;if(rl(t)){rv(t,this);if(n$(t)){e=t.priority+1}}this.priority=e}_detach(){const{to:e}=this.animation;if(rl(e)){rg(e,this)}}/**
   * Update the current value from outside the frameloop,
   * and return the `Animated` node.
   */_set(e,t=true){const r=ru(e);if(!th.und(r)){const e=ne(this);if(!e||!tv(r,e.getValue())){const n=nc(r);if(!e||e.constructor!=n){nt(this,n.create(r))}else{e.setValue(r)}if(e){e0.batchedUpdates(()=>{this._onChange(r,t)})}}}return ne(this)}_onStart(){const e=this.animation;if(!e.changed){e.changed=true;is(this,"onStart",nq(this,n7(this,e.to)),this)}}_onChange(e,t){if(!t){this._onStart();nb(this.animation.onChange,e,this)}nb(this.defaultProps.onChange,e,this);super._onChange(e,t)}// This method resets the animation state (even if already animating) to
// ensure the latest from/to range is used, and it also ensures this spring
// is added to the frameloop.
_start(){const e=this.animation;ne(this).reset(ru(e.to));if(!e.immediate){e.fromValues=e.values.map(e=>e.lastPosition)}if(!n4(this)){n3(this,true);if(!n5(this)){this._resume()}}}_resume(){if(td.skipAnimation){this.finish()}else{tD.start(this)}}/**
   * Exit the frameloop and notify `onRest` listeners.
   *
   * Always wrap `_stop` calls with `batchedUpdates`.
   */_stop(e,t){if(n4(this)){n3(this,false);const r=this.animation;tg(r.values,e=>{e.done=true});if(r.toValues){r.onChange=r.onPause=r.onResume=void 0}rf(this,{type:"idle",parent:this});const n=t?nV(this.get()):nq(this.get(),n7(this,e??r.to));t_(this._pendingCalls,n);if(r.changed){r.changed=false;is(this,"onRest",n,this)}}}};function n7(e,t){const r=nY(t);const n=nY(e.get());return tv(n,r)}function ie(e,t=e.loop,r=e.to){const n=nb(t);if(n){const i=n!==true&&nC(n);const a=(i||e).reverse;const o=!i||i.reset;return it({...e,loop:t,// Avoid updating default props when looping.
default:false,// Never loop the `pause` prop.
pause:void 0,// For the "reverse" prop to loop as expected, the "to" prop
// must be undefined. The "reverse" prop is ignored when the
// "to" prop is an array or function.
to:!a||nS(r)?r:void 0,// Ignore the "from" prop except on reset.
from:o?e.from:void 0,reset:o,// The "loop" prop can return a "useSpring" props object to
// override any of the original props.
...i})}}function it(e){const{to:t,from:r}=e=nC(e);const n=/* @__PURE__ */new Set;if(th.obj(t))ii(t,n);if(th.obj(r))ii(r,n);e.keys=n.size?Array.from(n):null;return e}function ir(e){const t=it(e);if(th.und(t.default)){t.default=nA(t)}return t}function ii(e,t){tm(e,(e,r)=>e!=null&&t.add(r))}var ia=["onStart","onRest","onChange","onPause","onResume"];function io(e,t,r){e.animation[r]=t[r]!==nw(t,r)?n_(t[r],e.key):void 0}function is(e,t,...r){e.animation[t]?.(...r);e.defaultProps[t]?.(...r)}// src/Controller.ts
var il=["onStart","onChange","onRest"];var iu=1;var ic=class{constructor(e,t){this.id=iu++;/** The animated values */this.springs={};/** The queue of props passed to the `update` method. */this.queue=[];/** The counter for tracking `scheduleProps` calls */this._lastAsyncId=0;/** The values currently being animated */this._active=/* @__PURE__ */new Set;/** The values that changed recently */this._changed=/* @__PURE__ */new Set;/** Equals false when `onStart` listeners can be called */this._started=false;/** State used by the `runAsync` function */this._state={paused:false,pauseQueue:/* @__PURE__ */new Set,resumeQueue:/* @__PURE__ */new Set,timeouts:/* @__PURE__ */new Set};/** The event queues that are flushed once per frame maximum */this._events={onStart:/* @__PURE__ */new Map,onChange:/* @__PURE__ */new Map,onRest:/* @__PURE__ */new Map};this._onFrame=this._onFrame.bind(this);if(t){this._flush=t}if(e){this.start({default:true,...e})}}/**
   * Equals `true` when no spring values are in the frameloop, and
   * no async animation is currently active.
   */get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>{return e.idle&&!e.isDelayed&&!e.isPaused})}get item(){return this._item}set item(e){this._item=e}/** Get the current values of our springs */get(){const e={};this.each((t,r)=>e[r]=t.get());return e}/** Set the current values without animating. */set(e){for(const t in e){const r=e[t];if(!th.und(r)){this.springs[t].set(r)}}}/** Push an update onto the queue of each value. */update(e){if(e){this.queue.push(it(e))}return this}/**
   * Start the queued animations for every spring, and resolve the returned
   * promise once all queued animations have finished or been cancelled.
   *
   * When you pass a queue (instead of nothing), that queue is used instead of
   * the queued animations added with the `update` method, which are left alone.
   */start(e){let{queue:t}=this;if(e){t=tb(e).map(it)}else{this.queue=[]}if(this._flush){return this._flush(this,t)}ib(this,t);return id(this,t)}/** @internal */stop(e,t){if(e!==!!e){t=e}if(t){const r=this.springs;tg(tb(t),t=>r[t].stop(!!e))}else{nz(this._state,this._lastAsyncId);this.each(t=>t.stop(!!e))}return this}/** Freeze the active animation in time */pause(e){if(th.und(e)){this.start({pause:true})}else{const t=this.springs;tg(tb(e),e=>t[e].pause())}return this}/** Resume the animation if paused. */resume(e){if(th.und(e)){this.start({pause:false})}else{const t=this.springs;tg(tb(e),e=>t[e].resume())}return this}/** Call a function once per spring value */each(e){tm(this.springs,e)}/** @internal Called at the end of every animation frame */_onFrame(){const{onStart:e,onChange:t,onRest:r}=this._events;const n=this._active.size>0;const i=this._changed.size>0;if(n&&!this._started||i&&!this._started){this._started=true;ty(e,([e,t])=>{t.value=this.get();e(t,this,this._item)})}const a=!n&&this._started;const o=i||a&&r.size?this.get():null;if(i&&t.size){ty(t,([e,t])=>{t.value=o;e(t,this,this._item)})}if(a){this._started=false;ty(r,([e,t])=>{t.value=o;e(t,this,this._item)})}}/** @internal */eventObserved(e){if(e.type=="change"){this._changed.add(e.parent);if(!e.idle){this._active.add(e.parent)}}else if(e.type=="idle"){this._active.delete(e.parent)}else return;e0.onFrame(this._onFrame)}};function id(e,t){return Promise.all(t.map(t=>ip(e,t))).then(t=>nj(e,t))}async function ip(e,t,r){const{keys:n,to:i,from:a,loop:o,onRest:s,onResolve:l}=t;const u=th.obj(t.default)&&t.default;if(o){t.loop=false}if(i===false)t.to=null;if(a===false)t.from=null;const c=th.arr(i)||th.fun(i)?i:void 0;if(c){t.to=void 0;t.onRest=void 0;if(u){u.onRest=void 0}}else{tg(il,r=>{const n=t[r];if(th.fun(n)){const i=e["_events"][r];t[r]=({finished:e,cancelled:t})=>{const r=i.get(n);if(r){if(!e)r.finished=false;if(t)r.cancelled=true}else{i.set(n,{value:null,finished:e||false,cancelled:t||false})}};if(u){u[r]=t[r]}}})}const d=e["_state"];if(t.pause===!d.paused){d.paused=t.pause;t_(t.pause?d.pauseQueue:d.resumeQueue)}else if(d.paused){t.pause=true}const f=(n||Object.keys(e.springs)).map(r=>e.springs[r].start(t));const p=t.cancel===true||nw(t,"cancel")===true;if(c||p&&d.asyncId){f.push(nB(++e["_lastAsyncId"],{props:t,state:d,actions:{pause:tf,resume:tf,start(t,r){if(p){nz(d,e["_lastAsyncId"]);r(nV(e))}else{t.onRest=s;r(nW(c,t,d,e))}}}}))}if(d.paused){await new Promise(e=>{d.resumeQueue.add(e)})}const h=nj(e,await Promise.all(f));if(o&&h.finished&&!(r&&h.noop)){const r=ie(t,o,i);if(r){ib(e,[r]);return ip(e,r,true)}}if(l){e0.batchedUpdates(()=>l(h,e,e.item))}return h}function ih(e,t){const r={...e.springs};if(t){tg(tb(t),e=>{if(th.und(e.keys)){e=it(e)}if(!th.obj(e.to)){e={...e,to:void 0}}im(r,e,e=>{return ig(e)})})}iv(e,r);return r}function iv(e,t){tm(t,(t,r)=>{if(!e.springs[r]){e.springs[r]=t;rv(t,e)}})}function ig(e,t){const r=new n9;r.key=e;if(t){rv(r,t)}return r}function im(e,t,r){if(t.keys){tg(t.keys,n=>{const i=e[n]||(e[n]=r(n));i["_prepareNode"](t)})}}function ib(e,t){tg(t,t=>{im(e.springs,t,t=>{return ig(t,e)})})}// src/SpringContext.tsx
var iy=({children:e,...t})=>{const r=(0,n.useContext)(i_);const i=t.pause||!!r.pause,a=t.immediate||!!r.immediate;t=r2(()=>({pause:i,immediate:a}),[i,a]);const{Provider:o}=i_;return /* @__PURE__ */n.createElement(o,{value:t},e)};var i_=iw(iy,{});iy.Provider=i_.Provider;iy.Consumer=i_.Consumer;function iw(e,t){Object.assign(e,n.createContext(t));e.Provider._context=e;e.Consumer._context=e;return e}// src/SpringRef.ts
var ix=()=>{const e=[];const t=function(t){rF();const n=[];tg(e,(e,i)=>{if(th.und(t)){n.push(e.start())}else{const a=r(t,e,i);if(a){n.push(e.start(a))}}});return n};t.current=e;t.add=function(t){if(!e.includes(t)){e.push(t)}};t.delete=function(t){const r=e.indexOf(t);if(~r)e.splice(r,1)};t.pause=function(){tg(e,e=>e.pause(...arguments));return this};t.resume=function(){tg(e,e=>e.resume(...arguments));return this};t.set=function(t){tg(e,(e,r)=>{const n=th.fun(t)?t(r,e):t;if(n){e.set(n)}})};t.start=function(t){const r=[];tg(e,(e,n)=>{if(th.und(t)){r.push(e.start())}else{const i=this._getProps(t,e,n);if(i){r.push(e.start(i))}}});return r};t.stop=function(){tg(e,e=>e.stop(...arguments));return this};t.update=function(t){tg(e,(e,r)=>e.update(this._getProps(t,e,r)));return this};const r=function(e,t,r){return th.fun(e)?e(r,t):e};t._getProps=r;return t};// src/hooks/useSprings.ts
function iA(e,t,r){const i=th.fun(t)&&t;if(i&&!r)r=[];const a=(0,n.useMemo)(()=>i||arguments.length==3?ix():void 0,[]);const o=(0,n.useRef)(0);const s=r1();const l=(0,n.useMemo)(()=>({ctrls:[],queue:[],flush(e,t){const r=ih(e,t);const n=o.current>0&&!l.queue.length&&!Object.keys(r).some(t=>!e.springs[t]);return n?id(e,t):new Promise(n=>{iv(e,r);l.queue.push(()=>{n(id(e,t))});s()})}}),[]);const u=(0,n.useRef)([...l.ctrls]);const c=[];const d=r3(e)||0;(0,n.useMemo)(()=>{tg(u.current.slice(e,d),e=>{nO(e,a);e.stop(true)});u.current.length=e;f(d,e)},[e]);(0,n.useMemo)(()=>{f(0,Math.min(d,e))},r);function f(e,r){for(let n=e;n<r;n++){const e=u.current[n]||(u.current[n]=new ic(null,l.flush));const r=i?i(n,e):t[n];if(r){c[n]=ir(r)}}}const p=u.current.map((e,t)=>ih(e,c[t]));const h=(0,n.useContext)(iy);const v=r3(h);const g=h!==v&&nT(h);rZ(()=>{o.current++;l.ctrls=u.current;const{queue:e}=l;if(e.length){l.queue=[];tg(e,e=>e())}tg(u.current,(e,t)=>{a?.add(e);if(g){e.start({default:h})}const r=c[t];if(r){nD(e,r.ref);if(e.ref){e.queue.push(r)}else{e.start(r)}}})});r4(()=>()=>{tg(l.ctrls,e=>e.stop(true))});const m=p.map(e=>({...e}));return a?[m,a]:m}// src/hooks/useSpring.ts
function ik(e,t){const r=th.fun(e);const[[n],i]=iA(1,r?e:[e],r?t||[]:t);return r||arguments.length==2?[n,i]:n}// src/hooks/useSpringRef.ts
var iE=()=>ix();var iI=()=>useState(iE)[0];// src/hooks/useSpringValue.ts
var iC=(e,t)=>{const r=useConstant(()=>new n9(e,t));useOnce2(()=>()=>{r.stop()});return r};// src/hooks/useTrail.ts
function iY(e,t,r){const n=is10.fun(t)&&t;if(n&&!r)r=[];let i=true;let a=void 0;const o=iA(e,(e,r)=>{const o=n?n(e,r):t;a=o.ref;i=i&&o.reverse;return o},// Ensure the props function is called when no deps exist.
// This works around the 3 argument rule.
r||[{}]);useIsomorphicLayoutEffect3(()=>{each6(o[1].current,(e,t)=>{const r=o[1].current[t+(i?1:-1)];nD(e,a);if(e.ref){if(r){e.update({to:r.springs})}return}if(r){e.start({to:r.springs})}else{e.start()}})},r);if(n||arguments.length==3){const e=a??o[1];e["_getProps"]=(t,r,n)=>{const i=is10.fun(t)?t(n,r):t;if(i){const t=e.current[n+(i.reverse?1:-1)];if(t)i.to=t.springs;return i}};return o}return o[0]}// src/hooks/useTransition.tsx
function iT(e,t,r){const i=th.fun(t)&&t;const{reset:a,sort:o,trail:s=0,expires:l=true,exitBeforeEnter:u=false,onDestroyed:c,ref:d,config:f}=i?i():t;const p=(0,n.useMemo)(()=>i||arguments.length==3?ix():void 0,[]);const h=tb(e);const v=[];const g=(0,n.useRef)(null);const m=a?null:g.current;rZ(()=>{g.current=v});r4(()=>{tg(v,e=>{p?.add(e.ctrl);e.ctrl.ref=p});return()=>{tg(g.current,e=>{if(e.expired){clearTimeout(e.expirationId)}nO(e.ctrl,p);e.ctrl.stop(true)})}});const b=iO(h,i?i():t,m);const y=a&&g.current||[];rZ(()=>tg(y,({ctrl:e,item:t,key:r})=>{nO(e,p);nb(c,t,r)}));const _=[];if(m)tg(m,(e,t)=>{if(e.expired){clearTimeout(e.expirationId);y.push(e)}else{t=_[t]=b.indexOf(e.key);if(~t)v[t]=e}});tg(h,(e,t)=>{if(!v[t]){v[t]={key:b[t],item:e,phase:"mount"/* MOUNT */,ctrl:new ic};v[t].ctrl.item=e}});if(_.length){let e=-1;const{leave:r}=i?i():t;tg(_,(t,n)=>{const i=m[n];if(~t){e=v.indexOf(i);v[e]={...i,item:h[t]}}else if(r){v.splice(++e,0,i)}})}if(th.fun(o)){v.sort((e,t)=>o(e.item,t.item))}let w=-s;const x=r1();const A=nA(t);const k=/* @__PURE__ */new Map;const E=(0,n.useRef)(/* @__PURE__ */new Map);const I=(0,n.useRef)(false);tg(v,(e,r)=>{const n=e.key;const a=e.phase;const o=i?i():t;let c;let p;const h=nb(o.delay||0,n);if(a=="mount"/* MOUNT */){c=o.enter;p="enter"/* ENTER */}else{const e=b.indexOf(n)<0;if(a!="leave"/* LEAVE */){if(e){c=o.leave;p="leave"/* LEAVE */}else if(c=o.update){p="update"/* UPDATE */}else return}else if(!e){c=o.enter;p="enter"/* ENTER */}else return}c=nb(c,e.item,r);c=th.obj(c)?nC(c):{to:c};if(!c.config){const t=f||A.config;c.config=nb(t,e.item,r,p)}w+=s;const v={...A,// we need to add our props.delay value you here.
delay:h+w,ref:d,immediate:o.immediate,// This prevents implied resets.
reset:false,// Merge any phase-specific props.
...c};if(p=="enter"/* ENTER */&&th.und(v.from)){const n=i?i():t;const a=th.und(n.initial)||m?n.from:n.initial;v.from=nb(a,e.item,r)}const{onResolve:y}=v;v.onResolve=e=>{nb(y,e);const t=g.current;const r=t.find(e=>e.key===n);if(!r)return;if(e.cancelled&&r.phase!="update"/* UPDATE */){return}if(r.ctrl.idle){const e=t.every(e=>e.ctrl.idle);if(r.phase=="leave"/* LEAVE */){const t=nb(l,r.item);if(t!==false){const n=t===true?0:t;r.expired=true;if(!e&&n>0){if(n<=0x7fffffff)r.expirationId=setTimeout(x,n);return}}}if(e&&t.some(e=>e.expired)){E.current.delete(r);if(u){I.current=true}x()}}};const _=ih(e.ctrl,v);if(p==="leave"/* LEAVE */&&u){E.current.set(e,{phase:p,springs:_,payload:v})}else{k.set(e,{phase:p,springs:_,payload:v})}});const C=(0,n.useContext)(iy);const Y=r3(C);const T=C!==Y&&nT(C);rZ(()=>{if(T){tg(v,e=>{e.ctrl.start({default:C})})}},[C]);tg(k,(e,t)=>{if(E.current.size){const e=v.findIndex(e=>e.key===t.key);v.splice(e,1)}});rZ(()=>{tg(E.current.size?E.current:k,({phase:e,payload:t},r)=>{const{ctrl:n}=r;r.phase=e;p?.add(n);if(T&&e=="enter"/* ENTER */){n.start({default:C})}if(t){nD(n,t.ref);if((n.ref||p)&&!I.current){n.update(t)}else{n.start(t);if(I.current){I.current=false}}}})},a?void 0:r);const S=e=>/* @__PURE__ */n.createElement(n.Fragment,null,v.map((t,r)=>{const{springs:i}=k.get(t)||t.ctrl;const a=e({...i},t.item,t,r);return a&&a.type?/* @__PURE__ */n.createElement(a.type,{...a.props,key:th.str(t.key)||th.num(t.key)?t.key:t.ctrl.id,ref:a.ref}):a}));return p?[S,p]:S}var iS=1;function iO(e,{key:t,keys:r=t},n){if(r===null){const t=/* @__PURE__ */new Set;return e.map(e=>{const r=n&&n.find(r=>r.item===e&&r.phase!=="leave"/* LEAVE */&&!t.has(r));if(r){t.add(r);return r.key}return iS++})}return th.und(r)?e:th.fun(r)?e.map(r):tb(r)}// src/hooks/useScroll.ts
var iD=({container:e,...t}={})=>{const[r,n]=ik(()=>({scrollX:0,scrollY:0,scrollXProgress:0,scrollYProgress:0,...t}),[]);useIsomorphicLayoutEffect5(()=>{const t=onScroll(({x:e,y:t})=>{n.start({scrollX:e.current,scrollXProgress:e.progress,scrollY:t.current,scrollYProgress:t.progress})},{container:e?.current||void 0});return()=>{each8(Object.values(r),e=>e.stop());t()}},[]);return r};// src/hooks/useResize.ts
var iF=({container:e,...t})=>{const[r,n]=ik(()=>({width:0,height:0,...t}),[]);useIsomorphicLayoutEffect6(()=>{const t=onResize(({width:e,height:t})=>{n.start({width:e,height:t,immediate:r.width.get()===0||r.height.get()===0})},{container:e?.current||void 0});return()=>{each9(Object.values(r),e=>e.stop());t()}},[]);return r};// src/hooks/useInView.ts
var iR=/* unused pure expression or super */null&&{any:0,all:1};function iP(e,t){const[r,n]=useState2(false);const i=useRef3();const a=is12.fun(e)&&e;const o=a?a():{};const{to:s={},from:l={},...u}=o;const c=a?t:e;const[d,f]=ik(()=>({from:l,...u}),[]);useIsomorphicLayoutEffect7(()=>{const e=i.current;const{root:t,once:a,amount:o="any",...u}=c??{};if(!e||a&&r||typeof IntersectionObserver==="undefined")return;const d=/* @__PURE__ */new WeakMap;const p=()=>{if(s){f.start(s)}n(true);const e=()=>{if(l){f.start(l)}n(false)};return a?void 0:e};const h=e=>{e.forEach(e=>{const t=d.get(e.target);if(e.isIntersecting===Boolean(t)){return}if(e.isIntersecting){const t=p();if(is12.fun(t)){d.set(e.target,t)}else{v.unobserve(e.target)}}else if(t){t();d.delete(e.target)}})};const v=new IntersectionObserver(h,{root:t&&t.current||void 0,threshold:typeof o==="number"||Array.isArray(o)?o:iR[o],...u});v.observe(e);return()=>v.unobserve(e)},[c]);if(a){return[i,d]}return[i,r]}// src/components/Spring.tsx
function iM({children:e,...t}){return e(ik(t))}// src/components/Trail.tsx
function iH({items:e,children:t,...r}){const n=iY(e.length,r);return e.map((e,r)=>{const i=t(e,r);return is13.fun(i)?i(n[r]):i})}// src/components/Transition.tsx
function iN({items:e,children:t,...r}){return iT(e,r)(t)}// src/interpolate.ts
// src/Interpolation.ts
var iL=class extends nJ{constructor(e,t){super();this.source=e;/** Equals false when in the frameloop */this.idle=true;/** The inputs which are currently animating */this._active=/* @__PURE__ */new Set;this.calc=t5(...t);const r=this._get();const n=nc(r);nt(this,n.create(r))}advance(e){const t=this._get();const r=this.get();if(!tv(t,r)){ne(this).setValue(t);this._onChange(t,this.idle)}if(!this.idle&&iB(this._active)){ij(this)}}_get(){const e=th.arr(this.source)?this.source.map(ru):tb(ru(this.source));return this.calc(...e)}_start(){if(this.idle&&!iB(this._active)){this.idle=false;tg(nr(this),e=>{e.done=false});if(td.skipAnimation){e0.batchedUpdates(()=>this.advance());ij(this)}else{tD.start(this)}}}// Observe our sources only when we're observed.
_attach(){let e=1;tg(tb(this.source),t=>{if(rl(t)){rv(t,this)}if(n$(t)){if(!t.idle){this._active.add(t)}e=Math.max(e,t.priority+1)}});this.priority=e;this._start()}// Stop observing our sources once we have no observers.
_detach(){tg(tb(this.source),e=>{if(rl(e)){rg(e,this)}});this._active.clear();ij(this)}/** @internal */eventObserved(e){if(e.type=="change"){if(e.idle){this.advance()}else{this._active.add(e.parent);this._start()}}else if(e.type=="idle"){this._active.delete(e.parent)}else if(e.type=="priority"){this.priority=tb(this.source).reduce((e,t)=>Math.max(e,(n$(t)?t.priority:0)+1),0)}}};function iK(e){return e.idle!==false}function iB(e){return!e.size||Array.from(e).every(iK)}function ij(e){if(!e.idle){e.idle=true;tg(nr(e),e=>{e.done=true});rf(e,{type:"idle",parent:e})}}// src/interpolate.ts
var iU=(e,...t)=>new iL(e,t);var iq=(e,...t)=>(deprecateInterpolate2(),new iL(e,t));// src/globals.ts
td.assign({createStringInterpolator:rC,to:(e,t)=>new iL(e,t)});var iV=tD.advance;// src/index.ts
//# sourceMappingURL=react-spring_core.modern.mjs.map
// EXTERNAL MODULE: external "ReactDOM"
var iW=r(5206);// CONCATENATED MODULE: ../tutor/node_modules/@react-spring/web/dist/react-spring_web.modern.mjs
// src/index.ts
// src/applyAnimatedValues.ts
var iz=/^--/;function iG(e,t){if(t==null||typeof t==="boolean"||t==="")return"";if(typeof t==="number"&&t!==0&&!iz.test(e)&&!(iX.hasOwnProperty(e)&&iX[e]))return t+"px";return(""+t).trim()}var iQ={};function i$(e,t){if(!e.nodeType||!e.setAttribute){return false}const r=e.nodeName==="filter"||e.parentNode&&e.parentNode.nodeName==="filter";const{className:n,style:i,children:a,scrollTop:o,scrollLeft:s,viewBox:l,...u}=t;const c=Object.values(u);const d=Object.keys(u).map(t=>r||e.hasAttribute(t)?t:iQ[t]||(iQ[t]=t.replace(/([A-Z])/g,// Attributes are written in dash case
    e=>"-"+e.toLowerCase())));if(a!==void 0){e.textContent=a}for(const t in i){if(i.hasOwnProperty(t)){const r=iG(t,i[t]);if(iz.test(t)){e.style.setProperty(t,r)}else{e.style[t]=r}}}d.forEach((t,r)=>{e.setAttribute(t,c[r])});if(n!==void 0){e.className=n}if(o!==void 0){e.scrollTop=o}if(s!==void 0){e.scrollLeft=s}if(l!==void 0){e.setAttribute("viewBox",l)}}var iX={animationIterationCount:true,borderImageOutset:true,borderImageSlice:true,borderImageWidth:true,boxFlex:true,boxFlexGroup:true,boxOrdinalGroup:true,columnCount:true,columns:true,flex:true,flexGrow:true,flexPositive:true,flexShrink:true,flexNegative:true,flexOrder:true,gridRow:true,gridRowEnd:true,gridRowSpan:true,gridRowStart:true,gridColumn:true,gridColumnEnd:true,gridColumnSpan:true,gridColumnStart:true,fontWeight:true,lineClamp:true,lineHeight:true,opacity:true,order:true,orphans:true,tabSize:true,widows:true,zIndex:true,zoom:true,// SVG-related properties
fillOpacity:true,floodOpacity:true,stopOpacity:true,strokeDasharray:true,strokeDashoffset:true,strokeMiterlimit:true,strokeOpacity:true,strokeWidth:true};var iJ=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1);var iZ=["Webkit","Ms","Moz","O"];iX=Object.keys(iX).reduce((e,t)=>{iZ.forEach(r=>e[iJ(r,t)]=e[t]);return e},iX);// src/AnimatedStyle.ts
var i0=/^(matrix|translate|scale|rotate|skew)/;var i1=/^(translate)/;var i2=/^(rotate|skew)/;var i6=(e,t)=>th.num(e)&&e!==0?e+t:e;var i4=(e,t)=>th.arr(e)?e.every(e=>i4(e,t)):th.num(e)?e===t:parseFloat(e)===t;var i5=class extends ns{constructor({x:e,y:t,z:r,...n}){const i=[];const a=[];if(e||t||r){i.push([e||0,t||0,r||0]);a.push(e=>[`translate3d(${e.map(e=>i6(e,"px")).join(",")})`,// prettier-ignore
    i4(e,0)])}tm(n,(e,t)=>{if(t==="transform"){i.push([e||""]);a.push(e=>[e,e===""])}else if(i0.test(t)){delete n[t];if(th.und(e))return;const r=i1.test(t)?"px":i2.test(t)?"deg":"";i.push(tb(e));a.push(t==="rotate3d"?([e,t,n,i])=>[`rotate3d(${e},${t},${n},${i6(i,r)})`,i4(i,0)]:e=>[`${t}(${e.map(e=>i6(e,r)).join(",")})`,i4(e,t.startsWith("scale")?1:0)])}});if(i.length){n.transform=new i3(i,a)}super(n)}};var i3=class extends rp{constructor(e,t){super();this.inputs=e;this.transforms=t;this._value=null}get(){return this._value||(this._value=this._get())}_get(){let e="";let t=true;tg(this.inputs,(r,n)=>{const i=ru(r[0]);const[a,o]=this.transforms[n](th.arr(i)?i:r.map(ru));e+=" "+a;t=t&&o});return t?"none":e}// Start observing our inputs once we have an observer.
observerAdded(e){if(e==1)tg(this.inputs,e=>tg(e,e=>rl(e)&&rv(e,this)))}// Stop observing our inputs once we have no observers.
observerRemoved(e){if(e==0)tg(this.inputs,e=>tg(e,e=>rl(e)&&rg(e,this)))}eventObserved(e){if(e.type=="change"){this._value=null}rf(this,e)}};// src/primitives.ts
var i8=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr",// SVG
"circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"];// src/index.ts
td.assign({batchedUpdates:iW.unstable_batchedUpdates,createStringInterpolator:rC,colors:tL});var i9=ng(i8,{applyAnimatedValues:i$,createAnimatedStyle:e=>new i5(e),// eslint-disable-next-line @typescript-eslint/no-unused-vars
getComponentProps:({scrollTop:e,scrollLeft:t,...r})=>r});var i7=i9.animated;//# sourceMappingURL=react-spring_web.modern.mjs.map
;// CONCATENATED MODULE: ../tutor/node_modules/react-use-measure/dist/index.js
function ae(e,t){let r;return(...n)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...n),t)}}function at({debounce:e,scroll:t,polyfill:r,offsetSize:i}={debounce:0,scroll:!1,offsetSize:!1}){const a=r||(typeof window=="undefined"?class{}:window.ResizeObserver);if(!a)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[o,s]=(0,n.useState)({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),l=(0,n.useRef)({element:null,scrollContainers:null,resizeObserver:null,lastBounds:o,orientationHandler:null}),u=e?typeof e=="number"?e:e.scroll:null,c=e?typeof e=="number"?e:e.resize:null,d=(0,n.useRef)(!1);(0,n.useEffect)(()=>(d.current=!0,()=>void(d.current=!1)));const[f,p,h]=(0,n.useMemo)(()=>{const e=()=>{if(!l.current.element)return;const{left:e,top:t,width:r,height:n,bottom:a,right:o,x:u,y:c}=l.current.element.getBoundingClientRect(),f={left:e,top:t,width:r,height:n,bottom:a,right:o,x:u,y:c};l.current.element instanceof HTMLElement&&i&&(f.height=l.current.element.offsetHeight,f.width=l.current.element.offsetWidth),Object.freeze(f),d.current&&!ao(l.current.lastBounds,f)&&s(l.current.lastBounds=f)};return[e,c?ae(e,c):e,u?ae(e,u):e]},[s,i,u,c]);function v(){l.current.scrollContainers&&(l.current.scrollContainers.forEach(e=>e.removeEventListener("scroll",h,!0)),l.current.scrollContainers=null),l.current.resizeObserver&&(l.current.resizeObserver.disconnect(),l.current.resizeObserver=null),l.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",l.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",l.current.orientationHandler))}function g(){l.current.element&&(l.current.resizeObserver=new a(h),l.current.resizeObserver.observe(l.current.element),t&&l.current.scrollContainers&&l.current.scrollContainers.forEach(e=>e.addEventListener("scroll",h,{capture:!0,passive:!0})),l.current.orientationHandler=()=>{h()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",l.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",l.current.orientationHandler))}const m=e=>{!e||e===l.current.element||(v(),l.current.element=e,l.current.scrollContainers=ai(e),g())};return an(h,!!t),ar(p),(0,n.useEffect)(()=>{v(),g()},[t,h,p]),(0,n.useEffect)(()=>v,[]),[m,o,f]}function ar(e){(0,n.useEffect)(()=>{const t=e;return window.addEventListener("resize",t),()=>void window.removeEventListener("resize",t)},[e])}function an(e,t){(0,n.useEffect)(()=>{if(t){const t=e;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[e,t])}function ai(e){const t=[];if(!e||e===document.body)return t;const{overflow:r,overflowX:n,overflowY:i}=window.getComputedStyle(e);return[r,n,i].some(e=>e==="auto"||e==="scroll")&&t.push(e),[...t,...ai(e.parentElement)]}const aa=["x","y","top","bottom","left","right","width","height"],ao=(e,t)=>aa.every(r=>e[r]===t[r]);//# sourceMappingURL=index.js.map
;// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/hooks/useAnimation.tsx
var as=/*#__PURE__*/function(e){e[e["slideDown"]=0]="slideDown";e[e["slideUp"]=1]="slideUp";e[e["slideLeft"]=2]="slideLeft";e[e["slideRight"]=3]="slideRight";e[e["collapseExpand"]=4]="collapseExpand";e[e["zoomIn"]=5]="zoomIn";e[e["zoomOut"]=6]="zoomOut";e[e["fadeIn"]=7]="fadeIn";e[e["sidebar"]=8]="sidebar";return e}({});var al=100;var au=e=>{var{data:t,animationType:r=4,slideThreshold:n=20,animationDuration:i=150,minOpacity:a=0,maxOpacity:o=1,easing:s=ra.easeInOutQuad,debounceMeasure:l=false,keys:u}=e;var c=Array.isArray(t)?t.length>0:!!t;var[d,f]=at({debounce:l?i+al:0});var p=ik({from:{height:0,opacity:a,y:0},to:{height:c?f.height:0,opacity:c?o:a,y:c?0:n*-1},config:{duration:i,easing:s}});var h=ik({from:{x:0},to:{x:c?0:n*-1},config:{duration:i,easing:s}});var v={x:0,y:0};switch(r){case 0:v.y=n*-1;v.x=0;break;case 1:v.y=n;v.x=0;break;case 2:v.x=n;v.y=0;break;case 3:v.x=n*-1;v.y=0;break}var g=iT(t,{keys:u||(e=>{return e}),from:(0,e$._)({opacity:a},v,r===5&&{transform:"scale(0.8)"},r===6&&{transform:"scale(1.2)"},r===7&&{opacity:0}),enter:(0,e$._)({opacity:o,x:0,y:0},r===5&&{transform:"scale(1)"},r===6&&{transform:"scale(1)"},r===7&&{opacity:1}),leave:(0,e$._)({opacity:a},v,r===5&&{transform:"scale(0.8)"},r===6&&{transform:"scale(1.2)"},r===7&&{opacity:0}),config:{duration:i,easing:s}});return{animationStyle:r===8?h:p,ref:d,transitions:g}};var ac=e=>{var{children:r,style:n,hideOnOverflow:i=true}=e,a=(0,eJ._)(e,["children","style","hideOnOverflow"]);return/*#__PURE__*/(0,t/* .jsx */.Y)(i7.div,(0,eX._)((0,e$._)({},a),{style:(0,eX._)((0,e$._)({},n),{overflow:i?"hidden":"initial"}),children:r}))};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/modals/Modal.tsx
function ad(){var e=(0,eS._)(["\n      background: linear-gradient(\n        73.09deg,\n        rgba(255, 150, 69, 0.4) 18.05%,\n        rgba(255, 100, 113, 0.4) 30.25%,\n        rgba(207, 110, 189, 0.4) 55.42%,\n        rgba(164, 119, 209, 0.4) 71.66%,\n        rgba(62, 100, 222, 0.4) 97.9%\n      );\n      opacity: 1;\n      backdrop-filter: blur(10px);\n    "]);ad=function t(){return e};return e}var af={backdrop:e=>{var{magicAi:t=false}=e;return/*#__PURE__*/(0,o/* .css */.AH)("position:fixed;background-color:",ey/* .colorTokens.background.modal */.I6.background.modal,";opacity:0.7;inset:0;z-index:",ey/* .zIndex.negative */.fE.negative,";",t&&(0,o/* .css */.AH)(ad()))},container:/*#__PURE__*/(0,o/* .css */.AH)("z-index:",ey/* .zIndex.highest */.fE.highest,";position:fixed;display:flex;justify-content:center;top:0;left:0;width:100%;height:100%;")};var ap=/*#__PURE__*/i().createContext({showModal:()=>Promise.resolve({action:"CLOSE"}),closeModal:ej/* .noop */.lQ,updateModal:ej/* .noop */.lQ,hasModalOnStack:false});var ah=()=>(0,n.useContext)(ap);var av=e=>{var{children:r}=e;var[a,o]=(0,n.useState)({modals:[]});var s=(0,n.useCallback)(e=>{var{component:t,props:r,closeOnOutsideClick:n=false,closeOnEscape:i=true,isMagicAi:a=false,depthIndex:s=ey/* .zIndex.modal */.fE.modal,id:l}=e;return new Promise(e=>{o(o=>(0,eX._)((0,e$._)({},o),{modals:[...o.modals,{component:t,props:r,resolve:e,closeOnOutsideClick:n,closeOnEscape:i,id:l||(0,ej/* .nanoid */.Ak)(),depthIndex:s,isMagicAi:a}]}))})},[]);var l=(0,n.useCallback)(function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{action:"CLOSE"};o(t=>{var r=t.modals[t.modals.length-1];r===null||r===void 0?void 0:r.resolve(e);return(0,eX._)((0,e$._)({},t),{modals:t.modals.slice(0,t.modals.length-1)})})},[]);var u=(0,n.useCallback)((e,t)=>{o(r=>{var n=r.modals.findIndex(t=>t.id===e);if(n===-1)return r;var i=[...r.modals];var a=i[n];i[n]=(0,eX._)((0,e$._)({},a),{props:(0,e$._)({},a.props,t)});return(0,eX._)((0,e$._)({},r),{modals:i})})},[]);var{transitions:c}=au({keys:e=>e.id,data:a.modals,animationType:as.slideUp,animationDuration:250});var d=(0,n.useMemo)(()=>{return a.modals.length>0},[a.modals]);(0,n.useEffect)(()=>{var e=e=>{var t;var r=document.querySelectorAll(".tutor-portal-popover");var n=!!document.body.classList.contains("modal-open");if(e.key==="Escape"&&((t=a.modals[a.modals.length-1])===null||t===void 0?void 0:t.closeOnEscape)&&!r.length&&!n){l({action:"CLOSE"})}};if(a.modals.length>0){document.addEventListener("keydown",e,true)}return()=>{document.removeEventListener("keydown",e,true)};// eslint-disable-next-line react-hooks/exhaustive-deps
},[a.modals.length,l]);return/*#__PURE__*/(0,t/* .jsxs */.FD)(ap.Provider,{value:{showModal:s,closeModal:l,updateModal:u,hasModalOnStack:d},children:[r,c((e,r,n,a)=>{return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{"data-cy":"tutor-modal",css:[af.container,{zIndex:r.depthIndex||ey/* .zIndex.modal */.fE.modal+a}],children:[/*#__PURE__*/(0,t/* .jsx */.Y)(ac,{style:(0,eX._)((0,e$._)({},e),{width:"100%"}),hideOnOverflow:false,children:/*#__PURE__*/i().createElement(r.component,(0,eX._)((0,e$._)({},r.props),{closeModal:l}))}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:af.backdrop({magicAi:r.isMagicAi}),onKeyUp:ej/* .noop */.lQ,tabIndex:-1,// This is not ideal to attach a click event on a non-interactive element like div,
// but in this case we have to do it.
onClick:()=>{if(r.closeOnOutsideClick){l({action:"CLOSE"})}}})]},r.id)})]})};// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/controls/Show.tsx
var ag=r(1817);// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/molecules/EmptyState.tsx
function am(){var e=(0,eS._)(["\n      border: 1px solid ",";\n      border-radius: ",";\n      background-color: ",";\n    "]);am=function t(){return e};return e}function ab(){var e=(0,eS._)(["\n      gap: ",";\n      padding: ",";\n      padding-bottom: ",";\n    "]);ab=function t(){return e};return e}function ay(){var e=(0,eS._)(["\n        max-width: 282px;\n      "]);ay=function t(){return e};return e}function a_(){var e=(0,eS._)(["\n      gap: ",";\n    "]);a_=function t(){return e};return e}function aw(){var e=(0,eS._)(["\n      ",";\n      color: ",";\n    "]);aw=function t(){return e};return e}function ax(){var e=(0,eS._)(["\n      ",";\n      color: ",";\n    "]);ax=function t(){return e};return e}function aA(){var e=(0,eS._)(["\n      gap: ",";\n      margin-top: ",";\n    "]);aA=function t(){return e};return e}var ak=e=>{var{emptyStateImage:r,emptyStateImage2x:n,imageAltText:i,title:a,size:o="medium",description:s,actions:l,removeBorder:u=true,wrapperCss:c}=e;return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:[aI.bannerWrapper(o,u,!!(0,eO/* .isDefined */.O9)(r)),c],children:[/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:r,children:/*#__PURE__*/(0,t/* .jsx */.Y)("img",{src:r,alt:i,srcSet:n?"".concat(n," 2x"):""})}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:aI.messageWrapper(o),children:[/*#__PURE__*/(0,t/* .jsx */.Y)("h5",{css:aI.title(o),children:a}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:s,children:/*#__PURE__*/(0,t/* .jsx */.Y)("p",{css:aI.description(o),children:s})}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:l,children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{"data-actions":true,css:aI.actionWrapper(o),children:l})})]})]})};/* ESM default export */const aE=ak;var aI={bannerWrapper:(e,t,r)=>/*#__PURE__*/(0,o/* .css */.AH)("display:grid;place-items:center;justify-content:center;gap:",ey/* .spacing["36"] */.YK["36"],";padding:",r?"".concat(ey/* .spacing["16"] */.YK["16"]," ").concat(ey/* .spacing["20"] */.YK["20"]):"".concat(ey/* .spacing["20"] */.YK["20"]),";",!t&&(0,o/* .css */.AH)(am(),ey/* .colorTokens.stroke.divider */.I6.stroke.divider,ey/* .borderRadius.card */.Vq.card,ey/* .colorTokens.background.white */.I6.background.white)," ",e==="small"&&(0,o/* .css */.AH)(ab(),ey/* .spacing["12"] */.YK["12"],r?ey/* .spacing["12"] */.YK["12"]:ey/* .spacing["16"] */.YK["16"],r?ey/* .spacing["24"] */.YK["24"]:undefined),"    & img{max-width:640px;width:100%;height:auto;border-radius:",e==="small"?ey/* .borderRadius["6"] */.Vq["6"]:ey/* .borderRadius["10"] */.Vq["10"],";overflow:hidden;object-position:center;object-fit:cover;",e==="small"&&(0,o/* .css */.AH)(ay()),"}"),messageWrapper:e=>/*#__PURE__*/(0,o/* .css */.AH)("display:flex;flex-direction:column;max-width:566px;width:100%;gap:",ey/* .spacing["12"] */.YK["12"],";text-align:center;",e==="small"&&(0,o/* .css */.AH)(a_(),ey/* .spacing["8"] */.YK["8"])),title:e=>/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.heading5 */.I.heading5(),";color:",ey/* .colorTokens.text.primary */.I6.text.primary,";",e==="small"&&(0,o/* .css */.AH)(aw(),eK/* .typography.caption */.I.caption("medium"),ey/* .colorTokens.text.primary */.I6.text.primary)),description:e=>/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.body */.I.body(),";color:",ey/* .colorTokens.text.hints */.I6.text.hints,";",e==="small"&&(0,o/* .css */.AH)(ax(),eK/* .typography.tiny */.I.tiny(),ey/* .colorTokens.text.hints */.I6.text.hints)),actionWrapper:e=>/*#__PURE__*/(0,o/* .css */.AH)("margin-top:",ey/* .spacing["20"] */.YK["20"],";display:flex;justify-content:center;align-items:center;gap:",ey/* .spacing["12"] */.YK["12"],";",e==="small"&&(0,o/* .css */.AH)(aA(),ey/* .spacing["8"] */.YK["8"],ey/* .spacing["8"] */.YK["8"]))};// CONCATENATED MODULE: ./node_modules/@swc/helpers/esm/_async_to_generator.js
function aC(e,t,r,n,i,a,o){try{var s=e[a](o);var l=s.value}catch(e){r(e);return}if(s.done)t(l);else Promise.resolve(l).then(n,i)}function aY(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(e){aC(a,n,i,o,s,"next",e)}function s(e){aC(a,n,i,o,s,"throw",e)}o(undefined)})}}// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/config/constants.ts
var aT=r(5781);// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/FocusTrap.tsx
var aS=e=>{var{children:t,blurPrevious:r=false}=e;var i=(0,n.useRef)(null);var a=(0,n.useRef)(null);(0,n.useEffect)(()=>{var e=i.current;if(!e){return}a.current=document.activeElement;if(r&&a.current&&a.current!==document.body){a.current.blur()}var t=e=>{if(!e||!e.isConnected){return false}var t=getComputedStyle(e);return t.display!=="none"&&t.visibility!=="hidden"&&!e.hidden&&e.offsetParent!==null};var n=()=>{var r='a[href], button, textarea, input, select, [tabindex]:not([tabindex="-1"])';return Array.from(e.querySelectorAll(r)).filter(e=>{return!e.hasAttribute("disabled")&&t(e)})};var o=()=>{var t=document.querySelectorAll('[data-focus-trap="true"]');return t.length>0&&t[t.length-1]===e};var s=t=>{if(!o()||t.key!=="Tab"){return}var r=n();if(r.length===0){return}var i=r[0];var a=r[r.length-1];var s=document.activeElement;if(!e.contains(s)&&document.body!==s){t.preventDefault();i.focus();return}if(t.shiftKey&&s===i){t.preventDefault();a.focus();return}if(!t.shiftKey&&s===a){t.preventDefault();i.focus();return}};document.addEventListener("keydown",s,true);return()=>{document.removeEventListener("keydown",s,true);if(a.current&&t(a.current)){a.current.focus()}};// eslint-disable-next-line react-hooks/exhaustive-deps
},[]);return/*#__PURE__*/(0,n.cloneElement)(n.Children.only(t),{ref:i,"data-focus-trap":"true",tabIndex:-1})};/* ESM default export */const aO=aS;// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/hooks/useScrollLock.ts
var aD=null;var aF=[];var aR=null;var aP=()=>{if(aD!==null)return aD;var e=document.createElement("div");e.style.visibility="hidden";e.style.overflow="scroll";e.style.width="100px";document.body.appendChild(e);var t=document.createElement("div");t.style.width="100%";e.appendChild(t);aD=e.offsetWidth-t.offsetWidth;document.body.removeChild(e);return aD};var aM=()=>{if(aR){return}var e=aP();var t=window.innerWidth>document.documentElement.clientWidth;aR={overflow:document.body.style.overflow,paddingRight:document.body.style.paddingRight};document.body.style.overflow="hidden";if(t&&e>0){var r=parseInt(window.getComputedStyle(document.body).paddingRight||"0",10);document.body.style.paddingRight="".concat(r+e,"px")}};var aH=()=>{if(!aR){return}document.body.style.overflow=aR.overflow;document.body.style.paddingRight=aR.paddingRight;aR=null};var aN=()=>{var e=Symbol("scroll-lock");aF.push(e);if(aF.length===1){aM()}return e};var aL=new Set;var aK=e=>{var t=aF.indexOf(e);if(t===-1){return}aF.splice(t,1);aL.delete(e);if(aF.length===0&&aL.size===0){aH()}};var aB=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:true;var t=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(!e){if(t.current){aK(t.current);t.current=null}return}t.current=aN();return()=>{if(t.current){var e=t.current;t.current=null;aL.add(e);requestAnimationFrame(()=>{aK(e)})}}},[e])};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/hooks/usePortalPopover.tsx
var aj={SAFE_MARGIN:12,MAX_OFFSET_VERTICAL:6,MAX_OFFSET_HORIZONTAL:12,CENTER_OFFSET:8};var aU=4;var aq={TOP:"top",TOP_LEFT:"topLeft",TOP_RIGHT:"topRight",RIGHT:"right",RIGHT_TOP:"rightTop",RIGHT_BOTTOM:"rightBottom",BOTTOM:"bottom",BOTTOM_LEFT:"bottomLeft",BOTTOM_RIGHT:"bottomRight",LEFT:"left",LEFT_TOP:"leftTop",LEFT_BOTTOM:"leftBottom",MIDDLE:"middle",ABSOLUTE_CENTER:"absoluteCenter"};var aV=e=>{var t={[aq.TOP]:aq.TOP,[aq.TOP_LEFT]:aq.TOP_RIGHT,[aq.TOP_RIGHT]:aq.TOP_LEFT,[aq.RIGHT]:aq.LEFT,[aq.RIGHT_TOP]:aq.LEFT_TOP,[aq.RIGHT_BOTTOM]:aq.LEFT_BOTTOM,[aq.BOTTOM]:aq.BOTTOM,[aq.BOTTOM_LEFT]:aq.BOTTOM_RIGHT,[aq.BOTTOM_RIGHT]:aq.BOTTOM_LEFT,[aq.LEFT]:aq.RIGHT,[aq.LEFT_TOP]:aq.RIGHT_TOP,[aq.LEFT_BOTTOM]:aq.RIGHT_BOTTOM,[aq.MIDDLE]:aq.MIDDLE,[aq.ABSOLUTE_CENTER]:aq.ABSOLUTE_CENTER};return t[e]||e};var aW=e=>{return{top:e.top,left:-e.left}};var az=(e,t)=>{var{width:r,height:n}=t;return{top:e.top<0,bottom:e.top+n>window.innerHeight,left:e.left<0,right:e.left+r>window.innerWidth}};var aG=(e,t)=>{return e.startsWith("top")&&t.top||e.startsWith("bottom")&&t.bottom||e.startsWith("left")&&t.left||e.startsWith("right")&&t.right};var aQ=(e,t,r,n,i)=>{var{width:a,height:o}=r;var{top:s,left:l}=i;var u=t.left+t.width/2-a/2;var c=t.top+t.height/2-o/2;var d={[aq.TOP]:{top:t.top-o-n,left:u},[aq.TOP_LEFT]:{top:t.top-o-n,left:t.left},[aq.TOP_RIGHT]:{top:t.top-o-n,left:t.right-a},[aq.BOTTOM]:{top:t.bottom+n,left:u},[aq.BOTTOM_LEFT]:{top:t.bottom+n,left:t.left},[aq.BOTTOM_RIGHT]:{top:t.bottom+n,left:t.right-a},[aq.LEFT]:{top:c,left:t.left-a-n},[aq.LEFT_TOP]:{top:t.top,left:t.left-a-n},[aq.LEFT_BOTTOM]:{top:t.bottom-o,left:t.left-a-n},[aq.RIGHT]:{top:c,left:t.right+n},[aq.RIGHT_TOP]:{top:t.top,left:t.right+n},[aq.RIGHT_BOTTOM]:{top:t.bottom-o,left:t.right+n},[aq.MIDDLE]:{top:c,left:u},[aq.ABSOLUTE_CENTER]:{top:window.innerHeight/2-o/2,left:window.innerWidth/2-a/2}};var f=d[e]||d[aq.BOTTOM];return{top:f.top+s,left:f.left+l}};var a$=(e,t,r,n,i,a)=>{var o={[aq.TOP]:aq.BOTTOM,[aq.TOP_LEFT]:aq.BOTTOM_LEFT,[aq.TOP_RIGHT]:aq.BOTTOM_RIGHT,[aq.BOTTOM]:aq.TOP,[aq.BOTTOM_LEFT]:aq.TOP_LEFT,[aq.BOTTOM_RIGHT]:aq.TOP_RIGHT,[aq.LEFT]:aq.RIGHT,[aq.LEFT_TOP]:aq.RIGHT_TOP,[aq.LEFT_BOTTOM]:aq.RIGHT_BOTTOM,[aq.RIGHT]:aq.LEFT,[aq.RIGHT_TOP]:aq.LEFT_TOP,[aq.RIGHT_BOTTOM]:aq.LEFT_BOTTOM,[aq.MIDDLE]:aq.MIDDLE,[aq.ABSOLUTE_CENTER]:aq.ABSOLUTE_CENTER};var s=az(e,r);var l=aG(t,s);if(!l){return{position:e,placement:t}}// Try opposite placement
var u=o[t];var c=aQ(u,n,r,i,a);var d=az(c,r);var f=aG(u,d);if(!f){return{position:c,placement:u}}return{position:e,placement:t}};var aX=(e,t,r,n)=>{var{width:i,height:a}=n;// Skip arrow for covered triggers or special placements
var o=[aq.MIDDLE,aq.ABSOLUTE_CENTER].includes(e);var s=r.left<t.left+aj.SAFE_MARGIN&&r.left+i>t.right-aj.SAFE_MARGIN&&r.top<t.top+aj.SAFE_MARGIN&&r.top+a>t.bottom-aj.SAFE_MARGIN;if(o||s)return{};var l=e.startsWith("top")||e.startsWith("bottom");var u=e.startsWith("left")||e.startsWith("right");if(l){var c=t.left+t.width/2;var d=Math.max(aj.SAFE_MARGIN,Math.min(i-aj.MAX_OFFSET_VERTICAL,c-r.left))-aj.CENTER_OFFSET;if(aT/* .isRTL */.V8){d=i-d-aj.CENTER_OFFSET*2}return{arrowLeft:d}}if(u){var f=t.top+t.height/2;var p=Math.max(aj.SAFE_MARGIN,Math.min(a-aj.MAX_OFFSET_HORIZONTAL,f-r.top))-aj.CENTER_OFFSET;return{arrowTop:p}}return{}};var aJ=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:aU;var{width:n,height:i}=t;return{left:Math.max(r,Math.min(window.innerWidth-n-r,e.left)),top:Math.max(r,Math.min(window.innerHeight-i-r,e.top))}};var aZ=e=>{var{isOpen:t,triggerRef:r,placement:i=aq.BOTTOM,arrow:a=false,gap:o=10,autoAdjustOverflow:s=true,positionModifier:l={top:0,left:0},dependencies:u=[]}=e;var c=(0,n.useMemo)(()=>r||{current:null},[r]);var d=(0,n.useRef)(null);var[f,p]=(0,n.useState)(0);var[h,v]=(0,n.useState)({left:0,top:0,placement:aq.BOTTOM});var g=(0,n.useMemo)(()=>{return aT/* .isRTL */.V8?aV(i):i},[i]);var m=(0,n.useMemo)(()=>{return aT/* .isRTL */.V8?aW(l):l},[l]);(0,n.useEffect)(()=>{if(!c.current)return;p(c.current.getBoundingClientRect().width)},[c]);(0,n.useEffect)(()=>{if(!t||!c.current||!d.current)return;var e=c.current.getBoundingClientRect();var r=d.current.getBoundingClientRect();var n={width:r.width||e.width,height:r.height};var i=aQ(g,e,n,o,m);var l=g;if(s){var u=a$(i,g,n,e,o,m);i=u.position;l=u.placement}i=aJ(i,n);var f=a?aX(l,e,i,n):{};v((0,e$._)((0,eX._)((0,e$._)({},i),{placement:l}),f))},[c,d,t,g,m,o,a,s,// eslint-disable-next-line react-hooks/exhaustive-deps
...u]);return{position:h,triggerWidth:f,triggerRef:c,popoverRef:d}};var a0=e=>{var{isOpen:r,children:i,onClickOutside:a,onEscape:o,animationType:s=as.slideDown}=e;var{hasModalOnStack:l}=ah();aB(r);(0,n.useEffect)(()=>{var e=e=>{if(e.key==="Escape"){o===null||o===void 0?void 0:o()}};if(!r)return;document.addEventListener("keydown",e,true);return()=>{document.removeEventListener("keydown",e,true)}},[r,l,o]);var{transitions:u}=au({data:r,animationType:s});return u((e,r)=>{if(!r){return null}return/*#__PURE__*/(0,iW.createPortal)(/*#__PURE__*/(0,t/* .jsx */.Y)(ac,{css:a1.wrapper,style:e,children:/*#__PURE__*/(0,t/* .jsx */.Y)(aO,{children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{className:"tutor-portal-popover",role:"presentation",children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:a1.backdrop,onKeyUp:ej/* .noop */.lQ,onClick:e=>{e.stopPropagation();a===null||a===void 0?void 0:a()}}),i]})})}),document.body)})};var a1={wrapper:/*#__PURE__*/(0,o/* .css */.AH)("position:fixed;z-index:",ey/* .zIndex.highest */.fE.highest,";inset:0;"),backdrop:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.centeredFlex */.x.centeredFlex,";position:fixed;inset:0;z-index:",ey/* .zIndex.negative */.fE.negative,";")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/molecules/Popover.tsx
function a2(){var e=(0,eS._)(["\n              border-left: 8px solid transparent;\n              border-right: 8px solid transparent;\n              border-top: 8px solid ",";\n              border-bottom: none;\n              left: ",";\n              bottom: -8px;\n              transform: ",";\n            "]);a2=function t(){return e};return e}function a6(){var e=(0,eS._)(["\n              border-left: 8px solid transparent;\n              border-right: 8px solid transparent;\n              border-bottom: 8px solid ",";\n              border-top: none;\n              left: ",";\n              top: -8px;\n              transform: ",";\n            "]);a6=function t(){return e};return e}function a4(){var e=(0,eS._)(["\n              border-top: 8px solid transparent;\n              border-bottom: 8px solid transparent;\n              border-left: 8px solid ",";\n              border-right: none;\n              right: -8px;\n              top: ",";\n              transform: ",";\n            "]);a4=function t(){return e};return e}function a5(){var e=(0,eS._)(["\n              border-top: 8px solid transparent;\n              border-bottom: 8px solid transparent;\n              border-right: 8px solid ",";\n              border-left: none;\n              left: -8px;\n              top: ",";\n              transform: ",";\n            "]);a5=function t(){return e};return e}function a3(){var e=(0,eS._)(["\n            content: '';\n            position: absolute;\n            width: 0;\n            height: 0;\n            border-color: transparent;\n            border-style: solid;\n            ","\n            ","\n            ","\n            ","\n          "]);a3=function t(){return e};return e}var a8=e=>{var{children:r,placement:n=aq.BOTTOM,triggerRef:i,isOpen:a,gap:o,maxWidth:s,closePopover:l,closeOnEscape:u=true,animationType:c=as.slideLeft,arrow:d=false,autoAdjustOverflow:f=true,positionModifier:p={top:0,left:0},dependencies:h=[]}=e;var{position:v,triggerWidth:g,popoverRef:m}=aZ({triggerRef:i,isOpen:a,autoAdjustOverflow:f,placement:n,arrow:d,gap:o,positionModifier:p,dependencies:h});return/*#__PURE__*/(0,t/* .jsx */.Y)(a0,{isOpen:a,onClickOutside:l,animationType:c,onEscape:u?l:undefined,children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:a9.wrapper({placement:aT/* .isRTL */.V8?aV(v.placement):v.placement,hideArrow:!d||v.arrowLeft===undefined&&v.arrowTop===undefined,arrowLeft:v.arrowLeft,arrowTop:v.arrowTop}),style:{left:v.left,top:v.top,maxWidth:s!==null&&s!==void 0?s:g},ref:m,children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:a9.content,children:r})})})};var a9={wrapper:e=>{var{placement:t,hideArrow:r,arrowLeft:n,arrowTop:i}=e;return/*#__PURE__*/(0,o/* .css */.AH)("position:absolute;width:100%;z-index:",ey/* .zIndex.dropdown */.fE.dropdown,";&::before{",t&&!r?(0,o/* .css */.AH)(a3(),t.startsWith("top")&&(0,o/* .css */.AH)(a2(),ey/* .colorTokens.stroke.white */.I6.stroke.white,n!==undefined?"".concat(n,"px"):"50%",n===undefined?"translateX(-50%)":"none"),t.startsWith("bottom")&&(0,o/* .css */.AH)(a6(),ey/* .colorTokens.stroke.white */.I6.stroke.white,n!==undefined?"".concat(n,"px"):"50%",n===undefined?"translateX(-50%)":"none"),t.startsWith("left")&&(0,o/* .css */.AH)(a4(),ey/* .colorTokens.stroke.white */.I6.stroke.white,i!==undefined?"".concat(i,"px"):"50%",i===undefined?"translateY(-50%)":"none"),t.startsWith("right")&&(0,o/* .css */.AH)(a5(),ey/* .colorTokens.stroke.white */.I6.stroke.white,i!==undefined?"".concat(i,"px"):"50%",i===undefined?"translateY(-50%)":"none")):"","}")},content:/*#__PURE__*/(0,o/* .css */.AH)("background-color:",ey/* .colorTokens.background.white */.I6.background.white,";box-shadow:",ey/* .shadow.popover */.r7.popover,";border-radius:",ey/* .borderRadius["6"] */.Vq["6"],";::-webkit-scrollbar{background-color:",ey/* .colorTokens.background.white */.I6.background.white,";width:10px;}::-webkit-scrollbar-thumb{background-color:",ey/* .colorTokens.action.secondary["default"] */.I6.action.secondary["default"],";border-radius:",ey/* .borderRadius["6"] */.Vq["6"],";}")};/* ESM default export */const a7=a8;// CONCATENATED MODULE: external "wp.date"
const oe=wp.date;// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/atoms/CheckBox.tsx
function ot(){var e=(0,eS._)(["\n      cursor: not-allowed;\n    "]);ot=function t(){return e};return e}function or(){var e=(0,eS._)(["\n      color: ",";\n    "]);or=function t(){return e};return e}function on(){var e=(0,eS._)(["\n        margin-right: ",";\n      "]);on=function t(){return e};return e}function oi(){var e=(0,eS._)(["\n        background-color: ",";\n      "]);oi=function t(){return e};return e}function oa(){var e=(0,eS._)(["\n      & + span::before {\n        background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='2' fill='none'%3E%3Crect width='10' height='1.5' y='.25' fill='%23fff' rx='.75'/%3E%3C/svg%3E\");\n        background-repeat: no-repeat;\n        background-size: 10px;\n        background-position: center center;\n        background-color: ",";\n        border: 0.5px solid ",";\n      }\n    "]);oa=function t(){return e};return e}function oo(){var e=(0,eS._)(["\n      & + span {\n        cursor: not-allowed;\n\n        &::before {\n          border-color: ",";\n        }\n      }\n    "]);oo=function t(){return e};return e}var os=/*#__PURE__*/i().forwardRef((e,r)=>{var{id:n=(0,ej/* .nanoid */.Ak)(),name:a,labelCss:o,inputCss:s,label:l="",checked:u,value:c,disabled:d=false,onChange:f,onBlur:p,isIndeterminate:h=false}=e;var v=e=>{f===null||f===void 0?void 0:f(!h?e.target.checked:true,e)};var g=e=>{if(typeof e==="string"){return e}if(typeof e==="number"||typeof e==="boolean"||e===null){return String(e)}if(e===undefined){return""}if(/*#__PURE__*/i().isValidElement(e)){var t;var r=(t=e.props)===null||t===void 0?void 0:t.children;if(typeof r==="string"){return r}if(Array.isArray(r)){return r.map(e=>typeof e==="string"?e:"").filter(Boolean).join(" ")}}return""};return/*#__PURE__*/(0,t/* .jsxs */.FD)("label",{htmlFor:n,css:[ol.container({disabled:d}),o],children:[/*#__PURE__*/(0,t/* .jsx */.Y)("input",(0,eX._)((0,e$._)({},e),{ref:r,id:n,name:a,type:"checkbox",value:c,checked:!!u,disabled:d,"aria-invalid":e["aria-invalid"],onChange:v,onBlur:p,css:[s,ol.checkbox({label:!!l,isIndeterminate:h,disabled:d})]})),/*#__PURE__*/(0,t/* .jsx */.Y)("span",{}),/*#__PURE__*/(0,t/* .jsx */.Y)("span",{css:[ol.label({isDisabled:d}),o],title:g(l),children:l})]})});var ol={container:e=>{var{disabled:t=false}=e;return/*#__PURE__*/(0,o/* .css */.AH)("position:relative;display:flex;align-items:center;cursor:pointer;user-select:none;color:",ey/* .colorTokens.text.title */.I6.text.title,";",t&&(0,o/* .css */.AH)(ot()))},label:e=>{var{isDisabled:t=false}=e;return/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.caption */.I.caption(),";color:",ey/* .colorTokens.text.title */.I6.text.title,";",t&&(0,o/* .css */.AH)(or(),ey/* .colorTokens.text.disable */.I6.text.disable))},checkbox:e=>{var{label:t,isIndeterminate:r,disabled:n}=e;return/*#__PURE__*/(0,o/* .css */.AH)("position:absolute;opacity:0 !important;height:0;width:0;& + span{position:relative;cursor:pointer;display:inline-flex;align-items:center;",t&&(0,o/* .css */.AH)(on(),ey/* .spacing["10"] */.YK["10"]),"}& + span::before{content:'';background-color:",ey/* .colorTokens.background.white */.I6.background.white,";border:1px solid ",ey/* .colorTokens.stroke["default"] */.I6.stroke["default"],";border-radius:3px;width:20px;height:20px;}&:checked + span::before{background-image:url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iOSIgdmlld0JveD0iMCAwIDEyIDkiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0wLjE2NTM0NCA0Ljg5OTQ2QzAuMTEzMjM1IDQuODQ0OTcgMC4wNzE3MzQ2IDQuNzgxMTUgMC4wNDI5ODg3IDQuNzExM0MtMC4wMTQzMjk2IDQuNTU1NjQgLTAuMDE0MzI5NiA0LjM4NDQ5IDAuMDQyOTg4NyA0LjIyODg0QzAuMDcxMTU0OSA0LjE1ODY4IDAuMTEyNzIzIDQuMDk0NzUgMC4xNjUzNDQgNC4wNDA2OEwxLjAzMzgyIDMuMjAzNkMxLjA4NDkzIDMuMTQzNCAxLjE0ODkgMy4wOTU1NyAxLjIyMDk2IDMuMDYzNjlDMS4yOTAzMiAzLjAzMjEzIDEuMzY1NTQgMy4wMTU2OSAxLjQ0MTY3IDMuMDE1NDRDMS41MjQxOCAzLjAxMzgzIDEuNjA2MDUgMy4wMzAyOSAxLjY4MTU5IDMuMDYzNjlDMS43NTYyNiAzLjA5NzA3IDEuODIzODYgMy4xNDQ1NyAxLjg4MDcxIDMuMjAzNkw0LjUwMDU1IDUuODQyNjhMMTAuMTI0MSAwLjE4ODIwNUMxMC4xNzk0IDAuMTI5NTQ0IDEwLjI0NTQgMC4wODIwNTQyIDEwLjMxODQgMC4wNDgyOTA4QzEwLjM5NDEgMC4wMTU0NjYxIDEwLjQ3NTkgLTAuMDAwOTcyMDU3IDEwLjU1ODMgNC40NDIyOGUtMDVDMTAuNjM1NyAwLjAwMDQ3NTMxOCAxMC43MTIxIDAuMDE3NDc5NSAxMC43ODI0IDAuMDQ5OTI0MkMxMC44NTI3IDAuMDgyMzY4OSAxMC45MTU0IDAuMTI5NTA5IDEwLjk2NjIgMC4xODgyMDVMMTEuODM0NyAxLjAzNzM0QzExLjg4NzMgMS4wOTE0MiAxMS45Mjg4IDEuMTU1MzQgMTEuOTU3IDEuMjI1NUMxMi4wMTQzIDEuMzgxMTYgMTIuMDE0MyAxLjU1MjMxIDExLjk1NyAxLjcwNzk2QzExLjkyODMgMS43Nzc4MSAxMS44ODY4IDEuODQxNjMgMTEuODM0NyAxLjg5NjEzTDQuOTIyOCA4LjgwOTgyQzQuODcxMjkgOC44NzAyMSA0LjgwNzQ3IDguOTE4NzUgNC43MzU2NiA4Ljk1MjE1QzQuNTgyMDIgOS4wMTU5NSA0LjQwOTQ5IDkuMDE1OTUgNC4yNTU4NCA4Ljk1MjE1QzQuMTg0MDQgOC45MTg3NSA0LjEyMDIyIDguODcwMjEgNC4wNjg3MSA4LjgwOTgyTDAuMTY1MzQ0IDQuODk5NDZaIiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K');background-repeat:no-repeat;background-size:10px 10px;background-position:center center;border-color:transparent;background-color:",ey/* .colorTokens.icon.brand */.I6.icon.brand,";border-radius:",ey/* .borderRadius["4"] */.Vq["4"],";",n&&(0,o/* .css */.AH)(oi(),ey/* .colorTokens.icon.disable["default"] */.I6.icon.disable["default"]),"}",r&&(0,o/* .css */.AH)(oa(),ey/* .colorTokens.brand.blue */.I6.brand.blue,ey/* .colorTokens.stroke.white */.I6.stroke.white)," ",n&&(0,o/* .css */.AH)(oo(),ey/* .colorTokens.stroke.disable */.I6.stroke.disable),"    &:focus-visible{& + span{border-radius:",ey/* .borderRadius["2"] */.Vq["2"],";outline:2px solid ",ey/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:1px;}}")}};/* ESM default export */const ou=os;// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/hooks/useDebounce.ts
var oc=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:300;var[r,i]=(0,n.useState)(e);(0,n.useEffect)(()=>{var r=setTimeout(()=>{i(e)},t);return()=>{clearTimeout(r)}},[e,t]);return r};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/hooks/useIntersectionObserver.ts
var od=function(){var{threshold:e=0,root:t=null,rootMargin:r="0%",freezeOnceVisible:i=false,dependencies:a=[]}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var o=(0,n.useRef)(null);var[s,l]=(0,n.useState)();var u=(s===null||s===void 0?void 0:s.isIntersecting)&&i;var c=e=>{var[t]=e;l(t)};(0,n.useEffect)(()=>{var n=o.current;var i=(0,eO/* .isDefined */.O9)(window.IntersectionObserver);if(!i||u||!n){if(!n){l(undefined)}return}var a={threshold:e,root:t,rootMargin:r};var s=new IntersectionObserver(c,a);s.observe(n);return()=>s.disconnect();// eslint-disable-next-line react-hooks/exhaustive-deps
},[o.current,e,t,r,u,...a]);return{intersectionEntry:s,intersectionElementRef:o}};/* ESM default export */const of=od;// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/atoms/Select.tsx
function op(){var e=(0,eS._)(["\n      display: flex;\n      flex-direction: row;\n      align-items: center;\n      justify-content: space-between;\n\n      > div {\n        flex: 1;\n      }\n    "]);op=function t(){return e};return e}function oh(){var e=(0,eS._)(["\n      flex: 1;\n    "]);oh=function t(){return e};return e}function ov(){var e=(0,eS._)(["\n        cursor: pointer;\n      "]);ov=function t(){return e};return e}function og(){var e=(0,eS._)(["\n        height: 32px;\n      "]);og=function t(){return e};return e}function om(){var e=(0,eS._)(["\n        color: ",";\n\n        &:hover {\n          text-decoration: underline;\n        }\n      "]);om=function t(){return e};return e}function ob(){var e=(0,eS._)(["\n      pointer-events: none;\n\n      > button {\n        color: ",";\n      }\n    "]);ob=function t(){return e};return e}function oy(){var e=(0,eS._)(["\n      > button {\n        ",";\n      }\n    "]);oy=function t(){return e};return e}function o_(){var e=(0,eS._)(["\n      background-color: ",";\n      position: relative;\n\n      &::before {\n        content: '';\n        position: absolute;\n        top: 0;\n        left: 0;\n        width: 3px;\n        height: 100%;\n        background-color: ",";\n        border-radius: 0 "," "," 0;\n      }\n    "]);o_=function t(){return e};return e}function ow(){var e=(0,eS._)(["\n      transform: rotate(180deg);\n    "]);ow=function t(){return e};return e}function ox(){var e=(0,eS._)(["\n      display: none;\n    "]);ox=function t(){return e};return e}var oA=20;var ok=e=>{var{options:r,onChange:i=ej/* .noop */.lQ,clearOption:a=ej/* .noop */.lQ,label:o,placeholder:s="",readOnly:l,isSearchable:u=false,isClearable:c=true,isInlineLabel:d=false,isFontWeight:f=false,value:p,caretSize:h=20,infiniteScroll:v=false,wrapperStyle:g,inputCss:m,disabled:b,size:y="regular",optionsStyleVariant:_="regular"}=e;var w=(0,ej/* .nanoid */.Ak)();var[x,A]=(0,n.useState)("");var[k,E]=(0,n.useState)("");var[I,C]=(0,n.useState)(false);var[Y,T]=(0,n.useState)([]);var S=(0,n.useRef)(null);var O=oc(k);(0,n.useEffect)(()=>{var e;var t;var n=(t=(e=r.find(e=>String(e.value)===String(p===null||p===void 0?void 0:p.value)))===null||e===void 0?void 0:e.label)!==null&&t!==void 0?t:"";A(n)},[r,p]);var D=(0,n.useMemo)(()=>{T([]);if(u){return r.filter(e=>{var{label:t}=e;return t.toLowerCase().startsWith(O.toLowerCase())})}return r},[O,u,r]);var{intersectionEntry:F,intersectionElementRef:R}=of();var P=D.length>Y.length;(0,n.useEffect)(()=>{if(!v){T(D);return}if(!(F===null||F===void 0?void 0:F.isIntersecting)||!P){return}var e=Y.length;var t=e+oA;T(r=>[...r,...D.slice(e,t)]);// eslint-disable-next-line react-hooks/exhaustive-deps
},[D,F===null||F===void 0?void 0:F.isIntersecting]);return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:[oI.mainWrapper,g],children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:oI.inputLabelWrapper(d),ref:S,children:[!!o&&/*#__PURE__*/(0,t/* .jsx */.Y)("label",{htmlFor:w,css:oI.label(d),children:o}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:[oI.inputWrapper,m],children:[/*#__PURE__*/(0,t/* .jsx */.Y)("input",{id:w,onClick:()=>C(e=>!e),css:oI.input({isSearchable:u,size:y}),autoComplete:"off",readOnly:l||!u,placeholder:s,value:x,onChange:e=>{A(e.target.value);E(e.target.value)},disabled:b,"data-select":true}),/*#__PURE__*/(0,t/* .jsx */.Y)("button",{type:"button",css:oI.caretButton,onClick:()=>{C(e=>!e)},disabled:b||l||r.length===0,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"chevronDown",width:h,height:h,style:oI.toggleIcon({isOpen:I})})})]})]}),/*#__PURE__*/(0,t/* .jsxs */.FD)(a7,{triggerRef:S,isOpen:I,closePopover:()=>C(false),animationType:as.slideDown,children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("ul",{css:oI.options,children:[Y.map(e=>/*#__PURE__*/(0,t/* .jsx */.Y)("li",{css:oI.optionItem({isSelected:e.value===(p===null||p===void 0?void 0:p.value),optionsStyleVariant:_,isDisabled:!!e.disabled}),children:/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"text",buttonCss:oI.optionButton({fontWeight:f?e.value:"inherit"}),onClick:()=>{A(e.label);E("");i(e);C(false)},children:e.label})},String(e.value))),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{ref:R,css:oI.spinnerWrapper({isVisible:P}),children:/*#__PURE__*/(0,t/* .jsx */.Y)(eT,{})})]}),c&&/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:oI.clearButton({isDisabled:x===""}),children:/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"text",disabled:x==="",icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"delete"}),onClick:()=>{a();A("");E("");C(false)},children:(0,em.__)("Clear","tutor-pro")})})]})]})};/* ESM default export */const oE=ok;var oI={mainWrapper:/*#__PURE__*/(0,o/* .css */.AH)("width:100%;"),inputLabelWrapper:e=>/*#__PURE__*/(0,o/* .css */.AH)("width:100%;display:flex;flex-direction:column;gap:",ey/* .spacing["4"] */.YK["4"],";",e&&(0,o/* .css */.AH)(op())),label:e=>/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.caption */.I.caption()," ",e&&(0,o/* .css */.AH)(oh())),inputWrapper:/*#__PURE__*/(0,o/* .css */.AH)("width:100%;position:relative;"),input:e=>{var{isSearchable:t,size:r}=e;return/*#__PURE__*/(0,o/* .css */.AH)("&[data-select]{",eK/* .typography.body */.I.body(),";width:100%;height:40px;background-color:",ey/* .colorTokens.background.white */.I6.background.white,";border-radius:",ey/* .borderRadius["6"] */.Vq["6"],";border:1px solid ",ey/* .colorTokens.stroke["default"] */.I6.stroke["default"],";box-shadow:",ey/* .shadow.input */.r7.input,";padding:",ey/* .spacing["8"] */.YK["8"]," ",ey/* .spacing["32"] */.YK["32"]," ",ey/* .spacing["8"] */.YK["8"]," ",ey/* .spacing["16"] */.YK["16"],";color:",ey/* .colorTokens.text.primary */.I6.text.primary,";appearance:textfield;transition:all 0.15s ease-in-out;",!t&&(0,o/* .css */.AH)(ov()),":focus{",eB/* .styleUtils.inputFocus */.x.inputFocus,";}:disabled{color:",ey/* .colorTokens.text.disable */.I6.text.disable,";cursor:not-allowed;}::-webkit-outer-spin-button,::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}::placeholder{color:",ey/* .colorTokens.text.subdued */.I6.text.subdued,";}",r==="small"&&(0,o/* .css */.AH)(og()),"}")},clearButton:e=>{var{isDisabled:t=false}=e;return/*#__PURE__*/(0,o/* .css */.AH)("padding:",ey/* .spacing["4"] */.YK["4"]," ",ey/* .spacing["8"] */.YK["8"],";border-top:1px solid ",ey/* .colorTokens.stroke["default"] */.I6.stroke["default"],";display:flex;justify-content:center;min-height:40px;& > button{padding:0;width:100%;font-size:",ey/* .fontSize["12"] */.J["12"],";> span{justify-content:center;}",!t&&(0,o/* .css */.AH)(om(),ey/* .colorTokens.text.title */.I6.text.title),"}")},options:/*#__PURE__*/(0,o/* .css */.AH)("list-style-type:none;max-height:500px;padding:",ey/* .spacing["4"] */.YK["4"]," 0;margin:0;",eB/* .styleUtils.overflowYAuto */.x.overflowYAuto,";"),optionItem:e=>{var{isSelected:t=false,isDisabled:r=false,optionsStyleVariant:n="regular"}=e;return/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.body */.I.body(),";min-height:36px;height:100%;width:100%;display:flex;align-items:center;transition:background-color 0.3s ease-in-out;cursor:pointer;",r&&(0,o/* .css */.AH)(ob(),ey/* .colorTokens.text.disable */.I6.text.disable),"    &:hover{background-color:",ey/* .colorTokens.background.hover */.I6.background.hover,";}",n==="small"&&(0,o/* .css */.AH)(oy(),eK/* .typography.caption */.I.caption())," ",t&&(0,o/* .css */.AH)(o_(),ey/* .colorTokens.background.active */.I6.background.active,ey/* .colorTokens.brand.blue */.I6.brand.blue,ey/* .borderRadius["6"] */.Vq["6"],ey/* .borderRadius["6"] */.Vq["6"]))},optionButton:e=>{var{fontWeight:t="inherit"}=e;return/*#__PURE__*/(0,o/* .css */.AH)("width:100%;justify-content:start;padding:",ey/* .spacing["6"] */.YK["6"]," ",ey/* .spacing["12"] */.YK["12"],";font-weight:",t,";color:",ey/* .colorTokens.text.title */.I6.text.title,";:hover{text-decoration:none;}:focus{box-shadow:none;}")},toggleIcon:e=>{var{isOpen:t=false}=e;return/*#__PURE__*/(0,o/* .css */.AH)("color:",ey/* .colorTokens.icon["default"] */.I6.icon["default"],";transition:transform 0.3s ease-in-out;",t&&(0,o/* .css */.AH)(ow()))},optionsContainer:/*#__PURE__*/(0,o/* .css */.AH)("position:absolute;overflow:hidden auto;min-width:16px;min-height:16px;max-width:calc(100% - 32px);max-height:calc(100% - 32px);"),caretButton:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.resetButton */.x.resetButton,";position:absolute;top:0;bottom:0;right:",ey/* .spacing["8"] */.YK["8"],";margin:auto 0;display:flex;align-items:center;"),spinnerWrapper:e=>{var{isVisible:t=false}=e;return/*#__PURE__*/(0,o/* .css */.AH)("width:100%;display:flex;justify-content:center;align-items:center;",!t&&(0,o/* .css */.AH)(ox()))}};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/ErrorBoundary.tsx
var oC;if(false){}else{// eslint-disable-next-line @typescript-eslint/no-require-imports
oC=r(5226)/* ["default"] */.A}var oY=e=>{var{children:r}=e;return/*#__PURE__*/(0,t/* .jsx */.Y)(oC,{children:r})};/* ESM default export */const oT=oY;// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/modals/BasicModalWrapper.tsx
function oS(){var e=(0,eS._)(["\n      max-width: 100vw;\n      width: 100vw;\n      height: 95vh;\n    "]);oS=function t(){return e};return e}function oO(){var e=(0,eS._)(["\n      position: absolute;\n      right: ",";\n      top: ",";\n    "]);oO=function t(){return e};return e}function oD(){var e=(0,eS._)(["\n      height: calc(100% - ","px);\n    "]);oD=function t(){return e};return e}var oF=e=>{var{children:r,onClose:n,title:i,subtitle:a,icon:o,entireHeader:s,actions:l,fullScreen:u,modalStyle:c,maxWidth:d=aT/* .modal.BASIC_MODAL_MAX_WIDTH */.yl.BASIC_MODAL_MAX_WIDTH,isCloseAble:f=true,blurTriggerElement:p=true}=e;aB();return/*#__PURE__*/(0,t/* .jsx */.Y)(aO,{blurPrevious:p,children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:[oP.container({isFullScreen:u}),c],style:{maxWidth:"".concat(d,"px")},children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:oP.header({hasEntireHeader:!!s}),children:[/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:!s,fallback:s,children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:oP.headerContent,children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:oP.iconWithTitle,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:o,children:o}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:i,children:/*#__PURE__*/(0,t/* .jsx */.Y)("p",{css:oP.title,children:i})})]}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:a,children:/*#__PURE__*/(0,t/* .jsx */.Y)("span",{css:oP.subtitle,children:a})})]})}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:oP.actionsWrapper({hasEntireHeader:!!s}),children:/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:l,fallback:/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:f,children:/*#__PURE__*/(0,t/* .jsx */.Y)("button",{"data-cy":"close-modal",type:"button",css:oP.closeButton,onClick:n,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"timesThin",width:24,height:24})})}),children:l})})]}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:oP.content({isFullScreen:u}),children:/*#__PURE__*/(0,t/* .jsx */.Y)(oT,{children:r})})]})})};/* ESM default export */const oR=oF;var oP={container:e=>{var{isFullScreen:t}=e;return/*#__PURE__*/(0,o/* .css */.AH)("position:relative;background:",ey/* .colorTokens.background.white */.I6.background.white,";box-shadow:",ey/* .shadow.modal */.r7.modal,";border-radius:",ey/* .borderRadius["10"] */.Vq["10"],";overflow:hidden;top:50%;left:50%;transform:translate(-50%,-50%);",t&&(0,o/* .css */.AH)(oS())," ",ey/* .Breakpoint.smallTablet */.EA.smallTablet,"{width:90%;}")},header:e=>{var{hasEntireHeader:t}=e;return/*#__PURE__*/(0,o/* .css */.AH)("display:flex;align-items:center;justify-content:space-between;width:100%;height:",!t?"".concat(aT/* .modal.BASIC_MODAL_HEADER_HEIGHT */.yl.BASIC_MODAL_HEADER_HEIGHT,"px"):"auto",";background:",ey/* .colorTokens.background.white */.I6.background.white,";border-bottom:",!t?"1px solid ".concat(ey/* .colorTokens.stroke.divider */.I6.stroke.divider):"none",";padding-inline:",ey/* .spacing["16"] */.YK["16"],";")},headerContent:/*#__PURE__*/(0,o/* .css */.AH)("place-self:center start;display:inline-flex;align-items:center;gap:",ey/* .spacing["12"] */.YK["12"],";"),iconWithTitle:/*#__PURE__*/(0,o/* .css */.AH)("display:inline-flex;align-items:center;gap:",ey/* .spacing["4"] */.YK["4"],";color:",ey/* .colorTokens.icon["default"] */.I6.icon["default"],";"),title:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.body */.I.body("medium"),";color:",ey/* .colorTokens.text.title */.I6.text.title,";"),subtitle:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.text.ellipsis */.x.text.ellipsis(1)," ",eK/* .typography.caption */.I.caption(),";color:",ey/* .colorTokens.text.hints */.I6.text.hints,";"),actionsWrapper:e=>{var{hasEntireHeader:t}=e;return/*#__PURE__*/(0,o/* .css */.AH)("place-self:center end;display:inline-flex;gap:",ey/* .spacing["16"] */.YK["16"],";",t&&(0,o/* .css */.AH)(oO(),ey/* .spacing["16"] */.YK["16"],ey/* .spacing["16"] */.YK["16"]))},closeButton:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.resetButton */.x.resetButton,";display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:",ey/* .borderRadius.circle */.Vq.circle,";background:",ey/* .colorTokens.background.white */.I6.background.white,";&:focus,&:active,&:hover{background:",ey/* .colorTokens.background.white */.I6.background.white,";}svg{color:",ey/* .colorTokens.icon["default"] */.I6.icon["default"],";transition:color 0.3s ease-in-out;}:hover{svg{color:",ey/* .colorTokens.icon.hover */.I6.icon.hover,";}}:focus{box-shadow:",ey/* .shadow.focus */.r7.focus,";}"),content:e=>{var{isFullScreen:t}=e;return/*#__PURE__*/(0,o/* .css */.AH)("background-color:",ey/* .colorTokens.background.white */.I6.background.white,";overflow-y:auto;max-height:90vh;",t&&(0,o/* .css */.AH)(oD(),aT/* .modal.BASIC_MODAL_HEADER_HEIGHT */.yl.BASIC_MODAL_HEADER_HEIGHT))}};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/modals/ConfirmationModal.tsx
var oM=e=>{var{title:r,description:n,confirmButtonText:i,cancelButtonText:a,confirmButtonVariant:o,closeModal:s,onConfirm:l,isLoading:u=false,icon:c,maxWidth:d=460}=e;return/*#__PURE__*/(0,t/* .jsxs */.FD)(oR,{icon:c,onClose:()=>s({action:"CLOSE"}),title:r,maxWidth:d,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:oN.content,children:n!==null&&n!==void 0?n:(0,em.__)("Once you perform this action this can’t be undone.","tutor-pro")}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:oN.footerWrapper,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"text",onClick:()=>s({action:"CLOSE"}),size:"small",children:a!==null&&a!==void 0?a:(0,em.__)("Cancel","tutor-pro")}),/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:o!==null&&o!==void 0?o:"danger",size:"small",loading:u,onClick:()=>{if(l){l()}else{s({action:"CONFIRM"})}},children:i!==null&&i!==void 0?i:(0,em.__)("Delete","tutor-pro")})]})]})};/* ESM default export */const oH=oM;var oN={content:/*#__PURE__*/(0,o/* .css */.AH)("font-size:",ey/* .fontSize["14"] */.J["14"],";line-height:",ey/* .lineHeight["20"] */.K_["20"],";color:",ey/* .colorTokens.text.subdued */.I6.text.subdued,";padding:",ey/* .spacing["20"] */.YK["20"],";"),footerWrapper:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;justify-content:end;gap:",ey/* .spacing["8"] */.YK["8"],";padding:",ey/* .spacing["12"] */.YK["12"]," ",ey/* .spacing["16"] */.YK["16"],";box-shadow:",ey/* .shadow.dividerTop */.r7.dividerTop,";")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/molecules/Paginator.tsx
var oL=e=>{var{currentPage:r,onPageChange:i,totalItems:a,itemsPerPage:o}=e;var s=Math.max(Math.ceil(a/o),1);var[l,u]=(0,n.useState)("");(0,n.useEffect)(()=>{u(r.toString())},[r]);var c=e=>{if(e<1||e>s){return}i(e)};return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:oB.wrapper,children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:oB.pageStatus,children:[(0,em.__)("Page","tutor-pro"),/*#__PURE__*/(0,t/* .jsx */.Y)("span",{children:/*#__PURE__*/(0,t/* .jsx */.Y)("input",{type:"text",css:oB.paginationInput,value:l,onChange:e=>{var{value:t}=e.currentTarget;var r=t.replace(/[^0-9]/g,"");var n=Number(r);if(n>0&&n<=s){u(r);i(n)}else if(!r){u(r)}},autoComplete:"off"})}),(0,em.__)("of","tutor-pro")," ",/*#__PURE__*/(0,t/* .jsx */.Y)("span",{children:s})]}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:oB.pageController,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("button",{type:"button",css:oB.paginationButton,onClick:()=>c(r-1),disabled:r===1,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:!aT/* .isRTL */.V8?"chevronLeft":"chevronRight",width:32,height:32})}),/*#__PURE__*/(0,t/* .jsx */.Y)("button",{type:"button",css:oB.paginationButton,onClick:()=>c(r+1),disabled:r===s,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:!aT/* .isRTL */.V8?"chevronRight":"chevronLeft",width:32,height:32})})]})]})};/* ESM default export */const oK=oL;var oB={wrapper:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;justify-content:end;align-items:center;flex-wrap:wrap;gap:",ey/* .spacing["8"] */.YK["8"],";height:36px;"),pageStatus:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.body */.I.body(),"    color:",ey/* .colorTokens.text.title */.I6.text.title,";min-width:100px;"),paginationInput:/*#__PURE__*/(0,o/* .css */.AH)("outline:0;border:1px solid ",ey/* .colorTokens.stroke["default"] */.I6.stroke["default"],";border-radius:",ey/* .borderRadius["6"] */.Vq["6"],";margin:0 ",ey/* .spacing["8"] */.YK["8"],";color:",ey/* .colorTokens.text.subdued */.I6.text.subdued,";padding:8px 12px;width:72px;&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none;margin:",ey/* .spacing["0"] */.YK["0"],";}&[type='number']{-moz-appearance:textfield;}"),pageController:/*#__PURE__*/(0,o/* .css */.AH)("gap:",ey/* .spacing["8"] */.YK["8"],";display:flex;justify-content:center;align-items:center;height:100%;"),paginationButton:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.resetButton */.x.resetButton,";background:",ey/* .colorTokens.background.white */.I6.background.white,";color:",ey/* .colorTokens.icon["default"] */.I6.icon["default"],";border-radius:",ey/* .borderRadius["6"] */.Vq["6"],";height:32px;width:32px;display:grid;place-items:center;transition:background-color 0.2s ease-in-out,color 0.3s ease-in-out;svg{color:",ey/* .colorTokens.icon["default"] */.I6.icon["default"],";}&:hover{background:",ey/* .colorTokens.background["default"] */.I6.background["default"],";& > svg{color:",ey/* .colorTokens.icon.brand */.I6.icon.brand,";}}&:disabled{background:",ey/* .colorTokens.background.white */.I6.background.white,";& > svg{color:",ey/* .colorTokens.icon.disable["default"] */.I6.icon.disable["default"],";}}")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/molecules/Table.tsx
function oj(){var e=(0,eS._)(["\n      border: 1px solid ",";\n      border-radius: ",";\n    "]);oj=function t(){return e};return e}function oU(){var e=(0,eS._)(["\n      border-bottom: 1px solid ",";\n    "]);oU=function t(){return e};return e}function oq(){var e=(0,eS._)(["\n      &:nth-of-type(even) {\n        background-color: ",";\n      }\n    "]);oq=function t(){return e};return e}function oV(){var e=(0,eS._)(["\n        background-color: ",";\n      "]);oV=function t(){return e};return e}function oW(){var e=(0,eS._)(["\n        background-color: ",";\n      "]);oW=function t(){return e};return e}function oz(){var e=(0,eS._)(["\n        :last-of-type {\n          border-bottom: none;\n        }\n      "]);oz=function t(){return e};return e}var oG={bodyRowSelected:ey/* .colorTokens.background.active */.I6.background.active,bodyRowHover:ey/* .colorTokens.background.hover */.I6.background.hover};var oQ=e=>{var{columns:r,data:n,entireHeader:i=null,headerHeight:a=60,noHeader:s=false,isStriped:l=false,isRounded:u=false,stripedBySelectedIndex:c=[],colors:d={},isBordered:f=true,loading:p=false,itemsPerPage:h=1,querySortProperties:v,querySortDirections:g={},onSortClick:m,renderInLastRow:b,rowStyle:y,sortIcons:_={asc:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"sortASC",height:16,width:16}),desc:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"sortDESC",height:16,width:16})}}=e;var w=(e,n)=>{return/*#__PURE__*/(0,t/* .jsx */.Y)("tr",{css:[oX.tableRow({isBordered:f,isStriped:l}),oX.bodyTr({colors:d,isSelected:c.includes(e),isRounded:u}),y],children:r.map((e,r)=>{return/*#__PURE__*/(0,t/* .jsx */.Y)("td",{css:[oX.td,{width:e.width}],children:n(e)},r)})},e)};var x=e=>{var r=null;var n=e.sortProperty;if(!n){return e.Header}if(v===null||v===void 0?void 0:v.includes(n)){if((g===null||g===void 0?void 0:g[n])==="asc"){r=_.asc}else{r=_.desc}}return/*#__PURE__*/(0,t/* .jsxs */.FD)("button",{type:"button",css:oX.headerWithIcon,onClick:()=>m===null||m===void 0?void 0:m(n),children:[e.Header,r&&r]})};var A=()=>{if(i){return/*#__PURE__*/(0,t/* .jsx */.Y)("th",{css:oX.th,colSpan:r.length,children:i})}return r.map((e,r)=>{if(e.Header!==null){return/*#__PURE__*/(0,t/* .jsx */.Y)("th",{css:[oX.th,e.css,{width:e.width}],colSpan:e.headerColSpan,children:x(e)},r)}})};var k=()=>{if(p){return(0,ej/* .range */.y1)(h).map(e=>w(e,()=>/*#__PURE__*/(0,t/* .jsx */.Y)(eM,{animation:true,height:20,width:"".concat((0,ej/* .getRandom */.G0)(40,80),"%")})))}if(!n.length){return/*#__PURE__*/(0,t/* .jsx */.Y)("tr",{css:oX.tableRow({isBordered:false,isStriped:false}),children:/*#__PURE__*/(0,t/* .jsx */.Y)("td",{colSpan:r.length,css:[oX.td,/*#__PURE__*/(0,o/* .css */.AH)("text-align:center;")],children:"No Data!"})})}var e=n.map((e,t)=>{return w(t,r=>{return"Cell"in r?r.Cell(e,t):r.accessor(e,t)})});if(b){b=/*#__PURE__*/(0,t/* .jsx */.Y)("tr",{children:/*#__PURE__*/(0,t/* .jsx */.Y)("td",{css:oX.td,children:b})},e.length);e.push(b)}return e};return/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:oX.tableContainer({isRounded:u}),children:/*#__PURE__*/(0,t/* .jsxs */.FD)("table",{css:oX.table,children:[!s&&/*#__PURE__*/(0,t/* .jsx */.Y)("thead",{children:/*#__PURE__*/(0,t/* .jsx */.Y)("tr",{css:[oX.tableRow({isBordered:f,isStriped:l}),{height:a}],children:A()})}),/*#__PURE__*/(0,t/* .jsx */.Y)("tbody",{children:k()})]})})};/* ESM default export */const o$=oQ;var oX={tableContainer:e=>{var{isRounded:t}=e;return/*#__PURE__*/(0,o/* .css */.AH)("display:block;width:100%;overflow-x:auto;",t&&(0,o/* .css */.AH)(oj(),ey/* .colorTokens.stroke.divider */.I6.stroke.divider,ey/* .borderRadius["6"] */.Vq["6"]))},headerWithIcon:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.resetButton */.x.resetButton,";",eK/* .typography.body */.I.body(),";color:",ey/* .colorTokens.text.subdued */.I6.text.subdued,";display:flex;gap:",ey/* .spacing["8"] */.YK["8"],";align-items:center;svg{color:",ey/* .colorTokens.text.primary */.I6.text.primary,";}"),table:/*#__PURE__*/(0,o/* .css */.AH)("width:100%;border-collapse:collapse;border:none;"),tableRow:e=>{var{isBordered:t,isStriped:r}=e;return/*#__PURE__*/(0,o/* .css */.AH)(t&&(0,o/* .css */.AH)(oU(),ey/* .colorTokens.stroke.divider */.I6.stroke.divider)," ",r&&(0,o/* .css */.AH)(oq(),ey/* .colorTokens.background.active */.I6.background.active))},th:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.body */.I.body(),";background-color:",ey/* .colorTokens.background.white */.I6.background.white,";color:",ey/* .colorTokens.text.primary */.I6.text.primary,";padding:0 ",ey/* .spacing["16"] */.YK["16"],";border:none;"),bodyTr:e=>{var{colors:t,isSelected:r,isRounded:n}=e;var{bodyRowDefault:i,bodyRowSelectedHover:a,bodyRowHover:s=oG.bodyRowHover,bodyRowSelected:l=oG.bodyRowSelected}=t;return/*#__PURE__*/(0,o/* .css */.AH)(i&&(0,o/* .css */.AH)(oV(),i),"      &:hover{background-color:",r&&a?a:s,";}",r&&(0,o/* .css */.AH)(oW(),l)," ",n&&(0,o/* .css */.AH)(oz()))},td:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.body */.I.body(),";padding:",ey/* .spacing["16"] */.YK["16"],";border:none;")};// EXTERNAL MODULE: ../tutor/node_modules/polished/lib/color/rgba.js
var oJ=r(3458);var oZ=/*#__PURE__*/r.n(oJ);// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/molecules/ThreeDots.tsx
function o0(){var e=(0,eS._)(["\n      padding-block: ",";\n    "]);o0=function t(){return e};return e}function o1(){var e=(0,eS._)(["\n      padding: "," ",";\n      ",";\n    "]);o1=function t(){return e};return e}function o2(){var e=(0,eS._)(["\n      color: ",";\n      svg {\n        color: ",";\n      }\n\n      &:hover:not(:disabled) {\n        color: ",";\n        background-color: ",";\n\n        svg {\n          color: ",";\n        }\n      }\n\n      &:active {\n        color: ",";\n        background-color: ",";\n\n        svg {\n          color: ",";\n        }\n      }\n    "]);o2=function t(){return e};return e}function o6(){var e=(0,eS._)(["\n      background-color: ",";\n      svg {\n        color: ",";\n      }\n    "]);o6=function t(){return e};return e}function o4(){var e=(0,eS._)(["\n      background-color: ",";\n      :hover {\n        background-color: ",";\n        svg {\n          color: ",";\n        }\n      }\n    "]);o4=function t(){return e};return e}var o5=e=>{var{text:r,icon:n,onClick:i,onClosePopover:a,isTrash:o=false,size:s="medium",buttonCss:l,disabled:u}=e,c=(0,eJ._)(e,["text","icon","onClick","onClosePopover","isTrash","size","buttonCss","disabled"]);return/*#__PURE__*/(0,t/* .jsxs */.FD)("button",(0,eX._)((0,e$._)({type:"button",css:[o9.option({isTrash:o,size:s}),l],onClick:e=>{if(i){i(e)}if(a){a()}},disabled:u},c),{children:[n&&n,/*#__PURE__*/(0,t/* .jsx */.Y)("span",{children:r})]}))};var o3=e=>{var{onClick:r,isOpen:a,disabled:o=false,closePopover:s,placement:l=aq.BOTTOM_RIGHT,children:u,animationType:c=as.slideLeft,dotsOrientation:d="horizontal",maxWidth:f="148px",isInverse:p=false,arrow:h=false,size:v="medium",closeOnEscape:g=true,wrapperCss:m}=e,b=(0,eJ._)(e,["onClick","isOpen","disabled","closePopover","placement","children","animationType","dotsOrientation","maxWidth","isInverse","arrow","size","closeOnEscape","wrapperCss"]);var y=(0,n.useRef)(null);return/*#__PURE__*/(0,t/* .jsxs */.FD)(t/* .Fragment */.FK,{children:[/*#__PURE__*/(0,t/* .jsx */.Y)("button",(0,eX._)((0,e$._)({type:"button",ref:y,onClick:r,css:[o9.button({isOpen:a,isInverse:p,isDisabled:o}),m],disabled:o},b),{children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:d==="horizontal"?"threeDots":"threeDotsVertical",width:32,height:32})})),/*#__PURE__*/(0,t/* .jsx */.Y)(a7,{gap:13,maxWidth:f,placement:l,triggerRef:y,isOpen:a,closePopover:s,animationType:c,arrow:h,closeOnEscape:g,children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:o9.wrapper({size:v}),children:i().Children.map(u,e=>{if(/*#__PURE__*/i().isValidElement(e)){var t={size:v};return /*#__PURE__*/i().cloneElement(e,t)}return e})})})]})};o3.Option=o5;/* ESM default export */const o8=o3;var o9={wrapper:e=>{var{size:t="medium"}=e;return/*#__PURE__*/(0,o/* .css */.AH)("padding-block:",ey/* .spacing["8"] */.YK["8"],";position:relative;",t==="small"&&(0,o/* .css */.AH)(o0(),ey/* .spacing["4"] */.YK["4"]))},option:e=>{var{isTrash:t=false,size:r="medium"}=e;return/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.resetButton */.x.resetButton,";",eK/* .typography.body */.I.body(),";width:100%;padding:",ey/* .spacing["10"] */.YK["10"]," ",ey/* .spacing["20"] */.YK["20"],";transition:background-color 0.3s ease-in-out;cursor:pointer;display:flex;align-items:center;gap:",ey/* .spacing["8"] */.YK["8"],";&:focus,&:active,&:hover{background:none;color:",ey/* .colorTokens.text.primary */.I6.text.primary,";}svg{flex-shrink:0;color:",ey/* .colorTokens.icon["default"] */.I6.icon["default"],";}",r==="small"&&(0,o/* .css */.AH)(o1(),ey/* .spacing["8"] */.YK["8"],ey/* .spacing["16"] */.YK["16"],eK/* .typography.small */.I.small("medium")),":hover:not(:disabled){background-color:",ey/* .colorTokens.background.hover */.I6.background.hover,";color:",ey/* .colorTokens.text.title */.I6.text.title,";svg{color:",ey/* .colorTokens.icon.hover */.I6.icon.hover,";filter:grayscale(0%);}}:disabled{cursor:not-allowed;color:",ey/* .colorTokens.text.disable */.I6.text.disable,";svg{color:",ey/* .colorTokens.icon.disable.background */.I6.icon.disable.background,";}}",t&&(0,o/* .css */.AH)(o2(),ey/* .colorTokens.text.error */.I6.text.error,ey/* .colorTokens.icon.error */.I6.icon.error,ey/* .colorTokens.text.error */.I6.text.error,oZ()(ey/* .colorTokens.bg.error */.I6.bg.error,.1),ey/* .colorTokens.icon.error */.I6.icon.error,ey/* .colorTokens.text.error */.I6.text.error,ey/* .colorTokens.color.danger["40"] */.I6.color.danger["40"],ey/* .colorTokens.icon.error */.I6.icon.error),":focus-visible{outline:2px solid ",ey/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:-4px;border-radius:",ey/* .borderRadius.input */.Vq.input,";}")},button:e=>{var{isOpen:t=false,isInverse:r=false,isDisabled:n=false}=e;return/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.resetButton */.x.resetButton,";width:32px;height:32px;border-radius:",ey/* .borderRadius.circle */.Vq.circle,";display:flex;justify-content:center;align-items:center;transition:background-color 0.3s ease-in-out;svg{color:",ey/* .colorTokens.icon["default"] */.I6.icon["default"],";flex-shrink:0;}:hover{background-color:",ey/* .colorTokens.background.hover */.I6.background.hover,";svg{color:",ey/* .colorTokens.icon["default"] */.I6.icon["default"],";}}&:focus,&:active{background:none;}&:focus-visible{outline:2px solid ",ey/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:1px;}",t&&(0,o/* .css */.AH)(o6(),ey/* .colorTokens.background.hover */.I6.background.hover,ey/* .colorTokens.icon.brand */.I6.icon.brand)," ",r&&(0,o/* .css */.AH)(o4(),ey/* .colorTokens.background.white */.I6.background.white,ey/* .colorTokens.background.white */.I6.background.white,!n&&ey/* .colorTokens.icon.brand */.I6.icon.brand),":disabled{cursor:not-allowed;}")}};// CONCATENATED MODULE: ./node_modules/react-hook-form/dist/index.esm.mjs
var o7=e=>e.type==="checkbox";var se=e=>e instanceof Date;var st=e=>e==null;const sr=e=>typeof e==="object";var sn=e=>!st(e)&&!Array.isArray(e)&&sr(e)&&!se(e);var si=e=>sn(e)&&e.target?o7(e.target)?e.target.checked:e.target.value:e;var sa=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e;var so=(e,t)=>e.has(sa(t));var ss=e=>{const t=e.constructor&&e.constructor.prototype;return sn(t)&&t.hasOwnProperty("isPrototypeOf")};var sl=typeof window!=="undefined"&&typeof window.HTMLElement!=="undefined"&&typeof document!=="undefined";function su(e){let t;const r=Array.isArray(e);const n=typeof FileList!=="undefined"?e instanceof FileList:false;if(e instanceof Date){t=new Date(e)}else if(!(sl&&(e instanceof Blob||n))&&(r||sn(e))){t=r?[]:Object.create(Object.getPrototypeOf(e));if(!r&&!ss(e)){t=e}else{for(const r in e){if(e.hasOwnProperty(r)){t[r]=su(e[r])}}}}else{return e}return t}var sc=e=>/^\w*$/.test(e);var sd=e=>e===undefined;var sf=e=>Array.isArray(e)?e.filter(Boolean):[];var sp=e=>sf(e.replace(/["|']|\]/g,"").split(/\.|\[/));var sh=(e,t,r)=>{if(!t||!sn(e)){return r}const n=(sc(t)?[t]:sp(t)).reduce((e,t)=>st(e)?e:e[t],e);return sd(n)||n===e?sd(e[t])?r:e[t]:n};var sv=e=>typeof e==="boolean";var sg=(e,t,r)=>{let n=-1;const i=sc(t)?[t]:sp(t);const a=i.length;const o=a-1;while(++n<a){const t=i[n];let a=r;if(n!==o){const r=e[t];a=sn(r)||Array.isArray(r)?r:!isNaN(+i[n+1])?[]:{}}if(t==="__proto__"||t==="constructor"||t==="prototype"){return}e[t]=a;e=e[t]}};const sm={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"};const sb={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"};const sy={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};const s_=n.createContext(null);s_.displayName="HookFormContext";/**
 * This custom hook allows you to access the form context. useFormContext is intended to be used in deeply nested structures, where it would become inconvenient to pass the context as a prop. To be used with {@link FormProvider}.
 *
 * @remarks
 * [API](https://react-hook-form.com/docs/useformcontext) • [Demo](https://codesandbox.io/s/react-hook-form-v7-form-context-ytudi)
 *
 * @returns return all useForm methods
 *
 * @example
 * ```tsx
 * function App() {
 *   const methods = useForm();
 *   const onSubmit = data => console.log(data);
 *
 *   return (
 *     <FormProvider {...methods} >
 *       <form onSubmit={methods.handleSubmit(onSubmit)}>
 *         <NestedInput />
 *         <input type="submit" />
 *       </form>
 *     </FormProvider>
 *   );
 * }
 *
 *  function NestedInput() {
 *   const { register } = useFormContext(); // retrieve all hook methods
 *   return <input {...register("test")} />;
 * }
 * ```
 */const sw=()=>n.useContext(s_);/**
 * A provider component that propagates the `useForm` methods to all children components via [React Context](https://reactjs.org/docs/context.html) API. To be used with {@link useFormContext}.
 *
 * @remarks
 * [API](https://react-hook-form.com/docs/useformcontext) • [Demo](https://codesandbox.io/s/react-hook-form-v7-form-context-ytudi)
 *
 * @param props - all useForm methods
 *
 * @example
 * ```tsx
 * function App() {
 *   const methods = useForm();
 *   const onSubmit = data => console.log(data);
 *
 *   return (
 *     <FormProvider {...methods} >
 *       <form onSubmit={methods.handleSubmit(onSubmit)}>
 *         <NestedInput />
 *         <input type="submit" />
 *       </form>
 *     </FormProvider>
 *   );
 * }
 *
 *  function NestedInput() {
 *   const { register } = useFormContext(); // retrieve all hook methods
 *   return <input {...register("test")} />;
 * }
 * ```
 */const sx=e=>{const{children:t,...r}=e;return n.createElement(s_.Provider,{value:r},t)};var sA=(e,t,r,n=true)=>{const i={defaultValues:t._defaultValues};for(const a in e){Object.defineProperty(i,a,{get:()=>{const i=a;if(t._proxyFormState[i]!==sb.all){t._proxyFormState[i]=!n||sb.all}r&&(r[i]=true);return e[i]}})}return i};const sk=typeof window!=="undefined"?n.useLayoutEffect:n.useEffect;/**
 * This custom hook allows you to subscribe to each form state, and isolate the re-render at the custom hook level. It has its scope in terms of form state subscription, so it would not affect other useFormState and useForm. Using this hook can reduce the re-render impact on large and complex form application.
 *
 * @remarks
 * [API](https://react-hook-form.com/docs/useformstate) • [Demo](https://codesandbox.io/s/useformstate-75xly)
 *
 * @param props - include options on specify fields to subscribe. {@link UseFormStateReturn}
 *
 * @example
 * ```tsx
 * function App() {
 *   const { register, handleSubmit, control } = useForm({
 *     defaultValues: {
 *     firstName: "firstName"
 *   }});
 *   const { dirtyFields } = useFormState({
 *     control
 *   });
 *   const onSubmit = (data) => console.log(data);
 *
 *   return (
 *     <form onSubmit={handleSubmit(onSubmit)}>
 *       <input {...register("firstName")} placeholder="First Name" />
 *       {dirtyFields.firstName && <p>Field is dirty.</p>}
 *       <input type="submit" />
 *     </form>
 *   );
 * }
 * ```
 */function sE(e){const t=sw();const{control:r=t.control,disabled:i,name:a,exact:o}=e||{};const[s,l]=n.useState(r._formState);const u=n.useRef({isDirty:false,isLoading:false,dirtyFields:false,touchedFields:false,validatingFields:false,isValidating:false,isValid:false,errors:false});sk(()=>r._subscribe({name:a,formState:u.current,exact:o,callback:e=>{!i&&l({...r._formState,...e})}}),[a,i,o]);n.useEffect(()=>{u.current.isValid&&r._setValid(true)},[r]);return n.useMemo(()=>sA(s,r,u.current,false),[s,r])}var sI=e=>typeof e==="string";var sC=(e,t,r,n,i)=>{if(sI(e)){n&&t.watch.add(e);return sh(r,e,i)}if(Array.isArray(e)){return e.map(e=>(n&&t.watch.add(e),sh(r,e)))}n&&(t.watchAll=true);return r};var sY=e=>st(e)||!sr(e);function sT(e,t,r=new WeakSet){if(sY(e)||sY(t)){return e===t}if(se(e)&&se(t)){return e.getTime()===t.getTime()}const n=Object.keys(e);const i=Object.keys(t);if(n.length!==i.length){return false}if(r.has(e)||r.has(t)){return true}r.add(e);r.add(t);for(const a of n){const n=e[a];if(!i.includes(a)){return false}if(a!=="ref"){const e=t[a];if(se(n)&&se(e)||sn(n)&&sn(e)||Array.isArray(n)&&Array.isArray(e)?!sT(n,e,r):n!==e){return false}}}return true}/**
 * Custom hook to subscribe to field change and isolate re-rendering at the component level.
 *
 * @remarks
 *
 * [API](https://react-hook-form.com/docs/usewatch) • [Demo](https://codesandbox.io/s/react-hook-form-v7-ts-usewatch-h9i5e)
 *
 * @example
 * ```tsx
 * const { control } = useForm();
 * const values = useWatch({
 *   name: "fieldName"
 *   control,
 * })
 * ```
 */function sS(e){const t=sw();const{control:r=t.control,name:i,defaultValue:a,disabled:o,exact:s,compute:l}=e||{};const u=n.useRef(a);const c=n.useRef(l);const d=n.useRef(undefined);c.current=l;const f=n.useMemo(()=>r._getWatch(i,u.current),[r,i]);const[p,h]=n.useState(c.current?c.current(f):f);sk(()=>r._subscribe({name:i,formState:{values:true},exact:s,callback:e=>{if(!o){const t=sC(i,r._names,e.values||r._formValues,false,u.current);if(c.current){const e=c.current(t);if(!sT(e,d.current)){h(e);d.current=e}}else{h(t)}}}}),[r,o,i,s]);n.useEffect(()=>r._removeUnmounted());return p}/**
 * Custom hook to work with controlled component, this function provide you with both form and field level state. Re-render is isolated at the hook level.
 *
 * @remarks
 * [API](https://react-hook-form.com/docs/usecontroller) • [Demo](https://codesandbox.io/s/usecontroller-0o8px)
 *
 * @param props - the path name to the form field value, and validation rules.
 *
 * @returns field properties, field and form state. {@link UseControllerReturn}
 *
 * @example
 * ```tsx
 * function Input(props) {
 *   const { field, fieldState, formState } = useController(props);
 *   return (
 *     <div>
 *       <input {...field} placeholder={props.name} />
 *       <p>{fieldState.isTouched && "Touched"}</p>
 *       <p>{formState.isSubmitted ? "submitted" : ""}</p>
 *     </div>
 *   );
 * }
 * ```
 */function sO(e){const t=sw();const{name:r,disabled:i,control:a=t.control,shouldUnregister:o,defaultValue:s}=e;const l=so(a._names.array,r);const u=n.useMemo(()=>sh(a._formValues,r,sh(a._defaultValues,r,s)),[a,r,s]);const c=sS({control:a,name:r,defaultValue:u,exact:true});const d=sE({control:a,name:r,exact:true});const f=n.useRef(e);const p=n.useRef(a.register(r,{...e.rules,value:c,...sv(e.disabled)?{disabled:e.disabled}:{}}));f.current=e;const h=n.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:true,get:()=>!!sh(d.errors,r)},isDirty:{enumerable:true,get:()=>!!sh(d.dirtyFields,r)},isTouched:{enumerable:true,get:()=>!!sh(d.touchedFields,r)},isValidating:{enumerable:true,get:()=>!!sh(d.validatingFields,r)},error:{enumerable:true,get:()=>sh(d.errors,r)}}),[d,r]);const v=n.useCallback(e=>p.current.onChange({target:{value:si(e),name:r},type:sm.CHANGE}),[r]);const g=n.useCallback(()=>p.current.onBlur({target:{value:sh(a._formValues,r),name:r},type:sm.BLUR}),[r,a._formValues]);const m=n.useCallback(e=>{const t=sh(a._fields,r);if(t&&e){t._f.ref={focus:()=>e.focus&&e.focus(),select:()=>e.select&&e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()}}},[a._fields,r]);const b=n.useMemo(()=>({name:r,value:c,...sv(i)||d.disabled?{disabled:d.disabled||i}:{},onChange:v,onBlur:g,ref:m}),[r,i,d.disabled,v,g,m,c]);n.useEffect(()=>{const e=a._options.shouldUnregister||o;a.register(r,{...f.current.rules,...sv(f.current.disabled)?{disabled:f.current.disabled}:{}});const t=(e,t)=>{const r=sh(a._fields,e);if(r&&r._f){r._f.mount=t}};t(r,true);if(e){const e=su(sh(a._options.defaultValues,r));sg(a._defaultValues,r,e);if(sd(sh(a._formValues,r))){sg(a._formValues,r,e)}}!l&&a.register(r);return()=>{(l?e&&!a._state.action:e)?a.unregister(r):t(r,false)}},[r,a,l,o]);n.useEffect(()=>{a._setDisabledField({disabled:i,name:r})},[i,r,a]);return n.useMemo(()=>({field:b,formState:d,fieldState:h}),[b,d,h])}/**
 * Component based on `useController` hook to work with controlled component.
 *
 * @remarks
 * [API](https://react-hook-form.com/docs/usecontroller/controller) • [Demo](https://codesandbox.io/s/react-hook-form-v6-controller-ts-jwyzw) • [Video](https://www.youtube.com/watch?v=N2UNk_UCVyA)
 *
 * @param props - the path name to the form field value, and validation rules.
 *
 * @returns provide field handler functions, field and form state.
 *
 * @example
 * ```tsx
 * function App() {
 *   const { control } = useForm<FormValues>({
 *     defaultValues: {
 *       test: ""
 *     }
 *   });
 *
 *   return (
 *     <form>
 *       <Controller
 *         control={control}
 *         name="test"
 *         render={({ field: { onChange, onBlur, value, ref }, formState, fieldState }) => (
 *           <>
 *             <input
 *               onChange={onChange} // send value to hook form
 *               onBlur={onBlur} // notify when input is touched
 *               value={value} // return updated value
 *               ref={ref} // set ref for focus management
 *             />
 *             <p>{formState.isSubmitted ? "submitted" : ""}</p>
 *             <p>{fieldState.isTouched ? "touched" : ""}</p>
 *           </>
 *         )}
 *       />
 *     </form>
 *   );
 * }
 * ```
 */const sD=e=>e.render(sO(e));const sF=e=>{const t={};for(const r of Object.keys(e)){if(sr(e[r])&&e[r]!==null){const n=sF(e[r]);for(const e of Object.keys(n)){t[`${r}.${e}`]=n[e]}}else{t[r]=e[r]}}return t};const sR="post";/**
 * Form component to manage submission.
 *
 * @param props - to setup submission detail. {@link FormProps}
 *
 * @returns form component or headless render prop.
 *
 * @example
 * ```tsx
 * function App() {
 *   const { control, formState: { errors } } = useForm();
 *
 *   return (
 *     <Form action="/api" control={control}>
 *       <input {...register("name")} />
 *       <p>{errors?.root?.server && 'Server error'}</p>
 *       <button>Submit</button>
 *     </Form>
 *   );
 * }
 * ```
 */function sP(e){const t=sw();const[r,n]=React.useState(false);const{control:i=t.control,onSubmit:a,children:o,action:s,method:l=sR,headers:u,encType:c,onError:d,render:f,onSuccess:p,validateStatus:h,...v}=e;const g=async t=>{let r=false;let n="";await i.handleSubmit(async e=>{const o=new FormData;let f="";try{f=JSON.stringify(e)}catch(e){}const v=sF(i._formValues);for(const e in v){o.append(e,v[e])}if(a){await a({data:e,event:t,method:l,formData:o,formDataJson:f})}if(s){try{const e=[u&&u["Content-Type"],c].some(e=>e&&e.includes("json"));const t=await fetch(String(s),{method:l,headers:{...u,...c&&c!=="multipart/form-data"?{"Content-Type":c}:{}},body:e?f:o});if(t&&(h?!h(t.status):t.status<200||t.status>=300)){r=true;d&&d({response:t});n=String(t.status)}else{p&&p({response:t})}}catch(e){r=true;d&&d({error:e})}}})(t);if(r&&e.control){e.control._subjects.state.next({isSubmitSuccessful:false});e.control.setError("root.server",{type:n})}};React.useEffect(()=>{n(true)},[]);return f?React.createElement(React.Fragment,null,f({submit:g})):React.createElement("form",{noValidate:r,action:s,method:l,encType:c,onSubmit:g,...v},o)}var sM=(e,t,r,n,i)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:i||true}}:{};var sH=e=>Array.isArray(e)?e:[e];var sN=()=>{let e=[];const t=t=>{for(const r of e){r.next&&r.next(t)}};const r=t=>{e.push(t);return{unsubscribe:()=>{e=e.filter(e=>e!==t)}}};const n=()=>{e=[]};return{get observers(){return e},next:t,subscribe:r,unsubscribe:n}};var sL=e=>sn(e)&&!Object.keys(e).length;var sK=e=>e.type==="file";var sB=e=>typeof e==="function";var sj=e=>{if(!sl){return false}const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)};var sU=e=>e.type===`select-multiple`;var sq=e=>e.type==="radio";var sV=e=>sq(e)||o7(e);var sW=e=>sj(e)&&e.isConnected;function sz(e,t){const r=t.slice(0,-1).length;let n=0;while(n<r){e=sd(e)?n++:e[t[n++]]}return e}function sG(e){for(const t in e){if(e.hasOwnProperty(t)&&!sd(e[t])){return false}}return true}function sQ(e,t){const r=Array.isArray(t)?t:sc(t)?[t]:sp(t);const n=r.length===1?e:sz(e,r);const i=r.length-1;const a=r[i];if(n){delete n[a]}if(i!==0&&(sn(n)&&sL(n)||Array.isArray(n)&&sG(n))){sQ(e,r.slice(0,-1))}return e}var s$=e=>{for(const t in e){if(sB(e[t])){return true}}return false};function sX(e,t={}){const r=Array.isArray(e);if(sn(e)||r){for(const r in e){if(Array.isArray(e[r])||sn(e[r])&&!s$(e[r])){t[r]=Array.isArray(e[r])?[]:{};sX(e[r],t[r])}else if(!st(e[r])){t[r]=true}}}return t}function sJ(e,t,r){const n=Array.isArray(e);if(sn(e)||n){for(const n in e){if(Array.isArray(e[n])||sn(e[n])&&!s$(e[n])){if(sd(t)||sY(r[n])){r[n]=Array.isArray(e[n])?sX(e[n],[]):{...sX(e[n])}}else{sJ(e[n],st(t)?{}:t[n],r[n])}}else{r[n]=!sT(e[n],t[n])}}}return r}var sZ=(e,t)=>sJ(e,t,sX(t));const s0={value:false,isValid:false};const s1={value:true,isValid:true};var s2=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!sd(e[0].attributes.value)?sd(e[0].value)||e[0].value===""?s1:{value:e[0].value,isValid:true}:s1:s0}return s0};var s6=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>sd(e)?e:t?e===""?NaN:e?+e:e:r&&sI(e)?new Date(e):n?n(e):e;const s4={isValid:false,value:null};var s5=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:true,value:t.value}:e,s4):s4;function s3(e){const t=e.ref;if(sK(t)){return t.files}if(sq(t)){return s5(e.refs).value}if(sU(t)){return[...t.selectedOptions].map(({value:e})=>e)}if(o7(t)){return s2(e.refs).value}return s6(sd(t.value)?e.ref.value:t.value,e)}var s8=(e,t,r,n)=>{const i={};for(const r of e){const e=sh(t,r);e&&sg(i,r,e._f)}return{criteriaMode:r,names:[...e],fields:i,shouldUseNativeValidation:n}};var s9=e=>e instanceof RegExp;var s7=e=>sd(e)?e:s9(e)?e.source:sn(e)?s9(e.value)?e.value.source:e.value:e;var le=e=>({isOnSubmit:!e||e===sb.onSubmit,isOnBlur:e===sb.onBlur,isOnChange:e===sb.onChange,isOnAll:e===sb.all,isOnTouch:e===sb.onTouched});const lt="AsyncFunction";var lr=e=>!!e&&!!e.validate&&!!(sB(e.validate)&&e.validate.constructor.name===lt||sn(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===lt));var ln=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);var li=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));const la=(e,t,r,n)=>{for(const i of r||Object.keys(e)){const r=sh(e,i);if(r){const{_f:e,...a}=r;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],i)&&!n){return true}else if(e.ref&&t(e.ref,e.name)&&!n){return true}else{if(la(a,t)){break}}}else if(sn(a)){if(la(a,t)){break}}}}return};function lo(e,t,r){const n=sh(e,r);if(n||sc(r)){return{error:n,name:r}}const i=r.split(".");while(i.length){const n=i.join(".");const a=sh(t,n);const o=sh(e,n);if(a&&!Array.isArray(a)&&r!==n){return{name:r}}if(o&&o.type){return{name:n,error:o}}if(o&&o.root&&o.root.type){return{name:`${n}.root`,error:o.root}}i.pop()}return{name:r}}var ls=(e,t,r,n)=>{r(e);const{name:i,...a}=e;return sL(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(e=>t[e]===(!n||sb.all))};var ll=(e,t,r)=>!e||!t||e===t||sH(e).some(e=>e&&(r?e===t:e.startsWith(t)||t.startsWith(e)));var lu=(e,t,r,n,i)=>{if(i.isOnAll){return false}else if(!r&&i.isOnTouch){return!(t||e)}else if(r?n.isOnBlur:i.isOnBlur){return!e}else if(r?n.isOnChange:i.isOnChange){return e}return true};var lc=(e,t)=>!sf(sh(e,t)).length&&sQ(e,t);var ld=(e,t,r)=>{const n=sH(sh(e,r));sg(n,"root",t[r]);sg(e,r,n);return e};var lf=e=>sI(e);function lp(e,t,r="validate"){if(lf(e)||Array.isArray(e)&&e.every(lf)||sv(e)&&!e){return{type:r,message:lf(e)?e:"",ref:t}}}var lh=e=>sn(e)&&!s9(e)?e:{value:e,message:""};var lv=async(e,t,r,n,i,a)=>{const{ref:o,refs:s,required:l,maxLength:u,minLength:c,min:d,max:f,pattern:p,validate:h,name:v,valueAsNumber:g,mount:m}=e._f;const b=sh(r,v);if(!m||t.has(v)){return{}}const y=s?s[0]:o;const _=e=>{if(i&&y.reportValidity){y.setCustomValidity(sv(e)?"":e||"");y.reportValidity()}};const w={};const x=sq(o);const A=o7(o);const k=x||A;const E=(g||sK(o))&&sd(o.value)&&sd(b)||sj(o)&&o.value===""||b===""||Array.isArray(b)&&!b.length;const I=sM.bind(null,v,n,w);const C=(e,t,r,n=sy.maxLength,i=sy.minLength)=>{const a=e?t:r;w[v]={type:e?n:i,message:a,ref:o,...I(e?n:i,a)}};if(a?!Array.isArray(b)||!b.length:l&&(!k&&(E||st(b))||sv(b)&&!b||A&&!s2(s).isValid||x&&!s5(s).isValid)){const{value:e,message:t}=lf(l)?{value:!!l,message:l}:lh(l);if(e){w[v]={type:sy.required,message:t,ref:y,...I(sy.required,t)};if(!n){_(t);return w}}}if(!E&&(!st(d)||!st(f))){let e;let t;const r=lh(f);const i=lh(d);if(!st(b)&&!isNaN(b)){const n=o.valueAsNumber||(b?+b:b);if(!st(r.value)){e=n>r.value}if(!st(i.value)){t=n<i.value}}else{const n=o.valueAsDate||new Date(b);const a=e=>new Date(new Date().toDateString()+" "+e);const s=o.type=="time";const l=o.type=="week";if(sI(r.value)&&b){e=s?a(b)>a(r.value):l?b>r.value:n>new Date(r.value)}if(sI(i.value)&&b){t=s?a(b)<a(i.value):l?b<i.value:n<new Date(i.value)}}if(e||t){C(!!e,r.message,i.message,sy.max,sy.min);if(!n){_(w[v].message);return w}}}if((u||c)&&!E&&(sI(b)||a&&Array.isArray(b))){const e=lh(u);const t=lh(c);const r=!st(e.value)&&b.length>+e.value;const i=!st(t.value)&&b.length<+t.value;if(r||i){C(r,e.message,t.message);if(!n){_(w[v].message);return w}}}if(p&&!E&&sI(b)){const{value:e,message:t}=lh(p);if(s9(e)&&!b.match(e)){w[v]={type:sy.pattern,message:t,ref:o,...I(sy.pattern,t)};if(!n){_(t);return w}}}if(h){if(sB(h)){const e=await h(b,r);const t=lp(e,y);if(t){w[v]={...t,...I(sy.validate,t.message)};if(!n){_(t.message);return w}}}else if(sn(h)){let e={};for(const t in h){if(!sL(e)&&!n){break}const i=lp(await h[t](b,r),y,t);if(i){e={...i,...I(t,i.message)};_(i.message);if(n){w[v]=e}}}if(!sL(e)){w[v]={ref:y,...e};if(!n){return w}}}}_(true);return w};const lg={mode:sb.onSubmit,reValidateMode:sb.onChange,shouldFocusError:true};function lm(e={}){let t={...lg,...e};let r={submitCount:0,isDirty:false,isReady:false,isLoading:sB(t.defaultValues),isValidating:false,isSubmitted:false,isSubmitting:false,isSubmitSuccessful:false,isValid:false,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||false};let n={};let i=sn(t.defaultValues)||sn(t.values)?su(t.defaultValues||t.values)||{}:{};let a=t.shouldUnregister?{}:su(i);let o={action:false,mount:false,watch:false};let s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set};let l;let u=0;const c={isDirty:false,dirtyFields:false,validatingFields:false,touchedFields:false,isValidating:false,isValid:false,errors:false};let d={...c};const f={array:sN(),state:sN()};const p=t.criteriaMode===sb.all;const h=e=>t=>{clearTimeout(u);u=setTimeout(e,t)};const v=async e=>{if(!t.disabled&&(c.isValid||d.isValid||e)){const e=t.resolver?sL((await A()).errors):await E(n,true);if(e!==r.isValid){f.state.next({isValid:e})}}};const g=(e,n)=>{if(!t.disabled&&(c.isValidating||c.validatingFields||d.isValidating||d.validatingFields)){(e||Array.from(s.mount)).forEach(e=>{if(e){n?sg(r.validatingFields,e,n):sQ(r.validatingFields,e)}});f.state.next({validatingFields:r.validatingFields,isValidating:!sL(r.validatingFields)})}};const m=(e,s=[],l,u,p=true,h=true)=>{if(u&&l&&!t.disabled){o.action=true;if(h&&Array.isArray(sh(n,e))){const t=l(sh(n,e),u.argA,u.argB);p&&sg(n,e,t)}if(h&&Array.isArray(sh(r.errors,e))){const t=l(sh(r.errors,e),u.argA,u.argB);p&&sg(r.errors,e,t);lc(r.errors,e)}if((c.touchedFields||d.touchedFields)&&h&&Array.isArray(sh(r.touchedFields,e))){const t=l(sh(r.touchedFields,e),u.argA,u.argB);p&&sg(r.touchedFields,e,t)}if(c.dirtyFields||d.dirtyFields){r.dirtyFields=sZ(i,a)}f.state.next({name:e,isDirty:C(e,s),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else{sg(a,e,s)}};const b=(e,t)=>{sg(r.errors,e,t);f.state.next({errors:r.errors})};const y=e=>{r.errors=e;f.state.next({errors:r.errors,isValid:false})};const _=(e,t,r,s)=>{const l=sh(n,e);if(l){const n=sh(a,e,sd(r)?sh(i,e):r);sd(n)||s&&s.defaultChecked||t?sg(a,e,t?n:s3(l._f)):S(e,n);o.mount&&v()}};const w=(e,n,a,o,s)=>{let l=false;let u=false;const p={name:e};if(!t.disabled){if(!a||o){if(c.isDirty||d.isDirty){u=r.isDirty;r.isDirty=p.isDirty=C();l=u!==p.isDirty}const t=sT(sh(i,e),n);u=!!sh(r.dirtyFields,e);t?sQ(r.dirtyFields,e):sg(r.dirtyFields,e,true);p.dirtyFields=r.dirtyFields;l=l||(c.dirtyFields||d.dirtyFields)&&u!==!t}if(a){const t=sh(r.touchedFields,e);if(!t){sg(r.touchedFields,e,a);p.touchedFields=r.touchedFields;l=l||(c.touchedFields||d.touchedFields)&&t!==a}}l&&s&&f.state.next(p)}return l?p:{}};const x=(e,n,i,a)=>{const o=sh(r.errors,e);const s=(c.isValid||d.isValid)&&sv(n)&&r.isValid!==n;if(t.delayError&&i){l=h(()=>b(e,i));l(t.delayError)}else{clearTimeout(u);l=null;i?sg(r.errors,e,i):sQ(r.errors,e)}if((i?!sT(o,i):o)||!sL(a)||s){const t={...a,...s&&sv(n)?{isValid:n}:{},errors:r.errors,name:e};r={...r,...t};f.state.next(t)}};const A=async e=>{g(e,true);const r=await t.resolver(a,t.context,s8(e||s.mount,n,t.criteriaMode,t.shouldUseNativeValidation));g(e);return r};const k=async e=>{const{errors:t}=await A(e);if(e){for(const n of e){const e=sh(t,n);e?sg(r.errors,n,e):sQ(r.errors,n)}}else{r.errors=t}return t};const E=async(e,n,i={valid:true})=>{for(const o in e){const l=e[o];if(l){const{_f:e,...u}=l;if(e){const u=s.array.has(e.name);const d=l._f&&lr(l._f);if(d&&c.validatingFields){g([o],true)}const f=await lv(l,s.disabled,a,p,t.shouldUseNativeValidation&&!n,u);if(d&&c.validatingFields){g([o])}if(f[e.name]){i.valid=false;if(n){break}}!n&&(sh(f,e.name)?u?ld(r.errors,f,e.name):sg(r.errors,e.name,f[e.name]):sQ(r.errors,e.name))}!sL(u)&&await E(u,n,i)}}return i.valid};const I=()=>{for(const e of s.unMount){const t=sh(n,e);t&&(t._f.refs?t._f.refs.every(e=>!sW(e)):!sW(t._f.ref))&&U(e)}s.unMount=new Set};const C=(e,r)=>!t.disabled&&(e&&r&&sg(a,e,r),!sT(M(),i));const Y=(e,t,r)=>sC(e,s,{...o.mount?a:sd(t)?i:sI(e)?{[e]:t}:t},r,t);const T=e=>sf(sh(o.mount?a:i,e,t.shouldUnregister?sh(i,e,[]):[]));const S=(e,t,r={})=>{const i=sh(n,e);let o=t;if(i){const r=i._f;if(r){!r.disabled&&sg(a,e,s6(t,r));o=sj(r.ref)&&st(t)?"":t;if(sU(r.ref)){[...r.ref.options].forEach(e=>e.selected=o.includes(e.value))}else if(r.refs){if(o7(r.ref)){r.refs.forEach(e=>{if(!e.defaultChecked||!e.disabled){if(Array.isArray(o)){e.checked=!!o.find(t=>t===e.value)}else{e.checked=o===e.value||!!o}}})}else{r.refs.forEach(e=>e.checked=e.value===o)}}else if(sK(r.ref)){r.ref.value=""}else{r.ref.value=o;if(!r.ref.type){f.state.next({name:e,values:su(a)})}}}}(r.shouldDirty||r.shouldTouch)&&w(e,o,r.shouldTouch,r.shouldDirty,true);r.shouldValidate&&P(e)};const O=(e,t,r)=>{for(const i in t){if(!t.hasOwnProperty(i)){return}const a=t[i];const o=e+"."+i;const l=sh(n,o);(s.array.has(e)||sn(a)||l&&!l._f)&&!se(a)?O(o,a,r):S(o,a,r)}};const D=(e,t,l={})=>{const u=sh(n,e);const p=s.array.has(e);const h=su(t);sg(a,e,h);if(p){f.array.next({name:e,values:su(a)});if((c.isDirty||c.dirtyFields||d.isDirty||d.dirtyFields)&&l.shouldDirty){f.state.next({name:e,dirtyFields:sZ(i,a),isDirty:C(e,h)})}}else{u&&!u._f&&!st(h)?O(e,h,l):S(e,h,l)}li(e,s)&&f.state.next({...r,name:e});f.state.next({name:o.mount?e:undefined,values:su(a)})};const F=async e=>{o.mount=true;const i=e.target;let u=i.name;let h=true;const m=sh(n,u);const b=e=>{h=Number.isNaN(e)||se(e)&&isNaN(e.getTime())||sT(e,sh(a,u,e))};const y=le(t.mode);const _=le(t.reValidateMode);if(m){let o;let k;const I=i.type?s3(m._f):si(e);const C=e.type===sm.BLUR||e.type===sm.FOCUS_OUT;const Y=!ln(m._f)&&!t.resolver&&!sh(r.errors,u)&&!m._f.deps||lu(C,sh(r.touchedFields,u),r.isSubmitted,_,y);const T=li(u,s,C);sg(a,u,I);if(C){if(!i||!i.readOnly){m._f.onBlur&&m._f.onBlur(e);l&&l(0)}}else if(m._f.onChange){m._f.onChange(e)}const S=w(u,I,C);const O=!sL(S)||T;!C&&f.state.next({name:u,type:e.type,values:su(a)});if(Y){if(c.isValid||d.isValid){if(t.mode==="onBlur"){if(C){v()}}else if(!C){v()}}return O&&f.state.next({name:u,...T?{}:S})}!C&&T&&f.state.next({...r});if(t.resolver){const{errors:e}=await A([u]);b(I);if(h){const t=lo(r.errors,n,u);const i=lo(e,n,t.name||u);o=i.error;u=i.name;k=sL(e)}}else{g([u],true);o=(await lv(m,s.disabled,a,p,t.shouldUseNativeValidation))[u];g([u]);b(I);if(h){if(o){k=false}else if(c.isValid||d.isValid){k=await E(n,true)}}}if(h){m._f.deps&&P(m._f.deps);x(u,k,o,S)}}};const R=(e,t)=>{if(sh(r.errors,t)&&e.focus){e.focus();return 1}return};const P=async(e,i={})=>{let a;let o;const l=sH(e);if(t.resolver){const t=await k(sd(e)?e:l);a=sL(t);o=e?!l.some(e=>sh(t,e)):a}else if(e){o=(await Promise.all(l.map(async e=>{const t=sh(n,e);return await E(t&&t._f?{[e]:t}:t)}))).every(Boolean);!(!o&&!r.isValid)&&v()}else{o=a=await E(n)}f.state.next({...!sI(e)||(c.isValid||d.isValid)&&a!==r.isValid?{}:{name:e},...t.resolver||!e?{isValid:a}:{},errors:r.errors});i.shouldFocus&&!o&&la(n,R,e?l:s.mount);return o};const M=e=>{const t={...o.mount?a:i};return sd(e)?t:sI(e)?sh(t,e):e.map(e=>sh(t,e))};const H=(e,t)=>({invalid:!!sh((t||r).errors,e),isDirty:!!sh((t||r).dirtyFields,e),error:sh((t||r).errors,e),isValidating:!!sh(r.validatingFields,e),isTouched:!!sh((t||r).touchedFields,e)});const N=e=>{e&&sH(e).forEach(e=>sQ(r.errors,e));f.state.next({errors:e?r.errors:{}})};const L=(e,t,i)=>{const a=(sh(n,e,{_f:{}})._f||{}).ref;const o=sh(r.errors,e)||{};// Don't override existing error messages elsewhere in the object tree.
const{ref:s,message:l,type:u,...c}=o;sg(r.errors,e,{...c,...t,ref:a});f.state.next({name:e,errors:r.errors,isValid:false});i&&i.shouldFocus&&a&&a.focus&&a.focus()};const K=(e,t)=>sB(e)?f.state.subscribe({next:r=>"values"in r&&e(Y(undefined,t),r)}):Y(e,t,true);const B=e=>f.state.subscribe({next:t=>{if(ll(e.name,t.name,e.exact)&&ls(t,e.formState||c,Z,e.reRenderRoot)){e.callback({values:{...a},...r,...t,defaultValues:i})}}}).unsubscribe;const j=e=>{o.mount=true;d={...d,...e.formState};return B({...e,formState:d})};const U=(e,o={})=>{for(const l of e?sH(e):s.mount){s.mount.delete(l);s.array.delete(l);if(!o.keepValue){sQ(n,l);sQ(a,l)}!o.keepError&&sQ(r.errors,l);!o.keepDirty&&sQ(r.dirtyFields,l);!o.keepTouched&&sQ(r.touchedFields,l);!o.keepIsValidating&&sQ(r.validatingFields,l);!t.shouldUnregister&&!o.keepDefaultValue&&sQ(i,l)}f.state.next({values:su(a)});f.state.next({...r,...!o.keepDirty?{}:{isDirty:C()}});!o.keepIsValid&&v()};const q=({disabled:e,name:t})=>{if(sv(e)&&o.mount||!!e||s.disabled.has(t)){e?s.disabled.add(t):s.disabled.delete(t)}};const V=(e,r={})=>{let a=sh(n,e);const l=sv(r.disabled)||sv(t.disabled);sg(n,e,{...a||{},_f:{...a&&a._f?a._f:{ref:{name:e}},name:e,mount:true,...r}});s.mount.add(e);if(a){q({disabled:sv(r.disabled)?r.disabled:t.disabled,name:e})}else{_(e,true,r.value)}return{...l?{disabled:r.disabled||t.disabled}:{},...t.progressive?{required:!!r.required,min:s7(r.min),max:s7(r.max),minLength:s7(r.minLength),maxLength:s7(r.maxLength),pattern:s7(r.pattern)}:{},name:e,onChange:F,onBlur:F,ref:l=>{if(l){V(e,r);a=sh(n,e);const t=sd(l.value)?l.querySelectorAll?l.querySelectorAll("input,select,textarea")[0]||l:l:l;const o=sV(t);const s=a._f.refs||[];if(o?s.find(e=>e===t):t===a._f.ref){return}sg(n,e,{_f:{...a._f,...o?{refs:[...s.filter(sW),t,...Array.isArray(sh(i,e))?[{}]:[]],ref:{type:t.type,name:e}}:{ref:t}}});_(e,false,undefined,t)}else{a=sh(n,e,{});if(a._f){a._f.mount=false}(t.shouldUnregister||r.shouldUnregister)&&!(so(s.array,e)&&o.action)&&s.unMount.add(e)}}}};const W=()=>t.shouldFocusError&&la(n,R,s.mount);const z=e=>{if(sv(e)){f.state.next({disabled:e});la(n,(t,r)=>{const i=sh(n,r);if(i){t.disabled=i._f.disabled||e;if(Array.isArray(i._f.refs)){i._f.refs.forEach(t=>{t.disabled=i._f.disabled||e})}}},0,false)}};const G=(e,i)=>async o=>{let l=undefined;if(o){o.preventDefault&&o.preventDefault();o.persist&&o.persist()}let u=su(a);f.state.next({isSubmitting:true});if(t.resolver){const{errors:e,values:t}=await A();r.errors=e;u=su(t)}else{await E(n)}if(s.disabled.size){for(const e of s.disabled){sQ(u,e)}}sQ(r.errors,"root");if(sL(r.errors)){f.state.next({errors:{}});try{await e(u,o)}catch(e){l=e}}else{if(i){await i({...r.errors},o)}W();setTimeout(W)}f.state.next({isSubmitted:true,isSubmitting:false,isSubmitSuccessful:sL(r.errors)&&!l,submitCount:r.submitCount+1,errors:r.errors});if(l){throw l}};const Q=(e,t={})=>{if(sh(n,e)){if(sd(t.defaultValue)){D(e,su(sh(i,e)))}else{D(e,t.defaultValue);sg(i,e,su(t.defaultValue))}if(!t.keepTouched){sQ(r.touchedFields,e)}if(!t.keepDirty){sQ(r.dirtyFields,e);r.isDirty=t.defaultValue?C(e,su(sh(i,e))):C()}if(!t.keepError){sQ(r.errors,e);c.isValid&&v()}f.state.next({...r})}};const $=(e,l={})=>{const u=e?su(e):i;const d=su(u);const p=sL(e);const h=p?i:d;if(!l.keepDefaultValues){i=u}if(!l.keepValues){if(l.keepDirtyValues){const e=new Set([...s.mount,...Object.keys(sZ(i,a))]);for(const t of Array.from(e)){sh(r.dirtyFields,t)?sg(h,t,sh(a,t)):D(t,sh(h,t))}}else{if(sl&&sd(e)){for(const e of s.mount){const t=sh(n,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(sj(e)){const t=e.closest("form");if(t){t.reset();break}}}}}if(l.keepFieldsRef){for(const e of s.mount){D(e,sh(h,e))}}else{n={}}}a=t.shouldUnregister?l.keepDefaultValues?su(i):{}:su(h);f.array.next({values:{...h}});f.state.next({values:{...h}})}s={mount:l.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:false,focus:""};o.mount=!c.isValid||!!l.keepIsValid||!!l.keepDirtyValues;o.watch=!!t.shouldUnregister;f.state.next({submitCount:l.keepSubmitCount?r.submitCount:0,isDirty:p?false:l.keepDirty?r.isDirty:!!(l.keepDefaultValues&&!sT(e,i)),isSubmitted:l.keepIsSubmitted?r.isSubmitted:false,dirtyFields:p?{}:l.keepDirtyValues?l.keepDefaultValues&&a?sZ(i,a):r.dirtyFields:l.keepDefaultValues&&e?sZ(i,e):l.keepDirty?r.dirtyFields:{},touchedFields:l.keepTouched?r.touchedFields:{},errors:l.keepErrors?r.errors:{},isSubmitSuccessful:l.keepIsSubmitSuccessful?r.isSubmitSuccessful:false,isSubmitting:false,defaultValues:i})};const X=(e,t)=>$(sB(e)?e(a):e,t);const J=(e,t={})=>{const r=sh(n,e);const i=r&&r._f;if(i){const e=i.refs?i.refs[0]:i.ref;if(e.focus){e.focus();t.shouldSelect&&sB(e.select)&&e.select()}}};const Z=e=>{r={...r,...e}};const ee=()=>sB(t.defaultValues)&&t.defaultValues().then(e=>{X(e,t.resetOptions);f.state.next({isLoading:false})});const et={control:{register:V,unregister:U,getFieldState:H,handleSubmit:G,setError:L,_subscribe:B,_runSchema:A,_focusError:W,_getWatch:Y,_getDirty:C,_setValid:v,_setFieldArray:m,_setDisabledField:q,_setErrors:y,_getFieldArray:T,_reset:$,_resetDefaultValues:ee,_removeUnmounted:I,_disableForm:z,_subjects:f,_proxyFormState:c,get _fields(){return n},get _formValues(){return a},get _state(){return o},set _state(value){o=value},get _defaultValues(){return i},get _names(){return s},set _names(value){s=value},get _formState(){return r},get _options(){return t},set _options(value){t={...t,...value}}},subscribe:j,trigger:P,register:V,handleSubmit:G,watch:K,setValue:D,getValues:M,reset:X,resetField:Q,clearErrors:N,unregister:U,setError:L,setFocus:J,getFieldState:H};return{...et,formControl:et}}var lb=()=>{if(typeof crypto!=="undefined"&&crypto.randomUUID){return crypto.randomUUID()}const e=typeof performance==="undefined"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const r=(Math.random()*16+e)%16|0;return(t=="x"?r:r&3|8).toString(16)})};var ly=(e,t,r={})=>r.shouldFocus||sd(r.shouldFocus)?r.focusName||`${e}.${sd(r.focusIndex)?t:r.focusIndex}.`:"";var l_=(e,t)=>[...e,...sH(t)];var lw=e=>Array.isArray(e)?e.map(()=>undefined):undefined;function lx(e,t,r){return[...e.slice(0,t),...sH(r),...e.slice(t)]}var lA=(e,t,r)=>{if(!Array.isArray(e)){return[]}if(sd(e[r])){e[r]=undefined}e.splice(r,0,e.splice(t,1)[0]);return e};var lk=(e,t)=>[...sH(t),...sH(e)];function lE(e,t){let r=0;const n=[...e];for(const e of t){n.splice(e-r,1);r++}return sf(n).length?n:[]}var lI=(e,t)=>sd(t)?[]:lE(e,sH(t).sort((e,t)=>e-t));var lC=(e,t,r)=>{[e[t],e[r]]=[e[r],e[t]]};var lY=(e,t,r)=>{e[t]=r;return e};/**
 * A custom hook that exposes convenient methods to perform operations with a list of dynamic inputs that need to be appended, updated, removed etc. • [Demo](https://codesandbox.io/s/react-hook-form-usefieldarray-ssugn) • [Video](https://youtu.be/4MrbfGSFY2A)
 *
 * @remarks
 * [API](https://react-hook-form.com/docs/usefieldarray) • [Demo](https://codesandbox.io/s/react-hook-form-usefieldarray-ssugn)
 *
 * @param props - useFieldArray props
 *
 * @returns methods - functions to manipulate with the Field Arrays (dynamic inputs) {@link UseFieldArrayReturn}
 *
 * @example
 * ```tsx
 * function App() {
 *   const { register, control, handleSubmit, reset, trigger, setError } = useForm({
 *     defaultValues: {
 *       test: []
 *     }
 *   });
 *   const { fields, append } = useFieldArray({
 *     control,
 *     name: "test"
 *   });
 *
 *   return (
 *     <form onSubmit={handleSubmit(data => console.log(data))}>
 *       {fields.map((item, index) => (
 *          <input key={item.id} {...register(`test.${index}.firstName`)}  />
 *       ))}
 *       <button type="button" onClick={() => append({ firstName: "bill" })}>
 *         append
 *       </button>
 *       <input type="submit" />
 *     </form>
 *   );
 * }
 * ```
 */function lT(e){const t=sw();const{control:r=t.control,name:i,keyName:a="id",shouldUnregister:o,rules:s}=e;const[l,u]=n.useState(r._getFieldArray(i));const c=n.useRef(r._getFieldArray(i).map(lb));const d=n.useRef(l);const f=n.useRef(false);d.current=l;r._names.array.add(i);n.useMemo(()=>s&&r.register(i,s),[r,s,i]);sk(()=>r._subjects.array.subscribe({next:({values:e,name:t})=>{if(t===i||!t){const t=sh(e,i);if(Array.isArray(t)){u(t);c.current=t.map(lb)}}}}).unsubscribe,[r,i]);const p=n.useCallback(e=>{f.current=true;r._setFieldArray(i,e)},[r,i]);const h=(e,t)=>{const n=sH(su(e));const a=l_(r._getFieldArray(i),n);r._names.focus=ly(i,a.length-1,t);c.current=l_(c.current,n.map(lb));p(a);u(a);r._setFieldArray(i,a,l_,{argA:lw(e)})};const v=(e,t)=>{const n=sH(su(e));const a=lk(r._getFieldArray(i),n);r._names.focus=ly(i,0,t);c.current=lk(c.current,n.map(lb));p(a);u(a);r._setFieldArray(i,a,lk,{argA:lw(e)})};const g=e=>{const t=lI(r._getFieldArray(i),e);c.current=lI(c.current,e);p(t);u(t);!Array.isArray(sh(r._fields,i))&&sg(r._fields,i,undefined);r._setFieldArray(i,t,lI,{argA:e})};const m=(e,t,n)=>{const a=sH(su(t));const o=lx(r._getFieldArray(i),e,a);r._names.focus=ly(i,e,n);c.current=lx(c.current,e,a.map(lb));p(o);u(o);r._setFieldArray(i,o,lx,{argA:e,argB:lw(t)})};const b=(e,t)=>{const n=r._getFieldArray(i);lC(n,e,t);lC(c.current,e,t);p(n);u(n);r._setFieldArray(i,n,lC,{argA:e,argB:t},false)};const y=(e,t)=>{const n=r._getFieldArray(i);lA(n,e,t);lA(c.current,e,t);p(n);u(n);r._setFieldArray(i,n,lA,{argA:e,argB:t},false)};const _=(e,t)=>{const n=su(t);const a=lY(r._getFieldArray(i),e,n);c.current=[...a].map((t,r)=>!t||r===e?lb():c.current[r]);p(a);u([...a]);r._setFieldArray(i,a,lY,{argA:e,argB:n},true,false)};const w=e=>{const t=sH(su(e));c.current=t.map(lb);p([...t]);u([...t]);r._setFieldArray(i,[...t],e=>e,{},true,false)};n.useEffect(()=>{r._state.action=false;li(i,r._names)&&r._subjects.state.next({...r._formState});if(f.current&&(!le(r._options.mode).isOnSubmit||r._formState.isSubmitted)&&!le(r._options.reValidateMode).isOnSubmit){if(r._options.resolver){r._runSchema([i]).then(e=>{const t=sh(e.errors,i);const n=sh(r._formState.errors,i);if(n?!t&&n.type||t&&(n.type!==t.type||n.message!==t.message):t&&t.type){t?sg(r._formState.errors,i,t):sQ(r._formState.errors,i);r._subjects.state.next({errors:r._formState.errors})}})}else{const e=sh(r._fields,i);if(e&&e._f&&!(le(r._options.reValidateMode).isOnSubmit&&le(r._options.mode).isOnSubmit)){lv(e,r._names.disabled,r._formValues,r._options.criteriaMode===sb.all,r._options.shouldUseNativeValidation,true).then(e=>!sL(e)&&r._subjects.state.next({errors:ld(r._formState.errors,e,i)}))}}}r._subjects.state.next({name:i,values:su(r._formValues)});r._names.focus&&la(r._fields,(e,t)=>{if(r._names.focus&&t.startsWith(r._names.focus)&&e.focus){e.focus();return 1}return});r._names.focus="";r._setValid();f.current=false},[l,i,r]);n.useEffect(()=>{!sh(r._formValues,i)&&r._setFieldArray(i);return()=>{const e=(e,t)=>{const n=sh(r._fields,e);if(n&&n._f){n._f.mount=t}};r._options.shouldUnregister||o?r.unregister(i):e(i,false)}},[i,r,a,o]);return{swap:n.useCallback(b,[p,i,r]),move:n.useCallback(y,[p,i,r]),prepend:n.useCallback(v,[p,i,r]),append:n.useCallback(h,[p,i,r]),remove:n.useCallback(g,[p,i,r]),insert:n.useCallback(m,[p,i,r]),update:n.useCallback(_,[p,i,r]),replace:n.useCallback(w,[p,i,r]),fields:n.useMemo(()=>l.map((e,t)=>({...e,[a]:c.current[t]||lb()})),[l,a])}}/**
 * Custom hook to manage the entire form.
 *
 * @remarks
 * [API](https://react-hook-form.com/docs/useform) • [Demo](https://codesandbox.io/s/react-hook-form-get-started-ts-5ksmm) • [Video](https://www.youtube.com/watch?v=RkXv4AXXC_4)
 *
 * @param props - form configuration and validation parameters.
 *
 * @returns methods - individual functions to manage the form state. {@link UseFormReturn}
 *
 * @example
 * ```tsx
 * function App() {
 *   const { register, handleSubmit, watch, formState: { errors } } = useForm();
 *   const onSubmit = data => console.log(data);
 *
 *   console.log(watch("example"));
 *
 *   return (
 *     <form onSubmit={handleSubmit(onSubmit)}>
 *       <input defaultValue="test" {...register("example")} />
 *       <input {...register("exampleRequired", { required: true })} />
 *       {errors.exampleRequired && <span>This field is required</span>}
 *       <button>Submit</button>
 *     </form>
 *   );
 * }
 * ```
 */function lS(e={}){const t=n.useRef(undefined);const r=n.useRef(undefined);const[i,a]=n.useState({isDirty:false,isValidating:false,isLoading:sB(e.defaultValues),isSubmitted:false,isSubmitting:false,isSubmitSuccessful:false,isValid:false,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||false,isReady:false,defaultValues:sB(e.defaultValues)?undefined:e.defaultValues});if(!t.current){if(e.formControl){t.current={...e.formControl,formState:i};if(e.defaultValues&&!sB(e.defaultValues)){e.formControl.reset(e.defaultValues,e.resetOptions)}}else{const{formControl:r,...n}=lm(e);t.current={...n,formState:i}}}const o=t.current.control;o._options=e;sk(()=>{const e=o._subscribe({formState:o._proxyFormState,callback:()=>a({...o._formState}),reRenderRoot:true});a(e=>({...e,isReady:true}));o._formState.isReady=true;return e},[o]);n.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]);n.useEffect(()=>{if(e.mode){o._options.mode=e.mode}if(e.reValidateMode){o._options.reValidateMode=e.reValidateMode}},[o,e.mode,e.reValidateMode]);n.useEffect(()=>{if(e.errors){o._setErrors(e.errors);o._focusError()}},[o,e.errors]);n.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]);n.useEffect(()=>{if(o._proxyFormState.isDirty){const e=o._getDirty();if(e!==i.isDirty){o._subjects.state.next({isDirty:e})}}},[o,i.isDirty]);n.useEffect(()=>{if(e.values&&!sT(e.values,r.current)){o._reset(e.values,{keepFieldsRef:true,...o._options.resetOptions});r.current=e.values;a(e=>({...e}))}else{o._resetDefaultValues()}},[o,e.values]);n.useEffect(()=>{if(!o._state.mount){o._setValid();o._state.mount=true}if(o._state.watch){o._state.watch=false;o._subjects.state.next({...o._formState})}o._removeUnmounted()});t.current.formState=sA(i,o);return t.current}//# sourceMappingURL=index.esm.mjs.map
;// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/dom-utils/getWindow.js
function lO(e){if(e==null){return window}if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t?t.defaultView||window:window}return e};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/dom-utils/instanceOf.js
function lD(e){var t=lO(e).Element;return e instanceof t||e instanceof Element}function lF(e){var t=lO(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function lR(e){// IE 11 has no ShadowRoot
if(typeof ShadowRoot==="undefined"){return false}var t=lO(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/utils/math.js
var lP=Math.max;var lM=Math.min;var lH=Math.round;// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/utils/userAgent.js
function lN(){var e=navigator.userAgentData;if(e!=null&&e.brands&&Array.isArray(e.brands)){return e.brands.map(function(e){return e.brand+"/"+e.version}).join(" ")}return navigator.userAgent};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js
function lL(){return!/^((?!chrome|android).)*safari/i.test(lN())};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js
function lK(e,t,r){if(t===void 0){t=false}if(r===void 0){r=false}var n=e.getBoundingClientRect();var i=1;var a=1;if(t&&lF(e)){i=e.offsetWidth>0?lH(n.width)/e.offsetWidth||1:1;a=e.offsetHeight>0?lH(n.height)/e.offsetHeight||1:1}var o=lD(e)?lO(e):window,s=o.visualViewport;var l=!lL()&&r;var u=(n.left+(l&&s?s.offsetLeft:0))/i;var c=(n.top+(l&&s?s.offsetTop:0))/a;var d=n.width/i;var f=n.height/a;return{width:d,height:f,top:c,right:u+d,bottom:c+f,left:u,x:u,y:c}};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js
function lB(e){var t=lO(e);var r=t.pageXOffset;var n=t.pageYOffset;return{scrollLeft:r,scrollTop:n}};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js
function lj(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js
function lU(e){if(e===lO(e)||!lF(e)){return lB(e)}else{return lj(e)}};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/dom-utils/getNodeName.js
function lq(e){return e?(e.nodeName||"").toLowerCase():null};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js
function lV(e){// $FlowFixMe[incompatible-return]: assume body is always available
return((lD(e)?e.ownerDocument:e.document)||window.document).documentElement};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js
function lW(e){// If <html> has a CSS width greater than the viewport, then this will be
// incorrect for RTL.
// Popper 1 is broken in this case and never had a bug report so let's assume
// it's not an issue. I don't think anyone ever specifies width on <html>
// anyway.
// Browsers where the left scrollbar doesn't cause an issue report `0` for
// this (e.g. Edge 2019, IE11, Safari)
return lK(lV(e)).left+lB(e).scrollLeft};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js
function lz(e){return lO(e).getComputedStyle(e)};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js
function lG(e){// Firefox wants us to check `-x` and `-y` variations as well
var t=lz(e),r=t.overflow,n=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+i+n)};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js
function lQ(e){var t=e.getBoundingClientRect();var r=lH(t.width)/e.offsetWidth||1;var n=lH(t.height)/e.offsetHeight||1;return r!==1||n!==1}// Returns the composite rect of an element relative to its offsetParent.
// Composite means it takes into account transforms as well as layout.
function l$(e,t,r){if(r===void 0){r=false}var n=lF(t);var i=lF(t)&&lQ(t);var a=lV(t);var o=lK(e,i,r);var s={scrollLeft:0,scrollTop:0};var l={x:0,y:0};if(n||!n&&!r){if(lq(t)!=="body"||// https://github.com/popperjs/popper-core/issues/1078
lG(a)){s=lU(t)}if(lF(t)){l=lK(t,true);l.x+=t.clientLeft;l.y+=t.clientTop}else if(a){l.x=lW(a)}}return{x:o.left+s.scrollLeft-l.x,y:o.top+s.scrollTop-l.y,width:o.width,height:o.height}};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js
// Returns the layout rect of an element relative to its offsetParent. Layout
// means it doesn't take into account transforms.
function lX(e){var t=lK(e);// Use the clientRect sizes if it's not been transformed.
// Fixes https://github.com/popperjs/popper-core/issues/1223
var r=e.offsetWidth;var n=e.offsetHeight;if(Math.abs(t.width-r)<=1){r=t.width}if(Math.abs(t.height-n)<=1){n=t.height}return{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/dom-utils/getParentNode.js
function lJ(e){if(lq(e)==="html"){return e}return(// $FlowFixMe[incompatible-return]
// $FlowFixMe[prop-missing]
e.assignedSlot||// step into the shadow DOM of the parent of a slotted node
e.parentNode||(lR(e)?e.host:null)||// ShadowRoot detected
// $FlowFixMe[incompatible-call]: HTMLElement is a Node
lV(e)// fallback
)};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js
function lZ(e){if(["html","body","#document"].indexOf(lq(e))>=0){// $FlowFixMe[incompatible-return]: assume body is always available
return e.ownerDocument.body}if(lF(e)&&lG(e)){return e}return lZ(lJ(e))};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js
/*
given a DOM element, return the list of all scroll parents, up the list of ancesors
until we get to the top window object. This list is what we attach scroll listeners
to, because if any of these parent elements scroll, we'll need to re-calculate the
reference element's position.
*/function l0(e,t){var r;if(t===void 0){t=[]}var n=lZ(e);var i=n===((r=e.ownerDocument)==null?void 0:r.body);var a=lO(n);var o=i?[a].concat(a.visualViewport||[],lG(n)?n:[]):n;var s=t.concat(o);return i?s:s.concat(l0(lJ(o)))};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/dom-utils/isTableElement.js
function l1(e){return["table","td","th"].indexOf(lq(e))>=0};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js
function l2(e){if(!lF(e)||// https://github.com/popperjs/popper-core/issues/837
lz(e).position==="fixed"){return null}return e.offsetParent}// `.offsetParent` reports `null` for fixed elements, while absolute elements
// return the containing block
function l6(e){var t=/firefox/i.test(lN());var r=/Trident/i.test(lN());if(r&&lF(e)){// In IE 9, 10 and 11 fixed elements containing block is always established by the viewport
var n=lz(e);if(n.position==="fixed"){return null}}var i=lJ(e);if(lR(i)){i=i.host}while(lF(i)&&["html","body"].indexOf(lq(i))<0){var a=lz(i);// This is non-exhaustive but covers the most common CSS properties that
// create a containing block.
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||t&&a.willChange==="filter"||t&&a.filter&&a.filter!=="none"){return i}else{i=i.parentNode}}return null}// Gets the closest ancestor positioned element. Handles some edge cases,
// such as table ancestors and cross browser bugs.
function l4(e){var t=lO(e);var r=l2(e);while(r&&l1(r)&&lz(r).position==="static"){r=l2(r)}if(r&&(lq(r)==="html"||lq(r)==="body"&&lz(r).position==="static")){return t}return r||l6(e)||t};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/enums.js
var l5="top";var l3="bottom";var l8="right";var l9="left";var l7="auto";var ue=[l5,l3,l8,l9];var ut="start";var ur="end";var un="clippingParents";var ui="viewport";var ua="popper";var uo="reference";var us=/*#__PURE__*/ue.reduce(function(e,t){return e.concat([t+"-"+ut,t+"-"+ur])},[]);var ul=/*#__PURE__*/[].concat(ue,[l7]).reduce(function(e,t){return e.concat([t,t+"-"+ut,t+"-"+ur])},[]);// modifiers that need to read the DOM
var uu="beforeRead";var uc="read";var ud="afterRead";// pure-logic modifiers
var uf="beforeMain";var up="main";var uh="afterMain";// modifier with the purpose to write to the DOM (or write into a framework state)
var uv="beforeWrite";var ug="write";var um="afterWrite";var ub=[uu,uc,ud,uf,up,uh,uv,ug,um];// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/utils/orderModifiers.js
// source: https://stackoverflow.com/questions/49875255
function uy(e){var t=new Map;var r=new Set;var n=[];e.forEach(function(e){t.set(e.name,e)});// On visiting object, check for its dependencies and visit them recursively
function i(e){r.add(e.name);var a=[].concat(e.requires||[],e.requiresIfExists||[]);a.forEach(function(e){if(!r.has(e)){var n=t.get(e);if(n){i(n)}}});n.push(e)}e.forEach(function(e){if(!r.has(e.name)){// check for visited object
i(e)}});return n}function u_(e){// order based on dependencies
var t=uy(e);// order based on phase
return ub.reduce(function(e,r){return e.concat(t.filter(function(e){return e.phase===r}))},[])};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/utils/debounce.js
function uw(e){var t;return function(){if(!t){t=new Promise(function(r){Promise.resolve().then(function(){t=undefined;r(e())})})}return t}};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/utils/mergeByName.js
function ux(e){var t=e.reduce(function(e,t){var r=e[t.name];e[t.name]=r?Object.assign({},r,t,{options:Object.assign({},r.options,t.options),data:Object.assign({},r.data,t.data)}):t;return e},{});// IE11 does not support Object.values
return Object.keys(t).map(function(e){return t[e]})};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/createPopper.js
var uA={placement:"bottom",modifiers:[],strategy:"absolute"};function uk(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return!t.some(function(e){return!(e&&typeof e.getBoundingClientRect==="function")})}function uE(e){if(e===void 0){e={}}var t=e,r=t.defaultModifiers,n=r===void 0?[]:r,i=t.defaultOptions,a=i===void 0?uA:i;return function e(e,t,r){if(r===void 0){r=a}var i={placement:"bottom",orderedModifiers:[],options:Object.assign({},uA,a),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}};var o=[];var s=false;var l={state:i,setOptions:function r(r){var o=typeof r==="function"?r(i.options):r;c();i.options=Object.assign({},a,i.options,o);i.scrollParents={reference:lD(e)?l0(e):e.contextElement?l0(e.contextElement):[],popper:l0(t)};// Orders the modifiers based on their dependencies and `phase`
// properties
var s=u_(ux([].concat(n,i.options.modifiers)));// Strip out disabled modifiers
i.orderedModifiers=s.filter(function(e){return e.enabled});u();return l.update()},// Sync update – it will always be executed, even if not necessary. This
// is useful for low frequency updates where sync behavior simplifies the
// logic.
// For high frequency updates (e.g. `resize` and `scroll` events), always
// prefer the async Popper#update method
forceUpdate:function e(){if(s){return}var e=i.elements,t=e.reference,r=e.popper;// Don't proceed if `reference` or `popper` are not valid elements
// anymore
if(!uk(t,r)){return}// Store the reference and popper rects to be read by modifiers
i.rects={reference:l$(t,l4(r),i.options.strategy==="fixed"),popper:lX(r)};// Modifiers have the ability to reset the current update cycle. The
// most common use case for this is the `flip` modifier changing the
// placement, which then needs to re-run all the modifiers, because the
// logic was previously ran for the previous placement and is therefore
// stale/incorrect
i.reset=false;i.placement=i.options.placement;// On each update cycle, the `modifiersData` property for each modifier
// is filled with the initial data specified by the modifier. This means
// it doesn't persist and is fresh on each update.
// To ensure persistent data, use `${name}#persistent`
i.orderedModifiers.forEach(function(e){return i.modifiersData[e.name]=Object.assign({},e.data)});for(var n=0;n<i.orderedModifiers.length;n++){if(i.reset===true){i.reset=false;n=-1;continue}var a=i.orderedModifiers[n],o=a.fn,u=a.options,c=u===void 0?{}:u,d=a.name;if(typeof o==="function"){i=o({state:i,options:c,name:d,instance:l})||i}}},// Async and optimistically optimized update – it will not be executed if
// not necessary (debounced to run at most once-per-tick)
update:uw(function(){return new Promise(function(e){l.forceUpdate();e(i)})}),destroy:function e(){c();s=true}};if(!uk(e,t)){return l}l.setOptions(r).then(function(e){if(!s&&r.onFirstUpdate){r.onFirstUpdate(e)}});// Modifiers have the ability to execute arbitrary code before the first
// update cycle runs. They will be executed in the same order as the update
// cycle. This is useful when a modifier adds some persistent data that
// other modifiers need to use, but the modifier is run after the dependent
// one.
function u(){i.orderedModifiers.forEach(function(e){var t=e.name,r=e.options,n=r===void 0?{}:r,a=e.effect;if(typeof a==="function"){var s=a({state:i,name:t,instance:l,options:n});var u=function e(){};o.push(s||u)}})}function c(){o.forEach(function(e){return e()});o=[]}return l}}var uI=/*#__PURE__*//* unused pure expression or super */null&&uE();// eslint-disable-next-line import/no-unused-modules
;// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/modifiers/eventListeners.js
// eslint-disable-next-line import/no-unused-modules
var uC={passive:true};function uY(e){var t=e.state,r=e.instance,n=e.options;var i=n.scroll,a=i===void 0?true:i,o=n.resize,s=o===void 0?true:o;var l=lO(t.elements.popper);var u=[].concat(t.scrollParents.reference,t.scrollParents.popper);if(a){u.forEach(function(e){e.addEventListener("scroll",r.update,uC)})}if(s){l.addEventListener("resize",r.update,uC)}return function(){if(a){u.forEach(function(e){e.removeEventListener("scroll",r.update,uC)})}if(s){l.removeEventListener("resize",r.update,uC)}}}// eslint-disable-next-line import/no-unused-modules
/* ESM default export */const uT={name:"eventListeners",enabled:true,phase:"write",fn:function e(){},effect:uY,data:{}};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/utils/getBasePlacement.js
function uS(e){return e.split("-")[0]};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/utils/getVariation.js
function uO(e){return e.split("-")[1]};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js
function uD(e){return["top","bottom"].indexOf(e)>=0?"x":"y"};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/utils/computeOffsets.js
function uF(e){var t=e.reference,r=e.element,n=e.placement;var i=n?uS(n):null;var a=n?uO(n):null;var o=t.x+t.width/2-r.width/2;var s=t.y+t.height/2-r.height/2;var l;switch(i){case l5:l={x:o,y:t.y-r.height};break;case l3:l={x:o,y:t.y+t.height};break;case l8:l={x:t.x+t.width,y:s};break;case l9:l={x:t.x-r.width,y:s};break;default:l={x:t.x,y:t.y}}var u=i?uD(i):null;if(u!=null){var c=u==="y"?"height":"width";switch(a){case ut:l[u]=l[u]-(t[c]/2-r[c]/2);break;case ur:l[u]=l[u]+(t[c]/2-r[c]/2);break;default:}}return l};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/modifiers/popperOffsets.js
function uR(e){var t=e.state,r=e.name;// Offsets are the actual position the popper needs to have to be
// properly positioned near its reference element
// This is the most basic placement, and will be adjusted by
// the modifiers in the next step
t.modifiersData[r]=uF({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}// eslint-disable-next-line import/no-unused-modules
/* ESM default export */const uP={name:"popperOffsets",enabled:true,phase:"read",fn:uR,data:{}};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/modifiers/computeStyles.js
// eslint-disable-next-line import/no-unused-modules
var uM={top:"auto",right:"auto",bottom:"auto",left:"auto"};// Round the offsets to the nearest suitable subpixel based on the DPR.
// Zooming can change the DPR, but it seems to report a value that will
// cleanly divide the values into the appropriate subpixels.
function uH(e,t){var r=e.x,n=e.y;var i=t.devicePixelRatio||1;return{x:lH(r*i)/i||0,y:lH(n*i)/i||0}}function uN(e){var t;var r=e.popper,n=e.popperRect,i=e.placement,a=e.variation,o=e.offsets,s=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,d=e.isFixed;var f=o.x,p=f===void 0?0:f,h=o.y,v=h===void 0?0:h;var g=typeof c==="function"?c({x:p,y:v}):{x:p,y:v};p=g.x;v=g.y;var m=o.hasOwnProperty("x");var b=o.hasOwnProperty("y");var y=l9;var _=l5;var w=window;if(u){var x=l4(r);var A="clientHeight";var k="clientWidth";if(x===lO(r)){x=lV(r);if(lz(x).position!=="static"&&s==="absolute"){A="scrollHeight";k="scrollWidth"}}// $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it
x=x;if(i===l5||(i===l9||i===l8)&&a===ur){_=l3;var E=d&&x===w&&w.visualViewport?w.visualViewport.height:x[A];v-=E-n.height;v*=l?1:-1}if(i===l9||(i===l5||i===l3)&&a===ur){y=l8;var I=d&&x===w&&w.visualViewport?w.visualViewport.width:x[k];p-=I-n.width;p*=l?1:-1}}var C=Object.assign({position:s},u&&uM);var Y=c===true?uH({x:p,y:v},lO(r)):{x:p,y:v};p=Y.x;v=Y.y;if(l){var T;return Object.assign({},C,(T={},T[_]=b?"0":"",T[y]=m?"0":"",T.transform=(w.devicePixelRatio||1)<=1?"translate("+p+"px, "+v+"px)":"translate3d("+p+"px, "+v+"px, 0)",T))}return Object.assign({},C,(t={},t[_]=b?v+"px":"",t[y]=m?p+"px":"",t.transform="",t))}function uL(e){var t=e.state,r=e.options;var n=r.gpuAcceleration,i=n===void 0?true:n,a=r.adaptive,o=a===void 0?true:a,s=r.roundOffsets,l=s===void 0?true:s;var u={placement:uS(t.placement),variation:uO(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};if(t.modifiersData.popperOffsets!=null){t.styles.popper=Object.assign({},t.styles.popper,uN(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))}if(t.modifiersData.arrow!=null){t.styles.arrow=Object.assign({},t.styles.arrow,uN(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:false,roundOffsets:l})))}t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}// eslint-disable-next-line import/no-unused-modules
/* ESM default export */const uK={name:"computeStyles",enabled:true,phase:"beforeWrite",fn:uL,data:{}};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/modifiers/applyStyles.js
// This modifier takes the styles prepared by the `computeStyles` modifier
// and applies them to the HTMLElements such as popper and arrow
function uB(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var r=t.styles[e]||{};var n=t.attributes[e]||{};var i=t.elements[e];// arrow is optional + virtual elements
if(!lF(i)||!lq(i)){return}// Flow doesn't support to extend this property, but it's the most
// effective way to apply styles to an HTMLElement
// $FlowFixMe[cannot-write]
Object.assign(i.style,r);Object.keys(n).forEach(function(e){var t=n[e];if(t===false){i.removeAttribute(e)}else{i.setAttribute(e,t===true?"":t)}})})}function uj(e){var t=e.state;var r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,r.popper);t.styles=r;if(t.elements.arrow){Object.assign(t.elements.arrow.style,r.arrow)}return function(){Object.keys(t.elements).forEach(function(e){var n=t.elements[e];var i=t.attributes[e]||{};var a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:r[e]);// Set all values to an empty string to unset them
var o=a.reduce(function(e,t){e[t]="";return e},{});// arrow is optional + virtual elements
if(!lF(n)||!lq(n)){return}Object.assign(n.style,o);Object.keys(i).forEach(function(e){n.removeAttribute(e)})})}}// eslint-disable-next-line import/no-unused-modules
/* ESM default export */const uU={name:"applyStyles",enabled:true,phase:"write",fn:uB,effect:uj,requires:["computeStyles"]};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/modifiers/offset.js
// eslint-disable-next-line import/no-unused-modules
function uq(e,t,r){var n=uS(e);var i=[l9,l5].indexOf(n)>=0?-1:1;var a=typeof r==="function"?r(Object.assign({},t,{placement:e})):r,o=a[0],s=a[1];o=o||0;s=(s||0)*i;return[l9,l8].indexOf(n)>=0?{x:s,y:o}:{x:o,y:s}}function uV(e){var t=e.state,r=e.options,n=e.name;var i=r.offset,a=i===void 0?[0,0]:i;var o=ul.reduce(function(e,r){e[r]=uq(r,t.rects,a);return e},{});var s=o[t.placement],l=s.x,u=s.y;if(t.modifiersData.popperOffsets!=null){t.modifiersData.popperOffsets.x+=l;t.modifiersData.popperOffsets.y+=u}t.modifiersData[n]=o}// eslint-disable-next-line import/no-unused-modules
/* ESM default export */const uW={name:"offset",enabled:true,phase:"main",requires:["popperOffsets"],fn:uV};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/utils/getOppositePlacement.js
var uz={left:"right",right:"left",bottom:"top",top:"bottom"};function uG(e){return e.replace(/left|right|bottom|top/g,function(e){return uz[e]})};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js
var uQ={start:"end",end:"start"};function u$(e){return e.replace(/start|end/g,function(e){return uQ[e]})};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js
function uX(e,t){var r=lO(e);var n=lV(e);var i=r.visualViewport;var a=n.clientWidth;var o=n.clientHeight;var s=0;var l=0;if(i){a=i.width;o=i.height;var u=lL();if(u||!u&&t==="fixed"){s=i.offsetLeft;l=i.offsetTop}}return{width:a,height:o,x:s+lW(e),y:l}};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js
// Gets the entire size of the scrollable document area, even extending outside
// of the `<html>` and `<body>` rect bounds if horizontally scrollable
function uJ(e){var t;var r=lV(e);var n=lB(e);var i=(t=e.ownerDocument)==null?void 0:t.body;var a=lP(r.scrollWidth,r.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0);var o=lP(r.scrollHeight,r.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0);var s=-n.scrollLeft+lW(e);var l=-n.scrollTop;if(lz(i||r).direction==="rtl"){s+=lP(r.clientWidth,i?i.clientWidth:0)-a}return{width:a,height:o,x:s,y:l}};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/dom-utils/contains.js
function uZ(e,t){var r=t.getRootNode&&t.getRootNode();// First, attempt with faster native method
if(e.contains(t)){return true}else if(r&&lR(r)){var n=t;do{if(n&&e.isSameNode(n)){return true}// $FlowFixMe[prop-missing]: need a better way to handle this...
n=n.parentNode||n.host}while(n)}// Give up, the result is false
return false};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/utils/rectToClientRect.js
function u0(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js
function u1(e,t){var r=lK(e,false,t==="fixed");r.top=r.top+e.clientTop;r.left=r.left+e.clientLeft;r.bottom=r.top+e.clientHeight;r.right=r.left+e.clientWidth;r.width=e.clientWidth;r.height=e.clientHeight;r.x=r.left;r.y=r.top;return r}function u2(e,t,r){return t===ui?u0(uX(e,r)):lD(t)?u1(t,r):u0(uJ(lV(e)))}// A "clipping parent" is an overflowable container with the characteristic of
// clipping (or hiding) overflowing elements with a position different from
// `initial`
function u6(e){var t=l0(lJ(e));var r=["absolute","fixed"].indexOf(lz(e).position)>=0;var n=r&&lF(e)?l4(e):e;if(!lD(n)){return[]}// $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414
return t.filter(function(e){return lD(e)&&uZ(e,n)&&lq(e)!=="body"})}// Gets the maximum area that the element is visible in due to any number of
// clipping parents
function u4(e,t,r,n){var i=t==="clippingParents"?u6(e):[].concat(t);var a=[].concat(i,[r]);var o=a[0];var s=a.reduce(function(t,r){var i=u2(e,r,n);t.top=lP(i.top,t.top);t.right=lM(i.right,t.right);t.bottom=lM(i.bottom,t.bottom);t.left=lP(i.left,t.left);return t},u2(e,o,n));s.width=s.right-s.left;s.height=s.bottom-s.top;s.x=s.left;s.y=s.top;return s};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/utils/getFreshSideObject.js
function u5(){return{top:0,right:0,bottom:0,left:0}};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/utils/mergePaddingObject.js
function u3(e){return Object.assign({},u5(),e)};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/utils/expandToHashMap.js
function u8(e,t){return t.reduce(function(t,r){t[r]=e;return t},{})};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/utils/detectOverflow.js
// eslint-disable-next-line import/no-unused-modules
function u9(e,t){if(t===void 0){t={}}var r=t,n=r.placement,i=n===void 0?e.placement:n,a=r.strategy,o=a===void 0?e.strategy:a,s=r.boundary,l=s===void 0?un:s,u=r.rootBoundary,c=u===void 0?ui:u,d=r.elementContext,f=d===void 0?ua:d,p=r.altBoundary,h=p===void 0?false:p,v=r.padding,g=v===void 0?0:v;var m=u3(typeof g!=="number"?g:u8(g,ue));var b=f===ua?uo:ua;var y=e.rects.popper;var _=e.elements[h?b:f];var w=u4(lD(_)?_:_.contextElement||lV(e.elements.popper),l,c,o);var x=lK(e.elements.reference);var A=uF({reference:x,element:y,strategy:"absolute",placement:i});var k=u0(Object.assign({},y,A));var E=f===ua?k:x;// positive = overflowing the clipping rect
// 0 or negative = within the clipping rect
var I={top:w.top-E.top+m.top,bottom:E.bottom-w.bottom+m.bottom,left:w.left-E.left+m.left,right:E.right-w.right+m.right};var C=e.modifiersData.offset;// Offsets can be applied only to the popper element
if(f===ua&&C){var Y=C[i];Object.keys(I).forEach(function(e){var t=[l8,l3].indexOf(e)>=0?1:-1;var r=[l5,l3].indexOf(e)>=0?"y":"x";I[e]+=Y[r]*t})}return I};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js
function u7(e,t){if(t===void 0){t={}}var r=t,n=r.placement,i=r.boundary,a=r.rootBoundary,o=r.padding,s=r.flipVariations,l=r.allowedAutoPlacements,u=l===void 0?ul:l;var c=uO(n);var d=c?s?us:us.filter(function(e){return uO(e)===c}):ue;var f=d.filter(function(e){return u.indexOf(e)>=0});if(f.length===0){f=d}// $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...
var p=f.reduce(function(t,r){t[r]=u9(e,{placement:r,boundary:i,rootBoundary:a,padding:o})[uS(r)];return t},{});return Object.keys(p).sort(function(e,t){return p[e]-p[t]})};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/modifiers/flip.js
// eslint-disable-next-line import/no-unused-modules
function ce(e){if(uS(e)===l7){return[]}var t=uG(e);return[u$(e),t,u$(t)]}function ct(e){var t=e.state,r=e.options,n=e.name;if(t.modifiersData[n]._skip){return}var i=r.mainAxis,a=i===void 0?true:i,o=r.altAxis,s=o===void 0?true:o,l=r.fallbackPlacements,u=r.padding,c=r.boundary,d=r.rootBoundary,f=r.altBoundary,p=r.flipVariations,h=p===void 0?true:p,v=r.allowedAutoPlacements;var g=t.options.placement;var m=uS(g);var b=m===g;var y=l||(b||!h?[uG(g)]:ce(g));var _=[g].concat(y).reduce(function(e,r){return e.concat(uS(r)===l7?u7(t,{placement:r,boundary:c,rootBoundary:d,padding:u,flipVariations:h,allowedAutoPlacements:v}):r)},[]);var w=t.rects.reference;var x=t.rects.popper;var A=new Map;var k=true;var E=_[0];for(var I=0;I<_.length;I++){var C=_[I];var Y=uS(C);var T=uO(C)===ut;var S=[l5,l3].indexOf(Y)>=0;var O=S?"width":"height";var D=u9(t,{placement:C,boundary:c,rootBoundary:d,altBoundary:f,padding:u});var F=S?T?l8:l9:T?l3:l5;if(w[O]>x[O]){F=uG(F)}var R=uG(F);var P=[];if(a){P.push(D[Y]<=0)}if(s){P.push(D[F]<=0,D[R]<=0)}if(P.every(function(e){return e})){E=C;k=false;break}A.set(C,P)}if(k){// `2` may be desired in some cases – research later
var M=h?3:1;var H=function e(e){var t=_.find(function(t){var r=A.get(t);if(r){return r.slice(0,e).every(function(e){return e})}});if(t){E=t;return"break"}};for(var N=M;N>0;N--){var L=H(N);if(L==="break")break}}if(t.placement!==E){t.modifiersData[n]._skip=true;t.placement=E;t.reset=true}}// eslint-disable-next-line import/no-unused-modules
/* ESM default export */const cr={name:"flip",enabled:true,phase:"main",fn:ct,requiresIfExists:["offset"],data:{_skip:false}};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/utils/getAltAxis.js
function cn(e){return e==="x"?"y":"x"};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/utils/within.js
function ci(e,t,r){return lP(e,lM(t,r))}function ca(e,t,r){var n=ci(e,t,r);return n>r?r:n};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/modifiers/preventOverflow.js
function co(e){var t=e.state,r=e.options,n=e.name;var i=r.mainAxis,a=i===void 0?true:i,o=r.altAxis,s=o===void 0?false:o,l=r.boundary,u=r.rootBoundary,c=r.altBoundary,d=r.padding,f=r.tether,p=f===void 0?true:f,h=r.tetherOffset,v=h===void 0?0:h;var g=u9(t,{boundary:l,rootBoundary:u,padding:d,altBoundary:c});var m=uS(t.placement);var b=uO(t.placement);var y=!b;var _=uD(m);var w=cn(_);var x=t.modifiersData.popperOffsets;var A=t.rects.reference;var k=t.rects.popper;var E=typeof v==="function"?v(Object.assign({},t.rects,{placement:t.placement})):v;var I=typeof E==="number"?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E);var C=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null;var Y={x:0,y:0};if(!x){return}if(a){var T;var S=_==="y"?l5:l9;var O=_==="y"?l3:l8;var D=_==="y"?"height":"width";var F=x[_];var R=F+g[S];var P=F-g[O];var M=p?-k[D]/2:0;var H=b===ut?A[D]:k[D];var N=b===ut?-k[D]:-A[D];// We need to include the arrow in the calculation so the arrow doesn't go
// outside the reference bounds
var L=t.elements.arrow;var K=p&&L?lX(L):{width:0,height:0};var B=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:u5();var j=B[S];var U=B[O];// If the reference length is smaller than the arrow length, we don't want
// to include its full size in the calculation. If the reference is small
// and near the edge of a boundary, the popper can overflow even if the
// reference is not overflowing as well (e.g. virtual elements with no
// width or height)
var q=ci(0,A[D],K[D]);var V=y?A[D]/2-M-q-j-I.mainAxis:H-q-j-I.mainAxis;var W=y?-A[D]/2+M+q+U+I.mainAxis:N+q+U+I.mainAxis;var z=t.elements.arrow&&l4(t.elements.arrow);var G=z?_==="y"?z.clientTop||0:z.clientLeft||0:0;var Q=(T=C==null?void 0:C[_])!=null?T:0;var $=F+V-Q-G;var X=F+W-Q;var J=ci(p?lM(R,$):R,F,p?lP(P,X):P);x[_]=J;Y[_]=J-F}if(s){var Z;var ee=_==="x"?l5:l9;var et=_==="x"?l3:l8;var er=x[w];var en=w==="y"?"height":"width";var ei=er+g[ee];var ea=er-g[et];var eo=[l5,l9].indexOf(m)!==-1;var es=(Z=C==null?void 0:C[w])!=null?Z:0;var el=eo?ei:er-A[en]-k[en]-es+I.altAxis;var eu=eo?er+A[en]+k[en]-es-I.altAxis:ea;var ec=p&&eo?ca(el,er,eu):ci(p?el:ei,er,p?eu:ea);x[w]=ec;Y[w]=ec-er}t.modifiersData[n]=Y}// eslint-disable-next-line import/no-unused-modules
/* ESM default export */const cs={name:"preventOverflow",enabled:true,phase:"main",fn:co,requiresIfExists:["offset"]};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/modifiers/arrow.js
// eslint-disable-next-line import/no-unused-modules
var cl=function e(e,t){e=typeof e==="function"?e(Object.assign({},t.rects,{placement:t.placement})):e;return u3(typeof e!=="number"?e:u8(e,ue))};function cu(e){var t;var r=e.state,n=e.name,i=e.options;var a=r.elements.arrow;var o=r.modifiersData.popperOffsets;var s=uS(r.placement);var l=uD(s);var u=[l9,l8].indexOf(s)>=0;var c=u?"height":"width";if(!a||!o){return}var d=cl(i.padding,r);var f=lX(a);var p=l==="y"?l5:l9;var h=l==="y"?l3:l8;var v=r.rects.reference[c]+r.rects.reference[l]-o[l]-r.rects.popper[c];var g=o[l]-r.rects.reference[l];var m=l4(a);var b=m?l==="y"?m.clientHeight||0:m.clientWidth||0:0;var y=v/2-g/2;// Make sure the arrow doesn't overflow the popper if the center point is
// outside of the popper bounds
var _=d[p];var w=b-f[c]-d[h];var x=b/2-f[c]/2+y;var A=ci(_,x,w);// Prevents breaking syntax highlighting...
var k=l;r.modifiersData[n]=(t={},t[k]=A,t.centerOffset=A-x,t)}function cc(e){var t=e.state,r=e.options;var n=r.element,i=n===void 0?"[data-popper-arrow]":n;if(i==null){return}// CSS selector
if(typeof i==="string"){i=t.elements.popper.querySelector(i);if(!i){return}}if(!uZ(t.elements.popper,i)){return}t.elements.arrow=i}// eslint-disable-next-line import/no-unused-modules
/* ESM default export */const cd={name:"arrow",enabled:true,phase:"main",fn:cu,effect:cc,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/modifiers/hide.js
function cf(e,t,r){if(r===void 0){r={x:0,y:0}}return{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function cp(e){return[l5,l8,l3,l9].some(function(t){return e[t]>=0})}function ch(e){var t=e.state,r=e.name;var n=t.rects.reference;var i=t.rects.popper;var a=t.modifiersData.preventOverflow;var o=u9(t,{elementContext:"reference"});var s=u9(t,{altBoundary:true});var l=cf(o,n);var u=cf(s,i,a);var c=cp(l);var d=cp(u);t.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d};t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}// eslint-disable-next-line import/no-unused-modules
/* ESM default export */const cv={name:"hide",enabled:true,phase:"main",requiresIfExists:["preventOverflow"],fn:ch};// CONCATENATED MODULE: ../tutor/node_modules/@popperjs/core/lib/popper.js
var cg=[uT,uP,uK,uU,uW,cr,cs,cd,cv];var cm=/*#__PURE__*/uE({defaultModifiers:cg});// eslint-disable-next-line import/no-unused-modules
// eslint-disable-next-line import/no-unused-modules
// eslint-disable-next-line import/no-unused-modules
;// CONCATENATED MODULE: ../tutor/node_modules/tippy.js/headless/dist/tippy-headless.esm.js
/**!
* tippy.js v6.3.7
* (c) 2017-2021 atomiks
* MIT License
*/var cb='<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>';var cy="tippy-content";var c_="tippy-backdrop";var cw="tippy-arrow";var cx="tippy-svg-arrow";var cA={passive:true,capture:true};var ck=function e(){return document.body};function cE(e,t){return({}).hasOwnProperty.call(e,t)}function cI(e,t,r){if(Array.isArray(e)){var n=e[t];return n==null?Array.isArray(r)?r[t]:r:n}return e}function cC(e,t){var r=({}).toString.call(e);return r.indexOf("[object")===0&&r.indexOf(t+"]")>-1}function cY(e,t){return typeof e==="function"?e.apply(void 0,t):e}function cT(e,t){// Avoid wrapping in `setTimeout` if ms is 0 anyway
if(t===0){return e}var r;return function(n){clearTimeout(r);r=setTimeout(function(){e(n)},t)}}function cS(e,t){var r=Object.assign({},e);t.forEach(function(e){delete r[e]});return r}function cO(e){return e.split(/\s+/).filter(Boolean)}function cD(e){return[].concat(e)}function cF(e,t){if(e.indexOf(t)===-1){e.push(t)}}function cR(e){return e.filter(function(t,r){return e.indexOf(t)===r})}function cP(e){return e.split("-")[0]}function cM(e){return[].slice.call(e)}function cH(e){return Object.keys(e).reduce(function(t,r){if(e[r]!==undefined){t[r]=e[r]}return t},{})}function cN(){return document.createElement("div")}function cL(e){return["Element","Fragment"].some(function(t){return cC(e,t)})}function cK(e){return cC(e,"NodeList")}function cB(e){return cC(e,"MouseEvent")}function cj(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function cU(e){if(cL(e)){return[e]}if(cK(e)){return cM(e)}if(Array.isArray(e)){return e}return cM(document.querySelectorAll(e))}function cq(e,t){e.forEach(function(e){if(e){e.style.transitionDuration=t+"ms"}})}function cV(e,t){e.forEach(function(e){if(e){e.setAttribute("data-state",t)}})}function cW(e){var t;var r=cD(e),n=r[0];// Elements created via a <template> have an ownerDocument with no reference to the body
return n!=null&&(t=n.ownerDocument)!=null&&t.body?n.ownerDocument:document}function cz(e,t){var r=t.clientX,n=t.clientY;return e.every(function(e){var t=e.popperRect,i=e.popperState,a=e.props;var o=a.interactiveBorder;var s=cP(i.placement);var l=i.modifiersData.offset;if(!l){return true}var u=s==="bottom"?l.top.y:0;var c=s==="top"?l.bottom.y:0;var d=s==="right"?l.left.x:0;var f=s==="left"?l.right.x:0;var p=t.top-n+u>o;var h=n-t.bottom-c>o;var v=t.left-r+d>o;var g=r-t.right-f>o;return p||h||v||g})}function cG(e,t,r){var n=t+"EventListener";// some browsers apparently support `transition` (unprefixed) but only fire
// `webkitTransitionEnd`...
["transitionend","webkitTransitionEnd"].forEach(function(t){e[n](t,r)})}/**
 * Compared to xxx.contains, this function works for dom structures with shadow
 * dom
 */function cQ(e,t){var r=t;while(r){var n;if(e.contains(r)){return true}r=r.getRootNode==null?void 0:(n=r.getRootNode())==null?void 0:n.host}return false}var c$={isTouch:false};var cX=0;/**
 * When a `touchstart` event is fired, it's assumed the user is using touch
 * input. We'll bind a `mousemove` event listener to listen for mouse input in
 * the future. This way, the `isTouch` property is fully dynamic and will handle
 * hybrid devices that use a mix of touch + mouse input.
 */function cJ(){if(c$.isTouch){return}c$.isTouch=true;if(window.performance){document.addEventListener("mousemove",cZ)}}/**
 * When two `mousemove` event are fired consecutively within 20ms, it's assumed
 * the user is using mouse input again. `mousemove` can fire on touch devices as
 * well, but very rarely that quickly.
 */function cZ(){var e=performance.now();if(e-cX<20){c$.isTouch=false;document.removeEventListener("mousemove",cZ)}cX=e}/**
 * When an element is in focus and has a tippy, leaving the tab/window and
 * returning causes it to show again. For mouse users this is unexpected, but
 * for keyboard use it makes sense.
 * TODO: find a better technique to solve this problem
 */function c0(){var e=document.activeElement;if(cj(e)){var t=e._tippy;if(e.blur&&!t.state.isVisible){e.blur()}}}function c1(){document.addEventListener("touchstart",cJ,cA);window.addEventListener("blur",c0)}var c2=typeof window!=="undefined"&&typeof document!=="undefined";var c6=c2?!!window.msCrypto:false;function c4(e){var t=e==="destroy"?"n already-":" ";return[e+"() was called on a"+t+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function c5(e){var t=/[ \t]{2,}/g;var r=/^[ \t]*/gm;return e.replace(t," ").replace(r,"").trim()}function c3(e){return c5("\n  %ctippy.js\n\n  %c"+c5(e)+"\n\n  %c\uD83D\uDC77‍ This is a development-only message. It will be removed in production.\n  ")}function c8(e){return[c3(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}// Assume warnings and errors never have the same message
var c9;if(false){}function c7(){c9=new Set}function de(e,t){if(e&&!c9.has(t)){var r;c9.add(t);(r=console).warn.apply(r,c8(t))}}function dt(e,t){if(e&&!c9.has(t)){var r;c9.add(t);(r=console).error.apply(r,c8(t))}}function dr(e){var t=!e;var r=Object.prototype.toString.call(e)==="[object Object]"&&!e.addEventListener;dt(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" "));dt(r,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var dn={animateFill:false,followCursor:false,inlinePositioning:false,sticky:false};var di={allowHTML:false,animation:"fade",arrow:true,content:"",inertia:false,maxWidth:350,role:"tooltip",theme:"",zIndex:9999};var da=Object.assign({appendTo:ck,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:true,ignoreAttributes:false,interactive:false,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function e(){},onBeforeUpdate:function e(){},onCreate:function e(){},onDestroy:function e(){},onHidden:function e(){},onHide:function e(){},onMount:function e(){},onShow:function e(){},onShown:function e(){},onTrigger:function e(){},onUntrigger:function e(){},onClickOutside:function e(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:false,touch:true,trigger:"mouseenter focus",triggerTarget:null},dn,di);var ds=Object.keys(da);var dl=function e(e){/* istanbul ignore else */if(false){}var t=Object.keys(e);t.forEach(function(t){da[t]=e[t]})};function du(e){var t=e.plugins||[];var r=t.reduce(function(t,r){var n=r.name,i=r.defaultValue;if(n){var a;t[n]=e[n]!==undefined?e[n]:(a=da[n])!=null?a:i}return t},{});return Object.assign({},e,r)}function dc(e,t){var r=t?Object.keys(du(Object.assign({},da,{plugins:t}))):ds;var n=r.reduce(function(t,r){var n=(e.getAttribute("data-tippy-"+r)||"").trim();if(!n){return t}if(r==="content"){t[r]=n}else{try{t[r]=JSON.parse(n)}catch(e){t[r]=n}}return t},{});return n}function dd(e,t){var r=Object.assign({},t,{content:cY(t.content,[e])},t.ignoreAttributes?{}:dc(e,t.plugins));r.aria=Object.assign({},da.aria,r.aria);r.aria={expanded:r.aria.expanded==="auto"?t.interactive:r.aria.expanded,content:r.aria.content==="auto"?t.interactive?null:"describedby":r.aria.content};return r}function df(e,t){if(e===void 0){e={}}if(t===void 0){t=[]}var r=Object.keys(e);r.forEach(function(e){var r=cS(da,Object.keys(dn));var n=!cE(r,e);// Check if the prop exists in `plugins`
if(n){n=t.filter(function(t){return t.name===e}).length===0}de(n,["`"+e+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.","\n\n","All props: https://atomiks.github.io/tippyjs/v6/all-props/\n","Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}function dp(e){var t=e.firstElementChild;var r=cM(t.children);return{box:t,content:r.find(function(e){return e.classList.contains(cy)}),arrow:r.find(function(e){return e.classList.contains(cw)||e.classList.contains(cx)}),backdrop:r.find(function(e){return e.classList.contains(c_)})}}var dh=1;var dv=[];// Used by `hideAll()`
var dg=[];function dm(e,t){var r=dd(e,Object.assign({},da,du(cH(t))));// ===========================================================================
// 🔒 Private members
// ===========================================================================
var n;var i;var a;var o=false;var s=false;var l=false;var u=false;var c;var d;var f;var p=[];var h=cT($,r.interactiveDebounce);var v;// ===========================================================================
// 🔑 Public members
// ===========================================================================
var g=dh++;var m=null;var b=cR(r.plugins);var y={// Is the instance currently enabled?
isEnabled:true,// Is the tippy currently showing and not transitioning out?
isVisible:false,// Has the instance been destroyed?
isDestroyed:false,// Is the tippy currently mounted to the DOM?
isMounted:false,// Has the tippy finished transitioning in?
isShown:false};var _={// properties
id:g,reference:e,popper:cN(),popperInstance:m,props:r,state:y,plugins:b,// methods
clearDelayTimeouts:el,setProps:eu,setContent:ec,show:ed,hide:ef,hideWithInteractivity:ep,enable:eo,disable:es,unmount:eh,destroy:ev};// TODO: Investigate why this early return causes a TDZ error in the tests —
// it doesn't seem to happen in the browser
/* istanbul ignore if */if(!r.render){if(false){}return _}// ===========================================================================
// Initial mutations
// ===========================================================================
var w=r.render(_),x=w.popper,A=w.onUpdate;x.setAttribute("data-tippy-root","");x.id="tippy-"+_.id;_.popper=x;e._tippy=_;x._tippy=_;var k=b.map(function(e){return e.fn(_)});var E=e.hasAttribute("aria-expanded");z();M();F();R("onCreate",[_]);if(r.showOnCreate){ei()}// Prevent a tippy with a delay from hiding if the cursor left then returned
// before it started hiding
x.addEventListener("mouseenter",function(){if(_.props.interactive&&_.state.isVisible){_.clearDelayTimeouts()}});x.addEventListener("mouseleave",function(){if(_.props.interactive&&_.props.trigger.indexOf("mouseenter")>=0){S().addEventListener("mousemove",h)}});return _;// ===========================================================================
// 🔒 Private methods
// ===========================================================================
function I(){var e=_.props.touch;return Array.isArray(e)?e:[e,0]}function C(){return I()[0]==="hold"}function Y(){var e;// @ts-ignore
return!!((e=_.props.render)!=null&&e.$$tippy)}function T(){return v||e}function S(){var e=T().parentNode;return e?cW(e):document}function O(){return dp(x)}function D(e){// For touch or keyboard input, force `0` delay for UX reasons
// Also if the instance is mounted but not visible (transitioning out),
// ignore delay
if(_.state.isMounted&&!_.state.isVisible||c$.isTouch||c&&c.type==="focus"){return 0}return cI(_.props.delay,e?0:1,da.delay)}function F(e){if(e===void 0){e=false}x.style.pointerEvents=_.props.interactive&&!e?"":"none";x.style.zIndex=""+_.props.zIndex}function R(e,t,r){if(r===void 0){r=true}k.forEach(function(r){if(r[e]){r[e].apply(r,t)}});if(r){var n;(n=_.props)[e].apply(n,t)}}function P(){var t=_.props.aria;if(!t.content){return}var r="aria-"+t.content;var n=x.id;var i=cD(_.props.triggerTarget||e);i.forEach(function(e){var t=e.getAttribute(r);if(_.state.isVisible){e.setAttribute(r,t?t+" "+n:n)}else{var i=t&&t.replace(n,"").trim();if(i){e.setAttribute(r,i)}else{e.removeAttribute(r)}}})}function M(){if(E||!_.props.aria.expanded){return}var t=cD(_.props.triggerTarget||e);t.forEach(function(e){if(_.props.interactive){e.setAttribute("aria-expanded",_.state.isVisible&&e===T()?"true":"false")}else{e.removeAttribute("aria-expanded")}})}function H(){S().removeEventListener("mousemove",h);dv=dv.filter(function(e){return e!==h})}function N(t){// Moved finger to scroll instead of an intentional tap outside
if(c$.isTouch){if(l||t.type==="mousedown"){return}}var r=t.composedPath&&t.composedPath()[0]||t.target;// Clicked on interactive popper
if(_.props.interactive&&cQ(x,r)){return}// Clicked on the event listeners target
if(cD(_.props.triggerTarget||e).some(function(e){return cQ(e,r)})){if(c$.isTouch){return}if(_.state.isVisible&&_.props.trigger.indexOf("click")>=0){return}}else{R("onClickOutside",[_,t])}if(_.props.hideOnClick===true){_.clearDelayTimeouts();_.hide();// `mousedown` event is fired right before `focus` if pressing the
// currentTarget. This lets a tippy with `focus` trigger know that it
// should not show
s=true;setTimeout(function(){s=false});// The listener gets added in `scheduleShow()`, but this may be hiding it
// before it shows, and hide()'s early bail-out behavior can prevent it
// from being cleaned up
if(!_.state.isMounted){j()}}}function L(){l=true}function K(){l=false}function B(){var e=S();e.addEventListener("mousedown",N,true);e.addEventListener("touchend",N,cA);e.addEventListener("touchstart",K,cA);e.addEventListener("touchmove",L,cA)}function j(){var e=S();e.removeEventListener("mousedown",N,true);e.removeEventListener("touchend",N,cA);e.removeEventListener("touchstart",K,cA);e.removeEventListener("touchmove",L,cA)}function U(e,t){V(e,function(){if(!_.state.isVisible&&x.parentNode&&x.parentNode.contains(x)){t()}})}function q(e,t){V(e,t)}function V(e,t){var r=O().box;function n(e){if(e.target===r){cG(r,"remove",n);t()}}// Make callback synchronous if duration is 0
// `transitionend` won't fire otherwise
if(e===0){return t()}cG(r,"remove",d);cG(r,"add",n);d=n}function W(t,r,n){if(n===void 0){n=false}var i=cD(_.props.triggerTarget||e);i.forEach(function(e){e.addEventListener(t,r,n);p.push({node:e,eventType:t,handler:r,options:n})})}function z(){if(C()){W("touchstart",Q,{passive:true});W("touchend",X,{passive:true})}cO(_.props.trigger).forEach(function(e){if(e==="manual"){return}W(e,Q);switch(e){case"mouseenter":W("mouseleave",X);break;case"focus":W(c6?"focusout":"blur",J);break;case"focusin":W("focusout",J);break}})}function G(){p.forEach(function(e){var t=e.node,r=e.eventType,n=e.handler,i=e.options;t.removeEventListener(r,n,i)});p=[]}function Q(e){var t;var r=false;if(!_.state.isEnabled||Z(e)||s){return}var n=((t=c)==null?void 0:t.type)==="focus";c=e;v=e.currentTarget;M();if(!_.state.isVisible&&cB(e)){// If scrolling, `mouseenter` events can be fired if the cursor lands
// over a new target, but `mousemove` events don't get fired. This
// causes interactive tooltips to get stuck open until the cursor is
// moved
dv.forEach(function(t){return t(e)})}// Toggle show/hide when clicking click-triggered tooltips
if(e.type==="click"&&(_.props.trigger.indexOf("mouseenter")<0||o)&&_.props.hideOnClick!==false&&_.state.isVisible){r=true}else{ei(e)}if(e.type==="click"){o=!r}if(r&&!n){ea(e)}}function $(e){var t=e.target;var n=T().contains(t)||x.contains(t);if(e.type==="mousemove"&&n){return}var i=en().concat(x).map(function(e){var t;var n=e._tippy;var i=(t=n.popperInstance)==null?void 0:t.state;if(i){return{popperRect:e.getBoundingClientRect(),popperState:i,props:r}}return null}).filter(Boolean);if(cz(i,e)){H();ea(e)}}function X(e){var t=Z(e)||_.props.trigger.indexOf("click")>=0&&o;if(t){return}if(_.props.interactive){_.hideWithInteractivity(e);return}ea(e)}function J(e){if(_.props.trigger.indexOf("focusin")<0&&e.target!==T()){return}// If focus was moved to within the popper
if(_.props.interactive&&e.relatedTarget&&x.contains(e.relatedTarget)){return}ea(e)}function Z(e){return c$.isTouch?C()!==e.type.indexOf("touch")>=0:false}function ee(){et();var t=_.props,r=t.popperOptions,n=t.placement,i=t.offset,a=t.getReferenceClientRect,o=t.moveTransition;var s=Y()?dp(x).arrow:null;var l=a?{getBoundingClientRect:a,contextElement:a.contextElement||T()}:e;var u={name:"$$tippy",enabled:true,phase:"beforeWrite",requires:["computeStyles"],fn:function e(e){var t=e.state;if(Y()){var r=O(),n=r.box;["placement","reference-hidden","escaped"].forEach(function(e){if(e==="placement"){n.setAttribute("data-placement",t.placement)}else{if(t.attributes.popper["data-popper-"+e]){n.setAttribute("data-"+e,"")}else{n.removeAttribute("data-"+e)}}});t.attributes.popper={}}}};var c=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!o}},u];if(Y()&&s){c.push({name:"arrow",options:{element:s,padding:3}})}c.push.apply(c,(r==null?void 0:r.modifiers)||[]);_.popperInstance=cm(l,x,Object.assign({},r,{placement:n,onFirstUpdate:f,modifiers:c}))}function et(){if(_.popperInstance){_.popperInstance.destroy();_.popperInstance=null}}function er(){var e=_.props.appendTo;var t;// By default, we'll append the popper to the triggerTargets's parentNode so
// it's directly after the reference element so the elements inside the
// tippy can be tabbed to
// If there are clipping issues, the user can specify a different appendTo
// and ensure focus management is handled correctly manually
var r=T();if(_.props.interactive&&e===ck||e==="parent"){t=r.parentNode}else{t=cY(e,[r])}// The popper element needs to exist on the DOM before its position can be
// updated as Popper needs to read its dimensions
if(!t.contains(x)){t.appendChild(x)}_.state.isMounted=true;ee();/* istanbul ignore else */if(false){}}function en(){return cM(x.querySelectorAll("[data-tippy-root]"))}function ei(e){_.clearDelayTimeouts();if(e){R("onTrigger",[_,e])}B();var t=D(true);var r=I(),i=r[0],a=r[1];if(c$.isTouch&&i==="hold"&&a){t=a}if(t){n=setTimeout(function(){_.show()},t)}else{_.show()}}function ea(e){_.clearDelayTimeouts();R("onUntrigger",[_,e]);if(!_.state.isVisible){j();return}// For interactive tippies, scheduleHide is added to a document.body handler
// from onMouseLeave so must intercept scheduled hides from mousemove/leave
// events when trigger contains mouseenter and click, and the tip is
// currently shown as a result of a click.
if(_.props.trigger.indexOf("mouseenter")>=0&&_.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&o){return}var t=D(false);if(t){i=setTimeout(function(){if(_.state.isVisible){_.hide()}},t)}else{// Fixes a `transitionend` problem when it fires 1 frame too
// late sometimes, we don't want hide() to be called.
a=requestAnimationFrame(function(){_.hide()})}}// ===========================================================================
// 🔑 Public methods
// ===========================================================================
function eo(){_.state.isEnabled=true}function es(){// Disabling the instance should also hide it
// https://github.com/atomiks/tippy.js-react/issues/106
_.hide();_.state.isEnabled=false}function el(){clearTimeout(n);clearTimeout(i);cancelAnimationFrame(a)}function eu(t){/* istanbul ignore else */if(false){}if(_.state.isDestroyed){return}R("onBeforeUpdate",[_,t]);G();var r=_.props;var n=dd(e,Object.assign({},r,cH(t),{ignoreAttributes:true}));_.props=n;z();if(r.interactiveDebounce!==n.interactiveDebounce){H();h=cT($,n.interactiveDebounce)}// Ensure stale aria-expanded attributes are removed
if(r.triggerTarget&&!n.triggerTarget){cD(r.triggerTarget).forEach(function(e){e.removeAttribute("aria-expanded")})}else if(n.triggerTarget){e.removeAttribute("aria-expanded")}M();F();if(A){A(r,n)}if(_.popperInstance){ee();// Fixes an issue with nested tippies if they are all getting re-rendered,
// and the nested ones get re-rendered first.
// https://github.com/atomiks/tippyjs-react/issues/177
// TODO: find a cleaner / more efficient solution(!)
en().forEach(function(e){// React (and other UI libs likely) requires a rAF wrapper as it flushes
// its work in one
requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})}R("onAfterUpdate",[_,t])}function ec(e){_.setProps({content:e})}function ed(){/* istanbul ignore else */if(false){}// Early bail-out
var e=_.state.isVisible;var t=_.state.isDestroyed;var r=!_.state.isEnabled;var n=c$.isTouch&&!_.props.touch;var i=cI(_.props.duration,0,da.duration);if(e||t||r||n){return}// Normalize `disabled` behavior across browsers.
// Firefox allows events on disabled elements, but Chrome doesn't.
// Using a wrapper element (i.e. <span>) is recommended.
if(T().hasAttribute("disabled")){return}R("onShow",[_],false);if(_.props.onShow(_)===false){return}_.state.isVisible=true;if(Y()){x.style.visibility="visible"}F();B();if(!_.state.isMounted){x.style.transition="none"}// If flipping to the opposite side after hiding at least once, the
// animation will use the wrong placement without resetting the duration
if(Y()){var a=O(),o=a.box,s=a.content;cq([o,s],0)}f=function e(){var e;if(!_.state.isVisible||u){return}u=true;// reflow
void x.offsetHeight;x.style.transition=_.props.moveTransition;if(Y()&&_.props.animation){var t=O(),r=t.box,n=t.content;cq([r,n],i);cV([r,n],"visible")}P();M();cF(dg,_);// certain modifiers (e.g. `maxSize`) require a second update after the
// popper has been positioned for the first time
(e=_.popperInstance)==null?void 0:e.forceUpdate();R("onMount",[_]);if(_.props.animation&&Y()){q(i,function(){_.state.isShown=true;R("onShown",[_])})}};er()}function ef(){/* istanbul ignore else */if(false){}// Early bail-out
var e=!_.state.isVisible;var t=_.state.isDestroyed;var r=!_.state.isEnabled;var n=cI(_.props.duration,1,da.duration);if(e||t||r){return}R("onHide",[_],false);if(_.props.onHide(_)===false){return}_.state.isVisible=false;_.state.isShown=false;u=false;o=false;if(Y()){x.style.visibility="hidden"}H();j();F(true);if(Y()){var i=O(),a=i.box,s=i.content;if(_.props.animation){cq([a,s],n);cV([a,s],"hidden")}}P();M();if(_.props.animation){if(Y()){U(n,_.unmount)}}else{_.unmount()}}function ep(e){/* istanbul ignore else */if(false){}S().addEventListener("mousemove",h);cF(dv,h);h(e)}function eh(){/* istanbul ignore else */if(false){}if(_.state.isVisible){_.hide()}if(!_.state.isMounted){return}et();// If a popper is not interactive, it will be appended outside the popper
// tree by default. This seems mainly for interactive tippies, but we should
// find a workaround if possible
en().forEach(function(e){e._tippy.unmount()});if(x.parentNode){x.parentNode.removeChild(x)}dg=dg.filter(function(e){return e!==_});_.state.isMounted=false;R("onHidden",[_])}function ev(){/* istanbul ignore else */if(false){}if(_.state.isDestroyed){return}_.clearDelayTimeouts();_.unmount();G();delete e._tippy;_.state.isDestroyed=true;R("onDestroy",[_])}}function db(e,t){if(t===void 0){t={}}var r=da.plugins.concat(t.plugins||[]);/* istanbul ignore else */if(false){}c1();var n=Object.assign({},t,{plugins:r});var i=cU(e);/* istanbul ignore else */if(false){var a,o}var s=i.reduce(function(e,t){var r=t&&dm(t,n);if(r){e.push(r)}return e},[]);return cL(e)?s[0]:s}db.defaultProps=da;db.setDefaultProps=dl;db.currentInput=c$;var dy=function e(e){var t=e===void 0?{}:e,r=t.exclude,n=t.duration;dg.forEach(function(e){var t=false;if(r){t=cj(r)?e.reference===r:e.popper===r.popper}if(!t){var i=e.props.duration;e.setProps({duration:n});e.hide();if(!e.state.isDestroyed){e.setProps({duration:i})}}})};// every time the popper is destroyed (i.e. a new target), removing the styles
// and causing transitions to break for singletons when the console is open, but
// most notably for non-transform styles being used, `gpuAcceleration: false`.
var d_=Object.assign({},uU,{effect:function e(e){var t=e.state;var r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,r.popper);t.styles=r;if(t.elements.arrow){Object.assign(t.elements.arrow.style,r.arrow)}// intentionally return no cleanup function
// return () => { ... }
}});var dw=function e(e,t){var r;if(t===void 0){t={}}/* istanbul ignore else */if(false){}var n=e;var i=[];var a=[];var o;var s=t.overrides;var l=[];var u=false;function c(){a=n.map(function(e){return cD(e.props.triggerTarget||e.reference)}).reduce(function(e,t){return e.concat(t)},[])}function d(){i=n.map(function(e){return e.reference})}function f(e){n.forEach(function(t){if(e){t.enable()}else{t.disable()}})}function p(e){return n.map(function(t){var r=t.setProps;t.setProps=function(n){r(n);if(t.reference===o){e.setProps(n)}};return function(){t.setProps=r}})}// have to pass singleton, as it maybe undefined on first call
function h(e,t){var r=a.indexOf(t);// bail-out
if(t===o){return}o=t;var l=(s||[]).concat("content").reduce(function(e,t){e[t]=n[r].props[t];return e},{});e.setProps(Object.assign({},l,{getReferenceClientRect:typeof l.getReferenceClientRect==="function"?l.getReferenceClientRect:function(){var e;return(e=i[r])==null?void 0:e.getBoundingClientRect()}}))}f(false);d();c();var v={fn:function e(){return{onDestroy:function e(){f(true)},onHidden:function e(){o=null},onClickOutside:function e(e){if(e.props.showOnCreate&&!u){u=true;o=null}},onShow:function e(e){if(e.props.showOnCreate&&!u){u=true;h(e,i[0])}},onTrigger:function e(e,t){h(e,t.currentTarget)}}}};var g=db(cN(),Object.assign({},cS(t,["overrides"]),{plugins:[v].concat(t.plugins||[]),triggerTarget:a,popperOptions:Object.assign({},t.popperOptions,{modifiers:[].concat(((r=t.popperOptions)==null?void 0:r.modifiers)||[],[d_])})}));var m=g.show;g.show=function(e){m();// first time, showOnCreate or programmatic call with no params
// default to showing first instance
if(!o&&e==null){return h(g,i[0])}// triggered from event (do nothing as prepareInstance already called by onTrigger)
// programmatic call with no params when already visible (do nothing again)
if(o&&e==null){return}// target is index of instance
if(typeof e==="number"){return i[e]&&h(g,i[e])}// target is a child tippy instance
if(n.indexOf(e)>=0){var t=e.reference;return h(g,t)}// target is a ReferenceElement
if(i.indexOf(e)>=0){return h(g,e)}};g.showNext=function(){var e=i[0];if(!o){return g.show(0)}var t=i.indexOf(o);g.show(i[t+1]||e)};g.showPrevious=function(){var e=i[i.length-1];if(!o){return g.show(e)}var t=i.indexOf(o);var r=i[t-1]||e;g.show(r)};var b=g.setProps;g.setProps=function(e){s=e.overrides||s;b(e)};g.setInstances=function(e){f(true);l.forEach(function(e){return e()});n=e;f(false);d();c();l=p(g);g.setProps({triggerTarget:a})};l=p(g);return g};var dx=/* unused pure expression or super */null&&{mouseover:"mouseenter",focusin:"focus",click:"click"};/**
 * Creates a delegate instance that controls the creation of tippy instances
 * for child elements (`target` CSS selector).
 */function dA(e,t){/* istanbul ignore else */if(false){}var r=[];var n=[];var i=false;var a=t.target;var o=cS(t,["target"]);var s=Object.assign({},o,{trigger:"manual",touch:false});var l=Object.assign({touch:da.touch},o,{showOnCreate:true});var u=db(e,s);var c=cD(u);function d(e){if(!e.target||i){return}var r=e.target.closest(a);if(!r){return}// Get relevant trigger with fallbacks:
// 1. Check `data-tippy-trigger` attribute on target node
// 2. Fallback to `trigger` passed to `delegate()`
// 3. Fallback to `defaultProps.trigger`
var o=r.getAttribute("data-tippy-trigger")||t.trigger||da.trigger;// @ts-ignore
if(r._tippy){return}if(e.type==="touchstart"&&typeof l.touch==="boolean"){return}if(e.type!=="touchstart"&&o.indexOf(dx[e.type])<0){return}var s=db(r,l);if(s){n=n.concat(s)}}function f(e,t,n,i){if(i===void 0){i=false}e.addEventListener(t,n,i);r.push({node:e,eventType:t,handler:n,options:i})}function p(e){var t=e.reference;f(t,"touchstart",d,cA);f(t,"mouseover",d);f(t,"focusin",d);f(t,"click",d)}function h(){r.forEach(function(e){var t=e.node,r=e.eventType,n=e.handler,i=e.options;t.removeEventListener(r,n,i)});r=[]}function v(e){var t=e.destroy;var r=e.enable;var a=e.disable;e.destroy=function(e){if(e===void 0){e=true}if(e){n.forEach(function(e){e.destroy()})}n=[];h();t()};e.enable=function(){r();n.forEach(function(e){return e.enable()});i=false};e.disable=function(){a();n.forEach(function(e){return e.disable()});i=true};p(e)}c.forEach(v);return u}var dk=/* unused pure expression or super */null&&{name:"animateFill",defaultValue:false,fn:function e(e){var t;// @ts-ignore
if(!((t=e.props.render)!=null&&t.$$tippy)){if(false){}return{}}var r=dp(e.popper),n=r.box,i=r.content;var a=e.props.animateFill?dE():null;return{onCreate:function t(){if(a){n.insertBefore(a,n.firstElementChild);n.setAttribute("data-animatefill","");n.style.overflow="hidden";e.setProps({arrow:false,animation:"shift-away"})}},onMount:function e(){if(a){var e=n.style.transitionDuration;var t=Number(e.replace("ms",""));// The content should fade in after the backdrop has mostly filled the
// tooltip element. `clip-path` is the other alternative but is not
// well-supported and is buggy on some devices.
i.style.transitionDelay=Math.round(t/10)+"ms";a.style.transitionDuration=e;cV([a],"visible")}},onShow:function e(){if(a){a.style.transitionDuration="0ms"}},onHide:function e(){if(a){cV([a],"hidden")}}}}};function dE(){var e=cN();e.className=c_;cV([e],"hidden");return e}var dI=/* unused pure expression or super */null&&{clientX:0,clientY:0};var dC=/* unused pure expression or super */null&&[];function dY(e){var t=e.clientX,r=e.clientY;dI={clientX:t,clientY:r}}function dT(e){e.addEventListener("mousemove",dY)}function dS(e){e.removeEventListener("mousemove",dY)}var dO=/* unused pure expression or super */null&&{name:"followCursor",defaultValue:false,fn:function e(e){var t=e.reference;var r=cW(e.props.triggerTarget||t);var n=false;var i=false;var a=true;var o=e.props;function s(){return e.props.followCursor==="initial"&&e.state.isVisible}function l(){r.addEventListener("mousemove",d)}function u(){r.removeEventListener("mousemove",d)}function c(){n=true;e.setProps({getReferenceClientRect:null});n=false}function d(r){// If the instance is interactive, avoid updating the position unless it's
// over the reference element
var n=r.target?t.contains(r.target):true;var i=e.props.followCursor;var a=r.clientX,o=r.clientY;var s=t.getBoundingClientRect();var l=a-s.left;var u=o-s.top;if(n||!e.props.interactive){e.setProps({// @ts-ignore - unneeded DOMRect properties
getReferenceClientRect:function e(){var e=t.getBoundingClientRect();var r=a;var n=o;if(i==="initial"){r=e.left+l;n=e.top+u}var s=i==="horizontal"?e.top:n;var c=i==="vertical"?e.right:r;var d=i==="horizontal"?e.bottom:n;var f=i==="vertical"?e.left:r;return{width:c-f,height:d-s,top:s,right:c,bottom:d,left:f}}})}}function f(){if(e.props.followCursor){dC.push({instance:e,doc:r});dT(r)}}function p(){dC=dC.filter(function(t){return t.instance!==e});if(dC.filter(function(e){return e.doc===r}).length===0){dS(r)}}return{onCreate:f,onDestroy:p,onBeforeUpdate:function t(){o=e.props},onAfterUpdate:function t(t,r){var a=r.followCursor;if(n){return}if(a!==undefined&&o.followCursor!==a){p();if(a){f();if(e.state.isMounted&&!i&&!s()){l()}}else{u();c()}}},onMount:function t(){if(e.props.followCursor&&!i){if(a){d(dI);a=false}if(!s()){l()}}},onTrigger:function e(e,t){if(cB(t)){dI={clientX:t.clientX,clientY:t.clientY}}i=t.type==="focus"},onHidden:function t(){if(e.props.followCursor){c();u();a=true}}}}};function dD(e,t){var r;return{popperOptions:Object.assign({},e.popperOptions,{modifiers:[].concat((((r=e.popperOptions)==null?void 0:r.modifiers)||[]).filter(function(e){var r=e.name;return r!==t.name}),[t])})}}var dF=/* unused pure expression or super */null&&{name:"inlinePositioning",defaultValue:false,fn:function e(e){var t=e.reference;function r(){return!!e.props.inlinePositioning}var n;var i=-1;var a=false;var o=[];var s={name:"tippyInlinePositioning",enabled:true,phase:"afterWrite",fn:function t(t){var i=t.state;if(r()){if(o.indexOf(i.placement)!==-1){o=[]}if(n!==i.placement&&o.indexOf(i.placement)===-1){o.push(i.placement);e.setProps({// @ts-ignore - unneeded DOMRect properties
getReferenceClientRect:function e(){return l(i.placement)}})}n=i.placement}}};function l(e){return dR(cP(e),t.getBoundingClientRect(),cM(t.getClientRects()),i)}function u(t){a=true;e.setProps(t);a=false}function c(){if(!a){u(dD(e.props,s))}}return{onCreate:c,onAfterUpdate:c,onTrigger:function t(t,r){if(cB(r)){var n=cM(e.reference.getClientRects());var a=n.find(function(e){return e.left-2<=r.clientX&&e.right+2>=r.clientX&&e.top-2<=r.clientY&&e.bottom+2>=r.clientY});var o=n.indexOf(a);i=o>-1?o:i}},onHidden:function e(){i=-1}}}};function dR(e,t,r,n){// Not an inline element, or placement is not yet known
if(r.length<2||e===null){return t}// There are two rects and they are disjoined
if(r.length===2&&n>=0&&r[0].left>r[1].right){return r[n]||t}switch(e){case"top":case"bottom":{var i=r[0];var a=r[r.length-1];var o=e==="top";var s=i.top;var l=a.bottom;var u=o?i.left:a.left;var c=o?i.right:a.right;var d=c-u;var f=l-s;return{top:s,bottom:l,left:u,right:c,width:d,height:f}}case"left":case"right":{var p=Math.min.apply(Math,r.map(function(e){return e.left}));var h=Math.max.apply(Math,r.map(function(e){return e.right}));var v=r.filter(function(t){return e==="left"?t.left===p:t.right===h});var g=v[0].top;var m=v[v.length-1].bottom;var b=p;var y=h;var _=y-b;var w=m-g;return{top:g,bottom:m,left:b,right:y,width:_,height:w}}default:{return t}}}var dP=/* unused pure expression or super */null&&{name:"sticky",defaultValue:false,fn:function e(e){var t=e.reference,r=e.popper;function n(){return e.popperInstance?e.popperInstance.state.elements.reference:t}function i(t){return e.props.sticky===true||e.props.sticky===t}var a=null;var o=null;function s(){var t=i("reference")?n().getBoundingClientRect():null;var l=i("popper")?r.getBoundingClientRect():null;if(t&&dM(a,t)||l&&dM(o,l)){if(e.popperInstance){e.popperInstance.update()}}a=t;o=l;if(e.state.isMounted){requestAnimationFrame(s)}}return{onMount:function t(){if(e.props.sticky){s()}}}}};function dM(e,t){if(e&&t){return e.top!==t.top||e.right!==t.right||e.bottom!==t.bottom||e.left!==t.left}return true}db.setDefaultProps({animation:false});/* ESM default export */const dH=db;//# sourceMappingURL=tippy-headless.esm.js.map
;// CONCATENATED MODULE: ../tutor/node_modules/@tippyjs/react/headless/dist/tippy-react-headless.esm.js
function dN(e,t){if(e==null)return{};var r={};var n=Object.keys(e);var i,a;for(a=0;a<n.length;a++){i=n[a];if(t.indexOf(i)>=0)continue;r[i]=e[i]}return r}var dL=typeof window!=="undefined"&&typeof document!=="undefined";function dK(e,t){if(e){if(typeof e==="function"){e(t)}if(({}).hasOwnProperty.call(e,"current")){e.current=t}}}function dB(){return dL&&document.createElement("div")}function dj(e){var t={"data-placement":e.placement};if(e.referenceHidden){t["data-reference-hidden"]=""}if(e.escaped){t["data-escaped"]=""}return t}function dU(e,t){if(e===t){return true}else if(typeof e==="object"&&e!=null&&typeof t==="object"&&t!=null){if(Object.keys(e).length!==Object.keys(t).length){return false}for(var r in e){if(t.hasOwnProperty(r)){if(!dU(e[r],t[r])){return false}}else{return false}}return true}else{return false}}function dq(e){var t=[];e.forEach(function(e){if(!t.find(function(t){return dU(e,t)})){t.push(e)}});return t}function dV(e,t){var r,n;return Object.assign({},t,{popperOptions:Object.assign({},e.popperOptions,t.popperOptions,{modifiers:dq([].concat(((r=e.popperOptions)==null?void 0:r.modifiers)||[],((n=t.popperOptions)==null?void 0:n.modifiers)||[]))})})}var dW=dL?n.useLayoutEffect:n.useEffect;function dz(e){// Using refs instead of state as it's recommended to not store imperative
// values in state due to memory problems in React(?)
var t=(0,n.useRef)();if(!t.current){t.current=typeof e==="function"?e():e}return t.current}function dG(e,t,r){r.split(/\s+/).forEach(function(r){if(r){e.classList[t](r)}})}var dQ={name:"className",defaultValue:"",fn:function e(e){var t=e.popper.firstElementChild;var r=function t(){var t;return!!((t=e.props.render)==null?void 0:t.$$tippy)};function n(){if(e.props.className&&!r()){if(false){}return}dG(t,"add",e.props.className)}function i(){if(r()){dG(t,"remove",e.props.className)}}return{onCreate:n,onBeforeUpdate:i,onAfterUpdate:n}}};function d$(e){function t(t){var r=t.children,a=t.content,o=t.visible,s=t.singleton,l=t.render,u=t.reference,c=t.disabled,d=c===void 0?false:c,f=t.ignoreAttributes,p=f===void 0?true:f,h=t.__source,v=t.__self,g=dN(t,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"]);var m=o!==undefined;var b=s!==undefined;var y=(0,n.useState)(false),_=y[0],w=y[1];var x=(0,n.useState)({}),A=x[0],k=x[1];var E=(0,n.useState)(),I=E[0],C=E[1];var Y=dz(function(){return{container:dB(),renders:1}});var T=Object.assign({ignoreAttributes:p},g,{content:Y.container});if(m){if(false){}T.trigger="manual";T.hideOnClick=false}if(b){d=true}var S=T;var O=T.plugins||[];if(l){S=Object.assign({},T,{plugins:b&&s.data!=null?[].concat(O,[{fn:function e(){return{onTrigger:function e(e,t){var r=s.data.children.find(function(e){var r=e.instance;return r.reference===t.currentTarget});e.state.$$activeSingletonInstance=r.instance;C(r.content)}}}}]):O,render:function e(){return{popper:Y.container}}})}var D=[u].concat(r?[r.type]:[]);// CREATE
dW(function(){var t=u;if(u&&u.hasOwnProperty("current")){t=u.current}var r=e(t||Y.ref||dB(),Object.assign({},S,{plugins:[dQ].concat(T.plugins||[])}));Y.instance=r;if(d){r.disable()}if(o){r.show()}if(b){s.hook({instance:r,content:a,props:S,setSingletonContent:C})}w(true);return function(){r.destroy();s==null?void 0:s.cleanup(r)}},D);// UPDATE
dW(function(){var e;// Prevent this effect from running on 1st render
if(Y.renders===1){Y.renders++;return}var t=Y.instance;t.setProps(dV(t.props,S));// Fixes #264
(e=t.popperInstance)==null?void 0:e.forceUpdate();if(d){t.disable()}else{t.enable()}if(m){if(o){t.show()}else{t.hide()}}if(b){s.hook({instance:t,content:a,props:S,setSingletonContent:C})}});dW(function(){var e;if(!l){return}var t=Y.instance;t.setProps({popperOptions:Object.assign({},t.props.popperOptions,{modifiers:[].concat((((e=t.props.popperOptions)==null?void 0:e.modifiers)||[]).filter(function(e){var t=e.name;return t!=="$$tippyReact"}),[{name:"$$tippyReact",enabled:true,phase:"beforeWrite",requires:["computeStyles"],fn:function e(e){var t;var r=e.state;var n=(t=r.modifiersData)==null?void 0:t.hide;// WARNING: this is a high-risk path that can cause an infinite
// loop. This expression _must_ evaluate to false when required
if(A.placement!==r.placement||A.referenceHidden!==(n==null?void 0:n.isReferenceHidden)||A.escaped!==(n==null?void 0:n.hasPopperEscaped)){k({placement:r.placement,referenceHidden:n==null?void 0:n.isReferenceHidden,escaped:n==null?void 0:n.hasPopperEscaped})}r.attributes.popper={}}}])})})},[A.placement,A.referenceHidden,A.escaped].concat(D));return /*#__PURE__*/i().createElement(i().Fragment,null,r?/*#__PURE__*/(0,n.cloneElement)(r,{ref:function e(e){Y.ref=e;dK(r.ref,e)}}):null,_&&/*#__PURE__*/(0,iW.createPortal)(l?l(dj(A),I,Y.instance):a,Y.container))}return t}function dX(e){return function t(t){var r=t===void 0?{}:t,n=r.disabled,i=n===void 0?false:n,a=r.overrides,o=a===void 0?[]:a;var s=useState(false),l=s[0],u=s[1];var c=dz({children:[],renders:1});dW(function(){if(!l){u(true);return}var t=c.children,r=c.sourceData;if(!r){if(false){}return}var n=e(t.map(function(e){return e.instance}),Object.assign({},r.props,{popperOptions:r.instance.props.popperOptions,overrides:o,plugins:[dQ].concat(r.props.plugins||[])}));c.instance=n;if(i){n.disable()}return function(){n.destroy();c.children=t.filter(function(e){var t=e.instance;return!t.state.isDestroyed})}},[l]);dW(function(){if(!l){return}if(c.renders===1){c.renders++;return}var e=c.children,t=c.instance,r=c.sourceData;if(!(t&&r)){return}var n=r.props,a=n.content,s=dN(n,["content"]);t.setProps(dV(t.props,Object.assign({},s,{overrides:o})));t.setInstances(e.map(function(e){return e.instance}));if(i){t.disable()}else{t.enable()}});return useMemo(function(){var e={data:c,hook:function e(e){c.sourceData=e;c.setSingletonContent=e.setSingletonContent},cleanup:function e(){c.sourceData=null}};var t={hook:function e(e){var t,r;c.children=c.children.filter(function(t){var r=t.instance;return e.instance!==r});c.children.push(e);if(((t=c.instance)==null?void 0:t.state.isMounted)&&((r=c.instance)==null?void 0:r.state.$$activeSingletonInstance)===e.instance){c.setSingletonContent==null?void 0:c.setSingletonContent(e.content)}if(c.instance&&!c.instance.state.isDestroyed){c.instance.setInstances(c.children.map(function(e){return e.instance}))}},cleanup:function e(e){c.children=c.children.filter(function(t){return t.instance!==e});if(c.instance&&!c.instance.state.isDestroyed){c.instance.setInstances(c.children.map(function(e){return e.instance}))}}};return[e,t]},[])}}var dJ=function(e,t){return/*#__PURE__*/(0,n.forwardRef)(function r(r,a){var o=r.children,s=dN(r,["children"]);return(/*#__PURE__*/// If I spread them separately here, Babel adds the _extends ponyfill for
// some reason
i().createElement(e,Object.assign({},t,s),o?/*#__PURE__*/(0,n.cloneElement)(o,{ref:function e(e){dK(a,e);dK(o.ref,e)}}):null))})};var dZ=/*#__PURE__*//* unused pure expression or super */null&&dX(createSingleton);var d0=/*#__PURE__*/dJ(/*#__PURE__*/d$(dH),{render:function e(){return""}});/* ESM default export */const d1=d0;//# sourceMappingURL=tippy-react-headless.esm.js.map
;// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/atoms/Tooltip.tsx
function d2(){var e=(0,eS._)(["\n        bottom: auto;\n        left: -4px;\n        top: 50%;\n        transform: translateY(-50%) rotate(45deg);\n      "]);d2=function t(){return e};return e}function d6(){var e=(0,eS._)(["\n        bottom: auto;\n        top: -4px;\n        left: 50%;\n        transform: translateX(-50%) rotate(45deg);\n      "]);d6=function t(){return e};return e}function d4(){var e=(0,eS._)(["\n        bottom: auto;\n        top: 50%;\n        left: auto;\n        right: -4px;\n        transform: translateY(-50%) rotate(45deg);\n      "]);d4=function t(){return e};return e}var d5={opacity:0,transform:"scale(0.8)"};var d3={tension:300,friction:15};var d8=e=>{var{children:r,content:n,allowHTML:i,placement:a="top",hideOnClick:o,delay:s=0,disabled:l=false,visible:u}=e;var[c,d]=ik(()=>d5);if(l)return r;var f=()=>{d.start({opacity:1,transform:"scale(1)",config:d3})};var p=e=>{var{unmount:t}=e;d.start((0,eX._)((0,e$._)({},d5),{onRest:t,config:(0,eX._)((0,e$._)({},d3),{clamp:true})}))};return/*#__PURE__*/(0,t/* .jsx */.Y)(d1,{render:e=>{return/*#__PURE__*/(0,t/* .jsx */.Y)(ac,(0,eX._)((0,e$._)({style:c,hideOnOverflow:false},e),{css:d7.contentBox(a),children:n}))},animation:true,onMount:f,onHide:p,allowHTML:i,delay:[s,100],hideOnClick:o,placement:a,visible:u,zIndex:ey/* .zIndex.highest */.fE.highest,children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{children:r})})};/* ESM default export */const d9=d8;var d7={contentBox:e=>/*#__PURE__*/(0,o/* .css */.AH)("max-width:250px;width:100%;background-color:",ey/* .colorTokens.color.black.main */.I6.color.black.main,";color:",ey/* .colorTokens.text.white */.I6.text.white,";border-radius:",ey/* .borderRadius["6"] */.Vq["6"],";padding:",ey/* .spacing["4"] */.YK["4"]," ",ey/* .spacing["8"] */.YK["8"],";font-size:",ey/* .fontSize["15"] */.J["15"],";line-height:",ey/* .lineHeight["20"] */.K_["20"],";position:relative;&::before{content:'';height:8px;width:8px;background-color:",ey/* .colorTokens.color.black.main */.I6.color.black.main,";position:absolute;bottom:-4px;left:50%;transform:translateX(-50%) rotate(45deg);",e==="right"&&(0,o/* .css */.AH)(d2())," ",e==="bottom"&&(0,o/* .css */.AH)(d6())," ",e==="left"&&(0,o/* .css */.AH)(d4()),"}")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/fields/FormFieldWrapper.tsx
function fe(){var e=(0,eS._)(["\n      opacity: 0.5;\n    "]);fe=function t(){return e};return e}function ft(){var e=(0,eS._)(["\n      display: none;\n    "]);ft=function t(){return e};return e}function fr(){var e=(0,eS._)(["\n      flex-direction: row;\n      align-items: center;\n      justify-content: space-between;\n      gap: ",";\n    "]);fr=function t(){return e};return e}function fn(){var e=(0,eS._)(["\n        padding: 0 "," 0 ",";\n      "]);fn=function t(){return e};return e}function fi(){var e=(0,eS._)(["\n        border-radius: 0;\n        border: none;\n        box-shadow: none;\n      "]);fi=function t(){return e};return e}function fa(){var e=(0,eS._)(["\n        border-color: transparent;\n      "]);fa=function t(){return e};return e}function fo(){var e=(0,eS._)(["\n          outline-color: ",";\n          background-color: ",";\n        "]);fo=function t(){return e};return e}function fs(){var e=(0,eS._)(["\n          border-color: ",";\n        "]);fs=function t(){return e};return e}function fl(){var e=(0,eS._)(["\n          color: ",";\n        "]);fl=function t(){return e};return e}function fu(){var e=(0,eS._)(["\n        border-color: ",";\n        background-color: ",";\n      "]);fu=function t(){return e};return e}function fc(){var e=(0,eS._)(["\n        border-color: ",";\n        background-color: ",";\n      "]);fc=function t(){return e};return e}function fd(){var e=(0,eS._)(["\n      justify-content: end;\n    "]);fd=function t(){return e};return e}function ff(){var e=(0,eS._)(["\n      color: ",";\n    "]);ff=function t(){return e};return e}function fp(){var e=(0,eS._)(["\n      ",";\n    "]);fp=function t(){return e};return e}var fh=e=>{var{field:r,fieldState:n,children:i,disabled:a=false,readOnly:o=false,label:s,isInlineLabel:l=false,variant:u,loading:c,placeholder:d,helpText:f,isHidden:p=false,removeBorder:h=false,characterCount:v,isSecondary:g=false,inputStyle:m,onClickAiButton:b,isMagicAi:y=false,generateWithAi:_=false,replaceEntireLabel:w=false}=e;var x;var A=(0,ej/* .nanoid */.Ak)();var k=[fg.input({variant:u,hasFieldError:!!n.error,removeBorder:h,readOnly:o,hasHelpText:!!f,isSecondary:g,isMagicAi:y})];if((0,eO/* .isDefined */.O9)(m)){k.push(m)}var E=/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:fg.inputWrapper,children:[i({id:A,name:r.name,css:k,"aria-invalid":n.error?"true":"false",disabled:a,readOnly:o,placeholder:d,className:"tutor-input-field"}),c&&/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:fg.loader,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eT,{size:20,color:ey/* .colorTokens.icon["default"] */.I6.icon["default"]})})]});return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:fg.container({disabled:a,isHidden:p}),"data-cy":"form-field-wrapper",children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:fg.inputContainer(l),children:[(s||f)&&/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:fg.labelContainer,children:[s&&/*#__PURE__*/(0,t/* .jsxs */.FD)("label",{htmlFor:A,css:fg.label(l,w),children:[s,/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:_,children:/*#__PURE__*/(0,t/* .jsx */.Y)("button",{type:"button",onClick:()=>{b===null||b===void 0?void 0:b()},css:fg.aiButton,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"magicAiColorize",width:32,height:32})})})]}),f&&!w&&/*#__PURE__*/(0,t/* .jsx */.Y)(d9,{content:f,placement:"top",allowHTML:true,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"info",width:20,height:20})})]}),v?/*#__PURE__*/(0,t/* .jsx */.Y)(d9,{placement:"right",hideOnClick:false,content:v.maxLimit-v.inputCharacter>=0?v.maxLimit-v.inputCharacter:(0,em.__)("Limit exceeded","tutor-pro"),children:E}):E]}),((x=n.error)===null||x===void 0?void 0:x.message)&&/*#__PURE__*/(0,t/* .jsxs */.FD)("p",{css:fg.errorLabel(!!n.error,l),children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{style:fg.alertIcon,name:"info",width:20,height:20})," ",n.error.message]})]})};/* ESM default export */const fv=fh;var fg={container:e=>{var{disabled:t,isHidden:r}=e;return/*#__PURE__*/(0,o/* .css */.AH)("display:flex;flex-direction:column;position:relative;background:inherit;width:100%;",t&&(0,o/* .css */.AH)(fe())," ",r&&(0,o/* .css */.AH)(ft()))},inputContainer:e=>/*#__PURE__*/(0,o/* .css */.AH)("display:flex;flex-direction:column;gap:",ey/* .spacing["4"] */.YK["4"],";width:100%;",e&&(0,o/* .css */.AH)(fr(),ey/* .spacing["12"] */.YK["12"])),input:e=>/*#__PURE__*/(0,o/* .css */.AH)("&.tutor-input-field{",eK/* .typography.body */.I.body("regular"),";width:100%;border-radius:",ey/* .borderRadius["6"] */.Vq["6"],";border:1px solid ",ey/* .colorTokens.stroke["default"] */.I6.stroke["default"],";padding:",ey/* .spacing["8"] */.YK["8"]," ",ey/* .spacing["16"] */.YK["16"],";color:",ey/* .colorTokens.text.title */.I6.text.title,";appearance:textfield;&:not(textarea){height:40px;}",e.hasHelpText&&(0,o/* .css */.AH)(fn(),ey/* .spacing["32"] */.YK["32"],ey/* .spacing["12"] */.YK["12"])," ",e.removeBorder&&(0,o/* .css */.AH)(fi())," ",e.isSecondary&&(0,o/* .css */.AH)(fa()),":focus{",eB/* .styleUtils.inputFocus */.x.inputFocus,";",e.isMagicAi&&(0,o/* .css */.AH)(fo(),ey/* .colorTokens.stroke.magicAi */.I6.stroke.magicAi,ey/* .colorTokens.background.magicAi["8"] */.I6.background.magicAi["8"])," ",e.hasFieldError&&(0,o/* .css */.AH)(fs(),ey/* .colorTokens.stroke.danger */.I6.stroke.danger),"}::-webkit-outer-spin-button,::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}::placeholder{",eK/* .typography.caption */.I.caption("regular"),";color:",ey/* .colorTokens.text.hints */.I6.text.hints,";",e.isSecondary&&(0,o/* .css */.AH)(fl(),ey/* .colorTokens.text.hints */.I6.text.hints),"}",e.hasFieldError&&(0,o/* .css */.AH)(fu(),ey/* .colorTokens.stroke.danger */.I6.stroke.danger,ey/* .colorTokens.background.status.errorFail */.I6.background.status.errorFail)," ",e.readOnly&&(0,o/* .css */.AH)(fc(),ey/* .colorTokens.background.disable */.I6.background.disable,ey/* .colorTokens.background.disable */.I6.background.disable),"}"),errorLabel:(e,t)=>/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.small */.I.small(),";line-height:",ey/* .lineHeight["20"] */.K_["20"],";display:flex;align-items:start;margin-top:",ey/* .spacing["4"] */.YK["4"],";",t&&(0,o/* .css */.AH)(fd())," ",e&&(0,o/* .css */.AH)(ff(),ey/* .colorTokens.text.status.onHold */.I6.text.status.onHold),"    & svg{margin-right:",ey/* .spacing["2"] */.YK["2"],";transform:rotate(180deg);}"),labelContainer:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;align-items:center;gap:",ey/* .spacing["4"] */.YK["4"],";> div{display:flex;color:",ey/* .colorTokens.color.black["30"] */.I6.color.black["30"],";}"),label:(e,t)=>/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.caption */.I.caption(),";margin:0px;width:",t?"100%":"auto",";color:",ey/* .colorTokens.text.title */.I6.text.title,";display:flex;align-items:center;gap:",ey/* .spacing["4"] */.YK["4"],";",e&&(0,o/* .css */.AH)(fp(),eK/* .typography.caption */.I.caption())),aiButton:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.resetButton */.x.resetButton,";width:32px;height:32px;border-radius:",ey/* .borderRadius["4"] */.Vq["4"],";display:flex;align-items:center;justify-content:center;:disabled{cursor:not-allowed;}&:focus,&:active,&:hover{background:none;}&:focus-visible{outline:2px solid ",ey/* .colorTokens.stroke.brand */.I6.stroke.brand,";}"),inputWrapper:/*#__PURE__*/(0,o/* .css */.AH)("position:relative;"),loader:/*#__PURE__*/(0,o/* .css */.AH)("position:absolute;top:50%;right:",ey/* .spacing["12"] */.YK["12"],";transform:translateY(-50%);display:flex;"),alertIcon:/*#__PURE__*/(0,o/* .css */.AH)("flex-shrink:0;")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/controls/For.tsx
var fm=e=>{var{each:t,children:r,fallback:n=null}=e;if(t.length===0){return n}return t.map((e,t)=>{return r(e,t)})};/* ESM default export */const fb=fm;// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/config/config.ts
var fy=r(9568);// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/hooks/useVisibilityControl.tsx
/**
 * Custom hook to control the visibility of fields based on the provided visibility key and context.
 *
 * @param {string} visibilityKey - The key used to determine the visibility of the field.
 * @returns {boolean} - Returns true if the field should be visible, false otherwise.
 */var f_=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return(0,n.useMemo)(()=>{var t;// If no visibility key provided, always show the field
if(!(0,eO/* .isDefined */.O9)(e)){return true}var[r,n]=(e===null||e===void 0?void 0:e.split("."))||[];if(!(0,eO/* .isDefined */.O9)(r)||!(0,eO/* .isDefined */.O9)(n)){return true}var i=fy/* .tutorConfig */.P===null||fy/* .tutorConfig */.P===void 0?void 0:(t=fy/* .tutorConfig.visibility_control */.P.visibility_control)===null||t===void 0?void 0:t[r];if(!i){return true}var a=fy/* .tutorConfig.current_user.roles */.P.current_user.roles;var o=a.includes("administrator")?"admin":"instructor";var s="".concat(n,"_").concat(o);if(!Object.keys(i).includes(s)){return true}return i[s]==="on"},[e])};/* ESM default export */const fw=f_;// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/hoc/withVisibilityControl.tsx
var fx=e=>{return r=>{var{visibilityKey:n}=r,i=(0,eJ._)(r,["visibilityKey"]);var a=fw(n);if(!a){return null}// @ts-ignore
return/*#__PURE__*/(0,t/* .jsx */.Y)(e,(0,e$._)({},i))}};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/atoms/Toast.tsx
function fA(){var e=(0,eS._)(["\n      left: ",";\n      top: calc("," + 60px);\n    "]);fA=function t(){return e};return e}function fk(){var e=(0,eS._)(["\n      right: ",";\n      top: calc("," + 60px);\n    "]);fk=function t(){return e};return e}function fE(){var e=(0,eS._)(["\n      left: 50%;\n      top: calc("," + 60px);\n      transform: translateX(-50%);\n    "]);fE=function t(){return e};return e}function fI(){var e=(0,eS._)(["\n      left: ",";\n      bottom: ",";\n    "]);fI=function t(){return e};return e}function fC(){var e=(0,eS._)(["\n      right: ",";\n      bottom: ",";\n    "]);fC=function t(){return e};return e}function fY(){var e=(0,eS._)(["\n      left: 50%;\n      bottom: ",";\n      transform: translateX(-50%);\n    "]);fY=function t(){return e};return e}function fT(){var e=(0,eS._)(["\n      background: ",";\n    "]);fT=function t(){return e};return e}function fS(){var e=(0,eS._)(["\n      background: ",";\n    "]);fS=function t(){return e};return e}function fO(){var e=(0,eS._)(["\n      background: ",";\n    "]);fO=function t(){return e};return e}function fD(){var e=(0,eS._)(["\n      background: ",";\n\n      h5 {\n        color: ",";\n      }\n\n      svg > path {\n        color: ",";\n      }\n    "]);fD=function t(){return e};return e}var fF={type:"dark",message:"",autoCloseDelay:3e3,position:"bottom-right"};var fR=/*#__PURE__*/i().createContext({showToast:()=>{}});var fP=()=>(0,n.useContext)(fR);var fM=e=>{var{children:r,position:i="bottom-right"}=e;var[a,o]=(0,n.useState)([]);var s=iT(a,{from:{opacity:0,y:-40},enter:{opacity:1,y:0},leave:{opacity:.5,y:100},config:{duration:300}});var l=(0,n.useCallback)(e=>{var t=(0,eX._)((0,e$._)({},fF,e),{id:(0,ej/* .nanoid */.Ak)()});o(e=>[t,...e]);var r;if(!(0,eO/* .isBoolean */.Lm)(t.autoCloseDelay)&&t.autoCloseDelay){r=setTimeout(()=>{o(e=>e.slice(0,-1))},t.autoCloseDelay)}return()=>{clearTimeout(r)}},[]);return/*#__PURE__*/(0,t/* .jsxs */.FD)(fR.Provider,{value:{showToast:l},children:[r,/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:fN.toastWrapper(i),children:s((e,r)=>{return/*#__PURE__*/(0,t/* .jsxs */.FD)(ac,{"data-cy":"tutor-toast",style:e,css:fN.toastItem(r.type),children:[/*#__PURE__*/(0,t/* .jsx */.Y)("h5",{css:fN.message,children:r.message}),/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"text",onClick:()=>{o(e=>e.filter(e=>e.id!==r.id))},children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"timesAlt",width:16,height:16})})]},r.id)})})]})};/* ESM default export */const fH=fM;var fN={toastWrapper:e=>/*#__PURE__*/(0,o/* .css */.AH)("display:flex;flex-direction:column;gap:",ey/* .spacing["16"] */.YK["16"],";max-width:400px;position:fixed;z-index:",ey/* .zIndex.highest */.fE.highest,";",e==="top-left"&&(0,o/* .css */.AH)(fA(),ey/* .spacing["20"] */.YK["20"],ey/* .spacing["20"] */.YK["20"])," ",e==="top-right"&&(0,o/* .css */.AH)(fk(),ey/* .spacing["20"] */.YK["20"],ey/* .spacing["20"] */.YK["20"])," ",e==="top-center"&&(0,o/* .css */.AH)(fE(),ey/* .spacing["20"] */.YK["20"])," ",e==="bottom-left"&&(0,o/* .css */.AH)(fI(),ey/* .spacing["20"] */.YK["20"],ey/* .spacing["20"] */.YK["20"])," ",e==="bottom-right"&&(0,o/* .css */.AH)(fC(),ey/* .spacing["20"] */.YK["20"],ey/* .spacing["20"] */.YK["20"])," ",e==="bottom-center"&&(0,o/* .css */.AH)(fY(),ey/* .spacing["20"] */.YK["20"])),toastItem:e=>/*#__PURE__*/(0,o/* .css */.AH)("width:100%;min-height:60px;display:flex;align-items:center;justify-content:space-between;gap:",ey/* .spacing["16"] */.YK["16"],";border-radius:",ey/* .borderRadius["6"] */.Vq["6"],";padding:",ey/* .spacing["16"] */.YK["16"],";svg > path{color:",ey/* .colorTokens.icon.white */.I6.icon.white,";}",e==="dark"&&(0,o/* .css */.AH)(fT(),ey/* .colorTokens.color.black.main */.I6.color.black.main)," ",e==="danger"&&(0,o/* .css */.AH)(fS(),ey/* .colorTokens.design.error */.I6.design.error)," ",e==="success"&&(0,o/* .css */.AH)(fO(),ey/* .colorTokens.design.success */.I6.design.success)," ",e==="warning"&&(0,o/* .css */.AH)(fD(),ey/* .colorTokens.color.warning["70"] */.I6.color.warning["70"],ey/* .colorTokens.text.primary */.I6.text.primary,ey/* .colorTokens.text.primary */.I6.text.primary)),message:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.body */.I.body(),";color:",ey/* .colorTokens.text.white */.I6.text.white,";"),timesIcon:/*#__PURE__*/(0,o/* .css */.AH)("path{color:",ey/* .colorTokens.icon.white */.I6.icon.white,";}")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/hooks/useWpMedia.ts
var fL=e=>{var{options:t={},onChange:r,initialFiles:i}=e;var{showToast:a}=fP();var o=(0,n.useMemo)(()=>i?Array.isArray(i)?i:[i]:[],[i]);var s=(0,n.useMemo)(()=>(0,eX._)((0,e$._)({},t,t.type?{library:{type:t.type}}:{}),{multiple:t.multiple?t.multiple===true?"add":t.multiple:false}),[t]);var[l,u]=(0,n.useState)(o);(0,n.useEffect)(()=>{if(o&&!l.length){u(o)}},[l,o]);var c=(0,n.useCallback)(()=>{var e;if(!((e=window.wp)===null||e===void 0?void 0:e.media)){// eslint-disable-next-line no-console
console.error("اكاديمية الغيث التعليمية media library is not available");return}var t=window.wp.media(s);t.on("close",()=>{if(t.$el){t.$el.parent().parent().remove()}});t.on("open",()=>{var e=t.state().get("selection");t.$el.attr("data-focus-trap","true");e.reset();l.forEach(t=>{var r=window.wp.media.attachment(t.id);if(r){r.fetch();e.add(r)}})});t.on("select",()=>{var e=t.state().get("selection").toJSON();var n=new Set(e.map(e=>e.id));var i=l.filter(e=>n.has(e.id));var o=e.reduce((e,t)=>{if(i.some(e=>e.id===t.id)){return e}if(s.maxFileSize&&t.filesizeInBytes>s.maxFileSize){a({// translators: %s is the file title
message:(0,em.sprintf)((0,em.__)("%s size exceeds the maximum allowed size","tutor-pro"),t.title),type:"danger"});return e}var r={id:t.id,title:t.title,url:t.url,name:t.title,size:t.filesizeHumanReadable,size_bytes:t.filesizeInBytes,ext:t.filename.split(".").pop()||""};e.push(r);return e},[]);var c=s.multiple?[...i,...o]:o.slice(0,1);if(s.maxFiles&&c.length>s.maxFiles){a({// translators: %d is the maximum number of files allowed
message:(0,em.sprintf)((0,em.__)("Cannot select more than %d files","tutor-pro"),s.maxFiles),type:"warning"});return}u(c);r===null||r===void 0?void 0:r(s.multiple?c:c[0]||null);t.close()});t.open()},[s,r,l,a]);var d=(0,n.useCallback)(()=>{u([]);r===null||r===void 0?void 0:r(s.multiple?[]:null)},[s.multiple,r]);return{openMediaLibrary:c,existingFiles:l,resetFiles:d}};/* ESM default export */const fK=fL;// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/fields/FormFileUploader.tsx
function fB(){var e=(0,eS._)(["\n      background-color: ",";\n      padding: "," 0 "," ",";\n      border: 1px solid ",";\n      border-radius: ",";\n      gap: ",";\n    "]);fB=function t(){return e};return e}function fj(){var e=(0,eS._)(["\n      margin-right: ",";\n    "]);fj=function t(){return e};return e}var fU={iso:["iso"],dwg:["dwg"],pdf:["pdf"],doc:["doc","docx"],csv:["csv"],xls:["xls","xlsx"],ppt:["ppt","pptx"],zip:["zip"],archive:["rar","7z","tar","gz"],txt:["txt"],rtf:["rtf"],text:["log"],jpg:["jpg"],png:["png"],image:["jpeg","gif","webp","avif"],mp3:["mp3"],fla:["fla"],audio:["ogg","wav","wma"],mp4:["mp4"],avi:["avi"],ai:["ai"],videoFile:["mkv","mpeg","flv","mov","wmv"],svg:["svg"],css:["css"],javascript:["js"],xml:["xml"],html:["html"],exe:["exe"],psd:["psd"],jsonFile:["json"],dbf:["dbf"]};var fq=e=>{for(var[t,r]of Object.entries(fU)){if(r.includes(e)){return t}}return"file"};var fV=e=>{var{field:r,fieldState:n,label:i,helpText:a,buttonText:o=(0,em.__)("Upload Media","tutor-pro"),selectMultiple:s=false,onChange:l,maxFileSize:u,maxFiles:c}=e;var d=r.value;var{openMediaLibrary:f,resetFiles:p}=fK({options:{multiple:s,maxFiles:c,maxFileSize:u},onChange:e=>{r.onChange(e);if(l){l(e)}},initialFiles:d?Array.isArray(d)?d:[d]:[]});var h=()=>{f()};var v=e=>{p();if(s){var t=(Array.isArray(d)?d:d?[d]:[]).filter(t=>t.id!==e);r.onChange(t.length>0?t:null);if(l){l(t.length>0?t:null)}}else{r.onChange(null);if(l){l(null)}}};return/*#__PURE__*/(0,t/* .jsx */.Y)(fv,{label:i,field:r,fieldState:n,helpText:a,children:()=>{return/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:d,fallback:/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{buttonCss:fz.uploadButton,icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"attach",height:24,width:24}),variant:"secondary",onClick:h,children:o}),children:e=>/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:fz.wrapper({hasFiles:Array.isArray(e)?e.length>0:e!==null}),children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:fz.attachmentsWrapper,children:/*#__PURE__*/(0,t/* .jsx */.Y)(fb,{each:Array.isArray(e)?e:[e],children:e=>/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:fz.attachmentCardWrapper,children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:fz.attachmentCard,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{style:fz.fileIcon,name:fq(e.ext||"file"),height:40,width:40}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:fz.attachmentCardBody,children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:fz.attachmentCardTitle,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{title:e.title,css:eB/* .styleUtils.text.ellipsis */.x.text.ellipsis(1),children:e.title}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:fz.fileExtension,children:".".concat(e.ext)})]}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:fz.attachmentCardSubtitle,children:/*#__PURE__*/(0,t/* .jsx */.Y)("span",{children:"".concat((0,em.__)("Size","tutor-pro"),": ").concat(e.size)})})]})]}),/*#__PURE__*/(0,t/* .jsx */.Y)("button",{type:"button",css:fz.removeButton,onClick:()=>{v(e.id)},children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"cross",height:24,width:24})})]},e.id)})}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:fz.uploadButtonWrapper({hasFiles:Array.isArray(e)?e.length>0:e!==null}),children:/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{buttonCss:fz.uploadButton,icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"attach",height:24,width:24}),variant:"secondary",onClick:h,"data-cy":"upload-media",children:o})})]})})}})};/* ESM default export */const fW=fx(fV);var fz={wrapper:e=>{var{hasFiles:t}=e;return/*#__PURE__*/(0,o/* .css */.AH)("display:flex;flex-direction:column;position:relative;",t&&(0,o/* .css */.AH)(fB(),ey/* .colorTokens.background.white */.I6.background.white,ey/* .spacing["16"] */.YK["16"],ey/* .spacing["16"] */.YK["16"],ey/* .spacing["16"] */.YK["16"],ey/* .colorTokens.stroke["default"] */.I6.stroke["default"],ey/* .borderRadius.card */.Vq.card,ey/* .spacing["8"] */.YK["8"]))},attachmentsWrapper:/*#__PURE__*/(0,o/* .css */.AH)("max-height:260px;padding-right:",ey/* .spacing["16"] */.YK["16"],";",eB/* .styleUtils.overflowYAuto */.x.overflowYAuto,";"),attachmentCardWrapper:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),";justify-content:space-between;align-items:center;gap:",ey/* .spacing["20"] */.YK["20"],";padding:",ey/* .spacing["4"] */.YK["4"]," ",ey/* .spacing["12"] */.YK["12"]," ",ey/* .spacing["4"] */.YK["4"]," 0;border-radius:",ey/* .borderRadius["6"] */.Vq["6"],";button{opacity:0;}&:hover,&:focus-within{background:",ey/* .colorTokens.background.hover */.I6.background.hover,";button{opacity:1;}}",ey/* .Breakpoint.smallTablet */.EA.smallTablet,"{button{opacity:1;}}"),attachmentCard:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;gap:",ey/* .spacing["8"] */.YK["8"],";overflow:hidden;"),attachmentCardBody:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",ey/* .spacing["4"] */.YK["4"],";"),attachmentCardTitle:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),";",eK/* .typography.caption */.I.caption("medium"),"    word-break:break-all;"),fileExtension:/*#__PURE__*/(0,o/* .css */.AH)("flex-shrink:0;"),attachmentCardSubtitle:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.tiny */.I.tiny("regular")," ",eB/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;gap:",ey/* .spacing["8"] */.YK["8"],";color:",ey/* .colorTokens.text.hints */.I6.text.hints,";svg{color:",ey/* .colorTokens.icon["default"] */.I6.icon["default"],";}"),uploadButtonWrapper:e=>{var{hasFiles:t}=e;return/*#__PURE__*/(0,o/* .css */.AH)(t&&(0,o/* .css */.AH)(fj(),ey/* .spacing["16"] */.YK["16"]))},uploadButton:/*#__PURE__*/(0,o/* .css */.AH)("width:100%;"),fileIcon:/*#__PURE__*/(0,o/* .css */.AH)("flex-shrink:0;color:",ey/* .colorTokens.icon["default"] */.I6.icon["default"],";"),removeButton:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.crossButton */.x.crossButton,";background:none;transition:none;flex-shrink:0;")};// CONCATENATED MODULE: ../tutor/node_modules/@swc/helpers/esm/_async_to_generator.js
function fG(e,t,r,n,i,a,o){try{var s=e[a](o);var l=s.value}catch(e){r(e);return}if(s.done)t(l);else Promise.resolve(l).then(n,i)}function fQ(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(e){fG(a,n,i,o,s,"next",e)}function s(e){fG(a,n,i,o,s,"throw",e)}o(undefined)})}};// CONCATENATED MODULE: ../tutor/node_modules/react-hook-form/dist/index.esm.mjs
var f$=e=>e.type==="checkbox";var fX=e=>e instanceof Date;var fJ=e=>e==null;const fZ=e=>typeof e==="object";var f0=e=>!fJ(e)&&!Array.isArray(e)&&fZ(e)&&!fX(e);var f1=e=>f0(e)&&e.target?f$(e.target)?e.target.checked:e.target.value:e;var f2=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e;var f6=(e,t)=>e.has(f2(t));var f4=e=>{const t=e.constructor&&e.constructor.prototype;return f0(t)&&t.hasOwnProperty("isPrototypeOf")};var f5=typeof window!=="undefined"&&typeof window.HTMLElement!=="undefined"&&typeof document!=="undefined";function f3(e){let t;const r=Array.isArray(e);const n=typeof FileList!=="undefined"?e instanceof FileList:false;if(e instanceof Date){t=new Date(e)}else if(!(f5&&(e instanceof Blob||n))&&(r||f0(e))){t=r?[]:Object.create(Object.getPrototypeOf(e));if(!r&&!f4(e)){t=e}else{for(const r in e){if(e.hasOwnProperty(r)){t[r]=f3(e[r])}}}}else{return e}return t}var f8=e=>/^\w*$/.test(e);var f9=e=>e===undefined;var f7=e=>Array.isArray(e)?e.filter(Boolean):[];var pe=e=>f7(e.replace(/["|']|\]/g,"").split(/\.|\[/));var pt=(e,t,r)=>{if(!t||!f0(e)){return r}const n=(f8(t)?[t]:pe(t)).reduce((e,t)=>fJ(e)?e:e[t],e);return f9(n)||n===e?f9(e[t])?r:e[t]:n};var pr=e=>typeof e==="boolean";var pn=(e,t,r)=>{let n=-1;const i=f8(t)?[t]:pe(t);const a=i.length;const o=a-1;while(++n<a){const t=i[n];let a=r;if(n!==o){const r=e[t];a=f0(r)||Array.isArray(r)?r:!isNaN(+i[n+1])?[]:{}}if(t==="__proto__"||t==="constructor"||t==="prototype"){return}e[t]=a;e=e[t]}};const pi={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"};const pa={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"};const po={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};const ps=n.createContext(null);ps.displayName="HookFormContext";/**
 * This custom hook allows you to access the form context. useFormContext is intended to be used in deeply nested structures, where it would become inconvenient to pass the context as a prop. To be used with {@link FormProvider}.
 *
 * @remarks
 * [API](https://react-hook-form.com/docs/useformcontext) • [Demo](https://codesandbox.io/s/react-hook-form-v7-form-context-ytudi)
 *
 * @returns return all useForm methods
 *
 * @example
 * ```tsx
 * function App() {
 *   const methods = useForm();
 *   const onSubmit = data => console.log(data);
 *
 *   return (
 *     <FormProvider {...methods} >
 *       <form onSubmit={methods.handleSubmit(onSubmit)}>
 *         <NestedInput />
 *         <input type="submit" />
 *       </form>
 *     </FormProvider>
 *   );
 * }
 *
 *  function NestedInput() {
 *   const { register } = useFormContext(); // retrieve all hook methods
 *   return <input {...register("test")} />;
 * }
 * ```
 */const pl=()=>n.useContext(ps);/**
 * A provider component that propagates the `useForm` methods to all children components via [React Context](https://reactjs.org/docs/context.html) API. To be used with {@link useFormContext}.
 *
 * @remarks
 * [API](https://react-hook-form.com/docs/useformcontext) • [Demo](https://codesandbox.io/s/react-hook-form-v7-form-context-ytudi)
 *
 * @param props - all useForm methods
 *
 * @example
 * ```tsx
 * function App() {
 *   const methods = useForm();
 *   const onSubmit = data => console.log(data);
 *
 *   return (
 *     <FormProvider {...methods} >
 *       <form onSubmit={methods.handleSubmit(onSubmit)}>
 *         <NestedInput />
 *         <input type="submit" />
 *       </form>
 *     </FormProvider>
 *   );
 * }
 *
 *  function NestedInput() {
 *   const { register } = useFormContext(); // retrieve all hook methods
 *   return <input {...register("test")} />;
 * }
 * ```
 */const pu=e=>{const{children:t,...r}=e;return n.createElement(ps.Provider,{value:r},t)};var pc=(e,t,r,n=true)=>{const i={defaultValues:t._defaultValues};for(const a in e){Object.defineProperty(i,a,{get:()=>{const i=a;if(t._proxyFormState[i]!==pa.all){t._proxyFormState[i]=!n||pa.all}r&&(r[i]=true);return e[i]}})}return i};const pd=typeof window!=="undefined"?n.useLayoutEffect:n.useEffect;/**
 * This custom hook allows you to subscribe to each form state, and isolate the re-render at the custom hook level. It has its scope in terms of form state subscription, so it would not affect other useFormState and useForm. Using this hook can reduce the re-render impact on large and complex form application.
 *
 * @remarks
 * [API](https://react-hook-form.com/docs/useformstate) • [Demo](https://codesandbox.io/s/useformstate-75xly)
 *
 * @param props - include options on specify fields to subscribe. {@link UseFormStateReturn}
 *
 * @example
 * ```tsx
 * function App() {
 *   const { register, handleSubmit, control } = useForm({
 *     defaultValues: {
 *     firstName: "firstName"
 *   }});
 *   const { dirtyFields } = useFormState({
 *     control
 *   });
 *   const onSubmit = (data) => console.log(data);
 *
 *   return (
 *     <form onSubmit={handleSubmit(onSubmit)}>
 *       <input {...register("firstName")} placeholder="First Name" />
 *       {dirtyFields.firstName && <p>Field is dirty.</p>}
 *       <input type="submit" />
 *     </form>
 *   );
 * }
 * ```
 */function pf(e){const t=pl();const{control:r=t.control,disabled:i,name:a,exact:o}=e||{};const[s,l]=n.useState(r._formState);const u=n.useRef({isDirty:false,isLoading:false,dirtyFields:false,touchedFields:false,validatingFields:false,isValidating:false,isValid:false,errors:false});pd(()=>r._subscribe({name:a,formState:u.current,exact:o,callback:e=>{!i&&l({...r._formState,...e})}}),[a,i,o]);n.useEffect(()=>{u.current.isValid&&r._setValid(true)},[r]);return n.useMemo(()=>pc(s,r,u.current,false),[s,r])}var pp=e=>typeof e==="string";var ph=(e,t,r,n,i)=>{if(pp(e)){n&&t.watch.add(e);return pt(r,e,i)}if(Array.isArray(e)){return e.map(e=>(n&&t.watch.add(e),pt(r,e)))}n&&(t.watchAll=true);return r};var pv=e=>fJ(e)||!fZ(e);function pg(e,t,r=new WeakSet){if(pv(e)||pv(t)){return e===t}if(fX(e)&&fX(t)){return e.getTime()===t.getTime()}const n=Object.keys(e);const i=Object.keys(t);if(n.length!==i.length){return false}if(r.has(e)||r.has(t)){return true}r.add(e);r.add(t);for(const a of n){const n=e[a];if(!i.includes(a)){return false}if(a!=="ref"){const e=t[a];if(fX(n)&&fX(e)||f0(n)&&f0(e)||Array.isArray(n)&&Array.isArray(e)?!pg(n,e,r):n!==e){return false}}}return true}/**
 * Custom hook to subscribe to field change and isolate re-rendering at the component level.
 *
 * @remarks
 *
 * [API](https://react-hook-form.com/docs/usewatch) • [Demo](https://codesandbox.io/s/react-hook-form-v7-ts-usewatch-h9i5e)
 *
 * @example
 * ```tsx
 * const { control } = useForm();
 * const values = useWatch({
 *   name: "fieldName"
 *   control,
 * })
 * ```
 */function pm(e){const t=pl();const{control:r=t.control,name:i,defaultValue:a,disabled:o,exact:s,compute:l}=e||{};const u=n.useRef(a);const c=n.useRef(l);const d=n.useRef(undefined);c.current=l;const f=n.useMemo(()=>r._getWatch(i,u.current),[r,i]);const[p,h]=n.useState(c.current?c.current(f):f);pd(()=>r._subscribe({name:i,formState:{values:true},exact:s,callback:e=>{if(!o){const t=ph(i,r._names,e.values||r._formValues,false,u.current);if(c.current){const e=c.current(t);if(!pg(e,d.current)){h(e);d.current=e}}else{h(t)}}}}),[r,o,i,s]);n.useEffect(()=>r._removeUnmounted());return p}/**
 * Custom hook to work with controlled component, this function provide you with both form and field level state. Re-render is isolated at the hook level.
 *
 * @remarks
 * [API](https://react-hook-form.com/docs/usecontroller) • [Demo](https://codesandbox.io/s/usecontroller-0o8px)
 *
 * @param props - the path name to the form field value, and validation rules.
 *
 * @returns field properties, field and form state. {@link UseControllerReturn}
 *
 * @example
 * ```tsx
 * function Input(props) {
 *   const { field, fieldState, formState } = useController(props);
 *   return (
 *     <div>
 *       <input {...field} placeholder={props.name} />
 *       <p>{fieldState.isTouched && "Touched"}</p>
 *       <p>{formState.isSubmitted ? "submitted" : ""}</p>
 *     </div>
 *   );
 * }
 * ```
 */function pb(e){const t=pl();const{name:r,disabled:i,control:a=t.control,shouldUnregister:o,defaultValue:s}=e;const l=f6(a._names.array,r);const u=n.useMemo(()=>pt(a._formValues,r,pt(a._defaultValues,r,s)),[a,r,s]);const c=pm({control:a,name:r,defaultValue:u,exact:true});const d=pf({control:a,name:r,exact:true});const f=n.useRef(e);const p=n.useRef(a.register(r,{...e.rules,value:c,...pr(e.disabled)?{disabled:e.disabled}:{}}));f.current=e;const h=n.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:true,get:()=>!!pt(d.errors,r)},isDirty:{enumerable:true,get:()=>!!pt(d.dirtyFields,r)},isTouched:{enumerable:true,get:()=>!!pt(d.touchedFields,r)},isValidating:{enumerable:true,get:()=>!!pt(d.validatingFields,r)},error:{enumerable:true,get:()=>pt(d.errors,r)}}),[d,r]);const v=n.useCallback(e=>p.current.onChange({target:{value:f1(e),name:r},type:pi.CHANGE}),[r]);const g=n.useCallback(()=>p.current.onBlur({target:{value:pt(a._formValues,r),name:r},type:pi.BLUR}),[r,a._formValues]);const m=n.useCallback(e=>{const t=pt(a._fields,r);if(t&&e){t._f.ref={focus:()=>e.focus&&e.focus(),select:()=>e.select&&e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()}}},[a._fields,r]);const b=n.useMemo(()=>({name:r,value:c,...pr(i)||d.disabled?{disabled:d.disabled||i}:{},onChange:v,onBlur:g,ref:m}),[r,i,d.disabled,v,g,m,c]);n.useEffect(()=>{const e=a._options.shouldUnregister||o;a.register(r,{...f.current.rules,...pr(f.current.disabled)?{disabled:f.current.disabled}:{}});const t=(e,t)=>{const r=pt(a._fields,e);if(r&&r._f){r._f.mount=t}};t(r,true);if(e){const e=f3(pt(a._options.defaultValues,r));pn(a._defaultValues,r,e);if(f9(pt(a._formValues,r))){pn(a._formValues,r,e)}}!l&&a.register(r);return()=>{(l?e&&!a._state.action:e)?a.unregister(r):t(r,false)}},[r,a,l,o]);n.useEffect(()=>{a._setDisabledField({disabled:i,name:r})},[i,r,a]);return n.useMemo(()=>({field:b,formState:d,fieldState:h}),[b,d,h])}/**
 * Component based on `useController` hook to work with controlled component.
 *
 * @remarks
 * [API](https://react-hook-form.com/docs/usecontroller/controller) • [Demo](https://codesandbox.io/s/react-hook-form-v6-controller-ts-jwyzw) • [Video](https://www.youtube.com/watch?v=N2UNk_UCVyA)
 *
 * @param props - the path name to the form field value, and validation rules.
 *
 * @returns provide field handler functions, field and form state.
 *
 * @example
 * ```tsx
 * function App() {
 *   const { control } = useForm<FormValues>({
 *     defaultValues: {
 *       test: ""
 *     }
 *   });
 *
 *   return (
 *     <form>
 *       <Controller
 *         control={control}
 *         name="test"
 *         render={({ field: { onChange, onBlur, value, ref }, formState, fieldState }) => (
 *           <>
 *             <input
 *               onChange={onChange} // send value to hook form
 *               onBlur={onBlur} // notify when input is touched
 *               value={value} // return updated value
 *               ref={ref} // set ref for focus management
 *             />
 *             <p>{formState.isSubmitted ? "submitted" : ""}</p>
 *             <p>{fieldState.isTouched ? "touched" : ""}</p>
 *           </>
 *         )}
 *       />
 *     </form>
 *   );
 * }
 * ```
 */const py=e=>e.render(pb(e));const p_=e=>{const t={};for(const r of Object.keys(e)){if(fZ(e[r])&&e[r]!==null){const n=p_(e[r]);for(const e of Object.keys(n)){t[`${r}.${e}`]=n[e]}}else{t[r]=e[r]}}return t};const pw="post";/**
 * Form component to manage submission.
 *
 * @param props - to setup submission detail. {@link FormProps}
 *
 * @returns form component or headless render prop.
 *
 * @example
 * ```tsx
 * function App() {
 *   const { control, formState: { errors } } = useForm();
 *
 *   return (
 *     <Form action="/api" control={control}>
 *       <input {...register("name")} />
 *       <p>{errors?.root?.server && 'Server error'}</p>
 *       <button>Submit</button>
 *     </Form>
 *   );
 * }
 * ```
 */function px(e){const t=pl();const[r,n]=React.useState(false);const{control:i=t.control,onSubmit:a,children:o,action:s,method:l=pw,headers:u,encType:c,onError:d,render:f,onSuccess:p,validateStatus:h,...v}=e;const g=async t=>{let r=false;let n="";await i.handleSubmit(async e=>{const o=new FormData;let f="";try{f=JSON.stringify(e)}catch(e){}const v=p_(i._formValues);for(const e in v){o.append(e,v[e])}if(a){await a({data:e,event:t,method:l,formData:o,formDataJson:f})}if(s){try{const e=[u&&u["Content-Type"],c].some(e=>e&&e.includes("json"));const t=await fetch(String(s),{method:l,headers:{...u,...c&&c!=="multipart/form-data"?{"Content-Type":c}:{}},body:e?f:o});if(t&&(h?!h(t.status):t.status<200||t.status>=300)){r=true;d&&d({response:t});n=String(t.status)}else{p&&p({response:t})}}catch(e){r=true;d&&d({error:e})}}})(t);if(r&&e.control){e.control._subjects.state.next({isSubmitSuccessful:false});e.control.setError("root.server",{type:n})}};React.useEffect(()=>{n(true)},[]);return f?React.createElement(React.Fragment,null,f({submit:g})):React.createElement("form",{noValidate:r,action:s,method:l,encType:c,onSubmit:g,...v},o)}var pA=(e,t,r,n,i)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:i||true}}:{};var pk=e=>Array.isArray(e)?e:[e];var pE=()=>{let e=[];const t=t=>{for(const r of e){r.next&&r.next(t)}};const r=t=>{e.push(t);return{unsubscribe:()=>{e=e.filter(e=>e!==t)}}};const n=()=>{e=[]};return{get observers(){return e},next:t,subscribe:r,unsubscribe:n}};var pI=e=>f0(e)&&!Object.keys(e).length;var pC=e=>e.type==="file";var pY=e=>typeof e==="function";var pT=e=>{if(!f5){return false}const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)};var pS=e=>e.type===`select-multiple`;var pO=e=>e.type==="radio";var pD=e=>pO(e)||f$(e);var pF=e=>pT(e)&&e.isConnected;function pR(e,t){const r=t.slice(0,-1).length;let n=0;while(n<r){e=f9(e)?n++:e[t[n++]]}return e}function pP(e){for(const t in e){if(e.hasOwnProperty(t)&&!f9(e[t])){return false}}return true}function pM(e,t){const r=Array.isArray(t)?t:f8(t)?[t]:pe(t);const n=r.length===1?e:pR(e,r);const i=r.length-1;const a=r[i];if(n){delete n[a]}if(i!==0&&(f0(n)&&pI(n)||Array.isArray(n)&&pP(n))){pM(e,r.slice(0,-1))}return e}var pH=e=>{for(const t in e){if(pY(e[t])){return true}}return false};function pN(e,t={}){const r=Array.isArray(e);if(f0(e)||r){for(const r in e){if(Array.isArray(e[r])||f0(e[r])&&!pH(e[r])){t[r]=Array.isArray(e[r])?[]:{};pN(e[r],t[r])}else if(!fJ(e[r])){t[r]=true}}}return t}function pL(e,t,r){const n=Array.isArray(e);if(f0(e)||n){for(const n in e){if(Array.isArray(e[n])||f0(e[n])&&!pH(e[n])){if(f9(t)||pv(r[n])){r[n]=Array.isArray(e[n])?pN(e[n],[]):{...pN(e[n])}}else{pL(e[n],fJ(t)?{}:t[n],r[n])}}else{r[n]=!pg(e[n],t[n])}}}return r}var pK=(e,t)=>pL(e,t,pN(t));const pB={value:false,isValid:false};const pj={value:true,isValid:true};var pU=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!f9(e[0].attributes.value)?f9(e[0].value)||e[0].value===""?pj:{value:e[0].value,isValid:true}:pj:pB}return pB};var pq=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>f9(e)?e:t?e===""?NaN:e?+e:e:r&&pp(e)?new Date(e):n?n(e):e;const pV={isValid:false,value:null};var pW=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:true,value:t.value}:e,pV):pV;function pz(e){const t=e.ref;if(pC(t)){return t.files}if(pO(t)){return pW(e.refs).value}if(pS(t)){return[...t.selectedOptions].map(({value:e})=>e)}if(f$(t)){return pU(e.refs).value}return pq(f9(t.value)?e.ref.value:t.value,e)}var pG=(e,t,r,n)=>{const i={};for(const r of e){const e=pt(t,r);e&&pn(i,r,e._f)}return{criteriaMode:r,names:[...e],fields:i,shouldUseNativeValidation:n}};var pQ=e=>e instanceof RegExp;var p$=e=>f9(e)?e:pQ(e)?e.source:f0(e)?pQ(e.value)?e.value.source:e.value:e;var pX=e=>({isOnSubmit:!e||e===pa.onSubmit,isOnBlur:e===pa.onBlur,isOnChange:e===pa.onChange,isOnAll:e===pa.all,isOnTouch:e===pa.onTouched});const pJ="AsyncFunction";var pZ=e=>!!e&&!!e.validate&&!!(pY(e.validate)&&e.validate.constructor.name===pJ||f0(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===pJ));var p0=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);var p1=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));const p2=(e,t,r,n)=>{for(const i of r||Object.keys(e)){const r=pt(e,i);if(r){const{_f:e,...a}=r;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],i)&&!n){return true}else if(e.ref&&t(e.ref,e.name)&&!n){return true}else{if(p2(a,t)){break}}}else if(f0(a)){if(p2(a,t)){break}}}}return};function p6(e,t,r){const n=pt(e,r);if(n||f8(r)){return{error:n,name:r}}const i=r.split(".");while(i.length){const n=i.join(".");const a=pt(t,n);const o=pt(e,n);if(a&&!Array.isArray(a)&&r!==n){return{name:r}}if(o&&o.type){return{name:n,error:o}}if(o&&o.root&&o.root.type){return{name:`${n}.root`,error:o.root}}i.pop()}return{name:r}}var p4=(e,t,r,n)=>{r(e);const{name:i,...a}=e;return pI(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(e=>t[e]===(!n||pa.all))};var p5=(e,t,r)=>!e||!t||e===t||pk(e).some(e=>e&&(r?e===t:e.startsWith(t)||t.startsWith(e)));var p3=(e,t,r,n,i)=>{if(i.isOnAll){return false}else if(!r&&i.isOnTouch){return!(t||e)}else if(r?n.isOnBlur:i.isOnBlur){return!e}else if(r?n.isOnChange:i.isOnChange){return e}return true};var p8=(e,t)=>!f7(pt(e,t)).length&&pM(e,t);var p9=(e,t,r)=>{const n=pk(pt(e,r));pn(n,"root",t[r]);pn(e,r,n);return e};var p7=e=>pp(e);function he(e,t,r="validate"){if(p7(e)||Array.isArray(e)&&e.every(p7)||pr(e)&&!e){return{type:r,message:p7(e)?e:"",ref:t}}}var ht=e=>f0(e)&&!pQ(e)?e:{value:e,message:""};var hr=async(e,t,r,n,i,a)=>{const{ref:o,refs:s,required:l,maxLength:u,minLength:c,min:d,max:f,pattern:p,validate:h,name:v,valueAsNumber:g,mount:m}=e._f;const b=pt(r,v);if(!m||t.has(v)){return{}}const y=s?s[0]:o;const _=e=>{if(i&&y.reportValidity){y.setCustomValidity(pr(e)?"":e||"");y.reportValidity()}};const w={};const x=pO(o);const A=f$(o);const k=x||A;const E=(g||pC(o))&&f9(o.value)&&f9(b)||pT(o)&&o.value===""||b===""||Array.isArray(b)&&!b.length;const I=pA.bind(null,v,n,w);const C=(e,t,r,n=po.maxLength,i=po.minLength)=>{const a=e?t:r;w[v]={type:e?n:i,message:a,ref:o,...I(e?n:i,a)}};if(a?!Array.isArray(b)||!b.length:l&&(!k&&(E||fJ(b))||pr(b)&&!b||A&&!pU(s).isValid||x&&!pW(s).isValid)){const{value:e,message:t}=p7(l)?{value:!!l,message:l}:ht(l);if(e){w[v]={type:po.required,message:t,ref:y,...I(po.required,t)};if(!n){_(t);return w}}}if(!E&&(!fJ(d)||!fJ(f))){let e;let t;const r=ht(f);const i=ht(d);if(!fJ(b)&&!isNaN(b)){const n=o.valueAsNumber||(b?+b:b);if(!fJ(r.value)){e=n>r.value}if(!fJ(i.value)){t=n<i.value}}else{const n=o.valueAsDate||new Date(b);const a=e=>new Date(new Date().toDateString()+" "+e);const s=o.type=="time";const l=o.type=="week";if(pp(r.value)&&b){e=s?a(b)>a(r.value):l?b>r.value:n>new Date(r.value)}if(pp(i.value)&&b){t=s?a(b)<a(i.value):l?b<i.value:n<new Date(i.value)}}if(e||t){C(!!e,r.message,i.message,po.max,po.min);if(!n){_(w[v].message);return w}}}if((u||c)&&!E&&(pp(b)||a&&Array.isArray(b))){const e=ht(u);const t=ht(c);const r=!fJ(e.value)&&b.length>+e.value;const i=!fJ(t.value)&&b.length<+t.value;if(r||i){C(r,e.message,t.message);if(!n){_(w[v].message);return w}}}if(p&&!E&&pp(b)){const{value:e,message:t}=ht(p);if(pQ(e)&&!b.match(e)){w[v]={type:po.pattern,message:t,ref:o,...I(po.pattern,t)};if(!n){_(t);return w}}}if(h){if(pY(h)){const e=await h(b,r);const t=he(e,y);if(t){w[v]={...t,...I(po.validate,t.message)};if(!n){_(t.message);return w}}}else if(f0(h)){let e={};for(const t in h){if(!pI(e)&&!n){break}const i=he(await h[t](b,r),y,t);if(i){e={...i,...I(t,i.message)};_(i.message);if(n){w[v]=e}}}if(!pI(e)){w[v]={ref:y,...e};if(!n){return w}}}}_(true);return w};const hn={mode:pa.onSubmit,reValidateMode:pa.onChange,shouldFocusError:true};function hi(e={}){let t={...hn,...e};let r={submitCount:0,isDirty:false,isReady:false,isLoading:pY(t.defaultValues),isValidating:false,isSubmitted:false,isSubmitting:false,isSubmitSuccessful:false,isValid:false,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||false};let n={};let i=f0(t.defaultValues)||f0(t.values)?f3(t.defaultValues||t.values)||{}:{};let a=t.shouldUnregister?{}:f3(i);let o={action:false,mount:false,watch:false};let s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set};let l;let u=0;const c={isDirty:false,dirtyFields:false,validatingFields:false,touchedFields:false,isValidating:false,isValid:false,errors:false};let d={...c};const f={array:pE(),state:pE()};const p=t.criteriaMode===pa.all;const h=e=>t=>{clearTimeout(u);u=setTimeout(e,t)};const v=async e=>{if(!t.disabled&&(c.isValid||d.isValid||e)){const e=t.resolver?pI((await A()).errors):await E(n,true);if(e!==r.isValid){f.state.next({isValid:e})}}};const g=(e,n)=>{if(!t.disabled&&(c.isValidating||c.validatingFields||d.isValidating||d.validatingFields)){(e||Array.from(s.mount)).forEach(e=>{if(e){n?pn(r.validatingFields,e,n):pM(r.validatingFields,e)}});f.state.next({validatingFields:r.validatingFields,isValidating:!pI(r.validatingFields)})}};const m=(e,s=[],l,u,p=true,h=true)=>{if(u&&l&&!t.disabled){o.action=true;if(h&&Array.isArray(pt(n,e))){const t=l(pt(n,e),u.argA,u.argB);p&&pn(n,e,t)}if(h&&Array.isArray(pt(r.errors,e))){const t=l(pt(r.errors,e),u.argA,u.argB);p&&pn(r.errors,e,t);p8(r.errors,e)}if((c.touchedFields||d.touchedFields)&&h&&Array.isArray(pt(r.touchedFields,e))){const t=l(pt(r.touchedFields,e),u.argA,u.argB);p&&pn(r.touchedFields,e,t)}if(c.dirtyFields||d.dirtyFields){r.dirtyFields=pK(i,a)}f.state.next({name:e,isDirty:C(e,s),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else{pn(a,e,s)}};const b=(e,t)=>{pn(r.errors,e,t);f.state.next({errors:r.errors})};const y=e=>{r.errors=e;f.state.next({errors:r.errors,isValid:false})};const _=(e,t,r,s)=>{const l=pt(n,e);if(l){const n=pt(a,e,f9(r)?pt(i,e):r);f9(n)||s&&s.defaultChecked||t?pn(a,e,t?n:pz(l._f)):S(e,n);o.mount&&v()}};const w=(e,n,a,o,s)=>{let l=false;let u=false;const p={name:e};if(!t.disabled){if(!a||o){if(c.isDirty||d.isDirty){u=r.isDirty;r.isDirty=p.isDirty=C();l=u!==p.isDirty}const t=pg(pt(i,e),n);u=!!pt(r.dirtyFields,e);t?pM(r.dirtyFields,e):pn(r.dirtyFields,e,true);p.dirtyFields=r.dirtyFields;l=l||(c.dirtyFields||d.dirtyFields)&&u!==!t}if(a){const t=pt(r.touchedFields,e);if(!t){pn(r.touchedFields,e,a);p.touchedFields=r.touchedFields;l=l||(c.touchedFields||d.touchedFields)&&t!==a}}l&&s&&f.state.next(p)}return l?p:{}};const x=(e,n,i,a)=>{const o=pt(r.errors,e);const s=(c.isValid||d.isValid)&&pr(n)&&r.isValid!==n;if(t.delayError&&i){l=h(()=>b(e,i));l(t.delayError)}else{clearTimeout(u);l=null;i?pn(r.errors,e,i):pM(r.errors,e)}if((i?!pg(o,i):o)||!pI(a)||s){const t={...a,...s&&pr(n)?{isValid:n}:{},errors:r.errors,name:e};r={...r,...t};f.state.next(t)}};const A=async e=>{g(e,true);const r=await t.resolver(a,t.context,pG(e||s.mount,n,t.criteriaMode,t.shouldUseNativeValidation));g(e);return r};const k=async e=>{const{errors:t}=await A(e);if(e){for(const n of e){const e=pt(t,n);e?pn(r.errors,n,e):pM(r.errors,n)}}else{r.errors=t}return t};const E=async(e,n,i={valid:true})=>{for(const o in e){const l=e[o];if(l){const{_f:e,...u}=l;if(e){const u=s.array.has(e.name);const d=l._f&&pZ(l._f);if(d&&c.validatingFields){g([o],true)}const f=await hr(l,s.disabled,a,p,t.shouldUseNativeValidation&&!n,u);if(d&&c.validatingFields){g([o])}if(f[e.name]){i.valid=false;if(n){break}}!n&&(pt(f,e.name)?u?p9(r.errors,f,e.name):pn(r.errors,e.name,f[e.name]):pM(r.errors,e.name))}!pI(u)&&await E(u,n,i)}}return i.valid};const I=()=>{for(const e of s.unMount){const t=pt(n,e);t&&(t._f.refs?t._f.refs.every(e=>!pF(e)):!pF(t._f.ref))&&U(e)}s.unMount=new Set};const C=(e,r)=>!t.disabled&&(e&&r&&pn(a,e,r),!pg(M(),i));const Y=(e,t,r)=>ph(e,s,{...o.mount?a:f9(t)?i:pp(e)?{[e]:t}:t},r,t);const T=e=>f7(pt(o.mount?a:i,e,t.shouldUnregister?pt(i,e,[]):[]));const S=(e,t,r={})=>{const i=pt(n,e);let o=t;if(i){const r=i._f;if(r){!r.disabled&&pn(a,e,pq(t,r));o=pT(r.ref)&&fJ(t)?"":t;if(pS(r.ref)){[...r.ref.options].forEach(e=>e.selected=o.includes(e.value))}else if(r.refs){if(f$(r.ref)){r.refs.forEach(e=>{if(!e.defaultChecked||!e.disabled){if(Array.isArray(o)){e.checked=!!o.find(t=>t===e.value)}else{e.checked=o===e.value||!!o}}})}else{r.refs.forEach(e=>e.checked=e.value===o)}}else if(pC(r.ref)){r.ref.value=""}else{r.ref.value=o;if(!r.ref.type){f.state.next({name:e,values:f3(a)})}}}}(r.shouldDirty||r.shouldTouch)&&w(e,o,r.shouldTouch,r.shouldDirty,true);r.shouldValidate&&P(e)};const O=(e,t,r)=>{for(const i in t){if(!t.hasOwnProperty(i)){return}const a=t[i];const o=e+"."+i;const l=pt(n,o);(s.array.has(e)||f0(a)||l&&!l._f)&&!fX(a)?O(o,a,r):S(o,a,r)}};const D=(e,t,l={})=>{const u=pt(n,e);const p=s.array.has(e);const h=f3(t);pn(a,e,h);if(p){f.array.next({name:e,values:f3(a)});if((c.isDirty||c.dirtyFields||d.isDirty||d.dirtyFields)&&l.shouldDirty){f.state.next({name:e,dirtyFields:pK(i,a),isDirty:C(e,h)})}}else{u&&!u._f&&!fJ(h)?O(e,h,l):S(e,h,l)}p1(e,s)&&f.state.next({...r,name:e});f.state.next({name:o.mount?e:undefined,values:f3(a)})};const F=async e=>{o.mount=true;const i=e.target;let u=i.name;let h=true;const m=pt(n,u);const b=e=>{h=Number.isNaN(e)||fX(e)&&isNaN(e.getTime())||pg(e,pt(a,u,e))};const y=pX(t.mode);const _=pX(t.reValidateMode);if(m){let o;let k;const I=i.type?pz(m._f):f1(e);const C=e.type===pi.BLUR||e.type===pi.FOCUS_OUT;const Y=!p0(m._f)&&!t.resolver&&!pt(r.errors,u)&&!m._f.deps||p3(C,pt(r.touchedFields,u),r.isSubmitted,_,y);const T=p1(u,s,C);pn(a,u,I);if(C){if(!i||!i.readOnly){m._f.onBlur&&m._f.onBlur(e);l&&l(0)}}else if(m._f.onChange){m._f.onChange(e)}const S=w(u,I,C);const O=!pI(S)||T;!C&&f.state.next({name:u,type:e.type,values:f3(a)});if(Y){if(c.isValid||d.isValid){if(t.mode==="onBlur"){if(C){v()}}else if(!C){v()}}return O&&f.state.next({name:u,...T?{}:S})}!C&&T&&f.state.next({...r});if(t.resolver){const{errors:e}=await A([u]);b(I);if(h){const t=p6(r.errors,n,u);const i=p6(e,n,t.name||u);o=i.error;u=i.name;k=pI(e)}}else{g([u],true);o=(await hr(m,s.disabled,a,p,t.shouldUseNativeValidation))[u];g([u]);b(I);if(h){if(o){k=false}else if(c.isValid||d.isValid){k=await E(n,true)}}}if(h){m._f.deps&&P(m._f.deps);x(u,k,o,S)}}};const R=(e,t)=>{if(pt(r.errors,t)&&e.focus){e.focus();return 1}return};const P=async(e,i={})=>{let a;let o;const l=pk(e);if(t.resolver){const t=await k(f9(e)?e:l);a=pI(t);o=e?!l.some(e=>pt(t,e)):a}else if(e){o=(await Promise.all(l.map(async e=>{const t=pt(n,e);return await E(t&&t._f?{[e]:t}:t)}))).every(Boolean);!(!o&&!r.isValid)&&v()}else{o=a=await E(n)}f.state.next({...!pp(e)||(c.isValid||d.isValid)&&a!==r.isValid?{}:{name:e},...t.resolver||!e?{isValid:a}:{},errors:r.errors});i.shouldFocus&&!o&&p2(n,R,e?l:s.mount);return o};const M=e=>{const t={...o.mount?a:i};return f9(e)?t:pp(e)?pt(t,e):e.map(e=>pt(t,e))};const H=(e,t)=>({invalid:!!pt((t||r).errors,e),isDirty:!!pt((t||r).dirtyFields,e),error:pt((t||r).errors,e),isValidating:!!pt(r.validatingFields,e),isTouched:!!pt((t||r).touchedFields,e)});const N=e=>{e&&pk(e).forEach(e=>pM(r.errors,e));f.state.next({errors:e?r.errors:{}})};const L=(e,t,i)=>{const a=(pt(n,e,{_f:{}})._f||{}).ref;const o=pt(r.errors,e)||{};// Don't override existing error messages elsewhere in the object tree.
const{ref:s,message:l,type:u,...c}=o;pn(r.errors,e,{...c,...t,ref:a});f.state.next({name:e,errors:r.errors,isValid:false});i&&i.shouldFocus&&a&&a.focus&&a.focus()};const K=(e,t)=>pY(e)?f.state.subscribe({next:r=>"values"in r&&e(Y(undefined,t),r)}):Y(e,t,true);const B=e=>f.state.subscribe({next:t=>{if(p5(e.name,t.name,e.exact)&&p4(t,e.formState||c,Z,e.reRenderRoot)){e.callback({values:{...a},...r,...t,defaultValues:i})}}}).unsubscribe;const j=e=>{o.mount=true;d={...d,...e.formState};return B({...e,formState:d})};const U=(e,o={})=>{for(const l of e?pk(e):s.mount){s.mount.delete(l);s.array.delete(l);if(!o.keepValue){pM(n,l);pM(a,l)}!o.keepError&&pM(r.errors,l);!o.keepDirty&&pM(r.dirtyFields,l);!o.keepTouched&&pM(r.touchedFields,l);!o.keepIsValidating&&pM(r.validatingFields,l);!t.shouldUnregister&&!o.keepDefaultValue&&pM(i,l)}f.state.next({values:f3(a)});f.state.next({...r,...!o.keepDirty?{}:{isDirty:C()}});!o.keepIsValid&&v()};const q=({disabled:e,name:t})=>{if(pr(e)&&o.mount||!!e||s.disabled.has(t)){e?s.disabled.add(t):s.disabled.delete(t)}};const V=(e,r={})=>{let a=pt(n,e);const l=pr(r.disabled)||pr(t.disabled);pn(n,e,{...a||{},_f:{...a&&a._f?a._f:{ref:{name:e}},name:e,mount:true,...r}});s.mount.add(e);if(a){q({disabled:pr(r.disabled)?r.disabled:t.disabled,name:e})}else{_(e,true,r.value)}return{...l?{disabled:r.disabled||t.disabled}:{},...t.progressive?{required:!!r.required,min:p$(r.min),max:p$(r.max),minLength:p$(r.minLength),maxLength:p$(r.maxLength),pattern:p$(r.pattern)}:{},name:e,onChange:F,onBlur:F,ref:l=>{if(l){V(e,r);a=pt(n,e);const t=f9(l.value)?l.querySelectorAll?l.querySelectorAll("input,select,textarea")[0]||l:l:l;const o=pD(t);const s=a._f.refs||[];if(o?s.find(e=>e===t):t===a._f.ref){return}pn(n,e,{_f:{...a._f,...o?{refs:[...s.filter(pF),t,...Array.isArray(pt(i,e))?[{}]:[]],ref:{type:t.type,name:e}}:{ref:t}}});_(e,false,undefined,t)}else{a=pt(n,e,{});if(a._f){a._f.mount=false}(t.shouldUnregister||r.shouldUnregister)&&!(f6(s.array,e)&&o.action)&&s.unMount.add(e)}}}};const W=()=>t.shouldFocusError&&p2(n,R,s.mount);const z=e=>{if(pr(e)){f.state.next({disabled:e});p2(n,(t,r)=>{const i=pt(n,r);if(i){t.disabled=i._f.disabled||e;if(Array.isArray(i._f.refs)){i._f.refs.forEach(t=>{t.disabled=i._f.disabled||e})}}},0,false)}};const G=(e,i)=>async o=>{let l=undefined;if(o){o.preventDefault&&o.preventDefault();o.persist&&o.persist()}let u=f3(a);f.state.next({isSubmitting:true});if(t.resolver){const{errors:e,values:t}=await A();r.errors=e;u=f3(t)}else{await E(n)}if(s.disabled.size){for(const e of s.disabled){pM(u,e)}}pM(r.errors,"root");if(pI(r.errors)){f.state.next({errors:{}});try{await e(u,o)}catch(e){l=e}}else{if(i){await i({...r.errors},o)}W();setTimeout(W)}f.state.next({isSubmitted:true,isSubmitting:false,isSubmitSuccessful:pI(r.errors)&&!l,submitCount:r.submitCount+1,errors:r.errors});if(l){throw l}};const Q=(e,t={})=>{if(pt(n,e)){if(f9(t.defaultValue)){D(e,f3(pt(i,e)))}else{D(e,t.defaultValue);pn(i,e,f3(t.defaultValue))}if(!t.keepTouched){pM(r.touchedFields,e)}if(!t.keepDirty){pM(r.dirtyFields,e);r.isDirty=t.defaultValue?C(e,f3(pt(i,e))):C()}if(!t.keepError){pM(r.errors,e);c.isValid&&v()}f.state.next({...r})}};const $=(e,l={})=>{const u=e?f3(e):i;const d=f3(u);const p=pI(e);const h=p?i:d;if(!l.keepDefaultValues){i=u}if(!l.keepValues){if(l.keepDirtyValues){const e=new Set([...s.mount,...Object.keys(pK(i,a))]);for(const t of Array.from(e)){pt(r.dirtyFields,t)?pn(h,t,pt(a,t)):D(t,pt(h,t))}}else{if(f5&&f9(e)){for(const e of s.mount){const t=pt(n,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(pT(e)){const t=e.closest("form");if(t){t.reset();break}}}}}if(l.keepFieldsRef){for(const e of s.mount){D(e,pt(h,e))}}else{n={}}}a=t.shouldUnregister?l.keepDefaultValues?f3(i):{}:f3(h);f.array.next({values:{...h}});f.state.next({values:{...h}})}s={mount:l.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:false,focus:""};o.mount=!c.isValid||!!l.keepIsValid||!!l.keepDirtyValues;o.watch=!!t.shouldUnregister;f.state.next({submitCount:l.keepSubmitCount?r.submitCount:0,isDirty:p?false:l.keepDirty?r.isDirty:!!(l.keepDefaultValues&&!pg(e,i)),isSubmitted:l.keepIsSubmitted?r.isSubmitted:false,dirtyFields:p?{}:l.keepDirtyValues?l.keepDefaultValues&&a?pK(i,a):r.dirtyFields:l.keepDefaultValues&&e?pK(i,e):l.keepDirty?r.dirtyFields:{},touchedFields:l.keepTouched?r.touchedFields:{},errors:l.keepErrors?r.errors:{},isSubmitSuccessful:l.keepIsSubmitSuccessful?r.isSubmitSuccessful:false,isSubmitting:false,defaultValues:i})};const X=(e,t)=>$(pY(e)?e(a):e,t);const J=(e,t={})=>{const r=pt(n,e);const i=r&&r._f;if(i){const e=i.refs?i.refs[0]:i.ref;if(e.focus){e.focus();t.shouldSelect&&pY(e.select)&&e.select()}}};const Z=e=>{r={...r,...e}};const ee=()=>pY(t.defaultValues)&&t.defaultValues().then(e=>{X(e,t.resetOptions);f.state.next({isLoading:false})});const et={control:{register:V,unregister:U,getFieldState:H,handleSubmit:G,setError:L,_subscribe:B,_runSchema:A,_focusError:W,_getWatch:Y,_getDirty:C,_setValid:v,_setFieldArray:m,_setDisabledField:q,_setErrors:y,_getFieldArray:T,_reset:$,_resetDefaultValues:ee,_removeUnmounted:I,_disableForm:z,_subjects:f,_proxyFormState:c,get _fields(){return n},get _formValues(){return a},get _state(){return o},set _state(value){o=value},get _defaultValues(){return i},get _names(){return s},set _names(value){s=value},get _formState(){return r},get _options(){return t},set _options(value){t={...t,...value}}},subscribe:j,trigger:P,register:V,handleSubmit:G,watch:K,setValue:D,getValues:M,reset:X,resetField:Q,clearErrors:N,unregister:U,setError:L,setFocus:J,getFieldState:H};return{...et,formControl:et}}var ha=()=>{if(typeof crypto!=="undefined"&&crypto.randomUUID){return crypto.randomUUID()}const e=typeof performance==="undefined"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const r=(Math.random()*16+e)%16|0;return(t=="x"?r:r&3|8).toString(16)})};var ho=(e,t,r={})=>r.shouldFocus||f9(r.shouldFocus)?r.focusName||`${e}.${f9(r.focusIndex)?t:r.focusIndex}.`:"";var hs=(e,t)=>[...e,...pk(t)];var hl=e=>Array.isArray(e)?e.map(()=>undefined):undefined;function hu(e,t,r){return[...e.slice(0,t),...pk(r),...e.slice(t)]}var hc=(e,t,r)=>{if(!Array.isArray(e)){return[]}if(f9(e[r])){e[r]=undefined}e.splice(r,0,e.splice(t,1)[0]);return e};var hd=(e,t)=>[...pk(t),...pk(e)];function hf(e,t){let r=0;const n=[...e];for(const e of t){n.splice(e-r,1);r++}return f7(n).length?n:[]}var hp=(e,t)=>f9(t)?[]:hf(e,pk(t).sort((e,t)=>e-t));var hh=(e,t,r)=>{[e[t],e[r]]=[e[r],e[t]]};var hv=(e,t,r)=>{e[t]=r;return e};/**
 * A custom hook that exposes convenient methods to perform operations with a list of dynamic inputs that need to be appended, updated, removed etc. • [Demo](https://codesandbox.io/s/react-hook-form-usefieldarray-ssugn) • [Video](https://youtu.be/4MrbfGSFY2A)
 *
 * @remarks
 * [API](https://react-hook-form.com/docs/usefieldarray) • [Demo](https://codesandbox.io/s/react-hook-form-usefieldarray-ssugn)
 *
 * @param props - useFieldArray props
 *
 * @returns methods - functions to manipulate with the Field Arrays (dynamic inputs) {@link UseFieldArrayReturn}
 *
 * @example
 * ```tsx
 * function App() {
 *   const { register, control, handleSubmit, reset, trigger, setError } = useForm({
 *     defaultValues: {
 *       test: []
 *     }
 *   });
 *   const { fields, append } = useFieldArray({
 *     control,
 *     name: "test"
 *   });
 *
 *   return (
 *     <form onSubmit={handleSubmit(data => console.log(data))}>
 *       {fields.map((item, index) => (
 *          <input key={item.id} {...register(`test.${index}.firstName`)}  />
 *       ))}
 *       <button type="button" onClick={() => append({ firstName: "bill" })}>
 *         append
 *       </button>
 *       <input type="submit" />
 *     </form>
 *   );
 * }
 * ```
 */function hg(e){const t=pl();const{control:r=t.control,name:n,keyName:i="id",shouldUnregister:a,rules:o}=e;const[s,l]=React.useState(r._getFieldArray(n));const u=React.useRef(r._getFieldArray(n).map(ha));const c=React.useRef(s);const d=React.useRef(false);c.current=s;r._names.array.add(n);React.useMemo(()=>o&&r.register(n,o),[r,o,n]);pd(()=>r._subjects.array.subscribe({next:({values:e,name:t})=>{if(t===n||!t){const t=pt(e,n);if(Array.isArray(t)){l(t);u.current=t.map(ha)}}}}).unsubscribe,[r,n]);const f=React.useCallback(e=>{d.current=true;r._setFieldArray(n,e)},[r,n]);const p=(e,t)=>{const i=pk(f3(e));const a=hs(r._getFieldArray(n),i);r._names.focus=ho(n,a.length-1,t);u.current=hs(u.current,i.map(ha));f(a);l(a);r._setFieldArray(n,a,hs,{argA:hl(e)})};const h=(e,t)=>{const i=pk(f3(e));const a=hd(r._getFieldArray(n),i);r._names.focus=ho(n,0,t);u.current=hd(u.current,i.map(ha));f(a);l(a);r._setFieldArray(n,a,hd,{argA:hl(e)})};const v=e=>{const t=hp(r._getFieldArray(n),e);u.current=hp(u.current,e);f(t);l(t);!Array.isArray(pt(r._fields,n))&&pn(r._fields,n,undefined);r._setFieldArray(n,t,hp,{argA:e})};const g=(e,t,i)=>{const a=pk(f3(t));const o=hu(r._getFieldArray(n),e,a);r._names.focus=ho(n,e,i);u.current=hu(u.current,e,a.map(ha));f(o);l(o);r._setFieldArray(n,o,hu,{argA:e,argB:hl(t)})};const m=(e,t)=>{const i=r._getFieldArray(n);hh(i,e,t);hh(u.current,e,t);f(i);l(i);r._setFieldArray(n,i,hh,{argA:e,argB:t},false)};const b=(e,t)=>{const i=r._getFieldArray(n);hc(i,e,t);hc(u.current,e,t);f(i);l(i);r._setFieldArray(n,i,hc,{argA:e,argB:t},false)};const y=(e,t)=>{const i=f3(t);const a=hv(r._getFieldArray(n),e,i);u.current=[...a].map((t,r)=>!t||r===e?ha():u.current[r]);f(a);l([...a]);r._setFieldArray(n,a,hv,{argA:e,argB:i},true,false)};const _=e=>{const t=pk(f3(e));u.current=t.map(ha);f([...t]);l([...t]);r._setFieldArray(n,[...t],e=>e,{},true,false)};React.useEffect(()=>{r._state.action=false;p1(n,r._names)&&r._subjects.state.next({...r._formState});if(d.current&&(!pX(r._options.mode).isOnSubmit||r._formState.isSubmitted)&&!pX(r._options.reValidateMode).isOnSubmit){if(r._options.resolver){r._runSchema([n]).then(e=>{const t=pt(e.errors,n);const i=pt(r._formState.errors,n);if(i?!t&&i.type||t&&(i.type!==t.type||i.message!==t.message):t&&t.type){t?pn(r._formState.errors,n,t):pM(r._formState.errors,n);r._subjects.state.next({errors:r._formState.errors})}})}else{const e=pt(r._fields,n);if(e&&e._f&&!(pX(r._options.reValidateMode).isOnSubmit&&pX(r._options.mode).isOnSubmit)){hr(e,r._names.disabled,r._formValues,r._options.criteriaMode===pa.all,r._options.shouldUseNativeValidation,true).then(e=>!pI(e)&&r._subjects.state.next({errors:p9(r._formState.errors,e,n)}))}}}r._subjects.state.next({name:n,values:f3(r._formValues)});r._names.focus&&p2(r._fields,(e,t)=>{if(r._names.focus&&t.startsWith(r._names.focus)&&e.focus){e.focus();return 1}return});r._names.focus="";r._setValid();d.current=false},[s,n,r]);React.useEffect(()=>{!pt(r._formValues,n)&&r._setFieldArray(n);return()=>{const e=(e,t)=>{const n=pt(r._fields,e);if(n&&n._f){n._f.mount=t}};r._options.shouldUnregister||a?r.unregister(n):e(n,false)}},[n,r,i,a]);return{swap:React.useCallback(m,[f,n,r]),move:React.useCallback(b,[f,n,r]),prepend:React.useCallback(h,[f,n,r]),append:React.useCallback(p,[f,n,r]),remove:React.useCallback(v,[f,n,r]),insert:React.useCallback(g,[f,n,r]),update:React.useCallback(y,[f,n,r]),replace:React.useCallback(_,[f,n,r]),fields:React.useMemo(()=>s.map((e,t)=>({...e,[i]:u.current[t]||ha()})),[s,i])}}/**
 * Custom hook to manage the entire form.
 *
 * @remarks
 * [API](https://react-hook-form.com/docs/useform) • [Demo](https://codesandbox.io/s/react-hook-form-get-started-ts-5ksmm) • [Video](https://www.youtube.com/watch?v=RkXv4AXXC_4)
 *
 * @param props - form configuration and validation parameters.
 *
 * @returns methods - individual functions to manage the form state. {@link UseFormReturn}
 *
 * @example
 * ```tsx
 * function App() {
 *   const { register, handleSubmit, watch, formState: { errors } } = useForm();
 *   const onSubmit = data => console.log(data);
 *
 *   console.log(watch("example"));
 *
 *   return (
 *     <form onSubmit={handleSubmit(onSubmit)}>
 *       <input defaultValue="test" {...register("example")} />
 *       <input {...register("exampleRequired", { required: true })} />
 *       {errors.exampleRequired && <span>This field is required</span>}
 *       <button>Submit</button>
 *     </form>
 *   );
 * }
 * ```
 */function hm(e={}){const t=n.useRef(undefined);const r=n.useRef(undefined);const[i,a]=n.useState({isDirty:false,isValidating:false,isLoading:pY(e.defaultValues),isSubmitted:false,isSubmitting:false,isSubmitSuccessful:false,isValid:false,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||false,isReady:false,defaultValues:pY(e.defaultValues)?undefined:e.defaultValues});if(!t.current){if(e.formControl){t.current={...e.formControl,formState:i};if(e.defaultValues&&!pY(e.defaultValues)){e.formControl.reset(e.defaultValues,e.resetOptions)}}else{const{formControl:r,...n}=hi(e);t.current={...n,formState:i}}}const o=t.current.control;o._options=e;pd(()=>{const e=o._subscribe({formState:o._proxyFormState,callback:()=>a({...o._formState}),reRenderRoot:true});a(e=>({...e,isReady:true}));o._formState.isReady=true;return e},[o]);n.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]);n.useEffect(()=>{if(e.mode){o._options.mode=e.mode}if(e.reValidateMode){o._options.reValidateMode=e.reValidateMode}},[o,e.mode,e.reValidateMode]);n.useEffect(()=>{if(e.errors){o._setErrors(e.errors);o._focusError()}},[o,e.errors]);n.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]);n.useEffect(()=>{if(o._proxyFormState.isDirty){const e=o._getDirty();if(e!==i.isDirty){o._subjects.state.next({isDirty:e})}}},[o,i.isDirty]);n.useEffect(()=>{if(e.values&&!pg(e.values,r.current)){o._reset(e.values,{keepFieldsRef:true,...o._options.resetOptions});r.current=e.values;a(e=>({...e}))}else{o._resetDefaultValues()}},[o,e.values]);n.useEffect(()=>{if(!o._state.mount){o._setValid();o._state.mount=true}if(o._state.watch){o._state.watch=false;o._subjects.state.next({...o._formState})}o._removeUnmounted()});t.current.formState=pc(i,o);return t.current}//# sourceMappingURL=index.esm.mjs.map
// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/utils/create-variation.ts
var hb=r(8631);// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/atoms/MagicButton.tsx
var hy=/*#__PURE__*/i().forwardRef((e,r)=>{var{className:n,variant:i,size:a,children:o,type:s="button",disabled:l=false,roundedFull:u=true,loading:c}=e,d=(0,eJ._)(e,["className","variant","size","children","type","disabled","roundedFull","loading"]);return/*#__PURE__*/(0,t/* .jsx */.Y)("button",(0,eX._)((0,e$._)({type:s,ref:r,css:hx({variant:i,size:a,rounded:u?"true":"false"}),className:n,disabled:l},d),{children:/*#__PURE__*/(0,t/* .jsx */.Y)("span",{css:hw.buttonSpan,children:c?/*#__PURE__*/(0,t/* .jsx */.Y)(eT,{size:24}):o})}))});/* ESM default export */const h_=hy;var hw={buttonSpan:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.flexCenter */.x.flexCenter(),";z-index:",ey/* .zIndex.positive */.fE.positive,";"),base:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.resetButton */.x.resetButton,";",eK/* .typography.small */.I.small("medium"),";display:flex;gap:",ey/* .spacing["4"] */.YK["4"],";width:100%;justify-content:center;align-items:center;white-space:nowrap;position:relative;overflow:hidden;transition:box-shadow 0.5s ease;&:focus-visible{outline:2px solid ",ey/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:1px;}&:disabled{cursor:not-allowed;background:",ey/* .colorTokens.action.primary.disable */.I6.action.primary.disable,";pointer-events:none;color:",ey/* .colorTokens.text.disable */.I6.text.disable,";border-color:",ey/* .colorTokens.stroke.disable */.I6.stroke.disable,";}"),default:e=>/*#__PURE__*/(0,o/* .css */.AH)("background:",!e?ey/* .colorTokens.ai.gradient_1 */.I6.ai.gradient_1:ey/* .colorTokens.ai.gradient_1_rtl */.I6.ai.gradient_1_rtl,";color:",ey/* .colorTokens.text.white */.I6.text.white,";&::before{content:'';position:absolute;inset:0;background:",!e?ey/* .colorTokens.ai.gradient_2 */.I6.ai.gradient_2:ey/* .colorTokens.ai.gradient_2_rtl */.I6.ai.gradient_2_rtl,";opacity:0;transition:opacity 0.5s ease;}&:hover::before{opacity:1;}"),secondary:/*#__PURE__*/(0,o/* .css */.AH)("background-color:",ey/* .colorTokens.action.secondary["default"] */.I6.action.secondary["default"],";color:",ey/* .colorTokens.text.brand */.I6.text.brand,";border-radius:",ey/* .borderRadius["6"] */.Vq["6"],";&:hover{background-color:",ey/* .colorTokens.action.secondary.hover */.I6.action.secondary.hover,";}"),outline:/*#__PURE__*/(0,o/* .css */.AH)("position:relative;&::before{content:'';position:absolute;inset:0;background:",ey/* .colorTokens.ai.gradient_1 */.I6.ai.gradient_1,";color:",ey/* .colorTokens.text.primary */.I6.text.primary,";border:1px solid transparent;-webkit-mask:linear-gradient(#fff 0 0) padding-box,linear-gradient(#fff 0 0);mask:linear-gradient(#fff 0 0) padding-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude;}&:hover{&::before{background:",ey/* .colorTokens.ai.gradient_2 */.I6.ai.gradient_2,";}}"),primaryOutline:/*#__PURE__*/(0,o/* .css */.AH)("border:1px solid ",ey/* .colorTokens.brand.blue */.I6.brand.blue,";color:",ey/* .colorTokens.brand.blue */.I6.brand.blue,";&:hover{background-color:",ey/* .colorTokens.brand.blue */.I6.brand.blue,";color:",ey/* .colorTokens.text.white */.I6.text.white,";}"),primary:/*#__PURE__*/(0,o/* .css */.AH)("background-color:",ey/* .colorTokens.brand.blue */.I6.brand.blue,";color:",ey/* .colorTokens.text.white */.I6.text.white,";"),ghost:/*#__PURE__*/(0,o/* .css */.AH)("background-color:transparent;color:",ey/* .colorTokens.text.subdued */.I6.text.subdued,";border-radius:",ey/* .borderRadius["4"] */.Vq["4"],";&:hover{color:",ey/* .colorTokens.text.primary */.I6.text.primary,";}"),plain:/*#__PURE__*/(0,o/* .css */.AH)("span{background:",!aT/* .isRTL */.V8?ey/* .colorTokens.text.ai.gradient */.I6.text.ai.gradient:ey/* .colorTokens.ai.gradient_1_rtl */.I6.ai.gradient_1_rtl,";background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;&:hover{background:",!aT/* .isRTL */.V8?ey/* .colorTokens.ai.gradient_2 */.I6.ai.gradient_2:ey/* .colorTokens.ai.gradient_2_rtl */.I6.ai.gradient_2_rtl,";background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;}}"),size:{default:/*#__PURE__*/(0,o/* .css */.AH)("height:32px;padding-inline:",ey/* .spacing["12"] */.YK["12"],";padding-block:",ey/* .spacing["4"] */.YK["4"],";"),sm:/*#__PURE__*/(0,o/* .css */.AH)("height:24px;padding-inline:",ey/* .spacing["10"] */.YK["10"],";"),icon:/*#__PURE__*/(0,o/* .css */.AH)("width:32px;height:32px;")},rounded:{true:/*#__PURE__*/(0,o/* .css */.AH)("border-radius:",ey/* .borderRadius["54"] */.Vq["54"],";&::before{border-radius:",ey/* .borderRadius["54"] */.Vq["54"],";}"),false:/*#__PURE__*/(0,o/* .css */.AH)("border-radius:",ey/* .borderRadius["4"] */.Vq["4"],";&::before{border-radius:",ey/* .borderRadius["4"] */.Vq["4"],";}")}};var hx=(0,hb/* .createVariation */.s)({variants:{variant:{default:hw.default(aT/* .isRTL */.V8),primary:hw.primary,secondary:hw.secondary,outline:hw.outline,primary_outline:hw.primaryOutline,ghost:hw.ghost,plain:hw.plain},size:{default:hw.size.default,sm:hw.size.sm,icon:hw.size.icon},rounded:{true:hw.rounded.true,false:hw.rounded.false}},defaultVariants:{variant:"default",size:"default",rounded:"true"}},hw.base);// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/fields/FormTextareaInput.tsx
function hA(){var e=(0,eS._)(["\n        resize: vertical;\n      "]);hA=function t(){return e};return e}var hk=6;var hE=e=>{var{label:r,rows:i=hk,columns:a,maxLimit:o,field:s,fieldState:l,disabled:u,readOnly:c,loading:d,placeholder:f,helpText:p,onChange:h,onKeyDown:v,isHidden:g,enableResize:m=true,isSecondary:b=false,isMagicAi:y=false,inputCss:_,maxHeight:w,autoResize:x=false}=e;var A;var k=(A=s.value)!==null&&A!==void 0?A:"";var E=(0,n.useRef)(null);var I=undefined;if(o){I={maxLimit:o,inputCharacter:k.toString().length}}var C=()=>{if(E.current){if(w){E.current.style.maxHeight="".concat(w,"px")}E.current.style.height="auto";E.current.style.height="".concat(E.current.scrollHeight,"px")}};(0,n.useLayoutEffect)(()=>{if(x){C()}// eslint-disable-next-line react-hooks/exhaustive-deps
},[]);return/*#__PURE__*/(0,t/* .jsx */.Y)(fv,{label:r,field:s,fieldState:l,disabled:u,readOnly:c,loading:d,placeholder:f,helpText:p,isHidden:g,characterCount:I,isSecondary:b,isMagicAi:y,children:e=>{return/*#__PURE__*/(0,t/* .jsx */.Y)(t/* .Fragment */.FK,{children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:hC.container(m,_),children:/*#__PURE__*/(0,t/* .jsx */.Y)("textarea",(0,eX._)((0,e$._)({},s,e),{ref:e=>{s.ref(e);// @ts-ignore
E.current=e;// this is not ideal but it is the only way to set ref to the input element
},style:{maxHeight:w?"".concat(w,"px"):"none"},className:"tutor-input-field",value:k,onChange:e=>{var{value:t}=e.target;if(o&&t.trim().length>o){return}s.onChange(t);if(h){h(t)}if(x){C()}},onKeyDown:e=>{v===null||v===void 0?void 0:v(e.key)},autoComplete:"off",rows:i,cols:a}))})})}})};/* ESM default export */const hI=fx(hE);var hC={container:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:false,t=arguments.length>1?arguments[1]:void 0;return/*#__PURE__*/(0,o/* .css */.AH)("position:relative;display:flex;textarea{",eK/* .typography.body */.I.body(),";height:auto;padding:",ey/* .spacing["8"] */.YK["8"]," ",ey/* .spacing["12"] */.YK["12"],";resize:none;",eB/* .styleUtils.overflowYAuto */.x.overflowYAuto,";&.tutor-input-field{",t,";}",e&&(0,o/* .css */.AH)(hA()),"}")}};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/magic-ai-content/OptionList.tsx
var hY=e=>{var{options:r,onChange:n}=e;return/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:hT.wrapper,children:/*#__PURE__*/(0,t/* .jsx */.Y)(fb,{each:r,children:(e,r)=>{return/*#__PURE__*/(0,t/* .jsx */.Y)("button",{type:"button",onClick:()=>n(e.value),css:hT.item,children:e.label},r)}})})};var hT={wrapper:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;flex-direction:column;padding-block:",ey/* .spacing["8"] */.YK["8"],";max-height:400px;overflow-y:auto;"),item:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.resetButton */.x.resetButton,";",eK/* .typography.caption */.I.caption(),";width:100%;padding:",ey/* .spacing["4"] */.YK["4"]," ",ey/* .spacing["16"] */.YK["16"],";color:",ey/* .colorTokens.text.subdued */.I6.text.subdued,";display:flex;align-items:center;&:hover{background-color:",ey/* .colorTokens.background.hover */.I6.background.hover,";color:",ey/* .colorTokens.text.title */.I6.text.title,";}")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/hooks/useSelectKeyboardNavigation.ts
var hS=e=>{var{options:t,isOpen:r,onSelect:i,onClose:a,selectedValue:o}=e;var[s,l]=(0,n.useState)(-1);var u=(0,n.useCallback)(e=>{if(!r)return;var n=(e,r)=>{var n;var i=e;var a=r==="down"?1:-1;do{i+=a;if(i<0)i=t.length-1;if(i>=t.length)i=0}while(i>=0&&i<t.length&&t[i].disabled)if((n=t[i])===null||n===void 0?void 0:n.disabled){return e}return i};switch(e.key){case"ArrowDown":e.preventDefault();l(e=>{var t=n(e===-1?0:e,"down");return t});break;case"ArrowUp":e.preventDefault();l(e=>{var t=n(e===-1?0:e,"up");return t});break;case"Enter":e.preventDefault();e.stopPropagation();if(s>=0&&s<t.length){var o=t[s];if(!o.disabled){a();i(o)}}break;case"Escape":e.preventDefault();e.stopPropagation();a();break;default:break}},[r,t,s,i,a]);(0,n.useEffect)(()=>{if(r){if(s===-1){var e=t.findIndex(e=>e.value===o);var n=e>=0?e:t.findIndex(e=>!e.disabled);l(n)}document.addEventListener("keydown",u,true);return()=>document.removeEventListener("keydown",u,true)}},[r,u,t,o,s]);(0,n.useEffect)(()=>{if(!r){l(-1)}},[r]);var c=(0,n.useCallback)(e=>{var r;if(!((r=t[e])===null||r===void 0?void 0:r.disabled)){l(e)}},[t]);return{activeIndex:s,setActiveIndex:c}};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/fields/FormSelectInput.tsx
function hO(){var e=(0,eS._)(["\n      &::before {\n        content: '';\n        position: absolute;\n        inset: 0;\n        background: ",";\n        color: ",";\n        border: 1px solid transparent;\n        -webkit-mask:\n          linear-gradient(#fff 0 0) padding-box,\n          linear-gradient(#fff 0 0);\n        -webkit-mask-composite: xor;\n        mask-composite: exclude;\n        border-radius: 6px;\n      }\n    "]);hO=function t(){return e};return e}function hD(){var e=(0,eS._)(["\n        padding-left: ",";\n      "]);hD=function t(){return e};return e}function hF(){var e=(0,eS._)(["\n        &.tutor-input-field {\n          height: 56px;\n          padding-bottom: ",";\n        }\n      "]);hF=function t(){return e};return e}function hR(){var e=(0,eS._)(["\n        background-color: ",";\n      "]);hR=function t(){return e};return e}function hP(){var e=(0,eS._)(["\n        position: relative;\n        border: none;\n        background: transparent;\n      "]);hP=function t(){return e};return e}function hM(){var e=(0,eS._)(["\n          outline-color: ",";\n          background-color: ",";\n        "]);hM=function t(){return e};return e}function hH(){var e=(0,eS._)(["\n          border-color: ",";\n          background-color: ",";\n        "]);hH=function t(){return e};return e}function hN(){var e=(0,eS._)(["\n      padding-left: calc("," + 1px);\n    "]);hN=function t(){return e};return e}function hL(){var e=(0,eS._)(["\n        color: ",";\n\n        &:hover {\n          text-decoration: underline;\n        }\n      "]);hL=function t(){return e};return e}function hK(){var e=(0,eS._)(["\n      min-width: 200px;\n    "]);hK=function t(){return e};return e}function hB(){var e=(0,eS._)(["\n      background-color: ",";\n    "]);hB=function t(){return e};return e}function hj(){var e=(0,eS._)(["\n      background-color: ",";\n      position: relative;\n\n      &::before {\n        content: '';\n        position: absolute;\n        top: 0;\n        left: 0;\n        width: 3px;\n        height: 100%;\n        background-color: ",";\n        border-radius: 0 "," "," 0;\n      }\n    "]);hj=function t(){return e};return e}function hU(){var e=(0,eS._)(["\n      transform: rotate(180deg);\n    "]);hU=function t(){return e};return e}var hq=e=>{var{options:r,field:i,fieldState:a,onChange:o=ej/* .noop */.lQ,label:s,placeholder:l="",disabled:u,readOnly:c,loading:d,isSearchable:f=false,isInlineLabel:p,hideCaret:h,listLabel:v,isClearable:g=false,helpText:m,removeOptionsMinWidth:b=false,leftIcon:y,removeBorder:_,dataAttribute:w,isSecondary:x=false,isMagicAi:A=false,isAiOutline:k=false,selectOnFocus:E,optionItemCss:I}=e;var C;var Y=(0,n.useCallback)(()=>r.find(e=>e.value===i.value)||{label:"",value:"",description:""},[i.value,r]);var T=(0,n.useMemo)(()=>r.some(e=>(0,eO/* .isDefined */.O9)(e.description)),[r]);var[S,O]=(0,n.useState)((C=Y())===null||C===void 0?void 0:C.label);var[D,F]=(0,n.useState)(false);var[R,P]=(0,n.useState)("");var[M,H]=(0,n.useState)(false);var N=(0,n.useRef)(null);var L=(0,n.useRef)(null);var K=(0,n.useRef)(null);var B=(0,n.useRef)(null);var j=(0,n.useMemo)(()=>{if(f){return r.filter(e=>{var{label:t}=e;return t.toLowerCase().includes(R.toLowerCase())})}return r},[R,f,r]);var U=(0,n.useMemo)(()=>{return r.find(e=>e.value===i.value)},[i.value,r]);var q=(0,e$._)({},(0,eO/* .isDefined */.O9)(w)&&{[w]:true});(0,n.useEffect)(()=>{var e;O((e=Y())===null||e===void 0?void 0:e.label)},[i.value,Y]);(0,n.useEffect)(()=>{if(M){var e;O((e=Y())===null||e===void 0?void 0:e.label)}},[Y,M]);var V=(e,t)=>{t===null||t===void 0?void 0:t.stopPropagation();if(!e.disabled){i.onChange(e.value);o(e);P("");F(false);H(false)}};var{activeIndex:W,setActiveIndex:z}=hS({options:j,isOpen:M,selectedValue:i.value,onSelect:V,onClose:()=>{H(false);F(false);P("")}});(0,n.useEffect)(()=>{if(M&&W>=0&&B.current){B.current.scrollIntoView({block:"nearest",behavior:"smooth"})}},[M,W]);return/*#__PURE__*/(0,t/* .jsx */.Y)(fv,{fieldState:a,field:i,label:s,disabled:u||r.length===0,readOnly:c,loading:d,isInlineLabel:p,helpText:m,removeBorder:_,isSecondary:x,isMagicAi:A,children:e=>{var n,o;var{css:s}=e,p=(0,eJ._)(e,["css"]);return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:hW.mainWrapper,children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:hW.inputWrapper(k),ref:L,children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:hW.leftIcon,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:y,children:y}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:U===null||U===void 0?void 0:U.icon,children:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:e,width:32,height:32})})]}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:{width:"100%"},children:[/*#__PURE__*/(0,t/* .jsx */.Y)("input",(0,eX._)((0,e$._)({},p,q),{ref:e=>{i.ref(e);// @ts-ignore
N.current=e;// this is not ideal but it is the only way to set ref to the input element
},className:"tutor-input-field",css:[s,hW.input({hasLeftIcon:!!y||!!(U===null||U===void 0?void 0:U.icon),hasDescription:T,hasError:!!a.error,isMagicAi:A,isAiOutline:k})],autoComplete:"off",readOnly:c||!f,placeholder:l,value:D?R:S,title:S,onClick:e=>{var t;e.stopPropagation();H(e=>!e);(t=N.current)===null||t===void 0?void 0:t.focus()},onKeyDown:e=>{if(e.key==="Enter"){var t;e.preventDefault();H(e=>!e);(t=N.current)===null||t===void 0?void 0:t.focus()}if(e.key==="Tab"){H(false)}},onFocus:E&&f?e=>{e.target.select()}:undefined,onChange:e=>{O(e.target.value);if(f){F(true);P(e.target.value)}},"data-select":true})),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:T,children:/*#__PURE__*/(0,t/* .jsx */.Y)("span",{css:hW.description({hasLeftIcon:!!y}),title:(n=Y())===null||n===void 0?void 0:n.description,children:(o=Y())===null||o===void 0?void 0:o.description})})]}),!h&&!d&&/*#__PURE__*/(0,t/* .jsx */.Y)("button",{tabIndex:-1,type:"button",css:hW.caretButton({isOpen:M}),onClick:()=>{var e;H(e=>!e);(e=N.current)===null||e===void 0?void 0:e.focus()},disabled:u||c||r.length===0,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"chevronDown",width:20,height:20})})]}),/*#__PURE__*/(0,t/* .jsx */.Y)(a7,{triggerRef:L,isOpen:M,dependencies:[j.length],animationType:as.slideDown,closePopover:()=>{H(false);F(false);P("")},children:/*#__PURE__*/(0,t/* .jsxs */.FD)("ul",{css:[hW.options(b)],children:[!!v&&/*#__PURE__*/(0,t/* .jsx */.Y)("li",{css:hW.listLabel,children:v}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:j.length>0,fallback:/*#__PURE__*/(0,t/* .jsx */.Y)("li",{css:hW.emptyState,children:(0,em.__)("No options available","tutor-pro")}),children:j.map((e,r)=>/*#__PURE__*/(0,t/* .jsx */.Y)("li",{ref:e.value===i.value?K:W===r?B:null,css:[hW.optionItem({isSelected:e.value===i.value,isActive:r===W,isDisabled:!!e.disabled}),I],children:/*#__PURE__*/(0,t/* .jsxs */.FD)("button",{type:"button",css:hW.label,onClick:t=>{if(!e.disabled){V(e,t)}},disabled:e.disabled,title:e.label,onMouseOver:()=>z(r),onMouseLeave:()=>r!==W&&z(-1),onFocus:()=>z(r),"aria-selected":W===r,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:e.icon,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:e.icon,width:32,height:32})}),/*#__PURE__*/(0,t/* .jsx */.Y)("span",{children:e.label})]})},String(e.value)))}),g&&/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:hW.clearButton({isDisabled:S===""}),children:/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"text",disabled:S==="",icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"delete"}),onClick:()=>{i.onChange(null);O("");P("");H(false)},children:(0,em.__)("Clear","tutor-pro")})})]})})]})}})};/* ESM default export */const hV=hq;var hW={mainWrapper:/*#__PURE__*/(0,o/* .css */.AH)("width:100%;"),inputWrapper:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:false;return/*#__PURE__*/(0,o/* .css */.AH)("width:100%;display:flex;justify-content:space-between;align-items:center;position:relative;",e&&(0,o/* .css */.AH)(hO(),ey/* .colorTokens.ai.gradient_1 */.I6.ai.gradient_1,ey/* .colorTokens.text.primary */.I6.text.primary))},leftIcon:/*#__PURE__*/(0,o/* .css */.AH)("position:absolute;left:",ey/* .spacing["8"] */.YK["8"],";",eB/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;height:100%;color:",ey/* .colorTokens.icon["default"] */.I6.icon["default"],";"),input:e=>{var{hasLeftIcon:t,hasDescription:r,hasError:n=false,isMagicAi:i=false,isAiOutline:a=false}=e;return/*#__PURE__*/(0,o/* .css */.AH)("&[data-select]{",eK/* .typography.body */.I.body(),";width:100%;cursor:pointer;padding-right:",ey/* .spacing["32"] */.YK["32"],";",eB/* .styleUtils.textEllipsis */.x.textEllipsis,";background-color:transparent;background-color:",ey/* .colorTokens.background.white */.I6.background.white,";",t&&(0,o/* .css */.AH)(hD(),ey/* .spacing["48"] */.YK["48"])," ",r&&(0,o/* .css */.AH)(hF(),ey/* .spacing["24"] */.YK["24"])," ",n&&(0,o/* .css */.AH)(hR(),ey/* .colorTokens.background.status.errorFail */.I6.background.status.errorFail)," ",a&&(0,o/* .css */.AH)(hP()),":focus{",eB/* .styleUtils.inputFocus */.x.inputFocus,";",i&&(0,o/* .css */.AH)(hM(),ey/* .colorTokens.stroke.magicAi */.I6.stroke.magicAi,ey/* .colorTokens.background.magicAi["8"] */.I6.background.magicAi["8"])," ",n&&(0,o/* .css */.AH)(hH(),ey/* .colorTokens.stroke.danger */.I6.stroke.danger,ey/* .colorTokens.background.status.errorFail */.I6.background.status.errorFail),"}}")},description:e=>{var{hasLeftIcon:t}=e;return/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.small */.I.small(),";",eB/* .styleUtils.text.ellipsis */.x.text.ellipsis(1),"    color:",ey/* .colorTokens.text.hints */.I6.text.hints,";position:absolute;bottom:",ey/* .spacing["8"] */.YK["8"],";padding-inline:calc(",ey/* .spacing["16"] */.YK["16"]," + 1px) ",ey/* .spacing["32"] */.YK["32"],";",t&&(0,o/* .css */.AH)(hN(),ey/* .spacing["48"] */.YK["48"]))},listLabel:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.body */.I.body(),";color:",ey/* .colorTokens.text.subdued */.I6.text.subdued,";min-height:40px;display:flex;align-items:center;padding-left:",ey/* .spacing["16"] */.YK["16"],";"),clearButton:e=>{var{isDisabled:t=false}=e;return/*#__PURE__*/(0,o/* .css */.AH)("padding:",ey/* .spacing["4"] */.YK["4"]," ",ey/* .spacing["8"] */.YK["8"],";border-top:1px solid ",ey/* .colorTokens.stroke["default"] */.I6.stroke["default"],";& > button{padding:0;width:100%;font-size:",ey/* .fontSize["12"] */.J["12"],";> span{justify-content:center;}",!t&&(0,o/* .css */.AH)(hL(),ey/* .colorTokens.text.title */.I6.text.title),"}")},options:e=>/*#__PURE__*/(0,o/* .css */.AH)("z-index:",ey/* .zIndex.dropdown */.fE.dropdown,";background-color:",ey/* .colorTokens.background.white */.I6.background.white,";list-style-type:none;box-shadow:",ey/* .shadow.popover */.r7.popover,";padding:",ey/* .spacing["4"] */.YK["4"]," 0;margin:0;max-height:500px;border-radius:",ey/* .borderRadius["6"] */.Vq["6"],";",eB/* .styleUtils.overflowYAuto */.x.overflowYAuto,";scrollbar-gutter:auto;",!e&&(0,o/* .css */.AH)(hK())),optionItem:e=>{var{isSelected:t=false,isActive:r=false,isDisabled:n=false}=e;return/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.body */.I.body(),";min-height:36px;height:100%;width:100%;display:flex;align-items:center;transition:background-color 0.3s ease-in-out;cursor:",n?"not-allowed":"pointer",";opacity:",n?.5:1,";",r&&(0,o/* .css */.AH)(hB(),ey/* .colorTokens.background.hover */.I6.background.hover),"    &:hover{background-color:",!n&&ey/* .colorTokens.background.hover */.I6.background.hover,";}",!n&&t&&(0,o/* .css */.AH)(hj(),ey/* .colorTokens.background.active */.I6.background.active,ey/* .colorTokens.action.primary["default"] */.I6.action.primary["default"],ey/* .borderRadius["6"] */.Vq["6"],ey/* .borderRadius["6"] */.Vq["6"]))},label:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.resetButton */.x.resetButton,";",eB/* .styleUtils.text.ellipsis */.x.text.ellipsis(1),";color:",ey/* .colorTokens.text.title */.I6.text.title,";width:100%;height:100%;display:flex;align-items:center;gap:",ey/* .spacing["8"] */.YK["8"],";margin:0 ",ey/* .spacing["12"] */.YK["12"],";padding:",ey/* .spacing["6"] */.YK["6"]," 0;text-align:left;line-height:",ey/* .lineHeight["24"] */.K_["24"],";word-break:break-all;cursor:pointer;&:hover,&:focus,&:active{background-color:transparent;color:",ey/* .colorTokens.text.title */.I6.text.title,";}span{flex-shrink:0;",eB/* .styleUtils.text.ellipsis */.x.text.ellipsis(1),"      width:100%;}"),arrowUpDown:/*#__PURE__*/(0,o/* .css */.AH)("color:",ey/* .colorTokens.icon["default"] */.I6.icon["default"],";display:flex;justify-content:center;align-items:center;margin-top:",ey/* .spacing["2"] */.YK["2"],";"),optionsContainer:/*#__PURE__*/(0,o/* .css */.AH)("position:absolute;overflow:hidden auto;min-width:16px;max-width:calc(100% - 32px);"),caretButton:e=>{var{isOpen:t=false}=e;return/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.resetButton */.x.resetButton,";position:absolute;right:",ey/* .spacing["4"] */.YK["4"],";display:flex;align-items:center;transition:transform 0.3s ease-in-out;color:",ey/* .colorTokens.icon["default"] */.I6.icon["default"],";border-radius:",ey/* .borderRadius["4"] */.Vq["4"],";padding:",ey/* .spacing["6"] */.YK["6"],";height:100%;&:focus,&:active,&:hover{background:none;color:",ey/* .colorTokens.icon["default"] */.I6.icon["default"],";}&:focus-visible{outline:2px solid ",ey/* .colorTokens.stroke.brand */.I6.stroke.brand,";}",t&&(0,o/* .css */.AH)(hU()))},emptyState:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.flexCenter */.x.flexCenter(),";padding:",ey/* .spacing["8"] */.YK["8"],";")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/config/magic-ai.ts
var hz=[{label:"English",value:"english"},{label:"简体中文",value:"simplified-chinese"},{label:"繁體中文",value:"traditional-chinese"},{label:"Español",value:"spanish"},{label:"Français",value:"french"},{label:"日本語",value:"japanese"},{label:"Deutsch",value:"german"},{label:"Português",value:"portuguese"},{label:"العربية",value:"arabic"},{label:"Русский",value:"russian"},{label:"Italiano",value:"italian"},{label:"한국어",value:"korean"},{label:"हिन्दी",value:"hindi"},{label:"Nederlands",value:"dutch"},{label:"Polski",value:"polish"},{label:"አማርኛ",value:"amharic"},{label:"Български",value:"bulgarian"},{label:"বাংলা",value:"bengali"},{label:"Čeština",value:"czech"},{label:"Dansk",value:"danish"},{label:"Ελληνικά",value:"greek"},{label:"Eesti",value:"estonian"},{label:"فارسی",value:"persian"},{label:"Filipino",value:"filipino"},{label:"Hrvatski",value:"croatian"},{label:"Magyar",value:"hungarian"},{label:"Bahasa Indonesia",value:"indonesian"},{label:"Lietuvių",value:"lithuanian"},{label:"Latviešu",value:"latvian"},{label:"Melayu",value:"malay"},{label:"Norsk",value:"norwegian"},{label:"Română",value:"romanian"},{label:"Slovenčina",value:"slovak"},{label:"Slovenščina",value:"slovenian"},{label:"Српски",value:"serbian"},{label:"Svenska",value:"swedish"},{label:"ภาษาไทย",value:"thai"},{label:"Türkçe",value:"turkish"},{label:"Українська",value:"ukrainian"},{label:"اردو",value:"urdu"},{label:"Tiếng Việt",value:"vietnamese"}];var hG=[{label:(0,em.__)("Formal","tutor-pro"),value:"formal"},{label:(0,em.__)("Casual","tutor-pro"),value:"casual"},{label:(0,em.__)("Professional","tutor-pro"),value:"professional"},{label:(0,em.__)("Enthusiastic","tutor-pro"),value:"enthusiastic"},{label:(0,em.__)("Informational","tutor-pro"),value:"informational"},{label:(0,em.__)("Funny","tutor-pro"),value:"funny"}];var hQ=[{label:(0,em.__)("Title","tutor-pro"),value:"title"},{label:(0,em.__)("Essay","tutor-pro"),value:"essay"},{label:(0,em.__)("Paragraph","tutor-pro"),value:"paragraph"},{label:(0,em.__)("Outline","tutor-pro"),value:"outline"}];// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/magic-ai-content/PromptControls.tsx
var h$=e=>{var{form:r}=e;return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:hX.wrapper,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(py,{control:r.control,name:"characters",render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(b2,(0,eX._)((0,e$._)({},e),{isMagicAi:true,label:(0,em.__)("Character Limit","tutor-pro"),type:"number"}))}),/*#__PURE__*/(0,t/* .jsx */.Y)(py,{control:r.control,name:"language",render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(hV,(0,eX._)((0,e$._)({},e),{isMagicAi:true,label:(0,em.__)("Language","tutor-pro"),options:hz}))}),/*#__PURE__*/(0,t/* .jsx */.Y)(py,{control:r.control,name:"tone",render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(hV,(0,eX._)((0,e$._)({},e),{isMagicAi:true,options:hG,label:(0,em.__)("Tone","tutor-pro")}))}),/*#__PURE__*/(0,t/* .jsx */.Y)(py,{control:r.control,name:"format",render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(hV,(0,eX._)((0,e$._)({},e),{isMagicAi:true,label:(0,em.__)("Format","tutor-pro"),options:hQ}))})]})};var hX={wrapper:/*#__PURE__*/(0,o/* .css */.AH)("display:grid;grid-template-columns:repeat(2,1fr);gap:",ey/* .spacing["16"] */.YK["16"],";")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/magic-ai-content/SkeletonLoader.tsx
var hJ=()=>{return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:h0.container,children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:h0.wrapper,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eM,{animation:true,isMagicAi:true,width:"20%",height:"12px"}),/*#__PURE__*/(0,t/* .jsx */.Y)(eM,{animation:true,isMagicAi:true,width:"100%",height:"12px"}),/*#__PURE__*/(0,t/* .jsx */.Y)(eM,{animation:true,isMagicAi:true,width:"100%",height:"12px"}),/*#__PURE__*/(0,t/* .jsx */.Y)(eM,{animation:true,isMagicAi:true,width:"40%",height:"12px"})]}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:h0.wrapper,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eM,{animation:true,isMagicAi:true,width:"80%",height:"12px"}),/*#__PURE__*/(0,t/* .jsx */.Y)(eM,{animation:true,isMagicAi:true,width:"100%",height:"12px"}),/*#__PURE__*/(0,t/* .jsx */.Y)(eM,{animation:true,isMagicAi:true,width:"80%",height:"12px"})]})]})};/* ESM default export */const hZ=hJ;var h0={wrapper:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;flex-direction:column;gap:",ey/* .spacing["8"] */.YK["8"],";"),container:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;flex-direction:column;gap:",ey/* .spacing["32"] */.YK["32"],";")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/hooks/useFormWithGlobalError.ts
var h1=e=>{var[t,r]=(0,n.useState)();var i=hm(e);return(0,eX._)((0,e$._)({},i),{submitError:t,setSubmitError:r})};// CONCATENATED MODULE: ./node_modules/@tanstack/query-core/build/modern/mutationObserver.js
// src/mutationObserver.ts
var h2=class extends P{#l;#E=void 0;#I;#C;constructor(e,t){super();this.#l=e;this.setOptions(t);this.bindMethods();this.#Y()}bindMethods(){this.mutate=this.mutate.bind(this);this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#l.defaultMutationOptions(e);if(!_(this.options,t)){this.#l.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#I,observer:this})}if(t?.mutationKey&&this.options.mutationKey&&m(t.mutationKey)!==m(this.options.mutationKey)){this.reset()}else if(this.#I?.state.status==="pending"){this.#I.setOptions(this.options)}}onUnsubscribe(){if(!this.hasListeners()){this.#I?.removeObserver(this)}}onMutationUpdate(e){this.#Y();this.#T(e)}getCurrentResult(){return this.#E}reset(){this.#I?.removeObserver(this);this.#I=void 0;this.#Y();this.#T()}mutate(e,t){this.#C=t;this.#I?.removeObserver(this);this.#I=this.#l.getMutationCache().build(this.#l,this.options);this.#I.addObserver(this);return this.#I.execute(e)}#Y(){const e=this.#I?.state??Z();this.#E={...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset}}#T(e){R.batch(()=>{if(this.#C&&this.hasListeners()){const t=this.#E.variables;const r=this.#E.context;if(e?.type==="success"){this.#C.onSuccess?.(e.data,t,r);this.#C.onSettled?.(e.data,null,t,r)}else if(e?.type==="error"){this.#C.onError?.(e.error,t,r);this.#C.onSettled?.(void 0,e.error,t,r)}}this.listeners.forEach(e=>{e(this.#E)})})}};//# sourceMappingURL=mutationObserver.js.map
;// CONCATENATED MODULE: ./node_modules/@tanstack/react-query/build/legacy/useMutation.js
"use client";// src/useMutation.ts
function h6(e,t){const r=ec(t);const[i]=n.useState(()=>new h2(r,e));n.useEffect(()=>{i.setOptions(e)},[i,e]);const a=n.useSyncExternalStore(n.useCallback(e=>i.subscribe(R.batchCalls(e)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult());const o=n.useCallback((e,t)=>{i.mutate(e,t).catch(l)},[i]);if(a.error&&O(i.options.throwOnError,[a.error])){throw a.error}return{...a,mutate:o,mutateAsync:a.mutate}}//# sourceMappingURL=useMutation.js.map
;// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/helpers/bind.js
function h4(e,t){return function r(){return e.apply(t,arguments)}};// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/utils.js
// utils is a library of generic helper functions non-specific to axios
const{toString:h5}=Object.prototype;const{getPrototypeOf:h3}=Object;const{iterator:h8,toStringTag:h9}=Symbol;const h7=(e=>t=>{const r=h5.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null));const ve=e=>{e=e.toLowerCase();return t=>h7(t)===e};const vt=e=>t=>typeof t===e;/**
 * Determine if a value is an Array
 *
 * @param {Object} val The value to test
 *
 * @returns {boolean} True if value is an Array, otherwise false
 */const{isArray:vr}=Array;/**
 * Determine if a value is undefined
 *
 * @param {*} val The value to test
 *
 * @returns {boolean} True if the value is undefined, otherwise false
 */const vn=vt("undefined");/**
 * Determine if a value is a Buffer
 *
 * @param {*} val The value to test
 *
 * @returns {boolean} True if value is a Buffer, otherwise false
 */function vi(e){return e!==null&&!vn(e)&&e.constructor!==null&&!vn(e.constructor)&&vl(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}/**
 * Determine if a value is an ArrayBuffer
 *
 * @param {*} val The value to test
 *
 * @returns {boolean} True if value is an ArrayBuffer, otherwise false
 */const va=ve("ArrayBuffer");/**
 * Determine if a value is a view on an ArrayBuffer
 *
 * @param {*} val The value to test
 *
 * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
 */function vo(e){let t;if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView){t=ArrayBuffer.isView(e)}else{t=e&&e.buffer&&va(e.buffer)}return t}/**
 * Determine if a value is a String
 *
 * @param {*} val The value to test
 *
 * @returns {boolean} True if value is a String, otherwise false
 */const vs=vt("string");/**
 * Determine if a value is a Function
 *
 * @param {*} val The value to test
 * @returns {boolean} True if value is a Function, otherwise false
 */const vl=vt("function");/**
 * Determine if a value is a Number
 *
 * @param {*} val The value to test
 *
 * @returns {boolean} True if value is a Number, otherwise false
 */const vu=vt("number");/**
 * Determine if a value is an Object
 *
 * @param {*} thing The value to test
 *
 * @returns {boolean} True if value is an Object, otherwise false
 */const vc=e=>e!==null&&typeof e==="object";/**
 * Determine if a value is a Boolean
 *
 * @param {*} thing The value to test
 * @returns {boolean} True if value is a Boolean, otherwise false
 */const vd=e=>e===true||e===false;/**
 * Determine if a value is a plain Object
 *
 * @param {*} val The value to test
 *
 * @returns {boolean} True if value is a plain Object, otherwise false
 */const vf=e=>{if(h7(e)!=="object"){return false}const t=h3(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(h9 in e)&&!(h8 in e)};/**
 * Determine if a value is an empty object (safely handles Buffers)
 *
 * @param {*} val The value to test
 *
 * @returns {boolean} True if value is an empty object, otherwise false
 */const vp=e=>{// Early return for non-objects or Buffers to prevent RangeError
if(!vc(e)||vi(e)){return false}try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch(e){// Fallback for any other objects that might cause RangeError with Object.keys()
return false}};/**
 * Determine if a value is a Date
 *
 * @param {*} val The value to test
 *
 * @returns {boolean} True if value is a Date, otherwise false
 */const vh=ve("Date");/**
 * Determine if a value is a File
 *
 * @param {*} val The value to test
 *
 * @returns {boolean} True if value is a File, otherwise false
 */const vv=ve("File");/**
 * Determine if a value is a Blob
 *
 * @param {*} val The value to test
 *
 * @returns {boolean} True if value is a Blob, otherwise false
 */const vg=ve("Blob");/**
 * Determine if a value is a FileList
 *
 * @param {*} val The value to test
 *
 * @returns {boolean} True if value is a File, otherwise false
 */const vm=ve("FileList");/**
 * Determine if a value is a Stream
 *
 * @param {*} val The value to test
 *
 * @returns {boolean} True if value is a Stream, otherwise false
 */const vb=e=>vc(e)&&vl(e.pipe);/**
 * Determine if a value is a FormData
 *
 * @param {*} thing The value to test
 *
 * @returns {boolean} True if value is an FormData, otherwise false
 */const vy=e=>{let t;return e&&(typeof FormData==="function"&&e instanceof FormData||vl(e.append)&&((t=h7(e))==="formdata"||// detect form-data instance
t==="object"&&vl(e.toString)&&e.toString()==="[object FormData]"))};/**
 * Determine if a value is a URLSearchParams object
 *
 * @param {*} val The value to test
 *
 * @returns {boolean} True if value is a URLSearchParams object, otherwise false
 */const v_=ve("URLSearchParams");const[vw,vx,vA,vk]=["ReadableStream","Request","Response","Headers"].map(ve);/**
 * Trim excess whitespace off the beginning and end of a string
 *
 * @param {String} str The String to trim
 *
 * @returns {String} The String freed of excess whitespace
 */const vE=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");/**
 * Iterate over an Array or an Object invoking a function for each item.
 *
 * If `obj` is an Array callback will be called passing
 * the value, index, and complete array for each item.
 *
 * If 'obj' is an Object callback will be called passing
 * the value, key, and complete object for each property.
 *
 * @param {Object|Array} obj The object to iterate
 * @param {Function} fn The callback to invoke for each item
 *
 * @param {Boolean} [allOwnKeys = false]
 * @returns {any}
 */function vI(e,t,{allOwnKeys:r=false}={}){// Don't bother if no value provided
if(e===null||typeof e==="undefined"){return}let n;let i;// Force an array if not already something iterable
if(typeof e!=="object"){/*eslint no-param-reassign:0*/e=[e]}if(vr(e)){// Iterate over array values
for(n=0,i=e.length;n<i;n++){t.call(null,e[n],n,e)}}else{// Buffer check
if(vi(e)){return}// Iterate over object keys
const i=r?Object.getOwnPropertyNames(e):Object.keys(e);const a=i.length;let o;for(n=0;n<a;n++){o=i[n];t.call(null,e[o],o,e)}}}function vC(e,t){if(vi(e)){return null}t=t.toLowerCase();const r=Object.keys(e);let n=r.length;let i;while(n-- >0){i=r[n];if(t===i.toLowerCase()){return i}}return null}const vY=(()=>{/*eslint no-undef:0*/if(typeof globalThis!=="undefined")return globalThis;return typeof self!=="undefined"?self:typeof window!=="undefined"?window:global})();const vT=e=>!vn(e)&&e!==vY;/**
 * Accepts varargs expecting each argument to be an object, then
 * immutably merges the properties of each object and returns result.
 *
 * When multiple objects contain the same key the later object in
 * the arguments list will take precedence.
 *
 * Example:
 *
 * ```js
 * var result = merge({foo: 123}, {foo: 456});
 * console.log(result.foo); // outputs 456
 * ```
 *
 * @param {Object} obj1 Object to merge
 *
 * @returns {Object} Result of all merge properties
 */function vS(){const{caseless:e}=vT(this)&&this||{};const t={};const r=(r,n)=>{const i=e&&vC(t,n)||n;if(vf(t[i])&&vf(r)){t[i]=vS(t[i],r)}else if(vf(r)){t[i]=vS({},r)}else if(vr(r)){t[i]=r.slice()}else{t[i]=r}};for(let e=0,t=arguments.length;e<t;e++){arguments[e]&&vI(arguments[e],r)}return t}/**
 * Extends object a by mutably adding to it the properties of object b.
 *
 * @param {Object} a The object to be extended
 * @param {Object} b The object to copy properties from
 * @param {Object} thisArg The object to bind function to
 *
 * @param {Boolean} [allOwnKeys]
 * @returns {Object} The resulting value of object a
 */const vO=(e,t,r,{allOwnKeys:n}={})=>{vI(t,(t,n)=>{if(r&&vl(t)){e[n]=h4(t,r)}else{e[n]=t}},{allOwnKeys:n});return e};/**
 * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
 *
 * @param {string} content with BOM
 *
 * @returns {string} content value without BOM
 */const vD=e=>{if(e.charCodeAt(0)===65279){e=e.slice(1)}return e};/**
 * Inherit the prototype methods from one constructor into another
 * @param {function} constructor
 * @param {function} superConstructor
 * @param {object} [props]
 * @param {object} [descriptors]
 *
 * @returns {void}
 */const vF=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n);e.prototype.constructor=e;Object.defineProperty(e,"super",{value:t.prototype});r&&Object.assign(e.prototype,r)};/**
 * Resolve object with deep prototype chain to a flat object
 * @param {Object} sourceObj source object
 * @param {Object} [destObj]
 * @param {Function|Boolean} [filter]
 * @param {Function} [propFilter]
 *
 * @returns {Object}
 */const vR=(e,t,r,n)=>{let i;let a;let o;const s={};t=t||{};// eslint-disable-next-line no-eq-null,eqeqeq
if(e==null)return t;do{i=Object.getOwnPropertyNames(e);a=i.length;while(a-- >0){o=i[a];if((!n||n(o,e,t))&&!s[o]){t[o]=e[o];s[o]=true}}e=r!==false&&h3(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype)return t};/**
 * Determines whether a string ends with the characters of a specified string
 *
 * @param {String} str
 * @param {String} searchString
 * @param {Number} [position= 0]
 *
 * @returns {boolean}
 */const vP=(e,t,r)=>{e=String(e);if(r===undefined||r>e.length){r=e.length}r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r};/**
 * Returns new array from array like object or null if failed
 *
 * @param {*} [thing]
 *
 * @returns {?Array}
 */const vM=e=>{if(!e)return null;if(vr(e))return e;let t=e.length;if(!vu(t))return null;const r=new Array(t);while(t-- >0){r[t]=e[t]}return r};/**
 * Checking if the Uint8Array exists and if it does, it returns a function that checks if the
 * thing passed in is an instance of Uint8Array
 *
 * @param {TypedArray}
 *
 * @returns {Array}
 */// eslint-disable-next-line func-names
const vH=(e=>{// eslint-disable-next-line func-names
return t=>{return e&&t instanceof e}})(typeof Uint8Array!=="undefined"&&h3(Uint8Array));/**
 * For each entry in the object, call the function with the key and value.
 *
 * @param {Object<any, any>} obj - The object to iterate over.
 * @param {Function} fn - The function to call for each entry.
 *
 * @returns {void}
 */const vN=(e,t)=>{const r=e&&e[h8];const n=r.call(e);let i;while((i=n.next())&&!i.done){const r=i.value;t.call(e,r[0],r[1])}};/**
 * It takes a regular expression and a string, and returns an array of all the matches
 *
 * @param {string} regExp - The regular expression to match against.
 * @param {string} str - The string to search.
 *
 * @returns {Array<boolean>}
 */const vL=(e,t)=>{let r;const n=[];while((r=e.exec(t))!==null){n.push(r)}return n};/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */const vK=ve("HTMLFormElement");const vB=e=>{return e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function e(e,t,r){return t.toUpperCase()+r})};/* Creating a function that will check if an object has a property. */const vj=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype);/**
 * Determine if a value is a RegExp object
 *
 * @param {*} val The value to test
 *
 * @returns {boolean} True if value is a RegExp object, otherwise false
 */const vU=ve("RegExp");const vq=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e);const n={};vI(r,(r,i)=>{let a;if((a=t(r,i,e))!==false){n[i]=a||r}});Object.defineProperties(e,n)};/**
 * Makes all methods read-only
 * @param {Object} obj
 */const vV=e=>{vq(e,(t,r)=>{// skip restricted props in strict mode
if(vl(e)&&["arguments","caller","callee"].indexOf(r)!==-1){return false}const n=e[r];if(!vl(n))return;t.enumerable=false;if("writable"in t){t.writable=false;return}if(!t.set){t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}}})};const vW=(e,t)=>{const r={};const n=e=>{e.forEach(e=>{r[e]=true})};vr(e)?n(e):n(String(e).split(t));return r};const vz=()=>{};const vG=(e,t)=>{return e!=null&&Number.isFinite(e=+e)?e:t};/**
 * If the thing is a FormData object, return true, otherwise return false.
 *
 * @param {unknown} thing - The thing to check.
 *
 * @returns {boolean}
 */function vQ(e){return!!(e&&vl(e.append)&&e[h9]==="FormData"&&e[h8])}const v$=e=>{const t=new Array(10);const r=(e,n)=>{if(vc(e)){if(t.indexOf(e)>=0){return}//Buffer check
if(vi(e)){return e}if(!("toJSON"in e)){t[n]=e;const i=vr(e)?[]:{};vI(e,(e,t)=>{const a=r(e,n+1);!vn(a)&&(i[t]=a)});t[n]=undefined;return i}}return e};return r(e,0)};const vX=ve("AsyncFunction");const vJ=e=>e&&(vc(e)||vl(e))&&vl(e.then)&&vl(e.catch);// original code
// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
const vZ=((e,t)=>{if(e){return setImmediate}return t?((e,t)=>{vY.addEventListener("message",({source:r,data:n})=>{if(r===vY&&n===e){t.length&&t.shift()()}},false);return r=>{t.push(r);vY.postMessage(e,"*")}})(`axios@${Math.random()}`,[]):e=>setTimeout(e)})(typeof setImmediate==="function",vl(vY.postMessage));const v0=typeof queueMicrotask!=="undefined"?queueMicrotask.bind(vY):typeof process!=="undefined"&&process.nextTick||vZ;// *********************
const v1=e=>e!=null&&vl(e[h8]);/* ESM default export */const v2={isArray:vr,isArrayBuffer:va,isBuffer:vi,isFormData:vy,isArrayBufferView:vo,isString:vs,isNumber:vu,isBoolean:vd,isObject:vc,isPlainObject:vf,isEmptyObject:vp,isReadableStream:vw,isRequest:vx,isResponse:vA,isHeaders:vk,isUndefined:vn,isDate:vh,isFile:vv,isBlob:vg,isRegExp:vU,isFunction:vl,isStream:vb,isURLSearchParams:v_,isTypedArray:vH,isFileList:vm,forEach:vI,merge:vS,extend:vO,trim:vE,stripBOM:vD,inherits:vF,toFlatObject:vR,kindOf:h7,kindOfTest:ve,endsWith:vP,toArray:vM,forEachEntry:vN,matchAll:vL,isHTMLForm:vK,hasOwnProperty:vj,hasOwnProp:vj,reduceDescriptors:vq,freezeMethods:vV,toObjectSet:vW,toCamelCase:vB,noop:vz,toFiniteNumber:vG,findKey:vC,global:vY,isContextDefined:vT,isSpecCompliantForm:vQ,toJSONObject:v$,isAsyncFn:vX,isThenable:vJ,setImmediate:vZ,asap:v0,isIterable:v1};// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/core/AxiosError.js
/**
 * Create an Error with the specified message, config, error code, request and response.
 *
 * @param {string} message The error message.
 * @param {string} [code] The error code (for example, 'ECONNABORTED').
 * @param {Object} [config] The config.
 * @param {Object} [request] The request.
 * @param {Object} [response] The response.
 *
 * @returns {Error} The created error.
 */function v6(e,t,r,n,i){Error.call(this);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}else{this.stack=new Error().stack}this.message=e;this.name="AxiosError";t&&(this.code=t);r&&(this.config=r);n&&(this.request=n);if(i){this.response=i;this.status=i.status?i.status:null}}v2.inherits(v6,Error,{toJSON:function e(){return{// Standard
message:this.message,name:this.name,// Microsoft
description:this.description,number:this.number,// Mozilla
fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,// Axios
config:v2.toJSONObject(this.config),code:this.code,status:this.status}}});const v4=v6.prototype;const v5={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{v5[e]={value:e}});Object.defineProperties(v6,v5);Object.defineProperty(v4,"isAxiosError",{value:true});// eslint-disable-next-line func-names
v6.from=(e,t,r,n,i,a)=>{const o=Object.create(v4);v2.toFlatObject(e,o,function e(e){return e!==Error.prototype},e=>{return e!=="isAxiosError"});v6.call(o,e.message,t,r,n,i);o.cause=e;o.name=e.name;a&&Object.assign(o,a);return o};/* ESM default export */const v3=v6;// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/helpers/null.js
// eslint-disable-next-line strict
/* ESM default export */const v8=null;// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/helpers/toFormData.js
// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored
/**
 * Determines if the given thing is a array or js object.
 *
 * @param {string} thing - The object or array to be visited.
 *
 * @returns {boolean}
 */function v9(e){return v2.isPlainObject(e)||v2.isArray(e)}/**
 * It removes the brackets from the end of a string
 *
 * @param {string} key - The key of the parameter.
 *
 * @returns {string} the key without the brackets.
 */function v7(e){return v2.endsWith(e,"[]")?e.slice(0,-2):e}/**
 * It takes a path, a key, and a boolean, and returns a string
 *
 * @param {string} path - The path to the current key.
 * @param {string} key - The key of the current object being iterated over.
 * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
 *
 * @returns {string} The path to the current key.
 */function ge(e,t,r){if(!e)return t;return e.concat(t).map(function e(e,t){// eslint-disable-next-line no-param-reassign
e=v7(e);return!r&&t?"["+e+"]":e}).join(r?".":"")}/**
 * If the array is an array and none of its elements are visitable, then it's a flat array.
 *
 * @param {Array<any>} arr - The array to check
 *
 * @returns {boolean}
 */function gt(e){return v2.isArray(e)&&!e.some(v9)}const gr=v2.toFlatObject(v2,{},null,function e(e){return/^is[A-Z]/.test(e)});/**
 * Convert a data object to FormData
 *
 * @param {Object} obj
 * @param {?Object} [formData]
 * @param {?Object} [options]
 * @param {Function} [options.visitor]
 * @param {Boolean} [options.metaTokens = true]
 * @param {Boolean} [options.dots = false]
 * @param {?Boolean} [options.indexes = false]
 *
 * @returns {Object}
 **//**
 * It converts an object into a FormData object
 *
 * @param {Object<any, any>} obj - The object to convert to form data.
 * @param {string} formData - The FormData object to append to.
 * @param {Object<string, any>} options
 *
 * @returns
 */function gn(e,t,r){if(!v2.isObject(e)){throw new TypeError("target must be an object")}// eslint-disable-next-line no-param-reassign
t=t||new(v8||FormData);// eslint-disable-next-line no-param-reassign
r=v2.toFlatObject(r,{metaTokens:true,dots:false,indexes:false},false,function e(e,t){// eslint-disable-next-line no-eq-null,eqeqeq
return!v2.isUndefined(t[e])});const n=r.metaTokens;// eslint-disable-next-line no-use-before-define
const i=r.visitor||c;const a=r.dots;const o=r.indexes;const s=r.Blob||typeof Blob!=="undefined"&&Blob;const l=s&&v2.isSpecCompliantForm(t);if(!v2.isFunction(i)){throw new TypeError("visitor must be a function")}function u(e){if(e===null)return"";if(v2.isDate(e)){return e.toISOString()}if(v2.isBoolean(e)){return e.toString()}if(!l&&v2.isBlob(e)){throw new v3("Blob is not supported. Use a Buffer instead.")}if(v2.isArrayBuffer(e)||v2.isTypedArray(e)){return l&&typeof Blob==="function"?new Blob([e]):Buffer.from(e)}return e}/**
   * Default visitor.
   *
   * @param {*} value
   * @param {String|Number} key
   * @param {Array<String|Number>} path
   * @this {FormData}
   *
   * @returns {boolean} return true to visit the each prop of the value recursively
   */function c(e,r,i){let s=e;if(e&&!i&&typeof e==="object"){if(v2.endsWith(r,"{}")){// eslint-disable-next-line no-param-reassign
r=n?r:r.slice(0,-2);// eslint-disable-next-line no-param-reassign
e=JSON.stringify(e)}else if(v2.isArray(e)&&gt(e)||(v2.isFileList(e)||v2.endsWith(r,"[]"))&&(s=v2.toArray(e))){// eslint-disable-next-line no-param-reassign
r=v7(r);s.forEach(function e(e,n){!(v2.isUndefined(e)||e===null)&&t.append(// eslint-disable-next-line no-nested-ternary
o===true?ge([r],n,a):o===null?r:r+"[]",u(e))});return false}}if(v9(e)){return true}t.append(ge(i,r,a),u(e));return false}const d=[];const f=Object.assign(gr,{defaultVisitor:c,convertValue:u,isVisitable:v9});function p(e,r){if(v2.isUndefined(e))return;if(d.indexOf(e)!==-1){throw Error("Circular reference detected in "+r.join("."))}d.push(e);v2.forEach(e,function e(e,n){const a=!(v2.isUndefined(e)||e===null)&&i.call(t,e,v2.isString(n)?n.trim():n,r,f);if(a===true){p(e,r?r.concat(n):[n])}});d.pop()}if(!v2.isObject(e)){throw new TypeError("data must be an object")}p(e);return t}/* ESM default export */const gi=gn;// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/helpers/AxiosURLSearchParams.js
/**
 * It encodes a string by replacing all characters that are not in the unreserved set with
 * their percent-encoded equivalents
 *
 * @param {string} str - The string to encode.
 *
 * @returns {string} The encoded string.
 */function ga(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function e(e){return t[e]})}/**
 * It takes a params object and converts it to a FormData object
 *
 * @param {Object<string, any>} params - The parameters to be converted to a FormData object.
 * @param {Object<string, any>} options - The options object passed to the Axios constructor.
 *
 * @returns {void}
 */function go(e,t){this._pairs=[];e&&gi(e,this,t)}const gs=go.prototype;gs.append=function e(e,t){this._pairs.push([e,t])};gs.toString=function e(e){const t=e?function(t){return e.call(this,t,ga)}:ga;return this._pairs.map(function e(e){return t(e[0])+"="+t(e[1])},"").join("&")};/* ESM default export */const gl=go;// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/helpers/buildURL.js
/**
 * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their
 * URI encoded counterparts
 *
 * @param {string} val The value to be encoded.
 *
 * @returns {string} The encoded value.
 */function gu(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}/**
 * Build a URL by appending params to the end
 *
 * @param {string} url The base of the url (e.g., http://www.google.com)
 * @param {object} [params] The params to be appended
 * @param {?(object|Function)} options
 *
 * @returns {string} The formatted url
 */function gc(e,t,r){/*eslint no-param-reassign:0*/if(!t){return e}const n=r&&r.encode||gu;if(v2.isFunction(r)){r={serialize:r}}const i=r&&r.serialize;let a;if(i){a=i(t,r)}else{a=v2.isURLSearchParams(t)?t.toString():new gl(t,r).toString(n)}if(a){const t=e.indexOf("#");if(t!==-1){e=e.slice(0,t)}e+=(e.indexOf("?")===-1?"?":"&")+a}return e};// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/core/InterceptorManager.js
class gd{constructor(){this.handlers=[]}/**
   * Add a new interceptor to the stack
   *
   * @param {Function} fulfilled The function to handle `then` for a `Promise`
   * @param {Function} rejected The function to handle `reject` for a `Promise`
   *
   * @return {Number} An ID used to remove interceptor later
   */use(e,t,r){this.handlers.push({fulfilled:e,rejected:t,synchronous:r?r.synchronous:false,runWhen:r?r.runWhen:null});return this.handlers.length-1}/**
   * Remove an interceptor from the stack
   *
   * @param {Number} id The ID that was returned by `use`
   *
   * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
   */eject(e){if(this.handlers[e]){this.handlers[e]=null}}/**
   * Clear all interceptors from the stack
   *
   * @returns {void}
   */clear(){if(this.handlers){this.handlers=[]}}/**
   * Iterate over all the registered interceptors
   *
   * This method is particularly useful for skipping over any
   * interceptors that may have become `null` calling `eject`.
   *
   * @param {Function} fn The function to call for each interceptor
   *
   * @returns {void}
   */forEach(e){v2.forEach(this.handlers,function t(t){if(t!==null){e(t)}})}}/* ESM default export */const gf=gd;// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/defaults/transitional.js
/* ESM default export */const gp={silentJSONParsing:true,forcedJSONParsing:true,clarifyTimeoutError:false};// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js
/* ESM default export */const gh=typeof URLSearchParams!=="undefined"?URLSearchParams:gl;// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/platform/browser/classes/FormData.js
/* ESM default export */const gv=typeof FormData!=="undefined"?FormData:null;// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/platform/browser/classes/Blob.js
/* ESM default export */const gg=typeof Blob!=="undefined"?Blob:null;// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/platform/browser/index.js
/* ESM default export */const gm={isBrowser:true,classes:{URLSearchParams:gh,FormData:gv,Blob:gg},protocols:["http","https","file","blob","url","data"]};// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/platform/common/utils.js
const gb=typeof window!=="undefined"&&typeof document!=="undefined";const gy=typeof navigator==="object"&&navigator||undefined;/**
 * Determine if we're running in a standard browser environment
 *
 * This allows axios to run in a web worker, and react-native.
 * Both environments support XMLHttpRequest, but not fully standard globals.
 *
 * web workers:
 *  typeof window -> undefined
 *  typeof document -> undefined
 *
 * react-native:
 *  navigator.product -> 'ReactNative'
 * nativescript
 *  navigator.product -> 'NativeScript' or 'NS'
 *
 * @returns {boolean}
 */const g_=gb&&(!gy||["ReactNative","NativeScript","NS"].indexOf(gy.product)<0);/**
 * Determine if we're running in a standard browser webWorker environment
 *
 * Although the `isStandardBrowserEnv` method indicates that
 * `allows axios to run in a web worker`, the WebWorker will still be
 * filtered out due to its judgment standard
 * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
 * This leads to a problem when axios post `FormData` in webWorker
 */const gw=(()=>{return typeof WorkerGlobalScope!=="undefined"&&// eslint-disable-next-line no-undef
self instanceof WorkerGlobalScope&&typeof self.importScripts==="function"})();const gx=gb&&window.location.href||"http://localhost";// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/platform/index.js
/* ESM default export */const gA={...e,...gm};// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/helpers/toURLEncodedForm.js
function gk(e,t){return gi(e,new gA.classes.URLSearchParams,{visitor:function(e,t,r,n){if(gA.isNode&&v2.isBuffer(e)){this.append(t,e.toString("base64"));return false}return n.defaultVisitor.apply(this,arguments)},...t})};// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/helpers/formDataToJSON.js
/**
 * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
 *
 * @param {string} name - The name of the property to get.
 *
 * @returns An array of strings.
 */function gE(e){// foo[x][y][z]
// foo.x.y.z
// foo-x-y-z
// foo x y z
return v2.matchAll(/\w+|\[(\w*)]/g,e).map(e=>{return e[0]==="[]"?"":e[1]||e[0]})}/**
 * Convert an array to an object.
 *
 * @param {Array<any>} arr - The array to convert to an object.
 *
 * @returns An object with the same keys and values as the array.
 */function gI(e){const t={};const r=Object.keys(e);let n;const i=r.length;let a;for(n=0;n<i;n++){a=r[n];t[a]=e[a]}return t}/**
 * It takes a FormData object and returns a JavaScript object
 *
 * @param {string} formData The FormData object to convert to JSON.
 *
 * @returns {Object<string, any> | null} The converted object.
 */function gC(e){function t(e,r,n,i){let a=e[i++];if(a==="__proto__")return true;const o=Number.isFinite(+a);const s=i>=e.length;a=!a&&v2.isArray(n)?n.length:a;if(s){if(v2.hasOwnProp(n,a)){n[a]=[n[a],r]}else{n[a]=r}return!o}if(!n[a]||!v2.isObject(n[a])){n[a]=[]}const l=t(e,r,n[a],i);if(l&&v2.isArray(n[a])){n[a]=gI(n[a])}return!o}if(v2.isFormData(e)&&v2.isFunction(e.entries)){const r={};v2.forEachEntry(e,(e,n)=>{t(gE(e),n,r,0)});return r}return null}/* ESM default export */const gY=gC;// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/defaults/index.js
/**
 * It takes a string, tries to parse it, and if it fails, it returns the stringified version
 * of the input
 *
 * @param {any} rawValue - The value to be stringified.
 * @param {Function} parser - A function that parses a string into a JavaScript object.
 * @param {Function} encoder - A function that takes a value and returns a string.
 *
 * @returns {string} A stringified version of the rawValue.
 */function gT(e,t,r){if(v2.isString(e)){try{(t||JSON.parse)(e);return v2.trim(e)}catch(e){if(e.name!=="SyntaxError"){throw e}}}return(r||JSON.stringify)(e)}const gS={transitional:gp,adapter:["xhr","http","fetch"],transformRequest:[function e(e,t){const r=t.getContentType()||"";const n=r.indexOf("application/json")>-1;const i=v2.isObject(e);if(i&&v2.isHTMLForm(e)){e=new FormData(e)}const a=v2.isFormData(e);if(a){return n?JSON.stringify(gY(e)):e}if(v2.isArrayBuffer(e)||v2.isBuffer(e)||v2.isStream(e)||v2.isFile(e)||v2.isBlob(e)||v2.isReadableStream(e)){return e}if(v2.isArrayBufferView(e)){return e.buffer}if(v2.isURLSearchParams(e)){t.setContentType("application/x-www-form-urlencoded;charset=utf-8",false);return e.toString()}let o;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1){return gk(e,this.formSerializer).toString()}if((o=v2.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return gi(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}if(i||n){t.setContentType("application/json",false);return gT(e)}return e}],transformResponse:[function e(e){const t=this.transitional||gS.transitional;const r=t&&t.forcedJSONParsing;const n=this.responseType==="json";if(v2.isResponse(e)||v2.isReadableStream(e)){return e}if(e&&v2.isString(e)&&(r&&!this.responseType||n)){const r=t&&t.silentJSONParsing;const i=!r&&n;try{return JSON.parse(e)}catch(e){if(i){if(e.name==="SyntaxError"){throw v3.from(e,v3.ERR_BAD_RESPONSE,this,null,this.response)}throw e}}}return e}],/**
   * A timeout in milliseconds to abort a request. If set to 0 (default) a
   * timeout is not created.
   */timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:gA.classes.FormData,Blob:gA.classes.Blob},validateStatus:function e(e){return e>=200&&e<300},headers:{common:{"Accept":"application/json, text/plain, */*","Content-Type":undefined}}};v2.forEach(["delete","get","head","post","put","patch"],e=>{gS.headers[e]={}});/* ESM default export */const gO=gS;// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/helpers/parseHeaders.js
// RawAxiosHeaders whose duplicates are ignored by node
// c.f. https://nodejs.org/api/http.html#http_message_headers
const gD=v2.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"]);/**
 * Parse headers into an object
 *
 * ```
 * Date: Wed, 27 Aug 2014 08:58:49 GMT
 * Content-Type: application/json
 * Connection: keep-alive
 * Transfer-Encoding: chunked
 * ```
 *
 * @param {String} rawHeaders Headers needing to be parsed
 *
 * @returns {Object} Headers parsed into an object
 *//* ESM default export */const gF=e=>{const t={};let r;let n;let i;e&&e.split("\n").forEach(function e(e){i=e.indexOf(":");r=e.substring(0,i).trim().toLowerCase();n=e.substring(i+1).trim();if(!r||t[r]&&gD[r]){return}if(r==="set-cookie"){if(t[r]){t[r].push(n)}else{t[r]=[n]}}else{t[r]=t[r]?t[r]+", "+n:n}});return t};// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/core/AxiosHeaders.js
const gR=Symbol("internals");function gP(e){return e&&String(e).trim().toLowerCase()}function gM(e){if(e===false||e==null){return e}return v2.isArray(e)?e.map(gM):String(e)}function gH(e){const t=Object.create(null);const r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;while(n=r.exec(e)){t[n[1]]=n[2]}return t}const gN=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function gL(e,t,r,n,i){if(v2.isFunction(n)){return n.call(this,t,r)}if(i){t=r}if(!v2.isString(t))return;if(v2.isString(n)){return t.indexOf(n)!==-1}if(v2.isRegExp(n)){return n.test(t)}}function gK(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>{return t.toUpperCase()+r})}function gB(e,t){const r=v2.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(e,r,i){return this[n].call(this,t,e,r,i)},configurable:true})})}class gj{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function i(e,t,r){const i=gP(t);if(!i){throw new Error("header name must be a non-empty string")}const a=v2.findKey(n,i);if(!a||n[a]===undefined||r===true||r===undefined&&n[a]!==false){n[a||t]=gM(e)}}const a=(e,t)=>v2.forEach(e,(e,r)=>i(e,r,t));if(v2.isPlainObject(e)||e instanceof this.constructor){a(e,t)}else if(v2.isString(e)&&(e=e.trim())&&!gN(e)){a(gF(e),t)}else if(v2.isObject(e)&&v2.isIterable(e)){let r={},n,i;for(const t of e){if(!v2.isArray(t)){throw TypeError("Object iterator must return a key-value pair")}r[i=t[0]]=(n=r[i])?v2.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}a(r,t)}else{e!=null&&i(t,e,r)}return this}get(e,t){e=gP(e);if(e){const r=v2.findKey(this,e);if(r){const e=this[r];if(!t){return e}if(t===true){return gH(e)}if(v2.isFunction(t)){return t.call(this,e,r)}if(v2.isRegExp(t)){return t.exec(e)}throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){e=gP(e);if(e){const r=v2.findKey(this,e);return!!(r&&this[r]!==undefined&&(!t||gL(this,this[r],r,t)))}return false}delete(e,t){const r=this;let n=false;function i(e){e=gP(e);if(e){const i=v2.findKey(r,e);if(i&&(!t||gL(r,r[i],i,t))){delete r[i];n=true}}}if(v2.isArray(e)){e.forEach(i)}else{i(e)}return n}clear(e){const t=Object.keys(this);let r=t.length;let n=false;while(r--){const i=t[r];if(!e||gL(this,this[i],i,e,true)){delete this[i];n=true}}return n}normalize(e){const t=this;const r={};v2.forEach(this,(n,i)=>{const a=v2.findKey(r,i);if(a){t[a]=gM(n);delete t[i];return}const o=e?gK(i):String(i).trim();if(o!==i){delete t[i]}t[o]=gM(n);r[o]=true});return this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);v2.forEach(this,(r,n)=>{r!=null&&r!==false&&(t[n]=e&&v2.isArray(r)?r.join(", "):r)});return t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);t.forEach(e=>r.set(e));return r}static accessor(e){const t=this[gR]=this[gR]={accessors:{}};const r=t.accessors;const n=this.prototype;function i(e){const t=gP(e);if(!r[t]){gB(n,e);r[t]=true}}v2.isArray(e)?e.forEach(i):i(e);return this}}gj.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);// reserved names hotfix
v2.reduceDescriptors(gj.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);// map `set` => `Set`
return{get:()=>e,set(e){this[r]=e}}});v2.freezeMethods(gj);/* ESM default export */const gU=gj;// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/core/transformData.js
/**
 * Transform the data for a request or a response
 *
 * @param {Array|Function} fns A single function or Array of functions
 * @param {?Object} response The response object
 *
 * @returns {*} The resulting transformed data
 */function gq(e,t){const r=this||gO;const n=t||r;const i=gU.from(n.headers);let a=n.data;v2.forEach(e,function e(e){a=e.call(r,a,i.normalize(),t?t.status:undefined)});i.normalize();return a};// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/cancel/isCancel.js
function gV(e){return!!(e&&e.__CANCEL__)};// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/cancel/CanceledError.js
/**
 * A `CanceledError` is an object that is thrown when an operation is canceled.
 *
 * @param {string=} message The message.
 * @param {Object=} config The config.
 * @param {Object=} request The request.
 *
 * @returns {CanceledError} The created error.
 */function gW(e,t,r){// eslint-disable-next-line no-eq-null,eqeqeq
v3.call(this,e==null?"canceled":e,v3.ERR_CANCELED,t,r);this.name="CanceledError"}v2.inherits(gW,v3,{__CANCEL__:true});/* ESM default export */const gz=gW;// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/core/settle.js
/**
 * Resolve or reject a Promise based on response status.
 *
 * @param {Function} resolve A function that resolves the promise.
 * @param {Function} reject A function that rejects the promise.
 * @param {object} response The response.
 *
 * @returns {object} The response.
 */function gG(e,t,r){const n=r.config.validateStatus;if(!r.status||!n||n(r.status)){e(r)}else{t(new v3("Request failed with status code "+r.status,[v3.ERR_BAD_REQUEST,v3.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}};// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/helpers/parseProtocol.js
function gQ(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""};// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/helpers/speedometer.js
/**
 * Calculate data maxRate
 * @param {Number} [samplesCount= 10]
 * @param {Number} [min= 1000]
 * @returns {Function}
 */function g$(e,t){e=e||10;const r=new Array(e);const n=new Array(e);let i=0;let a=0;let o;t=t!==undefined?t:1e3;return function s(s){const l=Date.now();const u=n[a];if(!o){o=l}r[i]=s;n[i]=l;let c=a;let d=0;while(c!==i){d+=r[c++];c=c%e}i=(i+1)%e;if(i===a){a=(a+1)%e}if(l-o<t){return}const f=u&&l-u;return f?Math.round(d*1e3/f):undefined}}/* ESM default export */const gX=g$;// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/helpers/throttle.js
/**
 * Throttle decorator
 * @param {Function} fn
 * @param {Number} freq
 * @return {Function}
 */function gJ(e,t){let r=0;let n=1e3/t;let i;let a;const o=(t,n=Date.now())=>{r=n;i=null;if(a){clearTimeout(a);a=null}e(...t)};const s=(...e)=>{const t=Date.now();const s=t-r;if(s>=n){o(e,t)}else{i=e;if(!a){a=setTimeout(()=>{a=null;o(i)},n-s)}}};const l=()=>i&&o(i);return[s,l]}/* ESM default export */const gZ=gJ;// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/helpers/progressEventReducer.js
const g0=(e,t,r=3)=>{let n=0;const i=gX(50,250);return gZ(r=>{const a=r.loaded;const o=r.lengthComputable?r.total:undefined;const s=a-n;const l=i(s);const u=a<=o;n=a;const c={loaded:a,total:o,progress:o?a/o:undefined,bytes:s,rate:l?l:undefined,estimated:l&&o&&u?(o-a)/l:undefined,event:r,lengthComputable:o!=null,[t?"download":"upload"]:true};e(c)},r)};const g1=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]};const g2=e=>(...t)=>v2.asap(()=>e(...t));// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/helpers/isURLSameOrigin.js
/* ESM default export */const g6=gA.hasStandardBrowserEnv?((e,t)=>r=>{r=new URL(r,gA.origin);return e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)})(new URL(gA.origin),gA.navigator&&/(msie|trident)/i.test(gA.navigator.userAgent)):()=>true;// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/helpers/cookies.js
/* ESM default export */const g4=gA.hasStandardBrowserEnv?// Standard browser envs support document.cookie
{write(e,t,r,n,i,a){const o=[e+"="+encodeURIComponent(t)];v2.isNumber(r)&&o.push("expires="+new Date(r).toGMTString());v2.isString(n)&&o.push("path="+n);v2.isString(i)&&o.push("domain="+i);a===true&&o.push("secure");document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:// Non-standard browser env (web workers, react-native) lack needed support.
{write(){},read(){return null},remove(){}};// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/helpers/isAbsoluteURL.js
/**
 * Determines whether the specified URL is absolute
 *
 * @param {string} url The URL to test
 *
 * @returns {boolean} True if the specified URL is absolute, otherwise false
 */function g5(e){// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
// by any combination of letters, digits, plus, period, or hyphen.
return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)};// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/helpers/combineURLs.js
/**
 * Creates a new URL by combining the specified URLs
 *
 * @param {string} baseURL The base URL
 * @param {string} relativeURL The relative URL
 *
 * @returns {string} The combined URL
 */function g3(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e};// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/core/buildFullPath.js
/**
 * Creates a new URL by combining the baseURL with the requestedURL,
 * only when the requestedURL is not already an absolute URL.
 * If the requestURL is absolute, this function returns the requestedURL untouched.
 *
 * @param {string} baseURL The base URL
 * @param {string} requestedURL Absolute or relative URL to combine
 *
 * @returns {string} The combined full path
 */function g8(e,t,r){let n=!g5(t);if(e&&(n||r==false)){return g3(e,t)}return t};// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/core/mergeConfig.js
const g9=e=>e instanceof gU?{...e}:e;/**
 * Config-specific merge-function which creates a new config-object
 * by merging two configuration objects together.
 *
 * @param {Object} config1
 * @param {Object} config2
 *
 * @returns {Object} New object resulting from merging config2 to config1
 */function g7(e,t){// eslint-disable-next-line no-param-reassign
t=t||{};const r={};function n(e,t,r,n){if(v2.isPlainObject(e)&&v2.isPlainObject(t)){return v2.merge.call({caseless:n},e,t)}else if(v2.isPlainObject(t)){return v2.merge({},t)}else if(v2.isArray(t)){return t.slice()}return t}// eslint-disable-next-line consistent-return
function i(e,t,r,i){if(!v2.isUndefined(t)){return n(e,t,r,i)}else if(!v2.isUndefined(e)){return n(undefined,e,r,i)}}// eslint-disable-next-line consistent-return
function a(e,t){if(!v2.isUndefined(t)){return n(undefined,t)}}// eslint-disable-next-line consistent-return
function o(e,t){if(!v2.isUndefined(t)){return n(undefined,t)}else if(!v2.isUndefined(e)){return n(undefined,e)}}// eslint-disable-next-line consistent-return
function s(r,i,a){if(a in t){return n(r,i)}else if(a in e){return n(undefined,r)}}const l={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(e,t,r)=>i(g9(e),g9(t),r,true)};v2.forEach(Object.keys({...e,...t}),function n(n){const a=l[n]||i;const o=a(e[n],t[n],n);v2.isUndefined(o)&&a!==s||(r[n]=o)});return r};// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/helpers/resolveConfig.js
/* ESM default export */const me=e=>{const t=g7({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:a,headers:o,auth:s}=t;t.headers=o=gU.from(o);t.url=gc(g8(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer);// HTTP basic authentication
if(s){o.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):"")))}let l;if(v2.isFormData(r)){if(gA.hasStandardBrowserEnv||gA.hasStandardBrowserWebWorkerEnv){o.setContentType(undefined);// Let the browser set it
}else if((l=o.getContentType())!==false){// fix semicolon duplication issue for ReactNative FormData implementation
const[e,...t]=l?l.split(";").map(e=>e.trim()).filter(Boolean):[];o.setContentType([e||"multipart/form-data",...t].join("; "))}}// Add xsrf header
// This is only done if running in a standard browser environment.
// Specifically not if we're in a web worker, or react-native.
if(gA.hasStandardBrowserEnv){n&&v2.isFunction(n)&&(n=n(t));if(n||n!==false&&g6(t.url)){// Add xsrf header
const e=i&&a&&g4.read(a);if(e){o.set(i,e)}}}return t};// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/adapters/xhr.js
const mt=typeof XMLHttpRequest!=="undefined";/* ESM default export */const mr=mt&&function(e){return new Promise(function t(t,r){const n=me(e);let i=n.data;const a=gU.from(n.headers).normalize();let{responseType:o,onUploadProgress:s,onDownloadProgress:l}=n;let u;let c,d;let f,p;function h(){f&&f();// flush events
p&&p();// flush events
n.cancelToken&&n.cancelToken.unsubscribe(u);n.signal&&n.signal.removeEventListener("abort",u)}let v=new XMLHttpRequest;v.open(n.method.toUpperCase(),n.url,true);// Set the request timeout in MS
v.timeout=n.timeout;function g(){if(!v){return}// Prepare the response
const n=gU.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders());const i=!o||o==="text"||o==="json"?v.responseText:v.response;const a={data:i,status:v.status,statusText:v.statusText,headers:n,config:e,request:v};gG(function e(e){t(e);h()},function e(e){r(e);h()},a);// Clean up request
v=null}if("onloadend"in v){// Use onloadend if available
v.onloadend=g}else{// Listen for ready state to emulate onloadend
v.onreadystatechange=function e(){if(!v||v.readyState!==4){return}// The request errored out and we didn't get a response, this will be
// handled by onerror instead
// With one exception: request that using file: protocol, most browsers
// will return status as 0 even though it's a successful request
if(v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)){return}// readystate handler is calling before onerror or ontimeout handlers,
// so we should call onloadend on the next 'tick'
setTimeout(g)}}// Handle browser request cancellation (as opposed to a manual cancellation)
v.onabort=function t(){if(!v){return}r(new v3("Request aborted",v3.ECONNABORTED,e,v));// Clean up request
v=null};// Handle low level network errors
v.onerror=function t(){// Real errors are hidden from us by the browser
// onerror should only fire if it's a network error
r(new v3("Network Error",v3.ERR_NETWORK,e,v));// Clean up request
v=null};// Handle timeout
v.ontimeout=function t(){let t=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const i=n.transitional||gp;if(n.timeoutErrorMessage){t=n.timeoutErrorMessage}r(new v3(t,i.clarifyTimeoutError?v3.ETIMEDOUT:v3.ECONNABORTED,e,v));// Clean up request
v=null};// Remove Content-Type if data is undefined
i===undefined&&a.setContentType(null);// Add headers to the request
if("setRequestHeader"in v){v2.forEach(a.toJSON(),function e(e,t){v.setRequestHeader(t,e)})}// Add withCredentials to request if needed
if(!v2.isUndefined(n.withCredentials)){v.withCredentials=!!n.withCredentials}// Add responseType to request if needed
if(o&&o!=="json"){v.responseType=n.responseType}// Handle progress if needed
if(l){[d,p]=g0(l,true);v.addEventListener("progress",d)}// Not all browsers support upload events
if(s&&v.upload){[c,f]=g0(s);v.upload.addEventListener("progress",c);v.upload.addEventListener("loadend",f)}if(n.cancelToken||n.signal){// Handle cancellation
// eslint-disable-next-line func-names
u=t=>{if(!v){return}r(!t||t.type?new gz(null,e,v):t);v.abort();v=null};n.cancelToken&&n.cancelToken.subscribe(u);if(n.signal){n.signal.aborted?u():n.signal.addEventListener("abort",u)}}const m=gQ(n.url);if(m&&gA.protocols.indexOf(m)===-1){r(new v3("Unsupported protocol "+m+":",v3.ERR_BAD_REQUEST,e));return}// Send the request
v.send(i||null)})};// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/helpers/composeSignals.js
const mn=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let r=new AbortController;let n;const i=function(e){if(!n){n=true;o();const t=e instanceof Error?e:this.reason;r.abort(t instanceof v3?t:new gz(t instanceof Error?t.message:t))}};let a=t&&setTimeout(()=>{a=null;i(new v3(`timeout ${t} of ms exceeded`,v3.ETIMEDOUT))},t);const o=()=>{if(e){a&&clearTimeout(a);a=null;e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)});e=null}};e.forEach(e=>e.addEventListener("abort",i));const{signal:s}=r;s.unsubscribe=()=>v2.asap(o);return s}};/* ESM default export */const mi=mn;// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/helpers/trackStream.js
const ma=function*(e,t){let r=e.byteLength;if(!t||r<t){yield e;return}let n=0;let i;while(n<r){i=n+t;yield e.slice(n,i);n=i}};const mo=async function*(e,t){for await(const r of ms(e)){yield*ma(r,t)}};const ms=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:e,value:r}=await t.read();if(e){break}yield r}}finally{await t.cancel()}};const ml=(e,t,r,n)=>{const i=mo(e,t);let a=0;let o;let s=e=>{if(!o){o=true;n&&n(e)}};return new ReadableStream({async pull(e){try{const{done:t,value:n}=await i.next();if(t){s();e.close();return}let o=n.byteLength;if(r){let e=a+=o;r(e)}e.enqueue(new Uint8Array(n))}catch(e){s(e);throw e}},cancel(e){s(e);return i.return()}},{highWaterMark:2})};// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/adapters/fetch.js
const mu=typeof fetch==="function"&&typeof Request==="function"&&typeof Response==="function";const mc=mu&&typeof ReadableStream==="function";// used only inside the fetch adapter
const md=mu&&(typeof TextEncoder==="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer()));const mf=(e,...t)=>{try{return!!e(...t)}catch(e){return false}};const mp=mc&&mf(()=>{let e=false;const t=new Request(gA.origin,{body:new ReadableStream,method:"POST",get duplex(){e=true;return"half"}}).headers.has("Content-Type");return e&&!t});const mh=64*1024;const mv=mc&&mf(()=>v2.isReadableStream(new Response("").body));const mg={stream:mv&&(e=>e.body)};mu&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!mg[t]&&(mg[t]=v2.isFunction(e[t])?e=>e[t]():(e,r)=>{throw new v3(`Response type '${t}' is not supported`,v3.ERR_NOT_SUPPORT,r)})})})(new Response);const mm=async e=>{if(e==null){return 0}if(v2.isBlob(e)){return e.size}if(v2.isSpecCompliantForm(e)){const t=new Request(gA.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}if(v2.isArrayBufferView(e)||v2.isArrayBuffer(e)){return e.byteLength}if(v2.isURLSearchParams(e)){e=e+""}if(v2.isString(e)){return(await md(e)).byteLength}};const mb=async(e,t)=>{const r=v2.toFiniteNumber(e.getContentLength());return r==null?mm(t):r};/* ESM default export */const my=mu&&(async e=>{let{url:t,method:r,data:n,signal:i,cancelToken:a,timeout:o,onDownloadProgress:s,onUploadProgress:l,responseType:u,headers:c,withCredentials:d="same-origin",fetchOptions:f}=me(e);u=u?(u+"").toLowerCase():"text";let p=mi([i,a&&a.toAbortSignal()],o);let h;const v=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let g;try{if(l&&mp&&r!=="get"&&r!=="head"&&(g=await mb(c,n))!==0){let e=new Request(t,{method:"POST",body:n,duplex:"half"});let r;if(v2.isFormData(n)&&(r=e.headers.get("content-type"))){c.setContentType(r)}if(e.body){const[t,r]=g1(g,g0(g2(l)));n=ml(e.body,mh,t,r)}}if(!v2.isString(d)){d=d?"include":"omit"}// Cloudflare Workers throws when credentials are defined
// see https://github.com/cloudflare/workerd/issues/902
const i="credentials"in Request.prototype;h=new Request(t,{...f,signal:p,method:r.toUpperCase(),headers:c.normalize().toJSON(),body:n,duplex:"half",credentials:i?d:undefined});let a=await fetch(h,f);const o=mv&&(u==="stream"||u==="response");if(mv&&(s||o&&v)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=a[t]});const t=v2.toFiniteNumber(a.headers.get("content-length"));const[r,n]=s&&g1(t,g0(g2(s),true))||[];a=new Response(ml(a.body,mh,r,()=>{n&&n();v&&v()}),e)}u=u||"text";let m=await mg[v2.findKey(mg,u)||"text"](a,e);!o&&v&&v();return await new Promise((t,r)=>{gG(t,r,{data:m,headers:gU.from(a.headers),status:a.status,statusText:a.statusText,config:e,request:h})})}catch(t){v&&v();if(t&&t.name==="TypeError"&&/Load failed|fetch/i.test(t.message)){throw Object.assign(new v3("Network Error",v3.ERR_NETWORK,e,h),{cause:t.cause||t})}throw v3.from(t,t&&t.code,e,h)}});// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/adapters/adapters.js
const m_={http:v8,xhr:mr,fetch:my};v2.forEach(m_,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){// eslint-disable-next-line no-empty
}Object.defineProperty(e,"adapterName",{value:t})}});const mw=e=>`- ${e}`;const mx=e=>v2.isFunction(e)||e===null||e===false;/* ESM default export */const mA={getAdapter:e=>{e=v2.isArray(e)?e:[e];const{length:t}=e;let r;let n;const i={};for(let a=0;a<t;a++){r=e[a];let t;n=r;if(!mx(r)){n=m_[(t=String(r)).toLowerCase()];if(n===undefined){throw new v3(`Unknown adapter '${t}'`)}}if(n){break}i[t||"#"+a]=n}if(!n){const e=Object.entries(i).map(([e,t])=>`adapter ${e} `+(t===false?"is not supported by the environment":"is not available in the build"));let r=t?e.length>1?"since :\n"+e.map(mw).join("\n"):" "+mw(e[0]):"as no adapter specified";throw new v3(`There is no suitable adapter to dispatch the request `+r,"ERR_NOT_SUPPORT")}return n},adapters:m_};// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/core/dispatchRequest.js
/**
 * Throws a `CanceledError` if cancellation has been requested.
 *
 * @param {Object} config The config that is to be used for the request
 *
 * @returns {void}
 */function mk(e){if(e.cancelToken){e.cancelToken.throwIfRequested()}if(e.signal&&e.signal.aborted){throw new gz(null,e)}}/**
 * Dispatch a request to the server using the configured adapter.
 *
 * @param {object} config The config that is to be used for the request
 *
 * @returns {Promise} The Promise to be fulfilled
 */function mE(e){mk(e);e.headers=gU.from(e.headers);// Transform request data
e.data=gq.call(e,e.transformRequest);if(["post","put","patch"].indexOf(e.method)!==-1){e.headers.setContentType("application/x-www-form-urlencoded",false)}const t=mA.getAdapter(e.adapter||gO.adapter);return t(e).then(function t(t){mk(e);// Transform response data
t.data=gq.call(e,e.transformResponse,t);t.headers=gU.from(t.headers);return t},function t(t){if(!gV(t)){mk(e);// Transform response data
if(t&&t.response){t.response.data=gq.call(e,e.transformResponse,t.response);t.response.headers=gU.from(t.response.headers)}}return Promise.reject(t)})};// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/env/data.js
const mI="1.11.0";// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/helpers/validator.js
const mC={};// eslint-disable-next-line func-names
["object","boolean","number","function","string","symbol"].forEach((e,t)=>{mC[e]=function r(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const mY={};/**
 * Transitional option validator
 *
 * @param {function|boolean?} validator - set to false if the transitional option has been removed
 * @param {string?} version - deprecated version / removed since version
 * @param {string?} message - some message with additional info
 *
 * @returns {function}
 */mC.transitional=function e(e,t,r){function n(e,t){return"[Axios v"+mI+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}// eslint-disable-next-line func-names
return(r,i,a)=>{if(e===false){throw new v3(n(i," has been removed"+(t?" in "+t:"")),v3.ERR_DEPRECATED)}if(t&&!mY[i]){mY[i]=true;// eslint-disable-next-line no-console
console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))}return e?e(r,i,a):true}};mC.spelling=function e(e){return(t,r)=>{// eslint-disable-next-line no-console
console.warn(`${r} is likely a misspelling of ${e}`);return true}};/**
 * Assert object's properties type
 *
 * @param {object} options
 * @param {object} schema
 * @param {boolean?} allowUnknown
 *
 * @returns {object}
 */function mT(e,t,r){if(typeof e!=="object"){throw new v3("options must be an object",v3.ERR_BAD_OPTION_VALUE)}const n=Object.keys(e);let i=n.length;while(i-- >0){const a=n[i];const o=t[a];if(o){const t=e[a];const r=t===undefined||o(t,a,e);if(r!==true){throw new v3("option "+a+" must be "+r,v3.ERR_BAD_OPTION_VALUE)}continue}if(r!==true){throw new v3("Unknown option "+a,v3.ERR_BAD_OPTION)}}}/* ESM default export */const mS={assertOptions:mT,validators:mC};// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/core/Axios.js
const mO=mS.validators;/**
 * Create a new instance of Axios
 *
 * @param {Object} instanceConfig The default config for the instance
 *
 * @return {Axios} A new instance of Axios
 */class mD{constructor(e){this.defaults=e||{};this.interceptors={request:new gf,response:new gf}}/**
   * Dispatch a request
   *
   * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
   * @param {?Object} config
   *
   * @returns {Promise} The Promise to be fulfilled
   */async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;// slice off the Error: ... line
const r=t.stack?t.stack.replace(/^.+\n/,""):"";try{if(!e.stack){e.stack=r;// match without the 2 top stack lines
}else if(r&&!String(e.stack).endsWith(r.replace(/^.+\n.+\n/,""))){e.stack+="\n"+r}}catch(e){// ignore the case where "stack" is an un-writable property
}}throw e}}_request(e,t){/*eslint no-param-reassign:0*/// Allow for axios('example/url'[, config]) a la fetch API
if(typeof e==="string"){t=t||{};t.url=e}else{t=e||{}}t=g7(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:i}=t;if(r!==undefined){mS.assertOptions(r,{silentJSONParsing:mO.transitional(mO.boolean),forcedJSONParsing:mO.transitional(mO.boolean),clarifyTimeoutError:mO.transitional(mO.boolean)},false)}if(n!=null){if(v2.isFunction(n)){t.paramsSerializer={serialize:n}}else{mS.assertOptions(n,{encode:mO.function,serialize:mO.function},true)}}// Set config.allowAbsoluteUrls
if(t.allowAbsoluteUrls!==undefined){// do nothing
}else if(this.defaults.allowAbsoluteUrls!==undefined){t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls}else{t.allowAbsoluteUrls=true}mS.assertOptions(t,{baseUrl:mO.spelling("baseURL"),withXsrfToken:mO.spelling("withXSRFToken")},true);// Set config.method
t.method=(t.method||this.defaults.method||"get").toLowerCase();// Flatten headers
let a=i&&v2.merge(i.common,i[t.method]);i&&v2.forEach(["delete","get","head","post","put","patch","common"],e=>{delete i[e]});t.headers=gU.concat(a,i);// filter out skipped interceptors
const o=[];let s=true;this.interceptors.request.forEach(function e(e){if(typeof e.runWhen==="function"&&e.runWhen(t)===false){return}s=s&&e.synchronous;o.unshift(e.fulfilled,e.rejected)});const l=[];this.interceptors.response.forEach(function e(e){l.push(e.fulfilled,e.rejected)});let u;let c=0;let d;if(!s){const e=[mE.bind(this),undefined];e.unshift(...o);e.push(...l);d=e.length;u=Promise.resolve(t);while(c<d){u=u.then(e[c++],e[c++])}return u}d=o.length;let f=t;c=0;while(c<d){const e=o[c++];const t=o[c++];try{f=e(f)}catch(e){t.call(this,e);break}}try{u=mE.call(this,f)}catch(e){return Promise.reject(e)}c=0;d=l.length;while(c<d){u=u.then(l[c++],l[c++])}return u}getUri(e){e=g7(this.defaults,e);const t=g8(e.baseURL,e.url,e.allowAbsoluteUrls);return gc(t,e.params,e.paramsSerializer)}}// Provide aliases for supported request methods
v2.forEach(["delete","get","head","options"],function e(e){/*eslint func-names:0*/mD.prototype[e]=function(t,r){return this.request(g7(r||{},{method:e,url:t,data:(r||{}).data}))}});v2.forEach(["post","put","patch"],function e(e){/*eslint func-names:0*/function t(t){return function r(r,n,i){return this.request(g7(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}mD.prototype[e]=t();mD.prototype[e+"Form"]=t(true)});/* ESM default export */const mF=mD;// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/cancel/CancelToken.js
/**
 * A `CancelToken` is an object that can be used to request cancellation of an operation.
 *
 * @param {Function} executor The executor function.
 *
 * @returns {CancelToken}
 */class mR{constructor(e){if(typeof e!=="function"){throw new TypeError("executor must be a function.")}let t;this.promise=new Promise(function e(e){t=e});const r=this;// eslint-disable-next-line func-names
this.promise.then(e=>{if(!r._listeners)return;let t=r._listeners.length;while(t-- >0){r._listeners[t](e)}r._listeners=null});// eslint-disable-next-line func-names
this.promise.then=e=>{let t;// eslint-disable-next-line func-names
const n=new Promise(e=>{r.subscribe(e);t=e}).then(e);n.cancel=function e(){r.unsubscribe(t)};return n};e(function e(e,n,i){if(r.reason){// Cancellation has already been requested
return}r.reason=new gz(e,n,i);t(r.reason)})}/**
   * Throws a `CanceledError` if cancellation has been requested.
   */throwIfRequested(){if(this.reason){throw this.reason}}/**
   * Subscribe to the cancel signal
   */subscribe(e){if(this.reason){e(this.reason);return}if(this._listeners){this._listeners.push(e)}else{this._listeners=[e]}}/**
   * Unsubscribe from the cancel signal
   */unsubscribe(e){if(!this._listeners){return}const t=this._listeners.indexOf(e);if(t!==-1){this._listeners.splice(t,1)}}toAbortSignal(){const e=new AbortController;const t=t=>{e.abort(t)};this.subscribe(t);e.signal.unsubscribe=()=>this.unsubscribe(t);return e.signal}/**
   * Returns an object that contains a new `CancelToken` and a function that, when called,
   * cancels the `CancelToken`.
   */static source(){let e;const t=new mR(function t(t){e=t});return{token:t,cancel:e}}}/* ESM default export */const mP=mR;// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/helpers/spread.js
/**
 * Syntactic sugar for invoking a function and expanding an array for arguments.
 *
 * Common use case would be to use `Function.prototype.apply`.
 *
 *  ```js
 *  function f(x, y, z) {}
 *  var args = [1, 2, 3];
 *  f.apply(null, args);
 *  ```
 *
 * With `spread` this example can be re-written.
 *
 *  ```js
 *  spread(function(x, y, z) {})([1, 2, 3]);
 *  ```
 *
 * @param {Function} callback
 *
 * @returns {Function}
 */function mM(e){return function t(t){return e.apply(null,t)}};// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/helpers/isAxiosError.js
/**
 * Determines whether the payload is an error thrown by Axios
 *
 * @param {*} payload The value to test
 *
 * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
 */function mH(e){return v2.isObject(e)&&e.isAxiosError===true};// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/helpers/HttpStatusCode.js
const mN={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(mN).forEach(([e,t])=>{mN[t]=e});/* ESM default export */const mL=mN;// CONCATENATED MODULE: ../tutor/node_modules/axios/lib/axios.js
/**
 * Create an instance of Axios
 *
 * @param {Object} defaultConfig The default config for the instance
 *
 * @returns {Axios} A new instance of Axios
 */function mK(e){const t=new mF(e);const r=h4(mF.prototype.request,t);// Copy axios.prototype to instance
v2.extend(r,mF.prototype,t,{allOwnKeys:true});// Copy context to instance
v2.extend(r,t,null,{allOwnKeys:true});// Factory for creating new instances
r.create=function t(t){return mK(g7(e,t))};return r}// Create the default instance to be exported
const mB=mK(gO);// Expose Axios class to allow class inheritance
mB.Axios=mF;// Expose Cancel & CancelToken
mB.CanceledError=gz;mB.CancelToken=mP;mB.isCancel=gV;mB.VERSION=mI;mB.toFormData=gi;// Expose AxiosError class
mB.AxiosError=v3;// alias for CanceledError for backward compatibility
mB.Cancel=mB.CanceledError;// Expose all/spread
mB.all=function e(e){return Promise.all(e)};mB.spread=mM;// Expose isAxiosError
mB.isAxiosError=mH;// Expose mergeConfig
mB.mergeConfig=g7;mB.AxiosHeaders=gU;mB.formToJSON=e=>gY(v2.isHTMLForm(e)?new FormData(e):e);mB.getAdapter=mA.getAdapter;mB.HttpStatusCode=mL;mB.default=mB;// this module should only have a default export
/* ESM default export */const mj=mB;// EXTERNAL MODULE: ../tutor/node_modules/querystring/index.js
var mU=r(4059);// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/utils/form.ts
var mq=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return Object.keys(e).reduce((r,n)=>{var i=e[n];if(typeof i==="object"&&!isPrimitivesArray(i)&&!isFileOrBlob(i)){return _object_spread({},r,mq(_object_spread({},i),"".concat(t).concat(n,".")))}return _object_spread_props(_object_spread({},r),{["".concat(t).concat(n)]:i})},{})};var mV=(e,t)=>{var r=e;if(r.status===404||r.status===403||r.status===500){return{nonFieldErrors:["Unexpected error!"]}}var n=mq(t);var i=mq(r.data);var{non_field_errors:a}=i,o=_object_without_properties(i,["non_field_errors"]);var s=isStringArray(a)?a:[];for(var l of Object.keys(o)){if(!(l in n)){var u=i[l];if(isStringArray(u)){s.push(...u)}}}return{nonFieldErrors:s.map(translateBeErrorMessage),fieldErrors:Object.keys(i).filter(e=>e in n).reduce((e,t)=>{var r=i[t];if(isStringArray(r)){return _object_spread_props(_object_spread({},e),{[t]:r.map(translateBeErrorMessage)})}return e},{})}};var mW=(e,t,r)=>{if(!isAxiosError(e)||!e.response){throw e}var{fieldErrors:n,nonFieldErrors:i}=mV(e.response,r);if(i===null||i===void 0?void 0:i.length){t.setSubmitError(i[0])}if(n){for(var a of Object.keys(n)){var o=n[a];if(o.length>0){t.setError(a,{message:o[0]})}}}};var mz=(e,t)=>{return r=>_async_to_generator(function*(){e.setSubmitError(undefined);try{yield t(r)}catch(t){mW(t,e,r)}})()};var mG=(e,t)=>{var r=function(t){var r=e[t];if(Array.isArray(r)){r.forEach((e,r)=>{if((0,ej/* .isFileOrBlob */.$X)(e)||(0,eO/* .isString */.Kg)(e)){n.append("".concat(t,"[").concat(r,"]"),e)}else if((0,eO/* .isBoolean */.Lm)(e)||(0,eO/* .isNumber */.Et)(e)){n.append("".concat(t,"[").concat(r,"]"),e.toString())}else if(typeof e==="object"&&e!==null){n.append("".concat(t,"[").concat(r,"]"),JSON.stringify(e))}else{n.append("".concat(t,"[").concat(r,"]"),e)}})}else{if((0,ej/* .isFileOrBlob */.$X)(r)||(0,eO/* .isString */.Kg)(r)){n.append(t,r)}else if((0,eO/* .isBoolean */.Lm)(r)){n.append(t,r.toString())}else if((0,eO/* .isNumber */.Et)(r)){n.append(t,"".concat(r))}else if(typeof r==="object"&&r!==null){n.append(t,JSON.stringify(r))}else{n.append(t,r)}}};var n=new FormData;for(var i of Object.keys(e))r(i);n.append("_method",t.toUpperCase());return n};var mQ=e=>{var t={};for(var r in e){var n=e[r];if(!(0,eO/* .isDefined */.O9)(n)){t[r]="null"}else if((0,eO/* .isBoolean */.Lm)(n)){t[r]=n===true?"true":"false"}else{t[r]=n}}return t};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/utils/api.ts
mj.defaults.paramsSerializer=e=>{return mU.stringify(e)};var m$=mj.create({baseURL:fy/* ["default"].WP_API_BASE_URL */.A.WP_API_BASE_URL});m$.interceptors.request.use(e=>{var t;(t=e).headers||(t.headers={});e.headers["X-WP-Nonce"]=fy/* .tutorConfig.wp_rest_nonce */.P.wp_rest_nonce;if(e.method&&["post","put","patch"].includes(e.method.toLocaleLowerCase())){if(e.data){e.data=mG(e.data,e.method)}if(["put","patch"].includes(e.method.toLowerCase())){e.method="POST"}}if(e.params){e.params=mQ(e.params)}if(e.method&&["get","delete"].includes(e.method.toLowerCase())){e.params=(0,eX._)((0,e$._)({},e.params),{_method:e.method})}return e},e=>{return Promise.reject(e)});m$.interceptors.response.use(e=>{return Promise.resolve(e).then(e=>e)});var mX=mj.create({baseURL:fy/* ["default"].WP_AJAX_BASE_URL */.A.WP_AJAX_BASE_URL});mX.interceptors.request.use(e=>{var t,r;(t=e).headers||(t.headers={});// config.headers['X-WP-Nonce'] = tutorConfig._tutor_nonce;
// We will use REST methods while using but wp ajax only sent via post method.
e.method="POST";if(e.params){e.params=mQ(e.params)}(r=e).data||(r.data={});var n=fy/* .tutorConfig.nonce_key */.P.nonce_key;var i=fy/* .tutorConfig._tutor_nonce */.P._tutor_nonce;e.data=(0,eX._)((0,e$._)({},e.data,e.params),{action:e.url,[n]:i});e.data=mG(e.data,e.method);e.params={};e.url=undefined;return e},e=>Promise.reject(e));mX.interceptors.response.use(e=>Promise.resolve(e).then(e=>e.data));// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/utils/endpoints.ts
var mJ={ADMIN_AJAX:"wp-admin/admin-ajax.php",TAGS:"course-tag",CATEGORIES:"course-category",USERS:"users",USERS_LIST:"tutor_user_list",ORDER_DETAILS:"tutor_order_details",ADMIN_COMMENT:"tutor_order_comment",ORDER_MARK_AS_PAID:"tutor_order_paid",ORDER_REFUND:"tutor_order_refund",ORDER_CANCEL:"tutor_order_cancel",ADD_ORDER_DISCOUNT:"tutor_order_discount",COURSE_LIST:"course_list",BUNDLE_LIST:"tutor_get_bundle_list",CATEGORY_LIST:"category_list",CREATED_COURSE:"tutor_create_course",TUTOR_INSTRUCTOR_SEARCH:"tutor_course_instructor_search",TUTOR_YOUTUBE_VIDEO_DURATION:"tutor_youtube_video_duration",TUTOR_UNLINK_PAGE_BUILDER:"tutor_unlink_page_builder",// AI CONTENT GENERATION
GENERATE_AI_IMAGE:"tutor_pro_generate_image",MAGIC_FILL_AI_IMAGE:"tutor_pro_magic_fill_image",MAGIC_TEXT_GENERATION:"tutor_pro_generate_text_content",MAGIC_AI_MODIFY_CONTENT:"tutor_pro_modify_text_content",USE_AI_GENERATED_IMAGE:"tutor_pro_use_magic_image",OPEN_AI_SAVE_SETTINGS:"tutor_pro_chatgpt_save_settings",GENERATE_COURSE_CONTENT:"tutor_pro_generate_course_content",GENERATE_COURSE_TOPIC_CONTENT:"tutor_pro_generate_course_topic_content",SAVE_AI_GENERATED_COURSE_CONTENT:"tutor_pro_ai_course_create",GENERATE_QUIZ_QUESTIONS:"tutor_pro_generate_quiz_questions",// SUBSCRIPTION
GET_SUBSCRIPTIONS_LIST:"tutor_subscription_plans",SAVE_SUBSCRIPTION:"tutor_subscription_plan_save",DELETE_SUBSCRIPTION:"tutor_subscription_plan_delete",DUPLICATE_SUBSCRIPTION:"tutor_subscription_plan_duplicate",SORT_SUBSCRIPTION:"tutor_subscription_plan_sort",// COURSE
GET_COURSE_DETAILS:"tutor_course_details",UPDATE_COURSE:"tutor_update_course",GET_COURSE_LIST:"tutor_course_list",// WOO COMMERCE PRODUCTS
GET_WC_PRODUCTS:"tutor_get_wc_products",GET_WC_PRODUCT_DETAILS:"tutor_get_wc_product",// QUIZ
GET_QUIZ_DETAILS:"tutor_quiz_details",SAVE_QUIZ:"tutor_quiz_builder_save",QUIZ_IMPORT_DATA:"quiz_import_data",QUIZ_EXPORT_DATA:"quiz_export_data",DELETE_QUIZ:"tutor_quiz_delete",// ZOOM
GET_ZOOM_MEETING_DETAILS:"tutor_zoom_meeting_details",SAVE_ZOOM_MEETING:"tutor_zoom_save_meeting",DELETE_ZOOM_MEETING:"tutor_zoom_delete_meeting",// GOOGLE MEET
GET_GOOGLE_MEET_DETAILS:"tutor_google_meet_meeting_details",SAVE_GOOGLE_MEET:"tutor_google_meet_new_meeting",DELETE_GOOGLE_MEET:"tutor_google_meet_delete",// TOPIC
GET_COURSE_CONTENTS:"tutor_course_contents",SAVE_TOPIC:"tutor_save_topic",DELETE_TOPIC:"tutor_delete_topic",DELETE_TOPIC_CONTENT:"tutor_delete_lesson",UPDATE_COURSE_CONTENT_ORDER:"tutor_update_course_content_order",DUPLICATE_CONTENT:"tutor_duplicate_content",ADD_CONTENT_BANK_CONTENT_TO_COURSE:"tutor_content_bank_add_content_to_course",DELETE_CONTENT_BANK_CONTENT_FROM_COURSE:"tutor_content_bank_remove_content_from_course",// LESSON
GET_LESSON_DETAILS:"tutor_lesson_details",SAVE_LESSON:"tutor_save_lesson",// ASSIGNMENT
GET_ASSIGNMENT_DETAILS:"tutor_assignment_details",SAVE_ASSIGNMENT:"tutor_assignment_save",// TAX SETTINGS
GET_TAX_SETTINGS:"tutor_get_tax_settings",GET_H5P_QUIZ_CONTENT:"tutor_h5p_list_quiz_contents",GET_H5P_LESSON_CONTENT:"tutor_h5p_list_lesson_contents",GET_H5P_QUIZ_CONTENT_BY_ID:"tutor_h5p_quiz_content_by_id",// PAYMENT SETTINGS
GET_PAYMENT_SETTINGS:"tutor_payment_settings",GET_PAYMENT_GATEWAYS:"tutor_payment_gateways",INSTALL_PAYMENT_GATEWAY:"tutor_install_payment_gateway",REMOVE_PAYMENT_GATEWAY:"tutor_remove_payment_gateway",// ADDON LIST
GET_ADDON_LIST:"tutor_get_all_addons",ADDON_ENABLE_DISABLE:"addon_enable_disable",// INSTALL PLUGIN
TUTOR_INSTALL_PLUGIN:"tutor_install_plugin",// COUPON
GET_COUPON_DETAILS:"tutor_coupon_details",CREATE_COUPON:"tutor_coupon_create",UPDATE_COUPON:"tutor_coupon_update",COUPON_APPLIES_TO:"tutor_coupon_applies_to_list",// ENROLLMENT
CREATE_ENROLLMENT:"tutor_enroll_bulk_student",GET_COURSE_BUNDLE_LIST:"tutor_course_bundle_list",GET_UNENROLLED_USERS:"tutor_unenrolled_users",// MEMBERSHIP
GET_MEMBERSHIP_PLANS:"tutor_membership_plans",SAVE_MEMBERSHIP_PLAN:"tutor_membership_plan_save",DUPLICATE_MEMBERSHIP_PLAN:"tutor_membership_plan_duplicate",DELETE_MEMBERSHIP_PLAN:"tutor_membership_plan_delete",// COURSE BUNDLE
GET_BUNDLE_DETAILS:"tutor_get_course_bundle_data",UPDATE_BUNDLE:"tutor_create_course_bundle",ADD_REMOVE_COURSE_TO_BUNDLE:"tutor_add_remove_course_to_bundle",// IMPORT EXPORT
GET_EXPORTABLE_CONTENT:"tutor_pro_exportable_contents",EXPORT_CONTENTS:"tutor_pro_export",EXPORT_SETTINGS_FREE:"tutor_export_settings",IMPORT_CONTENTS:"tutor_pro_import",IMPORT_SETTINGS_FREE:"tutor_import_settings",GET_IMPORT_EXPORT_HISTORY:"tutor_pro_export_import_history",DELETE_IMPORT_EXPORT_HISTORY:"tutor_pro_delete_export_import_history",// CONTENT BANK
GET_CONTENT_BANK_COLLECTIONS:"tutor_content_bank_collections",SAVE_CONTENT_BANK_COLLECTION:"tutor_content_bank_collection_save",DELETE_CONTENT_BANK_COLLECTION:"tutor_content_bank_collection_delete",GET_CONTENT_BANK_CONTENTS:"tutor_content_bank_contents",DELETE_CONTENT_BANK_CONTENTS:"tutor_content_bank_content_delete",GET_CONTENT_DETAILS:"tutor_pro_get_content_details",GET_CONTENT_BANK_LESSON_DETAILS:"tutor_content_bank_lesson_details",GET_CONTENT_BANK_ASSIGNMENT_DETAILS:"tutor_content_bank_assignment_details",SAVE_CONTENT_BANK_LESSON_CONTENT:"tutor_content_bank_lesson_save",SAVE_CONTENT_BANK_ASSIGNMENT_CONTENT:"tutor_content_bank_assignment_save",SAVE_QUESTION_CONTENT:"tutor_content_bank_question_save",GET_CONTENT_BANK_QUESTION_DETAILS:"tutor_content_bank_question_details",DUPLICATE_CONTENT_BANK_CONTENT:"tutor_content_bank_content_duplicate",MOVE_CONTENT_BANK_CONTENT:"tutor_content_bank_content_move",DUPLICATE_CONTENT_BANK_COLLECTION:"tutor_content_bank_collection_duplicate",IMPORT_FROM_COURSES:"tutor_content_bank_content_synchronize"};/* ESM default export */const mZ=mJ;// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/services/magic-ai.ts
var m0=e=>{return mX.post(mZ.GENERATE_AI_IMAGE,e)};var m1=()=>{return h6({mutationFn:m0})};var m2=e=>{return mX.post(mZ.MAGIC_FILL_AI_IMAGE,e).then(e=>e.data.data[0].b64_json)};var m6=()=>{var{showToast:e}=fP();return h6({mutationFn:m2,onError:t=>{e({type:"danger",message:(0,ej/* .convertToErrorMessage */.EL)(t)})}})};var m4=e=>{return mX.post(mZ.MAGIC_TEXT_GENERATION,e)};var m5=()=>{var{showToast:e}=fP();return h6({mutationFn:m4,onError:t=>{e({type:"danger",message:(0,ej/* .convertToErrorMessage */.EL)(t)})}})};var m3=e=>{return mX.post(mZ.MAGIC_AI_MODIFY_CONTENT,e)};var m8=()=>{var{showToast:e}=fP();return h6({mutationFn:m3,onError:t=>{e({type:"danger",message:(0,ej/* .convertToErrorMessage */.EL)(t)})}})};var m9=e=>{return mX.post(mZ.USE_AI_GENERATED_IMAGE,e)};var m7=()=>{var{showToast:e}=fP();return h6({mutationFn:m9,onError:t=>{e({type:"danger",message:(0,ej/* .convertToErrorMessage */.EL)(t)})}})};var be=e=>{return wpAjaxInstance.post(endpoints.GENERATE_COURSE_CONTENT,e,{signal:e.signal})};var bt=e=>{var{showToast:t}=useToast();return useMutation({mutationKey:["GenerateCourseContent",e],mutationFn:be,onError:e=>{t({type:"danger",message:convertToErrorMessage(e)})}})};var br=e=>{return wpAjaxInstance.post(endpoints.GENERATE_COURSE_CONTENT,e,{signal:e.signal})};var bn=()=>{var{showToast:e}=useToast();return useMutation({mutationFn:br,onError:t=>{e({type:"danger",message:convertToErrorMessage(t)})}})};var bi=e=>{return wpAjaxInstance.post(endpoints.GENERATE_COURSE_TOPIC_CONTENT,e,{signal:e.signal})};var ba=()=>{var{showToast:e}=useToast();return useMutation({mutationFn:bi,onError:t=>{e({type:"danger",message:convertToErrorMessage(t)})}})};var bo=e=>{return wpAjaxInstance.post(endpoints.SAVE_AI_GENERATED_COURSE_CONTENT,e)};var bs=()=>{var{showToast:e}=useToast();var t=useQueryClient();return useMutation({mutationFn:bo,onSuccess(){t.invalidateQueries({queryKey:["CourseDetails"]})},onError:t=>{e({type:"danger",message:convertToErrorMessage(t)})}})};var bl=e=>{return wpAjaxInstance.post(endpoints.GENERATE_QUIZ_QUESTIONS,e,{signal:e.signal})};var bu=()=>{var{showToast:e}=useToast();return useMutation({mutationFn:bl,onError:t=>{e({type:"danger",message:convertToErrorMessage(t)})}})};var bc=e=>{return mX.post(mZ.OPEN_AI_SAVE_SETTINGS,(0,e$._)({},e))};var bd=()=>{var{showToast:e}=fP();return h6({mutationFn:bc,onSuccess:t=>{e({type:"success",message:t.message})},onError:t=>{e({type:"danger",message:(0,ej/* .convertToErrorMessage */.EL)(t)})}})};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/modals/AITextModal.tsx
var bf=[(0,em.__)("Mastering Digital Marketing: A Complete Guide","tutor-pro"),(0,em.__)("The Ultimate Photoshop Course for Beginners","tutor-pro"),(0,em.__)("Python Programming: From Zero to Hero","tutor-pro"),(0,em.__)("Creative Writing Essentials: Unlock Your Storytelling Potential","tutor-pro"),(0,em.__)("The Complete Guide to Web Development with React","tutor-pro"),(0,em.__)("Master Public Speaking: Deliver Powerful Presentations","tutor-pro"),(0,em.__)("Excel for Business: From Basics to Advanced Analytics","tutor-pro"),(0,em.__)("Fitness Fundamentals: Build Strength and Confidence","tutor-pro"),(0,em.__)("Photography Made Simple: Capture Stunning Shots","tutor-pro"),(0,em.__)("Financial Freedom: Learn the Basics of Investing","tutor-pro")];var bp=e=>{var{title:r,icon:i,closeModal:a,field:s,format:l="essay",characters:u=250,is_html:c=false,fieldLabel:d="",fieldPlaceholder:f=""}=e;var p=h1({defaultValues:{prompt:"",characters:u,language:"english",tone:"formal",format:l}});var h=m5();var v=m8();var[g,m]=(0,n.useState)([]);var[b,y]=(0,n.useState)(0);var[_,w]=(0,n.useState)(false);var[x,A]=(0,n.useState)(null);var k=(0,n.useRef)(null);var E=(0,n.useRef)(null);var I=(0,n.useMemo)(()=>{return g[b]},[g,b]);var C=p.watch("prompt");function Y(e){m(t=>[e,...t]);y(0)}function T(e,t){return fQ(function*(){if(g.length===0){return}var r=g[b];if(e==="translation"&&!!t){var n=yield v.mutateAsync({type:"translation",content:r,language:t,is_html:c});if(n.data){Y(n.data)}return}if(e==="change_tone"&&!!t){var i=yield v.mutateAsync({type:"change_tone",content:r,tone:t,is_html:c});if(i.data){Y(i.data)}return}var a=yield v.mutateAsync({type:e,content:r,is_html:c});if(a.data){Y(a.data)}})()}(0,n.useEffect)(()=>{p.setFocus("prompt");// eslint-disable-next-line react-hooks/exhaustive-deps
},[]);return/*#__PURE__*/(0,t/* .jsx */.Y)(oR,{onClose:a,title:r,icon:i,maxWidth:524,children:/*#__PURE__*/(0,t/* .jsxs */.FD)("form",{onSubmit:p.handleSubmit(e=>fQ(function*(){var t=yield h.mutateAsync((0,eX._)((0,e$._)({},e),{is_html:c}));if(t.data){Y(t.data)}})()),children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:bv.container,children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:bv.fieldsWrapper,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(py,{control:p.control,name:"prompt",render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(hI,(0,eX._)((0,e$._)({},e),{label:d||(0,em.__)("Craft Your Course Description","tutor-pro"),placeholder:f||(0,em.__)("Provide a brief overview of your course topic, target audience, and key takeaways","tutor-pro"),rows:4,isMagicAi:true}))}),/*#__PURE__*/(0,t/* .jsxs */.FD)("button",{type:"button",css:bv.inspireButton,onClick:()=>{var e=bf.length;var t=Math.floor(Math.random()*e);p.reset((0,eX._)((0,e$._)({},p.getValues()),{prompt:bf[t]}))},children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"bulbLine"}),(0,em.__)("Inspire Me","tutor-pro")]})]}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:!h.isPending&&!v.isPending,fallback:/*#__PURE__*/(0,t/* .jsx */.Y)(hZ,{}),children:/*#__PURE__*/(0,t/* .jsxs */.FD)(ag/* ["default"] */.A,{when:g.length>0,fallback:/*#__PURE__*/(0,t/* .jsx */.Y)(h$,{form:p}),children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:bv.actionBar,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:bv.navigation,children:/*#__PURE__*/(0,t/* .jsxs */.FD)(ag/* ["default"] */.A,{when:g.length>1,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"text",onClick:()=>y(e=>Math.max(0,e-1)),disabled:b===0,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:!aT/* .isRTL */.V8?"chevronLeft":"chevronRight",width:20,height:20})}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:bv.pageInfo,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("span",{children:b+1})," / ",g.length]}),/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"text",onClick:()=>y(e=>Math.min(g.length-1,e+1)),disabled:b===g.length-1,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:!aT/* .isRTL */.V8?"chevronRight":"chevronLeft",width:20,height:20})})]})}),/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"text",onClick:()=>fQ(function*(){if(g.length===0){return}var e=g[b];yield(0,ej/* .copyToClipboard */.lW)(e);w(true);setTimeout(()=>{w(false)},1500)})(),children:/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:_,fallback:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"copy",width:20,height:20}),children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"checkFilled",width:20,height:20,style:/*#__PURE__*/(0,o/* .css */.AH)("color:",ey/* .colorTokens.text.success */.I6.text.success," !important;")})})})]}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:bv.content,dangerouslySetInnerHTML:{__html:I}})]}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:bv.otherActions,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(h_,{variant:"outline",roundedFull:false,onClick:()=>T("rephrase"),children:(0,em.__)("Rephrase","tutor-pro")}),/*#__PURE__*/(0,t/* .jsx */.Y)(h_,{variant:"outline",roundedFull:false,onClick:()=>T("make_shorter"),children:(0,em.__)("Make Shorter","tutor-pro")}),/*#__PURE__*/(0,t/* .jsxs */.FD)(h_,{variant:"outline",roundedFull:false,ref:k,onClick:()=>A("tone"),children:[(0,em.__)("Change Tone","tutor-pro"),/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"chevronDown",width:16,height:16})]}),/*#__PURE__*/(0,t/* .jsxs */.FD)(h_,{variant:"outline",roundedFull:false,ref:E,onClick:()=>A("translate"),children:[(0,em.__)("Translate to","tutor-pro"),/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"chevronDown",width:16,height:16})]}),/*#__PURE__*/(0,t/* .jsx */.Y)(h_,{variant:"outline",roundedFull:false,onClick:()=>T("write_as_bullets"),children:(0,em.__)("Write as Bullets","tutor-pro")}),/*#__PURE__*/(0,t/* .jsx */.Y)(h_,{variant:"outline",roundedFull:false,onClick:()=>T("make_longer"),children:(0,em.__)("Make Longer","tutor-pro")}),/*#__PURE__*/(0,t/* .jsx */.Y)(h_,{variant:"outline",roundedFull:false,onClick:()=>T("simplify_language"),children:(0,em.__)("Simplify Language","tutor-pro")})]})]})})]}),/*#__PURE__*/(0,t/* .jsx */.Y)(a7,{isOpen:x==="tone",triggerRef:k,arrow:true,closePopover:()=>A(null),maxWidth:"160px",animationType:as.slideDown,children:/*#__PURE__*/(0,t/* .jsx */.Y)(hY,{options:hG,onChange:e=>fQ(function*(){A(null);yield T("change_tone",e)})()})}),/*#__PURE__*/(0,t/* .jsx */.Y)(a7,{isOpen:x==="translate",triggerRef:E,closePopover:()=>A(null),maxWidth:"160px",animationType:as.slideDown,children:/*#__PURE__*/(0,t/* .jsx */.Y)(hY,{options:hz,onChange:e=>fQ(function*(){A(null);yield T("translation",e)})()})}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:bv.footer,children:/*#__PURE__*/(0,t/* .jsxs */.FD)(ag/* ["default"] */.A,{when:g.length>0,fallback:/*#__PURE__*/(0,t/* .jsxs */.FD)(h_,{type:"submit",disabled:h.isPending||!C||v.isPending,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"magicWand",width:24,height:24}),(0,em.__)("Generate Now","tutor-pro")]}),children:[/*#__PURE__*/(0,t/* .jsx */.Y)(h_,{variant:"outline",type:"submit",disabled:h.isPending||!C||v.isPending,children:(0,em.__)("Generate Again","tutor-pro")}),/*#__PURE__*/(0,t/* .jsx */.Y)(h_,{variant:"primary",disabled:h.isPending||g.length===0||v.isPending,onClick:()=>{s.onChange(g[b]);a()},children:(0,em.__)("Use This","tutor-pro")})]})})]})})};/* ESM default export */const bh=bp;var bv={container:/*#__PURE__*/(0,o/* .css */.AH)("padding:",ey/* .spacing["20"] */.YK["20"],";display:flex;flex-direction:column;gap:",ey/* .spacing["16"] */.YK["16"],";"),fieldsWrapper:/*#__PURE__*/(0,o/* .css */.AH)("position:relative;textarea{padding-bottom:",ey/* .spacing["40"] */.YK["40"]," !important;}"),footer:/*#__PURE__*/(0,o/* .css */.AH)("padding:",ey/* .spacing["12"] */.YK["12"]," ",ey/* .spacing["16"] */.YK["16"],";display:flex;align-items:center;justify-content:end;gap:",ey/* .spacing["10"] */.YK["10"],";box-shadow:0px 1px 0px 0px #e4e5e7 inset;button{width:fit-content;}"),pageInfo:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.caption */.I.caption(),";color:",ey/* .colorTokens.text.hints */.I6.text.hints,";& > span{font-weight:",ey/* .fontWeight.medium */.Wy.medium,";color:",ey/* .colorTokens.text.primary */.I6.text.primary,";}"),inspireButton:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.resetButton */.x.resetButton,";",eK/* .typography.small */.I.small(),";position:absolute;height:28px;bottom:",ey/* .spacing["12"] */.YK["12"],";left:",ey/* .spacing["12"] */.YK["12"],";border:1px solid ",ey/* .colorTokens.stroke.brand */.I6.stroke.brand,";border-radius:",ey/* .borderRadius["4"] */.Vq["4"],";display:flex;align-items:center;gap:",ey/* .spacing["4"] */.YK["4"],";color:",ey/* .colorTokens.text.brand */.I6.text.brand,";padding-inline:",ey/* .spacing["12"] */.YK["12"],";background-color:",ey/* .colorTokens.background.white */.I6.background.white,";&:hover{background-color:",ey/* .colorTokens.background.brand */.I6.background.brand,";color:",ey/* .colorTokens.text.white */.I6.text.white,";}&:focus-visible{outline:2px solid ",ey/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:1px;}&:disabled{background-color:",ey/* .colorTokens.background.disable */.I6.background.disable,";color:",ey/* .colorTokens.text.disable */.I6.text.disable,";}"),navigation:/*#__PURE__*/(0,o/* .css */.AH)("margin-left:-",ey/* .spacing["8"] */.YK["8"],";display:flex;align-items:center;"),content:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.caption */.I.caption(),";height:180px;overflow-y:auto;background-color:",ey/* .colorTokens.background.magicAi["default"] */.I6.background.magicAi["default"],";border-radius:",ey/* .borderRadius["6"] */.Vq["6"],";padding:",ey/* .spacing["6"] */.YK["6"]," ",ey/* .spacing["12"] */.YK["12"],";color:",ey/* .colorTokens.text.magicAi */.I6.text.magicAi,";"),actionBar:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;align-items:center;justify-content:space-between;"),otherActions:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;gap:",ey/* .spacing["10"] */.YK["10"],";flex-wrap:wrap;& > button{width:fit-content;}")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/modals/ProIdentifierModal.tsx
var bg={title:/*#__PURE__*/(0,t/* .jsxs */.FD)(t/* .Fragment */.FK,{children:[(0,em.__)("Upgrade to Tutor LMS Pro today and experience the power of ","tutor-pro"),/*#__PURE__*/(0,t/* .jsx */.Y)("span",{css:eB/* .styleUtils.aiGradientText */.x.aiGradientText,children:(0,em.__)("AI Studio","tutor-pro")})]}),message:(0,em.__)("Upgrade your plan to access the AI feature","tutor-pro"),featuresTitle:(0,em.__)("Don’t miss out on this game-changing feature!","tutor-pro"),features:[(0,em.__)("Generate a complete course outline in seconds!","tutor-pro"),(0,em.__)("Let the AI Studio create Quizzes on your behalf and give your brain a well-deserved break.","tutor-pro"),(0,em.__)("Generate images, customize backgrounds, and even remove unwanted objects with ease.","tutor-pro"),(0,em.__)("Say goodbye to typos and grammar errors with AI-powered copy editing.","tutor-pro")],footer:/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{onClick:()=>window.open(fy/* ["default"].TUTOR_PRICING_PAGE */.A.TUTOR_PRICING_PAGE,"_blank","noopener"),icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"crown",width:24,height:24}),children:(0,em.__)("Get Tutor LMS Pro","tutor-pro")})};var bm=e=>{var{title:r=bg.title,message:n=bg.message,featuresTitle:i=bg.featuresTitle,features:a=bg.features,closeModal:o,image:s,image2x:l,footer:u=bg.footer}=e;return/*#__PURE__*/(0,t/* .jsx */.Y)(oR,{onClose:o,entireHeader:/*#__PURE__*/(0,t/* .jsx */.Y)("span",{css:by.message,children:n}),maxWidth:496,children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:by.wrapper,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:r,children:/*#__PURE__*/(0,t/* .jsx */.Y)("h4",{css:by.title,children:r})}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:s,children:/*#__PURE__*/(0,t/* .jsx */.Y)("img",{css:by.image,src:s,alt:typeof r==="string"?r:(0,em.__)("Illustration","tutor-pro"),srcSet:l?"".concat(s," ").concat(l," 2x"):undefined})}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:i,children:/*#__PURE__*/(0,t/* .jsx */.Y)("h6",{css:by.featuresTiTle,children:i})}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:a.length,children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:by.features,children:/*#__PURE__*/(0,t/* .jsx */.Y)(fb,{each:a,children:(e,r)=>/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:by.feature,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"materialCheck",width:20,height:20,style:by.checkIcon}),/*#__PURE__*/(0,t/* .jsx */.Y)("span",{children:e})]},r)})})}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:u,children:u})]})})};/* ESM default export */const bb=bm;var by={wrapper:/*#__PURE__*/(0,o/* .css */.AH)("padding:0 ",ey/* .spacing["24"] */.YK["24"]," ",ey/* .spacing["32"] */.YK["32"]," ",ey/* .spacing["24"] */.YK["24"],";",eB/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",ey/* .spacing["16"] */.YK["16"],";"),message:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.small */.I.small(),";color:",ey/* .colorTokens.text.subdued */.I6.text.subdued,";padding-left:",ey/* .spacing["8"] */.YK["8"],";padding-top:",ey/* .spacing["24"] */.YK["24"],";padding-bottom:",ey/* .spacing["4"] */.YK["4"],";"),title:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.heading6 */.I.heading6("medium"),";color:",ey/* .colorTokens.text.primary */.I6.text.primary,";text-wrap:pretty;"),image:/*#__PURE__*/(0,o/* .css */.AH)("height:270px;width:100%;object-fit:cover;object-position:center;border-radius:",ey/* .borderRadius["8"] */.Vq["8"],";"),featuresTiTle:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.body */.I.body("medium"),";color:",ey/* .colorTokens.text.primary */.I6.text.primary,";text-wrap:pretty;"),features:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",ey/* .spacing["4"] */.YK["4"],";padding-right:",ey/* .spacing["48"] */.YK["48"],";"),feature:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),";gap:",ey/* .spacing["12"] */.YK["12"],";",eK/* .typography.small */.I.small(),";color:",ey/* .colorTokens.text.title */.I6.text.title,";span{text-wrap:pretty;}"),checkIcon:/*#__PURE__*/(0,o/* .css */.AH)("flex-shrink:0;color:",ey/* .colorTokens.text.success */.I6.text.success,";")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/atoms/Alert.tsx
var b_={text:{warning:"#D47E00",success:"#D47E00",danger:"#f44337",info:"#D47E00",primary:"#D47E00"},icon:{warning:"#FAB000",success:"#FAB000",danger:"#f55e53",info:"#FAB000",primary:"#FAB000"},background:{warning:"#FBFAE9",success:"#FBFAE9",danger:"#fdd9d7",info:"#FBFAE9",primary:"#FBFAE9"}};var bw=e=>{var{children:r,type:n="warning",icon:i}=e;return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:bA.wrapper({type:n}),children:[/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:i,children:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{style:bA.icon({type:n}),name:e,height:24,width:24})}),/*#__PURE__*/(0,t/* .jsx */.Y)("span",{children:r})]})};/* ESM default export */const bx=bw;var bA={wrapper:e=>{var{type:t}=e;return/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.caption */.I.caption(),";display:flex;align-items:start;padding:",ey/* .spacing["8"] */.YK["8"]," ",ey/* .spacing["12"] */.YK["12"],";width:100%;border-radius:",ey/* .borderRadius.card */.Vq.card,";gap:",ey/* .spacing["4"] */.YK["4"],";background-color:",b_.background[t],";color:",b_.text[t],";")},icon:e=>{var{type:t}=e;return/*#__PURE__*/(0,o/* .css */.AH)("color:",b_.icon[t],";flex-shrink:0;")}};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/atoms/Switch.tsx
function bk(){var e=(0,eS._)(["\n        width: 26px;\n        height: 16px;\n      "]);bk=function t(){return e};return e}function bE(){var e=(0,eS._)(["\n          top: 2px;\n          left: 3px;\n          width: 12px;\n          height: 12px;\n        "]);bE=function t(){return e};return e}function bI(){var e=(0,eS._)(["\n            left: 11px;\n          "]);bI=function t(){return e};return e}function bC(){var e=(0,eS._)(["\n      right: 3px;\n    "]);bC=function t(){return e};return e}function bY(){var e=(0,eS._)(["\n      left: 3px;\n    "]);bY=function t(){return e};return e}var bT={switchStyles:e=>/*#__PURE__*/(0,o/* .css */.AH)("&[data-input]{all:unset;appearance:none;border:0;width:40px;height:24px;background:",ey/* .colorTokens.color.black["10"] */.I6.color.black["10"],";border-radius:12px;position:relative;display:inline-block;vertical-align:middle;cursor:pointer;transition:background-color 0.25s cubic-bezier(0.785,0.135,0.15,0.86);",e==="small"&&(0,o/* .css */.AH)(bk()),"      &::before{display:none !important;}&:focus{border:none;outline:none;box-shadow:none;}&:focus-visible{outline:2px solid ",ey/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:1px;}&:after{content:'';position:absolute;top:3px;left:",ey/* .spacing["4"] */.YK["4"],";width:18px;height:18px;background:",ey/* .colorTokens.background.white */.I6.background.white,";border-radius:",ey/* .borderRadius.circle */.Vq.circle,";box-shadow:",ey/* .shadow["switch"] */.r7["switch"],";transition:left 0.25s cubic-bezier(0.785,0.135,0.15,0.86);",e==="small"&&(0,o/* .css */.AH)(bE()),"}&:checked{background:",ey/* .colorTokens.primary.main */.I6.primary.main,";&:after{left:18px;",e==="small"&&(0,o/* .css */.AH)(bI()),"}}&:disabled{pointer-events:none;filter:none;opacity:0.5;}}"),labelStyles:e=>/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.caption */.I.caption(),";color:",e?ey/* .colorTokens.text.title */.I6.text.title:ey/* .colorTokens.text.subdued */.I6.text.subdued,";"),wrapperStyle:e=>/*#__PURE__*/(0,o/* .css */.AH)("display:flex;align-items:center;justify-content:space-between;width:fit-content;flex-direction:",e==="left"?"row":"row-reverse",";column-gap:",ey/* .spacing["12"] */.YK["12"],";position:relative;"),spinner:e=>/*#__PURE__*/(0,o/* .css */.AH)("display:flex;position:absolute;top:50%;transform:translateY(-50%);",e&&(0,o/* .css */.AH)(bC())," ",!e&&(0,o/* .css */.AH)(bY()))};var bS=/*#__PURE__*/i().forwardRef((e,r)=>{var{id:n=(0,ej/* .nanoid */.Ak)(),name:i,label:a,value:o,checked:s,disabled:l,loading:u,onChange:c,labelPosition:d="left",labelCss:f,size:p="regular"}=e;var h=e=>{c===null||c===void 0?void 0:c(e.target.checked,e)};return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:bT.wrapperStyle(d),children:[a&&/*#__PURE__*/(0,t/* .jsx */.Y)("label",{css:[bT.labelStyles(s||false),f],htmlFor:n,children:a}),/*#__PURE__*/(0,t/* .jsx */.Y)("input",{ref:r,value:o?String(o):undefined,type:"checkbox",name:i,id:n,checked:!!s,disabled:l,css:bT.switchStyles(p),onChange:h,"data-input":true}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:u,children:/*#__PURE__*/(0,t/* .jsx */.Y)("span",{css:bT.spinner(!!s),children:/*#__PURE__*/(0,t/* .jsx */.Y)(eT,{size:p==="small"?12:20})})})]})});/* ESM default export */const bO=bS;// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/fields/FormSwitch.tsx
var bD=e=>{var{field:r,fieldState:n,label:i,disabled:a,loading:o,labelPosition:s="left",helpText:l,isHidden:u,labelCss:c,onChange:d}=e;return/*#__PURE__*/(0,t/* .jsx */.Y)(fv,{label:i,field:r,fieldState:n,loading:o,helpText:l,isHidden:u,isInlineLabel:true,children:e=>{return/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:bR.wrapper,children:/*#__PURE__*/(0,t/* .jsx */.Y)(bO,(0,eX._)((0,e$._)({},r,e),{disabled:a,checked:r.value,labelCss:c,labelPosition:s,onChange:()=>{r.onChange(!r.value);d===null||d===void 0?void 0:d(!r.value)}}))})}})};/* ESM default export */const bF=fx(bD);var bR={wrapper:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;align-items:center;justify-content:space-between;gap:",ey/* .spacing["40"] */.YK["40"],";")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/utils/validation.ts
var bP=()=>({required:{value:true,message:(0,em.__)("This field is required","tutor-pro")}});var bM=e=>{var{maxValue:t,message:r}=e;return{maxLength:{value:t,message:r||__("Max. value should be ".concat(t),"tutor-pro")}}};var bH=()=>({validate:e=>{if((e===null||e===void 0?void 0:e.amount)===undefined){return __("The field is required","tutor-pro")}return undefined}});var bN=e=>{if(!isValid(new Date(e||""))){return __("Invalid date entered!","tutor-pro")}return undefined};var bL=e=>({validate:t=>{if(t&&e<t.length){return(0,em.__)("Maximum ".concat(e," character supported"),"tutor-pro")}return undefined}});var bK=e=>{if(!e){return undefined}var t=__("Invalid time entered!","tutor-pro");var[r,n]=e.split(":");if(!r||!n){return t}var[i,a]=n.split(" ");if(!i||!a){return t}if(r.length!==2||i.length!==2){return t}if(Number(r)<1||Number(r)>12){return t}if(Number(i)<0||Number(i)>59){return t}if(!["am","pm"].includes(a.toLowerCase())){return t}return undefined};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/modals/SetupOpenAiModal.tsx
function bB(){var e=(0,eS._)(["\n      padding: ",";\n      padding-top: ",";\n    "]);bB=function t(){return e};return e}var bj,bU;var bq=((bj=fy/* .tutorConfig.settings */.P.settings)===null||bj===void 0?void 0:bj.chatgpt_enable)==="on";var bV=(bU=fy/* .tutorConfig.current_user.roles */.P.current_user.roles)===null||bU===void 0?void 0:bU.includes(aT/* .TutorRoles.ADMINISTRATOR */.gt.ADMINISTRATOR);var bW=e=>{var{closeModal:r,image:i,image2x:a}=e;var o=h1({defaultValues:{openAIApiKey:"",enable_open_ai:bq},shouldFocusError:true});var s=bd();var l=e=>fQ(function*(){var t=yield s.mutateAsync({chatgpt_api_key:e.openAIApiKey,chatgpt_enable:e.enable_open_ai?1:0});if(t.status_code===200){r({action:"CONFIRM"});window.location.reload()}})();(0,n.useEffect)(()=>{o.setFocus("openAIApiKey");// eslint-disable-next-line react-hooks/exhaustive-deps
},[]);return/*#__PURE__*/(0,t/* .jsx */.Y)(oR,{onClose:()=>r({action:"CLOSE"}),title:bV?(0,em.__)("Set OpenAI API key","tutor-pro"):undefined,entireHeader:bV?undefined:/*#__PURE__*/(0,t/* .jsx */.Y)(t/* .Fragment */.FK,{children:" "}),maxWidth:560,children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:bG.wrapper({isCurrentUserAdmin:bV}),children:/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:bV,fallback:/*#__PURE__*/(0,t/* .jsxs */.FD)(t/* .Fragment */.FK,{children:[/*#__PURE__*/(0,t/* .jsx */.Y)("img",{css:bG.image,src:i,srcSet:a?"".concat(i," 1x, ").concat(a," 2x"):"".concat(i," 1x"),alt:(0,em.__)("Connect API KEY","tutor-pro")}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:bG.message,children:(0,em.__)("API is not connected","tutor-pro")}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:bG.title,children:(0,em.__)("Please, ask your Admin to connect the API with Tutor LMS Pro.","tutor-pro")})]})]}),children:/*#__PURE__*/(0,t/* .jsxs */.FD)(t/* .Fragment */.FK,{children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("form",{css:bG.formWrapper,onSubmit:o.handleSubmit(l),children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:bG.infoText,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{dangerouslySetInnerHTML:{/* translators: %1$s and %2$s are opening and closing anchor tags for the "OpenAI User settings" link */__html:(0,em.sprintf)((0,em.__)("Find your Secret API key in your %1$sOpenAI User settings%2$s and paste it here to connect OpenAI with your Tutor LMS website.","tutor-pro"),'<a href="'.concat(fy/* ["default"].CHATGPT_PLATFORM_URL */.A.CHATGPT_PLATFORM_URL,'" target="_blank" rel="noopener noreferrer">'),"</a>")}}),/*#__PURE__*/(0,t/* .jsx */.Y)(bx,{type:"info",icon:"warning",children:(0,em.__)("The page will reload after submission. Make sure to save the course information.","tutor-pro")})]}),/*#__PURE__*/(0,t/* .jsx */.Y)(py,{name:"openAIApiKey",control:o.control,rules:bP(),render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(b2,(0,eX._)((0,e$._)({},e),{type:"password",isPassword:true,label:(0,em.__)("OpenAI API key","tutor-pro"),placeholder:(0,em.__)("Enter your OpenAI API key","tutor-pro")}))}),/*#__PURE__*/(0,t/* .jsx */.Y)(py,{name:"enable_open_ai",control:o.control,render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(bF,(0,eX._)((0,e$._)({},e),{label:(0,em.__)("Enable OpenAI","tutor-pro")}))})]}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:bG.formFooter,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{onClick:()=>r({action:"CLOSE"}),variant:"text",size:"small",children:(0,em.__)("Cancel","tutor-pro")}),/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{size:"small",onClick:o.handleSubmit(l),loading:s.isPending,children:(0,em.__)("Save","tutor-pro")})]})]})})})})};/* ESM default export */const bz=bW;var bG={wrapper:e=>{var{isCurrentUserAdmin:t}=e;return/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",ey/* .spacing["20"] */.YK["20"],";",!t&&(0,o/* .css */.AH)(bB(),ey/* .spacing["24"] */.YK["24"],ey/* .spacing["6"] */.YK["6"]))},formWrapper:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",ey/* .spacing["20"] */.YK["20"],";padding:",ey/* .spacing["16"] */.YK["16"]," ",ey/* .spacing["16"] */.YK["16"]," 0 ",ey/* .spacing["16"] */.YK["16"],";"),infoText:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.small */.I.small(),";",eB/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",ey/* .spacing["8"] */.YK["8"],";color:",ey/* .colorTokens.text.subdued */.I6.text.subdued,";a{",eB/* .styleUtils.resetButton */.x.resetButton,"      color:",ey/* .colorTokens.text.brand */.I6.text.brand,";}"),formFooter:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),";justify-content:flex-end;gap:",ey/* .spacing["16"] */.YK["16"],";border-top:1px solid ",ey/* .colorTokens.stroke.divider */.I6.stroke.divider,";padding:",ey/* .spacing["16"] */.YK["16"],";"),image:/*#__PURE__*/(0,o/* .css */.AH)("height:310px;width:100%;object-fit:cover;object-position:center;border-radius:",ey/* .borderRadius["8"] */.Vq["8"],";"),message:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.small */.I.small(),";color:",ey/* .colorTokens.text.subdued */.I6.text.subdued,";"),title:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.heading4 */.I.heading4("medium"),";color:",ey/* .colorTokens.text.primary */.I6.text.primary,";margin-top:",ey/* .spacing["4"] */.YK["4"],";text-wrap:pretty;")};// CONCATENATED MODULE: ../tutor/assets/react/v3/public/images/pro-placeholders/generate-text-2x.webp
const bQ=r.p+"images/generate-text-2x-45983f4c.webp";// CONCATENATED MODULE: ../tutor/assets/react/v3/public/images/pro-placeholders/generate-text.webp
const b$=r.p+"images/generate-text-269f7e17.webp";// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/fields/FormInput.tsx
function bX(){var e=(0,eS._)(["\n      svg {\n        color: ",";\n      }\n    "]);bX=function t(){return e};return e}var bJ;var bZ=!!fy/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var b0=(bJ=fy/* .tutorConfig.settings */.P.settings)===null||bJ===void 0?void 0:bJ.chatgpt_key_exist;var b1=e=>{var{label:r,type:i="text",maxLimit:a,field:o,fieldState:s,disabled:l,readOnly:u,loading:c,placeholder:d,helpText:f,onChange:p,onKeyDown:h,isHidden:v,isClearable:g=false,isSecondary:m=false,removeBorder:b,dataAttribute:y,isInlineLabel:_=false,isPassword:w=false,style:x,selectOnFocus:A=false,autoFocus:k=false,generateWithAi:E=false,isMagicAi:I=false,allowNegative:C=false,onClickAiButton:Y}=e;var[T,S]=(0,n.useState)(i);var{showModal:O}=ah();var D=(0,n.useRef)(null);var F;var R=(F=o.value)!==null&&F!==void 0?F:"";var P=undefined;if(T==="number"){R=(0,ej/* .parseNumberOnly */.TW)("".concat(R),C).replace(/(\..*)\./g,"$1")}if(a){P={maxLimit:a,inputCharacter:R.toString().length}}var M=(0,e$._)({},(0,eO/* .isDefined */.O9)(y)&&{[y]:true});var H=()=>{if(!bZ){O({component:bb,props:{image:b$,image2x:bQ}})}else if(!b0){O({component:bz,props:{image:b$,image2x:bQ}})}else{O({component:bh,isMagicAi:true,props:{title:(0,em.__)("AI Studio","tutor-pro"),icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"magicAiColorize",width:24,height:24}),characters:120,field:o,fieldState:s,format:"title",is_html:false,fieldLabel:(0,em.__)("Create a Compelling Title","tutor-pro"),fieldPlaceholder:(0,em.__)("Describe the main focus of your course in a few words","tutor-pro")}});Y===null||Y===void 0?void 0:Y()}};return/*#__PURE__*/(0,t/* .jsx */.Y)(fv,{label:r,field:o,fieldState:s,disabled:l,readOnly:u,loading:c,placeholder:d,helpText:f,isHidden:v,characterCount:P,isSecondary:m,removeBorder:b,isInlineLabel:_,inputStyle:x,generateWithAi:E,onClickAiButton:H,isMagicAi:I,children:e=>{return/*#__PURE__*/(0,t/* .jsx */.Y)(t/* .Fragment */.FK,{children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:b6.container(g||w),children:[/*#__PURE__*/(0,t/* .jsx */.Y)("input",(0,eX._)((0,e$._)({},o,e,M),{type:T==="number"?"text":T,value:R,autoFocus:k,onChange:e=>{var{value:t}=e.target;var r=T==="number"?(0,ej/* .parseNumberOnly */.TW)(t):t;o.onChange(r);if(p){p(r)}},onClick:e=>{e.stopPropagation()},onKeyDown:e=>{e.stopPropagation();h===null||h===void 0?void 0:h(e.key)},autoComplete:"off",ref:e=>{o.ref(e);// @ts-ignore
D.current=e;// this is not ideal but it is the only way to set ref to the input element
},onFocus:()=>{if(!A||!D.current){return}D.current.select()}})),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:w,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{isIconOnly:true,variant:"text",size:"small",onClick:()=>S(e=>e==="password"?"text":"password"),icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"eye",width:24,height:24}),"aria-label":(0,em.__)("Show/Hide Password","tutor-pro"),buttonCss:b6.eyeButton({type:T})})}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:g&&!!o.value&&T!=="password",children:/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{isIconOnly:true,variant:"text",size:"small",onClick:()=>o.onChange(""),buttonCss:eB/* .styleUtils.inputClearButton */.x.inputClearButton,icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"cross",width:24,height:24}),"aria-label":(0,em.__)("Clear","tutor-pro")})})]})})}})};/* ESM default export */const b2=fx(b1);var b6={container:e=>/*#__PURE__*/(0,o/* .css */.AH)("position:relative;display:flex;input{&.tutor-input-field{",e&&"padding-right: ".concat(ey/* .spacing["36"] */.YK["36"],";"),";}}"),eyeButton:e=>{var{type:t}=e;return/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.inputClearButton */.x.inputClearButton,";",t!=="password"&&(0,o/* .css */.AH)(bX(),ey/* .colorTokens.icon.brand */.I6.icon.brand))}};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/fields/FormInputWithContent.tsx
function b4(){var e=(0,eS._)(["\n      border: 1px solid ",";\n      border-radius: ",";\n      box-shadow: ",";\n      background-color: ",";\n    "]);b4=function t(){return e};return e}function b5(){var e=(0,eS._)(["\n      border-color: ",";\n      background-color: ",";\n    "]);b5=function t(){return e};return e}function b3(){var e=(0,eS._)(["\n        border-color: ",";\n      "]);b3=function t(){return e};return e}function b8(){var e=(0,eS._)(["\n          padding-",": ",";\n        "]);b8=function t(){return e};return e}function b9(){var e=(0,eS._)(["\n            padding-",": ",";\n          "]);b9=function t(){return e};return e}function b7(){var e=(0,eS._)(["\n          font-size: ",";\n          font-weight: ",";\n          height: 34px;\n          ",";\n        "]);b7=function t(){return e};return e}function ye(){var e=(0,eS._)(["\n      ","\n    "]);ye=function t(){return e};return e}function yt(){var e=(0,eS._)(["\n      border-right: 1px solid ",";\n    "]);yt=function t(){return e};return e}function yr(){var e=(0,eS._)(["\n      ","\n    "]);yr=function t(){return e};return e}function yn(){var e=(0,eS._)(["\n      border-left: 1px solid ",";\n    "]);yn=function t(){return e};return e}var yi=e=>{var{label:r,content:i,contentPosition:a="left",showVerticalBar:o=true,size:s="regular",type:l="text",field:u,fieldState:c,disabled:d,readOnly:f,loading:p,placeholder:h,helpText:v,onChange:g,onKeyDown:m,isHidden:b,wrapperCss:y,contentCss:_,removeBorder:w=false,selectOnFocus:x=false}=e;var A=(0,n.useRef)(null);return/*#__PURE__*/(0,t/* .jsx */.Y)(fv,{label:r,field:u,fieldState:c,disabled:d,readOnly:f,loading:p,placeholder:h,helpText:v,isHidden:b,removeBorder:w,children:e=>{var{css:r}=e,n=(0,eJ._)(e,["css"]);var d;return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:[yo.inputWrapper(!!c.error,w),y],children:[a==="left"&&/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:[yo.inputLeftContent(o,s),_],children:i}),/*#__PURE__*/(0,t/* .jsx */.Y)("input",(0,eX._)((0,e$._)({},u,n),{type:"text",value:(d=u.value)!==null&&d!==void 0?d:"",onChange:e=>{var t=l==="number"?e.target.value.replace(/[^0-9.]/g,"").replace(/(\..*)\./g,"$1"):e.target.value;u.onChange(t);if(g){g(t)}},onKeyDown:e=>m===null||m===void 0?void 0:m(e.key),css:[r,yo.input(a,o,s)],autoComplete:"off",ref:e=>{u.ref(e);// @ts-ignore
A.current=e;// this is not ideal but it is the only way to set ref to the input element
},onFocus:()=>{if(!x||!A.current){return}A.current.select()},"data-input":true})),a==="right"&&/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:[yo.inputRightContent(o,s),_],children:i})]})}})};/* ESM default export */const ya=fx(yi);var yo={inputWrapper:(e,t)=>/*#__PURE__*/(0,o/* .css */.AH)("display:flex;align-items:center;",!t&&(0,o/* .css */.AH)(b4(),ey/* .colorTokens.stroke["default"] */.I6.stroke["default"],ey/* .borderRadius["6"] */.Vq["6"],ey/* .shadow.input */.r7.input,ey/* .colorTokens.background.white */.I6.background.white)," ",e&&(0,o/* .css */.AH)(b5(),ey/* .colorTokens.stroke.danger */.I6.stroke.danger,ey/* .colorTokens.background.status.errorFail */.I6.background.status.errorFail),";&:focus-within{",eB/* .styleUtils.inputFocus */.x.inputFocus,";",e&&(0,o/* .css */.AH)(b3(),ey/* .colorTokens.stroke.danger */.I6.stroke.danger),"}"),input:(e,t,r)=>/*#__PURE__*/(0,o/* .css */.AH)("&[data-input]{",eK/* .typography.body */.I.body(),";border:none;box-shadow:none;background-color:transparent;padding-",e,":0;",t&&(0,o/* .css */.AH)(b8(),e,ey/* .spacing["10"] */.YK["10"]),";",r==="large"&&(0,o/* .css */.AH)(b7(),ey/* .fontSize["24"] */.J["24"],ey/* .fontWeight.medium */.Wy.medium,t&&(0,o/* .css */.AH)(b9(),e,ey/* .spacing["12"] */.YK["12"])),"  \n      &:focus{box-shadow:none;outline:none;}}"),inputLeftContent:(e,t)=>/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.small */.I.small()," ",eB/* .styleUtils.flexCenter */.x.flexCenter(),"    height:40px;min-width:48px;color:",ey/* .colorTokens.icon.subdued */.I6.icon.subdued,";padding-inline:",ey/* .spacing["12"] */.YK["12"],";",t==="large"&&(0,o/* .css */.AH)(ye(),eK/* .typography.body */.I.body())," ",e&&(0,o/* .css */.AH)(yt(),ey/* .colorTokens.stroke["default"] */.I6.stroke["default"])),inputRightContent:(e,t)=>/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.small */.I.small()," ",eB/* .styleUtils.flexCenter */.x.flexCenter(),"    height:40px;min-width:48px;color:",ey/* .colorTokens.icon.subdued */.I6.icon.subdued,";padding-inline:",ey/* .spacing["12"] */.YK["12"],";",t==="large"&&(0,o/* .css */.AH)(yr(),eK/* .typography.body */.I.body())," ",e&&(0,o/* .css */.AH)(yn(),ey/* .colorTokens.stroke["default"] */.I6.stroke["default"]))};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/atoms/WPEditor.tsx
function ys(){var e=(0,eS._)(["\n        ","\n      "]);ys=function t(){return e};return e}function yl(){var e=(0,eS._)(["\n        border-top-right-radius: ",";\n      "]);yl=function t(){return e};return e}function yu(){var e=(0,eS._)(["\n          ","\n        "]);yu=function t(){return e};return e}function yc(){var e=(0,eS._)(["\n      .mce-tinymce.mce-container {\n        border: ",";\n        border-radius: ",";\n\n        ","\n      }\n    "]);yc=function t(){return e};return e}var yd=!!fy/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;// Without getDefaultSettings function editor does not initiate
if(!window.wp.editor.getDefaultSettings){window.wp.editor.getDefaultSettings=()=>({})}function yf(e,t,r,n,i,a,o,s,l,u,c,d,f){var p=d!==null&&d!==void 0?d:n?"bold italic underline | image | ".concat(yd?"codesample":""):"formatselect bold italic underline | bullist numlist | blockquote | alignleft aligncenter alignright | link unlink | wp_more ".concat(yd?" codesample":""," | wp_adv");var h=f!==null&&f!==void 0?f:"strikethrough hr | forecolor pastetext removeformat | charmap | outdent indent | undo redo | wp_help | fullscreen | tutor_button | undoRedoDropdown";p=c?p:p.replaceAll(" | "," ");return{tinymce:{wpautop:true,menubar:false,autoresize_min_height:l||200,autoresize_max_height:u||500,wp_autoresize_on:true,browser_spellcheck:!s,convert_urls:false,end_container_on_empty_block:true,entities:"38,amp,60,lt,62,gt",entity_encoding:"raw",fix_list_elements:true,indent:false,relative_urls:0,remove_script_host:0,plugins:"charmap,colorpicker,hr,lists,image,media,paste,tabfocus,textcolor,fullscreen,اكاديمية الغيث التعليمية,wpautoresize,wpeditimage,wpemoji,wpgallery,wplink,wpdialogs,wptextpattern,wpview".concat(yd?",codesample":""),skin:"light",skin_url:"".concat(fy/* .tutorConfig.site_url */.P.site_url,"/wp-content/plugins/tutor/assets/lib/tinymce/light"),submit_patch:true,link_context_toolbar:false,theme:"modern",toolbar:!s,toolbar1:p,toolbar2:n?false:h,content_css:"".concat(fy/* .tutorConfig.site_url */.P.site_url,"/wp-includes/css/dashicons.min.css,").concat(fy/* .tutorConfig.site_url */.P.site_url,"/wp-includes/js/tinymce/skins/اكاديمية الغيث التعليمية/wp-content.css,").concat(fy/* .tutorConfig.site_url */.P.site_url,"/wp-content/plugins/tutor/assets/lib/tinymce/light/content.min.css"),statusbar:!s,branding:false,// eslint-disable-next-line @typescript-eslint/no-explicit-any
setup:i=>{i.on("init",()=>{if(e&&!s){i.getBody().focus()}if(s){i.setMode("readonly");var t=i.contentDocument.querySelector(".mce-content-body");t.style.backgroundColor="transparent";setTimeout(()=>{var e=t.scrollHeight;if(e){i.iframeElement.style.height="".concat(e,"px")}},500)}});if(!n){i.addButton("tutor_button",{text:(0,em.__)("Tutor ShortCode","tutor-pro"),icon:false,type:"menubutton",menu:[{text:(0,em.__)("Student Registration Form","tutor-pro"),onclick:()=>{i.insertContent("[tutor_student_registration_form]")}},{text:(0,em.__)("Instructor Registration Form","tutor-pro"),onclick:()=>{i.insertContent("[tutor_instructor_registration_form]")}},{text:(0,em.__)("Courses","tutor-pro"),onclick:()=>{i.windowManager.open({title:(0,em.__)("Courses Shortcode","tutor-pro"),body:[{type:"textbox",name:"id",label:(0,em.__)("Course id, separate by (,) comma","tutor-pro"),value:""},{type:"textbox",name:"exclude_ids",label:(0,em.__)("Exclude Course IDS","tutor-pro"),value:""},{type:"textbox",name:"category",label:(0,em.__)("Category IDS","tutor-pro"),value:""},{type:"listbox",name:"orderby",label:(0,em.__)("Order By","tutor-pro"),onselect:()=>{},values:[{text:"ID",value:"ID"},{text:"title",value:"title"},{text:"rand",value:"rand"},{text:"date",value:"date"},{text:"menu_order",value:"menu_order"},{text:"post__in",value:"post__in"}]},{type:"listbox",name:"order",label:(0,em.__)("Order","tutor-pro"),onselect:()=>{},values:[{text:"DESC",value:"DESC"},{text:"ASC",value:"ASC"}]},{type:"textbox",name:"count",label:(0,em.__)("Count","tutor-pro"),value:"6"}],// eslint-disable-next-line @typescript-eslint/no-explicit-any
onsubmit:e=>{i.insertContent('[tutor_course id="'.concat(e.data.id,'" exclude_ids="').concat(e.data.exclude_ids,'" category="').concat(e.data.category,'" orderby="').concat(e.data.orderby,'" order="').concat(e.data.order,'" count="').concat(e.data.count,'"]'))}})}}]})}i.on("change keyup paste",()=>{t(i.getContent())});i.on("focus",()=>{r(true)});i.on("blur",()=>r(false));i.on("FullscreenStateChanged",e=>{var t=document.getElementById("tutor-course-builder");var r=document.getElementById("tutor-course-bundle-builder-root");var n=t||r;if(n){if(e.state){n.style.position="relative";n.style.zIndex="100000"}else{n.removeAttribute("style")}}o===null||o===void 0?void 0:o(e.state)})},wp_keep_scroll_position:false,wpeditimage_html5_captions:true},mediaButtons:!i&&!n&&!s,drag_drop_upload:true,quicktags:a||n||s?false:{buttons:["strong","em","block","del","ins","img","ul","ol","li","code","more","close"]}}}var yp=e=>{var{value:r="",onChange:i,isMinimal:a,hideMediaButtons:o,hideQuickTags:s,autoFocus:l=false,onFullScreenChange:u,readonly:c=false,min_height:d,max_height:f,toolbar1:p,toolbar2:h}=e;var v=(0,n.useRef)(null);var{current:g}=(0,n.useRef)((0,ej/* .nanoid */.Ak)());var[m,b]=(0,n.useState)(l);var y=e=>{var t=e.target;i(t.value)};var _=(0,n.useCallback)(e=>{var{tinymce:t}=window;if(!t||m){return}var r=window.tinymce.get(g);if(r){if(e!==r.getContent()){r.setContent(e)}}},[g,m]);(0,n.useEffect)(()=>{_(r);// eslint-disable-next-line react-hooks/exhaustive-deps
},[r]);(0,n.useEffect)(()=>{if(typeof window.wp!=="undefined"&&window.wp.editor){window.wp.editor.remove(g);window.wp.editor.initialize(g,yf(m,i,b,a,o,s,u,c,d,f,aT/* .CURRENT_VIEWPORT.isAboveMobile */.vN.isAboveMobile,p,h));var e=v.current;e===null||e===void 0?void 0:e.addEventListener("change",y);e===null||e===void 0?void 0:e.addEventListener("input",y);return()=>{window.wp.editor.remove(g);e===null||e===void 0?void 0:e.removeEventListener("change",y);e===null||e===void 0?void 0:e.removeEventListener("input",y)}}// eslint-disable-next-line react-hooks/exhaustive-deps
},[c]);return/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:yv.wrapper({hideQuickTags:s,isMinimal:a,isFocused:m,isReadOnly:c}),children:/*#__PURE__*/(0,t/* .jsx */.Y)("textarea",{"data-cy":"tutor-tinymce",ref:v,id:g,defaultValue:r})})};/* ESM default export */const yh=yp;var yv={wrapper:e=>{var{hideQuickTags:t,isMinimal:r,isFocused:n,isReadOnly:i}=e;return/*#__PURE__*/(0,o/* .css */.AH)("flex:1;.wp-editor-tools{z-index:auto;}.wp-editor-container{border-top-left-radius:",ey/* .borderRadius["6"] */.Vq["6"],";border-bottom-left-radius:",ey/* .borderRadius["6"] */.Vq["6"],";border-bottom-right-radius:",ey/* .borderRadius["6"] */.Vq["6"],";",n&&!i&&(0,o/* .css */.AH)(ys(),eB/* .styleUtils.inputFocus */.x.inputFocus),":focus-within{",!i&&eB/* .styleUtils.inputFocus */.x.inputFocus,"}}.wp-switch-editor{height:auto;border:1px solid #dcdcde;border-radius:0px;border-top-left-radius:",ey/* .borderRadius["4"] */.Vq["4"],";border-top-right-radius:",ey/* .borderRadius["4"] */.Vq["4"],";top:2px;padding:3px 8px 4px;font-size:13px;color:#646970;&:focus,&:active,&:hover{background:#f0f0f1;color:#646970;}}.mce-btn button{&:focus,&:active,&:hover{background:none;color:#50575e;}}.mce-toolbar-grp,.quicktags-toolbar{border-top-left-radius:",ey/* .borderRadius["6"] */.Vq["6"],";",(t||r)&&(0,o/* .css */.AH)(yl(),ey/* .borderRadius["6"] */.Vq["6"]),"}.mce-top-part::before{display:none;}.mce-statusbar{border-bottom-left-radius:",ey/* .borderRadius["6"] */.Vq["6"],";border-bottom-right-radius:",ey/* .borderRadius["6"] */.Vq["6"],";}.mce-tinymce{box-shadow:none;background-color:transparent;}.mce-edit-area{background-color:unset;}",(t||r)&&(0,o/* .css */.AH)(yc(),!i?"1px solid ".concat(ey/* .colorTokens.stroke["default"] */.I6.stroke["default"]):"none",ey/* .borderRadius["6"] */.Vq["6"],n&&!i&&(0,o/* .css */.AH)(yu(),eB/* .styleUtils.inputFocus */.x.inputFocus)),"    textarea{visibility:visible !important;width:100%;resize:none;border:none;outline:none;padding:",ey/* .spacing["10"] */.YK["10"],";}")}};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/fields/FormWPEditor.tsx
function yg(){var e=(0,eS._)(["\n      overflow: hidden;\n      border-radius: ",";\n    "]);yg=function t(){return e};return e}var ym;var yb={droip:"droipColorized",elementor:"elementorColorized",gutenberg:"gutenbergColorized",divi:"diviColorized"};var yy=!!fy/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var y_=(ym=fy/* .tutorConfig.settings */.P.settings)===null||ym===void 0?void 0:ym.chatgpt_key_exist;var yw=e=>{var{editorUsed:r,onBackToWPEditorClick:i,onCustomEditorButtonClick:a}=e;var{showModal:o}=ah();var[s,l]=(0,n.useState)("");return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:yk.editorOverlay,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:r.name!=="gutenberg",children:/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"tertiary",size:"small",buttonCss:yk.editWithButton,icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"arrowLeft",height:24,width:24}),loading:s==="back_to",onClick:()=>fQ(function*(){var{action:e}=yield o({component:oH,props:{title:(0,em.__)("Back to اكاديمية الغيث التعليمية Editor","tutor-pro"),description:/*#__PURE__*/(0,t/* .jsx */.Y)(bx,{type:"warning",icon:"warning",children:(0,em.__)("Warning: Switching to the اكاديمية الغيث التعليمية default editor may cause issues with your current layout, design, and content.","tutor-pro")}),confirmButtonText:(0,em.__)("Confirm","tutor-pro"),confirmButtonVariant:"primary"},depthIndex:ey/* .zIndex.highest */.fE.highest});if(e==="CONFIRM"){try{l("back_to");yield i===null||i===void 0?void 0:i(r.name)}finally{l("")}}})(),children:(0,em.__)("Back to اكاديمية الغيث التعليمية Editor","tutor-pro")})}),/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"tertiary",size:"small",buttonCss:yk.editWithButton,loading:s==="edit_with",icon:yb[r.name]&&/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:yb[r.name],height:24,width:24}),onClick:()=>fQ(function*(){try{l("edit_with");yield a===null||a===void 0?void 0:a(r);window.location.href=r.link}finally{l("")}})(),children:/* translators: %s is the editor name */(0,em.sprintf)((0,em.__)("Edit with %s","tutor-pro"),r===null||r===void 0?void 0:r.label)})]})};var yx=e=>{var{label:r,field:i,fieldState:a,disabled:o,readOnly:s,loading:l,placeholder:u,helpText:c,onChange:d,generateWithAi:f=false,onClickAiButton:p,hasCustomEditorSupport:h=false,isMinimal:v=false,hideMediaButtons:g=false,hideQuickTags:m=false,editors:b=[],editorUsed:y={name:"classic",label:"Classic Editor",link:""},isMagicAi:_=false,autoFocus:w=false,onCustomEditorButtonClick:x,onBackToWPEditorClick:A,onFullScreenChange:k,min_height:E,max_height:I,toolbar1:C,toolbar2:Y}=e;var T,S,O,D,F;var{showModal:R}=ah();var P=((T=fy/* .tutorConfig.settings */.P.settings)===null||T===void 0?void 0:T.hide_admin_bar_for_users)==="off";var M=(O=fy/* .tutorConfig.current_user */.P.current_user)===null||O===void 0?void 0:(S=O.roles)===null||S===void 0?void 0:S.includes(aT/* .TutorRoles.ADMINISTRATOR */.gt.ADMINISTRATOR);var H=(F=fy/* .tutorConfig.current_user */.P.current_user)===null||F===void 0?void 0:(D=F.roles)===null||D===void 0?void 0:D.includes(aT/* .TutorRoles.TUTOR_INSTRUCTOR */.gt.TUTOR_INSTRUCTOR);var[N,L]=(0,n.useState)(null);var K=b.filter(e=>M||H&&P||e.name==="droip");var B=h&&K.length>0;var j=B&&y.name!=="classic";var U=()=>{if(!yy){R({component:bb,props:{image:b$,image2x:bQ}})}else if(!y_){R({component:bz,props:{image:b$,image2x:bQ}})}else{R({component:bh,isMagicAi:true,props:{title:(0,em.__)("AI Studio","tutor-pro"),icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"magicAiColorize",width:24,height:24}),characters:1e3,field:i,fieldState:a,is_html:true}});p===null||p===void 0?void 0:p()}};var q=/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:yk.editorLabel,children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("span",{css:yk.labelWithAi,children:[r,/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:f,children:/*#__PURE__*/(0,t/* .jsx */.Y)("button",{type:"button",css:yk.aiButton,onClick:U,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"magicAiColorize",width:32,height:32})})})]}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:yk.editorsButtonWrapper,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("span",{children:(0,em.__)("Edit with","tutor-pro")}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:yk.customEditorButtons,children:/*#__PURE__*/(0,t/* .jsx */.Y)(fb,{each:K,children:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(d9,{content:e.label,delay:200,children:/*#__PURE__*/(0,t/* .jsxs */.FD)("button",{type:"button",css:yk.customEditorButton,disabled:N===e.name,onClick:()=>fQ(function*(){try{L(e.name);yield x===null||x===void 0?void 0:x(e);window.location.href=e.link}finally{L(null)}})(),children:[/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:N===e.name,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eE,{})}),/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:yb[e.name],height:24,width:24})]})},e.name)})})]})]});return/*#__PURE__*/(0,t/* .jsx */.Y)(fv,{label:B?q:r,field:i,fieldState:a,disabled:o,readOnly:s,placeholder:u,helpText:c,isMagicAi:_,generateWithAi:!B&&f,onClickAiButton:U,replaceEntireLabel:B,children:()=>{if(l){return/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:eB/* .styleUtils.flexCenter */.x.flexCenter(),children:/*#__PURE__*/(0,t/* .jsx */.Y)(eT,{size:20,color:ey/* .colorTokens.icon["default"] */.I6.icon["default"]})})}var e;return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:yk.wrapper({isOverlayVisible:j}),children:[/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:j,children:/*#__PURE__*/(0,t/* .jsx */.Y)(yw,{editorUsed:y,onBackToWPEditorClick:A,onCustomEditorButtonClick:x})}),/*#__PURE__*/(0,t/* .jsx */.Y)(yh,{value:(e=i.value)!==null&&e!==void 0?e:"",onChange:e=>{i.onChange(e);if(d){d(e)}},isMinimal:v,hideMediaButtons:g,hideQuickTags:m,autoFocus:w,onFullScreenChange:k,readonly:s,min_height:E,max_height:I,toolbar1:C,toolbar2:Y})]})}})};/* ESM default export */const yA=yx;var yk={wrapper:e=>{var{isOverlayVisible:t=false}=e;return/*#__PURE__*/(0,o/* .css */.AH)("position:relative;",t&&(0,o/* .css */.AH)(yg(),ey/* .borderRadius["6"] */.Vq["6"]))},editorLabel:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;width:100%;align-items:center;justify-content:space-between;"),aiButton:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.resetButton */.x.resetButton,";",eB/* .styleUtils.flexCenter */.x.flexCenter(),";width:32px;height:32px;border-radius:",ey/* .borderRadius["4"] */.Vq["4"],";:disabled{cursor:not-allowed;}&:focus-visible{outline:2px solid ",ey/* .colorTokens.stroke.brand */.I6.stroke.brand,";}"),labelWithAi:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;align-items:center;gap:",ey/* .spacing["4"] */.YK["4"],";"),editorsButtonWrapper:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;align-items:center;gap:",ey/* .spacing["8"] */.YK["8"],";color:",ey/* .colorTokens.text.hints */.I6.text.hints,";"),customEditorButtons:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;align-items:center;gap:",ey/* .spacing["4"] */.YK["4"],";"),customEditorButton:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.resetButton */.x.resetButton,"    display:flex;align-items:center;justify-content:center;position:relative;border-radius:",ey/* .borderRadius.circle */.Vq.circle,";&:focus-visible{outline:2px solid ",ey/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:1px;}"),editorOverlay:/*#__PURE__*/(0,o/* .css */.AH)("position:absolute;height:100%;width:100%;",eB/* .styleUtils.flexCenter */.x.flexCenter(),";gap:",ey/* .spacing["8"] */.YK["8"],";background-color:",oZ()(ey/* .colorTokens.background.modal */.I6.background.modal,.6),";border-radius:",ey/* .borderRadius["6"] */.Vq["6"],";z-index:",ey/* .zIndex.positive */.fE.positive,";backdrop-filter:blur(8px);"),editWithButton:/*#__PURE__*/(0,o/* .css */.AH)("background:",ey/* .colorTokens.action.secondary["default"] */.I6.action.secondary["default"],";color:",ey/* .colorTokens.text.primary */.I6.text.primary,";box-shadow:inset 0 -1px 0 0 ",oZ()("#1112133D",.24),",0 1px 0 0 ",oZ()("#1112133D",.8),";")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/modals/ModalWrapper.tsx
var yE=e=>{var{children:r,onClose:n,title:i,subtitle:a,icon:o,headerChildren:s,entireHeader:l,actions:u,maxWidth:c=1218,blurTriggerElement:d=true}=e;aB();return/*#__PURE__*/(0,t/* .jsx */.Y)(aO,{blurPrevious:d,children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:yC.container({maxWidth:c}),children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:yC.header({hasHeaderChildren:!!s}),children:/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:l,fallback:/*#__PURE__*/(0,t/* .jsxs */.FD)(t/* .Fragment */.FK,{children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:yC.headerContent,children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:yC.iconWithTitle,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:o,children:o}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:i,children:/*#__PURE__*/(0,t/* .jsx */.Y)("h6",{css:yC.title,title:typeof i==="string"?i:"",children:i})})]}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:a,children:/*#__PURE__*/(0,t/* .jsx */.Y)("span",{css:yC.subtitle,children:a})})]}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:yC.headerChildren,children:/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:s,children:s})}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:yC.actionsWrapper,children:/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:u,fallback:/*#__PURE__*/(0,t/* .jsx */.Y)("button",{type:"button",css:yC.closeButton,onClick:n,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"times",width:14,height:14})}),children:u})})]}),children:l})}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:yC.content,children:/*#__PURE__*/(0,t/* .jsx */.Y)(oT,{children:r})})]})})};/* ESM default export */const yI=yE;var yC={container:e=>{var{maxWidth:t}=e;return/*#__PURE__*/(0,o/* .css */.AH)("position:relative;background:",ey/* .colorTokens.background.white */.I6.background.white,";margin:",aT/* .modal.MARGIN_TOP */.yl.MARGIN_TOP,"px auto ",ey/* .spacing["24"] */.YK["24"],";height:100%;max-width:",t,"px;box-shadow:",ey/* .shadow.modal */.r7.modal,";border-radius:",ey/* .borderRadius["10"] */.Vq["10"],";overflow:hidden;bottom:0;z-index:",ey/* .zIndex.modal */.fE.modal,";width:100%;",ey/* .Breakpoint.smallTablet */.EA.smallTablet,"{width:90%;}")},header:e=>{var{hasHeaderChildren:t}=e;return/*#__PURE__*/(0,o/* .css */.AH)("display:grid;grid-template-columns:",t?"1fr auto 1fr":"1fr auto auto",";gap:",ey/* .spacing["8"] */.YK["8"],";align-items:center;width:100%;height:",aT/* .modal.HEADER_HEIGHT */.yl.HEADER_HEIGHT,"px;background:",ey/* .colorTokens.background.white */.I6.background.white,";border-bottom:1px solid ",ey/* .colorTokens.stroke.divider */.I6.stroke.divider,";position:sticky;")},headerContent:/*#__PURE__*/(0,o/* .css */.AH)("place-self:center start;display:inline-flex;align-items:center;gap:",ey/* .spacing["12"] */.YK["12"],";padding-left:",ey/* .spacing["24"] */.YK["24"],";",ey/* .Breakpoint.smallMobile */.EA.smallMobile,"{padding-left:",ey/* .spacing["16"] */.YK["16"],";}"),headerChildren:/*#__PURE__*/(0,o/* .css */.AH)("place-self:center center;"),iconWithTitle:/*#__PURE__*/(0,o/* .css */.AH)("display:inline-flex;align-items:center;gap:",ey/* .spacing["4"] */.YK["4"],";flex-shrink:0;color:",ey/* .colorTokens.icon["default"] */.I6.icon["default"],";"),title:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.heading6 */.I.heading6("medium"),";color:",ey/* .colorTokens.text.title */.I6.text.title,";text-transform:none;letter-spacing:normal;"),subtitle:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.text.ellipsis */.x.text.ellipsis(1)," ",eK/* .typography.caption */.I.caption(),";color:",ey/* .colorTokens.text.hints */.I6.text.hints,";padding-left:",ey/* .spacing["12"] */.YK["12"],";border-left:1px solid ",ey/* .colorTokens.icon.hints */.I6.icon.hints,";"),actionsWrapper:/*#__PURE__*/(0,o/* .css */.AH)("place-self:center end;display:inline-flex;gap:",ey/* .spacing["16"] */.YK["16"],";padding-right:",ey/* .spacing["24"] */.YK["24"],";",ey/* .Breakpoint.smallMobile */.EA.smallMobile,"{padding-right:",ey/* .spacing["16"] */.YK["16"],";}"),closeButton:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.resetButton */.x.resetButton,";display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:",ey/* .borderRadius.circle */.Vq.circle,";background:",ey/* .colorTokens.background.white */.I6.background.white,";&:focus,&:active,&:hover{background:",ey/* .colorTokens.background.white */.I6.background.white,";}svg{color:",ey/* .colorTokens.icon["default"] */.I6.icon["default"],";transition:color 0.3s ease-in-out;}:hover{svg{color:",ey/* .colorTokens.icon.hover */.I6.icon.hover,";}}:focus{box-shadow:",ey/* .shadow.focus */.r7.focus,";}"),content:/*#__PURE__*/(0,o/* .css */.AH)("height:calc(100% - ",aT/* .modal.HEADER_HEIGHT */.yl.HEADER_HEIGHT+aT/* .modal.MARGIN_TOP */.yl.MARGIN_TOP,"px);background-color:",ey/* .colorTokens.surface.courseBuilder */.I6.surface.courseBuilder,";overflow-x:hidden;",eB/* .styleUtils.overflowYAuto */.x.overflowYAuto)};// CONCATENATED MODULE: ./node_modules/@tanstack/query-core/build/modern/queryObserver.js
// src/queryObserver.ts
var yY=class extends P{constructor(e,t){super();this.options=t;this.#l=e;this.#S=null;this.#O=K();if(!this.options.experimental_prefetchInRender){this.#O.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))}this.bindMethods();this.setOptions(t)}#l;#D=void 0;#F=void 0;#E=void 0;#R;#P;#O;#S;#M;#H;// This property keeps track of the last query with defined data.
// It will be used to pass the previous data and query to the placeholder function between renders.
#N;#L;#K;#B;#j=/* @__PURE__ */new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){if(this.listeners.size===1){this.#D.addObserver(this);if(yS(this.#D,this.options)){this.#U()}else{this.updateResult()}this.#q()}}onUnsubscribe(){if(!this.hasListeners()){this.destroy()}}shouldFetchOnReconnect(){return yO(this.#D,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return yO(this.#D,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=/* @__PURE__ */new Set;this.#V();this.#W();this.#D.removeObserver(this)}setOptions(e){const t=this.options;const r=this.#D;this.options=this.#l.defaultQueryOptions(e);if(this.options.enabled!==void 0&&typeof this.options.enabled!=="boolean"&&typeof this.options.enabled!=="function"&&typeof p(this.options.enabled,this.#D)!=="boolean"){throw new Error("Expected enabled to be a boolean or a callback that returns a boolean")}this.#z();this.#D.setOptions(this.options);if(t._defaulted&&!_(this.options,t)){this.#l.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#D,observer:this})}const n=this.hasListeners();if(n&&yD(this.#D,r,this.options,t)){this.#U()}this.updateResult();if(n&&(this.#D!==r||p(this.options.enabled,this.#D)!==p(t.enabled,this.#D)||f(this.options.staleTime,this.#D)!==f(t.staleTime,this.#D))){this.#G()}const i=this.#Q();if(n&&(this.#D!==r||p(this.options.enabled,this.#D)!==p(t.enabled,this.#D)||i!==this.#B)){this.#$(i)}}getOptimisticResult(e){const t=this.#l.getQueryCache().build(this.#l,e);const r=this.createResult(t,e);if(yR(this,r)){this.#E=r;this.#P=this.options;this.#R=this.#D.state}return r}getCurrentResult(){return this.#E}trackResult(e,t){return new Proxy(e,{get:(e,r)=>{this.trackProp(r);t?.(r);return Reflect.get(e,r)}})}trackProp(e){this.#j.add(e)}getCurrentQuery(){return this.#D}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#l.defaultQueryOptions(e);const r=this.#l.getQueryCache().build(this.#l,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#U({...e,cancelRefetch:e.cancelRefetch??true}).then(()=>{this.updateResult();return this.#E})}#U(e){this.#z();let t=this.#D.fetch(this.options,e);if(!e?.throwOnError){t=t.catch(l)}return t}#G(){this.#V();const e=f(this.options.staleTime,this.#D);if(s||this.#E.isStale||!c(e)){return}const t=d(this.#E.dataUpdatedAt,e);const r=t+1;this.#L=setTimeout(()=>{if(!this.#E.isStale){this.updateResult()}},r)}#Q(){return(typeof this.options.refetchInterval==="function"?this.options.refetchInterval(this.#D):this.options.refetchInterval)??false}#$(e){this.#W();this.#B=e;if(s||p(this.options.enabled,this.#D)===false||!c(this.#B)||this.#B===0){return}this.#K=setInterval(()=>{if(this.options.refetchIntervalInBackground||H.isFocused()){this.#U()}},this.#B)}#q(){this.#G();this.#$(this.#Q())}#V(){if(this.#L){clearTimeout(this.#L);this.#L=void 0}}#W(){if(this.#K){clearInterval(this.#K);this.#K=void 0}}createResult(e,t){const r=this.#D;const n=this.options;const i=this.#E;const a=this.#R;const o=this.#P;const s=e!==r;const l=s?e.state:this.#F;const{state:u}=e;let c={...u};let d=false;let f;if(t._optimisticResults){const i=this.hasListeners();const a=!i&&yS(e,t);const o=i&&yD(e,r,t,n);if(a||o){c={...c,...Q(u.data,e.options)}}if(t._optimisticResults==="isRestoring"){c.fetchStatus="idle"}}let{error:h,errorUpdatedAt:v,status:g}=c;f=c.data;let m=false;if(t.placeholderData!==void 0&&f===void 0&&g==="pending"){let e;if(i?.isPlaceholderData&&t.placeholderData===o?.placeholderData){e=i.data;m=true}else{e=typeof t.placeholderData==="function"?t.placeholderData(this.#N?.state.data,this.#N):t.placeholderData}if(e!==void 0){g="success";f=E(i?.data,e,t);d=true}}if(t.select&&f!==void 0&&!m){if(i&&f===a?.data&&t.select===this.#M){f=this.#H}else{try{this.#M=t.select;f=t.select(f);f=E(i?.data,f,t);this.#H=f;this.#S=null}catch(e){this.#S=e}}}if(this.#S){h=this.#S;f=this.#H;v=Date.now();g="error"}const b=c.fetchStatus==="fetching";const y=g==="pending";const _=g==="error";const w=y&&b;const x=f!==void 0;const A={status:g,fetchStatus:c.fetchStatus,isPending:y,isSuccess:g==="success",isError:_,isInitialLoading:w,isLoading:w,data:f,dataUpdatedAt:c.dataUpdatedAt,error:h,errorUpdatedAt:v,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>l.dataUpdateCount||c.errorUpdateCount>l.errorUpdateCount,isFetching:b,isRefetching:b&&!y,isLoadingError:_&&!x,isPaused:c.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:_&&x,isStale:yF(e,t),refetch:this.refetch,promise:this.#O,isEnabled:p(t.enabled,e)!==false};const k=A;if(this.options.experimental_prefetchInRender){const t=e=>{if(k.status==="error"){e.reject(k.error)}else if(k.data!==void 0){e.resolve(k.data)}};const n=()=>{const e=this.#O=k.promise=K();t(e)};const i=this.#O;switch(i.status){case"pending":if(e.queryHash===r.queryHash){t(i)}break;case"fulfilled":if(k.status==="error"||k.data!==i.value){n()}break;case"rejected":if(k.status!=="error"||k.error!==i.reason){n()}break}}return k}updateResult(){const e=this.#E;const t=this.createResult(this.#D,this.options);this.#R=this.#D.state;this.#P=this.options;if(this.#R.data!==void 0){this.#N=this.#D}if(_(t,e)){return}this.#E=t;const r=()=>{if(!e){return true}const{notifyOnChangeProps:t}=this.options;const r=typeof t==="function"?t():t;if(r==="all"||!r&&!this.#j.size){return true}const n=new Set(r??this.#j);if(this.options.throwOnError){n.add("error")}return Object.keys(this.#E).some(t=>{const r=t;const i=this.#E[r]!==e[r];return i&&n.has(r)})};this.#T({listeners:r()})}#z(){const e=this.#l.getQueryCache().build(this.#l,this.options);if(e===this.#D){return}const t=this.#D;this.#D=e;this.#F=e.state;if(this.hasListeners()){t?.removeObserver(this);e.addObserver(this)}}onQueryUpdate(){this.updateResult();if(this.hasListeners()){this.#q()}}#T(e){R.batch(()=>{if(e.listeners){this.listeners.forEach(e=>{e(this.#E)})}this.#l.getQueryCache().notify({query:this.#D,type:"observerResultsUpdated"})})}};function yT(e,t){return p(t.enabled,e)!==false&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===false)}function yS(e,t){return yT(e,t)||e.state.data!==void 0&&yO(e,t,t.refetchOnMount)}function yO(e,t,r){if(p(t.enabled,e)!==false&&f(t.staleTime,e)!=="static"){const n=typeof r==="function"?r(e):r;return n==="always"||n!==false&&yF(e,t)}return false}function yD(e,t,r,n){return(e!==t||p(n.enabled,e)===false)&&(!r.suspense||e.state.status!=="error")&&yF(e,r)}function yF(e,t){return p(t.enabled,e)!==false&&e.isStaleByTime(f(t.staleTime,e))}function yR(e,t){if(!_(e.getCurrentResult(),t)){return true}return false}//# sourceMappingURL=queryObserver.js.map
;// CONCATENATED MODULE: ./node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.js
"use client";// src/QueryErrorResetBoundary.tsx
function yP(){let e=false;return{clearReset:()=>{e=false},reset:()=>{e=true},isReset:()=>{return e}}}var yM=n.createContext(yP());var yH=()=>n.useContext(yM);var yN=({children:e})=>{const[t]=React.useState(()=>yP());return /* @__PURE__ */jsx(yM.Provider,{value:t,children:typeof e==="function"?e(t):e})};//# sourceMappingURL=QueryErrorResetBoundary.js.map
;// CONCATENATED MODULE: ./node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.js
"use client";// src/errorBoundaryUtils.ts
var yL=(e,t)=>{if(e.suspense||e.throwOnError||e.experimental_prefetchInRender){if(!t.isReset()){e.retryOnMount=false}}};var yK=e=>{n.useEffect(()=>{e.clearReset()},[e])};var yB=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:i})=>{return e.isError&&!t.isReset()&&!e.isFetching&&n&&(i&&e.data===void 0||O(r,[e.error,n]))};//# sourceMappingURL=errorBoundaryUtils.js.map
;// CONCATENATED MODULE: ./node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.js
"use client";// src/IsRestoringProvider.ts
var yj=n.createContext(false);var yU=()=>n.useContext(yj);var yq=yj.Provider;//# sourceMappingURL=IsRestoringProvider.js.map
;// CONCATENATED MODULE: ./node_modules/@tanstack/react-query/build/legacy/suspense.js
// src/suspense.ts
var yV=(e,t)=>t.state.data===void 0;var yW=e=>{if(e.suspense){const t=e=>e==="static"?e:Math.max(e??1e3,1e3);const r=e.staleTime;e.staleTime=typeof r==="function"?(...e)=>t(r(...e)):t(r);if(typeof e.gcTime==="number"){e.gcTime=Math.max(e.gcTime,1e3)}}};var yz=(e,t)=>e.isLoading&&e.isFetching&&!t;var yG=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending;var yQ=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});//# sourceMappingURL=suspense.js.map
;// CONCATENATED MODULE: ./node_modules/@tanstack/react-query/build/legacy/useBaseQuery.js
"use client";// src/useBaseQuery.ts
function y$(e,t,r){var i,a,o,u,c;if(false){}const d=yU();const f=yH();const p=ec(r);const h=p.defaultQueryOptions(e);(a=(i=p.getDefaultOptions().queries)==null?void 0:i._experimental_beforeQuery)==null?void 0:a.call(i,h);if(false){}h._optimisticResults=d?"isRestoring":"optimistic";yW(h);yL(h,f);yK(f);const v=!p.getQueryCache().get(h.queryHash);const[g]=n.useState(()=>new t(p,h));const m=g.getOptimisticResult(h);const b=!d&&e.subscribed!==false;n.useSyncExternalStore(n.useCallback(e=>{const t=b?g.subscribe(R.batchCalls(e)):l;g.updateResult();return t},[g,b]),()=>g.getCurrentResult(),()=>g.getCurrentResult());n.useEffect(()=>{g.setOptions(h)},[h,g]);if(yG(h,m)){throw yQ(h,g,f)}if(yB({result:m,errorResetBoundary:f,throwOnError:h.throwOnError,query:p.getQueryCache().get(h.queryHash),suspense:h.suspense})){throw m.error};(u=(o=p.getDefaultOptions().queries)==null?void 0:o._experimental_afterQuery)==null?void 0:u.call(o,h,m);if(h.experimental_prefetchInRender&&!s&&yz(m,d)){const e=v?// Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
yQ(h,g,f):// subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
(c=p.getQueryCache().get(h.queryHash))==null?void 0:c.promise;e==null?void 0:e.catch(l).finally(()=>{g.updateResult()})}return!h.notifyOnChangeProps?g.trackResult(m):m}//# sourceMappingURL=useBaseQuery.js.map
;// CONCATENATED MODULE: ./node_modules/@tanstack/react-query/build/legacy/useQuery.js
"use client";// src/useQuery.ts
function yX(e,t){return y$(e,yY,t)}//# sourceMappingURL=useQuery.js.map
;// CONCATENATED MODULE: ./addons/content-bank/assets/react/manage-contents/services/content-bank.ts
var yJ=e=>{return mX.post(mZ.SAVE_CONTENT_BANK_COLLECTION,e)};var yZ=()=>{var e=ec();var{showToast:t}=fP();return h6({mutationFn:yJ,onSuccess:r=>{e.invalidateQueries({queryKey:["ContentBankCollections"]});e.invalidateQueries({queryKey:["ContentBankCollectionsInfinity"]});e.invalidateQueries({queryKey:["ContentBankContents"]});t({type:"success",message:r.message})},onError:e=>{t({type:"danger",message:(0,ej/* .convertToErrorMessage */.EL)(e)})}})};var y0=e=>{return mX.post(mZ.DELETE_CONTENT_BANK_COLLECTION,{id:e})};var y1=()=>{var e=ec();var{showToast:t}=fP();return h6({mutationFn:y0,onSuccess:r=>{e.invalidateQueries({queryKey:["ContentBankCollections"]});e.invalidateQueries({queryKey:["ContentBankCollectionsInfinity"]});t({type:"success",message:r.message})},onError:e=>{t({type:"danger",message:(0,ej/* .convertToErrorMessage */.EL)(e)})}})};var y2=e=>{return mX.post(mZ.DELETE_CONTENT_BANK_CONTENTS,{collection_id:e.collectionId,content_ids:e.contentIds})};var y6=()=>{var e=ec();var{showToast:t}=fP();return h6({mutationFn:y2,onSuccess:r=>{e.invalidateQueries({queryKey:["ContentBankContents"]});e.invalidateQueries({queryKey:["ContentBankCollectionsInfinity"]});t({type:"success",message:r.message})},onError:e=>{t({type:"danger",message:(0,ej/* .convertToErrorMessage */.EL)(e)})}})};var y4=e=>{return mX.get(mZ.GET_CONTENT_BANK_LESSON_DETAILS,{params:{lesson_id:e}}).then(e=>e.data)};var y5=e=>{return yX({queryFn:()=>y4(Number(e)),queryKey:["GetLessonContentDetails",e],enabled:!!e})};var y3=(e,t,r)=>{var n;var i;return ev(ep(ev(ep({},t&&{lesson_id:t}),{collection_id:r,title:e.title,description:e.description,thumbnail_id:(i=(n=e.thumbnail)===null||n===void 0?void 0:n.id)!==null&&i!==void 0?i:null}),e.video?Object.fromEntries(Object.entries(e.video).map(t=>{var[r,n]=t;var i;return["video[".concat(r,"]"),r==="source"&&!n?"-1":r==="poster_url"&&!((i=e.video)===null||i===void 0?void 0:i.poster)?"":n]})):{}),{"video[runtime][hours]":e.duration.hour||0,"video[runtime][minutes]":e.duration.minute||0,"video[runtime][seconds]":e.duration.second||0,tutor_attachments:(e.tutor_attachments||[]).map(e=>e.id)})};var y8=e=>{return mX.post(mZ.SAVE_CONTENT_BANK_LESSON_CONTENT,e)};var y9=()=>{var e=ec();var{showToast:t}=fP();return h6({mutationFn:y8,onSuccess:(r,n)=>{e.invalidateQueries({queryKey:["ContentBankContents"]});e.invalidateQueries({queryKey:["GetLessonContentDetails",n.lesson_id]});if(!n.lesson_id){e.invalidateQueries({queryKey:["ContentBankCollectionsInfinity"]})}t({type:"success",message:r.message})},onError:e=>{t({type:"danger",message:(0,ej/* .convertToErrorMessage */.EL)(e)})}})};var y7=e=>{return mX.get(mZ.GET_CONTENT_BANK_ASSIGNMENT_DETAILS,{params:{assignment_id:e}}).then(e=>e.data)};var _e=e=>{return yX({queryFn:()=>y7(Number(e)),queryKey:["GetAssignmentsContentDetails",e],enabled:!!e})};var _t=(e,t,r)=>{return ev(ep({},t&&{assignment_id:t}),{collection_id:r,title:e.title,summary:e.summary,attachments:(e.attachments||[]).map(e=>e.id),"assignment_option[time_duration][time]":e.time_duration.time,"assignment_option[time_duration][value]":e.time_duration.value,"assignment_option[deadline_from_start]":e.deadline_from_start?"1":"0","assignment_option[total_mark]":e.total_mark,"assignment_option[pass_mark]":e.pass_mark,"assignment_option[upload_files_limit]":e.upload_files_limit,"assignment_option[upload_file_size_limit]":e.upload_file_size_limit})};var _r=e=>{return mX.post(mZ.SAVE_CONTENT_BANK_ASSIGNMENT_CONTENT,e)};var _n=()=>{var e=ec();var{showToast:t}=fP();return h6({mutationFn:_r,onSuccess:(r,n)=>{e.invalidateQueries({queryKey:["ContentBankContents"]});e.invalidateQueries({queryKey:["GetAssignmentContentDetails",n.assignment_id]});if(!n.assignment_id){e.invalidateQueries({queryKey:["ContentBankCollectionsInfinity"]})}t({type:"success",message:r.message})},onError:e=>{t({type:"danger",message:(0,ej/* .convertToErrorMessage */.EL)(e)})}})};var _i=e=>{return mX.get(mZ.GET_CONTENT_BANK_QUESTION_DETAILS,{params:{question_id:e}}).then(e=>e.data)};var _a=e=>{return yX({queryFn:()=>_i(e),queryKey:["GetQuestionContentDetails",e],enabled:!!e})};var _o=e=>{return mX.post(mZ.SAVE_QUESTION_CONTENT,{payload:e})};var _s=()=>{var e=ec();var{showToast:t}=fP();return h6({mutationFn:_o,onSuccess:(r,n)=>{e.invalidateQueries({queryKey:["ContentBankContents"]});e.invalidateQueries({queryKey:["GetQuestionContentDetails",n.question_id]});if(!n.question_id){e.invalidateQueries({queryKey:["ContentBankCollectionsInfinity"]})}t({type:"success",message:r.message})},onError:e=>{t({type:"danger",message:(0,ej/* .convertToErrorMessage */.EL)(e)})}})};var _l=e=>{return mX.post(mZ.DUPLICATE_CONTENT_BANK_COLLECTION,{id:e})};var _u=()=>{var e=ec();var{showToast:t}=fP();return h6({mutationFn:_l,onSuccess:r=>{e.invalidateQueries({queryKey:["ContentBankCollections"]});e.invalidateQueries({queryKey:["ContentBankCollectionsInfinity"]});t({type:"success",message:r.message})},onError:e=>{t({type:"danger",message:(0,ej/* .convertToErrorMessage */.EL)(e)})}})};var _c=e=>{var{contentIds:t}=e;return mX.post(mZ.DUPLICATE_CONTENT_BANK_CONTENT,{content_ids:t})};var _d=()=>{var e=ec();var{showToast:t}=fP();return h6({mutationFn:_c,onSuccess:r=>{e.invalidateQueries({queryKey:["ContentBankContents"]});e.invalidateQueries({queryKey:["ContentBankCollectionsInfinity"]});t({type:"success",message:r.message})},onError:e=>{t({type:"danger",message:(0,ej/* .convertToErrorMessage */.EL)(e)})}})};var _f=e=>{var{collectionId:t,contentIds:r}=e;return mX.post(mZ.MOVE_CONTENT_BANK_CONTENT,{collection_id:t,content_ids:r})};var _p=()=>{var e=ec();var{showToast:t}=fP();return h6({mutationFn:_f,onSuccess:r=>{e.invalidateQueries({queryKey:["ContentBankContents"]});e.invalidateQueries({queryKey:["ContentBankCollectionsInfinity"]});t({type:"success",message:r.message})},onError:e=>{t({type:"danger",message:(0,ej/* .convertToErrorMessage */.EL)(e)})}})};var _h=e=>{return mX.post(mZ.IMPORT_FROM_COURSES,e)};var _v=()=>{return h6({mutationFn:_h})};// CONCATENATED MODULE: ./addons/content-bank/assets/react/manage-contents/components/modals/AssignmentModal.tsx
var _g=[{label:(0,em.__)("Weeks","tutor-pro"),value:"weeks"},{label:(0,em.__)("Days","tutor-pro"),value:"days"},{label:(0,em.__)("Hours","tutor-pro"),value:"hours"}];var _m=e=>{var{contentId:r="",collectionId:i,closeModal:a,subtitle:o}=e;var s;var l=((s=fy/* .tutorConfig.settings */.P.settings)===null||s===void 0?void 0:s.chatgpt_enable)==="on";var u=_e(Number(r));var c=_n();var{data:d}=u;var f=lS({defaultValues:{title:"",summary:"",attachments:[],time_duration:{value:"0",time:"weeks"},deadline_from_start:false,total_mark:10,pass_mark:5,upload_files_limit:1,upload_file_size_limit:2,content_drip_settings:{unlock_date:"",after_xdays_of_enroll:"",prerequisites:[]}},shouldFocusError:true,mode:"onChange"});var p=f.formState.dirtyFields&&Object.keys(f.formState.dirtyFields).length>0;(0,n.useEffect)(()=>{if(d){f.reset({title:d.post_title||"",summary:(0,ej/* .normalizeLineEndings */.EW)(d.post_content)||"",attachments:d.attachments||[],time_duration:{value:d.assignment_option.time_duration.value||"0",time:d.assignment_option.time_duration.time||"weeks"},deadline_from_start:d.assignment_option.deadline_from_start==="1"?true:false,total_mark:d.assignment_option.total_mark||10,pass_mark:d.assignment_option.pass_mark||5,upload_files_limit:d.assignment_option.upload_files_limit||1,upload_file_size_limit:d.assignment_option.upload_file_size_limit||2})}var e=setTimeout(()=>{f.setFocus("title")},250);return()=>{clearTimeout(e)};// eslint-disable-next-line react-hooks/exhaustive-deps
},[d]);var h=e=>aY(function*(){var t=_t(e,Number(r),Number(i));var n=yield c.mutateAsync(t);if(n.status_code===200||n.status_code===201){a({action:"CONFIRM"})}})();return/*#__PURE__*/(0,t/* .jsx */.Y)(yI,{onClose:()=>a({action:"CLOSE"}),icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:p?"warning":"assignment",width:24,height:24}),title:p?aT/* .CURRENT_VIEWPORT.isAboveDesktop */.vN.isAboveDesktop?(0,em.__)("Unsaved Changes","tutor-pro"):"":(0,em.__)("Assignment","tutor-pro"),subtitle:o&&(aT/* .CURRENT_VIEWPORT.isAboveSmallMobile */.vN.isAboveSmallMobile?(0,em.sprintf)((0,em.__)("Collection: %s","tutor-pro"),o):""),maxWidth:1070,actions:p&&/*#__PURE__*/(0,t/* .jsxs */.FD)(t/* .Fragment */.FK,{children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"text",size:"small",onClick:()=>{if(r){f.reset()}else{a({action:"CLOSE"})}},children:r?(0,em.__)("Discard Changes","tutor-pro"):(0,em.__)("Cancel","tutor-pro")}),/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{"data-cy":"save-assignment",loading:c.isPending,variant:"primary",size:"small",onClick:f.handleSubmit(h),children:r?(0,em.__)("Update","tutor-pro"):(0,em.__)("Save","tutor-pro")})]}),children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:_y.wrapper,children:/*#__PURE__*/(0,t/* .jsxs */.FD)(ag/* ["default"] */.A,{when:!u.isLoading,fallback:/*#__PURE__*/(0,t/* .jsx */.Y)(eE,{}),children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:_y.assignmentInfo,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{name:"title",control:f.control,rules:ep({required:(0,em.__)("Assignment title is required","tutor-pro")},bL(255)),render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(b2,ev(ep({},e),{label:(0,em.__)("Title","tutor-pro"),placeholder:(0,em.__)("Enter Assignment Title","tutor-pro"),generateWithAi:l,isClearable:true}))}),/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{name:"summary",control:f.control,render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(yA,ev(ep({},e),{label:(0,em.__)("Content","tutor-pro"),placeholder:(0,em.__)("Enter Assignment Content","tutor-pro"),generateWithAi:l}))})]})}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:_y.rightPanel,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{name:"attachments",control:f.control,render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(fW,ev(ep({},e),{label:(0,em.__)("Attachments","tutor-pro"),buttonText:(0,em.__)("Upload Attachment","tutor-pro"),selectMultiple:true}))}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:_y.timeLimit,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{name:"time_duration.value",control:f.control,render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(b2,ev(ep({},e),{type:"number",label:(0,em.__)("Time Limit","tutor-pro"),placeholder:"0",dataAttribute:"data-time-limit",selectOnFocus:true}))}),/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{name:"time_duration.time",control:f.control,render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(hV,ev(ep({},e),{options:_g,removeOptionsMinWidth:true,dataAttribute:"data-time-limit-unit"}))})]}),/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{name:"deadline_from_start",control:f.control,render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(bF,ev(ep({},e),{label:(0,em.__)("Set Deadline From Assignment Start Time","tutor-pro"),helpText:(0,em.__)("Each student will get their own deadline based on when they start the assignment.","tutor-pro")}))}),/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{name:"total_mark",control:f.control,render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(b2,ev(ep({},e),{type:"number",label:(0,em.__)("Total Points","tutor-pro"),placeholder:"0",selectOnFocus:true}))}),/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{name:"pass_mark",control:f.control,rules:{validate:e=>{if(Number(e)>Number(f.getValues("total_mark"))){return(0,em.__)("Pass mark cannot be greater than total mark","tutor-pro")}return true}},render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(b2,ev(ep({},e),{type:"number",label:(0,em.__)("Minimum Pass Points","tutor-pro"),placeholder:"0",selectOnFocus:true}))}),/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{name:"upload_files_limit",control:f.control,render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(b2,ev(ep({},e),{placeholder:"0",type:"number",label:(0,em.__)("File Upload Limit","tutor-pro"),helpText:(0,em.__)("Define the number of files that a student can upload in this assignment. Input 0 to disable the option to upload.","tutor-pro"),selectOnFocus:true}))}),/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{name:"upload_file_size_limit",control:f.control,render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(ya,ev(ep({},e),{type:"number",label:(0,em.__)("Maximum File Size Limit","tutor-pro"),placeholder:"0",content:(0,em.__)("MB","tutor-pro"),contentPosition:"right"}))})]})]})})})};/* ESM default export */const _b=_m;var _y={wrapper:/*#__PURE__*/(0,o/* .css */.AH)("margin:0 auto;display:grid;grid-template-columns:1fr 338px;width:100%;height:100%;padding-inline:",ey/* .spacing["32"] */.YK["32"],";",ey/* .Breakpoint.smallTablet */.EA.smallTablet,"{grid-template-columns:1fr;padding-inline:",ey/* .spacing["24"] */.YK["24"],";}",ey/* .Breakpoint.mobile */.EA.mobile,"{padding-inline:",ey/* .spacing["16"] */.YK["16"],";}"),assignmentInfo:/*#__PURE__*/(0,o/* .css */.AH)("padding-block:",ey/* .spacing["24"] */.YK["24"],";padding-right:",ey/* .spacing["32"] */.YK["32"],";display:flex;flex-direction:column;gap:",ey/* .spacing["24"] */.YK["24"],";position:sticky;top:0;z-index:",ey/* .zIndex.positive */.fE.positive,";",ey/* .Breakpoint.smallTablet */.EA.smallTablet,"{position:unset;padding-right:0;}"),rightPanel:/*#__PURE__*/(0,o/* .css */.AH)("border-left:1px solid ",ey/* .colorTokens.stroke.divider */.I6.stroke.divider,";display:flex;flex-direction:column;gap:",ey/* .spacing["16"] */.YK["16"],";padding-block:",ey/* .spacing["24"] */.YK["24"],";padding-left:",ey/* .spacing["32"] */.YK["32"],";",ey/* .Breakpoint.smallTablet */.EA.smallTablet,"{border-left:none;padding-left:0;}"),timeLimit:/*#__PURE__*/(0,o/* .css */.AH)("display:grid;align-items:end;grid-template-columns:1fr 100px;& input{border:1px solid ",ey/* .colorTokens.stroke["default"] */.I6.stroke["default"],";&[data-time-limit]{border-radius:",ey/* .borderRadius["6"] */.Vq["6"]," 0 0 ",ey/* .borderRadius["6"] */.Vq["6"],";border-right:none;&:focus{border-right:1px solid ",ey/* .colorTokens.stroke["default"] */.I6.stroke["default"],";z-index:",ey/* .zIndex.positive */.fE.positive,";}}&[data-time-limit-unit]{border-radius:0 ",ey/* .borderRadius["6"] */.Vq["6"]," ",ey/* .borderRadius["6"] */.Vq["6"]," 0;}}"),uploadAttachment:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;flex-direction:column;gap:",ey/* .spacing["8"] */.YK["8"],";"),uploadLabel:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.body */.I.body(),"    color:",ey/* .colorTokens.text.title */.I6.text.title,";"),contentDripLabel:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;align-items:center;svg{margin-right:",ey/* .spacing["4"] */.YK["4"],";color:",ey/* .colorTokens.icon.success */.I6.icon.success,";}")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/atoms/ImageInput.tsx
function _w(){var e=(0,eS._)(["\n      width: 168px;\n    "]);_w=function t(){return e};return e}function _x(){var e=(0,eS._)(["\n      width: 168px;\n    "]);_x=function t(){return e};return e}var _A={large:"regular",regular:"small",small:"small"};var _k=e=>{var{buttonText:r=(0,em.__)("Upload Media","tutor-pro"),infoText:n,size:i="regular",value:a,uploadHandler:s,clearHandler:l,emptyImageCss:u,previewImageCss:c,overlayCss:d,replaceButtonText:f,loading:p,disabled:h=false,isClearAble:v=true}=e;return/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:!p,fallback:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:_I.emptyMedia({size:i,isDisabled:h}),children:/*#__PURE__*/(0,t/* .jsx */.Y)(eE,{})}),children:/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:a===null||a===void 0?void 0:a.url,fallback:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{"aria-disabled":h,css:[_I.emptyMedia({size:i,isDisabled:h}),u],onClick:e=>{e.stopPropagation();if(h){return}s()},onKeyDown:e=>{if(!h&&e.key==="Enter"){e.preventDefault();s()}},children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"addImage",width:32,height:32}),/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{disabled:h,size:_A[i],variant:"secondary",buttonContentCss:_I.buttonText,"data-cy":"upload-media",children:r}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:n,children:/*#__PURE__*/(0,t/* .jsx */.Y)("p",{css:_I.infoTexts,children:n})})]}),children:e=>{return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:[_I.previewWrapper({size:i,isDisabled:h}),c],"data-cy":"media-preview",children:[/*#__PURE__*/(0,t/* .jsx */.Y)("img",{src:e,alt:a===null||a===void 0?void 0:a.title,css:_I.imagePreview}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:[_I.hoverPreview,d],"data-hover-buttons-wrapper":true,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{disabled:h,variant:"secondary",size:_A[i],buttonCss:/*#__PURE__*/(0,o/* .css */.AH)("margin-top:",v&&ey/* .spacing["16"] */.YK["16"],";"),onClick:e=>{e.stopPropagation();s()},"data-cy":"replace-media",children:f||(0,em.__)("Replace Image","tutor-pro")}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:v,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{disabled:h,variant:"text",size:_A[i],onClick:e=>{e.stopPropagation();l()},"data-cy":"clear-media",children:(0,em.__)("Remove","tutor-pro")})})]})]})}})})};/* ESM default export */const _E=_k;var _I={emptyMedia:e=>{var{size:t,isDisabled:r}=e;return/*#__PURE__*/(0,o/* .css */.AH)("width:100%;height:168px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:",ey/* .spacing["8"] */.YK["8"],";border:1px dashed ",ey/* .colorTokens.stroke.border */.I6.stroke.border,";border-radius:",ey/* .borderRadius["8"] */.Vq["8"],";background-color:",ey/* .colorTokens.bg.white */.I6.bg.white,";overflow:hidden;cursor:",r?"not-allowed":"pointer",";",t==="small"&&(0,o/* .css */.AH)(_w()),"    svg{color:",ey/* .colorTokens.icon["default"] */.I6.icon["default"],";}&:hover svg{color:",!r&&ey/* .colorTokens.brand.blue */.I6.brand.blue,";}")},buttonText:/*#__PURE__*/(0,o/* .css */.AH)("color:",ey/* .colorTokens.text.brand */.I6.text.brand,";"),infoTexts:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.tiny */.I.tiny(),";color:",ey/* .colorTokens.text.subdued */.I6.text.subdued,";text-align:center;"),previewWrapper:e=>{var{size:t,isDisabled:r}=e;return/*#__PURE__*/(0,o/* .css */.AH)("width:100%;height:168px;border:1px solid ",ey/* .colorTokens.stroke["default"] */.I6.stroke["default"],";border-radius:",ey/* .borderRadius["8"] */.Vq["8"],";overflow:hidden;position:relative;background-color:",ey/* .colorTokens.bg.white */.I6.bg.white,";",t==="small"&&(0,o/* .css */.AH)(_x()),"    &:hover{[data-hover-buttons-wrapper]{display:",r?"none":"flex",";opacity:",r?0:1,";}}")},imagePreview:/*#__PURE__*/(0,o/* .css */.AH)("height:100%;width:100%;object-fit:contain;"),hoverPreview:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;flex-direction:column;justify-content:center;align-items:center;gap:",ey/* .spacing["8"] */.YK["8"],";opacity:0;position:absolute;inset:0;background-color:",oZ()(ey/* .colorTokens.color.black.main */.I6.color.black.main,.6),";button:first-of-type{box-shadow:",ey/* .shadow.button */.r7.button,";}button:last-of-type:not(:only-of-type){color:",ey/* .colorTokens.text.white */.I6.text.white,";box-shadow:none;}")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/magic-ai-image/ImageContext.tsx
var _C=[(0,em.__)("A serene classroom setting with books and a chalkboard","tutor-pro"),(0,em.__)("An abstract representation of innovation and creativity","tutor-pro"),(0,em.__)("A vibrant workspace with a laptop and coffee cup","tutor-pro"),(0,em.__)("A modern design with digital learning icons","tutor-pro"),(0,em.__)("A futuristic cityscape with a glowing pathway","tutor-pro"),(0,em.__)("A peaceful nature scene with soft colors","tutor-pro"),(0,em.__)("A professional boardroom with sleek visuals","tutor-pro"),(0,em.__)("A stack of books with warm, inviting lighting","tutor-pro"),(0,em.__)("A dynamic collage of technology and education themes","tutor-pro"),(0,em.__)("A bold and minimalistic design with striking colors","tutor-pro")];// eslint-disable-next-line @typescript-eslint/no-explicit-any
var _Y=/*#__PURE__*/i().createContext(null);var _T=()=>{var e=(0,n.useContext)(_Y);if(!e){throw new Error("useMagicImageGeneration must be used within MagicImageGenerationProvider.")}return e};var _S=e=>{var{children:r,field:i,fieldState:a,onCloseModal:o}=e;var s=h1({defaultValues:{prompt:"",style:"none"}});var[l,u]=(0,n.useState)("generation");var[c,d]=(0,n.useState)("");var[f,p]=(0,n.useState)([null,null,null,null]);var h=(0,n.useCallback)(e=>{u(e)},[]);return/*#__PURE__*/(0,t/* .jsx */.Y)(_Y.Provider,{value:{state:l,onDropdownMenuChange:h,images:f,setImages:p,currentImage:c,setCurrentImage:d,field:i,fieldState:a,onCloseModal:o},children:/*#__PURE__*/(0,t/* .jsx */.Y)(pu,(0,eX._)((0,e$._)({},s),{children:r}))})};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/fields/FormImageRadioGroup.tsx
function _O(){var e=(0,eS._)(["\n        img {\n          border-color: ",";\n        }\n      "]);_O=function t(){return e};return e}function _D(){var e=(0,eS._)(["\n        outline-color: ",";\n      "]);_D=function t(){return e};return e}var _F=e=>{var{field:r,fieldState:n,label:i,options:a=[],disabled:o}=e;return/*#__PURE__*/(0,t/* .jsx */.Y)(fv,{field:r,fieldState:n,label:i,disabled:o,children:()=>{return/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:_P.wrapper,children:a.map((e,n)=>/*#__PURE__*/(0,t/* .jsxs */.FD)("button",{type:"button",css:_P.item(r.value===e.value),onClick:()=>{r.onChange(e.value)},disabled:o,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("img",{src:e.image,alt:e.label,width:64,height:64}),/*#__PURE__*/(0,t/* .jsx */.Y)("p",{children:e.label})]},n))})}})};/* ESM default export */const _R=_F;var _P={wrapper:/*#__PURE__*/(0,o/* .css */.AH)("display:grid;grid-template-columns:repeat(4,minmax(64px,1fr));gap:",ey/* .spacing["12"] */.YK["12"],";margin-top:",ey/* .spacing["4"] */.YK["4"],";"),item:e=>/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.resetButton */.x.resetButton,";display:flex;flex-direction:column;gap:",ey/* .spacing["4"] */.YK["4"],";align-items:center;width:100%;cursor:pointer;input{appearance:none;}p{",eK/* .typography.small */.I.small(),";width:100%;",eB/* .styleUtils.textEllipsis */.x.textEllipsis,";color:",ey/* .colorTokens.text.subdued */.I6.text.subdued,";text-align:center;}&:hover,&:focus-visible{",!e&&(0,o/* .css */.AH)(_O(),ey/* .colorTokens.stroke.hover */.I6.stroke.hover),"}img{border-radius:",ey/* .borderRadius["6"] */.Vq["6"],";border:2px solid ",ey/* .colorTokens.stroke.border */.I6.stroke.border,";outline:2px solid transparent;outline-offset:2px;transition:border-color 0.3s ease;",e&&(0,o/* .css */.AH)(_D(),ey/* .colorTokens.stroke.magicAi */.I6.stroke.magicAi),"}")};// CONCATENATED MODULE: ../tutor/assets/react/v3/public/images/ai-types/3d.png
const _M=r.p+"images/3d-d74232c4.png";// CONCATENATED MODULE: ../tutor/assets/react/v3/public/images/ai-types/black-and-white.png
const _H=r.p+"images/black-and-white-a1d197c0.png";// CONCATENATED MODULE: ../tutor/assets/react/v3/public/images/ai-types/concept.png
const _N=r.p+"images/concept-ad427b25.png";// CONCATENATED MODULE: ../tutor/assets/react/v3/public/images/ai-types/dreamy.png
const _L=r.p+"images/dreamy-72eab497.png";// CONCATENATED MODULE: ../tutor/assets/react/v3/public/images/ai-types/filmic.png
const _K=r.p+"images/filmic-91db8802.png";// CONCATENATED MODULE: ../tutor/assets/react/v3/public/images/ai-types/illustration.png
const _B=r.p+"images/illustration-19074f05.png";// CONCATENATED MODULE: ../tutor/assets/react/v3/public/images/ai-types/neon.png
const _j=r.p+"images/neon-bfde2ac7.png";// CONCATENATED MODULE: ../tutor/assets/react/v3/public/images/ai-types/none.jpg
const _U=r.p+"images/none-2088b52b.jpg";// CONCATENATED MODULE: ../tutor/assets/react/v3/public/images/ai-types/painting.png
const _q=r.p+"images/painting-db63dd8a.png";// CONCATENATED MODULE: ../tutor/assets/react/v3/public/images/ai-types/photo.png
const _V=r.p+"images/photo-7d69e05e.png";// CONCATENATED MODULE: ../tutor/assets/react/v3/public/images/ai-types/retro.png
const _W=r.p+"images/retro-bcc8eda3.png";// CONCATENATED MODULE: ../tutor/assets/react/v3/public/images/ai-types/sketch.png
const _z=r.p+"images/sketch-319bbedf.png";// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/utils/magic-ai.ts
function _G(e,t){e.lineTo(t.x,t.y);e.stroke()}function _Q(e,t){var r=t.x-e.x;var n=t.y-e.y;return Math.sqrt(r*r+n*n)}function _$(e){var t=atob(e.split(",")[1]);var r=e.split(",")[0].split(":")[1].split(";")[0];var n=new ArrayBuffer(t.length);var i=new Uint8Array(n);for(var a=0;a<t.length;a++){i[a]=t.charCodeAt(a)}return new Blob([n],{type:r})}function _X(e,t){var r=_$(e);var n=document.createElement("a");n.href=URL.createObjectURL(r);n.download=t;document.body.appendChild(n);n.click();document.body.removeChild(n)}function _J(e,t){var r=document.createElement("canvas");r.width=1024;r.height=1024;var n=r.getContext("2d");n===null||n===void 0?void 0:n.putImageData(e,0,0);n===null||n===void 0?void 0:n.drawImage(r,0,0,1024,1024);return new Promise(e=>{r.toBlob(r=>{if(!r){e(null);return}e(new File([r],t,{type:"image/png"}))})})}var _Z=e=>{if(e&&typeof e!=="function"&&e.current){var t=e.current;var r=t.getContext("2d");return{canvas:t,context:r}}return{canvas:null,context:null}};var _0=e=>{return e.toDataURL("image/png")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/magic-ai-image/ImageItem.tsx
function _1(){var e=(0,eS._)(["\n      background-position: top left;\n    "]);_1=function t(){return e};return e}function _2(){var e=(0,eS._)(["\n      background-position: top right;\n      animation-delay: 0.5s;\n    "]);_2=function t(){return e};return e}function _6(){var e=(0,eS._)(["\n      background-position: bottom left;\n      animation-delay: 1.5s;\n    "]);_6=function t(){return e};return e}function _4(){var e=(0,eS._)(["\n      background-position: bottom right;\n      animation-delay: 1s;\n    "]);_4=function t(){return e};return e}function _5(){var e=(0,eS._)(["\n      outline-color: ",";\n\n      [data-actions] {\n        opacity: 1;\n      }\n    "]);_5=function t(){return e};return e}var _3=[{label:(0,em.__)("Magic Fill","tutor-pro"),value:"magic-fill",icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"magicWand",width:24,height:24})},// @TODO: will be implemented in the future
// {
//   label: __('Object eraser', __TUTOR_TEXT_DOMAIN__),
//   value: 'magic-erase',
//   icon: <SVGIcon name="eraser" width={24} height={24} />,
// },
// {
//   label: __('Variations', __TUTOR_TEXT_DOMAIN__),
//   value: 'variations',
//   icon: <SVGIcon name="reload" width={24} height={24} />,
// },
{label:(0,em.__)("Download","tutor-pro"),value:"download",icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"download",width:24,height:24})}];var _8=e=>{var{src:r,loading:i,index:a}=e;var o=(0,n.useRef)(null);var[s,l]=(0,n.useState)(false);var{onDropdownMenuChange:u,setCurrentImage:c,onCloseModal:d,field:f}=_T();var p=m7();if(i||!r){return/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:_7.loader(a+1)})}return/*#__PURE__*/(0,t/* .jsxs */.FD)(t/* .Fragment */.FK,{children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:_7.image({isActive:p.isPending}),children:[/*#__PURE__*/(0,t/* .jsx */.Y)("img",{src:r,alt:(0,em.__)("Generated Image","tutor-pro")}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{"data-actions":true,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:_7.useButton,children:/*#__PURE__*/(0,t/* .jsxs */.FD)(h_,{variant:"primary",disabled:p.isPending,onClick:()=>fQ(function*(){if(!r){return}var e=yield p.mutateAsync({image:r});if(e.data){f.onChange(e.data);d()}})(),loading:p.isPending,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"download",width:24,height:24}),(0,em.__)("Use This","tutor-pro")]})}),/*#__PURE__*/(0,t/* .jsx */.Y)(h_,{variant:"primary",size:"icon",css:_7.threeDots,ref:o,onClick:()=>l(true),children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"threeDotsVertical",width:24,height:24})})]})]}),/*#__PURE__*/(0,t/* .jsx */.Y)(a7,{triggerRef:o,isOpen:s,arrow:true,closePopover:()=>{l(false)},animationType:as.slideDown,maxWidth:"160px",children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:_7.dropdownOptions,children:/*#__PURE__*/(0,t/* .jsx */.Y)(fb,{each:_3,children:(e,n)=>/*#__PURE__*/(0,t/* .jsxs */.FD)("button",{type:"button",css:_7.dropdownItem,onClick:()=>{switch(e.value){case"magic-fill":{c(r);u(e.value);break}case"download":{var t="".concat((0,ej/* .nanoid */.Ak)(),".png");_X(r,t);break}default:break}l(false)},children:[e.icon,e.label]},n)})})})]})};var _9=/*#__PURE__*/(0,o/* .keyframes */.i7)("		0%{opacity:0.3;}25%{opacity:0.5;}50%{opacity:0.7;}75%{opacity:0.5;}100%{opacity:0.3;}");var _7={loader:e=>/*#__PURE__*/(0,o/* .css */.AH)("border-radius:",ey/* .borderRadius["12"] */.Vq["12"],";background:linear-gradient(\n      73.09deg,#ff9645 18.05%,#ff6471 30.25%,#cf6ebd 55.42%,#a477d1 71.66%,#3e64de 97.9%\n    );position:relative;width:100%;height:100%;background-size:612px 612px;opacity:0.3;transition:opacity 0.5s ease;animation:",_9," 2s linear infinite;",e===1&&(0,o/* .css */.AH)(_1())," ",e===2&&(0,o/* .css */.AH)(_2()),"		",e===3&&(0,o/* .css */.AH)(_6()),"		",e===4&&(0,o/* .css */.AH)(_4())),image:e=>{var{isActive:t}=e;return/*#__PURE__*/(0,o/* .css */.AH)("width:100%;height:100%;overflow:hidden;border-radius:",ey/* .borderRadius["12"] */.Vq["12"],";position:relative;outline:2px solid transparent;outline-offset:2px;transition:border-radius 0.3s ease;[data-actions]{opacity:0;transition:opacity 0.3s ease;}img{position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;}",t&&(0,o/* .css */.AH)(_5(),ey/* .colorTokens.stroke.brand */.I6.stroke.brand),"    &:hover,&:focus-within{outline-color:",ey/* .colorTokens.stroke.brand */.I6.stroke.brand,";[data-actions]{opacity:1;}}")},threeDots:/*#__PURE__*/(0,o/* .css */.AH)("position:absolute;top:",ey/* .spacing["8"] */.YK["8"],";right:",ey/* .spacing["8"] */.YK["8"],";border-radius:",ey/* .borderRadius["4"] */.Vq["4"],";"),useButton:/*#__PURE__*/(0,o/* .css */.AH)("position:absolute;left:50%;bottom:",ey/* .spacing["12"] */.YK["12"],";transform:translateX(-50%);button{display:inline-flex;align-items:center;gap:",ey/* .spacing["4"] */.YK["4"],";}"),dropdownOptions:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;flex-direction:column;padding-block:",ey/* .spacing["8"] */.YK["8"],";"),dropdownItem:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.small */.I.small(),";",eB/* .styleUtils.resetButton */.x.resetButton,";height:40px;display:flex;gap:",ey/* .spacing["10"] */.YK["10"],";align-items:center;transition:background-color 0.3s ease;color:",ey/* .colorTokens.text.title */.I6.text.title,";padding-inline:",ey/* .spacing["8"] */.YK["8"],";cursor:pointer;svg{color:",ey/* .colorTokens.icon["default"] */.I6.icon["default"],";}&:hover{background-color:",ey/* .colorTokens.background.hover */.I6.background.hover,";}")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/magic-ai-image/styles.ts
var we={wrapper:/*#__PURE__*/(0,o/* .css */.AH)("min-width:1000px;display:grid;grid-template-columns:1fr 330px;",ey/* .Breakpoint.tablet */.EA.tablet,"{min-width:auto;grid-template-columns:1fr;width:100%;}"),left:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;justify-content:center;align-items:center;background-color:#f7f7f7;z-index:",ey/* .zIndex.level */.fE.level,";"),right:/*#__PURE__*/(0,o/* .css */.AH)("padding:",ey/* .spacing["20"] */.YK["20"],";display:flex;flex-direction:column;align-items:space-between;z-index:",ey/* .zIndex.positive */.fE.positive,";"),rightFooter:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;flex-direction:column;gap:",ey/* .spacing["8"] */.YK["8"],";margin-top:auto;padding-top:80px;")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/magic-ai-image/ImageGeneration.tsx
var wt=[{label:(0,em.__)("None","tutor-pro"),value:"none",image:_U},{label:(0,em.__)("Photo","tutor-pro"),value:"photo",image:_V},{label:(0,em.__)("Neon","tutor-pro"),value:"neon",image:_j},{label:(0,em.__)("3D","tutor-pro"),value:"3d",image:_M},{label:(0,em.__)("Painting","tutor-pro"),value:"painting",image:_q},{label:(0,em.__)("Sketch","tutor-pro"),value:"sketch",image:_z},{label:(0,em.__)("Concept","tutor-pro"),value:"concept_art",image:_N},{label:(0,em.__)("Illustration","tutor-pro"),value:"illustration",image:_B},{label:(0,em.__)("Dreamy","tutor-pro"),value:"dreamy",image:_L},{label:(0,em.__)("Filmic","tutor-pro"),value:"filmic",image:_K},{label:(0,em.__)("Retro","tutor-pro"),value:"retrowave",image:_W},{label:(0,em.__)("Black & White","tutor-pro"),value:"black-and-white",image:_H}];var wr=()=>{var e=hm({defaultValues:{style:"none",prompt:""}});var{images:r,setImages:i}=_T();var a=m1();var{showToast:o}=fP();var[s,l]=(0,n.useState)(r.every(e=>e===null));var[u,c]=(0,n.useState)([false,false,false,false]);var d=e.watch("style");var f=e.watch("prompt");var p=!d||!f;var h=r.some(eO/* .isDefined */.O9);(0,n.useEffect)(()=>{if(a.isError){o({type:"danger",message:a.error.response.data.message})}// eslint-disable-next-line react-hooks/exhaustive-deps
},[a.isError]);(0,n.useEffect)(()=>{e.setFocus("prompt");// eslint-disable-next-line react-hooks/exhaustive-deps
},[]);return/*#__PURE__*/(0,t/* .jsxs */.FD)("form",{css:we.wrapper,onSubmit:e.handleSubmit(e=>fQ(function*(){c([true,true,true,true]);l(false);try{yield Promise.all(Array.from({length:4}).map((t,r)=>{return a.mutateAsync(e).then(e=>{i(t=>{var n,i;var a=[...t];var o;a[r]=(o=(i=e.data.data)===null||i===void 0?void 0:(n=i[0])===null||n===void 0?void 0:n.b64_json)!==null&&o!==void 0?o:null;return a});c(e=>{var t=[...e];t[r]=false;return t})}).catch(e=>{c(e=>{var t=[...e];t[r]=false;return t});throw e})}))}catch(e){c([false,false,false,false]);l(true)}})()),children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:we.left,children:/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:!s,fallback:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"magicAiPlaceholder",width:72,height:72}),children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:wn.images,children:/*#__PURE__*/(0,t/* .jsx */.Y)(fb,{each:r,children:(e,r)=>{return/*#__PURE__*/(0,t/* .jsx */.Y)(_8,{src:e,loading:u[r],index:r},r)}})})})}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:we.right,children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:wn.fields,children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:wn.promptWrapper,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(py,{control:e.control,name:"prompt",render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(hI,(0,eX._)((0,e$._)({},e),{label:(0,em.__)("Visualize Your Course","tutor-pro"),placeholder:(0,em.__)("Describe the image you want for your course thumbnail","tutor-pro"),rows:4,isMagicAi:true,disabled:a.isPending,enableResize:false}))}),/*#__PURE__*/(0,t/* .jsxs */.FD)("button",{type:"button",css:wn.inspireButton,onClick:()=>{var t=_C.length;var r=Math.floor(Math.random()*t);e.reset((0,eX._)((0,e$._)({},e.getValues()),{prompt:_C[r]}))},disabled:a.isPending,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"bulbLine"}),(0,em.__)("Inspire Me","tutor-pro")]})]}),/*#__PURE__*/(0,t/* .jsx */.Y)(py,{control:e.control,name:"style",render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(_R,(0,eX._)((0,e$._)({},e),{label:(0,em.__)("Styles","tutor-pro"),options:wt,disabled:a.isPending}))})]}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:we.rightFooter,children:/*#__PURE__*/(0,t/* .jsxs */.FD)(h_,{type:"submit",disabled:a.isPending||p,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:h?"reload":"magicAi",width:24,height:24}),h?(0,em.__)("Generate Again","tutor-pro"):(0,em.__)("Generate Now","tutor-pro")]})})]})]})};var wn={images:/*#__PURE__*/(0,o/* .css */.AH)("display:grid;grid-template-columns:repeat(2,minmax(150px,1fr));grid-template-rows:repeat(2,minmax(150px,1fr));gap:",ey/* .spacing["12"] */.YK["12"],";align-self:start;padding:",ey/* .spacing["24"] */.YK["24"],";width:100%;height:100%;> div{aspect-ratio:1 / 1;}"),fields:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;flex-direction:column;gap:",ey/* .spacing["12"] */.YK["12"],";"),promptWrapper:/*#__PURE__*/(0,o/* .css */.AH)("position:relative;textarea{padding-bottom:",ey/* .spacing["40"] */.YK["40"]," !important;}"),inspireButton:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.resetButton */.x.resetButton,";",eK/* .typography.small */.I.small(),";position:absolute;height:28px;bottom:",ey/* .spacing["12"] */.YK["12"],";left:",ey/* .spacing["12"] */.YK["12"],";border:1px solid ",ey/* .colorTokens.stroke.brand */.I6.stroke.brand,";border-radius:",ey/* .borderRadius["4"] */.Vq["4"],";display:flex;align-items:center;gap:",ey/* .spacing["4"] */.YK["4"],";color:",ey/* .colorTokens.text.brand */.I6.text.brand,";padding-inline:",ey/* .spacing["12"] */.YK["12"],";background-color:",ey/* .colorTokens.background.white */.I6.background.white,";&:hover{background-color:",ey/* .colorTokens.background.brand */.I6.background.brand,";color:",ey/* .colorTokens.text.white */.I6.text.white,";}&:focus-visible{outline:2px solid ",ey/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:1px;}&:disabled{background-color:",ey/* .colorTokens.background.disable */.I6.background.disable,";color:",ey/* .colorTokens.text.disable */.I6.text.disable,";}")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/atoms/Separator.tsx
var wi=/*#__PURE__*/i().forwardRef((e,r)=>{var{className:n,variant:i}=e;return/*#__PURE__*/(0,t/* .jsx */.Y)("div",{className:n,ref:r,css:wo({variant:i})})});wi.displayName="Separator";var wa={horizontal:/*#__PURE__*/(0,o/* .css */.AH)("height:1px;width:100%;"),vertical:/*#__PURE__*/(0,o/* .css */.AH)("height:100%;width:1px;"),base:/*#__PURE__*/(0,o/* .css */.AH)("flex-shrink:0;background-color:",ey/* .colorTokens.stroke.divider */.I6.stroke.divider,";")};var wo=(0,hb/* .createVariation */.s)({variants:{variant:{horizontal:wa.horizontal,vertical:wa.vertical}},defaultVariants:{variant:"horizontal"}},wa.base);// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/fields/FormRangeSliderField.tsx
function ws(){var e=(0,eS._)(["\n      border: 1px solid ",";\n      border-radius: ",";\n      padding: "," "," "," ",";\n    "]);ws=function t(){return e};return e}function wl(){var e=(0,eS._)(["\n      background: ",";\n    "]);wl=function t(){return e};return e}function wu(e,t,r,n){if(!t.current){return 0}var i=t.current.getBoundingClientRect();var a=i.width;var o=e-i.left;var s=Math.max(0,Math.min(o,a));var l=s/a*100;var u=Math.floor(r+l/100*(n-r));return u}var wc=e=>{var{field:r,fieldState:i,label:a,min:o=0,max:s=100,isMagicAi:l=false,hasBorder:u=false}=e;var c=(0,n.useRef)(null);var[d,f]=(0,n.useState)(r.value);var p=(0,n.useRef)(null);var h=(0,n.useRef)(null);var v=oc(d);(0,n.useEffect)(()=>{r.onChange(v);// eslint-disable-next-line react-hooks/exhaustive-deps
},[v,r.onChange]);(0,n.useEffect)(()=>{var e=false;var t=t=>{if(t.target!==h.current){return}e=true;document.body.style.userSelect="none"};var r=t=>{if(!e||!p.current){return}f(wu(t.clientX,p,o,s))};var n=()=>{e=false;document.body.style.userSelect="auto"};window.addEventListener("mousedown",t);window.addEventListener("mousemove",r);window.addEventListener("mouseup",n);return()=>{window.removeEventListener("mousedown",t);window.removeEventListener("mousemove",r);window.removeEventListener("mouseup",n)}},[o,s]);var g=(0,n.useMemo)(()=>{return Math.floor((d-o)/(s-o)*100)},[d,o,s]);return/*#__PURE__*/(0,t/* .jsx */.Y)(fv,{field:r,fieldState:i,label:a,isMagicAi:l,children:()=>/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:wf.wrapper(u),children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:wf.track,ref:p,onKeyDown:ej/* .noop */.lQ,onClick:e=>{f(wu(e.clientX,p,o,s))},children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:wf.fill,style:{width:"".concat(g,"%")}}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:wf.thumb(l),style:{left:"".concat(g,"%")},ref:h})]}),/*#__PURE__*/(0,t/* .jsx */.Y)("input",{type:"text",css:wf.input,value:String(d),onChange:e=>{f(Number(e.target.value))},ref:c,onFocus:()=>{var e;(e=c.current)===null||e===void 0?void 0:e.select()}})]})})};/* ESM default export */const wd=wc;var wf={wrapper:e=>/*#__PURE__*/(0,o/* .css */.AH)("display:grid;grid-template-columns:1fr 45px;gap:",ey/* .spacing["20"] */.YK["20"],";align-items:center;",e&&(0,o/* .css */.AH)(ws(),ey/* .colorTokens.stroke.disable */.I6.stroke.disable,ey/* .borderRadius["6"] */.Vq["6"],ey/* .spacing["12"] */.YK["12"],ey/* .spacing["10"] */.YK["10"],ey/* .spacing["12"] */.YK["12"],ey/* .spacing["16"] */.YK["16"])),track:/*#__PURE__*/(0,o/* .css */.AH)("position:relative;height:4px;background-color:",ey/* .colorTokens.bg.gray20 */.I6.bg.gray20,";border-radius:",ey/* .borderRadius["50"] */.Vq["50"],";width:100%;flex-shrink:0;cursor:pointer;"),fill:/*#__PURE__*/(0,o/* .css */.AH)("position:absolute;left:0;top:0;height:100%;background:",ey/* .colorTokens.ai.gradient_1 */.I6.ai.gradient_1,";width:50%;border-radius:",ey/* .borderRadius["50"] */.Vq["50"],";"),thumb:e=>/*#__PURE__*/(0,o/* .css */.AH)("position:absolute;top:50%;transform:translate(-50%,-50%);width:20px;height:20px;border-radius:",ey/* .borderRadius.circle */.Vq.circle,";&::before{content:'';position:absolute;top:50%;left:50%;width:8px;height:8px;transform:translate(-50%,-50%);border-radius:",ey/* .borderRadius.circle */.Vq.circle,";background-color:",ey/* .colorTokens.background.white */.I6.background.white,";cursor:pointer;}",e&&(0,o/* .css */.AH)(wl(),ey/* .colorTokens.ai.gradient_1 */.I6.ai.gradient_1)),input:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.caption */.I.caption("medium"),";height:32px;border:1px solid ",ey/* .colorTokens.stroke.border */.I6.stroke.border,";border-radius:",ey/* .borderRadius["6"] */.Vq["6"],";text-align:center;color:",ey/* .colorTokens.text.primary */.I6.text.primary,";&:focus-visible{",eB/* .styleUtils.inputFocus */.x.inputFocus,";}")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/magic-ai-image/DrawingCanvas.tsx
var wh=/*#__PURE__*/i().forwardRef((e,r)=>{var{src:i,width:a,height:o,brushSize:s,trackStack:l,pointer:u,setTrackStack:c,setPointer:d}=e;var[f,p]=(0,n.useState)(false);var[h,v]=(0,n.useState)({x:0,y:0});var g=(0,n.useRef)(null);var m=e=>{var{canvas:t,context:n}=_Z(r);if(!t||!n){return}var i=t.getBoundingClientRect();var a=(e.clientX-i.left)*(t.width/i.width);var o=(e.clientY-i.top)*(t.height/i.height);n.globalCompositeOperation="destination-out";n.beginPath();n.moveTo(a,o);p(true);v({x:a,y:o})};var b=e=>{var{canvas:t,context:n}=_Z(r);if(!t||!n||!g.current){return}var i=t.getBoundingClientRect();var a={x:(e.clientX-i.left)*(t.width/i.width),y:(e.clientY-i.top)*(t.height/i.height)};if(f){_G(n,a)}g.current.style.left="".concat(a.x,"px");g.current.style.top="".concat(a.y,"px")};var y=e=>{var{canvas:t,context:n}=_Z(r);if(!n||!t){return}p(false);n.closePath();var i=t.getBoundingClientRect();var a={x:(e.clientX-i.left)*(t.width/i.width),y:(e.clientY-i.top)*(t.height/i.height)};// Check if the mouse is just clicked but not drag for drawing a path, then draw a circle
if(_Q(h,a)===0){_G(n,{x:a.x+1,y:a.y+1})}c(e=>{var t=e.slice(0,u);return[...t,n.getImageData(0,0,1024,1024)]});d(e=>e+1)};var _=()=>{var{canvas:e,context:t}=_Z(r);if(!e||!t){return}var n=new Image;n.src=i;n.onload=()=>{t.clearRect(0,0,e.width,e.height);var r=n.width/n.height;var i=e.width/e.height;var a;var o;if(i>r){o=e.height;a=e.height*r}else{a=e.width;o=e.width/r}var s=(e.width-a)/2;var u=(e.height-o)/2;t.drawImage(n,s,u,a,o);if(l.length===0){c([t.getImageData(0,0,e.width,e.height)])}};t.lineJoin="round";t.lineCap="round"};var w=()=>{if(!g.current){return}document.body.style.cursor="none";g.current.style.display="block"};var x=()=>{if(!g.current){return}document.body.style.cursor="auto";g.current.style.display="none"};(0,n.useEffect)(()=>{_();// eslint-disable-next-line react-hooks/exhaustive-deps
},[]);return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:wv.wrapper,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("canvas",{ref:r,width:a,height:o,onMouseDown:m,onMouseMove:b,onMouseUp:y,onMouseEnter:w,onMouseLeave:x}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{ref:g,css:wv.customCursor(s)})]})});var wv={wrapper:/*#__PURE__*/(0,o/* .css */.AH)("position:relative;"),customCursor:e=>/*#__PURE__*/(0,o/* .css */.AH)("position:absolute;width:",e,"px;height:",e,"px;border-radius:",ey/* .borderRadius.circle */.Vq.circle,";background:linear-gradient(\n      73.09deg,rgba(255,150,69,0.4) 18.05%,rgba(255,100,113,0.4) 30.25%,rgba(207,110,189,0.4) 55.42%,rgba(164,119,209,0.4) 71.66%,rgba(62,100,222,0.4) 97.9%\n    );border:3px solid ",ey/* .colorTokens.stroke.white */.I6.stroke.white,";pointer-events:none;transform:translate(-50%,-50%);z-index:",ey/* .zIndex.highest */.fE.highest,";display:none;")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/magic-ai-image/MagicFill.tsx
var wg=620;var wm=620;var wb=()=>{var e=h1({defaultValues:{brush_size:40,prompt:""}});var r=m6();var i=(0,n.useRef)(null);var{onDropdownMenuChange:a,currentImage:s,field:l,onCloseModal:u}=_T();var c=m7();var d=oc(e.watch("brush_size",40));var[f,p]=(0,n.useState)([]);var[h,v]=(0,n.useState)(1);var g=(0,n.useCallback)((e,t)=>{var r;var n=(r=i.current)===null||r===void 0?void 0:r.getContext("2d");if(!n){return}for(var a of t.slice(0,e)){n.putImageData(a,0,0)}},[]);(0,n.useEffect)(()=>{var e;var t=(e=i.current)===null||e===void 0?void 0:e.getContext("2d");if(!t){return}t.lineWidth=d},[d]);(0,n.useEffect)(()=>{var e=e=>{if(e.metaKey){if(e.shiftKey&&e.key.toUpperCase()==="Z"){g(h+1,f);v(e=>Math.min(e+1,f.length));return}if(e.key.toUpperCase()==="Z"){g(h-1,f);v(e=>Math.max(e-1,1));return}}};window.addEventListener("keydown",e);return()=>{window.removeEventListener("keydown",e)}},[h,f,g]);if(!s){return null}return/*#__PURE__*/(0,t/* .jsxs */.FD)("form",{css:we.wrapper,onSubmit:e.handleSubmit(e=>fQ(function*(){var t=i.current;var n=t===null||t===void 0?void 0:t.getContext("2d");if(!t||!n){return}var a={prompt:e.prompt,image:_0(t)};var o=yield r.mutateAsync(a);if(o){var s=new Image;s.onload=()=>{t.width=wg;t.height=wm;n.drawImage(s,0,0,t.width,t.height);n.lineWidth=d;n.lineJoin="round";n.lineCap="round"};s.src=o}})()),children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:we.left,children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:ww.leftWrapper,children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:ww.actionBar,children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:ww.backButtonWrapper,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("button",{type:"button",css:ww.backButton,onClick:()=>a("generation"),children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"arrowLeft"})}),(0,em.__)("Magic Fill","tutor-pro")]}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:ww.actions,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(h_,{variant:"ghost",disabled:f.length===0,onClick:()=>{g(1,f);p(f.slice(0,1));v(1)},children:(0,em.__)("Revert to Original","tutor-pro")}),/*#__PURE__*/(0,t/* .jsx */.Y)(wi,{variant:"vertical",css:/*#__PURE__*/(0,o/* .css */.AH)("min-height:16px;")}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:ww.undoRedo,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(h_,{variant:"ghost",size:"icon",disabled:h<=1,onClick:()=>{g(h-1,f);v(e=>Math.max(e-1,1))},children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"undo",width:20,height:20})}),/*#__PURE__*/(0,t/* .jsx */.Y)(h_,{variant:"ghost",size:"icon",disabled:h===f.length,onClick:()=>{g(h+1,f);v(e=>Math.min(e+1,f.length))},children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"redo",width:20,height:20})})]})]})]}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:ww.canvasAndLoading,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(wh,{ref:i,width:wg,height:wm,src:s,brushSize:d,trackStack:f,pointer:h,setTrackStack:p,setPointer:v}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:r.isPending,children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:ww.loading})})]}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:ww.footerActions,children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:ww.footerActionsLeft,children:/*#__PURE__*/(0,t/* .jsx */.Y)(h_,{variant:"secondary",onClick:()=>{var e="".concat((0,ej/* .nanoid */.Ak)(),".png");var{canvas:t}=_Z(i);if(!t)return;_X(_0(t),e)},children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"download",width:24,height:24})})})})]})}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:we.right,children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:ww.fields,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(py,{control:e.control,name:"brush_size",render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(wd,(0,eX._)((0,e$._)({},e),{label:"Brush Size",min:1,max:100,isMagicAi:true,hasBorder:true}))}),/*#__PURE__*/(0,t/* .jsx */.Y)(py,{control:e.control,name:"prompt",render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(hI,(0,eX._)((0,e$._)({},e),{label:(0,em.__)("Describe the Fill","tutor-pro"),placeholder:(0,em.__)("Write 5 words to describe...","tutor-pro"),rows:4,isMagicAi:true}))})]}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:[we.rightFooter,/*#__PURE__*/(0,o/* .css */.AH)("margin-top:auto;")],children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:ww.footerButtons,children:[/*#__PURE__*/(0,t/* .jsxs */.FD)(h_,{type:"submit",disabled:r.isPending||!e.watch("prompt"),children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"magicWand",width:24,height:24}),(0,em.__)("Generative Erase","tutor-pro")]}),/*#__PURE__*/(0,t/* .jsx */.Y)(h_,{variant:"primary_outline",disabled:r.isPending,loading:c.isPending,onClick:()=>fQ(function*(){var{canvas:e}=_Z(i);if(!e)return;var t=yield c.mutateAsync({image:_0(e)});if(t.data){l.onChange(t.data);u()}})(),children:(0,em.__)("Use Image","tutor-pro")})]})})]})]})};/* ESM default export */const wy=wb;var w_={loading:/*#__PURE__*/(0,o/* .keyframes */.i7)("0%{opacity:0;}50%{opacity:0.6;}100%{opacity:0;}"),walker:/*#__PURE__*/(0,o/* .keyframes */.i7)("0%{left:0%;}100%{left:100%;}")};var ww={canvasAndLoading:/*#__PURE__*/(0,o/* .css */.AH)("position:relative;z-index:",ey/* .zIndex.positive */.fE.positive,";"),loading:/*#__PURE__*/(0,o/* .css */.AH)("position:absolute;top:0;left:0;width:100%;height:100%;background:",ey/* .colorTokens.ai.gradient_1 */.I6.ai.gradient_1,";opacity:0.6;transition:0.5s ease opacity;animation:",w_.loading," 1s linear infinite;z-index:0;&::before{content:'';position:absolute;top:0;left:0;width:200px;height:100%;background:linear-gradient(\n        270deg,rgba(255,255,255,0) 0%,rgba(255,255,255,0.6) 51.13%,rgba(255,255,255,0) 100%\n      );animation:",w_.walker," 1s linear infinite;}"),actionBar:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;align-items:center;justify-content:space-between;"),fields:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;flex-direction:column;gap:",ey/* .spacing["12"] */.YK["12"],";"),leftWrapper:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;flex-direction:column;gap:",ey/* .spacing["8"] */.YK["8"],";padding-block:",ey/* .spacing["16"] */.YK["16"],";"),footerButtons:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;flex-direction:column;gap:",ey/* .spacing["8"] */.YK["8"],";"),footerActions:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;justify-content:space-between;"),footerActionsLeft:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;align-items:center;gap:",ey/* .spacing["12"] */.YK["12"],";"),actions:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;align-items:center;gap:",ey/* .spacing["16"] */.YK["16"],";"),undoRedo:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;align-items:center;gap:",ey/* .spacing["12"] */.YK["12"],";"),backButtonWrapper:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;align-items:center;gap:",ey/* .spacing["8"] */.YK["8"],";",eK/* .typography.body */.I.body("medium"),";color:",ey/* .colorTokens.text.title */.I6.text.title,";"),backButton:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.resetButton */.x.resetButton,";width:24px;height:24px;border-radius:",ey/* .borderRadius["4"] */.Vq["4"],";border:1px solid ",ey/* .colorTokens.stroke["default"] */.I6.stroke["default"],";display:flex;align-items:center;justify-content:center;"),image:/*#__PURE__*/(0,o/* .css */.AH)("width:492px;height:498px;position:relative;img{position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;}"),canvasWrapper:/*#__PURE__*/(0,o/* .css */.AH)("position:relative;"),customCursor:e=>/*#__PURE__*/(0,o/* .css */.AH)("position:absolute;width:",e,"px;height:",e,"px;border-radius:",ey/* .borderRadius.circle */.Vq.circle,";background:linear-gradient(\n      73.09deg,rgba(255,150,69,0.4) 18.05%,rgba(255,100,113,0.4) 30.25%,rgba(207,110,189,0.4) 55.42%,rgba(164,119,209,0.4) 71.66%,rgba(62,100,222,0.4) 97.9%\n    );border:3px solid ",ey/* .colorTokens.stroke.white */.I6.stroke.white,";pointer-events:none;transform:translate(-50%,-50%);z-index:",ey/* .zIndex.highest */.fE.highest,";display:none;")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/modals/AiImageModal.tsx
function wx(){var{state:e}=_T();switch(e){case"generation":return/*#__PURE__*/(0,t/* .jsx */.Y)(wr,{});case"magic-fill":return/*#__PURE__*/(0,t/* .jsx */.Y)(wy,{});default:return null}}var wA=e=>{var{title:r,icon:n,closeModal:i,field:a,fieldState:o}=e;return/*#__PURE__*/(0,t/* .jsx */.Y)(oR,{onClose:i,title:r,icon:n,maxWidth:1e3,children:/*#__PURE__*/(0,t/* .jsx */.Y)(_S,{field:a,fieldState:o,onCloseModal:i,children:/*#__PURE__*/(0,t/* .jsx */.Y)(wx,{})})})};/* ESM default export */const wk=wA;// CONCATENATED MODULE: ../tutor/assets/react/v3/public/images/pro-placeholders/generate-image-2x.webp
const wE=r.p+"images/generate-image-2x-7d387dcf.webp";// CONCATENATED MODULE: ../tutor/assets/react/v3/public/images/pro-placeholders/generate-image.webp
const wI=r.p+"images/generate-image-3e5f50a6.webp";// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/fields/FormImageInput.tsx
var wC;var wY=!!fy/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var wT=(wC=fy/* .tutorConfig.settings */.P.settings)===null||wC===void 0?void 0:wC.chatgpt_key_exist;var wS=e=>{var{field:r,fieldState:n,label:i,size:a,helpText:o,buttonText:s=(0,em.__)("Upload Media","tutor-pro"),infoText:l,onChange:u,generateWithAi:c=false,previewImageCss:d,loading:f,onClickAiButton:p}=e;var{showModal:h}=ah();var{openMediaLibrary:v,resetFiles:g}=fK({options:{type:"image",multiple:false},onChange:e=>{if(e&&!Array.isArray(e)){var{id:t,url:n,title:i}=e;r.onChange({id:t,url:n,title:i});if(u){u({id:t,url:n,title:i})}}},initialFiles:r.value});var m=r.value;var b=()=>{v()};var y=()=>{g();r.onChange(null);if(u){u(null)}};var _=()=>{if(!wY){h({component:bb,props:{image:wI,image2x:wE}})}else if(!wT){h({component:bz,props:{image:wI,image2x:wE}})}else{h({component:wk,isMagicAi:true,props:{title:(0,em.__)("AI Studio","tutor-pro"),icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"magicAiColorize",width:24,height:24}),field:r,fieldState:n}});p===null||p===void 0?void 0:p()}};return/*#__PURE__*/(0,t/* .jsx */.Y)(fv,{label:i,field:r,fieldState:n,helpText:o,onClickAiButton:_,generateWithAi:c,children:()=>{return/*#__PURE__*/(0,t/* .jsx */.Y)("div",{children:/*#__PURE__*/(0,t/* .jsx */.Y)(_E,{size:a,value:m,uploadHandler:b,clearHandler:y,buttonText:s,infoText:l,previewImageCss:d,loading:f})})}})};/* ESM default export */const wO=fx(wS);// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/services/video.ts
var wD=e=>{return mX.post(mZ.TUTOR_YOUTUBE_VIDEO_DURATION,{video_id:e})};var wF=()=>{return h6({mutationFn:wD})};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/utils/video.ts
function wR(e){return fQ(function*(){var t=/^.*(vimeo\.com\/)((channels\/[A-z]+\/)|(groups\/[A-z]+\/videos\/))?([0-9]+)/;var r=e.match(t);var n=r?r[5]:null;var i="https://vimeo.com/api/v2/video/".concat(n,".xml");try{var a=yield fetch(i);if(!a.ok){throw new Error((0,em.__)("Failed to fetch the video data","tutor-pro"))}var o=yield a.text();var s=new DOMParser;var l=s.parseFromString(o,"application/xml");var u=l.getElementsByTagName("duration")[0];if(!u||!u.textContent){return null}var c=Number.parseInt(u.textContent,10);return c;// in seconds
}catch(e){// eslint-disable-next-line no-console
console.error("Error fetching video duration:",e);return null}})()}var wP=e=>fQ(function*(){var t=document.createElement("video");t.src=e;t.preload="metadata";return new Promise(e=>{t.onloadedmetadata=()=>{e(t.duration)}})})();var wM=e=>{var t=e.match(/PT(\d+H)?(\d+M)?(\d+S)?/);if(!t){return 0}var r=t[1]?Number(t[1].replace("H","")):0;var n=t[2]?Number(t[2].replace("M","")):0;var i=t[3]?Number(t[3].replace("S","")):0;return r*3600+n*60+i};/**
 * Generates a thumbnail from different video sources
 * @param {string} source - Video source type ('youtube', 'vimeo', 'external_url', 'html5')
 * @param {string} url - Video URL
 * @returns {Promise<string>} - Base64 encoded thumbnail image
 */var wH=(e,t)=>fQ(function*(){if(e==="youtube"){var r=t.match(aT/* .VideoRegex.YOUTUBE */.j8.YOUTUBE);var n=r&&r[7].length===11?r[7]:"";return"https://img.youtube.com/vi/".concat(n,"/maxresdefault.jpg")}if(e==="vimeo"){try{var i=t.split("/").pop();var a=yield fetch("https://vimeo.com/api/v2/video/".concat(i,".json"));var o=yield a.json();return o[0].thumbnail_large}catch(e){throw new Error("Failed to get Vimeo thumbnail. Error: ".concat(e))}}if(e==="external_url"||e==="html5"){return new Promise((e,r)=>{try{// Create video element
    var n=document.createElement("video");n.muted=true;n.style.cssText="position: fixed; left: 0; top: 0; width: 1px; height: 1px; object-fit: contain; z-index: -1;";n.crossOrigin="Anonymous";// Create canvas element
    var i=document.createElement("canvas");// Track loading states
    var a=false;var o=false;var s=false;var l=false;var u=()=>{n.src="";n.remove();i.remove();clearTimeout(d)};var c=()=>{if(a&&o&&s&&l){try{i.height=n.videoHeight;i.width=n.videoWidth;var t=i.getContext("2d");if(!t){throw new Error((0,em.__)("Failed to get canvas context","tutor-pro"))}t.drawImage(n,0,0);var c=i.toDataURL("image/png");u();e(c)}catch(e){u();var d=e instanceof Error?e.message:(0,em.__)("Unknown error occurred","tutor-pro");r(new Error("Thumbnail generation failed: ".concat(d)))}}};// Setup event listeners
    n.addEventListener("loadedmetadata",()=>{a=true;if(!n.currentTime||n.currentTime<2){n.currentTime=2;// Take snapshot at 2 seconds
    }});n.addEventListener("loadeddata",()=>{o=true;c()});n.addEventListener("suspend",()=>{s=true;c()});n.addEventListener("seeked",()=>{l=true;c()});n.addEventListener("error",e=>{u();r(new Error("Video loading failed: ".concat(e.message)))});// Set timeout
    // 30 seconds is a reasonable maximum time to wait for video metadata and frame capture
    var d=setTimeout(()=>{u();r(new Error((0,em.__)("Thumbnail generation timed out","tutor-pro")))},3e4);// Add elements to DOM
    document.body.appendChild(n);document.body.appendChild(i);// Start loading the video
    n.src=t}catch(e){var f=e instanceof Error?e.message:"Unknown error occurred";r(new Error("Thumbnail generation failed: ".concat(f)))}})}throw new Error((0,em.__)("Unsupported video source","tutor-pro"))})();// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/fields/FormVideoInput.tsx
function wN(){var e=(0,eS._)(["\n      background-color: ",";\n    "]);wN=function t(){return e};return e}function wL(){var e=(0,eS._)(["\n      ",";\n    "]);wL=function t(){return e};return e}var wK=fy/* .tutorConfig.supported_video_sources */.P.supported_video_sources||[];var wB=wK.filter(e=>e.value!=="html5");var wj=wK.map(e=>e.value);var wU=["vimeo","youtube","html5"];var wq={youtube:(0,em.__)("Paste YouTube Video URL","tutor-pro"),vimeo:(0,em.__)("Paste Vimeo Video URL","tutor-pro"),external_url:(0,em.__)("Paste External Video URL","tutor-pro"),shortcode:(0,em.__)("Paste Video Shortcode","tutor-pro"),embedded:(0,em.__)("Paste Embedded Video Code","tutor-pro")};var wV={youtube:"youtube",vimeo:"vimeo",shortcode:"shortcode",embedded:"coding"};var wW=(e,t)=>{var r={source:"",source_video_id:"",poster:"",poster_url:"",source_html5:"",source_external_url:"",source_shortcode:"",source_youtube:"",source_vimeo:"",source_embedded:""};return e?(0,e$._)({},e,t):(0,e$._)({},r,t)};var wz={youtube:e=>{var t=e.match(aT/* .VideoRegex.YOUTUBE */.j8.YOUTUBE);return t&&t[7].length===11?t[7]:null},vimeo:e=>{var t=e.match(aT/* .VideoRegex.VIMEO */.j8.VIMEO);return(t===null||t===void 0?void 0:t[5])||null},shortcode:e=>{return e.match(aT/* .VideoRegex.SHORTCODE */.j8.SHORTCODE)?e:null},url:e=>{return e.match(aT/* .VideoRegex.EXTERNAL_URL */.j8.EXTERNAL_URL)?e:null}};var wG=e=>{var{source:t,url:r,getYouTubeVideoDurationMutation:n}=e;return fQ(function*(){try{var e=0;switch(t){case"vimeo":var i;e=(i=yield wR(r))!==null&&i!==void 0?i:0;break;case"html5":case"external_url":var a;e=(a=yield wP(r))!==null&&a!==void 0?a:0;break;case"youtube":{var o=wz.youtube(r);if(o){var s=yield n.mutateAsync(o);e=wM(s.data.duration)}break}}if(e){var l=(0,ej/* .covertSecondsToHMS */.uu)(Math.floor(e));return l}return null}catch(e){// eslint-disable-next-line no-console
console.error("Error getting video duration:",e);return null}})()};var wQ=e=>{var{field:r,fieldState:i,label:a,helpText:s,buttonText:l=(0,em.__)("Upload Media","tutor-pro"),infoText:u,onChange:c,supportedFormats:d,loading:f,onGetDuration:p}=e;var h,v,g;var m=h1({defaultValues:{videoSource:((h=wB[0])===null||h===void 0?void 0:h.value)||"",videoUrl:""}});var b=wF();var[y,_]=(0,n.useState)(false);var[w,x]=(0,n.useState)({hours:0,minutes:0,seconds:0});var[A,k]=(0,n.useState)("");var[E,I]=(0,n.useState)(false);var C=(0,n.useRef)(null);var Y=e=>fQ(function*(){if(!e){return}var t=Array.isArray(e)?e[0]:e;var n={source:"html5",source_video_id:t.id.toString(),source_html5:t.url};r.onChange(wW(r.value,n));c===null||c===void 0?void 0:c(wW(r.value,n));try{_(true);D();var i=yield wH("external_url",t.url);var a=yield wP(t.url);if(!a){return}x((0,ej/* .covertSecondsToHMS */.uu)(Math.floor(a)));if(p){p((0,ej/* .covertSecondsToHMS */.uu)(Math.floor(a)))}if(i){k(i)}}finally{_(false)}})();var{openMediaLibrary:T,resetFiles:S}=fK({options:{type:(d===null||d===void 0?void 0:d.length)?d.map(e=>"video/".concat(e)).join(","):"video"},onChange:Y});var{openMediaLibrary:O,resetFiles:D}=fK({options:{type:"image"},onChange:e=>{if(!e){return}var t=Array.isArray(e)?e[0]:e;var n={poster:t.id.toString(),poster_url:t.url};r.onChange(wW(r.value,n));c===null||c===void 0?void 0:c(wW(r.value,n))},initialFiles:((v=r.value)===null||v===void 0?void 0:v.poster)?{id:Number(r.value.poster),url:r.value.poster_url,title:""}:null});var F=m.watch("videoSource")||"";var R=r.value;(0,n.useEffect)(()=>{var e;if(!R){return}if(!R.source){var t,n;m.setValue("videoSource",(t=wB[0])===null||t===void 0?void 0:t.value);m.setValue("videoUrl",R["source_".concat((n=wB[0])===null||n===void 0?void 0:n.value)]||"");return}var i=wj.includes(R.source);if(!i){r.onChange(wW(R,{source:""}));return}m.setValue("videoSource",R.source);m.setValue("videoUrl",R["source_".concat(R.source)]||"");if(!R.poster_url&&wU.includes(R.source)){var a=R.source;_(true);wH(a,R["source_".concat(a)]||"").then(e=>{_(false);k(e)}).finally(()=>{_(false)})}if(Object.values(w).some(e=>e>0)){return}if(R.source==="vimeo"){wR(R["source_vimeo"]||"").then(e=>{if(!e){return}x((0,ej/* .covertSecondsToHMS */.uu)(Math.floor(e)));if(p){p((0,ej/* .covertSecondsToHMS */.uu)(Math.floor(e)))}})}if(["external_url","html5"].includes(R.source)){wP(R["source_".concat(R.source)]||"").then(e=>{if(!e){return}x((0,ej/* .covertSecondsToHMS */.uu)(Math.floor(e)));if(p){p((0,ej/* .covertSecondsToHMS */.uu)(Math.floor(e)))}})}if(R.source==="youtube"&&((e=fy/* .tutorConfig.settings */.P.settings)===null||e===void 0?void 0:e.youtube_api_key_exist)){var o;var s=(o=wz.youtube(R["source_youtube"]||""))!==null&&o!==void 0?o:"";b.mutateAsync(s).then(e=>{var t=e.data.duration;if(!t){return}var r=wM(t);x((0,ej/* .covertSecondsToHMS */.uu)(Math.floor(r)));if(p){p((0,ej/* .covertSecondsToHMS */.uu)(Math.floor(r)))}})}// eslint-disable-next-line react-hooks/exhaustive-deps
},[R]);if(!wj.length){return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:wX.emptyMediaWrapper,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:a,children:/*#__PURE__*/(0,t/* .jsx */.Y)("label",{children:a})}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:wX.emptyMedia({hasVideoSource:false}),children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("p",{css:wX.warningText,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"info",height:20,width:20}),(0,em.__)("No video source selected","tutor-pro")]}),/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{buttonCss:wX.selectFromSettingsButton,variant:"secondary",size:"small",icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"linkExternal",height:24,width:24}),onClick:()=>{window.open(fy/* ["default"].VIDEO_SOURCES_SETTINGS_URL */.A.VIDEO_SOURCES_SETTINGS_URL,"_blank","noopener")},children:(0,em.__)("Select from settings","tutor-pro")})]})]})}var P=e=>{if(e==="video"){T();return}O()};var M=e=>{var t=e==="video"?{source:"",source_video_id:"",poster:"",poster_url:""}:{poster:"",poster_url:""};var n=wW(R,t);if(e==="video"){S()}else{D()}r.onChange(n);k("");x({hours:0,minutes:0,seconds:0});if(c){c(n)}};var H=()=>{if(!(R===null||R===void 0?void 0:R.source)||!wj.includes(R.source)){return false}var e=R===null||R===void 0?void 0:R.source;var t="source_".concat(e);return R&&R[t]!==""};var N=e=>fQ(function*(){_(true);try{var{videoSource:t,videoUrl:n}=e;var i={source:t,["source_".concat(t)]:n};r.onChange(wW(R,i));c===null||c===void 0?void 0:c(wW(R,i));I(false);var[a,o]=yield Promise.all([wG({source:t,url:n,getYouTubeVideoDurationMutation:b}),wU.includes(t)?wH(t,n):null]);if(a){x(a);p===null||p===void 0?void 0:p(a)}if(o){k(o)}}finally{_(false)}})();var L=e=>{var t=e.trim();if(F==="embedded")return true;if(F==="shortcode"){return wz.shortcode(t)?true:(0,em.__)("Invalid Shortcode","tutor-pro")}if(!wz.url(t)){return(0,em.__)("Invalid URL","tutor-pro")}if(F==="youtube"&&!wz.youtube(t)){return(0,em.__)("Invalid YouTube URL","tutor-pro")}if(F==="vimeo"&&!wz.vimeo(t)){return(0,em.__)("Invalid Vimeo URL","tutor-pro")}return true};return/*#__PURE__*/(0,t/* .jsxs */.FD)(t/* .Fragment */.FK,{children:[/*#__PURE__*/(0,t/* .jsx */.Y)(fv,{label:a,field:r,fieldState:i,helpText:s,children:()=>{return/*#__PURE__*/(0,t/* .jsx */.Y)("div",{ref:C,children:/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:!f,fallback:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:wX.emptyMedia({hasVideoSource:true}),children:/*#__PURE__*/(0,t/* .jsx */.Y)(eE,{})}),children:/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:H(),fallback:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:wX.emptyMedia({hasVideoSource:true}),children:[/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:wj.includes("html5"),children:/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{"data-cy":"upload-media",size:"small",variant:"secondary",icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"monitorPlay",height:24,width:24}),onClick:()=>{P("video")},children:l})}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:wj.filter(e=>e!=="html5").length>0,children:/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:!wj.includes("html5"),fallback:/*#__PURE__*/(0,t/* .jsx */.Y)("button",{"data-cy":"add-from-url",type:"button",css:wX.urlButton,onClick:()=>{I(e=>!e)},children:(0,em.__)("Add from URL","tutor-pro")}),children:/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{"data-cy":"add-from-url",size:"small",variant:"secondary",icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"plusSquareBrand",height:24,width:24}),onClick:()=>{I(e=>!e)},children:(0,em.__)("Add from URL","tutor-pro")})})}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:wj.includes("html5"),children:/*#__PURE__*/(0,t/* .jsx */.Y)("p",{css:wX.infoTexts,children:u})})]}),children:()=>{var e;return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:wX.previewWrapper,"data-cy":"media-preview",children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:wX.videoInfoWrapper,children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:wX.videoInfoCard,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:wV[R===null||R===void 0?void 0:R.source]||"video",height:36,width:36}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:wX.videoInfo,children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:wX.videoInfoTitle,children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:eB/* .styleUtils.text.ellipsis */.x.text.ellipsis(1),children:wU.includes((R===null||R===void 0?void 0:R.source)||"")?R===null||R===void 0?void 0:R["source_".concat(R.source)]:(e=wK.find(e=>e.value===(R===null||R===void 0?void 0:R.source)))===null||e===void 0?void 0:e.label})})})]}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:wX.actionButtons,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:F!=="html5",children:/*#__PURE__*/(0,t/* .jsx */.Y)("button",{type:"button",css:eB/* .styleUtils.actionButton */.x.actionButton,onClick:()=>{I(true)},children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"edit",height:24,width:24})})}),/*#__PURE__*/(0,t/* .jsx */.Y)("button",{"data-cy":"remove-video",type:"button",css:eB/* .styleUtils.actionButton */.x.actionButton,onClick:()=>{M("video")},children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"cross",height:24,width:24})})]})]}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:wX.imagePreview({hasImageInput:wU.includes((R===null||R===void 0?void 0:R.source)||"")}),children:/*#__PURE__*/(0,t/* .jsxs */.FD)(ag/* ["default"] */.A,{when:wU.includes((R===null||R===void 0?void 0:R.source)||""),fallback:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:wX.urlData,children:m.watch("videoUrl")}),children:[/*#__PURE__*/(0,t/* .jsx */.Y)(_E,{value:R?{id:Number(R.poster)||0,url:R.poster_url||A,title:""}:null,loading:y,isClearAble:!!(R===null||R===void 0?void 0:R.poster),disabled:["vimeo","youtube"].includes((R===null||R===void 0?void 0:R.source)||""),uploadHandler:()=>P("poster"),clearHandler:()=>M("poster"),buttonText:(0,em.__)("Upload Thumbnail","tutor-pro"),infoText:(0,em.__)("Upload a thumbnail image for your video","tutor-pro"),emptyImageCss:wX.thumbImage,previewImageCss:wX.thumbImage,overlayCss:wX.thumbImage,replaceButtonText:(0,em.__)("Replace Thumbnail","tutor-pro")}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:w.hours>0||w.minutes>0||w.seconds>0,children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:wX.duration,children:[w.hours>0&&"".concat(w.hours,"h")," ",w.minutes,"m ",w.seconds,"s"]})})]})})]})}})})})}}),/*#__PURE__*/(0,t/* .jsx */.Y)(a7,{triggerRef:C,isOpen:E,placement:aq.MIDDLE,animationType:as.fadeIn,closePopover:()=>I(false),positionModifier:{top:17,left:0},maxWidth:"".concat(((g=C.current)===null||g===void 0?void 0:g.offsetWidth)||300,"px"),children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:wX.popoverContent,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(py,{control:m.control,name:"videoSource",rules:(0,e$._)({},bP()),render:e=>{return/*#__PURE__*/(0,t/* .jsx */.Y)(hV,(0,eX._)((0,e$._)({},e),{options:wB,disabled:wK.length<=1,placeholder:(0,em.__)("Select source","tutor-pro"),hideCaret:wK.length<=1}))}}),/*#__PURE__*/(0,t/* .jsx */.Y)(py,{control:m.control,name:"videoUrl",rules:(0,eX._)((0,e$._)({},bP()),{validate:L}),render:e=>{return/*#__PURE__*/(0,t/* .jsx */.Y)(hI,(0,eX._)((0,e$._)({},e),{inputCss:/*#__PURE__*/(0,o/* .css */.AH)("border-style:dashed;"),rows:2,placeholder:wq[F]||(0,em.__)("Paste Here","tutor-pro")}))}}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:wX.popoverButtonWrapper,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"text",size:"small",onClick:()=>{I(false)},children:(0,em.__)("Cancel","tutor-pro")}),/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{"data-cy":"submit-url",variant:"secondary",size:"small",onClick:m.handleSubmit(N),children:(0,em.__)("Ok","tutor-pro")})]})]})})]})};/* ESM default export */const w$=fx(wQ);var wX={emptyMediaWrapper:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",ey/* .spacing["4"] */.YK["4"],";label{",eK/* .typography.caption */.I.caption(),";color:",ey/* .colorTokens.text.title */.I6.text.title,";}"),emptyMedia:e=>{var{hasVideoSource:t=false}=e;return/*#__PURE__*/(0,o/* .css */.AH)("width:100%;height:164px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:",ey/* .spacing["8"] */.YK["8"],";border:1px dashed ",ey/* .colorTokens.stroke.border */.I6.stroke.border,";border-radius:",ey/* .borderRadius["8"] */.Vq["8"],";background-color:",ey/* .colorTokens.background.status.warning */.I6.background.status.warning,";",t&&(0,o/* .css */.AH)(wN(),ey/* .colorTokens.bg.white */.I6.bg.white))},infoTexts:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.tiny */.I.tiny(),";color:",ey/* .colorTokens.text.subdued */.I6.text.subdued,";"),warningText:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;gap:",ey/* .spacing["4"] */.YK["4"],";",eK/* .typography.caption */.I.caption(),";color:",ey/* .colorTokens.text.warning */.I6.text.warning,";"),selectFromSettingsButton:/*#__PURE__*/(0,o/* .css */.AH)("background:",ey/* .colorTokens.bg.white */.I6.bg.white,";"),urlData:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.caption */.I.caption(),";",eB/* .styleUtils.display.flex */.x.display.flex("column"),";padding:",ey/* .spacing["8"] */.YK["8"]," ",ey/* .spacing["12"] */.YK["12"],";gap:",ey/* .spacing["8"] */.YK["8"],";word-break:break-all;"),previewWrapper:/*#__PURE__*/(0,o/* .css */.AH)("width:100%;height:100%;border:1px solid ",ey/* .colorTokens.stroke["default"] */.I6.stroke["default"],";border-radius:",ey/* .borderRadius["8"] */.Vq["8"],";overflow:hidden;background-color:",ey/* .colorTokens.bg.white */.I6.bg.white,";"),videoInfoWrapper:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),";justify-content:space-between;align-items:center;gap:",ey/* .spacing["20"] */.YK["20"],";padding:",ey/* .spacing["8"] */.YK["8"]," ",ey/* .spacing["12"] */.YK["12"],";"),videoInfoCard:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;gap:",ey/* .spacing["8"] */.YK["8"],";svg{flex-shrink:0;color:",ey/* .colorTokens.icon.hover */.I6.icon.hover,";}"),videoInfo:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",ey/* .spacing["4"] */.YK["4"],";"),videoInfoTitle:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),";",eK/* .typography.caption */.I.caption("medium"),"    word-break:break-all;"),imagePreview:e=>{var{hasImageInput:t}=e;return/*#__PURE__*/(0,o/* .css */.AH)("width:100%;max-height:168px;position:relative;overflow:hidden;background-color:",ey/* .colorTokens.background["default"] */.I6.background["default"],";",!t&&(0,o/* .css */.AH)(wL(),eB/* .styleUtils.overflowYAuto */.x.overflowYAuto),";scrollbar-gutter:auto;&:hover{[data-hover-buttons-wrapper]{opacity:1;}}")},duration:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.tiny */.I.tiny(),";position:absolute;bottom:",ey/* .spacing["12"] */.YK["12"],";right:",ey/* .spacing["12"] */.YK["12"],";background-color:rgba(0,0,0,0.5);color:",ey/* .colorTokens.text.white */.I6.text.white,";padding:",ey/* .spacing["4"] */.YK["4"]," ",ey/* .spacing["8"] */.YK["8"],";border-radius:",ey/* .borderRadius["6"] */.Vq["6"],";pointer-events:none;"),thumbImage:/*#__PURE__*/(0,o/* .css */.AH)("border-radius:0;border:none;"),urlButton:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.resetButton */.x.resetButton,";",eK/* .typography.small */.I.small("medium"),";color:",ey/* .colorTokens.text.brand */.I6.text.brand,";border-radius:",ey/* .borderRadius["2"] */.Vq["2"],";padding:0 ",ey/* .spacing["4"] */.YK["4"],";margin-bottom:",ey/* .spacing["8"] */.YK["8"],";&:focus,&:active,&:hover{background:none;color:",ey/* .colorTokens.text.brand */.I6.text.brand,";}&:focus-visible{outline:2px solid ",ey/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:1px;}"),actionButtons:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),";gap:",ey/* .spacing["4"] */.YK["4"],";"),popover:/*#__PURE__*/(0,o/* .css */.AH)("position:absolute;width:100%;z-index:",ey/* .zIndex.dropdown */.fE.dropdown,";background-color:",ey/* .colorTokens.bg.white */.I6.bg.white,";border-radius:",ey/* .borderRadius.card */.Vq.card,";box-shadow:",ey/* .shadow.popover */.r7.popover,";"),popoverContent:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",ey/* .spacing["12"] */.YK["12"],";padding:",ey/* .spacing["16"] */.YK["16"],";"),popoverButtonWrapper:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),";gap:",ey/* .spacing["8"] */.YK["8"],";justify-content:flex-end;")};// CONCATENATED MODULE: ../tutor/node_modules/@babel/runtime/helpers/esm/typeof.js
function wJ(e){"@babel/helpers - typeof";return wJ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wJ(e)};// CONCATENATED MODULE: ../tutor/node_modules/date-fns/esm/_lib/requiredArgs/index.js
function wZ(e,t){if(t.length<e){throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}};// CONCATENATED MODULE: ../tutor/node_modules/date-fns/esm/isDate/index.js
/**
 * @name isDate
 * @category Common Helpers
 * @summary Is the given value a date?
 *
 * @description
 * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
 *
 * @param {*} value - the value to check
 * @returns {boolean} true if the given value is a date
 * @throws {TypeError} 1 arguments required
 *
 * @example
 * // For a valid date:
 * const result = isDate(new Date())
 * //=> true
 *
 * @example
 * // For an invalid date:
 * const result = isDate(new Date(NaN))
 * //=> true
 *
 * @example
 * // For some value:
 * const result = isDate('2014-02-31')
 * //=> false
 *
 * @example
 * // For an object:
 * const result = isDate({})
 * //=> false
 */function w0(e){wZ(1,arguments);return e instanceof Date||wJ(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"};// CONCATENATED MODULE: ../tutor/node_modules/date-fns/esm/toDate/index.js
/**
 * @name toDate
 * @category Common Helpers
 * @summary Convert the given argument to an instance of Date.
 *
 * @description
 * Convert the given argument to an instance of Date.
 *
 * If the argument is an instance of Date, the function returns its clone.
 *
 * If the argument is a number, it is treated as a timestamp.
 *
 * If the argument is none of the above, the function returns Invalid Date.
 *
 * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
 *
 * @param {Date|Number} argument - the value to convert
 * @returns {Date} the parsed date in the local time zone
 * @throws {TypeError} 1 argument required
 *
 * @example
 * // Clone the date:
 * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
 * //=> Tue Feb 11 2014 11:30:30
 *
 * @example
 * // Convert the timestamp to date:
 * const result = toDate(1392098430000)
 * //=> Tue Feb 11 2014 11:30:30
 */function w1(e){wZ(1,arguments);var t=Object.prototype.toString.call(e);// Clone the date
if(e instanceof Date||wJ(e)==="object"&&t==="[object Date]"){// Prevent the date to lose the milliseconds when passed to new Date() in IE10
return new Date(e.getTime())}else if(typeof e==="number"||t==="[object Number]"){return new Date(e)}else{if((typeof e==="string"||t==="[object String]")&&typeof console!=="undefined"){// eslint-disable-next-line no-console
console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");// eslint-disable-next-line no-console
console.warn(new Error().stack)}return new Date(NaN)}};// CONCATENATED MODULE: ../tutor/node_modules/date-fns/esm/isValid/index.js
/**
 * @name isValid
 * @category Common Helpers
 * @summary Is the given date valid?
 *
 * @description
 * Returns false if argument is Invalid Date and true otherwise.
 * Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}
 * Invalid Date is a Date, whose time value is NaN.
 *
 * Time value of Date: http://es5.github.io/#x15.9.1.1
 *
 * @param {*} date - the date to check
 * @returns {Boolean} the date is valid
 * @throws {TypeError} 1 argument required
 *
 * @example
 * // For the valid date:
 * const result = isValid(new Date(2014, 1, 31))
 * //=> true
 *
 * @example
 * // For the value, convertable into a date:
 * const result = isValid(1393804800000)
 * //=> true
 *
 * @example
 * // For the invalid date:
 * const result = isValid(new Date(''))
 * //=> false
 */function w2(e){wZ(1,arguments);if(!w0(e)&&typeof e!=="number"){return false}var t=w1(e);return!isNaN(Number(t))};// CONCATENATED MODULE: ../tutor/node_modules/date-fns/esm/_lib/toInteger/index.js
function w6(e){if(e===null||e===true||e===false){return NaN}var t=Number(e);if(isNaN(t)){return t}return t<0?Math.ceil(t):Math.floor(t)};// CONCATENATED MODULE: ../tutor/node_modules/date-fns/esm/addMilliseconds/index.js
/**
 * @name addMilliseconds
 * @category Millisecond Helpers
 * @summary Add the specified number of milliseconds to the given date.
 *
 * @description
 * Add the specified number of milliseconds to the given date.
 *
 * @param {Date|Number} date - the date to be changed
 * @param {Number} amount - the amount of milliseconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
 * @returns {Date} the new date with the milliseconds added
 * @throws {TypeError} 2 arguments required
 *
 * @example
 * // Add 750 milliseconds to 10 July 2014 12:45:30.000:
 * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
 * //=> Thu Jul 10 2014 12:45:30.750
 */function w4(e,t){wZ(2,arguments);var r=w1(e).getTime();var n=w6(t);return new Date(r+n)};// CONCATENATED MODULE: ../tutor/node_modules/date-fns/esm/subMilliseconds/index.js
/**
 * @name subMilliseconds
 * @category Millisecond Helpers
 * @summary Subtract the specified number of milliseconds from the given date.
 *
 * @description
 * Subtract the specified number of milliseconds from the given date.
 *
 * @param {Date|Number} date - the date to be changed
 * @param {Number} amount - the amount of milliseconds to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
 * @returns {Date} the new date with the milliseconds subtracted
 * @throws {TypeError} 2 arguments required
 *
 * @example
 * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:
 * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
 * //=> Thu Jul 10 2014 12:45:29.250
 */function w5(e,t){wZ(2,arguments);var r=w6(t);return w4(e,-r)};// CONCATENATED MODULE: ../tutor/node_modules/date-fns/esm/_lib/getUTCDayOfYear/index.js
var w3=864e5;function w8(e){wZ(1,arguments);var t=w1(e);var r=t.getTime();t.setUTCMonth(0,1);t.setUTCHours(0,0,0,0);var n=t.getTime();var i=r-n;return Math.floor(i/w3)+1};// CONCATENATED MODULE: ../tutor/node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js
function w9(e){wZ(1,arguments);var t=1;var r=w1(e);var n=r.getUTCDay();var i=(n<t?7:0)+n-t;r.setUTCDate(r.getUTCDate()-i);r.setUTCHours(0,0,0,0);return r};// CONCATENATED MODULE: ../tutor/node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js
function w7(e){wZ(1,arguments);var t=w1(e);var r=t.getUTCFullYear();var n=new Date(0);n.setUTCFullYear(r+1,0,4);n.setUTCHours(0,0,0,0);var i=w9(n);var a=new Date(0);a.setUTCFullYear(r,0,4);a.setUTCHours(0,0,0,0);var o=w9(a);if(t.getTime()>=i.getTime()){return r+1}else if(t.getTime()>=o.getTime()){return r}else{return r-1}};// CONCATENATED MODULE: ../tutor/node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js
function xe(e){wZ(1,arguments);var t=w7(e);var r=new Date(0);r.setUTCFullYear(t,0,4);r.setUTCHours(0,0,0,0);var n=w9(r);return n};// CONCATENATED MODULE: ../tutor/node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js
var xt=6048e5;function xr(e){wZ(1,arguments);var t=w1(e);var r=w9(t).getTime()-xe(t).getTime();// Round the number of days to the nearest integer
// because the number of milliseconds in a week is not constant
// (e.g. it's different in the week of the daylight saving time clock shift)
return Math.round(r/xt)+1};// CONCATENATED MODULE: ../tutor/node_modules/date-fns/esm/_lib/defaultOptions/index.js
var xn={};function xi(){return xn}function xa(e){xn=e};// CONCATENATED MODULE: ../tutor/node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js
function xo(e,t){var r,n,i,a,o,s,l,u;wZ(1,arguments);var c=xi();var d=w6((r=(n=(i=(a=t===null||t===void 0?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t===null||t===void 0?void 0:(o=t.locale)===null||o===void 0?void 0:(s=o.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&i!==void 0?i:c.weekStartsOn)!==null&&n!==void 0?n:(l=c.locale)===null||l===void 0?void 0:(u=l.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&r!==void 0?r:0);// Test if weekStartsOn is between 0 and 6 _and_ is not NaN
if(!(d>=0&&d<=6)){throw new RangeError("weekStartsOn must be between 0 and 6 inclusively")}var f=w1(e);var p=f.getUTCDay();var h=(p<d?7:0)+p-d;f.setUTCDate(f.getUTCDate()-h);f.setUTCHours(0,0,0,0);return f};// CONCATENATED MODULE: ../tutor/node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js
function xs(e,t){var r,n,i,a,o,s,l,u;wZ(1,arguments);var c=w1(e);var d=c.getUTCFullYear();var f=xi();var p=w6((r=(n=(i=(a=t===null||t===void 0?void 0:t.firstWeekContainsDate)!==null&&a!==void 0?a:t===null||t===void 0?void 0:(o=t.locale)===null||o===void 0?void 0:(s=o.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&i!==void 0?i:f.firstWeekContainsDate)!==null&&n!==void 0?n:(l=f.locale)===null||l===void 0?void 0:(u=l.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&r!==void 0?r:1);// Test if weekStartsOn is between 1 and 7 _and_ is not NaN
if(!(p>=1&&p<=7)){throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively")}var h=new Date(0);h.setUTCFullYear(d+1,0,p);h.setUTCHours(0,0,0,0);var v=xo(h,t);var g=new Date(0);g.setUTCFullYear(d,0,p);g.setUTCHours(0,0,0,0);var m=xo(g,t);if(c.getTime()>=v.getTime()){return d+1}else if(c.getTime()>=m.getTime()){return d}else{return d-1}};// CONCATENATED MODULE: ../tutor/node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js
function xl(e,t){var r,n,i,a,o,s,l,u;wZ(1,arguments);var c=xi();var d=w6((r=(n=(i=(a=t===null||t===void 0?void 0:t.firstWeekContainsDate)!==null&&a!==void 0?a:t===null||t===void 0?void 0:(o=t.locale)===null||o===void 0?void 0:(s=o.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&i!==void 0?i:c.firstWeekContainsDate)!==null&&n!==void 0?n:(l=c.locale)===null||l===void 0?void 0:(u=l.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&r!==void 0?r:1);var f=xs(e,t);var p=new Date(0);p.setUTCFullYear(f,0,d);p.setUTCHours(0,0,0,0);var h=xo(p,t);return h};// CONCATENATED MODULE: ../tutor/node_modules/date-fns/esm/_lib/getUTCWeek/index.js
var xu=6048e5;function xc(e,t){wZ(1,arguments);var r=w1(e);var n=xo(r,t).getTime()-xl(r,t).getTime();// Round the number of days to the nearest integer
// because the number of milliseconds in a week is not constant
// (e.g. it's different in the week of the daylight saving time clock shift)
return Math.round(n/xu)+1};// CONCATENATED MODULE: ../tutor/node_modules/date-fns/esm/_lib/addLeadingZeros/index.js
function xd(e,t){var r=e<0?"-":"";var n=Math.abs(e).toString();while(n.length<t){n="0"+n}return r+n};// CONCATENATED MODULE: ../tutor/node_modules/date-fns/esm/_lib/format/lightFormatters/index.js
/*
 * |     | Unit                           |     | Unit                           |
 * |-----|--------------------------------|-----|--------------------------------|
 * |  a  | AM, PM                         |  A* |                                |
 * |  d  | Day of month                   |  D  |                                |
 * |  h  | Hour [1-12]                    |  H  | Hour [0-23]                    |
 * |  m  | Minute                         |  M  | Month                          |
 * |  s  | Second                         |  S  | Fraction of second             |
 * |  y  | Year (abs)                     |  Y  |                                |
 *
 * Letters marked by * are not implemented but reserved by Unicode standard.
 */var xf={// Year
y:function e(e,t){// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
// | Year     |     y | yy |   yyy |  yyyy | yyyyy |
// |----------|-------|----|-------|-------|-------|
// | AD 1     |     1 | 01 |   001 |  0001 | 00001 |
// | AD 12    |    12 | 12 |   012 |  0012 | 00012 |
// | AD 123   |   123 | 23 |   123 |  0123 | 00123 |
// | AD 1234  |  1234 | 34 |  1234 |  1234 | 01234 |
// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
var r=e.getUTCFullYear();// Returns 1 for 1 BC (which is year 0 in JavaScript)
var n=r>0?r:1-r;return xd(t==="yy"?n%100:n,t.length)},// Month
M:function e(e,t){var r=e.getUTCMonth();return t==="M"?String(r+1):xd(r+1,2)},// Day of the month
d:function e(e,t){return xd(e.getUTCDate(),t.length)},// AM or PM
a:function e(e,t){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},// Hour [1-12]
h:function e(e,t){return xd(e.getUTCHours()%12||12,t.length)},// Hour [0-23]
H:function e(e,t){return xd(e.getUTCHours(),t.length)},// Minute
m:function e(e,t){return xd(e.getUTCMinutes(),t.length)},// Second
s:function e(e,t){return xd(e.getUTCSeconds(),t.length)},// Fraction of second
S:function e(e,t){var r=t.length;var n=e.getUTCMilliseconds();var i=Math.floor(n*Math.pow(10,r-3));return xd(i,t.length)}};/* ESM default export */const xp=xf;// CONCATENATED MODULE: ../tutor/node_modules/date-fns/esm/_lib/format/formatters/index.js
var xh={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"};/*
 * |     | Unit                           |     | Unit                           |
 * |-----|--------------------------------|-----|--------------------------------|
 * |  a  | AM, PM                         |  A* | Milliseconds in day            |
 * |  b  | AM, PM, noon, midnight         |  B  | Flexible day period            |
 * |  c  | Stand-alone local day of week  |  C* | Localized hour w/ day period   |
 * |  d  | Day of month                   |  D  | Day of year                    |
 * |  e  | Local day of week              |  E  | Day of week                    |
 * |  f  |                                |  F* | Day of week in month           |
 * |  g* | Modified Julian day            |  G  | Era                            |
 * |  h  | Hour [1-12]                    |  H  | Hour [0-23]                    |
 * |  i! | ISO day of week                |  I! | ISO week of year               |
 * |  j* | Localized hour w/ day period   |  J* | Localized hour w/o day period  |
 * |  k  | Hour [1-24]                    |  K  | Hour [0-11]                    |
 * |  l* | (deprecated)                   |  L  | Stand-alone month              |
 * |  m  | Minute                         |  M  | Month                          |
 * |  n  |                                |  N  |                                |
 * |  o! | Ordinal number modifier        |  O  | Timezone (GMT)                 |
 * |  p! | Long localized time            |  P! | Long localized date            |
 * |  q  | Stand-alone quarter            |  Q  | Quarter                        |
 * |  r* | Related Gregorian year         |  R! | ISO week-numbering year        |
 * |  s  | Second                         |  S  | Fraction of second             |
 * |  t! | Seconds timestamp              |  T! | Milliseconds timestamp         |
 * |  u  | Extended year                  |  U* | Cyclic year                    |
 * |  v* | Timezone (generic non-locat.)  |  V* | Timezone (location)            |
 * |  w  | Local week of year             |  W* | Week of month                  |
 * |  x  | Timezone (ISO-8601 w/o Z)      |  X  | Timezone (ISO-8601)            |
 * |  y  | Year (abs)                     |  Y  | Local week-numbering year      |
 * |  z  | Timezone (specific non-locat.) |  Z* | Timezone (aliases)             |
 *
 * Letters marked by * are not implemented but reserved by Unicode standard.
 *
 * Letters marked by ! are non-standard, but implemented by date-fns:
 * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
 * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
 *   i.e. 7 for Sunday, 1 for Monday, etc.
 * - `I` is ISO week of year, as opposed to `w` which is local week of year.
 * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
 *   `R` is supposed to be used in conjunction with `I` and `i`
 *   for universal ISO week-numbering date, whereas
 *   `Y` is supposed to be used in conjunction with `w` and `e`
 *   for week-numbering date specific to the locale.
 * - `P` is long localized date format
 * - `p` is long localized time format
 */var xv={// Era
G:function e(e,t,r){var n=e.getUTCFullYear()>0?1:0;switch(t){// AD, BC
case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});// A, B
case"GGGGG":return r.era(n,{width:"narrow"});// Anno Domini, Before Christ
case"GGGG":default:return r.era(n,{width:"wide"})}},// Year
y:function e(e,t,r){// Ordinal number
if(t==="yo"){var n=e.getUTCFullYear();// Returns 1 for 1 BC (which is year 0 in JavaScript)
var i=n>0?n:1-n;return r.ordinalNumber(i,{unit:"year"})}return xp.y(e,t)},// Local week-numbering year
Y:function e(e,t,r,n){var i=xs(e,n);// Returns 1 for 1 BC (which is year 0 in JavaScript)
var a=i>0?i:1-i;// Two digit year
if(t==="YY"){var o=a%100;return xd(o,2)}// Ordinal number
if(t==="Yo"){return r.ordinalNumber(a,{unit:"year"})}// Padding
return xd(a,t.length)},// ISO week-numbering year
R:function e(e,t){var r=w7(e);// Padding
return xd(r,t.length)},// Extended year. This is a single number designating the year of this calendar system.
// The main difference between `y` and `u` localizers are B.C. years:
// | Year | `y` | `u` |
// |------|-----|-----|
// | AC 1 |   1 |   1 |
// | BC 1 |   1 |   0 |
// | BC 2 |   2 |  -1 |
// Also `yy` always returns the last two digits of a year,
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
u:function e(e,t){var r=e.getUTCFullYear();return xd(r,t.length)},// Quarter
Q:function e(e,t,r){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){// 1, 2, 3, 4
case"Q":return String(n);// 01, 02, 03, 04
case"QQ":return xd(n,2);// 1st, 2nd, 3rd, 4th
case"Qo":return r.ordinalNumber(n,{unit:"quarter"});// Q1, Q2, Q3, Q4
case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});// 1, 2, 3, 4 (narrow quarter; could be not numerical)
case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});// 1st quarter, 2nd quarter, ...
case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},// Stand-alone quarter
q:function e(e,t,r){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){// 1, 2, 3, 4
case"q":return String(n);// 01, 02, 03, 04
case"qq":return xd(n,2);// 1st, 2nd, 3rd, 4th
case"qo":return r.ordinalNumber(n,{unit:"quarter"});// Q1, Q2, Q3, Q4
case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});// 1, 2, 3, 4 (narrow quarter; could be not numerical)
case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});// 1st quarter, 2nd quarter, ...
case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},// Month
M:function e(e,t,r){var n=e.getUTCMonth();switch(t){case"M":case"MM":return xp.M(e,t);// 1st, 2nd, ..., 12th
case"Mo":return r.ordinalNumber(n+1,{unit:"month"});// Jan, Feb, ..., Dec
case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});// J, F, ..., D
case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});// January, February, ..., December
case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},// Stand-alone month
L:function e(e,t,r){var n=e.getUTCMonth();switch(t){// 1, 2, ..., 12
case"L":return String(n+1);// 01, 02, ..., 12
case"LL":return xd(n+1,2);// 1st, 2nd, ..., 12th
case"Lo":return r.ordinalNumber(n+1,{unit:"month"});// Jan, Feb, ..., Dec
case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});// J, F, ..., D
case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});// January, February, ..., December
case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},// Local week of year
w:function e(e,t,r,n){var i=xc(e,n);if(t==="wo"){return r.ordinalNumber(i,{unit:"week"})}return xd(i,t.length)},// ISO week of year
I:function e(e,t,r){var n=xr(e);if(t==="Io"){return r.ordinalNumber(n,{unit:"week"})}return xd(n,t.length)},// Day of the month
d:function e(e,t,r){if(t==="do"){return r.ordinalNumber(e.getUTCDate(),{unit:"date"})}return xp.d(e,t)},// Day of year
D:function e(e,t,r){var n=w8(e);if(t==="Do"){return r.ordinalNumber(n,{unit:"dayOfYear"})}return xd(n,t.length)},// Day of week
E:function e(e,t,r){var n=e.getUTCDay();switch(t){// Tue
case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});// T
case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});// Tu
case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});// Tuesday
case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},// Local day of week
e:function e(e,t,r,n){var i=e.getUTCDay();var a=(i-n.weekStartsOn+8)%7||7;switch(t){// Numerical value (Nth day of week with current locale or weekStartsOn)
case"e":return String(a);// Padded numerical value
case"ee":return xd(a,2);// 1st, 2nd, ..., 7th
case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});// T
case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});// Tu
case"eeeeee":return r.day(i,{width:"short",context:"formatting"});// Tuesday
case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},// Stand-alone local day of week
c:function e(e,t,r,n){var i=e.getUTCDay();var a=(i-n.weekStartsOn+8)%7||7;switch(t){// Numerical value (same as in `e`)
case"c":return String(a);// Padded numerical value
case"cc":return xd(a,t.length);// 1st, 2nd, ..., 7th
case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});// T
case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});// Tu
case"cccccc":return r.day(i,{width:"short",context:"standalone"});// Tuesday
case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},// ISO day of week
i:function e(e,t,r){var n=e.getUTCDay();var i=n===0?7:n;switch(t){// 2
case"i":return String(i);// 02
case"ii":return xd(i,t.length);// 2nd
case"io":return r.ordinalNumber(i,{unit:"day"});// Tue
case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});// T
case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});// Tu
case"iiiiii":return r.day(n,{width:"short",context:"formatting"});// Tuesday
case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},// AM or PM
a:function e(e,t,r){var n=e.getUTCHours();var i=n/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},// AM, PM, midnight, noon
b:function e(e,t,r){var n=e.getUTCHours();var i;if(n===12){i=xh.noon}else if(n===0){i=xh.midnight}else{i=n/12>=1?"pm":"am"}switch(t){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},// in the morning, in the afternoon, in the evening, at night
B:function e(e,t,r){var n=e.getUTCHours();var i;if(n>=17){i=xh.evening}else if(n>=12){i=xh.afternoon}else if(n>=4){i=xh.morning}else{i=xh.night}switch(t){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},// Hour [1-12]
h:function e(e,t,r){if(t==="ho"){var n=e.getUTCHours()%12;if(n===0)n=12;return r.ordinalNumber(n,{unit:"hour"})}return xp.h(e,t)},// Hour [0-23]
H:function e(e,t,r){if(t==="Ho"){return r.ordinalNumber(e.getUTCHours(),{unit:"hour"})}return xp.H(e,t)},// Hour [0-11]
K:function e(e,t,r){var n=e.getUTCHours()%12;if(t==="Ko"){return r.ordinalNumber(n,{unit:"hour"})}return xd(n,t.length)},// Hour [1-24]
k:function e(e,t,r){var n=e.getUTCHours();if(n===0)n=24;if(t==="ko"){return r.ordinalNumber(n,{unit:"hour"})}return xd(n,t.length)},// Minute
m:function e(e,t,r){if(t==="mo"){return r.ordinalNumber(e.getUTCMinutes(),{unit:"minute"})}return xp.m(e,t)},// Second
s:function e(e,t,r){if(t==="so"){return r.ordinalNumber(e.getUTCSeconds(),{unit:"second"})}return xp.s(e,t)},// Fraction of second
S:function e(e,t){return xp.S(e,t)},// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
X:function e(e,t,r,n){var i=n._originalDate||e;var a=i.getTimezoneOffset();if(a===0){return"Z"}switch(t){// Hours and optional minutes
case"X":return xm(a);// Hours, minutes and optional seconds without `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `XX`
case"XXXX":case"XX":// Hours and minutes without `:` delimiter
return xb(a);// Hours, minutes and optional seconds with `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `XXX`
case"XXXXX":case"XXX":default:return xb(a,":")}},// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
x:function e(e,t,r,n){var i=n._originalDate||e;var a=i.getTimezoneOffset();switch(t){// Hours and optional minutes
case"x":return xm(a);// Hours, minutes and optional seconds without `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `xx`
case"xxxx":case"xx":// Hours and minutes without `:` delimiter
return xb(a);// Hours, minutes and optional seconds with `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `xxx`
case"xxxxx":case"xxx":default:return xb(a,":")}},// Timezone (GMT)
O:function e(e,t,r,n){var i=n._originalDate||e;var a=i.getTimezoneOffset();switch(t){// Short
case"O":case"OO":case"OOO":return"GMT"+xg(a,":");// Long
case"OOOO":default:return"GMT"+xb(a,":")}},// Timezone (specific non-location)
z:function e(e,t,r,n){var i=n._originalDate||e;var a=i.getTimezoneOffset();switch(t){// Short
case"z":case"zz":case"zzz":return"GMT"+xg(a,":");// Long
case"zzzz":default:return"GMT"+xb(a,":")}},// Seconds timestamp
t:function e(e,t,r,n){var i=n._originalDate||e;var a=Math.floor(i.getTime()/1e3);return xd(a,t.length)},// Milliseconds timestamp
T:function e(e,t,r,n){var i=n._originalDate||e;var a=i.getTime();return xd(a,t.length)}};function xg(e,t){var r=e>0?"-":"+";var n=Math.abs(e);var i=Math.floor(n/60);var a=n%60;if(a===0){return r+String(i)}var o=t||"";return r+String(i)+o+xd(a,2)}function xm(e,t){if(e%60===0){var r=e>0?"-":"+";return r+xd(Math.abs(e)/60,2)}return xb(e,t)}function xb(e,t){var r=t||"";var n=e>0?"-":"+";var i=Math.abs(e);var a=xd(Math.floor(i/60),2);var o=xd(i%60,2);return n+a+r+o}/* ESM default export */const xy=xv;// CONCATENATED MODULE: ../tutor/node_modules/date-fns/esm/_lib/format/longFormatters/index.js
var x_=function e(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}};var xw=function e(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}};var xx=function e(e,t){var r=e.match(/(P+)(p+)?/)||[];var n=r[1];var i=r[2];if(!i){return x_(e,t)}var a;switch(n){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",x_(n,t)).replace("{{time}}",xw(i,t))};var xA={p:xw,P:xx};/* ESM default export */const xk=xA;// CONCATENATED MODULE: ../tutor/node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js
/**
 * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
 * They usually appear for dates that denote time before the timezones were introduced
 * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
 * and GMT+01:00:00 after that date)
 *
 * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
 * which would lead to incorrect calculations.
 *
 * This function returns the timezone offset in milliseconds that takes seconds in account.
 */function xE(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));t.setUTCFullYear(e.getFullYear());return e.getTime()-t.getTime()};// CONCATENATED MODULE: ../tutor/node_modules/date-fns/esm/_lib/protectedTokens/index.js
var xI=["D","DD"];var xC=["YY","YYYY"];function xY(e){return xI.indexOf(e)!==-1}function xT(e){return xC.indexOf(e)!==-1}function xS(e,t,r){if(e==="YYYY"){throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}else if(e==="YY"){throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}else if(e==="D"){throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}else if(e==="DD"){throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}};// CONCATENATED MODULE: ../tutor/node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js
var xO={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};var xD=function e(e,t,r){var n;var i=xO[e];if(typeof i==="string"){n=i}else if(t===1){n=i.one}else{n=i.other.replace("{{count}}",t.toString())}if(r!==null&&r!==void 0&&r.addSuffix){if(r.comparison&&r.comparison>0){return"in "+n}else{return n+" ago"}}return n};/* ESM default export */const xF=xD;// CONCATENATED MODULE: ../tutor/node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js
function xR(e){return function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};// TODO: Remove String()
var r=t.width?String(t.width):e.defaultWidth;var n=e.formats[r]||e.formats[e.defaultWidth];return n}};// CONCATENATED MODULE: ../tutor/node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js
var xP={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"};var xM={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"};var xH={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"};var xN={date:xR({formats:xP,defaultWidth:"full"}),time:xR({formats:xM,defaultWidth:"full"}),dateTime:xR({formats:xH,defaultWidth:"full"})};/* ESM default export */const xL=xN;// CONCATENATED MODULE: ../tutor/node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js
var xK={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};var xB=function e(e,t,r,n){return xK[e]};/* ESM default export */const xj=xB;// CONCATENATED MODULE: ../tutor/node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js
function xU(e){return function(t,r){var n=r!==null&&r!==void 0&&r.context?String(r.context):"standalone";var i;if(n==="formatting"&&e.formattingValues){var a=e.defaultFormattingWidth||e.defaultWidth;var o=r!==null&&r!==void 0&&r.width?String(r.width):a;i=e.formattingValues[o]||e.formattingValues[a]}else{var s=e.defaultWidth;var l=r!==null&&r!==void 0&&r.width?String(r.width):e.defaultWidth;i=e.values[l]||e.values[s]}var u=e.argumentCallback?e.argumentCallback(t):t;// @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!
return i[u]}};// CONCATENATED MODULE: ../tutor/node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js
var xq={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]};var xV={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]};// Note: in English, the names of days of the week and months are capitalized.
// If you are making a new locale based on this one, check if the same is true for the language you're working on.
// Generally, formatted dates should look like they are in the middle of a sentence,
// e.g. in Spanish language the weekdays and months should be in the lowercase.
var xW={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]};var xz={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]};var xG={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}};var xQ={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}};var x$=function e(e,t){var r=Number(e);// If ordinal numbers depend on context, for example,
// if they are different for different grammatical genders,
// use `options.unit`.
//
// `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
// 'day', 'hour', 'minute', 'second'.
var n=r%100;if(n>20||n<10){switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}}return r+"th"};var xX={ordinalNumber:x$,era:xU({values:xq,defaultWidth:"wide"}),quarter:xU({values:xV,defaultWidth:"wide",argumentCallback:function e(e){return e-1}}),month:xU({values:xW,defaultWidth:"wide"}),day:xU({values:xz,defaultWidth:"wide"}),dayPeriod:xU({values:xG,defaultWidth:"wide",formattingValues:xQ,defaultFormattingWidth:"wide"})};/* ESM default export */const xJ=xX;// CONCATENATED MODULE: ../tutor/node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js
function xZ(e){return function(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var n=r.width;var i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth];var a=t.match(i);if(!a){return null}var o=a[0];var s=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth];var l=Array.isArray(s)?x1(s,function(e){return e.test(o)}):x0(s,function(e){return e.test(o)});var u;u=e.valueCallback?e.valueCallback(l):l;u=r.valueCallback?r.valueCallback(u):u;var c=t.slice(o.length);return{value:u,rest:c}}}function x0(e,t){for(var r in e){if(e.hasOwnProperty(r)&&t(e[r])){return r}}return undefined}function x1(e,t){for(var r=0;r<e.length;r++){if(t(e[r])){return r}}return undefined};// CONCATENATED MODULE: ../tutor/node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js
function x2(e){return function(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var n=t.match(e.matchPattern);if(!n)return null;var i=n[0];var a=t.match(e.parsePattern);if(!a)return null;var o=e.valueCallback?e.valueCallback(a[0]):a[0];o=r.valueCallback?r.valueCallback(o):o;var s=t.slice(i.length);return{value:o,rest:s}}};// CONCATENATED MODULE: ../tutor/node_modules/date-fns/esm/locale/en-US/_lib/match/index.js
var x6=/^(\d+)(th|st|nd|rd)?/i;var x4=/\d+/i;var x5={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i};var x3={any:[/^b/i,/^(a|c)/i]};var x8={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i};var x9={any:[/1/i,/2/i,/3/i,/4/i]};var x7={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i};var Ae={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]};var At={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i};var Ar={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]};var An={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i};var Ai={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}};var Aa={ordinalNumber:x2({matchPattern:x6,parsePattern:x4,valueCallback:function e(e){return parseInt(e,10)}}),era:xZ({matchPatterns:x5,defaultMatchWidth:"wide",parsePatterns:x3,defaultParseWidth:"any"}),quarter:xZ({matchPatterns:x8,defaultMatchWidth:"wide",parsePatterns:x9,defaultParseWidth:"any",valueCallback:function e(e){return e+1}}),month:xZ({matchPatterns:x7,defaultMatchWidth:"wide",parsePatterns:Ae,defaultParseWidth:"any"}),day:xZ({matchPatterns:At,defaultMatchWidth:"wide",parsePatterns:Ar,defaultParseWidth:"any"}),dayPeriod:xZ({matchPatterns:An,defaultMatchWidth:"any",parsePatterns:Ai,defaultParseWidth:"any"})};/* ESM default export */const Ao=Aa;// CONCATENATED MODULE: ../tutor/node_modules/date-fns/esm/locale/en-US/index.js
/**
 * @type {Locale}
 * @category Locales
 * @summary English locale (United States).
 * @language English
 * @iso-639-2 eng
 * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
 * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
 */var As={code:"en-US",formatDistance:xF,formatLong:xL,formatRelative:xj,localize:xJ,match:Ao,options:{weekStartsOn:0/* Sunday */,firstWeekContainsDate:1}};/* ESM default export */const Al=As;// CONCATENATED MODULE: ../tutor/node_modules/date-fns/esm/_lib/defaultLocale/index.js
/* ESM default export */const Au=Al;// CONCATENATED MODULE: ../tutor/node_modules/date-fns/esm/format/index.js
// This RegExp consists of three parts separated by `|`:
// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
//   (one of the certain letters followed by `o`)
// - (\w)\1* matches any sequences of the same letter
// - '' matches two quote characters in a row
// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
//   except a single quote symbol, which ends the sequence.
//   Two quote characters do not end the sequence.
//   If there is no matching single quote
//   then the sequence will continue until the end of the string.
// - . matches any single character unmatched by previous parts of the RegExps
var Ac=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;// This RegExp catches symbols escaped by quotes, and also
// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
var Ad=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;var Af=/^'([^]*?)'?$/;var Ap=/''/g;var Ah=/[a-zA-Z]/;/**
 * @name format
 * @category Common Helpers
 * @summary Format the date.
 *
 * @description
 * Return the formatted date string in the given format. The result may vary by locale.
 *
 * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
 * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
 *
 * The characters wrapped between two single quotes characters (') are escaped.
 * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
 * (see the last example)
 *
 * Format of the string is based on Unicode Technical Standard #35:
 * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
 * with a few additions (see note 7 below the table).
 *
 * Accepted patterns:
 * | Unit                            | Pattern | Result examples                   | Notes |
 * |---------------------------------|---------|-----------------------------------|-------|
 * | Era                             | G..GGG  | AD, BC                            |       |
 * |                                 | GGGG    | Anno Domini, Before Christ        | 2     |
 * |                                 | GGGGG   | A, B                              |       |
 * | Calendar year                   | y       | 44, 1, 1900, 2017                 | 5     |
 * |                                 | yo      | 44th, 1st, 0th, 17th              | 5,7   |
 * |                                 | yy      | 44, 01, 00, 17                    | 5     |
 * |                                 | yyy     | 044, 001, 1900, 2017              | 5     |
 * |                                 | yyyy    | 0044, 0001, 1900, 2017            | 5     |
 * |                                 | yyyyy   | ...                               | 3,5   |
 * | Local week-numbering year       | Y       | 44, 1, 1900, 2017                 | 5     |
 * |                                 | Yo      | 44th, 1st, 1900th, 2017th         | 5,7   |
 * |                                 | YY      | 44, 01, 00, 17                    | 5,8   |
 * |                                 | YYY     | 044, 001, 1900, 2017              | 5     |
 * |                                 | YYYY    | 0044, 0001, 1900, 2017            | 5,8   |
 * |                                 | YYYYY   | ...                               | 3,5   |
 * | ISO week-numbering year         | R       | -43, 0, 1, 1900, 2017             | 5,7   |
 * |                                 | RR      | -43, 00, 01, 1900, 2017           | 5,7   |
 * |                                 | RRR     | -043, 000, 001, 1900, 2017        | 5,7   |
 * |                                 | RRRR    | -0043, 0000, 0001, 1900, 2017     | 5,7   |
 * |                                 | RRRRR   | ...                               | 3,5,7 |
 * | Extended year                   | u       | -43, 0, 1, 1900, 2017             | 5     |
 * |                                 | uu      | -43, 01, 1900, 2017               | 5     |
 * |                                 | uuu     | -043, 001, 1900, 2017             | 5     |
 * |                                 | uuuu    | -0043, 0001, 1900, 2017           | 5     |
 * |                                 | uuuuu   | ...                               | 3,5   |
 * | Quarter (formatting)            | Q       | 1, 2, 3, 4                        |       |
 * |                                 | Qo      | 1st, 2nd, 3rd, 4th                | 7     |
 * |                                 | QQ      | 01, 02, 03, 04                    |       |
 * |                                 | QQQ     | Q1, Q2, Q3, Q4                    |       |
 * |                                 | QQQQ    | 1st quarter, 2nd quarter, ...     | 2     |
 * |                                 | QQQQQ   | 1, 2, 3, 4                        | 4     |
 * | Quarter (stand-alone)           | q       | 1, 2, 3, 4                        |       |
 * |                                 | qo      | 1st, 2nd, 3rd, 4th                | 7     |
 * |                                 | qq      | 01, 02, 03, 04                    |       |
 * |                                 | qqq     | Q1, Q2, Q3, Q4                    |       |
 * |                                 | qqqq    | 1st quarter, 2nd quarter, ...     | 2     |
 * |                                 | qqqqq   | 1, 2, 3, 4                        | 4     |
 * | Month (formatting)              | M       | 1, 2, ..., 12                     |       |
 * |                                 | Mo      | 1st, 2nd, ..., 12th               | 7     |
 * |                                 | MM      | 01, 02, ..., 12                   |       |
 * |                                 | MMM     | Jan, Feb, ..., Dec                |       |
 * |                                 | MMMM    | January, February, ..., December  | 2     |
 * |                                 | MMMMM   | J, F, ..., D                      |       |
 * | Month (stand-alone)             | L       | 1, 2, ..., 12                     |       |
 * |                                 | Lo      | 1st, 2nd, ..., 12th               | 7     |
 * |                                 | LL      | 01, 02, ..., 12                   |       |
 * |                                 | LLL     | Jan, Feb, ..., Dec                |       |
 * |                                 | LLLL    | January, February, ..., December  | 2     |
 * |                                 | LLLLL   | J, F, ..., D                      |       |
 * | Local week of year              | w       | 1, 2, ..., 53                     |       |
 * |                                 | wo      | 1st, 2nd, ..., 53th               | 7     |
 * |                                 | ww      | 01, 02, ..., 53                   |       |
 * | ISO week of year                | I       | 1, 2, ..., 53                     | 7     |
 * |                                 | Io      | 1st, 2nd, ..., 53th               | 7     |
 * |                                 | II      | 01, 02, ..., 53                   | 7     |
 * | Day of month                    | d       | 1, 2, ..., 31                     |       |
 * |                                 | do      | 1st, 2nd, ..., 31st               | 7     |
 * |                                 | dd      | 01, 02, ..., 31                   |       |
 * | Day of year                     | D       | 1, 2, ..., 365, 366               | 9     |
 * |                                 | Do      | 1st, 2nd, ..., 365th, 366th       | 7     |
 * |                                 | DD      | 01, 02, ..., 365, 366             | 9     |
 * |                                 | DDD     | 001, 002, ..., 365, 366           |       |
 * |                                 | DDDD    | ...                               | 3     |
 * | Day of week (formatting)        | E..EEE  | Mon, Tue, Wed, ..., Sun           |       |
 * |                                 | EEEE    | Monday, Tuesday, ..., Sunday      | 2     |
 * |                                 | EEEEE   | M, T, W, T, F, S, S               |       |
 * |                                 | EEEEEE  | Mo, Tu, We, Th, Fr, Sa, Su        |       |
 * | ISO day of week (formatting)    | i       | 1, 2, 3, ..., 7                   | 7     |
 * |                                 | io      | 1st, 2nd, ..., 7th                | 7     |
 * |                                 | ii      | 01, 02, ..., 07                   | 7     |
 * |                                 | iii     | Mon, Tue, Wed, ..., Sun           | 7     |
 * |                                 | iiii    | Monday, Tuesday, ..., Sunday      | 2,7   |
 * |                                 | iiiii   | M, T, W, T, F, S, S               | 7     |
 * |                                 | iiiiii  | Mo, Tu, We, Th, Fr, Sa, Su        | 7     |
 * | Local day of week (formatting)  | e       | 2, 3, 4, ..., 1                   |       |
 * |                                 | eo      | 2nd, 3rd, ..., 1st                | 7     |
 * |                                 | ee      | 02, 03, ..., 01                   |       |
 * |                                 | eee     | Mon, Tue, Wed, ..., Sun           |       |
 * |                                 | eeee    | Monday, Tuesday, ..., Sunday      | 2     |
 * |                                 | eeeee   | M, T, W, T, F, S, S               |       |
 * |                                 | eeeeee  | Mo, Tu, We, Th, Fr, Sa, Su        |       |
 * | Local day of week (stand-alone) | c       | 2, 3, 4, ..., 1                   |       |
 * |                                 | co      | 2nd, 3rd, ..., 1st                | 7     |
 * |                                 | cc      | 02, 03, ..., 01                   |       |
 * |                                 | ccc     | Mon, Tue, Wed, ..., Sun           |       |
 * |                                 | cccc    | Monday, Tuesday, ..., Sunday      | 2     |
 * |                                 | ccccc   | M, T, W, T, F, S, S               |       |
 * |                                 | cccccc  | Mo, Tu, We, Th, Fr, Sa, Su        |       |
 * | AM, PM                          | a..aa   | AM, PM                            |       |
 * |                                 | aaa     | am, pm                            |       |
 * |                                 | aaaa    | a.m., p.m.                        | 2     |
 * |                                 | aaaaa   | a, p                              |       |
 * | AM, PM, noon, midnight          | b..bb   | AM, PM, noon, midnight            |       |
 * |                                 | bbb     | am, pm, noon, midnight            |       |
 * |                                 | bbbb    | a.m., p.m., noon, midnight        | 2     |
 * |                                 | bbbbb   | a, p, n, mi                       |       |
 * | Flexible day period             | B..BBB  | at night, in the morning, ...     |       |
 * |                                 | BBBB    | at night, in the morning, ...     | 2     |
 * |                                 | BBBBB   | at night, in the morning, ...     |       |
 * | Hour [1-12]                     | h       | 1, 2, ..., 11, 12                 |       |
 * |                                 | ho      | 1st, 2nd, ..., 11th, 12th         | 7     |
 * |                                 | hh      | 01, 02, ..., 11, 12               |       |
 * | Hour [0-23]                     | H       | 0, 1, 2, ..., 23                  |       |
 * |                                 | Ho      | 0th, 1st, 2nd, ..., 23rd          | 7     |
 * |                                 | HH      | 00, 01, 02, ..., 23               |       |
 * | Hour [0-11]                     | K       | 1, 2, ..., 11, 0                  |       |
 * |                                 | Ko      | 1st, 2nd, ..., 11th, 0th          | 7     |
 * |                                 | KK      | 01, 02, ..., 11, 00               |       |
 * | Hour [1-24]                     | k       | 24, 1, 2, ..., 23                 |       |
 * |                                 | ko      | 24th, 1st, 2nd, ..., 23rd         | 7     |
 * |                                 | kk      | 24, 01, 02, ..., 23               |       |
 * | Minute                          | m       | 0, 1, ..., 59                     |       |
 * |                                 | mo      | 0th, 1st, ..., 59th               | 7     |
 * |                                 | mm      | 00, 01, ..., 59                   |       |
 * | Second                          | s       | 0, 1, ..., 59                     |       |
 * |                                 | so      | 0th, 1st, ..., 59th               | 7     |
 * |                                 | ss      | 00, 01, ..., 59                   |       |
 * | Fraction of second              | S       | 0, 1, ..., 9                      |       |
 * |                                 | SS      | 00, 01, ..., 99                   |       |
 * |                                 | SSS     | 000, 001, ..., 999                |       |
 * |                                 | SSSS    | ...                               | 3     |
 * | Timezone (ISO-8601 w/ Z)        | X       | -08, +0530, Z                     |       |
 * |                                 | XX      | -0800, +0530, Z                   |       |
 * |                                 | XXX     | -08:00, +05:30, Z                 |       |
 * |                                 | XXXX    | -0800, +0530, Z, +123456          | 2     |
 * |                                 | XXXXX   | -08:00, +05:30, Z, +12:34:56      |       |
 * | Timezone (ISO-8601 w/o Z)       | x       | -08, +0530, +00                   |       |
 * |                                 | xx      | -0800, +0530, +0000               |       |
 * |                                 | xxx     | -08:00, +05:30, +00:00            | 2     |
 * |                                 | xxxx    | -0800, +0530, +0000, +123456      |       |
 * |                                 | xxxxx   | -08:00, +05:30, +00:00, +12:34:56 |       |
 * | Timezone (GMT)                  | O...OOO | GMT-8, GMT+5:30, GMT+0            |       |
 * |                                 | OOOO    | GMT-08:00, GMT+05:30, GMT+00:00   | 2     |
 * | Timezone (specific non-locat.)  | z...zzz | GMT-8, GMT+5:30, GMT+0            | 6     |
 * |                                 | zzzz    | GMT-08:00, GMT+05:30, GMT+00:00   | 2,6   |
 * | Seconds timestamp               | t       | 512969520                         | 7     |
 * |                                 | tt      | ...                               | 3,7   |
 * | Milliseconds timestamp          | T       | 512969520900                      | 7     |
 * |                                 | TT      | ...                               | 3,7   |
 * | Long localized date             | P       | 04/29/1453                        | 7     |
 * |                                 | PP      | Apr 29, 1453                      | 7     |
 * |                                 | PPP     | April 29th, 1453                  | 7     |
 * |                                 | PPPP    | Friday, April 29th, 1453          | 2,7   |
 * | Long localized time             | p       | 12:00 AM                          | 7     |
 * |                                 | pp      | 12:00:00 AM                       | 7     |
 * |                                 | ppp     | 12:00:00 AM GMT+2                 | 7     |
 * |                                 | pppp    | 12:00:00 AM GMT+02:00             | 2,7   |
 * | Combination of date and time    | Pp      | 04/29/1453, 12:00 AM              | 7     |
 * |                                 | PPpp    | Apr 29, 1453, 12:00:00 AM         | 7     |
 * |                                 | PPPppp  | April 29th, 1453 at ...           | 7     |
 * |                                 | PPPPpppp| Friday, April 29th, 1453 at ...   | 2,7   |
 * Notes:
 * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
 *    are the same as "stand-alone" units, but are different in some languages.
 *    "Formatting" units are declined according to the rules of the language
 *    in the context of a date. "Stand-alone" units are always nominative singular:
 *
 *    `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
 *
 *    `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
 *
 * 2. Any sequence of the identical letters is a pattern, unless it is escaped by
 *    the single quote characters (see below).
 *    If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)
 *    the output will be the same as default pattern for this unit, usually
 *    the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units
 *    are marked with "2" in the last column of the table.
 *
 *    `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`
 *
 *    `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`
 *
 *    `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`
 *
 *    `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`
 *
 *    `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`
 *
 * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).
 *    The output will be padded with zeros to match the length of the pattern.
 *
 *    `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`
 *
 * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
 *    These tokens represent the shortest form of the quarter.
 *
 * 5. The main difference between `y` and `u` patterns are B.C. years:
 *
 *    | Year | `y` | `u` |
 *    |------|-----|-----|
 *    | AC 1 |   1 |   1 |
 *    | BC 1 |   1 |   0 |
 *    | BC 2 |   2 |  -1 |
 *
 *    Also `yy` always returns the last two digits of a year,
 *    while `uu` pads single digit years to 2 characters and returns other years unchanged:
 *
 *    | Year | `yy` | `uu` |
 *    |------|------|------|
 *    | 1    |   01 |   01 |
 *    | 14   |   14 |   14 |
 *    | 376  |   76 |  376 |
 *    | 1453 |   53 | 1453 |
 *
 *    The same difference is true for local and ISO week-numbering years (`Y` and `R`),
 *    except local week-numbering years are dependent on `options.weekStartsOn`
 *    and `options.firstWeekContainsDate` (compare [getISOWeekYear]{@link https://date-fns.org/docs/getISOWeekYear}
 *    and [getWeekYear]{@link https://date-fns.org/docs/getWeekYear}).
 *
 * 6. Specific non-location timezones are currently unavailable in `date-fns`,
 *    so right now these tokens fall back to GMT timezones.
 *
 * 7. These patterns are not in the Unicode Technical Standard #35:
 *    - `i`: ISO day of week
 *    - `I`: ISO week of year
 *    - `R`: ISO week-numbering year
 *    - `t`: seconds timestamp
 *    - `T`: milliseconds timestamp
 *    - `o`: ordinal number modifier
 *    - `P`: long localized date
 *    - `p`: long localized time
 *
 * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
 *    You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
 *
 * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
 *    You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
 *
 * @param {Date|Number} date - the original date
 * @param {String} format - the string of tokens
 * @param {Object} [options] - an object with options.
 * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
 * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
 * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is
 * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;
 *   see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
 * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;
 *   see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
 * @returns {String} the formatted date string
 * @throws {TypeError} 2 arguments required
 * @throws {RangeError} `date` must not be Invalid Date
 * @throws {RangeError} `options.locale` must contain `localize` property
 * @throws {RangeError} `options.locale` must contain `formatLong` property
 * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
 * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
 * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
 * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
 * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
 * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
 * @throws {RangeError} format string contains an unescaped latin alphabet character
 *
 * @example
 * // Represent 11 February 2014 in middle-endian format:
 * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
 * //=> '02/11/2014'
 *
 * @example
 * // Represent 2 July 2014 in Esperanto:
 * import { eoLocale } from 'date-fns/locale/eo'
 * const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
 *   locale: eoLocale
 * })
 * //=> '2-a de julio 2014'
 *
 * @example
 * // Escape string by single quote characters:
 * const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
 * //=> "3 o'clock"
 */function Av(e,t,r){var n,i,a,o,s,l,u,c,d,f,p,h,v,g,m,b,y,_;wZ(2,arguments);var w=String(t);var x=xi();var A=(n=(i=r===null||r===void 0?void 0:r.locale)!==null&&i!==void 0?i:x.locale)!==null&&n!==void 0?n:Au;var k=w6((a=(o=(s=(l=r===null||r===void 0?void 0:r.firstWeekContainsDate)!==null&&l!==void 0?l:r===null||r===void 0?void 0:(u=r.locale)===null||u===void 0?void 0:(c=u.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&s!==void 0?s:x.firstWeekContainsDate)!==null&&o!==void 0?o:(d=x.locale)===null||d===void 0?void 0:(f=d.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&a!==void 0?a:1);// Test if weekStartsOn is between 1 and 7 _and_ is not NaN
if(!(k>=1&&k<=7)){throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively")}var E=w6((p=(h=(v=(g=r===null||r===void 0?void 0:r.weekStartsOn)!==null&&g!==void 0?g:r===null||r===void 0?void 0:(m=r.locale)===null||m===void 0?void 0:(b=m.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&v!==void 0?v:x.weekStartsOn)!==null&&h!==void 0?h:(y=x.locale)===null||y===void 0?void 0:(_=y.options)===null||_===void 0?void 0:_.weekStartsOn)!==null&&p!==void 0?p:0);// Test if weekStartsOn is between 0 and 6 _and_ is not NaN
if(!(E>=0&&E<=6)){throw new RangeError("weekStartsOn must be between 0 and 6 inclusively")}if(!A.localize){throw new RangeError("locale must contain localize property")}if(!A.formatLong){throw new RangeError("locale must contain formatLong property")}var I=w1(e);if(!w2(I)){throw new RangeError("Invalid time value")}// Convert the date in system timezone to the same date in UTC+00:00 timezone.
// This ensures that when UTC functions will be implemented, locales will be compatible with them.
// See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376
var C=xE(I);var Y=w5(I,C);var T={firstWeekContainsDate:k,weekStartsOn:E,locale:A,_originalDate:I};var S=w.match(Ad).map(function(e){var t=e[0];if(t==="p"||t==="P"){var r=xk[t];return r(e,A.formatLong)}return e}).join("").match(Ac).map(function(n){// Replace two single quote characters with one single quote character
if(n==="''"){return"'"}var i=n[0];if(i==="'"){return Ag(n)}var a=xy[i];if(a){if(!(r!==null&&r!==void 0&&r.useAdditionalWeekYearTokens)&&xT(n)){xS(n,t,String(e))}if(!(r!==null&&r!==void 0&&r.useAdditionalDayOfYearTokens)&&xY(n)){xS(n,t,String(e))}return a(Y,n,A.localize,T)}if(i.match(Ah)){throw new RangeError("Format string contains an unescaped latin alphabet character `"+i+"`")}return n}).join("");return S}function Ag(e){var t=e.match(Af);if(!t){return e}return t[1].replace(Ap,"'")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/services/h5p.ts
var Am=e=>{return mX.post(mZ.GET_H5P_LESSON_CONTENT,{search_filter:e})};var Ab=(e,t)=>{return yX({queryKey:["H5PLessonContents",e],queryFn:()=>Am(e).then(e=>e.data),enabled:t==="lesson"})};var Ay=e=>{return mX.post(mZ.GET_H5P_QUIZ_CONTENT,{search_filter:e})};var A_=(e,t)=>{return yX({queryKey:["H5PQuizContents",e],queryFn:()=>Ay(e).then(e=>e.data),enabled:t==="tutor_h5p_quiz"})};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/modals/H5PContentListModal.tsx
var Aw=e=>{var{title:r,closeModal:i,onAddContent:a,contentType:o,addedContentIds:s=[]}=e;var l=h1({defaultValues:{search:""}});var u=oc(l.watch("search"),300);var c=A_(u,o);var d=Ab(u,o);var[f,p]=(0,n.useState)([]);var h=o==="tutor_h5p_quiz"?c.data:d.data;var v=h===null||h===void 0?void 0:h.output.filter(e=>!s.includes(String(e.id)));var g=[{Header:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{"data-index":true,css:AA.tableLabel,children:(v===null||v===void 0?void 0:v.length)?/*#__PURE__*/(0,t/* .jsx */.Y)(ou,{onChange:e=>{if(e){p((v===null||v===void 0?void 0:v.filter(e=>!s.includes(String(e.id))))||[])}else{p([])}},checked:f.length===((v===null||v===void 0?void 0:v.filter(e=>!s.includes(String(e.id))))||[]).length,isIndeterminate:f.length>0&&f.length<((v===null||v===void 0?void 0:v.filter(e=>!s.includes(String(e.id))))||[]).length}):"#"}),Cell:e=>{return/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:eK/* .typography.caption */.I.caption(),children:/*#__PURE__*/(0,t/* .jsx */.Y)(ou,{onChange:t=>{if(t){p([...f,e])}else{p(f.filter(t=>t.id!==e.id))}},checked:f.map(e=>e.id).includes(e.id)&&!s.includes(String(e.id))})})}},{Header:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:AA.tableLabel,children:(0,em.__)("Title","tutor-pro")}),Cell:e=>{return/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:AA.title,children:e.title})}},{Header:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:AA.tableLabel,children:(0,em.__)("Content Type","tutor-pro")}),Cell:e=>{return/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:eK/* .typography.caption */.I.caption(),children:e.content_type})}},{Header:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:AA.tableLabel,children:(0,em.__)("Created At","tutor-pro")}),Cell:e=>{return/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:eK/* .typography.caption */.I.caption(),children:Av(new Date(e.updated_at),aT/* .DateFormats.yearMonthDayHourMinuteSecond */.UA.yearMonthDayHourMinuteSecond)})}}];return/*#__PURE__*/(0,t/* .jsxs */.FD)(oR,{title:/* translators: %s is the number of selected items */f.length>0?(0,em.sprintf)((0,em.__)("%s selected","tutor-pro"),f.length):r,onClose:()=>i({action:"CLOSE"}),maxWidth:920,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:AA.searchWrapper,children:/*#__PURE__*/(0,t/* .jsx */.Y)(py,{control:l.control,name:"search",render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(ya,(0,eX._)((0,e$._)({},e),{placeholder:(0,em.__)("Search by title","tutor-pro"),showVerticalBar:false,content:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"search",width:24,height:24})}))})}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:AA.tableWrapper,children:/*#__PURE__*/(0,t/* .jsx */.Y)(o$,{columns:g,data:v||[],loading:c.isLoading||d.isLoading})}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:v===null||v===void 0?void 0:v.length,children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:AA.footer,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{size:"small",variant:"text",onClick:()=>i({action:"CLOSE"}),children:(0,em.__)("Cancel","tutor-pro")}),/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{type:"submit",size:"small",variant:"primary",onClick:()=>{a(f);i({action:"CONFIRM"})},disabled:!f.length,children:(0,em.__)("Add","tutor-pro")})]})})]})};/* ESM default export */const Ax=Aw;var AA={searchWrapper:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;padding:",ey/* .spacing["20"] */.YK["20"],";"),tableWrapper:/*#__PURE__*/(0,o/* .css */.AH)("max-height:calc(100vh - 350px);overflow:auto;tr{td:first-of-type{padding-left:",ey/* .spacing["20"] */.YK["20"],";}td:last-of-type{padding-right:",ey/* .spacing["20"] */.YK["20"],";}}"),tableLabel:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.body */.I.body("medium"),";text-align:left;color:",ey/* .colorTokens.text.primary */.I6.text.primary,";&[data-index]{padding-left:",ey/* .spacing["4"] */.YK["4"],";}"),title:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.text.ellipsis */.x.text.ellipsis(2),"    width:100%;text-align:left;",eK/* .typography.caption */.I.caption(),";min-width:340px;max-width:400px;"),footer:/*#__PURE__*/(0,o/* .css */.AH)("box-shadow:",ey/* .shadow.dividerTop */.r7.dividerTop,";height:56px;display:flex;align-items:center;justify-content:end;gap:",ey/* .spacing["16"] */.YK["16"],";padding-inline:",ey/* .spacing["16"] */.YK["16"],";")};// CONCATENATED MODULE: ./addons/content-bank/assets/react/manage-contents/components/modals/LessonModal.tsx
var Ak=e=>{var{contentId:r="",collectionId:i,closeModal:a,subtitle:o}=e;var s,l,u,c;var d=((s=fy/* .tutorConfig.settings */.P.settings)===null||s===void 0?void 0:s.chatgpt_enable)==="on";var f=fy/* .tutorConfig.enable_lesson_classic_editor */.P.enable_lesson_classic_editor==="1";var p=((l=fy/* .tutorConfig.settings */.P.settings)===null||l===void 0?void 0:l.hide_admin_bar_for_users)==="off";var h=(u=fy/* .tutorConfig.current_user.roles */.P.current_user.roles)===null||u===void 0?void 0:u.includes(aT/* .TutorRoles.ADMINISTRATOR */.gt.ADMINISTRATOR);var v=(c=fy/* .tutorConfig.current_user.roles */.P.current_user.roles)===null||c===void 0?void 0:c.includes(aT/* .TutorRoles.TUTOR_INSTRUCTOR */.gt.TUTOR_INSTRUCTOR);var g=f&&(h||v&&p);var m=y5(Number(r)||null);var b=y9();var{showModal:y}=ah();var{data:_,isLoading:w}=m;var x=lS({defaultValues:{title:"",description:"",thumbnail:null,tutor_attachments:[],lesson_preview:false,video:null,duration:{hour:0,minute:0,second:0}},shouldFocusError:true,mode:"onChange"});var A=x.formState.dirtyFields&&Object.keys(x.formState.dirtyFields).length>0;(0,n.useEffect)(()=>{if(_&&!w){var e,t,r;x.reset({title:_.post_title||"",description:(0,ej/* .normalizeLineEndings */.EW)(_.post_content)||"",thumbnail:{id:_.ID?Number(_.thumbnail_id):0,title:"",url:_.thumbnail||""},tutor_attachments:_.attachments||[],video:_.video||null,duration:{hour:((e=_.video.runtime)===null||e===void 0?void 0:e.hours)||0,minute:((t=_.video.runtime)===null||t===void 0?void 0:t.minutes)||0,second:((r=_.video.runtime)===null||r===void 0?void 0:r.seconds)||0}})}var n=document.querySelector(".button.insert-media.add_media");var i=document.querySelector(".add-h5p-content-button");if(n&&i){n.after(i)}var a=setTimeout(()=>{x.setFocus("title")},250);return()=>{clearTimeout(a)};// eslint-disable-next-line react-hooks/exhaustive-deps
},[_,w]);var k=e=>aY(function*(){var t=y3(e,Number(r),i);var n=yield b.mutateAsync(t);if(n.status_code===200||n.status_code===201){a({action:"CONFIRM"})}})();var E=()=>{var e=x.getValues("description");var t=e.match(/\[h5p id="(\d+)"\]/g)||[];var r=t.map(e=>{var t;var r=((t=e.match(/\[h5p id="(\d+)"\]/))===null||t===void 0?void 0:t[1])||"";return String(r)});var n=t=>{var r=e=>{return'[h5p id="'.concat(e.id,'"]')};var n=t.map(r);x.setValue("description","".concat(e,"\n").concat(n.join("\n")),{shouldDirty:true})};y({component:Ax,props:{title:(0,em.__)("Select H5P Content","tutor-pro"),onAddContent:n,contentType:"lesson",addedContentIds:r}})};return/*#__PURE__*/(0,t/* .jsx */.Y)(yI,{onClose:()=>a({action:"CLOSE"}),icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:A?"warning":"lesson",width:24,height:24}),title:A?aT/* .CURRENT_VIEWPORT.isAboveDesktop */.vN.isAboveDesktop?(0,em.__)("Unsaved Changes","tutor-pro"):"":(0,em.__)("Lesson","tutor-pro"),subtitle:o&&(aT/* .CURRENT_VIEWPORT.isAboveSmallMobile */.vN.isAboveSmallMobile?(0,em.sprintf)((0,em.__)("Collection: %s","tutor-pro"),o):""),maxWidth:1070,actions:A&&/*#__PURE__*/(0,t/* .jsxs */.FD)(t/* .Fragment */.FK,{children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"text",size:"small",onClick:()=>{if(r){x.reset()}else{a({action:"CLOSE"})}},children:r?(0,em.__)("Discard Changes","tutor-pro"):(0,em.__)("Cancel","tutor-pro")}),/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{"data-cy":"save-lesson",loading:b.isPending,variant:"primary",size:"small",onClick:x.handleSubmit(k),children:r?(0,em.__)("Update","tutor-pro"):(0,em.__)("Save","tutor-pro")})]}),children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:AI.wrapper,children:/*#__PURE__*/(0,t/* .jsxs */.FD)(ag/* ["default"] */.A,{when:!m.isLoading,fallback:/*#__PURE__*/(0,t/* .jsx */.Y)(eE,{}),children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:AI.lessonInfo,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{name:"title",control:x.control,rules:ep({required:(0,em.__)("Lesson title is required.","tutor-pro")},bL(255)),render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(b2,ev(ep({},e),{label:(0,em.__)("Name","tutor-pro"),placeholder:(0,em.__)("Enter Lesson Name","tutor-pro"),generateWithAi:d,isClearable:true}))}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:AI.description,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{name:"description",control:x.control,render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(yA,ev(ep({},e),{label:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:AI.descriptionLabel,children:[(0,em.__)("Content","tutor-pro"),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:g,children:/*#__PURE__*/(0,t/* .jsx */.Y)(d9,{content:(0,em.__)("Save the lesson first to use the WP Editor.","tutor-pro"),delay:200,disabled:!!r,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"text",size:"small",onClick:()=>{window.open("".concat(fy/* .tutorConfig.site_url */.P.site_url,"/wp-admin/post.php?post=").concat(r,"&action=edit"),"_blank","noopener")},icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"edit",width:24,height:24}),buttonCss:AI.wpEditorButton,disabled:!r,children:(0,em.__)("WP Editor","tutor-pro")})})})]}),placeholder:(0,em.__)("Enter Lesson Description","tutor-pro"),generateWithAi:d}))}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:(0,ej/* .isAddonEnabled */.GR)(aT/* .Addons.H5P_INTEGRATION */.oW.H5P_INTEGRATION),children:/*#__PURE__*/(0,t/* .jsx */.Y)("button",{className:"add-h5p-content-button",css:AI.addH5PContentButton,type:"button",onClick:E,children:(0,em.__)("Add H5P Content","tutor-pro")})})]})]})}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:AI.rightPanel,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{name:"thumbnail",control:x.control,render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(wO,ev(ep({},e),{label:(0,em.__)("Featured Image","tutor-pro"),buttonText:(0,em.__)("Upload Image","tutor-pro"),infoText:/* translators: %s is the maximum allowed upload file size (e.g., "2MB") */(0,em.sprintf)((0,em.__)("JPEG, PNG, GIF, and WebP formats, up to %s","tutor-pro"),fy/* .tutorConfig.max_upload_size */.P.max_upload_size)}))}),/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{name:"video",control:x.control,render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(w$,ev(ep({},e),{label:(0,em.__)("Video","tutor-pro"),buttonText:(0,em.__)("Upload Video","tutor-pro"),infoText:(0,em.sprintf)((0,em.__)("MP4, and WebM formats, up to %s","tutor-pro"),fy/* .tutorConfig.max_upload_size */.P.max_upload_size),onGetDuration:e=>{x.setValue("duration.hour",e.hours);x.setValue("duration.minute",e.minutes);x.setValue("duration.second",e.seconds)}}))}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:AI.durationWrapper,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("span",{css:AI.additionLabel,children:(0,em.__)("Video Playback Time","tutor-pro")}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:AI.duration,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{name:"duration.hour",control:x.control,render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(ya,ev(ep({},e),{type:"number",content:/*#__PURE__*/(0,t/* .jsx */.Y)("span",{css:AI.durationContent,children:(0,em.__)("hour","tutor-pro")}),contentPosition:"right",placeholder:"0",showVerticalBar:false}))}),/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{name:"duration.minute",control:x.control,render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(ya,ev(ep({},e),{type:"number",content:/*#__PURE__*/(0,t/* .jsx */.Y)("span",{css:AI.durationContent,children:(0,em.__)("min","tutor-pro")}),contentPosition:"right",placeholder:"0",showVerticalBar:false}))}),/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{name:"duration.second",control:x.control,render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(ya,ev(ep({},e),{type:"number",content:/*#__PURE__*/(0,t/* .jsx */.Y)("span",{css:AI.durationContent,children:(0,em.__)("sec","tutor-pro")}),contentPosition:"right",placeholder:"0",showVerticalBar:false}))})]})]}),/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{name:"tutor_attachments",control:x.control,render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(fW,ev(ep({},e),{label:(0,em.__)("Exercise Files","tutor-pro"),buttonText:(0,em.__)("Upload Attachment","tutor-pro"),selectMultiple:true}))})]})]})})})};/* ESM default export */const AE=Ak;var AI={wrapper:e=>{var{hasRightSidebar:t=true}=e;return/*#__PURE__*/(0,o/* .css */.AH)("margin:0 auto;display:grid;grid-template-columns:",t?"1fr 338px":"1fr",";height:100%;width:100%;padding-inline:",ey/* .spacing["32"] */.YK["32"],";",ey/* .Breakpoint.smallTablet */.EA.smallTablet,"{grid-template-columns:1fr;padding-inline:",ey/* .spacing["24"] */.YK["24"],";}",ey/* .Breakpoint.mobile */.EA.mobile,"{padding-inline:",ey/* .spacing["16"] */.YK["16"],";}")},lessonInfo:e=>{var{hasRightSidebar:t=true}=e;return/*#__PURE__*/(0,o/* .css */.AH)("padding-block:",ey/* .spacing["20"] */.YK["20"],";padding-right:",t&&ey/* .spacing["32"] */.YK["32"],";display:flex;flex-direction:column;gap:",ey/* .spacing["24"] */.YK["24"],";position:sticky;top:0;z-index:",ey/* .zIndex.positive */.fE.positive,";",ey/* .Breakpoint.smallTablet */.EA.smallTablet,"{position:unset;padding-right:0;}")},description:/*#__PURE__*/(0,o/* .css */.AH)("position:relative;"),descriptionLabel:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;align-items:center;justify-content:space-between;height:32px;"),addH5PContentButton:e=>{var{isPro:t=true}=e;return/*#__PURE__*/(0,o/* .css */.AH)("text-decoration:none;font-size:13px;line-height:2.15384615;min-height:30px;margin:0;padding:",!t?"0px":"0 10px",";cursor:pointer;border:1px solid #3e64de;border-radius:3px;white-space:nowrap;box-sizing:border-box;color:#3e64de;border-color:#3e64de;background:transparent;[data-button-text]{",eB/* .styleUtils.flexCenter */.x.flexCenter(),";padding:0 10px;}:hover:not(:disabled){background:",ey/* .colorTokens.background.white */.I6.background.white,";color:#3e64de;}:disabled{cursor:not-allowed;position:relative;top:auto;left:auto;opacity:0.5;}")},rightPanel:/*#__PURE__*/(0,o/* .css */.AH)("border-left:1px solid ",ey/* .colorTokens.stroke.divider */.I6.stroke.divider,";display:flex;flex-direction:column;gap:",ey/* .spacing["16"] */.YK["16"],";padding-block:",ey/* .spacing["20"] */.YK["20"],";padding-left:",ey/* .spacing["32"] */.YK["32"],";",ey/* .Breakpoint.smallTablet */.EA.smallTablet,"{border-left:none;padding-left:0;}"),durationWrapper:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;flex-direction:column;gap:",ey/* .spacing["8"] */.YK["8"],";"),duration:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;align-items:flex-end;gap:",ey/* .spacing["8"] */.YK["8"],";"),durationContent:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.small */.I.small(),";color:",ey/* .colorTokens.text.hints */.I6.text.hints,";"),additionLabel:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.body */.I.body(),"    color:",ey/* .colorTokens.text.title */.I6.text.title,";"),lessonPreview:/*#__PURE__*/(0,o/* .css */.AH)("background-color:",ey/* .colorTokens.background.white */.I6.background.white,";padding:",ey/* .spacing["12"] */.YK["12"],";border:1px solid ",ey/* .colorTokens.stroke["default"] */.I6.stroke["default"],";border-radius:",ey/* .borderRadius["8"] */.Vq["8"],";"),previewLabel:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;align-items:center;gap:",ey/* .spacing["4"] */.YK["4"],";"),contentDripLabel:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;align-items:center;svg{margin-right:",ey/* .spacing["4"] */.YK["4"],";color:",ey/* .colorTokens.icon.success */.I6.icon.success,";}"),previewInfo:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.small */.I.small(),";text-align:center;color:",ey/* .colorTokens.text.title */.I6.text.title,";padding:",ey/* .spacing["8"] */.YK["8"]," ",ey/* .spacing["24"] */.YK["24"],";background:",ey/* .colorTokens.background.status.success */.I6.background.status.success,";border-radius:",ey/* .borderRadius["4"] */.Vq["4"],";margin-top:",ey/* .spacing["12"] */.YK["12"],";"),wpEditorButton:/*#__PURE__*/(0,o/* .css */.AH)("margin-left:",ey/* .spacing["4"] */.YK["4"],";color:",ey/* .colorTokens.text.brand */.I6.text.brand,";svg{color:",ey/* .colorTokens.icon.brand */.I6.icon.brand,";}&:hover:not(:disabled){text-decoration:underline;}")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/hooks/usePaginatedTable.ts
var AC=function(){var{limit:e=aT/* .ITEMS_PER_PAGE */.re}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var[t,r]=(0,n.useState)({page:1,sortProperty:"",sortDirection:undefined,filter:{}});var i=t;var a=e*Math.max(0,i.page-1);var o=(0,n.useCallback)(e=>{r(t=>(0,e$._)({},t,e))},[r]);var s=e=>o({page:e});var l=(0,n.useCallback)(e=>o({page:1,filter:e}),[o]);var u=e=>{var t={};if(e!==i.sortProperty){t={sortDirection:"asc",sortProperty:e}}else{t={sortDirection:i.sortDirection==="asc"?"desc":"asc",sortProperty:e}}o(t)};return{pageInfo:i,onPageChange:s,onColumnSort:u,offset:a,itemsPerPage:e,onFilterItems:l}};// CONCATENATED MODULE: ./node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js
// src/infiniteQueryObserver.ts
var AY=class extends yY{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods();this.fetchNextPage=this.fetchNextPage.bind(this);this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:er()})}getOptimisticResult(e){e.behavior=er();return super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:r}=e;const n=super.createResult(e,t);const{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=n;const l=r.fetchMeta?.fetchMore?.direction;const u=o&&l==="forward";const c=i&&l==="forward";const d=o&&l==="backward";const f=i&&l==="backward";const p={...n,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:ea(t,r.data),hasPreviousPage:eo(t,r.data),isFetchNextPageError:u,isFetchingNextPage:c,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!u&&!d,isRefetching:a&&!c&&!f};return p}};//# sourceMappingURL=infiniteQueryObserver.js.map
;// CONCATENATED MODULE: ./node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.js
"use client";// src/useInfiniteQuery.ts
function AT(e,t){return y$(e,AY,t)}//# sourceMappingURL=useInfiniteQuery.js.map
;// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/services/content-bank.ts
var AS=e=>{return mX.get(mZ.GET_CONTENT_BANK_COLLECTIONS,{params:e}).then(e=>e.data)};var AO=e=>{return yX({queryKey:["ContentBankCollections",e],queryFn:()=>AS((0,e$._)({},e)),placeholderData:e=>e,enabled:!!e.page&&!!e.per_page})};var AD=e=>{return AT({queryKey:["ContentBankCollectionsInfinity",e],queryFn:t=>{var{pageParam:r=1}=t;return AS((0,eX._)((0,e$._)({},e),{page:r}))},getNextPageParam:e=>e.current_page<e.total_page?e.current_page+1:undefined,initialPageParam:1,enabled:e.isEnabled&&!!e.per_page})};var AF=e=>{return mX.get(mZ.GET_CONTENT_BANK_CONTENTS,{params:e}).then(e=>e.data)};var AR=e=>{return yX({queryFn:()=>AF(e),queryKey:["ContentBankContents",e],placeholderData:e=>e,enabled:!!e.collection_id})};var AP={"cb-lesson":(0,em.__)("Lesson","tutor-pro"),"cb-assignment":(0,em.__)("Assignment","tutor-pro"),"cb-question":(0,em.__)("Question","tutor-pro")};// CONCATENATED MODULE: ./addons/content-bank/assets/react/manage-contents/components/modals/MoveCollectionModal.tsx
var AM=e=>{var{closeModal:r,title:i,subtitle:a,contentIds:o}=e;var s,l,u;var[c,d]=(0,n.useState)("");var f=oc(c);var{pageInfo:p,onPageChange:h,itemsPerPage:v,onFilterItems:g}=AC();var m=AO({page:p.page,per_page:v,search:String(p.filter.search||"")});var b=_p();(0,n.useEffect)(()=>{g({search:f||""})},[g,f]);var y;var _=(y=(s=m.data)===null||s===void 0?void 0:s.data)!==null&&y!==void 0?y:[];var w;var x=(w=(l=m.data)===null||l===void 0?void 0:l.total_record)!==null&&w!==void 0?w:0;var A;var k=Number((A=(u=m.data)===null||u===void 0?void 0:u.total_page)!==null&&A!==void 0?A:0);return/*#__PURE__*/(0,t/* .jsx */.Y)(oR,{onClose:()=>r({action:"CLOSE"}),title:i,subtitle:a,maxWidth:500,children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:AH.container,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:AH.searchFieldWrapper,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eG,{variant:"search",value:c,onChange:d,placeholder:(0,em.__)("Search...","tutor-pro")})}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:!m.isLoading,fallback:/*#__PURE__*/(0,t/* .jsx */.Y)(eI,{}),children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:AH.listWrapper,children:/*#__PURE__*/(0,t/* .jsx */.Y)(fb,{each:_,fallback:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:AH.empty,children:(0,em.__)("No collections found.","tutor-pro")}),children:e=>/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:AH.collectionItem,children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:AH.collectionTitle,children:e.post_title}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:AH.collectionCount,children:[e.count_stats.total," ",(0,em.__)("Items","tutor-pro")]})]}),/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{"data-move-here-button":true,variant:"primary",size:"small",loading:b.isPending,onClick:()=>aY(function*(){var t=yield b.mutateAsync({collectionId:e.ID,contentIds:o});if(t.status_code===200){r()}})(),children:(0,em.__)("Move Here","tutor-pro")})]},e.ID)})})}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:k>1,children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:AH.paginatorWrapper,children:/*#__PURE__*/(0,t/* .jsx */.Y)(oK,{currentPage:p.page,onPageChange:h,totalItems:x,itemsPerPage:v})})})]})})};var AH={container:/*#__PURE__*/(0,o/* .css */.AH)(),searchFieldWrapper:/*#__PURE__*/(0,o/* .css */.AH)("padding:",ey/* .spacing["20"] */.YK["20"]," ",ey/* .spacing["20"] */.YK["20"]," ",ey/* .spacing["16"] */.YK["16"]," ",ey/* .spacing["20"] */.YK["20"],";"),listWrapper:/*#__PURE__*/(0,o/* .css */.AH)("max-height:340px;overflow-y:auto;padding:0 0 ",ey/* .spacing["8"] */.YK["8"]," 0;"),collectionItem:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;align-items:center;justify-content:space-between;padding:",ey/* .spacing["12"] */.YK["12"]," ",ey/* .spacing["20"] */.YK["20"],";transition:background-color 0.25s ease-in-out;[data-move-here-button]{opacity:0;transition:opacity 0.25s ease-in-out;}&:hover{background:",ey/* .colorTokens.background.hover */.I6.background.hover,";[data-move-here-button]{opacity:1;}}"),collectionTitle:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.caption */.I.caption("regular"),";color:",ey/* .colorTokens.text.title */.I6.text.title,";"),collectionCount:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.small */.I.small(),";color:",ey/* .colorTokens.text.subdued */.I6.text.subdued,";"),empty:/*#__PURE__*/(0,o/* .css */.AH)("text-align:center;color:",ey/* .colorTokens.text.hints */.I6.text.hints,";padding:",ey/* .spacing["32"] */.YK["32"]," 0;"),paginatorWrapper:/*#__PURE__*/(0,o/* .css */.AH)("padding:",ey/* .spacing["20"] */.YK["20"]," ",ey/* .spacing["16"] */.YK["16"],";"),errorMessage:/*#__PURE__*/(0,o/* .css */.AH)("height:100px;display:flex;align-items:center;justify-content:center;")};/* ESM default export */const AN=AM;// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/utils/quiz.ts
var AL=(e,t)=>{if(t===e){return null}if(e===eO/* .QuizDataStatus.NEW */.cW.NEW){return eO/* .QuizDataStatus.NEW */.cW.NEW}if((e===eO/* .QuizDataStatus.UPDATE */.cW.UPDATE||e===eO/* .QuizDataStatus.NO_CHANGE */.cW.NO_CHANGE)&&t===eO/* .QuizDataStatus.UPDATE */.cW.UPDATE){return eO/* .QuizDataStatus.UPDATE */.cW.UPDATE}return eO/* .QuizDataStatus.NO_CHANGE */.cW.NO_CHANGE};var AK=e=>{if(e){var t=e.question_type;if(t==="h5p"){return true}var r=e.question_answers||[];var n=r.every(e=>e.is_saved);var i=r.some(e=>e.is_correct==="1");if(r.length===0&&t!=="open_ended"&&t!=="short_answer"){return{message:(0,em.__)("Please add an option.","tutor-pro"),type:"add_option"}}if(!n){return{message:(0,em.__)("Please finish editing all newly created options.","tutor-pro"),type:"save_option"}}if(["true_false","multiple_choice"].includes(t)&&!i){return{message:(0,em.__)("Please select a correct answer.","tutor-pro"),type:"correct_option"}}if(t==="matching"){var a=e.question_settings.is_image_matching;var o=r.every(e=>e.answer_title);if(!o){return{message:(0,em.__)("Please add titles to all options.","tutor-pro"),type:"save_option"}}if(a){var s=r.every(e=>e.image_url);if(!s){return{message:(0,em.__)("Please add images to all options.","tutor-pro"),type:"question"}}}else{var l=r.every(e=>e.answer_two_gap_match);if(!l){return{message:(0,em.__)("Please add matched text to all options.","tutor-pro"),type:"save_option"}}}}}return true};var AB=e=>{var t=e=>{if(e.image_url){return e.answer_view_format==="text_image"?eO/* .QuizDataStatus.NO_CHANGE */.cW.NO_CHANGE:eO/* .QuizDataStatus.UPDATE */.cW.UPDATE}return e.answer_view_format==="text"?eO/* .QuizDataStatus.NO_CHANGE */.cW.NO_CHANGE:eO/* .QuizDataStatus.UPDATE */.cW.UPDATE};if(e.question_settings){e.question_settings.answer_required=!!Number(e.question_settings.answer_required);e.question_settings.show_question_mark=!!Number(e.question_settings.show_question_mark);e.question_settings.randomize_question=!!Number(e.question_settings.randomize_question)}e.question_answers=e.question_answers.map(e=>(0,eX._)((0,e$._)({},e),{_data_status:t(e),is_saved:true,answer_view_format:e.image_url?"text_image":"text"}));e.question_description=(0,ej/* .normalizeLineEndings */.EW)(e.question_description)||"";e.answer_explanation=e.answer_explanation==='<p><br data-mce-bogus="1"></p>'?"":(0,ej/* .normalizeLineEndings */.EW)(e.answer_explanation)||"";switch(e.question_type){case"single_choice":{return(0,eX._)((0,e$._)({},e),{_data_status:eO/* .QuizDataStatus.UPDATE */.cW.UPDATE,question_type:"multiple_choice",question_answers:e.question_answers.map(e=>(0,eX._)((0,e$._)({},e),{_data_status:eO/* .QuizDataStatus.UPDATE */.cW.UPDATE})),question_settings:(0,eX._)((0,e$._)({},e.question_settings),{question_type:"multiple_choice",has_multiple_correct_answer:false})})}case"multiple_choice":{return(0,eX._)((0,e$._)({},e),{_data_status:e.question_settings.has_multiple_correct_answer?eO/* .QuizDataStatus.NO_CHANGE */.cW.NO_CHANGE:eO/* .QuizDataStatus.UPDATE */.cW.UPDATE,question_settings:(0,eX._)((0,e$._)({},e.question_settings),{has_multiple_correct_answer:e.question_settings.has_multiple_correct_answer?!!Number(e.question_settings.has_multiple_correct_answer):true})})}case"matching":{return(0,eX._)((0,e$._)({},e),{_data_status:e.question_settings.is_image_matching?eO/* .QuizDataStatus.NO_CHANGE */.cW.NO_CHANGE:eO/* .QuizDataStatus.UPDATE */.cW.UPDATE,question_settings:(0,eX._)((0,e$._)({},e.question_settings),{is_image_matching:e.question_settings.is_image_matching?!!Number(e.question_settings.is_image_matching):false})})}case"image_matching":{return(0,eX._)((0,e$._)({},e),{_data_status:eO/* .QuizDataStatus.UPDATE */.cW.UPDATE,question_type:"matching",question_answers:e.question_answers.map(e=>(0,eX._)((0,e$._)({},e),{_data_status:eO/* .QuizDataStatus.UPDATE */.cW.UPDATE})),question_settings:(0,eX._)((0,e$._)({},e.question_settings),{question_type:"matching",is_image_matching:true})})}default:return(0,eX._)((0,e$._)({},e),{_data_status:eO/* .QuizDataStatus.NO_CHANGE */.cW.NO_CHANGE})}};// CONCATENATED MODULE: ./addons/content-bank/assets/react/manage-contents/components/QuestionConditions.tsx
var Aj={true_false:{label:(0,em.__)("True/False","tutor-pro"),icon:"quizTrueFalse"},multiple_choice:{label:(0,em.__)("Multiple Choice","tutor-pro"),icon:"quizMultiChoice"},open_ended:{label:(0,em.__)("Open Ended/Essay","tutor-pro"),icon:"quizEssay"},fill_in_the_blank:{label:(0,em.__)("Fill in the Blanks","tutor-pro"),icon:"quizFillInTheBlanks"},short_answer:{label:(0,em.__)("Short Answer","tutor-pro"),icon:"quizShortAnswer"},matching:{label:(0,em.__)("Matching","tutor-pro"),icon:"quizImageMatching"},image_answering:{label:(0,em.__)("Image Answering","tutor-pro"),icon:"quizImageAnswer"},ordering:{label:(0,em.__)("Ordering","tutor-pro"),icon:"quizOrdering"}};var AU=["multiple_choice","matching","image_answering"];var Aq=()=>{var e=sw();var r=e.watch("question_type");var n=e.watch("question_id");var i=e.watch("_data_status");return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:AW.questionTypeWrapper,children:/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:!n,fallback:/*#__PURE__*/(0,t/* .jsxs */.FD)(t/* .Fragment */.FK,{children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:eK/* .typography.caption */.I.caption(),children:(0,em.__)("Question Type","tutor-pro")}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:AW.questionType,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:r?Aj[r].icon:"quizTrueFalse",width:32,height:32}),/*#__PURE__*/(0,t/* .jsx */.Y)("span",{children:r?Aj[r].label:""})]})]}),children:/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{control:e.control,name:"question_type",render:r=>/*#__PURE__*/(0,t/* .jsx */.Y)(hV,ev(ep({},r),{label:(0,em.__)("Question Type","tutor-pro"),options:Object.entries(Aj).map(e=>{var[t,r]=e;return{value:t,label:r.label,icon:r.icon}}),placeholder:(0,em.__)("Question Type","tutor-pro"),onChange:t=>{var r=t.value;if(r==="true_false"){e.setValue("question_answers",[{answer_id:(0,ej/* .nanoid */.Ak)(),is_saved:true,_data_status:eO/* .QuizDataStatus.NEW */.cW.NEW,answer_title:(0,em.__)("True","tutor-pro"),is_correct:"1",answer_order:1,answer_two_gap_match:"",answer_view_format:"text",belongs_question_id:"",belongs_question_type:"true_false"},{answer_id:(0,ej/* .nanoid */.Ak)(),is_saved:true,_data_status:eO/* .QuizDataStatus.NEW */.cW.NEW,answer_title:(0,em.__)("False","tutor-pro"),is_correct:"0",answer_order:2,answer_two_gap_match:"",answer_view_format:"text",belongs_question_id:"",belongs_question_type:"true_false"}],{shouldDirty:true})}else if(r==="fill_in_the_blank"){e.setValue("question_answers",[{answer_id:(0,ej/* .nanoid */.Ak)(),is_saved:true,_data_status:eO/* .QuizDataStatus.NEW */.cW.NEW,answer_title:"",is_correct:"1",answer_order:1,answer_two_gap_match:"",answer_view_format:"text",belongs_question_id:"",belongs_question_type:"fill_in_the_blank"}])}else{e.setValue("question_answers",[],{shouldDirty:true})}}}))})})}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:AW.conditions,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("p",{children:(0,em.__)("Conditions:","tutor-pro")}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:AW.conditionControls,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:r==="multiple_choice",children:/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{control:e.control,name:"question_settings.has_multiple_correct_answer",render:r=>/*#__PURE__*/(0,t/* .jsx */.Y)(bF,ev(ep({},r),{label:(0,em.__)("Multiple Correct Answer","tutor-pro"),onChange:t=>{if(AL(i,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)){e.setValue("_data_status",AL(i,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE))}// Reset all answers to incorrect on multiple correct answer toggle from true to false
    if(!t){e.setValue("question_answers",e.getValues("question_answers").map(e=>{return ev(ep({},e),{is_correct:"0"})}))}}}))})}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:r==="matching",children:/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{control:e.control,name:"question_settings.is_image_matching",render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(bF,ev(ep({},e),{label:(0,em.__)("Image Matching","tutor-pro")}))})}),/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{control:e.control,name:"question_settings.answer_required",render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(bF,ev(ep({},e),{label:(0,em.__)("Answer Required","tutor-pro")}))}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:AU.includes(r),children:/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{control:e.control,name:"question_settings.randomize_question",render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(bF,ev(ep({},e),{label:(0,em.__)("Randomize Choice","tutor-pro")}))})}),/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{control:e.control,name:"question_settings.question_mark",rules:{min:0},render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(b2,ev(ep({},e),{label:(0,em.__)("Point For This Question","tutor-pro"),type:"number",isInlineLabel:true,placeholder:"0",style:/*#__PURE__*/(0,o/* .css */.AH)("max-width:80px;")}))}),/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{control:e.control,name:"question_settings.show_question_mark",render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(bF,ev(ep({},e),{label:(0,em.__)("Display Points","tutor-pro")}))})]})]})]})};/* ESM default export */const AV=Aq;var AW={emptyQuestions:/*#__PURE__*/(0,o/* .css */.AH)("padding:",ey/* .spacing["12"] */.YK["12"]," ",ey/* .spacing["32"] */.YK["32"]," ",ey/* .spacing["24"] */.YK["24"]," ",ey/* .spacing["24"] */.YK["24"],";",eK/* .typography.caption */.I.caption("medium"),";"),questionTypeWrapper:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),";padding:",ey/* .spacing["8"] */.YK["8"]," ",ey/* .spacing["32"] */.YK["32"]," ",ey/* .spacing["24"] */.YK["24"]," ",ey/* .spacing["24"] */.YK["24"],";gap:",ey/* .spacing["10"] */.YK["10"],";border-bottom:1px solid ",ey/* .colorTokens.stroke.divider */.I6.stroke.divider,";"),questionType:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;align-items:center;gap:",ey/* .spacing["10"] */.YK["10"],";",eK/* .typography.body */.I.body("medium"),";"),conditions:/*#__PURE__*/(0,o/* .css */.AH)("padding:",ey/* .spacing["8"] */.YK["8"]," ",ey/* .spacing["32"] */.YK["32"]," ",ey/* .spacing["24"] */.YK["24"]," ",ey/* .spacing["24"] */.YK["24"],";p{",eK/* .typography.body */.I.body("medium"),";color:",ey/* .colorTokens.text.primary */.I6.text.primary,";}"),conditionControls:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",ey/* .spacing["16"] */.YK["16"],";margin-top:",ey/* .spacing["16"] */.YK["16"],";")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/fields/quiz/FormAnswerExplanation.tsx
function Az(){var e=(0,eS._)(["\n      background-color: ",";\n      padding: "," ",";\n\n      &:hover {\n        background-color: ",";\n      }\n    "]);Az=function t(){return e};return e}function AG(){var e=(0,eS._)(["\n      padding-inline: 0;\n      max-height: unset;\n      overflow: unset;\n    "]);AG=function t(){return e};return e}function AQ(){var e=(0,eS._)(["\n      padding: 0;\n    "]);AQ=function t(){return e};return e}function A$(){var e=(0,eS._)(["\n        background-color: transparent;\n      "]);A$=function t(){return e};return e}function AX(){var e=(0,eS._)(["\n        resize: vertical;\n      "]);AX=function t(){return e};return e}function AJ(){var e=(0,eS._)(["\n      opacity: 1;\n    "]);AJ=function t(){return e};return e}var AZ=e=>{var{label:r,field:i,fieldState:a,disabled:o,loading:s,placeholder:l,helpText:u,onChange:c}=e;var d;var f=(d=i.value)!==null&&d!==void 0?d:"";var[p,h]=(0,n.useState)(false);var[v,g]=(0,n.useState)(f);return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:A1.wrapper({hasValue:!!f&&!p}),children:[/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:p||f,children:/*#__PURE__*/(0,t/* .jsx */.Y)("label",{css:A1.answerLabel,children:r})}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:A1.editorWrapper({isEdit:p}),children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:A1.container({isEdit:p||!!f}),children:[/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:!f&&!p,fallback:/*#__PURE__*/(0,t/* .jsx */.Y)(yA,{field:i,fieldState:a,disabled:o,helpText:u,loading:s,readOnly:!p,onChange:c,placeholder:l,autoFocus:true,isMinimal:true}),children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:A1.placeholder,children:l})}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:p,children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{"data-action-buttons":true,css:A1.actionButtonWrapper({isEdit:p}),children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"text",size:"small",onClick:()=>{i.onChange(v);h(false)},children:(0,em.__)("Cancel","tutor-pro")}),/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"secondary",size:"small",onClick:()=>{var e;g((e=i.value)!==null&&e!==void 0?e:"");h(false)},disabled:i.value===v,children:(0,em.__)("Ok","tutor-pro")})]})}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:!p,children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{onClick:()=>{if(!p&&!o){h(true)}},onKeyDown:e=>{if((e.key==="Enter"||e.key===" ")&&!p){h(true)}},"data-overlay":true,tabIndex:0,role:"button"})})]})})]})};/* ESM default export */const A0=AZ;var A1={wrapper:e=>{var{hasValue:t}=e;return/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),"    gap:",ey/* .spacing["10"] */.YK["10"],";border-radius:",ey/* .borderRadius.card */.Vq.card,";",t&&(0,o/* .css */.AH)(Az(),ey/* .colorTokens.color.success["30"] */.I6.color.success["30"],ey/* .spacing["12"] */.YK["12"],ey/* .spacing["24"] */.YK["24"],ey/* .colorTokens.color.success["40"] */.I6.color.success["40"]))},editorWrapper:e=>{var{isEdit:t}=e;return/*#__PURE__*/(0,o/* .css */.AH)("position:relative;max-height:400px;overflow-y:scroll;",t&&(0,o/* .css */.AH)(AG()))},container:e=>{var{isEdit:t}=e;return/*#__PURE__*/(0,o/* .css */.AH)("position:relative;display:flex;flex-direction:column;gap:",ey/* .spacing["16"] */.YK["16"],";min-height:48px;height:100%;width:100%;inset:0;border-radius:",ey/* .borderRadius["6"] */.Vq["6"],";transition:background 0.15s ease-in-out;[data-overlay]{position:absolute;inset:0;opacity:1;:focus-visible{outline:2px solid ",ey/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:-2px;border-radius:",ey/* .borderRadius.card */.Vq.card,";}}& label{",eK/* .typography.caption */.I.caption(),"      margin-bottom:",ey/* .spacing["6"] */.YK["6"],";color:",ey/* .colorTokens.text.title */.I6.text.title,";}",t&&(0,o/* .css */.AH)(AQ()),"    &:hover{background-color:",ey/* .colorTokens.background.white */.I6.background.white,";color:",ey/* .colorTokens.text.subdued */.I6.text.subdued,";cursor:text;[data-action-buttons]{opacity:1;}",t&&(0,o/* .css */.AH)(A$()),"}")},inputContainer:e=>/*#__PURE__*/(0,o/* .css */.AH)("position:relative;display:flex;& textarea{",eK/* .typography.caption */.I.caption(),"      color:",ey/* .colorTokens.text.title */.I6.text.title,";height:auto;padding:",ey/* .spacing["8"] */.YK["8"]," ",ey/* .spacing["12"] */.YK["12"],";resize:none;",e&&(0,o/* .css */.AH)(AX()),"}"),clearButton:/*#__PURE__*/(0,o/* .css */.AH)("position:absolute;right:",ey/* .spacing["2"] */.YK["2"],";top:",ey/* .spacing["2"] */.YK["2"],";width:36px;height:36px;border-radius:",ey/* .borderRadius["2"] */.Vq["2"],";background:transparent;button{padding:",ey/* .spacing["10"] */.YK["10"],";}"),placeholder:/*#__PURE__*/(0,o/* .css */.AH)("padding:",ey/* .spacing["12"] */.YK["12"]," ",ey/* .spacing["24"] */.YK["24"],";",eK/* .typography.caption */.I.caption(),"    color:",ey/* .colorTokens.text.hints */.I6.text.hints,";display:flex;align-items:center;height:100%;"),actionButtonWrapper:e=>{var{isEdit:t}=e;return/*#__PURE__*/(0,o/* .css */.AH)("display:flex;justify-content:flex-end;gap:",ey/* .spacing["8"] */.YK["8"],";opacity:0;transition:opacity 0.15s ease-in-out;",t&&(0,o/* .css */.AH)(AJ()))},answer:/*#__PURE__*/(0,o/* .css */.AH)("padding:",ey/* .spacing["12"] */.YK["12"]," ",ey/* .spacing["24"] */.YK["24"],";border-radius:",ey/* .borderRadius.card */.Vq.card,";display:flex;flex-direction:column;gap:",ey/* .spacing["16"] */.YK["16"],";background-color:",ey/* .colorTokens.background.success.fill30 */.I6.background.success.fill30,";color:",ey/* .colorTokens.text.title */.I6.text.title,";transition:background 0.15s ease-in-out;&:hover{background-color:",ey/* .colorTokens.background.success.fill40 */.I6.background.success.fill40,";}"),answerLabel:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.caption */.I.caption(),"    color:",ey/* .colorTokens.text.title */.I6.text.title,";"),answerParagraph:/*#__PURE__*/(0,o/* .css */.AH)("pre{",eB/* .styleUtils.overflowXAuto */.x.overflowXAuto,"}")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/fields/quiz/FormQuestionDescription.tsx
function A2(){var e=(0,eS._)(["\n      padding-inline: 0;\n      max-height: unset;\n      overflow: unset;\n    "]);A2=function t(){return e};return e}function A6(){var e=(0,eS._)(["\n      &:hover,\n      &:has([data-overlay]:focus-visible) {\n        background-color: ",";\n        color: ",";\n\n        [data-action-buttons] {\n          opacity: 1;\n        }\n      }\n    "]);A6=function t(){return e};return e}function A4(){var e=(0,eS._)(["\n      padding-inline: 0;\n    "]);A4=function t(){return e};return e}function A5(){var e=(0,eS._)(["\n      opacity: 1;\n    "]);A5=function t(){return e};return e}var A3=!!fy/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var A8=e=>{var{label:r,field:i,fieldState:a,disabled:o=false,loading:s,placeholder:l,helpText:u,onChange:c}=e;var d;var f=(d=i.value)!==null&&d!==void 0?d:"";var[p,h]=(0,n.useState)(false);var[v,g]=(0,n.useState)(f);var m=()=>{i.onChange(v);h(false)};var b=()=>{h(false);g(i.value||"")};var y=()=>{if(!p&&!o){h(true)}};var _=e=>{if((e.key==="Enter"||e.key===" ")&&!p){e.preventDefault();h(true)}};return/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:A7.editorWrapper({isEdit:p}),tabIndex:-1,children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:A7.container({isEdit:p,isDisabled:o}),children:[/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:!p&&(!A3||!f),fallback:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:A7.editorContainer,"aria-hidden":!p,// @ts-ignore
inert:!p?"":undefined,children:/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:A3,fallback:/*#__PURE__*/(0,t/* .jsx */.Y)(hI,{field:i,fieldState:a,label:r,disabled:o,helpText:u,loading:s,readOnly:!p,onChange:c,placeholder:l,autoResize:true,maxHeight:400}),children:/*#__PURE__*/(0,t/* .jsx */.Y)(yA,{field:i,fieldState:a,label:r,disabled:o,helpText:u,loading:s,readOnly:!p,onChange:c,placeholder:l,min_height:100,max_height:400,autoFocus:true,toolbar1:"bold italic underline | bullist numlist | blockquote | alignleft aligncenter alignright | link unlink | ".concat(A3?" codesample":""," | wp_adv"),toolbar2:"formatselect strikethrough hr wp_more forecolor pastetext removeformat charmap outdent indent undo redo wp_help fullscreen tutor_button undoRedoDropdown"})})}),children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:A7.placeholder,dangerouslySetInnerHTML:{__html:f||l||""},tabIndex:-1,"aria-hidden":"true"})}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:p,children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{"data-action-buttons":true,css:A7.actionButtonWrapper({isEdit:p}),children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"text",size:"small",onClick:m,children:(0,em.__)("Cancel","tutor-pro")}),/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"secondary",size:"small",onClick:b,disabled:f===v,children:(0,em.__)("Ok","tutor-pro")})]})}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:!p,children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{onClick:y,onKeyDown:_,"data-overlay":true,tabIndex:0,role:"button","aria-label":f?(0,em.__)("Edit description","tutor-pro"):(0,em.__)("Add description","tutor-pro")})})]})})};/* ESM default export */const A9=A8;var A7={editorWrapper:e=>{var{isEdit:t}=e;return/*#__PURE__*/(0,o/* .css */.AH)("position:relative;max-height:400px;overflow-y:auto;border-radius:",ey/* .borderRadius["6"] */.Vq["6"],";",t&&(0,o/* .css */.AH)(A2()))},container:e=>{var{isEdit:t,isDisabled:r}=e;return/*#__PURE__*/(0,o/* .css */.AH)("position:relative;display:flex;flex-direction:column;gap:",ey/* .spacing["16"] */.YK["16"],";min-height:64px;height:100%;width:100%;inset:0;padding-inline:",ey/* .spacing["8"] */.YK["8"]," ",ey/* .spacing["16"] */.YK["16"],";border-radius:",ey/* .borderRadius["6"] */.Vq["6"],";transition:background-color 0.15s ease-in-out;[data-overlay]{position:absolute;inset:0;opacity:1;cursor:pointer;&:focus-visible{outline:2px solid ",ey/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:-2px;border-radius:",ey/* .borderRadius.card */.Vq.card,";}}& label{",eK/* .typography.caption */.I.caption(),";margin-bottom:",ey/* .spacing["6"] */.YK["6"],";color:",ey/* .colorTokens.text.title */.I6.text.title,";}",!r&&(0,o/* .css */.AH)(A6(),!t&&ey/* .colorTokens.background.white */.I6.background.white,ey/* .colorTokens.text.subdued */.I6.text.subdued)," ",t&&(0,o/* .css */.AH)(A4()))},editorContainer:/*#__PURE__*/(0,o/* .css */.AH)("position:relative;width:100%;"),placeholder:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.caption */.I.caption(),"    color:",ey/* .colorTokens.text.hints */.I6.text.hints,";height:100%;inset:0;padding-block:",ey/* .spacing["8"] */.YK["8"],";overflow-x:hidden;pointer-events:none;"),actionButtonWrapper:e=>{var{isEdit:t}=e;return/*#__PURE__*/(0,o/* .css */.AH)("display:flex;justify-content:flex-end;gap:",ey/* .spacing["8"] */.YK["8"],";opacity:0;transition:opacity 0.15s ease-in-out;",t&&(0,o/* .css */.AH)(A5()))}};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/fields/quiz/FormQuestionTitle.tsx
function ke(){var e=(0,eS._)(["\n      min-height: 40px;\n      padding-inline: "," ",";\n      border-radius: ",";\n    "]);ke=function t(){return e};return e}function kt(){var e=(0,eS._)(["\n      &:hover {\n        background-color: ",";\n        color: ",";\n\n        [data-action-buttons] {\n          opacity: ",";\n        }\n      }\n    "]);kt=function t(){return e};return e}function kr(){var e=(0,eS._)(["\n      display: block;\n      background-color: ",";\n      color: ",";\n      padding: 0;\n      cursor: default;\n    "]);kr=function t(){return e};return e}function kn(){var e=(0,eS._)(["\n        ","\n      "]);kn=function t(){return e};return e}function ki(){var e=(0,eS._)(["\n      ","\n      padding: "," ",";\n      border-radius: ",";\n    "]);ki=function t(){return e};return e}function ka(){var e=(0,eS._)(["\n      opacity: 1;\n    "]);ka=function t(){return e};return e}var ko=e=>{var{maxLimit:r,maxHeight:i,field:a,fieldState:o,disabled:s,readOnly:l,loading:u,placeholder:c,helpText:d,onChange:f,onKeyDown:p,isHidden:h,isSecondary:v=false,removeBorder:g,dataAttribute:m,isInlineLabel:b=false,style:y,wrapperCss:_,selectOnFocus:w=false,size:x="regular",isEdit:A,onToggleEdit:k}=e;var E;var I=(E=a.value)!==null&&E!==void 0?E:"";var C=(0,n.useRef)(null);var Y=(0,eO/* .isDefined */.O9)(A);var[T,S]=(0,n.useState)(!I?true:false);var O=Y?A:T;var[D,F]=(0,n.useState)(I);var R=undefined;if(r){R={maxLimit:r,inputCharacter:I.toString().length}}var P=(0,e$._)({},(0,eO/* .isDefined */.O9)(m)&&{[m]:true});(0,n.useEffect)(()=>{if(O&&C.current){C.current.focus();F(I)}L();// eslint-disable-next-line react-hooks/exhaustive-deps
},[O]);var M=e=>{if(!Y){S(e)}k===null||k===void 0?void 0:k(e)};var H=()=>{M(false)};var N=()=>{a.onChange(D);M(false)};var L=()=>{if(C.current){var e=C.current;var t=e.offsetHeight;var r=e.scrollHeight;if(r>t){if(i&&r>i){e.style.height="".concat(i,"px");e.style.overflowY="auto"}else{e.style.height="".concat(r,"px");e.style.overflowY="hidden"}}}};return/*#__PURE__*/(0,t/* .jsx */.Y)(fv,{field:a,fieldState:o,disabled:s,readOnly:l,loading:u,helpText:d,isHidden:h,characterCount:R,isSecondary:v,removeBorder:g,isInlineLabel:b,inputStyle:y,children:e=>{return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{role:"button",css:[kl.container({isEdit:O,isDisabled:s||false,size:x}),_],"aria-label":(0,em.__)("Question title field","tutor-pro"),children:[/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:!O,children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{"data-placeholder":true,css:kl.placeholder({size:x}),onClick:()=>!s&&M(true),onKeyDown:e=>{if(e.key==="Enter"||e.key===" "){M(true)}},children:a.value||c})}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:O,children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:kl.inputContainer({hasValueChanged:!!D&&a.value!==D,size:x}),children:/*#__PURE__*/(0,t/* .jsx */.Y)("textarea",(0,eX._)((0,e$._)({},a,e,P),{className:"tutor-input-field",rows:2,ref:e=>{a.ref(e);// @ts-ignore
C.current=e;// this is not ideal but it is the only way to set ref to the input element
},value:I,placeholder:c,onChange:e=>{var{value:t}=e.target;a.onChange(t);if(f){f(t)}},onKeyDown:e=>{if(e.key==="Enter"&&(e.ctrlKey||e.metaKey)){e.preventDefault();H()}else if(e.key==="Escape"){e.preventDefault();N()}p===null||p===void 0?void 0:p(e.key)},onInput:L,onPaste:L,onFocus:e=>{if(w){e.target.select()}},autoComplete:"off"}))})}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{"data-action-buttons":true,css:kl.actionButtonWrapper({isEdit:O}),children:/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:O,fallback:/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{buttonCss:kl.actionButton,variant:"text",size:"small",onClick:()=>M(true),"aria-label":(0,em.__)("Edit question title","tutor-pro"),"data-question-title-edit-button":true,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"edit",height:24,width:24})}),children:/*#__PURE__*/(0,t/* .jsxs */.FD)(t/* .Fragment */.FK,{children:[/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:a.value!==D&&a.value,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{buttonCss:kl.actionButton,variant:"text",size:"small",onClick:H,disabled:a.value===D,"aria-label":(0,em.__)("Save question title","tutor-pro"),children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"checkMark",height:24,width:24})})}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:!!I&&D,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{buttonCss:kl.actionButton,variant:"text",size:"small",onClick:N,"aria-label":(0,em.__)("Cancel question title","tutor-pro"),children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"lineCross",height:24,width:24})})})]})})})]})}})};/* ESM default export */const ks=ko;var kl={container:e=>{var{isEdit:t,isDisabled:r,size:n}=e;return/*#__PURE__*/(0,o/* .css */.AH)("display:grid;align-items:center;gap:",ey/* .spacing["8"] */.YK["8"],";grid-template-columns:1fr auto;min-height:50px;padding-inline:",ey/* .spacing["8"] */.YK["8"]," ",ey/* .spacing["16"] */.YK["16"],";padding-block:",ey/* .spacing["8"] */.YK["8"],";border-radius:",ey/* .borderRadius["6"] */.Vq["6"],";",n==="small"&&(0,o/* .css */.AH)(ke(),ey/* .spacing["4"] */.YK["4"],ey/* .spacing["8"] */.YK["8"],ey/* .borderRadius["4"] */.Vq["4"])," ",!r&&(0,o/* .css */.AH)(kt(),ey/* .colorTokens.background.white */.I6.background.white,ey/* .colorTokens.text.subdued */.I6.text.subdued,!r?1:0)," ",t&&(0,o/* .css */.AH)(kr(),ey/* .colorTokens.background.white */.I6.background.white,ey/* .colorTokens.text.subdued */.I6.text.subdued)," ",ey/* .Breakpoint.smallTablet */.EA.smallTablet,"{[data-action-buttons]{opacity:1;}}")},inputContainer:e=>{var{hasValueChanged:t,size:r}=e;return/*#__PURE__*/(0,o/* .css */.AH)("position:relative;display:flex;transition:background 0.15s ease-in-out;& textarea{",eK/* .typography.heading6 */.I.heading6(),"      color:",ey/* .colorTokens.text.primary */.I6.text.primary,";border:none;background:none;padding:0;width:100%;padding:",ey/* .spacing["8"] */.YK["8"]," ",ey/* .spacing["16"] */.YK["16"],";background-color:",ey/* .colorTokens.background.white */.I6.background.white,";&.tutor-input-field{padding-right:",t?ey/* .spacing["64"] */.YK["64"]:ey/* .spacing["32"] */.YK["32"],";}",r==="small"&&(0,o/* .css */.AH)(kn(),eK/* .typography.caption */.I.caption()),"}")},placeholder:e=>{var{size:t}=e;return/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.heading6 */.I.heading6(),"    color:",ey/* .colorTokens.text.hints */.I6.text.hints,";border-radius:",ey/* .borderRadius["6"] */.Vq["6"],";",t==="small"&&(0,o/* .css */.AH)(ki(),eK/* .typography.caption */.I.caption(),ey/* .spacing["4"] */.YK["4"],ey/* .spacing["8"] */.YK["8"],ey/* .borderRadius["4"] */.Vq["4"]))},actionButtonWrapper:e=>{var{isEdit:t}=e;return/*#__PURE__*/(0,o/* .css */.AH)("position:",t?"absolute":"static",";height:100%;right:",ey/* .spacing["4"] */.YK["4"],";top:0;display:flex;align-items:center;gap:",ey/* .spacing["8"] */.YK["8"],";opacity:0;transition:opacity 0.15s ease-in-out;",t&&(0,o/* .css */.AH)(ka()))},actionButton:/*#__PURE__*/(0,o/* .css */.AH)("padding:0;color:",ey/* .colorTokens.icon.subdued */.I6.icon.subdued,";")};// CONCATENATED MODULE: ./addons/content-bank/assets/react/manage-contents/context/QuestionModalContext.tsx
var ku=/*#__PURE__*/(0,n.createContext)(undefined);var kc=e=>{var{children:r}=e;var[i,a]=(0,n.useState)(null);var o={validationError:i,setValidationError:a};return/*#__PURE__*/(0,t/* .jsx */.Y)(ku.Provider,{value:o,children:typeof r==="function"?r({setValidationError:a}):r})};var kd=()=>{var e=(0,n.useContext)(ku);if(e===undefined){throw new Error("useQuestionModal must be used within a QuestionModalProvider")}return e};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/fields/quiz/questions/FormFillinTheBlanks.tsx
function kf(){var e=(0,eS._)(["\n      background-color: ",";\n      box-shadow: 0 0 0 1px ",";\n\n      &:hover {\n        box-shadow: 0 0 0 1px ",";\n      }\n    "]);kf=function t(){return e};return e}function kp(){var e=(0,eS._)(["\n      color: ",";\n    "]);kp=function t(){return e};return e}function kh(){var e=(0,eS._)(["\n      color: ",";\n\n      span {\n        color: ",";\n      }\n    "]);kh=function t(){return e};return e}var kv=e=>{var{field:r,questionId:i,validationError:a,setValidationError:o}=e;var s,l,u,c;var d;var f=(d=r.value)!==null&&d!==void 0?d:{_data_status:eO/* .QuizDataStatus.NEW */.cW.NEW,is_saved:false,answer_id:(0,ej/* .nanoid */.Ak)(),answer_title:"",belongs_question_id:i,belongs_question_type:"fill_in_the_blank",answer_two_gap_match:"",answer_view_format:"text",answer_order:0,is_correct:"0"};var p=(0,n.useRef)(null);var h=(s=f.answer_two_gap_match)===null||s===void 0?void 0:s.split("|");var[v,g]=(0,n.useState)(!f.answer_title||!f.answer_two_gap_match);var[m,b]=(0,n.useState)(f);var y=((u=f.answer_title)===null||u===void 0?void 0:(l=u.match(/{dash}/g))===null||l===void 0?void 0:l.length)||0;var _=((c=f.answer_two_gap_match)===null||c===void 0?void 0:c.split("|").length)||0;var w=!!(f.answer_title&&f.answer_two_gap_match&&y!==_);(0,n.useEffect)(()=>{if((0,eO/* .isDefined */.O9)(p.current)&&v){p.current.focus()}},[v]);return/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:km.option,children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:km.optionLabel({isEditing:v}),children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:km.optionHeader,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:km.optionTitle,children:(0,em.__)("Fill in the blanks","tutor-pro")}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:f.is_saved&&!v,children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:km.optionActions,children:/*#__PURE__*/(0,t/* .jsx */.Y)(d9,{content:(0,em.__)("Edit","tutor-pro"),children:/*#__PURE__*/(0,t/* .jsx */.Y)("button",{type:"button",css:eB/* .styleUtils.actionButton */.x.actionButton,"data-edit-button":true,onClick:e=>{e.stopPropagation();g(true)},"data-visually-hidden":true,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"edit",width:24,height:24})})})})})]}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:km.optionBody,children:/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:!f.is_saved||v,fallback:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:km.placeholderWrapper,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:km.optionPlaceholder({isTitle:!!f.answer_title}),children:f.answer_title?f.answer_title.replace(/{dash}/g,"_____"):(0,em.__)("Question title...","tutor-pro")}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:km.optionPlaceholder({isCorrectAnswer:h===null||h===void 0?void 0:h.length}),children:h&&h.length>0?/*#__PURE__*/(0,t/* .jsx */.Y)(fb,{each:h,children:(e,r)=>/*#__PURE__*/(0,t/* .jsxs */.FD)(n.Fragment,{children:[e,/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:r<(h?h.length-1:0),children:/*#__PURE__*/(0,t/* .jsx */.Y)("span",{children:"|"})})]},r)}):(0,em.__)("Correct Answer(s)...","tutor-pro")})]}),children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:km.optionInputWrapper,children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:km.inputWithHints,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("input",(0,eX._)((0,e$._)({},r),{ref:p,type:"text",placeholder:(0,em.__)("Question title...","tutor-pro"),value:f.answer_title,onClick:e=>{e.stopPropagation()},onChange:e=>{r.onChange((0,eX._)((0,e$._)({},f,AL(f._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:AL(f._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{answer_title:e.target.value}))},onKeyDown:e=>fQ(function*(){e.stopPropagation();if((e.metaKey||e.ctrlKey)&&e.key==="Enter"&&f.answer_title){r.onChange((0,e$._)({},f,AL(f._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:AL(f._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)}));g(false)}})()})),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:km.inputHints,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"info",height:20,width:20}),/*#__PURE__*/(0,t/* .jsx */.Y)("p",{children:(0,em.__)("Please make sure to use the variable {dash} in your question title to show the blanks in your question. You can use multiple {dash} variables in one question.","tutor-pro")})]})]}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:km.inputWithHints,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("input",(0,eX._)((0,e$._)({},r),{type:"text",placeholder:(0,em.__)("Correct Answer(s)...","tutor-pro"),value:h===null||h===void 0?void 0:h.join("|"),onClick:e=>{e.stopPropagation()},onChange:e=>{r.onChange((0,eX._)((0,e$._)({},f,AL(f._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:AL(f._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{answer_two_gap_match:e.target.value}))},onKeyDown:e=>fQ(function*(){if((e.metaKey||e.ctrlKey)&&e.key==="Enter"&&f.answer_two_gap_match){r.onChange((0,e$._)({},f,AL(f._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:AL(f._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE),is_saved:true}));if((a===null||a===void 0?void 0:a.type)==="save_option"){o===null||o===void 0?void 0:o(null)}g(false)}})()})),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:w,children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:km.errorMessage,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"info",height:20,width:20}),/*#__PURE__*/(0,t/* .jsx */.Y)("p",{children:(0,em.__)("Match the number of answers to the number of blanks {dash} in your question.","tutor-pro")})]})}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:km.inputHints,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"info",height:20,width:20}),/*#__PURE__*/(0,t/* .jsx */.Y)("p",{children:(0,em.__)("Separate multiple answers by a vertical bar |. 1 answer per {dash} variable is defined in the question. Example: Apple | Banana | Orange","tutor-pro")})]})]}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:km.optionInputButtons,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:f.is_saved,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"text",size:"small",onClick:e=>{e.stopPropagation();g(false);r.onChange(m)},children:(0,em.__)("Cancel","tutor-pro")})}),/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"secondary",size:"small",onClick:e=>fQ(function*(){e.stopPropagation();if(w){return}r.onChange((0,e$._)({},f,AL(f._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:AL(f._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE),is_saved:true}));b((0,e$._)({},f,AL(f._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:AL(f._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE),is_saved:true}));if((a===null||a===void 0?void 0:a.type)==="save_option"){o===null||o===void 0?void 0:o(null)}g(false)})(),disabled:!f.answer_title||!f.answer_two_gap_match||w,children:(0,em.__)("Ok","tutor-pro")})]})]})})})]})})};/* ESM default export */const kg=kv;var km={option:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),";",eK/* .typography.caption */.I.caption("medium"),";align-items:center;color:",ey/* .colorTokens.text.subdued */.I6.text.subdued,";gap:",ey/* .spacing["10"] */.YK["10"],";align-items:center;"),optionLabel:e=>{var{isEditing:t}=e;return/*#__PURE__*/(0,o/* .css */.AH)("display:flex;flex-direction:column;gap:",ey/* .spacing["12"] */.YK["12"],";width:100%;border-radius:",ey/* .borderRadius.card */.Vq.card,";padding:",ey/* .spacing["12"] */.YK["12"]," ",ey/* .spacing["16"] */.YK["16"],";transition:box-shadow 0.15s ease-in-out;background-color:",ey/* .colorTokens.background.white */.I6.background.white,";[data-visually-hidden]{opacity:0;}&:hover{box-shadow:0 0 0 1px ",ey/* .colorTokens.stroke.hover */.I6.stroke.hover,";[data-visually-hidden]{opacity:1;}}",t&&(0,o/* .css */.AH)(kf(),ey/* .colorTokens.background.white */.I6.background.white,ey/* .colorTokens.stroke.brand */.I6.stroke.brand,ey/* .colorTokens.stroke.brand */.I6.stroke.brand))},optionHeader:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;justify-content:space-between;align-items:center;"),optionTitle:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.caption */.I.caption("medium"),";color:",ey/* .colorTokens.text.subdued */.I6.text.subdued,";"),optionActions:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;gap:",ey/* .spacing["8"] */.YK["8"],";align-items:center;"),actionButton:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.resetButton */.x.resetButton,";color:",ey/* .colorTokens.icon["default"] */.I6.icon["default"],";display:flex;cursor:pointer;"),optionBody:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;"),optionInputWrapper:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.optionInputWrapper */.x.optionInputWrapper,";gap:",ey/* .spacing["16"] */.YK["16"],";"),placeholderWrapper:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;flex-direction:column;"),optionPlaceholder:e=>{var{isTitle:t,isCorrectAnswer:r}=e;return/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.body */.I.body(),";color:",ey/* .colorTokens.text.subdued */.I6.text.subdued,";padding-block:",ey/* .spacing["4"] */.YK["4"],";display:flex;align-items:center;gap:",ey/* .spacing["4"] */.YK["4"],";",t&&(0,o/* .css */.AH)(kp(),ey/* .colorTokens.text.hints */.I6.text.hints)," ",r&&(0,o/* .css */.AH)(kh(),ey/* .colorTokens.text.success */.I6.text.success,ey/* .colorTokens.stroke.border */.I6.stroke.border))},inputWithHints:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;flex-direction:column;gap:",ey/* .spacing["8"] */.YK["8"],";"),inputHints:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;gap:",ey/* .spacing["4"] */.YK["4"],";",eK/* .typography.small */.I.small(),";color:",ey/* .colorTokens.text.hints */.I6.text.hints,";align-items:flex-start;svg{flex-shrink:0;}"),errorMessage:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;gap:",ey/* .spacing["4"] */.YK["4"],";",eK/* .typography.small */.I.small(),";color:",ey/* .colorTokens.text.error */.I6.text.error,";align-items:flex-start;color:",ey/* .colorTokens.text.error */.I6.text.error,";svg{flex-shrink:0;color:",ey/* .colorTokens.icon.error */.I6.icon.error,";}"),optionInputButtons:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;justify-content:flex-end;gap:",ey/* .spacing["8"] */.YK["8"],";")};// CONCATENATED MODULE: ./addons/content-bank/assets/react/manage-contents/components/question-types/FillinTheBlanks.tsx
var kb=()=>{var e=sw();var{validationError:r,setValidationError:n}=kd();var i=e.watch("question_id");var{fields:a}=lT({control:e.control,name:"question_answers"});return/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:k_.optionWrapper,children:/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{control:e.control,name:"question_answers.0",render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(kg,ev(ep({},e),{questionId:i,validationError:r,setValidationError:n}))},a.length?JSON.stringify(a[0]):"")})};/* ESM default export */const ky=kb;var k_={optionWrapper:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),";padding-left:",ey/* .spacing["40"] */.YK["40"],";")};// CONCATENATED MODULE: ./node_modules/@dnd-kit/utilities/dist/utilities.esm.js
function kw(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return(0,n.useMemo)(()=>e=>{t.forEach(t=>t(e))},t)}// https://github.com/facebook/react/blob/master/packages/shared/ExecutionEnvironment.js
const kx=typeof window!=="undefined"&&typeof window.document!=="undefined"&&typeof window.document.createElement!=="undefined";function kA(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||// In Electron context the Window object serializes to [object global]
t==="[object global]"}function kk(e){return"nodeType"in e}function kE(e){var t,r;if(!e){return window}if(kA(e)){return e}if(!kk(e)){return window}return(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window}function kI(e){const{Document:t}=kE(e);return e instanceof t}function kC(e){if(kA(e)){return false}return e instanceof kE(e).HTMLElement}function kY(e){return e instanceof kE(e).SVGElement}function kT(e){if(!e){return document}if(kA(e)){return e.document}if(!kk(e)){return document}if(kI(e)){return e}if(kC(e)||kY(e)){return e.ownerDocument}return document}/**
 * A hook that resolves to useEffect on the server and useLayoutEffect on the client
 * @param callback {function} Callback function that is invoked when the dependencies of the hook change
 */const kS=kx?n.useLayoutEffect:n.useEffect;function kO(e){const t=(0,n.useRef)(e);kS(()=>{t.current=e});return(0,n.useCallback)(function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++){r[n]=arguments[n]}return t.current==null?void 0:t.current(...r)},[])}function kD(){const e=(0,n.useRef)(null);const t=(0,n.useCallback)((t,r)=>{e.current=setInterval(t,r)},[]);const r=(0,n.useCallback)(()=>{if(e.current!==null){clearInterval(e.current);e.current=null}},[]);return[t,r]}function kF(e,t){if(t===void 0){t=[e]}const r=(0,n.useRef)(e);kS(()=>{if(r.current!==e){r.current=e}},t);return r}function kR(e,t){const r=(0,n.useRef)();return(0,n.useMemo)(()=>{const t=e(r.current);r.current=t;return t},[...t])}function kP(e){const t=kO(e);const r=(0,n.useRef)(null);const i=(0,n.useCallback)(e=>{if(e!==r.current){t==null?void 0:t(e,r.current)}r.current=e},[]);return[r,i]}function kM(e){const t=(0,n.useRef)();(0,n.useEffect)(()=>{t.current=e},[e]);return t.current}let kH={};function kN(e,t){return(0,n.useMemo)(()=>{if(t){return t}const r=kH[e]==null?0:kH[e]+1;kH[e]=r;return e+"-"+r},[e,t])}function kL(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++){n[i-1]=arguments[i]}return n.reduce((t,r)=>{const n=Object.entries(r);for(const[r,i]of n){const n=t[r];if(n!=null){t[r]=n+e*i}}return t},{...t})}}const kK=/*#__PURE__*/kL(1);const kB=/*#__PURE__*/kL(-1);function kj(e){return"clientX"in e&&"clientY"in e}function kU(e){if(!e){return false}const{KeyboardEvent:t}=kE(e.target);return t&&e instanceof t}function kq(e){if(!e){return false}const{TouchEvent:t}=kE(e.target);return t&&e instanceof t}/**
 * Returns the normalized x and y coordinates for mouse and touch events.
 */function kV(e){if(kq(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}}}if(kj(e)){return{x:e.clientX,y:e.clientY}}return null}const kW=/*#__PURE__*/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}return[kW.Translate.toString(e),kW.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}});const kz="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function kG(e){if(e.matches(kz)){return e}return e.querySelector(kz)}//# sourceMappingURL=utilities.esm.js.map
;// CONCATENATED MODULE: ./node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js
const kQ={display:"none"};function k$(e){let{id:t,value:r}=e;return i().createElement("div",{id:t,style:kQ},r)}function kX(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;// Hide element visually but keep it readable by screen readers
const a={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 i().createElement("div",{id:t,style:a,role:"status","aria-live":n,"aria-atomic":true},r)}function kJ(){const[e,t]=(0,n.useState)("");const r=(0,n.useCallback)(e=>{if(e!=null){t(e)}},[]);return{announce:r,announcement:e}}//# sourceMappingURL=accessibility.esm.js.map
;// CONCATENATED MODULE: ./node_modules/@dnd-kit/core/dist/core.esm.js
const kZ=/*#__PURE__*/(0,n.createContext)(null);function k0(e){const t=(0,n.useContext)(kZ);(0,n.useEffect)(()=>{if(!t){throw new Error("useDndMonitor must be used within a children of <DndContext>")}const r=t(e);return r},[e,t])}function k1(){const[e]=(0,n.useState)(()=>new Set);const t=(0,n.useCallback)(t=>{e.add(t);return()=>e.delete(t)},[e]);const r=(0,n.useCallback)(t=>{let{type:r,event:n}=t;e.forEach(e=>{var t;return(t=e[r])==null?void 0:t.call(e,n)})},[e]);return[r,t]}const k2={draggable:"\n    To pick up a draggable item, press the space bar.\n    While dragging, use the arrow keys to move the item.\n    Press space again to drop the item in its new position, or press escape to cancel.\n  "};const k6={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;if(r){return"Draggable item "+t.id+" was moved over droppable area "+r.id+"."}return"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;if(r){return"Draggable item "+t.id+" was dropped over droppable area "+r.id}return"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function k4(e){let{announcements:t=k6,container:r,hiddenTextDescribedById:a,screenReaderInstructions:o=k2}=e;const{announce:s,announcement:l}=kJ();const u=kN("DndLiveRegion");const[c,d]=(0,n.useState)(false);(0,n.useEffect)(()=>{d(true)},[]);k0((0,n.useMemo)(()=>({onDragStart(e){let{active:r}=e;s(t.onDragStart({active:r}))},onDragMove(e){let{active:r,over:n}=e;if(t.onDragMove){s(t.onDragMove({active:r,over:n}))}},onDragOver(e){let{active:r,over:n}=e;s(t.onDragOver({active:r,over:n}))},onDragEnd(e){let{active:r,over:n}=e;s(t.onDragEnd({active:r,over:n}))},onDragCancel(e){let{active:r,over:n}=e;s(t.onDragCancel({active:r,over:n}))}}),[s,t]));if(!c){return null}const f=i().createElement(i().Fragment,null,i().createElement(k$,{id:a,value:o.draggable}),i().createElement(kX,{id:u,announcement:l}));return r?(0,iW.createPortal)(f,r):f}var k5;(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"})(k5||(k5={}));function k3(){}function k8(e,t){return(0,n.useMemo)(()=>({sensor:e,options:t!=null?t:{}}),[e,t])}function k9(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return(0,n.useMemo)(()=>[...t].filter(e=>e!=null),[...t])}const k7=/*#__PURE__*/Object.freeze({x:0,y:0});/**
 * Returns the distance between two points
 */function Ee(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Et(e,t){const r=kV(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+"%"}/**
 * Sort collisions from smallest to greatest value
 */function Er(e,t){let{data:{value:r}}=e;let{data:{value:n}}=t;return r-n}/**
 * Sort collisions from greatest to smallest value
 */function En(e,t){let{data:{value:r}}=e;let{data:{value:n}}=t;return n-r}/**
 * Returns the coordinates of the corners of a given rectangle:
 * [TopLeft {x, y}, TopRight {x, y}, BottomLeft {x, y}, BottomRight {x, y}]
 */function Ei(e){let{left:t,top:r,height:n,width:i}=e;return[{x:t,y:r},{x:t+i,y:r},{x:t,y:r+n},{x:t+i,y:r+n}]}function Ea(e,t){if(!e||e.length===0){return null}const[r]=e;return t?r[t]:r}/**
 * Returns the coordinates of the center of a given ClientRect
 */function Eo(e,t,r){if(t===void 0){t=e.left}if(r===void 0){r=e.top}return{x:t+e.width*.5,y:r+e.height*.5}}/**
 * Returns the closest rectangles from an array of rectangles to the center of a given
 * rectangle.
 */const Es=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const i=Eo(t,t.left,t.top);const a=[];for(const e of n){const{id:t}=e;const n=r.get(t);if(n){const r=Ee(Eo(n),i);a.push({id:t,data:{droppableContainer:e,value:r}})}}return a.sort(Er)};/**
 * Returns the closest rectangles from an array of rectangles to the corners of
 * another rectangle.
 */const El=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const i=Ei(t);const a=[];for(const e of n){const{id:t}=e;const n=r.get(t);if(n){const r=Ei(n);const o=i.reduce((e,t,n)=>{return e+Ee(r[n],t)},0);const s=Number((o/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:s}})}}return a.sort(Er)};/**
 * Returns the intersecting rectangle area between two rectangles
 */function Eu(e,t){const r=Math.max(t.top,e.top);const n=Math.max(t.left,e.left);const i=Math.min(t.left+t.width,e.left+e.width);const a=Math.min(t.top+t.height,e.top+e.height);const o=i-n;const s=a-r;if(n<i&&r<a){const r=t.width*t.height;const n=e.width*e.height;const i=o*s;const a=i/(r+n-i);return Number(a.toFixed(4))}// Rectangles do not overlap, or overlap has an area of zero (edge/corner overlap)
return 0}/**
 * Returns the rectangles that has the greatest intersection area with a given
 * rectangle in an array of rectangles.
 */const Ec=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const i=[];for(const e of n){const{id:n}=e;const a=r.get(n);if(a){const r=Eu(a,t);if(r>0){i.push({id:n,data:{droppableContainer:e,value:r}})}}}return i.sort(En)};/**
 * Check if a given point is contained within a bounding rectangle
 */function Ed(e,t){const{top:r,left:n,bottom:i,right:a}=t;return r<=e.y&&e.y<=i&&n<=e.x&&e.x<=a}/**
 * Returns the rectangles that the pointer is hovering over
 */const Ef=e=>{let{droppableContainers:t,droppableRects:r,pointerCoordinates:n}=e;if(!n){return[]}const i=[];for(const e of t){const{id:t}=e;const a=r.get(t);if(a&&Ed(n,a)){/* There may be more than a single rectangle intersecting
       * with the pointer coordinates. In order to sort the
       * colliding rectangles, we measure the distance between
       * the pointer and the corners of the intersecting rectangle
       */const r=Ei(a);const o=r.reduce((e,t)=>{return e+Ee(n,t)},0);const s=Number((o/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:s}})}}return i.sort(Er)};function Ep(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function Eh(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:k7}function Ev(e){return function t(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++){n[i-1]=arguments[i]}return n.reduce((t,r)=>({...t,top:t.top+e*r.y,bottom:t.bottom+e*r.y,left:t.left+e*r.x,right:t.right+e*r.x}),{...t})}}const Eg=/*#__PURE__*/Ev(1);function Em(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 Eb(e,t,r){const n=Em(t);if(!n){return e}const{scaleX:i,scaleY:a,x:o,y:s}=n;const l=e.left-o-(1-i)*parseFloat(r);const u=e.top-s-(1-a)*parseFloat(r.slice(r.indexOf(" ")+1));const c=i?e.width/i:e.width;const d=a?e.height/a:e.height;return{width:c,height:d,top:u,right:l+c,bottom:u+d,left:l}}const Ey={ignoreTransform:false};/**
 * Returns the bounding client rect of an element relative to the viewport.
 */function E_(e,t){if(t===void 0){t=Ey}let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:n}=kE(e).getComputedStyle(e);if(t){r=Eb(r,t,n)}}const{top:n,left:i,width:a,height:o,bottom:s,right:l}=r;return{top:n,left:i,width:a,height:o,bottom:s,right:l}}/**
 * Returns the bounding client rect of an element relative to the viewport.
 *
 * @remarks
 * The ClientRect returned by this method does not take into account transforms
 * applied to the element it measures.
 *
 */function Ew(e){return E_(e,{ignoreTransform:true})}function Ex(e){const t=e.innerWidth;const r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function EA(e,t){if(t===void 0){t=kE(e).getComputedStyle(e)}return t.position==="fixed"}function Ek(e,t){if(t===void 0){t=kE(e).getComputedStyle(e)}const r=/(auto|scroll|overlay)/;const n=["overflow","overflowX","overflowY"];return n.some(e=>{const n=t[e];return typeof n==="string"?r.test(n):false})}function EE(e,t){const r=[];function n(i){if(t!=null&&r.length>=t){return r}if(!i){return r}if(kI(i)&&i.scrollingElement!=null&&!r.includes(i.scrollingElement)){r.push(i.scrollingElement);return r}if(!kC(i)||kY(i)){return r}if(r.includes(i)){return r}const a=kE(e).getComputedStyle(i);if(i!==e){if(Ek(i,a)){r.push(i)}}if(EA(i,a)){return r}return n(i.parentNode)}if(!e){return r}return n(e)}function EI(e){const[t]=EE(e,1);return t!=null?t:null}function EC(e){if(!kx||!e){return null}if(kA(e)){return e}if(!kk(e)){return null}if(kI(e)||e===kT(e).scrollingElement){return window}if(kC(e)){return e}return null}function EY(e){if(kA(e)){return e.scrollX}return e.scrollLeft}function ET(e){if(kA(e)){return e.scrollY}return e.scrollTop}function ES(e){return{x:EY(e),y:ET(e)}}var EO;(function(e){e[e["Forward"]=1]="Forward";e[e["Backward"]=-1]="Backward"})(EO||(EO={}));function ED(e){if(!kx||!e){return false}return e===document.scrollingElement}function EF(e){const t={x:0,y:0};const r=ED(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth};const n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height};const i=e.scrollTop<=t.y;const a=e.scrollLeft<=t.x;const o=e.scrollTop>=n.y;const s=e.scrollLeft>=n.x;return{isTop:i,isLeft:a,isBottom:o,isRight:s,maxScroll:n,minScroll:t}}const ER={x:.2,y:.2};function EP(e,t,r,n,i){let{top:a,left:o,right:s,bottom:l}=r;if(n===void 0){n=10}if(i===void 0){i=ER}const{isTop:u,isBottom:c,isLeft:d,isRight:f}=EF(e);const p={x:0,y:0};const h={x:0,y:0};const v={height:t.height*i.y,width:t.width*i.x};if(!u&&a<=t.top+v.height){// Scroll Up
p.y=EO.Backward;h.y=n*Math.abs((t.top+v.height-a)/v.height)}else if(!c&&l>=t.bottom-v.height){// Scroll Down
p.y=EO.Forward;h.y=n*Math.abs((t.bottom-v.height-l)/v.height)}if(!f&&s>=t.right-v.width){// Scroll Right
p.x=EO.Forward;h.x=n*Math.abs((t.right-v.width-s)/v.width)}else if(!d&&o<=t.left+v.width){// Scroll Left
p.x=EO.Backward;h.x=n*Math.abs((t.left+v.width-o)/v.width)}return{direction:p,speed:h}}function EM(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:r,right:n,bottom:i}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:i,width:e.clientWidth,height:e.clientHeight}}function EH(e){return e.reduce((e,t)=>{return kK(e,ES(t))},k7)}function EN(e){return e.reduce((e,t)=>{return e+EY(t)},0)}function EL(e){return e.reduce((e,t)=>{return e+ET(t)},0)}function EK(e,t){if(t===void 0){t=E_}if(!e){return}const{top:r,left:n,bottom:i,right:a}=t(e);const o=EI(e);if(!o){return}if(i<=0||a<=0||r>=window.innerHeight||n>=window.innerWidth){e.scrollIntoView({block:"center",inline:"center"})}}const EB=[["x",["left","right"],EN],["y",["top","bottom"],EL]];class Ej{constructor(e,t){this.rect=void 0;this.width=void 0;this.height=void 0;this.top=void 0;this.bottom=void 0;this.right=void 0;this.left=void 0;const r=EE(t);const n=EH(r);this.rect={...e};this.width=e.width;this.height=e.height;for(const[e,t,i]of EB){for(const a of t){Object.defineProperty(this,a,{get:()=>{const t=i(r);const o=n[e]-t;return this.rect[a]+o},enumerable:true})}}Object.defineProperty(this,"rect",{enumerable:false})}}class EU{constructor(e){this.target=void 0;this.listeners=[];this.removeAll=()=>{this.listeners.forEach(e=>{var t;return(t=this.target)==null?void 0:t.removeEventListener(...e)})};this.target=e}add(e,t,r){var n;(n=this.target)==null?void 0:n.addEventListener(e,t,r);this.listeners.push([e,t,r])}}function Eq(e){// If the `event.target` element is removed from the document events will still be targeted
// at it, and hence won't always bubble up to the window or document anymore.
// If there is any risk of an element being removed while it is being dragged,
// the best practice is to attach the event listeners directly to the target.
// https://developer.mozilla.org/en-US/docs/Web/API/EventTarget
const{EventTarget:t}=kE(e);return e instanceof t?e:kT(e)}function EV(e,t){const r=Math.abs(e.x);const n=Math.abs(e.y);if(typeof t==="number"){return Math.sqrt(r**2+n**2)>t}if("x"in t&&"y"in t){return r>t.x&&n>t.y}if("x"in t){return r>t.x}if("y"in t){return n>t.y}return false}var EW;(function(e){e["Click"]="click";e["DragStart"]="dragstart";e["Keydown"]="keydown";e["ContextMenu"]="contextmenu";e["Resize"]="resize";e["SelectionChange"]="selectionchange";e["VisibilityChange"]="visibilitychange"})(EW||(EW={}));function Ez(e){e.preventDefault()}function EG(e){e.stopPropagation()}var EQ;(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"})(EQ||(EQ={}));const E$={start:[EQ.Space,EQ.Enter],cancel:[EQ.Esc],end:[EQ.Space,EQ.Enter,EQ.Tab]};const EX=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case EQ.Right:return{...r,x:r.x+25};case EQ.Left:return{...r,x:r.x-25};case EQ.Down:return{...r,y:r.y+25};case EQ.Up:return{...r,y:r.y-25}}return undefined};class EJ{constructor(e){this.props=void 0;this.autoScrollEnabled=false;this.referenceCoordinates=void 0;this.listeners=void 0;this.windowListeners=void 0;this.props=e;const{event:{target:t}}=e;this.props=e;this.listeners=new EU(kT(t));this.windowListeners=new EU(kE(t));this.handleKeyDown=this.handleKeyDown.bind(this);this.handleCancel=this.handleCancel.bind(this);this.attach()}attach(){this.handleStart();this.windowListeners.add(EW.Resize,this.handleCancel);this.windowListeners.add(EW.VisibilityChange,this.handleCancel);setTimeout(()=>this.listeners.add(EW.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props;const r=e.node.current;if(r){EK(r)}t(k7)}handleKeyDown(e){if(kU(e)){const{active:t,context:r,options:n}=this.props;const{keyboardCodes:i=E$,coordinateGetter:a=EX,scrollBehavior:o="smooth"}=n;const{code:s}=e;if(i.end.includes(s)){this.handleEnd(e);return}if(i.cancel.includes(s)){this.handleCancel(e);return}const{collisionRect:l}=r.current;const u=l?{x:l.left,y:l.top}:k7;if(!this.referenceCoordinates){this.referenceCoordinates=u}const c=a(e,{active:t,context:r.current,currentCoordinates:u});if(c){const t=kB(c,u);const n={x:0,y:0};const{scrollableAncestors:i}=r.current;for(const r of i){const i=e.code;const{isTop:a,isRight:s,isLeft:l,isBottom:u,maxScroll:d,minScroll:f}=EF(r);const p=EM(r);const h={x:Math.min(i===EQ.Right?p.right-p.width/2:p.right,Math.max(i===EQ.Right?p.left:p.left+p.width/2,c.x)),y:Math.min(i===EQ.Down?p.bottom-p.height/2:p.bottom,Math.max(i===EQ.Down?p.top:p.top+p.height/2,c.y))};const v=i===EQ.Right&&!s||i===EQ.Left&&!l;const g=i===EQ.Down&&!u||i===EQ.Up&&!a;if(v&&h.x!==c.x){const e=r.scrollLeft+t.x;const a=i===EQ.Right&&e<=d.x||i===EQ.Left&&e>=f.x;if(a&&!t.y){// We don't need to update coordinates, the scroll adjustment alone will trigger
// logic to auto-detect the new container we are over
r.scrollTo({left:e,behavior:o});return}if(a){n.x=r.scrollLeft-e}else{n.x=i===EQ.Right?r.scrollLeft-d.x:r.scrollLeft-f.x}if(n.x){r.scrollBy({left:-n.x,behavior:o})}break}else if(g&&h.y!==c.y){const e=r.scrollTop+t.y;const a=i===EQ.Down&&e<=d.y||i===EQ.Up&&e>=f.y;if(a&&!t.x){// We don't need to update coordinates, the scroll adjustment alone will trigger
// logic to auto-detect the new container we are over
r.scrollTo({top:e,behavior:o});return}if(a){n.y=r.scrollTop-e}else{n.y=i===EQ.Down?r.scrollTop-d.y:r.scrollTop-f.y}if(n.y){r.scrollBy({top:-n.y,behavior:o})}break}}this.handleMove(e,kK(kB(c,this.referenceCoordinates),n))}}}handleMove(e,t){const{onMove:r}=this.props;e.preventDefault();r(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault();this.detach();t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault();this.detach();t()}detach(){this.listeners.removeAll();this.windowListeners.removeAll()}}EJ.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=E$,onActivation:i}=t;let{active:a}=r;const{code:o}=e.nativeEvent;if(n.start.includes(o)){const t=a.activatorNode.current;if(t&&e.target!==t){return false}e.preventDefault();i==null?void 0:i({event:e.nativeEvent});return true}return false}}];function EZ(e){return Boolean(e&&"distance"in e)}function E0(e){return Boolean(e&&"delay"in e)}class E1{constructor(e,t,r){var n;if(r===void 0){r=Eq(e.event.target)}this.props=void 0;this.events=void 0;this.autoScrollEnabled=true;this.document=void 0;this.activated=false;this.initialCoordinates=void 0;this.timeoutId=null;this.listeners=void 0;this.documentListeners=void 0;this.windowListeners=void 0;this.props=e;this.events=t;const{event:i}=e;const{target:a}=i;this.props=e;this.events=t;this.document=kT(a);this.documentListeners=new EU(this.document);this.listeners=new EU(r);this.windowListeners=new EU(kE(a));this.initialCoordinates=(n=kV(i))!=null?n:k7;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:e,props:{options:{activationConstraint:t,bypassActivationConstraint:r}}}=this;this.listeners.add(e.move.name,this.handleMove,{passive:false});this.listeners.add(e.end.name,this.handleEnd);if(e.cancel){this.listeners.add(e.cancel.name,this.handleCancel)}this.windowListeners.add(EW.Resize,this.handleCancel);this.windowListeners.add(EW.DragStart,Ez);this.windowListeners.add(EW.VisibilityChange,this.handleCancel);this.windowListeners.add(EW.ContextMenu,Ez);this.documentListeners.add(EW.Keydown,this.handleKeydown);if(t){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options})){return this.handleStart()}if(E0(t)){this.timeoutId=setTimeout(this.handleStart,t.delay);this.handlePending(t);return}if(EZ(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll();this.windowListeners.removeAll();// Wait until the next event loop before removing document listeners
// This is necessary because we listen for `click` and `selection` events on the document
setTimeout(this.documentListeners.removeAll,50);if(this.timeoutId!==null){clearTimeout(this.timeoutId);this.timeoutId=null}}handlePending(e,t){const{active:r,onPending:n}=this.props;n(r,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this;const{onStart:t}=this.props;if(e){this.activated=true;// Stop propagation of click events once activation constraints are met
this.documentListeners.add(EW.Click,EG,{capture:true});// Remove any text selection from the document
this.removeTextSelection();// Prevent further text selection while dragging
this.documentListeners.add(EW.SelectionChange,this.removeTextSelection);t(e)}}handleMove(e){var t;const{activated:r,initialCoordinates:n,props:i}=this;const{onMove:a,options:{activationConstraint:o}}=i;if(!n){return}const s=(t=kV(e))!=null?t:k7;const l=kB(n,s);// Constraint validation
if(!r&&o){if(EZ(o)){if(o.tolerance!=null&&EV(l,o.tolerance)){return this.handleCancel()}if(EV(l,o.distance)){return this.handleStart()}}if(E0(o)){if(EV(l,o.tolerance)){return this.handleCancel()}}this.handlePending(o,l);return}if(e.cancelable){e.preventDefault()}a(s)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach();if(!this.activated){e(this.props.active)}t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach();if(!this.activated){e(this.props.active)}t()}handleKeydown(e){if(e.code===EQ.Esc){this.handleCancel()}}removeTextSelection(){var e;(e=this.document.getSelection())==null?void 0:e.removeAllRanges()}}const E2={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class E6 extends E1{constructor(e){const{event:t}=e;// Pointer events stop firing if the target is unmounted while dragging
// Therefore we attach listeners to the owner document instead
const r=kT(t.target);super(e,E2,r)}}E6.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e;let{onActivation:n}=t;if(!r.isPrimary||r.button!==0){return false}n==null?void 0:n({event:r});return true}}];const E4={move:{name:"mousemove"},end:{name:"mouseup"}};var E5;(function(e){e[e["RightClick"]=2]="RightClick"})(E5||(E5={}));class E3 extends E1{constructor(e){super(e,E4,kT(e.event.target))}}E3.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e;let{onActivation:n}=t;if(r.button===E5.RightClick){return false}n==null?void 0:n({event:r});return true}}];const E8={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class E9 extends E1{constructor(e){super(e,E8)}static setup(){// Adding a non-capture and non-passive `touchmove` listener in order
// to force `event.preventDefault()` calls to work in dynamically added
// touchmove event handlers. This is required for iOS Safari.
window.addEventListener(E8.move.name,e,{capture:false,passive:false});return function t(){window.removeEventListener(E8.move.name,e)};// We create a new handler because the teardown function of another sensor
// could remove our event listener if we use a referentially equal listener.
function e(){}}}E9.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e;let{onActivation:n}=t;const{touches:i}=r;if(i.length>1){return false}n==null?void 0:n({event:r});return true}}];var E7;(function(e){e[e["Pointer"]=0]="Pointer";e[e["DraggableRect"]=1]="DraggableRect"})(E7||(E7={}));var Ie;(function(e){e[e["TreeOrder"]=0]="TreeOrder";e[e["ReversedTreeOrder"]=1]="ReversedTreeOrder"})(Ie||(Ie={}));function It(e){let{acceleration:t,activator:r=E7.Pointer,canScroll:i,draggingRect:a,enabled:o,interval:s=5,order:l=Ie.TreeOrder,pointerCoordinates:u,scrollableAncestors:c,scrollableAncestorRects:d,delta:f,threshold:p}=e;const h=In({delta:f,disabled:!o});const[v,g]=kD();const m=(0,n.useRef)({x:0,y:0});const b=(0,n.useRef)({x:0,y:0});const y=(0,n.useMemo)(()=>{switch(r){case E7.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case E7.DraggableRect:return a}},[r,a,u]);const _=(0,n.useRef)(null);const w=(0,n.useCallback)(()=>{const e=_.current;if(!e){return}const t=m.current.x*b.current.x;const r=m.current.y*b.current.y;e.scrollBy(t,r)},[]);const x=(0,n.useMemo)(()=>l===Ie.TreeOrder?[...c].reverse():c,[l,c]);(0,n.useEffect)(()=>{if(!o||!c.length||!y){g();return}for(const e of x){if((i==null?void 0:i(e))===false){continue}const r=c.indexOf(e);const n=d[r];if(!n){continue}const{direction:a,speed:o}=EP(e,n,y,t,p);for(const e of["x","y"]){if(!h[e][a[e]]){o[e]=0;a[e]=0}}if(o.x>0||o.y>0){g();_.current=e;v(w,s);m.current=o;b.current=a;return}}m.current={x:0,y:0};b.current={x:0,y:0};g()},[t,w,i,g,o,s,JSON.stringify(y),JSON.stringify(h),v,c,x,d,JSON.stringify(p)])}const Ir={x:{[EO.Backward]:false,[EO.Forward]:false},y:{[EO.Backward]:false,[EO.Forward]:false}};function In(e){let{delta:t,disabled:r}=e;const n=kM(t);return kR(e=>{if(r||!n||!e){// Reset scroll intent tracking when auto-scrolling is disabled
return Ir}const i={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};// Keep track of the user intent to scroll in each direction for both axis
return{x:{[EO.Backward]:e.x[EO.Backward]||i.x===-1,[EO.Forward]:e.x[EO.Forward]||i.x===1},y:{[EO.Backward]:e.y[EO.Backward]||i.y===-1,[EO.Forward]:e.y[EO.Forward]||i.y===1}}},[r,t,n])}function Ii(e,t){const r=t!=null?e.get(t):undefined;const n=r?r.node.current:null;return kR(e=>{var r;if(t==null){return null}// In some cases, the draggable node can unmount while dragging
// This is the case for virtualized lists. In those situations,
// we fall back to the last known value for that node.
return(r=n!=null?n:e)!=null?r:null},[n,t])}function Ia(e,t){return(0,n.useMemo)(()=>e.reduce((e,r)=>{const{sensor:n}=r;const i=n.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,r)}));return[...e,...i]},[]),[e,t])}var Io;(function(e){e[e["Always"]=0]="Always";e[e["BeforeDragging"]=1]="BeforeDragging";e[e["WhileDragging"]=2]="WhileDragging"})(Io||(Io={}));var Is;(function(e){e["Optimized"]="optimized"})(Is||(Is={}));const Il=/*#__PURE__*/new Map;function Iu(e,t){let{dragging:r,dependencies:i,config:a}=t;const[o,s]=(0,n.useState)(null);const{frequency:l,measure:u,strategy:c}=a;const d=(0,n.useRef)(e);const f=m();const p=kF(f);const h=(0,n.useCallback)(function(e){if(e===void 0){e=[]}if(p.current){return}s(t=>{if(t===null){return e}return t.concat(e.filter(e=>!t.includes(e)))})},[p]);const v=(0,n.useRef)(null);const g=kR(t=>{if(f&&!r){return Il}if(!t||t===Il||d.current!==e||o!=null){const t=new Map;for(let r of e){if(!r){continue}if(o&&o.length>0&&!o.includes(r.id)&&r.rect.current){// This container does not need to be re-measured
t.set(r.id,r.rect.current);continue}const e=r.node.current;const n=e?new Ej(u(e),e):null;r.rect.current=n;if(n){t.set(r.id,n)}}return t}return t},[e,o,r,f,u]);(0,n.useEffect)(()=>{d.current=e},[e]);(0,n.useEffect)(()=>{if(f){return}h()},[r,f]);(0,n.useEffect)(()=>{if(o&&o.length>0){s(null)}},[JSON.stringify(o)]);(0,n.useEffect)(()=>{if(f||typeof l!=="number"||v.current!==null){return}v.current=setTimeout(()=>{h();v.current=null},l)},[l,f,h,...i]);return{droppableRects:g,measureDroppableContainers:h,measuringScheduled:o!=null};function m(){switch(c){case Io.Always:return false;case Io.BeforeDragging:return r;default:return!r}}}function Ic(e,t){return kR(r=>{if(!e){return null}if(r){return r}return typeof t==="function"?t(e):e},[t,e])}function Id(e,t){return Ic(e,t)}/**
 * Returns a new MutationObserver instance.
 * If `MutationObserver` is undefined in the execution environment, returns `undefined`.
 */function If(e){let{callback:t,disabled:r}=e;const i=kO(t);const a=(0,n.useMemo)(()=>{if(r||typeof window==="undefined"||typeof window.MutationObserver==="undefined"){return undefined}const{MutationObserver:e}=window;return new e(i)},[i,r]);(0,n.useEffect)(()=>{return()=>a==null?void 0:a.disconnect()},[a]);return a}/**
 * Returns a new ResizeObserver instance bound to the `onResize` callback.
 * If `ResizeObserver` is undefined in the execution environment, returns `undefined`.
 */function Ip(e){let{callback:t,disabled:r}=e;const i=kO(t);const a=(0,n.useMemo)(()=>{if(r||typeof window==="undefined"||typeof window.ResizeObserver==="undefined"){return undefined}const{ResizeObserver:e}=window;return new e(i)},[r]);(0,n.useEffect)(()=>{return()=>a==null?void 0:a.disconnect()},[a]);return a}function Ih(e){return new Ej(E_(e),e)}function Iv(e,t,r){if(t===void 0){t=Ih}const[i,a]=(0,n.useState)(null);function o(){a(n=>{if(!e){return null}if(e.isConnected===false){var i;// Fall back to last rect we measured if the element is
// no longer connected to the DOM.
return(i=n!=null?n:r)!=null?i:null}const a=t(e);if(JSON.stringify(n)===JSON.stringify(a)){return n}return a})}const s=If({callback(t){if(!e){return}for(const r of t){const{type:t,target:n}=r;if(t==="childList"&&n instanceof HTMLElement&&n.contains(e)){o();break}}}});const l=Ip({callback:o});kS(()=>{o();if(e){l==null?void 0:l.observe(e);s==null?void 0:s.observe(document.body,{childList:true,subtree:true})}else{l==null?void 0:l.disconnect();s==null?void 0:s.disconnect()}},[e]);return i}function Ig(e){const t=Ic(e);return Eh(e,t)}const Im=[];function Ib(e){const t=(0,n.useRef)(e);const r=kR(r=>{if(!e){return Im}if(r&&r!==Im&&e&&t.current&&e.parentNode===t.current.parentNode){return r}return EE(e)},[e]);(0,n.useEffect)(()=>{t.current=e},[e]);return r}function Iy(e){const[t,r]=(0,n.useState)(null);const i=(0,n.useRef)(e);// To-do: Throttle the handleScroll callback
const a=(0,n.useCallback)(e=>{const t=EC(e.target);if(!t){return}r(e=>{if(!e){return null}e.set(t,ES(t));return new Map(e)})},[]);(0,n.useEffect)(()=>{const t=i.current;if(e!==t){n(t);const o=e.map(e=>{const t=EC(e);if(t){t.addEventListener("scroll",a,{passive:true});return[t,ES(t)]}return null}).filter(e=>e!=null);r(o.length?new Map(o):null);i.current=e}return()=>{n(e);n(t)};function n(e){e.forEach(e=>{const t=EC(e);t==null?void 0:t.removeEventListener("scroll",a)})}},[a,e]);return(0,n.useMemo)(()=>{if(e.length){return t?Array.from(t.values()).reduce((e,t)=>kK(e,t),k7):EH(e)}return k7},[e,t])}function I_(e,t){if(t===void 0){t=[]}const r=(0,n.useRef)(null);(0,n.useEffect)(()=>{r.current=null},t);(0,n.useEffect)(()=>{const t=e!==k7;if(t&&!r.current){r.current=e}if(!t&&r.current){r.current=null}},[e]);return r.current?kB(e,r.current):k7}function Iw(e){(0,n.useEffect)(()=>{if(!kx){return}const t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(const e of t){e==null?void 0:e()}}},// eslint-disable-next-line react-hooks/exhaustive-deps
e.map(e=>{let{sensor:t}=e;return t}))}function Ix(e,t){return(0,n.useMemo)(()=>{return e.reduce((e,r)=>{let{eventName:n,handler:i}=r;e[n]=e=>{i(e,t)};return e},{})},[e,t])}function IA(e){return(0,n.useMemo)(()=>e?Ex(e):null,[e])}const Ik=[];function IE(e,t){if(t===void 0){t=E_}const[r]=e;const i=IA(r?kE(r):null);const[a,o]=(0,n.useState)(Ik);function s(){o(()=>{if(!e.length){return Ik}return e.map(e=>ED(e)?i:new Ej(t(e),e))})}const l=Ip({callback:s});kS(()=>{l==null?void 0:l.disconnect();s();e.forEach(e=>l==null?void 0:l.observe(e))},[e]);return a}function II(e){if(!e){return null}if(e.children.length>1){return e}const t=e.children[0];return kC(t)?t:e}function IC(e){let{measure:t}=e;const[r,i]=(0,n.useState)(null);const a=(0,n.useCallback)(e=>{for(const{target:r}of e){if(kC(r)){i(e=>{const n=t(r);return e?{...e,width:n.width,height:n.height}:n});break}}},[t]);const o=Ip({callback:a});const s=(0,n.useCallback)(e=>{const r=II(e);o==null?void 0:o.disconnect();if(r){o==null?void 0:o.observe(r)}i(r?t(r):null)},[t,o]);const[l,u]=kP(s);return(0,n.useMemo)(()=>({nodeRef:l,rect:r,setRef:u}),[r,l,u])}const IY=[{sensor:E6,options:{}},{sensor:EJ,options:{}}];const IT={current:{}};const IS={draggable:{measure:Ew},droppable:{measure:Ew,strategy:Io.WhileDragging,frequency:Is.Optimized},dragOverlay:{measure:E_}};class IO extends Map{get(e){var t;return e!=null?(t=super.get(e))!=null?t:undefined:undefined}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,r;return(t=(r=this.get(e))==null?void 0:r.node.current)!=null?t:undefined}}const ID={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:/*#__PURE__*/new Map,droppableRects:/*#__PURE__*/new Map,droppableContainers:/*#__PURE__*/new IO,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:k3},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:IS,measureDroppableContainers:k3,windowRect:null,measuringScheduled:false};const IF={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:k3,draggableNodes:/*#__PURE__*/new Map,over:null,measureDroppableContainers:k3};const IR=/*#__PURE__*/(0,n.createContext)(IF);const IP=/*#__PURE__*/(0,n.createContext)(ID);function IM(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new IO}}}function IH(e,t){switch(t.type){case k5.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case k5.DragMove:if(e.draggable.active==null){return e}return{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case k5.DragEnd:case k5.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case k5.RegisterDroppable:{const{element:r}=t;const{id:n}=r;const i=new IO(e.droppable.containers);i.set(n,r);return{...e,droppable:{...e.droppable,containers:i}}}case k5.SetDroppableDisabled:{const{id:r,key:n,disabled:i}=t;const a=e.droppable.containers.get(r);if(!a||n!==a.key){return e}const o=new IO(e.droppable.containers);o.set(r,{...a,disabled:i});return{...e,droppable:{...e.droppable,containers:o}}}case k5.UnregisterDroppable:{const{id:r,key:n}=t;const i=e.droppable.containers.get(r);if(!i||n!==i.key){return e}const a=new IO(e.droppable.containers);a.delete(r);return{...e,droppable:{...e.droppable,containers:a}}}default:{return e}}}function IN(e){let{disabled:t}=e;const{active:r,activatorEvent:i,draggableNodes:a}=(0,n.useContext)(IR);const o=kM(i);const s=kM(r==null?void 0:r.id);// Restore keyboard focus on the activator node
(0,n.useEffect)(()=>{if(t){return}if(!i&&o&&s!=null){if(!kU(o)){return}if(document.activeElement===o.target){// No need to restore focus
return}const e=a.get(s);if(!e){return}const{activatorNode:t,node:r}=e;if(!t.current&&!r.current){return}requestAnimationFrame(()=>{for(const e of[t.current,r.current]){if(!e){continue}const t=kG(e);if(t){t.focus();break}}})}},[i,t,a,s,o]);return null}function IL(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((e,t)=>{return t({transform:e,...n})},r):r}function IK(e){return(0,n.useMemo)(()=>({draggable:{...IS.draggable,...e==null?void 0:e.draggable},droppable:{...IS.droppable,...e==null?void 0:e.droppable},dragOverlay:{...IS.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 IB(e){let{activeNode:t,measure:r,initialRect:i,config:a=true}=e;const o=(0,n.useRef)(false);const{x:s,y:l}=typeof a==="boolean"?{x:a,y:a}:a;kS(()=>{const e=!s&&!l;if(e||!t){o.current=false;return}if(o.current||!i){// Return early if layout shift scroll compensation was already attempted
// or if there is no initialRect to compare to.
return}// Get the most up to date node ref for the active draggable
const n=t==null?void 0:t.node.current;if(!n||n.isConnected===false){// Return early if there is no attached node ref or if the node is
// disconnected from the document.
return}const a=r(n);const u=Eh(a,i);if(!s){u.x=0}if(!l){u.y=0}// Only perform layout shift scroll compensation once
o.current=true;if(Math.abs(u.x)>0||Math.abs(u.y)>0){const e=EI(n);if(e){e.scrollBy({top:u.y,left:u.x})}}},[t,s,l,i,r])}const Ij=/*#__PURE__*/(0,n.createContext)({...k7,scaleX:1,scaleY:1});var IU;(function(e){e[e["Uninitialized"]=0]="Uninitialized";e[e["Initializing"]=1]="Initializing";e[e["Initialized"]=2]="Initialized"})(IU||(IU={}));const Iq=/*#__PURE__*/(0,n.memo)(function e(e){var t,r,a,o;let{id:s,accessibility:l,autoScroll:u=true,children:c,sensors:d=IY,collisionDetection:f=Ec,measuring:p,modifiers:h,...v}=e;const g=(0,n.useReducer)(IH,undefined,IM);const[m,b]=g;const[y,_]=k1();const[w,x]=(0,n.useState)(IU.Uninitialized);const A=w===IU.Initialized;const{draggable:{active:k,nodes:E,translate:I},droppable:{containers:C}}=m;const Y=k!=null?E.get(k):null;const T=(0,n.useRef)({initial:null,translated:null});const S=(0,n.useMemo)(()=>{var e;return k!=null?{id:k,// It's possible for the active node to unmount while dragging
data:(e=Y==null?void 0:Y.data)!=null?e:IT,rect:T}:null},[k,Y]);const O=(0,n.useRef)(null);const[D,F]=(0,n.useState)(null);const[R,P]=(0,n.useState)(null);const M=kF(v,Object.values(v));const H=kN("DndDescribedBy",s);const N=(0,n.useMemo)(()=>C.getEnabled(),[C]);const L=IK(p);const{droppableRects:K,measureDroppableContainers:B,measuringScheduled:j}=Iu(N,{dragging:A,dependencies:[I.x,I.y],config:L.droppable});const U=Ii(E,k);const q=(0,n.useMemo)(()=>R?kV(R):null,[R]);const V=ek();const W=Id(U,L.draggable.measure);IB({activeNode:k!=null?E.get(k):null,config:V.layoutShiftCompensation,initialRect:W,measure:L.draggable.measure});const z=Iv(U,L.draggable.measure,W);const G=Iv(U?U.parentElement:null);const Q=(0,n.useRef)({activatorEvent:null,active:null,activeNode:U,collisionRect:null,collisions:null,droppableRects:K,draggableNodes:E,draggingNode:null,draggingNodeRect:null,droppableContainers:C,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null});const $=C.getNodeFor((t=Q.current.over)==null?void 0:t.id);const X=IC({measure:L.dragOverlay.measure});// Use the rect of the drag overlay if it is mounted
const J=(r=X.nodeRef.current)!=null?r:U;const Z=A?(a=X.rect)!=null?a:z:null;const ee=Boolean(X.nodeRef.current&&X.rect);// The delta between the previous and new position of the draggable node
// is only relevant when there is no drag overlay
const et=Ig(ee?null:z);// Get the window rect of the dragging node
const er=IA(J?kE(J):null);// Get scrollable ancestors of the dragging node
const en=Ib(A?$!=null?$:U:null);const ei=IE(en);// Apply modifiers
const ea=IL(h,{transform:{x:I.x-et.x,y:I.y-et.y,scaleX:1,scaleY:1},activatorEvent:R,active:S,activeNodeRect:z,containerNodeRect:G,draggingNodeRect:Z,over:Q.current.over,overlayNodeRect:X.rect,scrollableAncestors:en,scrollableAncestorRects:ei,windowRect:er});const eo=q?kK(q,I):null;const es=Iy(en);// Represents the scroll delta since dragging was initiated
const el=I_(es);// Represents the scroll delta since the last time the active node rect was measured
const eu=I_(es,[z]);const ec=kK(ea,el);const ed=Z?Eg(Z,ea):null;const ef=S&&ed?f({active:S,collisionRect:ed,droppableRects:K,droppableContainers:N,pointerCoordinates:eo}):null;const ep=Ea(ef,"id");const[eh,ev]=(0,n.useState)(null);// When there is no drag overlay used, we need to account for the
// window scroll delta
const eg=ee?ea:kK(ea,eu);const em=Ep(eg,(o=eh==null?void 0:eh.rect)!=null?o:null,z);const eb=(0,n.useRef)(null);const ey=(0,n.useCallback)((e,t)=>{let{sensor:r,options:n}=t;if(O.current==null){return}const i=E.get(O.current);if(!i){return}const a=e.nativeEvent;const o=new r({active:O.current,activeNode:i,event:a,options:n,// Sensors need to be instantiated with refs for arguments that change over time
// otherwise they are frozen in time with the stale arguments
context:Q,onAbort(e){const t=E.get(e);if(!t){return}const{onDragAbort:r}=M.current;const n={id:e};r==null?void 0:r(n);y({type:"onDragAbort",event:n})},onPending(e,t,r,n){const i=E.get(e);if(!i){return}const{onDragPending:a}=M.current;const o={id:e,constraint:t,initialCoordinates:r,offset:n};a==null?void 0:a(o);y({type:"onDragPending",event:o})},onStart(e){const t=O.current;if(t==null){return}const r=E.get(t);if(!r){return}const{onDragStart:n}=M.current;const i={activatorEvent:a,active:{id:t,data:r.data,rect:T}};(0,iW.unstable_batchedUpdates)(()=>{n==null?void 0:n(i);x(IU.Initializing);b({type:k5.DragStart,initialCoordinates:e,active:t});y({type:"onDragStart",event:i});F(eb.current);P(a)})},onMove(e){b({type:k5.DragMove,coordinates:e})},onEnd:s(k5.DragEnd),onCancel:s(k5.DragCancel)});eb.current=o;function s(e){return async function t(){const{active:t,collisions:r,over:n,scrollAdjustedTranslate:i}=Q.current;let o=null;if(t&&i){const{cancelDrop:s}=M.current;o={activatorEvent:a,active:t,collisions:r,delta:i,over:n};if(e===k5.DragEnd&&typeof s==="function"){const t=await Promise.resolve(s(o));if(t){e=k5.DragCancel}}}O.current=null;(0,iW.unstable_batchedUpdates)(()=>{b({type:e});x(IU.Uninitialized);ev(null);F(null);P(null);eb.current=null;const t=e===k5.DragEnd?"onDragEnd":"onDragCancel";if(o){const e=M.current[t];e==null?void 0:e(o);y({type:t,event:o})}})}}},[E]);const e_=(0,n.useCallback)((e,t)=>{return(r,n)=>{const i=r.nativeEvent;const a=E.get(n);if(O.current!==null||// No active draggable
!a||// Event has already been captured
i.dndKit||i.defaultPrevented){return}const o={active:a};const s=e(r,t.options,o);if(s===true){i.dndKit={capturedBy:t.sensor};O.current=n;ey(r,t)}}},[E,ey]);const ew=Ia(d,e_);Iw(d);kS(()=>{if(z&&w===IU.Initializing){x(IU.Initialized)}},[z,w]);(0,n.useEffect)(()=>{const{onDragMove:e}=M.current;const{active:t,activatorEvent:r,collisions:n,over:i}=Q.current;if(!t||!r){return}const a={active:t,activatorEvent:r,collisions:n,delta:{x:ec.x,y:ec.y},over:i};(0,iW.unstable_batchedUpdates)(()=>{e==null?void 0:e(a);y({type:"onDragMove",event:a})})},[ec.x,ec.y]);(0,n.useEffect)(()=>{const{active:e,activatorEvent:t,collisions:r,droppableContainers:n,scrollAdjustedTranslate:i}=Q.current;if(!e||O.current==null||!t||!i){return}const{onDragOver:a}=M.current;const o=n.get(ep);const s=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null;const l={active:e,activatorEvent:t,collisions:r,delta:{x:i.x,y:i.y},over:s};(0,iW.unstable_batchedUpdates)(()=>{ev(s);a==null?void 0:a(l);y({type:"onDragOver",event:l})})},[ep]);kS(()=>{Q.current={activatorEvent:R,active:S,activeNode:U,collisionRect:ed,collisions:ef,droppableRects:K,draggableNodes:E,draggingNode:J,draggingNodeRect:Z,droppableContainers:C,over:eh,scrollableAncestors:en,scrollAdjustedTranslate:ec};T.current={initial:Z,translated:ed}},[S,U,ef,ed,E,J,Z,K,C,eh,en,ec]);It({...V,delta:I,draggingRect:ed,pointerCoordinates:eo,scrollableAncestors:en,scrollableAncestorRects:ei});const ex=(0,n.useMemo)(()=>{const e={active:S,activeNode:U,activeNodeRect:z,activatorEvent:R,collisions:ef,containerNodeRect:G,dragOverlay:X,draggableNodes:E,droppableContainers:C,droppableRects:K,over:eh,measureDroppableContainers:B,scrollableAncestors:en,scrollableAncestorRects:ei,measuringConfiguration:L,measuringScheduled:j,windowRect:er};return e},[S,U,z,R,ef,G,X,E,C,K,eh,B,en,ei,L,j,er]);const eA=(0,n.useMemo)(()=>{const e={activatorEvent:R,activators:ew,active:S,activeNodeRect:z,ariaDescribedById:{draggable:H},dispatch:b,draggableNodes:E,over:eh,measureDroppableContainers:B};return e},[R,ew,S,z,b,H,E,eh,B]);return i().createElement(kZ.Provider,{value:_},i().createElement(IR.Provider,{value:eA},i().createElement(IP.Provider,{value:ex},i().createElement(Ij.Provider,{value:em},c)),i().createElement(IN,{disabled:(l==null?void 0:l.restoreFocus)===false})),i().createElement(k4,{...l,hiddenTextDescribedById:H}));function ek(){const e=(D==null?void 0:D.autoScrollEnabled)===false;const t=typeof u==="object"?u.enabled===false:u===false;const r=A&&!e&&!t;if(typeof u==="object"){return{...u,enabled:r}}return{enabled:r}}});const IV=/*#__PURE__*/(0,n.createContext)(null);const IW="button";const Iz="Draggable";function IG(e){let{id:t,data:r,disabled:i=false,attributes:a}=e;const o=kN(Iz);const{activators:s,activatorEvent:l,active:u,activeNodeRect:c,ariaDescribedById:d,draggableNodes:f,over:p}=(0,n.useContext)(IR);const{role:h=IW,roleDescription:v="draggable",tabIndex:g=0}=a!=null?a:{};const m=(u==null?void 0:u.id)===t;const b=(0,n.useContext)(m?Ij:IV);const[y,_]=kP();const[w,x]=kP();const A=Ix(s,t);const k=kF(r);kS(()=>{f.set(t,{id:t,key:o,node:y,activatorNode:w,data:k});return()=>{const e=f.get(t);if(e&&e.key===o){f.delete(t)}}},[f,t]);const E=(0,n.useMemo)(()=>({role:h,tabIndex:g,"aria-disabled":i,"aria-pressed":m&&h===IW?true:undefined,"aria-roledescription":v,"aria-describedby":d.draggable}),[i,h,g,m,v,d.draggable]);return{active:u,activatorEvent:l,activeNodeRect:c,attributes:E,isDragging:m,listeners:i?undefined:A,node:y,over:p,setNodeRef:_,setActivatorNodeRef:x,transform:b}}function IQ(){return(0,n.useContext)(IP)}const I$="Droppable";const IX={timeout:25};function IJ(e){let{data:t,disabled:r=false,id:i,resizeObserverConfig:a}=e;const o=kN(I$);const{active:s,dispatch:l,over:u,measureDroppableContainers:c}=(0,n.useContext)(IR);const d=(0,n.useRef)({disabled:r});const f=(0,n.useRef)(false);const p=(0,n.useRef)(null);const h=(0,n.useRef)(null);const{disabled:v,updateMeasurementsFor:g,timeout:m}={...IX,...a};const b=kF(g!=null?g:i);const y=(0,n.useCallback)(()=>{if(!f.current){// ResizeObserver invokes the `handleResize` callback as soon as `observe` is called,
// assuming the element is rendered and displayed.
f.current=true;return}if(h.current!=null){clearTimeout(h.current)}h.current=setTimeout(()=>{c(Array.isArray(b.current)?b.current:[b.current]);h.current=null},m)},[m]);const _=Ip({callback:y,disabled:v||!s});const w=(0,n.useCallback)((e,t)=>{if(!_){return}if(t){_.unobserve(t);f.current=false}if(e){_.observe(e)}},[_]);const[x,A]=kP(w);const k=kF(t);(0,n.useEffect)(()=>{if(!_||!x.current){return}_.disconnect();f.current=false;_.observe(x.current)},[x,_]);(0,n.useEffect)(()=>{l({type:k5.RegisterDroppable,element:{id:i,key:o,disabled:r,node:x,rect:p,data:k}});return()=>l({type:k5.UnregisterDroppable,key:o,id:i})},[i]);(0,n.useEffect)(()=>{if(r!==d.current.disabled){l({type:k5.SetDroppableDisabled,id:i,key:o,disabled:r});d.current.disabled=r}},[i,o,r,l]);return{active:s,rect:p,isOver:(u==null?void 0:u.id)===i,node:x,over:u,setNodeRef:A}}function IZ(e){let{animation:t,children:r}=e;const[a,o]=(0,n.useState)(null);const[s,l]=(0,n.useState)(null);const u=kM(r);if(!r&&!a&&u){o(u)}kS(()=>{if(!s){return}const e=a==null?void 0:a.key;const r=a==null?void 0:a.props.id;if(e==null||r==null){o(null);return}Promise.resolve(t(r,s)).then(()=>{o(null)})},[t,a,s]);return i().createElement(i().Fragment,null,r,a?(0,n.cloneElement)(a,{ref:l}):null)}const I0={x:0,y:0,scaleX:1,scaleY:1};function I1(e){let{children:t}=e;return i().createElement(IR.Provider,{value:IF},i().createElement(Ij.Provider,{value:I0},t))}const I2={position:"fixed",touchAction:"none"};const I6=e=>{const t=kU(e);return t?"transform 250ms ease":undefined};const I4=/*#__PURE__*/(0,n.forwardRef)((e,t)=>{let{as:r,activatorEvent:n,adjustScale:a,children:o,className:s,rect:l,style:u,transform:c,transition:d=I6}=e;if(!l){return null}const f=a?c:{...c,scaleX:1,scaleY:1};const p={...I2,width:l.width,height:l.height,top:l.top,left:l.left,transform:kW.Transform.toString(f),transformOrigin:a&&n?Et(n,l):undefined,transition:typeof d==="function"?d(n):d,...u};return i().createElement(r,{className:s,style:p,ref:t},o)});const I5=e=>t=>{let{active:r,dragOverlay:n}=t;const i={};const{styles:a,className:o}=e;if(a!=null&&a.active){for(const[e,t]of Object.entries(a.active)){if(t===undefined){continue}i[e]=r.node.style.getPropertyValue(e);r.node.style.setProperty(e,t)}}if(a!=null&&a.dragOverlay){for(const[e,t]of Object.entries(a.dragOverlay)){if(t===undefined){continue}n.node.style.setProperty(e,t)}}if(o!=null&&o.active){r.node.classList.add(o.active)}if(o!=null&&o.dragOverlay){n.node.classList.add(o.dragOverlay)}return function e(){for(const[e,t]of Object.entries(i)){r.node.style.setProperty(e,t)}if(o!=null&&o.active){r.node.classList.remove(o.active)}}};const I3=e=>{let{transform:{initial:t,final:r}}=e;return[{transform:kW.Transform.toString(t)},{transform:kW.Transform.toString(r)}]};const I8={duration:250,easing:"ease",keyframes:I3,sideEffects:/*#__PURE__*/I5({styles:{active:{opacity:"0"}}})};function I9(e){let{config:t,draggableNodes:r,droppableContainers:n,measuringConfiguration:i}=e;return kO((e,a)=>{if(t===null){return}const o=r.get(e);if(!o){return}const s=o.node.current;if(!s){return}const l=II(a);if(!l){return}const{transform:u}=kE(a).getComputedStyle(a);const c=Em(u);if(!c){return}const d=typeof t==="function"?t:I7(t);EK(s,i.draggable.measure);return d({active:{id:e,data:o.data,node:s,rect:i.draggable.measure(s)},draggableNodes:r,dragOverlay:{node:a,rect:i.dragOverlay.measure(l)},droppableContainers:n,measuringConfiguration:i,transform:c})})}function I7(e){const{duration:t,easing:r,sideEffects:n,keyframes:i}={...I8,...e};return e=>{let{active:a,dragOverlay:o,transform:s,...l}=e;if(!t){// Do not animate if animation duration is zero.
return}const u={x:o.rect.left-a.rect.left,y:o.rect.top-a.rect.top};const c={scaleX:s.scaleX!==1?a.rect.width*s.scaleX/o.rect.width:1,scaleY:s.scaleY!==1?a.rect.height*s.scaleY/o.rect.height:1};const d={x:s.x-u.x,y:s.y-u.y,...c};const f=i({...l,active:a,dragOverlay:o,transform:{initial:s,final:d}});const[p]=f;const h=f[f.length-1];if(JSON.stringify(p)===JSON.stringify(h)){// The start and end keyframes are the same, infer that there is no animation needed.
return}const v=n==null?void 0:n({active:a,dragOverlay:o,...l});const g=o.node.animate(f,{duration:t,easing:r,fill:"forwards"});return new Promise(e=>{g.onfinish=()=>{v==null?void 0:v();e()}})}}let Ce=0;function Ct(e){return(0,n.useMemo)(()=>{if(e==null){return}Ce++;return Ce},[e])}const Cr=/*#__PURE__*/i().memo(e=>{let{adjustScale:t=false,children:r,dropAnimation:a,style:o,transition:s,modifiers:l,wrapperElement:u="div",className:c,zIndex:d=999}=e;const{activatorEvent:f,active:p,activeNodeRect:h,containerNodeRect:v,draggableNodes:g,droppableContainers:m,dragOverlay:b,over:y,measuringConfiguration:_,scrollableAncestors:w,scrollableAncestorRects:x,windowRect:A}=IQ();const k=(0,n.useContext)(Ij);const E=Ct(p==null?void 0:p.id);const I=IL(l,{activatorEvent:f,active:p,activeNodeRect:h,containerNodeRect:v,draggingNodeRect:b.rect,over:y,overlayNodeRect:b.rect,scrollableAncestors:w,scrollableAncestorRects:x,transform:k,windowRect:A});const C=Ic(h);const Y=I9({config:a,draggableNodes:g,droppableContainers:m,measuringConfiguration:_});// We need to wait for the active node to be measured before connecting the drag overlay ref
// otherwise collisions can be computed against a mispositioned drag overlay
const T=C?b.setRef:undefined;return i().createElement(I1,null,i().createElement(IZ,{animation:Y},p&&E?i().createElement(I4,{key:E,id:p.id,ref:T,as:u,activatorEvent:f,adjustScale:t,className:c,transition:s,rect:C,style:{zIndex:d,...o},transform:I},r):null))});//# sourceMappingURL=core.esm.js.map
;// CONCATENATED MODULE: ./node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js
function Cn(e){return t=>{let{transform:r}=t;return{...r,x:Math.ceil(r.x/e)*e,y:Math.ceil(r.y/e)*e}}}const Ci=e=>{let{transform:t}=e;return{...t,y:0}};function Ca(e,t,r){const n={...e};if(t.top+e.y<=r.top){n.y=r.top-t.top}else if(t.bottom+e.y>=r.top+r.height){n.y=r.top+r.height-t.bottom}if(t.left+e.x<=r.left){n.x=r.left-t.left}else if(t.right+e.x>=r.left+r.width){n.x=r.left+r.width-t.right}return n}const Co=e=>{let{containerNodeRect:t,draggingNodeRect:r,transform:n}=e;if(!r||!t){return n}return Ca(n,r,t)};const Cs=e=>{let{draggingNodeRect:t,transform:r,scrollableAncestorRects:n}=e;const i=n[0];if(!t||!i){return r}return Ca(r,t,i)};const Cl=e=>{let{transform:t}=e;return{...t,x:0}};const Cu=e=>{let{transform:t,draggingNodeRect:r,windowRect:n}=e;if(!r||!n){return t}return Ca(t,r,n)};const Cc=e=>{let{activatorEvent:t,draggingNodeRect:r,transform:n}=e;if(r&&t){const e=getEventCoordinates(t);if(!e){return n}const i=e.x-r.left;const a=e.y-r.top;return{...n,x:n.x+i-r.width/2,y:n.y+a-r.height/2}}return n};//# sourceMappingURL=modifiers.esm.js.map
;// CONCATENATED MODULE: ./node_modules/@dnd-kit/sortable/dist/sortable.esm.js
/**
 * Move an array item to a different position. Returns a new array with the item moved to the new position.
 */function Cd(e,t,r){const n=e.slice();n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]);return n}/**
 * Swap an array item to a different position. Returns a new array with the item swapped to the new position.
 */function Cf(e,t,r){const n=e.slice();n[t]=e[r];n[r]=e[t];return n}function Cp(e,t){return e.reduce((e,r,n)=>{const i=t.get(r);if(i){e[n]=i}return e},Array(e.length))}function Ch(e){return e!==null&&e>=0}function Cv(e,t){if(e===t){return true}if(e.length!==t.length){return false}for(let r=0;r<e.length;r++){if(e[r]!==t[r]){return false}}return true}function Cg(e){if(typeof e==="boolean"){return{draggable:e,droppable:e}}return e}// To-do: We should be calculating scale transformation
const Cm=/* unused pure expression or super */null&&{scaleX:1,scaleY:1};const Cb=e=>{var t;let{rects:r,activeNodeRect:n,activeIndex:i,overIndex:a,index:o}=e;const s=(t=r[i])!=null?t:n;if(!s){return null}const l=Cy(r,o,i);if(o===i){const e=r[a];if(!e){return null}return{x:i<a?e.left+e.width-(s.left+s.width):e.left-s.left,y:0,...Cm}}if(o>i&&o<=a){return{x:-s.width-l,y:0,...Cm}}if(o<i&&o>=a){return{x:s.width+l,y:0,...Cm}}return{x:0,y:0,...Cm}};function Cy(e,t,r){const n=e[t];const i=e[t-1];const a=e[t+1];if(!n||!i&&!a){return 0}if(r<t){return i?n.left-(i.left+i.width):a.left-(n.left+n.width)}return a?a.left-(n.left+n.width):n.left-(i.left+i.width)}const C_=e=>{let{rects:t,activeIndex:r,overIndex:n,index:i}=e;const a=Cd(t,n,r);const o=t[i];const s=a[i];if(!s||!o){return null}return{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}};const Cw=e=>{let{activeIndex:t,index:r,rects:n,overIndex:i}=e;let a;let o;if(r===t){a=n[r];o=n[i]}if(r===i){a=n[r];o=n[t]}if(!o||!a){return null}return{x:o.left-a.left,y:o.top-a.top,scaleX:o.width/a.width,scaleY:o.height/a.height}};// To-do: We should be calculating scale transformation
const Cx={scaleX:1,scaleY:1};const CA=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:i,rects:a,overIndex:o}=e;const s=(t=a[r])!=null?t:n;if(!s){return null}if(i===r){const e=a[o];if(!e){return null}return{x:0,y:r<o?e.top+e.height-(s.top+s.height):e.top-s.top,...Cx}}const l=Ck(a,i,r);if(i>r&&i<=o){return{x:0,y:-s.height-l,...Cx}}if(i<r&&i>=o){return{x:0,y:s.height+l,...Cx}}return{x:0,y:0,...Cx}};function Ck(e,t,r){const n=e[t];const i=e[t-1];const a=e[t+1];if(!n){return 0}if(r<t){return i?n.top-(i.top+i.height):a?a.top-(n.top+n.height):0}return a?a.top-(n.top+n.height):i?n.top-(i.top+i.height):0}const CE="Sortable";const CI=/*#__PURE__*/i().createContext({activeIndex:-1,containerId:CE,disableTransforms:false,items:[],overIndex:-1,useDragOverlay:false,sortedRects:[],strategy:C_,disabled:{draggable:false,droppable:false}});function CC(e){let{children:t,id:r,items:a,strategy:o=C_,disabled:s=false}=e;const{active:l,dragOverlay:u,droppableRects:c,over:d,measureDroppableContainers:f}=IQ();const p=kN(CE,r);const h=Boolean(u.rect!==null);const v=(0,n.useMemo)(()=>a.map(e=>typeof e==="object"&&"id"in e?e.id:e),[a]);const g=l!=null;const m=l?v.indexOf(l.id):-1;const b=d?v.indexOf(d.id):-1;const y=(0,n.useRef)(v);const _=!Cv(v,y.current);const w=b!==-1&&m===-1||_;const x=Cg(s);kS(()=>{if(_&&g){f(v)}},[_,v,g,f]);(0,n.useEffect)(()=>{y.current=v},[v]);const A=(0,n.useMemo)(()=>({activeIndex:m,containerId:p,disabled:x,disableTransforms:w,items:v,overIndex:b,useDragOverlay:h,sortedRects:Cp(v,c),strategy:o}),[m,p,x.draggable,x.droppable,w,v,b,c,h,o]);return i().createElement(CI.Provider,{value:A},t)}const CY=e=>{let{id:t,items:r,activeIndex:n,overIndex:i}=e;return Cd(r,n,i).indexOf(t)};const CT=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:l,transition:u}=e;if(!u||!n){return false}if(s!==a&&i===o){return false}if(r){return true}return o!==i&&t===l};const CS={duration:200,easing:"ease"};const CO="transform";const CD=/*#__PURE__*/kW.Transition.toString({property:CO,duration:0,easing:"linear"});const CF={roleDescription:"sortable"};/*
 * When the index of an item changes while sorting,
 * we need to temporarily disable the transforms
 */function CR(e){let{disabled:t,index:r,node:i,rect:a}=e;const[o,s]=(0,n.useState)(null);const l=(0,n.useRef)(r);kS(()=>{if(!t&&r!==l.current&&i.current){const e=a.current;if(e){const t=E_(i.current,{ignoreTransform:true});const r={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};if(r.x||r.y){s(r)}}}if(r!==l.current){l.current=r}},[t,r,i,a]);(0,n.useEffect)(()=>{if(o){s(null)}},[o]);return o}function CP(e){let{animateLayoutChanges:t=CT,attributes:r,disabled:i,data:a,getNewIndex:o=CY,id:s,strategy:l,resizeObserverConfig:u,transition:c=CS}=e;const{items:d,containerId:f,activeIndex:p,disabled:h,disableTransforms:v,sortedRects:g,overIndex:m,useDragOverlay:b,strategy:y}=(0,n.useContext)(CI);const _=CM(i,h);const w=d.indexOf(s);const x=(0,n.useMemo)(()=>({sortable:{containerId:f,index:w,items:d},...a}),[f,a,w,d]);const A=(0,n.useMemo)(()=>d.slice(d.indexOf(s)),[d,s]);const{rect:k,node:E,isOver:I,setNodeRef:C}=IJ({id:s,data:x,disabled:_.droppable,resizeObserverConfig:{updateMeasurementsFor:A,...u}});const{active:Y,activatorEvent:T,activeNodeRect:S,attributes:O,setNodeRef:D,listeners:F,isDragging:R,over:P,setActivatorNodeRef:M,transform:H}=IG({id:s,data:x,attributes:{...CF,...r},disabled:_.draggable});const N=kw(C,D);const L=Boolean(Y);const K=L&&!v&&Ch(p)&&Ch(m);const B=!b&&R;const j=B&&K?H:null;const U=l!=null?l:y;const q=K?j!=null?j:U({rects:g,activeNodeRect:S,activeIndex:p,overIndex:m,index:w}):null;const V=Ch(p)&&Ch(m)?o({id:s,items:d,activeIndex:p,overIndex:m}):w;const W=Y==null?void 0:Y.id;const z=(0,n.useRef)({activeId:W,items:d,newIndex:V,containerId:f});const G=d!==z.current.items;const Q=t({active:Y,containerId:f,isDragging:R,isSorting:L,id:s,index:w,items:d,newIndex:z.current.newIndex,previousItems:z.current.items,previousContainerId:z.current.containerId,transition:c,wasDragging:z.current.activeId!=null});const $=CR({disabled:!Q,index:w,node:E,rect:k});(0,n.useEffect)(()=>{if(L&&z.current.newIndex!==V){z.current.newIndex=V}if(f!==z.current.containerId){z.current.containerId=f}if(d!==z.current.items){z.current.items=d}},[L,V,f,d]);(0,n.useEffect)(()=>{if(W===z.current.activeId){return}if(W!=null&&z.current.activeId==null){z.current.activeId=W;return}const e=setTimeout(()=>{z.current.activeId=W},50);return()=>clearTimeout(e)},[W]);return{active:Y,activeIndex:p,attributes:O,data:x,rect:k,index:w,newIndex:V,items:d,isOver:I,isSorting:L,isDragging:R,listeners:F,node:E,overIndex:m,over:P,setNodeRef:N,setActivatorNodeRef:M,setDroppableNodeRef:C,setDraggableNodeRef:D,transform:$!=null?$:q,transition:X()};function X(){if($||// Or to prevent items jumping to back to their "new" position when items change
G&&z.current.newIndex===w){return CD}if(B&&!kU(T)||!c){return undefined}if(L||Q){return kW.Transition.toString({...c,property:CO})}return undefined}}function CM(e,t){var r,n;if(typeof e==="boolean"){return{draggable:e,// Backwards compatibility
droppable:false}}return{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 CH(e){if(!e){return false}const t=e.data.current;if(t&&"sortable"in t&&typeof t.sortable==="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable){return true}return false}const CN=[EQ.Down,EQ.Right,EQ.Up,EQ.Left];const CL=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=t;if(CN.includes(e.code)){e.preventDefault();if(!r||!n){return}const t=[];a.getEnabled().forEach(r=>{if(!r||r!=null&&r.disabled){return}const a=i.get(r.id);if(!a){return}switch(e.code){case EQ.Down:if(n.top<a.top){t.push(r)}break;case EQ.Up:if(n.top>a.top){t.push(r)}break;case EQ.Left:if(n.left>a.left){t.push(r)}break;case EQ.Right:if(n.left<a.left){t.push(r)}break}});const l=El({active:r,collisionRect:n,droppableRects:i,droppableContainers:t,pointerCoordinates:null});let u=Ea(l,"id");if(u===(o==null?void 0:o.id)&&l.length>1){u=l[1].id}if(u!=null){const e=a.get(r.id);const t=a.get(u);const o=t?i.get(t.id):null;const l=t==null?void 0:t.node.current;if(l&&o&&e&&t){const r=EE(l);const i=r.some((e,t)=>s[t]!==e);const a=CK(e,t);const u=CB(e,t);const c=i||!a?{x:0,y:0}:{x:u?n.width-o.width:0,y:u?n.height-o.height:0};const d={x:o.left,y:o.top};const f=c.x&&c.y?d:kB(d,c);return f}}}return undefined};function CK(e,t){if(!CH(e)||!CH(t)){return false}return e.data.current.sortable.containerId===t.data.current.sortable.containerId}function CB(e,t){if(!CH(e)||!CH(t)){return false}if(!CK(e,t)){return false}return e.data.current.sortable.index<t.data.current.sortable.index}//# sourceMappingURL=sortable.esm.js.map
;// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/atoms/ProBadge.tsx
function Cj(){var e=(0,eS._)(["\n      height: ",";\n      display: inline-flex;\n      border-radius: ",";\n      align-items: center;\n      gap: ",";\n      overflow: hidden;\n      background: linear-gradient(88.9deg, #d65702 6.26%, #e5803c 91.4%);\n    "]);Cj=function t(){return e};return e}function CU(){var e=(0,eS._)(["\n        padding: 0;\n        padding-inline: ",";\n        margin: 0;\n      "]);CU=function t(){return e};return e}function Cq(){var e=(0,eS._)(["\n      display: inline-flex;\n      position: static;\n      transform: none;\n      padding: ",";\n      color: ",";\n      margin-right: ",";\n      font-size: ",";\n      line-height: ",";\n\n      ","\n    "]);Cq=function t(){return e};return e}var CV=e=>{var{children:r,content:n,size:i="regular",textOnly:a}=e;return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:CG.wrapper({hasChildren:(0,eO/* .isDefined */.O9)(r),size:i}),children:[r,/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:!(0,eO/* .isDefined */.O9)(r)&&!a,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:i==="tiny"?"crownRoundedSmall":"crownRounded",width:Cz[i].iconSize,height:Cz[i].iconSize})}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:CG.content({hasChildren:(0,eO/* .isDefined */.O9)(r),size:i,textOnly:a}),children:(0,eO/* .isDefined */.O9)(r)?/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:i==="tiny"?"crownRoundedSmall":"crownRounded",width:i==="tiny"?Cz[i].iconSize:16}):n})]})};/* ESM default export */const CW=CV;var Cz={tiny:{borderRadius:ey/* .spacing["10"] */.YK["10"],height:ey/* .spacing["10"] */.YK["10"],gap:ey/* .spacing["2"] */.YK["2"],iconSize:10,fontSize:"0.5rem",lineHeight:"0.625rem"},small:{borderRadius:ey/* .spacing["16"] */.YK["16"],height:ey/* .spacing["16"] */.YK["16"],gap:ey/* .spacing["4"] */.YK["4"],iconSize:16,fontSize:ey/* .fontSize["10"] */.J["10"],lineHeight:ey/* .lineHeight["16"] */.K_["16"]},regular:{borderRadius:"22px",height:"22px",gap:"5px",iconSize:22,fontSize:ey/* .fontSize["14"] */.J["14"],lineHeight:ey/* .lineHeight["18"] */.K_["18"]},large:{borderRadius:"26px",height:"26px",gap:ey/* .spacing["6"] */.YK["6"],iconSize:26,fontSize:ey/* .fontSize["16"] */.J["16"],lineHeight:ey/* .lineHeight["26"] */.K_["26"]}};var CG={wrapper:e=>{var{hasChildren:t,size:r="regular"}=e;return/*#__PURE__*/(0,o/* .css */.AH)("position:relative;svg{flex-shrink:0;}",!t&&(0,o/* .css */.AH)(Cj(),Cz[r].height,Cz[r].borderRadius,Cz[r].gap))},content:e=>{var{hasChildren:t,size:r="regular",textOnly:n}=e;return/*#__PURE__*/(0,o/* .css */.AH)("position:absolute;top:0;right:0;display:flex;flex-shrink:0;transform:translateX(50%) translateY(-50%);",!t&&(0,o/* .css */.AH)(Cq(),ey/* .spacing["2"] */.YK["2"],ey/* .colorTokens.icon.white */.I6.icon.white,Cz[r].gap,Cz[r].fontSize,Cz[r].lineHeight,n&&(0,o/* .css */.AH)(CU(),ey/* .spacing["6"] */.YK["6"])))}};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/utils/dndkit.ts
var CQ=e=>CT((0,eX._)((0,e$._)({},e),{wasDragging:true}));var C$={droppable:{strategy:Io.Always}};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/fields/quiz/questions/FormImageAnswering.tsx
function CX(){var e=(0,eS._)(["\n      background-color: ",";\n      outline: 1px solid ",";\n\n      &:hover {\n        outline: 1px solid ",";\n      }\n    "]);CX=function t(){return e};return e}function CJ(){var e=(0,eS._)(["\n      background-color: ",";\n    "]);CJ=function t(){return e};return e}function CZ(){var e=(0,eS._)(["\n      box-shadow: ",";\n    "]);CZ=function t(){return e};return e}var C0=!!fy/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var C1=e=>{var{index:r,onDuplicateOption:i,onRemoveOption:a,field:o,isOverlay:s=false,questionId:l,validationError:u,setValidationError:c}=e;var d;var f=(d=o.value)!==null&&d!==void 0?d:{answer_id:(0,ej/* .nanoid */.Ak)(),answer_title:"",is_correct:"0",belongs_question_id:l,belongs_question_type:"image_answering"};var p=(0,n.useRef)(null);var[h,v]=(0,n.useState)(!f.answer_title&&!f.image_id&&!f.image_url);var[g,m]=(0,n.useState)(f);var{attributes:b,listeners:y,setNodeRef:_,transform:w,transition:x,isDragging:A}=CP({id:o.value.answer_id||0,animateLayoutChanges:CQ});var{openMediaLibrary:k,resetFiles:E}=fK({options:{type:"image"},onChange:e=>{if(e&&!Array.isArray(e)){var{id:t,url:r}=e;o.onChange((0,eX._)((0,e$._)({},f,AL(f._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:AL(f._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{image_id:t,image_url:r}))}},initialFiles:o.value.image_id?{id:Number(f.image_id),url:f.image_url||"",title:f.image_url||""}:null});var I={transform:kW.Transform.toString(w),transition:x,opacity:A?.3:undefined};var C=()=>{o.onChange((0,eX._)((0,e$._)({},f,AL(f._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:AL(f._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{image_id:"",image_url:""}));E()};(0,n.useEffect)(()=>{if((0,eO/* .isDefined */.O9)(p.current)&&h){p.current.focus()}},[h]);return/*#__PURE__*/(0,t/* .jsx */.Y)("div",(0,eX._)((0,e$._)({},b),{css:C6.option,ref:_,style:I,tabIndex:-1,children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:C6.optionLabel({isEditing:h,isOverlay:s,isDragging:A}),onClick:()=>{v(true)},onKeyDown:e=>{e.stopPropagation();if(e.key==="Enter"||e.key===" "){v(true)}},children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:C6.optionHeader,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:eB/* .styleUtils.optionCounter */.x.optionCounter({isEditing:h}),children:String.fromCharCode(65+r)}),/*#__PURE__*/(0,t/* .jsxs */.FD)(ag/* ["default"] */.A,{when:!h&&f.is_saved,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("button",(0,eX._)((0,e$._)({},y),{type:"button",css:eB/* .styleUtils.optionDragButton */.x.optionDragButton({isOverlay:s}),"data-visually-hidden":true,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"dragVertical",height:24,width:24})})),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:C6.optionActions,"data-visually-hidden":true,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(d9,{content:(0,em.__)("Edit","tutor-pro"),delay:200,children:/*#__PURE__*/(0,t/* .jsx */.Y)("button",{type:"button",css:eB/* .styleUtils.actionButton */.x.actionButton,onClick:e=>{e.stopPropagation();v(true)},children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"edit",width:24,height:24})})}),/*#__PURE__*/(0,t/* .jsx */.Y)(d9,{content:(0,em.__)("Duplicate","tutor-pro"),delay:200,children:/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:!C0,fallback:/*#__PURE__*/(0,t/* .jsx */.Y)("button",{type:"button",css:eB/* .styleUtils.actionButton */.x.actionButton,onClick:e=>{e.stopPropagation();i(f)},children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"copyPaste",width:24,height:24})}),children:/*#__PURE__*/(0,t/* .jsx */.Y)(CW,{size:"tiny",children:/*#__PURE__*/(0,t/* .jsx */.Y)("button",{disabled:true,type:"button",css:eB/* .styleUtils.actionButton */.x.actionButton,onClick:ej/* .noop */.lQ,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"copyPaste",width:24,height:24})})})})}),/*#__PURE__*/(0,t/* .jsx */.Y)(d9,{content:(0,em.__)("Delete","tutor-pro"),delay:200,children:/*#__PURE__*/(0,t/* .jsx */.Y)("button",{type:"button",css:eB/* .styleUtils.actionButton */.x.actionButton,onClick:e=>{e.stopPropagation();a()},children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"delete",width:24,height:24})})})]})]})]}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:C6.optionBody,children:/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:h,fallback:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:C6.placeholderWrapper,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:f.image_url,fallback:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:C6.imagePlaceholder,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"imagePreview",height:48,width:48})}),children:()=>/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:C6.imagePlaceholder,children:/*#__PURE__*/(0,t/* .jsx */.Y)("img",{src:f.image_url,alt:f.image_url})})}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:C6.optionPlaceholder,children:f.answer_title||(0,em.__)("Write answer option...","tutor-pro")})]}),children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:eB/* .styleUtils.optionInputWrapper */.x.optionInputWrapper,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(_E,{value:{id:Number(f.image_id),url:f.image_url||"",title:f.image_url||""},buttonText:(0,em.__)("Upload Image","tutor-pro"),infoText:(0,em.__)("Standard Size: 700x430 pixels","tutor-pro"),uploadHandler:k,clearHandler:C,emptyImageCss:C6.emptyImageInput,previewImageCss:C6.previewImageInput}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:C6.inputWithHints,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("input",(0,eX._)((0,e$._)({},o),{ref:p,type:"text",placeholder:(0,em.__)("Input answer here","tutor-pro"),value:f.answer_title,onClick:e=>{e.stopPropagation()},onChange:e=>{o.onChange((0,eX._)((0,e$._)({},f,AL(f._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:AL(f._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{answer_title:e.target.value}))},onKeyDown:e=>fQ(function*(){e.stopPropagation();if((e.metaKey||e.ctrlKey)&&e.key==="Enter"&&f.answer_title){o.onChange((0,e$._)({},f,AL(f._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:AL(f._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE),is_saved:true}));if((u===null||u===void 0?void 0:u.type)==="save_option"){c===null||c===void 0?void 0:c(null)}v(false)}})()})),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:C6.inputHints,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"info",height:20,width:20}),/*#__PURE__*/(0,t/* .jsxs */.FD)("p",{children:[(0,em.__)("Students need to type their answers exactly as you write them here. Use ","tutor-pro"),/*#__PURE__*/(0,t/* .jsx */.Y)("span",{css:{fontWeight:ey/* .fontWeight.semiBold */.Wy.semiBold},children:(0,em.__)("small caps","tutor-pro")}),(0,em.__)(" when writing the answer.","tutor-pro")]})]})]}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:C6.optionInputButtons,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"text",size:"small",onClick:e=>{e.stopPropagation();v(false);o.onChange(g);if(!f.is_saved){a();if((u===null||u===void 0?void 0:u.type)==="save_option"){c===null||c===void 0?void 0:c(null)}}},children:(0,em.__)("Cancel","tutor-pro")}),/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"secondary",size:"small",onClick:e=>fQ(function*(){e.stopPropagation();o.onChange((0,eX._)((0,e$._)({},f,AL(f._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:AL(f._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{is_saved:true}));m((0,eX._)((0,e$._)({},f,AL(f._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:AL(f._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{is_saved:true}));if((u===null||u===void 0?void 0:u.type)==="save_option"){c===null||c===void 0?void 0:c(null)}v(false)})(),disabled:!f.answer_title||!f.image_id,children:(0,em.__)("Ok","tutor-pro")})]})]})})})]})}))};/* ESM default export */const C2=C1;var C6={option:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),";",eK/* .typography.caption */.I.caption("medium"),";align-items:center;color:",ey/* .colorTokens.text.subdued */.I6.text.subdued,";gap:",ey/* .spacing["10"] */.YK["10"],";align-items:center;"),optionLabel:e=>{var{isEditing:t,isOverlay:r,isDragging:n}=e;return/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),"    gap:",ey/* .spacing["20"] */.YK["20"],";width:100%;border-radius:",ey/* .borderRadius.card */.Vq.card,";padding:",ey/* .spacing["12"] */.YK["12"]," ",ey/* .spacing["16"] */.YK["16"],";background-color:",ey/* .colorTokens.background.white */.I6.background.white,";[data-visually-hidden]{opacity:0;}&:hover{outline:1px solid ",ey/* .colorTokens.stroke.hover */.I6.stroke.hover,";[data-visually-hidden]{opacity:1;}}",t&&(0,o/* .css */.AH)(CX(),ey/* .colorTokens.background.white */.I6.background.white,ey/* .colorTokens.stroke.brand */.I6.stroke.brand,ey/* .colorTokens.stroke.brand */.I6.stroke.brand)," ",n&&(0,o/* .css */.AH)(CJ(),ey/* .colorTokens.stroke.hover */.I6.stroke.hover)," ",r&&(0,o/* .css */.AH)(CZ(),ey/* .shadow.drag */.r7.drag)," ",ey/* .Breakpoint.smallTablet */.EA.smallTablet,"{[data-visually-hidden]{opacity:1;}}")},optionHeader:/*#__PURE__*/(0,o/* .css */.AH)("display:grid;grid-template-columns:1fr auto 1fr;align-items:center;:focus-within{[data-visually-hidden]{opacity:1;}}"),optionActions:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),"    gap:",ey/* .spacing["8"] */.YK["8"],";place-self:center end;"),optionBody:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex()),placeholderWrapper:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),"    gap:",ey/* .spacing["12"] */.YK["12"],";width:100%;"),imagePlaceholder:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.flexCenter */.x.flexCenter(),";height:210px;width:100%;background-color:",ey/* .colorTokens.background["default"] */.I6.background["default"],";border-radius:",ey/* .borderRadius.card */.Vq.card,";overflow:hidden;svg{color:",ey/* .colorTokens.icon.hints */.I6.icon.hints,";}img{width:100%;height:100%;object-fit:cover;object-position:center;}"),emptyImageInput:/*#__PURE__*/(0,o/* .css */.AH)("background-color:",ey/* .colorTokens.background["default"] */.I6.background["default"],";height:210px;"),previewImageInput:/*#__PURE__*/(0,o/* .css */.AH)("height:210px;"),optionPlaceholder:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.body */.I.body(),";color:",ey/* .colorTokens.text.subdued */.I6.text.subdued,";padding-block:",ey/* .spacing["4"] */.YK["4"],";"),inputWithHints:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),"    gap:",ey/* .spacing["8"] */.YK["8"],";"),inputHints:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),"    gap:",ey/* .spacing["4"] */.YK["4"],";",eK/* .typography.small */.I.small(),";color:",ey/* .colorTokens.text.hints */.I6.text.hints,";align-items:flex-start;svg{flex-shrink:0;}"),optionInputButtons:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),"    justify-content:flex-end;gap:",ey/* .spacing["8"] */.YK["8"],";")};// CONCATENATED MODULE: ./addons/content-bank/assets/react/manage-contents/components/question-types/ImageAnswering.tsx
var C4=()=>{var[e,r]=(0,n.useState)(null);var i=sw();var{validationError:a,setValidationError:o}=kd();var s=i.getValues("question_id");var{fields:l,append:u,insert:c,remove:d,move:f}=lT({control:i.control,name:"question_answers"});var p=k9(k8(E6,{activationConstraint:{distance:10}}),k8(EJ,{coordinateGetter:CL}));var h=(0,n.useMemo)(()=>{if(!e){return null}return l.find(t=>t.answer_id===e)},[e,l]);var v=()=>{u({_data_status:eO/* .QuizDataStatus.NEW */.cW.NEW,is_saved:false,answer_id:(0,ej/* .nanoid */.Ak)(),answer_title:"",is_correct:"0",belongs_question_id:s||"",belongs_question_type:"image_answering",answer_order:l.length,answer_two_gap_match:"",answer_view_format:""},{shouldFocus:true,focusName:"question_answers.".concat(l.length,".answer_title")})};var g=(e,t)=>{var r=ev(ep({},t),{_data_status:eO/* .QuizDataStatus.NEW */.cW.NEW,is_saved:true,answer_id:(0,ej/* .nanoid */.Ak)(),answer_title:"".concat(t.answer_title," (copy)"),is_correct:"0"});var n=e+1;c(n,r)};var m=(e,t)=>{d(e);if(t._data_status!==eO/* .QuizDataStatus.NEW */.cW.NEW){i.setValue("deleted_answer_ids",[...i.getValues("deleted_answer_ids")||[],t.answer_id])}};return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:C3.optionWrapper,children:[/*#__PURE__*/(0,t/* .jsxs */.FD)(Iq,{sensors:p,collisionDetection:Es,modifiers:[Cu],onDragStart:e=>{r(e.active.id)},onDragEnd:e=>{var{active:t,over:n}=e;if(!n){return}if(t.id!==n.id){var i=l.findIndex(e=>e.answer_id===t.id);var a=l.findIndex(e=>e.answer_id===n.id);f(i,a)}r(null)},children:[/*#__PURE__*/(0,t/* .jsx */.Y)(CC,{items:l.map(e=>ev(ep({},e),{id:e.answer_id})),strategy:CA,children:/*#__PURE__*/(0,t/* .jsx */.Y)(fb,{each:l,children:(e,r)=>/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{control:i.control,name:"question_answers.".concat(r),render:n=>/*#__PURE__*/(0,t/* .jsx */.Y)(C2,ev(ep({},n),{onDuplicateOption:e=>g(r,e),onRemoveOption:()=>m(r,e),index:r,questionId:s,validationError:a,setValidationError:o}))},"".concat(e.answer_id,"-").concat(r))})}),/*#__PURE__*/(0,iW.createPortal)(/*#__PURE__*/(0,t/* .jsx */.Y)(Cr,{zIndex:ey/* .zIndex.highest */.fE.highest,children:/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:h,children:r=>{var n=l.findIndex(e=>e.answer_id===r.answer_id);return/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{control:i.control,name:"question_answers.".concat(n),render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(C2,ev(ep({},e),{onDuplicateOption:ej/* .noop */.lQ,onRemoveOption:ej/* .noop */.lQ,index:n,isOverlay:true,questionId:s,validationError:a,setValidationError:o}))},e)}})}),document.body)]}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{children:/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"text",onClick:v,buttonContentCss:C3.addOptionButton,icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"plus",height:24,width:24}),children:(0,em.__)("Add Option","tutor-pro")})})]})};/* ESM default export */const C5=C4;var C3={optionWrapper:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",ey/* .spacing["12"] */.YK["12"],";padding-left:",ey/* .spacing["40"] */.YK["40"],";",ey/* .Breakpoint.smallMobile */.EA.smallMobile,"{padding-left:",ey/* .spacing["8"] */.YK["8"],";}"),addOptionButton:/*#__PURE__*/(0,o/* .css */.AH)("color:",ey/* .colorTokens.text.brand */.I6.text.brand,";svg{color:",ey/* .colorTokens.icon.brand */.I6.icon.brand,";}")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/fields/quiz/questions/FormMatching.tsx
function C8(){var e=(0,eS._)(["\n      background-color: ",";\n      outline: 1px solid ",";\n\n      &:hover {\n        outline: 1px solid ",";\n      }\n    "]);C8=function t(){return e};return e}function C9(){var e=(0,eS._)(["\n      background-color: ",";\n    "]);C9=function t(){return e};return e}function C7(){var e=(0,eS._)(["\n      box-shadow: ",";\n    "]);C7=function t(){return e};return e}function Ye(){var e=(0,eS._)(["\n      gap: ",";\n    "]);Ye=function t(){return e};return e}var Yt=!!fy/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var Yr=e=>{var{index:r,onDuplicateOption:i,onRemoveOption:a,field:o,isOverlay:s=false,isImageMatching:l,questionId:u,validationError:c,setValidationError:d}=e;var f;var p;var h=(p=o.value)!==null&&p!==void 0?p:{answer_id:"",answer_title:"",answer_two_gap_match:"",is_correct:"0",belongs_question_id:u,belongs_question_type:"matching"};var v=(0,n.useRef)(null);var[g,m]=(0,n.useState)(!h.answer_title||l?!h.image_url:!h.answer_two_gap_match);var[b,y]=(0,n.useState)(h);var{attributes:_,listeners:w,setNodeRef:x,transform:A,transition:k,isDragging:E}=CP({id:o.value.answer_id||0,animateLayoutChanges:CQ});var{openMediaLibrary:I,resetFiles:C}=fK({options:{type:"image"},onChange:e=>{if(e&&!Array.isArray(e)){var{id:t,url:r}=e;o.onChange((0,eX._)((0,e$._)({},h,AL(h._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:AL(h._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{image_id:t,image_url:r}))}},initialFiles:((f=o.value)===null||f===void 0?void 0:f.image_id)?{id:Number(o.value.image_id),url:o.value.image_url||"",title:""}:null});var Y={transform:kW.Transform.toString(A),transition:k,opacity:E?.3:undefined};var T=()=>{o.onChange((0,eX._)((0,e$._)({},h,AL(h._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:AL(h._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{image_id:"",image_url:""}));C()};(0,n.useEffect)(()=>{if((0,eO/* .isDefined */.O9)(v.current)&&g){v.current.focus()}},[g]);return/*#__PURE__*/(0,t/* .jsx */.Y)("div",(0,eX._)((0,e$._)({},_),{css:Yi.option,ref:x,tabIndex:-1,style:Y,children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:Yi.optionLabel({isEditing:g,isDragging:E,isOverlay:s}),onClick:()=>{m(true)},onKeyDown:e=>{e.stopPropagation();if(e.key==="Enter"||e.key===" "){m(true)}},children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:Yi.optionHeader,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:eB/* .styleUtils.optionCounter */.x.optionCounter({isEditing:g}),children:String.fromCharCode(65+r)}),/*#__PURE__*/(0,t/* .jsxs */.FD)(ag/* ["default"] */.A,{when:!g&&h.is_saved,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("button",(0,eX._)((0,e$._)({},w),{type:"button",css:eB/* .styleUtils.optionDragButton */.x.optionDragButton({isOverlay:s}),"data-visually-hidden":true,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"dragVertical",height:24,width:24})})),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:Yi.optionActions,"data-visually-hidden":true,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(d9,{content:(0,em.__)("Edit","tutor-pro"),delay:200,children:/*#__PURE__*/(0,t/* .jsx */.Y)("button",{type:"button",css:eB/* .styleUtils.actionButton */.x.actionButton,"data-edit-button":true,onClick:e=>{e.stopPropagation();m(true)},children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"edit",width:24,height:24})})}),/*#__PURE__*/(0,t/* .jsx */.Y)(d9,{content:(0,em.__)("Duplicate","tutor-pro"),delay:200,children:/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:!Yt,fallback:/*#__PURE__*/(0,t/* .jsx */.Y)("button",{type:"button",css:eB/* .styleUtils.actionButton */.x.actionButton,onClick:e=>{e.stopPropagation();i(h)},children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"copyPaste",width:24,height:24})}),children:/*#__PURE__*/(0,t/* .jsx */.Y)(CW,{size:"tiny",children:/*#__PURE__*/(0,t/* .jsx */.Y)("button",{disabled:true,type:"button",css:eB/* .styleUtils.actionButton */.x.actionButton,onClick:ej/* .noop */.lQ,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"copyPaste",width:24,height:24})})})})}),/*#__PURE__*/(0,t/* .jsx */.Y)(d9,{content:(0,em.__)("Delete","tutor-pro"),delay:200,children:/*#__PURE__*/(0,t/* .jsx */.Y)("button",{type:"button",css:eB/* .styleUtils.actionButton */.x.actionButton,"data-visually-hidden":true,onClick:e=>{e.stopPropagation();a()},children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"delete",width:24,height:24})})})]})]})]}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:Yi.optionBody,children:/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:g,fallback:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:Yi.placeholderWrapper({isImageMatching:l}),children:[/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:l,fallback:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:Yi.optionPlaceholder,children:h.answer_title||(0,em.__)("Answer title...","tutor-pro")}),children:/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:h.image_url,fallback:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:Yi.imagePlaceholder,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"imagePreview",height:48,width:48})}),children:()=>/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:Yi.imagePlaceholder,children:/*#__PURE__*/(0,t/* .jsx */.Y)("img",{src:h.image_url,alt:h.image_url})})})}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:Yi.optionPlaceholder,children:!l?h.answer_two_gap_match:h.answer_title})]}),children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:eB/* .styleUtils.optionInputWrapper */.x.optionInputWrapper,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:l,children:/*#__PURE__*/(0,t/* .jsx */.Y)(_E,{value:{id:Number(h.image_id),url:h.image_url||"",title:h.image_url||""},infoText:(0,em.__)("Standard Size: 700x430 pixels","tutor-pro"),uploadHandler:I,clearHandler:T,emptyImageCss:Yi.emptyImageInput,previewImageCss:Yi.previewImageInput})}),/*#__PURE__*/(0,t/* .jsx */.Y)("input",(0,eX._)((0,e$._)({},o),{type:"text",ref:v,placeholder:!l?(0,em.__)("Question","tutor-pro"):(0,em.__)("Image matched text..","tutor-pro"),value:h.answer_title,onClick:e=>{e.stopPropagation()},onChange:e=>{o.onChange((0,eX._)((0,e$._)({},h,AL(h._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:AL(h._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{answer_title:e.target.value}))},onKeyDown:e=>fQ(function*(){e.stopPropagation();if((e.metaKey||e.ctrlKey)&&e.key==="Enter"&&h.answer_title&&h.answer_two_gap_match){o.onChange((0,e$._)({},h,AL(h._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:AL(h._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)}));m(false)}})()})),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:!l,children:/*#__PURE__*/(0,t/* .jsx */.Y)("input",(0,eX._)((0,e$._)({},o),{type:"text",placeholder:(0,em.__)("Matched option..","tutor-pro"),value:h.answer_two_gap_match,onClick:e=>{e.stopPropagation()},onChange:e=>{o.onChange((0,eX._)((0,e$._)({},h,AL(h._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:AL(h._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{answer_two_gap_match:e.target.value}))},onKeyDown:e=>{e.stopPropagation();if((e.metaKey||e.ctrlKey)&&e.key==="Enter"&&h.answer_title&&h.answer_two_gap_match){o.onChange((0,e$._)({},h,AL(h._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:AL(h._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE),is_saved:true}));if((c===null||c===void 0?void 0:c.type)==="save_option"){d===null||d===void 0?void 0:d(null)}m(false)}}}))}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:Yi.optionInputButtons,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"text",size:"small",onClick:e=>{e.stopPropagation();m(false);o.onChange(b);if(!h.is_saved){if((c===null||c===void 0?void 0:c.type)==="save_option"){d===null||d===void 0?void 0:d(null)}a()}},children:(0,em.__)("Cancel","tutor-pro")}),/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"secondary",size:"small",onClick:e=>{e.stopPropagation();o.onChange((0,eX._)((0,e$._)({},h,AL(h._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:AL(h._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{is_saved:true}));y((0,eX._)((0,e$._)({},h,AL(h._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:AL(h._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{is_saved:true}));if((c===null||c===void 0?void 0:c.type)==="save_option"){d===null||d===void 0?void 0:d(null)}m(false)},disabled:!h.answer_title||(l?!h.image_id:!h.answer_two_gap_match),children:(0,em.__)("Ok","tutor-pro")})]})]})})})]})}))};/* ESM default export */const Yn=Yr;var Yi={option:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),";",eK/* .typography.caption */.I.caption("medium"),";align-items:center;color:",ey/* .colorTokens.text.subdued */.I6.text.subdued,";gap:",ey/* .spacing["10"] */.YK["10"],";align-items:center;"),optionLabel:e=>{var{isEditing:t,isDragging:r,isOverlay:n}=e;return/*#__PURE__*/(0,o/* .css */.AH)("display:flex;flex-direction:column;gap:",ey/* .spacing["12"] */.YK["12"],";width:100%;border-radius:",ey/* .borderRadius.card */.Vq.card,";padding:",ey/* .spacing["12"] */.YK["12"]," ",ey/* .spacing["16"] */.YK["16"],";background-color:",ey/* .colorTokens.background.white */.I6.background.white,";[data-visually-hidden]{opacity:0;}&:hover{outline:1px solid ",ey/* .colorTokens.stroke.hover */.I6.stroke.hover,";[data-visually-hidden]{opacity:1;}}",t&&(0,o/* .css */.AH)(C8(),ey/* .colorTokens.background.white */.I6.background.white,ey/* .colorTokens.stroke.brand */.I6.stroke.brand,ey/* .colorTokens.stroke.brand */.I6.stroke.brand)," ",r&&(0,o/* .css */.AH)(C9(),ey/* .colorTokens.stroke.hover */.I6.stroke.hover)," ",n&&(0,o/* .css */.AH)(C7(),ey/* .shadow.drag */.r7.drag)," ",ey/* .Breakpoint.smallTablet */.EA.smallTablet,"{[data-visually-hidden]{opacity:1;}}")},optionHeader:/*#__PURE__*/(0,o/* .css */.AH)("display:grid;grid-template-columns:1fr auto 1fr;align-items:center;&:focus-within{[data-visually-hidden]{opacity:1;}}"),optionActions:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),"    gap:",ey/* .spacing["8"] */.YK["8"],";place-self:center end;"),actionButton:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.resetButton */.x.resetButton,";",eB/* .styleUtils.display.flex */.x.display.flex(),"    color:",ey/* .colorTokens.icon["default"] */.I6.icon["default"],";cursor:pointer;&:disabled{cursor:not-allowed;color:",ey/* .colorTokens.icon.disable.background */.I6.icon.disable.background,";}"),optionBody:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex()),placeholderWrapper:e=>{var{isImageMatching:t}=e;return/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),"    width:100%;",t&&(0,o/* .css */.AH)(Ye(),ey/* .spacing["12"] */.YK["12"]))},imagePlaceholder:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.flexCenter */.x.flexCenter(),";height:210px;width:100%;background-color:",ey/* .colorTokens.background["default"] */.I6.background["default"],";border-radius:",ey/* .borderRadius.card */.Vq.card,";overflow:hidden;svg{color:",ey/* .colorTokens.icon.hints */.I6.icon.hints,";}img{width:100%;height:100%;object-fit:cover;object-position:center;}"),emptyImageInput:/*#__PURE__*/(0,o/* .css */.AH)("background-color:",ey/* .colorTokens.background["default"] */.I6.background["default"],";height:210px;"),previewImageInput:/*#__PURE__*/(0,o/* .css */.AH)("height:210px;"),optionPlaceholder:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.body */.I.body(),";color:",ey/* .colorTokens.text.subdued */.I6.text.subdued,";padding-block:",ey/* .spacing["4"] */.YK["4"],";"),optionInputWrapper:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),"    width:100%;gap:",ey/* .spacing["12"] */.YK["12"],";"),optionInputButtons:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),"    justify-content:flex-end;gap:",ey/* .spacing["8"] */.YK["8"],";")};// CONCATENATED MODULE: ./addons/content-bank/assets/react/manage-contents/components/question-types/Matching.tsx
var Ya=()=>{var[e,r]=(0,n.useState)(null);var i=sw();var{validationError:a,setValidationError:o}=kd();var s=i.getValues("question_id");var l=i.watch("question_settings.is_image_matching");var{fields:u,append:c,insert:d,remove:f,move:p}=lT({control:i.control,name:"question_answers"});var h=sS({control:i.control,name:"question_settings.is_image_matching",defaultValue:false});var v=k9(k8(E6,{activationConstraint:{distance:10}}),k8(EJ,{coordinateGetter:CL}));var g=(0,n.useMemo)(()=>{if(!e){return null}return u.find(t=>t.answer_id===e)},[e,u]);var m=()=>{c({_data_status:eO/* .QuizDataStatus.NEW */.cW.NEW,is_saved:false,answer_id:(0,ej/* .nanoid */.Ak)(),answer_title:"",is_correct:"0",belongs_question_id:s||"",belongs_question_type:h?"image_matching":"matching",answer_order:u.length,answer_two_gap_match:"",answer_view_format:""},{shouldFocus:true,focusName:"question_answers.".concat(u.length,".answer_title")})};var b=(e,t)=>{var r=ev(ep({},t),{_data_status:eO/* .QuizDataStatus.NEW */.cW.NEW,is_saved:true,answer_id:(0,ej/* .nanoid */.Ak)(),answer_title:"".concat(t.answer_title," (copy)"),is_correct:"0"});var n=e+1;d(n,r)};var y=(e,t)=>{f(e);if(t._data_status!==eO/* .QuizDataStatus.NEW */.cW.NEW){i.setValue("deleted_answer_ids",[...i.getValues("deleted_answer_ids")||[],t.answer_id])}};return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:Ys.optionWrapper,children:[/*#__PURE__*/(0,t/* .jsxs */.FD)(Iq,{sensors:v,collisionDetection:Es,modifiers:[Cu],onDragStart:e=>{r(e.active.id)},onDragEnd:e=>{var{active:t,over:n}=e;if(!n){return}if(t.id!==n.id){var i=u.findIndex(e=>e.answer_id===t.id);var a=u.findIndex(e=>e.answer_id===n.id);p(i,a)}r(null)},children:[/*#__PURE__*/(0,t/* .jsx */.Y)(CC,{items:u.map(e=>ev(ep({},e),{id:e.answer_id})),strategy:CA,children:/*#__PURE__*/(0,t/* .jsx */.Y)(fb,{each:u,children:(e,r)=>/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{control:i.control,name:"question_answers.".concat(r),render:n=>/*#__PURE__*/(0,t/* .jsx */.Y)(Yn,ev(ep({},n),{index:r,onDuplicateOption:e=>b(r,e),onRemoveOption:()=>y(r,e),isImageMatching:l,questionId:s,validationError:a,setValidationError:o}))},"".concat(e.answer_id,"-").concat(r))})}),/*#__PURE__*/(0,iW.createPortal)(/*#__PURE__*/(0,t/* .jsx */.Y)(Cr,{zIndex:ey/* .zIndex.highest */.fE.highest,children:/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:g,children:r=>{var n=u.findIndex(e=>e.answer_id===r.answer_id);return/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{control:i.control,name:"question_answers.".concat(n),render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(Yn,ev(ep({},e),{index:n,onDuplicateOption:ej/* .noop */.lQ,onRemoveOption:ej/* .noop */.lQ,isOverlay:true,isImageMatching:l,questionId:s,validationError:a,setValidationError:o}))},e)}})}),document.body)]}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{children:/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"text",onClick:m,buttonContentCss:Ys.addOptionButton,icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"plus",height:24,width:24}),children:(0,em.__)("Add Option","tutor-pro")})})]})};/* ESM default export */const Yo=Ya;var Ys={optionWrapper:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",ey/* .spacing["12"] */.YK["12"],";padding-left:",ey/* .spacing["40"] */.YK["40"],";",ey/* .Breakpoint.smallMobile */.EA.smallMobile,"{padding-left:",ey/* .spacing["8"] */.YK["8"],";}"),addOptionButton:/*#__PURE__*/(0,o/* .css */.AH)("color:",ey/* .colorTokens.text.brand */.I6.text.brand,";svg{color:",ey/* .colorTokens.icon.brand */.I6.icon.brand,";}")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/fields/quiz/questions/FormMultipleChoiceAndOrdering.tsx
function Yl(){var e=(0,eS._)(["\n        fill: none;\n      "]);Yl=function t(){return e};return e}function Yu(){var e=(0,eS._)(["\n          fill: ",";\n        "]);Yu=function t(){return e};return e}function Yc(){var e=(0,eS._)(["\n      [data-check-button] {\n        opacity: 1;\n        color: ",";\n        ","\n      }\n    "]);Yc=function t(){return e};return e}function Yd(){var e=(0,eS._)(["\n      background-color: ",";\n      color: ",";\n\n      &:hover {\n        outline: 1px solid ",";\n      }\n    "]);Yd=function t(){return e};return e}function Yf(){var e=(0,eS._)(["\n      background-color: ",";\n      outline: 1px solid ",";\n      &:hover {\n        outline: 1px solid ",";\n      }\n    "]);Yf=function t(){return e};return e}function Yp(){var e=(0,eS._)(["\n      background-color: ",";\n    "]);Yp=function t(){return e};return e}function Yh(){var e=(0,eS._)(["\n      box-shadow: ",";\n    "]);Yh=function t(){return e};return e}var Yv=!!fy/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var Yg=e=>{var{field:r,onDuplicateOption:i,onRemoveOption:a,onCheckCorrectAnswer:o,index:s,isOverlay:l=false,questionId:u,hasMultipleCorrectAnswer:c=false,questionType:d="multiple_choice",validationError:f,setValidationError:p}=e;var h,v;var g;var m=(g=r.value)!==null&&g!==void 0?g:{answer_id:(0,ej/* .nanoid */.Ak)(),answer_title:"",is_correct:"0",belongs_question_id:u,belongs_question_type:"multiple_choice"};var b=(0,n.useRef)(null);var[y,_]=(0,n.useState)(!m.is_saved||!m.answer_title&&!m.image_url);var[w,x]=(0,n.useState)((0,eO/* .isDefined */.O9)(m.image_id)&&(0,eO/* .isDefined */.O9)(m.image_url));var[A,k]=(0,n.useState)(m);var{attributes:E,listeners:I,setNodeRef:C,transform:Y,transition:T,isDragging:S}=CP({id:((h=r.value)===null||h===void 0?void 0:h.answer_id)||0,animateLayoutChanges:CQ});var{openMediaLibrary:O,resetFiles:D}=fK({options:{type:"image"},onChange:e=>{if(e&&!Array.isArray(e)){var{id:t,url:n}=e;r.onChange((0,eX._)((0,e$._)({},m,AL(m._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:AL(m._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{image_id:t,image_url:n,answer_view_format:"text_image"}));x(true)}},initialFiles:((v=r.value)===null||v===void 0?void 0:v.image_id)?{id:Number(r.value.image_id),url:r.value.image_url||"",title:""}:null});var F={transform:kW.Transform.toString(Y),transition:T,opacity:S?.3:undefined};var R=()=>{D();r.onChange((0,eX._)((0,e$._)({},m,AL(m._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:AL(m._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{image_id:"",image_url:"",answer_view_format:"text"}));x(false)};(0,n.useEffect)(()=>{if((0,eO/* .isDefined */.O9)(b.current)&&y){b.current.focus()}},[y]);return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",(0,eX._)((0,e$._)({},E),{css:Yb.option({isSelected:!!Number(m.is_correct),isMultipleChoice:c}),tabIndex:-1,ref:C,style:F,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:d==="multiple_choice",children:/*#__PURE__*/(0,t/* .jsx */.Y)("button",{css:eB/* .styleUtils.optionCheckButton */.x.optionCheckButton,"data-check-button":true,type:"button",onClick:o,children:/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:c,fallback:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:Number(m.is_correct)?"checkFilled":"check",height:32,width:32}),children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:Number(m.is_correct)?"checkSquareFilled":"checkSquare",height:32,width:32})})},m.is_correct)}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:Yb.optionLabel({isSelected:!!Number(m.is_correct),isEditing:y,isDragging:S,isOverlay:l}),onClick:()=>{_(true)},onKeyDown:e=>{e.stopPropagation();if(e.key==="Enter"||e.key===" "){_(true)}},children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:Yb.optionHeader({isEditing:y}),children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:Yb.optionCounterAndButton,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:eB/* .styleUtils.optionCounter */.x.optionCounter({isSelected:!!Number(m.is_correct),isEditing:y}),children:String.fromCharCode(65+s)}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:y,children:/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:!w,fallback:/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"text",icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"removeImage",width:24,height:24}),onClick:e=>{e.stopPropagation();R()},children:(0,em.__)("Remove Image","tutor-pro")}),children:/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"text",size:"small",icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"addImage",width:24,height:24}),onClick:e=>{e.stopPropagation();O()},children:(0,em.__)("Add Image","tutor-pro")})})})]}),/*#__PURE__*/(0,t/* .jsxs */.FD)(ag/* ["default"] */.A,{when:!y&&m.is_saved,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("button",(0,eX._)((0,e$._)({},I),{type:"button",css:eB/* .styleUtils.optionDragButton */.x.optionDragButton({isOverlay:l}),"data-visually-hidden":true,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"dragVertical",height:24,width:24})})),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:Yb.optionActions,"data-visually-hidden":true,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(d9,{content:(0,em.__)("Edit","tutor-pro"),delay:200,children:/*#__PURE__*/(0,t/* .jsx */.Y)("button",{type:"button",css:eB/* .styleUtils.actionButton */.x.actionButton,onClick:e=>{e.stopPropagation();_(true)},children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"edit",width:24,height:24})})}),/*#__PURE__*/(0,t/* .jsx */.Y)(d9,{content:(0,em.__)("Duplicate","tutor-pro"),delay:200,children:/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:!Yv,fallback:/*#__PURE__*/(0,t/* .jsx */.Y)("button",{type:"button",css:eB/* .styleUtils.actionButton */.x.actionButton,onClick:e=>{e.stopPropagation();i(m)},children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"copyPaste",width:24,height:24})}),children:/*#__PURE__*/(0,t/* .jsx */.Y)(CW,{size:"tiny",children:/*#__PURE__*/(0,t/* .jsx */.Y)("button",{disabled:true,type:"button",css:eB/* .styleUtils.actionButton */.x.actionButton,onClick:ej/* .noop */.lQ,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"copyPaste",width:24,height:24})})})})}),/*#__PURE__*/(0,t/* .jsx */.Y)(d9,{content:(0,em.__)("Delete","tutor-pro"),delay:200,children:/*#__PURE__*/(0,t/* .jsx */.Y)("button",{type:"button",css:eB/* .styleUtils.actionButton */.x.actionButton,onClick:e=>{e.stopPropagation();a()},children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"delete",width:24,height:24})})})]})]})]}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:Yb.optionBody,children:/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:y,fallback:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:Yb.placeholderWrapper,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:m.image_url,children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:Yb.imagePlaceholder,children:/*#__PURE__*/(0,t/* .jsx */.Y)("img",{src:m.image_url,alt:m.image_url})})}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:Yb.optionPlaceholder,children:m.answer_title||(0,em.__)("Write answer option...","tutor-pro")})]}),children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:eB/* .styleUtils.optionInputWrapper */.x.optionInputWrapper,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:w,children:/*#__PURE__*/(0,t/* .jsx */.Y)(_E,{value:{id:Number(m.image_id),url:m.image_url||"",title:(0,em.__)("Image","tutor-pro")},buttonText:(0,em.__)("Upload Image","tutor-pro"),infoText:(0,em.__)("Size: 700x430 pixels","tutor-pro"),uploadHandler:O,clearHandler:R,emptyImageCss:Yb.emptyImageInput,previewImageCss:Yb.previewImageInput})}),/*#__PURE__*/(0,t/* .jsx */.Y)("textarea",(0,eX._)((0,e$._)({},r),{ref:b,placeholder:(0,em.__)("Write option...","tutor-pro"),value:m.answer_title,onClick:e=>{e.stopPropagation()},onChange:e=>{var{value:t}=e.target;r.onChange((0,eX._)((0,e$._)({},m,AL(m._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:AL(m._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{answer_title:t}))},onKeyDown:e=>fQ(function*(){e.stopPropagation();if((e.metaKey||e.ctrlKey)&&e.key==="Enter"&&m.answer_title){r.onChange((0,e$._)({},m,AL(m._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:AL(m._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE),is_saved:true}));if((f===null||f===void 0?void 0:f.type)==="save_option"){p===null||p===void 0?void 0:p(null)}_(false)}})()})),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:Yb.optionInputButtons,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"text",size:"small",onClick:e=>{e.stopPropagation();_(false);r.onChange(A);if(!m.is_saved){if((f===null||f===void 0?void 0:f.type)==="save_option"){p===null||p===void 0?void 0:p(null)}a()}},children:(0,em.__)("Cancel","tutor-pro")}),/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"secondary",size:"small",onClick:e=>fQ(function*(){e.stopPropagation();r.onChange((0,eX._)((0,e$._)({},m,AL(m._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:AL(m._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{is_saved:true}));k((0,eX._)((0,e$._)({},m,AL(m._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:AL(m._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{is_saved:true}));if((f===null||f===void 0?void 0:f.type)==="save_option"){p===null||p===void 0?void 0:p(null)}_(false)})(),disabled:!m.answer_title&&!m.image_url,children:(0,em.__)("Ok","tutor-pro")})]})]})})})]})]}))};/* ESM default export */const Ym=Yg;var Yb={option:e=>{var{isSelected:t,isMultipleChoice:r}=e;return/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),";",eK/* .typography.caption */.I.caption("medium"),";align-items:center;color:",ey/* .colorTokens.text.subdued */.I6.text.subdued,";gap:",ey/* .spacing["10"] */.YK["10"],";align-items:center;[data-check-button]{color:",ey/* .colorTokens.icon["default"] */.I6.icon["default"],";",!r&&(0,o/* .css */.AH)(Yl()),"      &:focus-visible{opacity:1;}}&:hover{[data-check-button]{opacity:1;}}&:focus-within{[data-check-button]{opacity:1;}}",t&&(0,o/* .css */.AH)(Yc(),ey/* .colorTokens.bg.success */.I6.bg.success,!r&&(0,o/* .css */.AH)(Yu(),ey/* .colorTokens.bg.success */.I6.bg.success))," ",ey/* .Breakpoint.smallTablet */.EA.smallTablet,"{[data-check-button]{opacity:1;}}")},optionLabel:e=>{var{isSelected:t,isEditing:r,isDragging:n,isOverlay:i}=e;return/*#__PURE__*/(0,o/* .css */.AH)("display:flex;flex-direction:column;gap:",ey/* .spacing["12"] */.YK["12"],";width:100%;border-radius:",ey/* .borderRadius.card */.Vq.card,";padding:",ey/* .spacing["12"] */.YK["12"]," ",ey/* .spacing["16"] */.YK["16"],";background-color:",ey/* .colorTokens.background.white */.I6.background.white,";[data-visually-hidden]{opacity:0;}&:hover{outline:1px solid ",ey/* .colorTokens.stroke.hover */.I6.stroke.hover,";[data-visually-hidden]{opacity:1;}}",t&&(0,o/* .css */.AH)(Yd(),ey/* .colorTokens.background.success.fill40 */.I6.background.success.fill40,ey/* .colorTokens.text.primary */.I6.text.primary,ey/* .colorTokens.stroke.success.fill70 */.I6.stroke.success.fill70)," ",r&&(0,o/* .css */.AH)(Yf(),ey/* .colorTokens.background.white */.I6.background.white,t?ey/* .colorTokens.stroke.success.fill70 */.I6.stroke.success.fill70:ey/* .colorTokens.stroke.brand */.I6.stroke.brand,t?ey/* .colorTokens.stroke.success.fill70 */.I6.stroke.success.fill70:ey/* .colorTokens.stroke.brand */.I6.stroke.brand)," ",n&&(0,o/* .css */.AH)(Yp(),ey/* .colorTokens.stroke.hover */.I6.stroke.hover)," ",i&&(0,o/* .css */.AH)(Yh(),ey/* .shadow.drag */.r7.drag)," ",ey/* .Breakpoint.smallTablet */.EA.smallTablet,"{[data-visually-hidden]{opacity:1;}}")},optionHeader:e=>{var{isEditing:t=false}=e;return/*#__PURE__*/(0,o/* .css */.AH)("display:grid;grid-template-columns:",!t?"1fr auto 1fr":"1fr",";align-items:center;&:focus-within{[data-visually-hidden]{opacity:1;}}")},optionCounterAndButton:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),"    gap:",ey/* .spacing["8"] */.YK["8"],";place-self:center start;button{padding:0;min-height:24px;}"),optionActions:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),"    gap:",ey/* .spacing["8"] */.YK["8"],";place-self:center end;"),optionBody:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex()),placeholderWrapper:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),"    gap:",ey/* .spacing["12"] */.YK["12"],";width:100%;"),imagePlaceholder:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.flexCenter */.x.flexCenter(),";height:210px;width:100%;background-color:",ey/* .colorTokens.background["default"] */.I6.background["default"],";border-radius:",ey/* .borderRadius.card */.Vq.card,";overflow:hidden;svg{color:",ey/* .colorTokens.icon.hints */.I6.icon.hints,";}img{width:100%;height:100%;object-fit:cover;object-position:center;}"),emptyImageInput:/*#__PURE__*/(0,o/* .css */.AH)("background-color:",ey/* .colorTokens.background["default"] */.I6.background["default"],";height:210px;"),previewImageInput:/*#__PURE__*/(0,o/* .css */.AH)("height:210px;"),optionPlaceholder:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.body */.I.body(),";color:",ey/* .colorTokens.text.subdued */.I6.text.subdued,";padding-block:",ey/* .spacing["4"] */.YK["4"],";"),optionInputButtons:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),"    justify-content:flex-end;gap:",ey/* .spacing["8"] */.YK["8"],";")};// CONCATENATED MODULE: ./addons/content-bank/assets/react/manage-contents/components/question-types/MultipleChoiceAndOrdering.tsx
function Yy(){var e=eg(["\n      padding-left: ",";\n    "]);Yy=function t(){return e};return e}function Y_(){var e=eg(["\n      margin-left: ",";\n    "]);Y_=function t(){return e};return e}var Yw=()=>{var[e,r]=(0,n.useState)(null);var i=sw();var{validationError:a,setValidationError:o}=kd();var s=sS({control:i.control,name:"question_settings.has_multiple_correct_answer",defaultValue:false});var l=i.watch("question_id");var u=i.watch("question_type");var{fields:c,append:d,insert:f,remove:p,update:h,replace:v,move:g}=lT({control:i.control,name:"question_answers"});var m=k9(k8(E6,{activationConstraint:{distance:10}}),k8(EJ,{coordinateGetter:CL}));var b=sS({control:i.control,name:"question_answers",defaultValue:[]});var y=(0,n.useMemo)(()=>{if(!e){return null}return c.find(t=>t.answer_id===e)},[e,c]);var _=(e,t)=>{if(s){h(e,ev(ep({},t,AL(t._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:AL(t._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{is_correct:t.is_correct==="1"?"0":"1"}))}else{var r=b.map(e=>ev(ep({},e,AL(e._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:AL(e._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{is_correct:e.answer_id===t.answer_id?"1":"0"}));v(r)}if((a===null||a===void 0?void 0:a.type)==="correct_option"){o(null)}};var w=()=>{d({_data_status:eO/* .QuizDataStatus.NEW */.cW.NEW,is_saved:false,answer_id:(0,ej/* .nanoid */.Ak)(),answer_title:"",is_correct:"0",belongs_question_id:l,belongs_question_type:u,answer_order:c.length,answer_two_gap_match:"",answer_view_format:"text"},{shouldFocus:true,focusName:"question_answers.".concat(c.length,".answer_title")});if((a===null||a===void 0?void 0:a.type)==="add_option"){o(null)}};var x=(e,t)=>{var r=ev(ep({},t),{_data_status:eO/* .QuizDataStatus.NEW */.cW.NEW,is_saved:true,answer_id:(0,ej/* .nanoid */.Ak)(),answer_title:"".concat(t.answer_title," (copy)"),is_correct:"0"});var n=e+1;f(n,r)};var A=(e,t)=>{p(e);if(t._data_status!==eO/* .QuizDataStatus.NEW */.cW.NEW){i.setValue("deleted_answer_ids",[...i.getValues("deleted_answer_ids")||[],t.answer_id])}};return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:YA.optionWrapper({isOrdering:u==="ordering"}),children:[/*#__PURE__*/(0,t/* .jsxs */.FD)(Iq,{sensors:m,collisionDetection:Es,modifiers:[Cu],onDragStart:e=>{r(e.active.id)},onDragEnd:e=>{var{active:t,over:n}=e;if(!n){return}if(t.id!==n.id){var i=c.findIndex(e=>e.answer_id===t.id);var a=c.findIndex(e=>e.answer_id===n.id);g(i,a)}r(null)},children:[/*#__PURE__*/(0,t/* .jsx */.Y)(CC,{items:c.map(e=>ev(ep({},e),{id:e.answer_id})),strategy:CA,children:/*#__PURE__*/(0,t/* .jsx */.Y)(fb,{each:c,children:(e,r)=>/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{control:i.control,name:"question_answers.".concat(r),render:n=>/*#__PURE__*/(0,t/* .jsx */.Y)(Ym,ev(ep({},n),{onDuplicateOption:e=>x(r,e),onRemoveOption:()=>A(r,e),onCheckCorrectAnswer:()=>_(r,e),index:r,questionId:l,validationError:a,setValidationError:o,hasMultipleCorrectAnswer:s,questionType:u}))},"".concat(e.answer_id,"-").concat(e.is_correct))})}),/*#__PURE__*/(0,iW.createPortal)(/*#__PURE__*/(0,t/* .jsx */.Y)(Cr,{zIndex:ey/* .zIndex.highest */.fE.highest,children:/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:y,children:r=>{var n=b.findIndex(e=>e.answer_id===r.answer_id);return/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{control:i.control,name:"question_answers.".concat(n),render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(Ym,ev(ep({},e),{onDuplicateOption:ej/* .noop */.lQ,onRemoveOption:ej/* .noop */.lQ,onCheckCorrectAnswer:ej/* .noop */.lQ,index:n,isOverlay:true,questionId:l,validationError:a,setValidationError:o,hasMultipleCorrectAnswer:s,questionType:u}))},e)}})}),document.body)]}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:YA.addOptionButtonWrapper({isOrdering:u==="ordering"}),children:/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"text",onClick:w,buttonContentCss:YA.addOptionButton,icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"plus",height:24,width:24}),children:(0,em.__)("Add Option","tutor-pro")})})]})};/* ESM default export */const Yx=Yw;var YA={optionWrapper:e=>{var{isOrdering:t}=e;return/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",ey/* .spacing["12"] */.YK["12"],";",t&&(0,o/* .css */.AH)(Yy(),ey/* .spacing["40"] */.YK["40"]))},addOptionButtonWrapper:e=>{var{isOrdering:t}=e;return/*#__PURE__*/(0,o/* .css */.AH)("margin-left:",ey/* .spacing["48"] */.YK["48"],";",t&&(0,o/* .css */.AH)(Y_(),ey/* .spacing["8"] */.YK["8"]))},addOptionButton:/*#__PURE__*/(0,o/* .css */.AH)("color:",ey/* .colorTokens.text.brand */.I6.text.brand,";svg{color:",ey/* .colorTokens.icon.brand */.I6.icon.brand,";}")};// CONCATENATED MODULE: ./addons/content-bank/assets/react/manage-contents/components/question-types/OpenEndedAndShortAnswer.tsx
var Yk=()=>{return/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:YI.optionWrapper,children:/*#__PURE__*/(0,t/* .jsx */.Y)(bx,{icon:"bulb",children:(0,em.__)("No options are necessary for this question type","tutor-pro")})})};/* ESM default export */const YE=Yk;var YI={optionWrapper:/*#__PURE__*/(0,o/* .css */.AH)("padding-left:",ey/* .spacing["40"] */.YK["40"],";",ey/* .Breakpoint.smallMobile */.EA.smallMobile,"{padding-left:",ey/* .spacing["8"] */.YK["8"],";}")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/fields/quiz/questions/FormTrueFalse.tsx
function YC(){var e=(0,eS._)(["\n      [data-check-button] {\n        opacity: 1;\n        color: ",";\n      }\n    "]);YC=function t(){return e};return e}function YY(){var e=(0,eS._)(["\n      background-color: ",";\n      color: ",";\n\n      &:hover {\n        outline: 1px solid ",";\n      }\n    "]);YY=function t(){return e};return e}function YT(){var e=(0,eS._)(["\n      background-color: ",";\n    "]);YT=function t(){return e};return e}function YS(){var e=(0,eS._)(["\n      box-shadow: ",";\n    "]);YS=function t(){return e};return e}var YO=e=>{var{field:r,onCheckCorrectAnswer:n,isOverlay:i=false,questionId:a}=e;var o;var s=(o=r.value)!==null&&o!==void 0?o:{answer_id:(0,ej/* .nanoid */.Ak)(),answer_title:"",is_correct:"0",belongs_question_id:a,belongs_question_type:"true_false"};var{attributes:l,listeners:u,setNodeRef:c,transform:d,transition:f,isDragging:p}=CP({id:s.answer_id||0,animateLayoutChanges:CQ});var h={transform:kW.Transform.toString(d),transition:f,opacity:p?.3:undefined};return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",(0,eX._)((0,e$._)({},l),{css:YF.option({isSelected:!!Number(s.is_correct),isOverlay:i}),tabIndex:-1,ref:c,style:h,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("button",{"data-check-button":true,type:"button",css:eB/* .styleUtils.optionCheckButton */.x.optionCheckButton,onClick:n,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:Number(s.is_correct)?"checkFilled":"check",height:32,width:32})}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:YF.optionLabel({isSelected:!!Number(s.is_correct),isDragging:p,isOverlay:i}),children:[/*#__PURE__*/(0,t/* .jsx */.Y)("span",{children:s.answer_title}),/*#__PURE__*/(0,t/* .jsx */.Y)("button",(0,eX._)((0,e$._)({},u),{type:"button",css:eB/* .styleUtils.optionDragButton */.x.optionDragButton({isOverlay:i}),"data-visually-hidden":true,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"dragVertical",height:24,width:24})}))]})]}))};/* ESM default export */const YD=YO;var YF={option:e=>{var{isSelected:t,isOverlay:r}=e;return/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),";",eK/* .typography.caption */.I.caption("medium"),";align-items:center;color:",ey/* .colorTokens.text.subdued */.I6.text.subdued,";gap:",ey/* .spacing["10"] */.YK["10"],";height:48px;align-items:center;[data-check-button]{color:",ey/* .colorTokens.icon["default"] */.I6.icon["default"],";opacity:0;fill:none;flex-shrink:0;&:focus-visible{opacity:1;}}&:focus-within{[data-check-button]{opacity:1;}}&:hover{[data-check-button]{opacity:",r?0:1,";}}",t&&(0,o/* .css */.AH)(YC(),ey/* .colorTokens.bg.success */.I6.bg.success))},optionLabel:e=>{var{isSelected:t,isDragging:r,isOverlay:n}=e;return/*#__PURE__*/(0,o/* .css */.AH)("display:grid;grid-template-columns:1fr auto 1fr;align-items:center;width:100%;border-radius:",ey/* .borderRadius.card */.Vq.card,";padding:",ey/* .spacing["12"] */.YK["12"]," ",ey/* .spacing["16"] */.YK["16"],";background-color:",ey/* .colorTokens.background.white */.I6.background.white,";text-transform:capitalize;[data-visually-hidden]{opacity:0;}&:hover{outline:1px solid ",ey/* .colorTokens.stroke.hover */.I6.stroke.hover,";[data-visually-hidden]{opacity:1;}}&:focus-within{[data-visually-hidden]{opacity:1;}}",t&&(0,o/* .css */.AH)(YY(),ey/* .colorTokens.background.success.fill40 */.I6.background.success.fill40,ey/* .colorTokens.text.primary */.I6.text.primary,ey/* .colorTokens.stroke.success.fill70 */.I6.stroke.success.fill70)," ",r&&(0,o/* .css */.AH)(YT(),ey/* .colorTokens.stroke.hover */.I6.stroke.hover)," ",n&&(0,o/* .css */.AH)(YS(),ey/* .shadow.drag */.r7.drag)," ",ey/* .Breakpoint.smallTablet */.EA.smallTablet,"{[data-visually-hidden]{opacity:1;}}")}};// CONCATENATED MODULE: ./addons/content-bank/assets/react/manage-contents/components/question-types/TrueFalse.tsx
function YR(){var e=eg(["\n      [data-check-icon] {\n        opacity: 1;\n        color: ",";\n      }\n    "]);YR=function t(){return e};return e}function YP(){var e=eg(["\n      background-color: ",";\n      color: ",";\n\n      &:hover {\n        box-shadow: 0 0 0 1px ",";\n      }\n    "]);YP=function t(){return e};return e}var YM=()=>{var[e,r]=(0,n.useState)(null);var i=sw();var a=i.watch("question_id");var{fields:o,move:s,replace:l}=lT({control:i.control,name:"question_answers"});var u=k9(k8(E6,{activationConstraint:{distance:10}}),k8(EJ,{coordinateGetter:CL}));var c=sS({control:i.control,name:"question_answers",defaultValue:[]});var d=(0,n.useMemo)(()=>{if(!e){return null}return o.find(t=>t.answer_id===e)},[e,o]);var f=e=>{var t=c.map(t=>ev(ep({},t,AL(t._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:AL(t._data_status,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{is_correct:t.answer_id===e.answer_id?"1":"0"}));l(t)};return/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:YN.optionWrapper,children:/*#__PURE__*/(0,t/* .jsxs */.FD)(Iq,{sensors:u,collisionDetection:Es,modifiers:[Cu],onDragStart:e=>{r(e.active.id)},onDragEnd:e=>{var{active:t,over:n}=e;if(!n){return}if(t.id!==n.id){var i=o.findIndex(e=>e.answer_id===t.id);var a=o.findIndex(e=>e.answer_id===n.id);s(i,a)}r(null)},children:[/*#__PURE__*/(0,t/* .jsx */.Y)(CC,{items:o.map(e=>ev(ep({},e),{id:e.answer_id})),strategy:CA,children:/*#__PURE__*/(0,t/* .jsx */.Y)(fb,{each:o,children:(e,r)=>/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{control:i.control,name:"question_answers.".concat(r),render:n=>/*#__PURE__*/(0,t/* .jsx */.Y)(YD,ev(ep({},n),{index:r,onCheckCorrectAnswer:()=>f(e),questionId:a}))},"".concat(e.answer_id,"-").concat(e.is_correct))})}),/*#__PURE__*/(0,iW.createPortal)(/*#__PURE__*/(0,t/* .jsx */.Y)(Cr,{zIndex:ey/* .zIndex.highest */.fE.highest,children:/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:d,children:r=>{var n=o.findIndex(e=>e.answer_id===r.answer_id);return/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{control:i.control,name:"question_answers.".concat(n),render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(YD,ev(ep({},e),{index:n,onCheckCorrectAnswer:ej/* .noop */.lQ,isOverlay:true,questionId:a}))},e)}})}),document.body)]})})};/* ESM default export */const YH=YM;var YN={optionWrapper:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",ey/* .spacing["12"] */.YK["12"],";"),option:e=>{var{isSelected:t}=e;return/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),";",eK/* .typography.caption */.I.caption("medium"),";align-items:center;color:",ey/* .colorTokens.text.subdued */.I6.text.subdued,";gap:",ey/* .spacing["10"] */.YK["10"],";height:48px;align-items:center;[data-check-icon]{opacity:0;transition:opacity 0.15s ease-in-out;fill:none;flex-shrink:0;}&:hover{[data-check-icon]{opacity:1;}}",t&&(0,o/* .css */.AH)(YR(),ey/* .colorTokens.bg.success */.I6.bg.success))},optionLabel:e=>{var{isSelected:t}=e;return/*#__PURE__*/(0,o/* .css */.AH)("display:grid;grid-template-columns:1fr auto 1fr;align-items:center;width:100%;border-radius:",ey/* .borderRadius.card */.Vq.card,";padding:",ey/* .spacing["12"] */.YK["12"]," ",ey/* .spacing["16"] */.YK["16"],";background-color:",ey/* .colorTokens.background.white */.I6.background.white,";cursor:pointer;[data-visually-hidden]{opacity:0;}&:hover{box-shadow:0 0 0 1px ",ey/* .colorTokens.stroke.hover */.I6.stroke.hover,";[data-visually-hidden]{opacity:1;}}",t&&(0,o/* .css */.AH)(YP(),ey/* .colorTokens.background.success.fill40 */.I6.background.success.fill40,ey/* .colorTokens.text.primary */.I6.text.primary,ey/* .colorTokens.stroke.success.fill70 */.I6.stroke.success.fill70))},optionDragButton:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.resetButton */.x.resetButton," ",eB/* .styleUtils.flexCenter */.x.flexCenter(),"    transform:rotate(90deg);color:",ey/* .colorTokens.icon["default"] */.I6.icon["default"],";cursor:grab;place-self:center center;&:focus,&:active,&:hover{background:none;color:",ey/* .colorTokens.icon["default"] */.I6.icon["default"],";}")};// CONCATENATED MODULE: ./addons/content-bank/assets/react/manage-contents/components/QuestionForm.tsx
var YL=()=>{var{validationError:e}=kd();var r=sw();var i=r.watch("_data_status");var a=(0,n.useRef)(null);var o=r.watch("question_type");var s={true_false:/*#__PURE__*/(0,t/* .jsx */.Y)(YH,{}),multiple_choice:/*#__PURE__*/(0,t/* .jsx */.Y)(Yx,{}),open_ended:/*#__PURE__*/(0,t/* .jsx */.Y)(YE,{}),fill_in_the_blank:/*#__PURE__*/(0,t/* .jsx */.Y)(ky,{}),short_answer:/*#__PURE__*/(0,t/* .jsx */.Y)(YE,{}),matching:/*#__PURE__*/(0,t/* .jsx */.Y)(Yo,{}),image_answering:/*#__PURE__*/(0,t/* .jsx */.Y)(C5,{}),ordering:/*#__PURE__*/(0,t/* .jsx */.Y)(Yx,{})};return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:YB.questionForm,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:YB.questionWithIndex,children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:YB.questionTitleAndDesc,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{control:r.control,rules:{required:(0,em.__)("Question title is required","tutor-pro")},name:"question_title",render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(ks,ev(ep({},e),{placeholder:(0,em.__)("Write your question here..","tutor-pro"),disabled:o==="h5p",onChange:()=>{if(AL(i,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)){r.setValue("_data_status",AL(i,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE))}},selectOnFocus:i===eO/* .QuizDataStatus.NEW */.cW.NEW}))}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:o!=="h5p",fallback:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:YB.h5pShortCode,children:'[h5p id: "'.concat(r.watch("question_description"),'"]')})}),children:/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{control:r.control,name:"question_description",render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(A9,ev(ep({},e),{placeholder:(0,em.__)("Description (optional)","tutor-pro"),disabled:o==="h5p",onChange:()=>{if(AL(i,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)){r.setValue("_data_status",AL(i,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE))}}}))})})]})}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:e,children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{ref:a,css:YB.alertWrapper,children:/*#__PURE__*/(0,t/* .jsx */.Y)(bx,{type:"danger",icon:"warning",children:e===null||e===void 0?void 0:e.message})},Math.random())}),s[o],/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:o!=="h5p",children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:YB.questionAnswer,children:/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{control:r.control,name:"answer_explanation",render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(A0,ev(ep({},e),{label:(0,em.__)("Answer Explanation","tutor-pro"),placeholder:(0,em.__)("Write answer explanation...","tutor-pro"),onChange:()=>{if(AL(i,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE)){r.setValue("_data_status",AL(i,eO/* .QuizDataStatus.UPDATE */.cW.UPDATE))}}}))})})})]})};/* ESM default export */const YK=YL;var YB={questionForm:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),";padding-right:",ey/* .spacing["48"] */.YK["48"],";gap:",ey/* .spacing["16"] */.YK["16"],";",ey/* .Breakpoint.smallMobile */.EA.smallMobile,"{padding-right:",ey/* .spacing["8"] */.YK["8"],";}"),questionWithIndex:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("row"),";align-items:flex-start;padding-left:",ey/* .spacing["40"] */.YK["40"],";gap:",ey/* .spacing["4"] */.YK["4"],";",ey/* .Breakpoint.smallMobile */.EA.smallMobile,"{padding-left:",ey/* .spacing["8"] */.YK["8"],";}"),questionIndex:/*#__PURE__*/(0,o/* .css */.AH)("margin-top:",ey/* .spacing["10"] */.YK["10"],";",eK/* .typography.heading6 */.I.heading6(),";color:",ey/* .colorTokens.text.hints */.I6.text.hints,";"),questionTitleAndDesc:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",ey/* .spacing["8"] */.YK["8"],";width:100%;"),h5pShortCode:/*#__PURE__*/(0,o/* .css */.AH)("margin-left:",ey/* .spacing["8"] */.YK["8"],";padding:",ey/* .spacing["4"] */.YK["4"]," ",ey/* .spacing["8"] */.YK["8"],";",eK/* .typography.caption */.I.caption(),";color:",ey/* .colorTokens.text.white */.I6.text.white,";background-color:#2575be;border-radius:",ey/* .borderRadius.card */.Vq.card,";width:fit-content;font-family:'Fire Code',monospace;"),questionAnswer:/*#__PURE__*/(0,o/* .css */.AH)("padding-left:",ey/* .spacing["40"] */.YK["40"],";",ey/* .Breakpoint.smallMobile */.EA.smallMobile,"{padding-left:",ey/* .spacing["8"] */.YK["8"],";}"),emptyState:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.flexCenter */.x.flexCenter("column"),";padding-left:",ey/* .spacing["40"] */.YK["40"],";padding-right:",ey/* .spacing["48"] */.YK["48"],";gap:",ey/* .spacing["16"] */.YK["16"],";"),emptyStateImage:/*#__PURE__*/(0,o/* .css */.AH)("width:220px;height:auto;"),emptyStateText:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.small */.I.small(),";color:",ey/* .colorTokens.text.subdued */.I6.text.subdued,";text-align:center;max-width:330px;"),alertWrapper:/*#__PURE__*/(0,o/* .css */.AH)("padding-left:",ey/* .spacing["40"] */.YK["40"],";animation:shake 0.3s linear;@keyframes shake{0%{transform:translateX(0);}25%{transform:translateX(-5px);}50%{transform:translateX(5px);}75%{transform:translateX(-5px);}100%{transform:translateX(0);}}")};// CONCATENATED MODULE: ./addons/content-bank/assets/react/manage-contents/components/modals/QuestionModal.tsx
var Yj=e=>{var{contentId:r="",collectionId:i,closeModal:a,subtitle:o}=e;var s=lS({defaultValues:{_data_status:r?aT/* .QuizDataStatus.NO_CHANGE */.cW.NO_CHANGE:aT/* .QuizDataStatus.NEW */.cW.NEW,question_title:"",question_description:"",question_type:"true_false",question_answers:[{answer_id:(0,ej/* .nanoid */.Ak)(),_data_status:aT/* .QuizDataStatus.NEW */.cW.NEW,is_saved:true,answer_title:(0,em.__)("True","tutor-pro"),is_correct:"1",answer_order:1,answer_two_gap_match:"",answer_view_format:"text",belongs_question_id:"",belongs_question_type:"true_false"},{answer_id:(0,ej/* .nanoid */.Ak)(),is_saved:true,_data_status:aT/* .QuizDataStatus.NEW */.cW.NEW,answer_title:(0,em.__)("False","tutor-pro"),is_correct:"0",answer_order:2,answer_two_gap_match:"",answer_view_format:"text",belongs_question_id:"",belongs_question_type:"true_false"}],answer_explanation:"",question_mark:1,question_settings:{answer_required:false,show_question_mark:false,question_mark:1},deleted_answer_ids:[]}});var l=_s();var u=_a(Number(r));var c=s.formState.dirtyFields&&Object.keys(s.formState.dirtyFields).length>0;var d=(e,t)=>aY(function*(){var r=AK(e);if(r!==true){t(r);return}var n=yield l.mutateAsync(ev(ep({},i&&{collection_id:i},e),{_data_status:aT/* .QuizDataStatus.UPDATE */.cW.UPDATE,question_settings:(()=>{var t=e.question_settings;return ev(ep({},t),{answer_required:t.answer_required?"1":"0",show_question_mark:t.show_question_mark?"1":"0",randomize_question:t.randomize_question?"1":"0",has_multiple_correct_answer:t.has_multiple_correct_answer?"1":"0",is_image_matching:t.is_image_matching?"1":"0"})})()}));if(n.status_code===200||n.status_code===201){a({action:"CONFIRM"})}})();(0,n.useEffect)(()=>{if(!u.isLoading&&u.data){var e=u.data;s.reset(ev(ep({},AB(e)),{_data_status:aT/* .QuizDataStatus.NO_CHANGE */.cW.NO_CHANGE,question_id:e.question_id,question_answers:e.question_answers.map(e=>ev(ep({},e),{_data_status:aT/* .QuizDataStatus.NO_CHANGE */.cW.NO_CHANGE,is_saved:true})),deleted_answer_ids:[]}))}var t=setTimeout(()=>{s.setFocus("question_title")},250);return()=>{clearTimeout(t)};// eslint-disable-next-line react-hooks/exhaustive-deps
},[u.isLoading,u.data]);return/*#__PURE__*/(0,t/* .jsx */.Y)(kc,{children:e=>{var{setValidationError:n}=e;return/*#__PURE__*/(0,t/* .jsx */.Y)(t/* .Fragment */.FK,{children:/*#__PURE__*/(0,t/* .jsx */.Y)(sx,ev(ep({},s),{children:/*#__PURE__*/(0,t/* .jsx */.Y)(yI,{onClose:()=>a({action:"CLOSE"}),icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:c?"warning":"quiz",width:24,height:24}),title:c?aT/* .CURRENT_VIEWPORT.isAboveDesktop */.vN.isAboveDesktop?(0,em.__)("Unsaved Changes","tutor-pro"):"":(0,em.__)("Question","tutor-pro"),subtitle:o&&(aT/* .CURRENT_VIEWPORT.isAboveSmallMobile */.vN.isAboveSmallMobile?(0,em.sprintf)((0,em.__)("Collection: %s","tutor-pro"),o):""),maxWidth:1070,actions:c&&/*#__PURE__*/(0,t/* .jsxs */.FD)(t/* .Fragment */.FK,{children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"text",size:"small",onClick:()=>{if(r){s.reset()}else{a({action:"CLOSE"})}},children:r?(0,em.__)("Discard Changes","tutor-pro"):(0,em.__)("Cancel","tutor-pro")}),/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{"data-cy":"save-question",loading:l.isPending,variant:"primary",size:"small",onClick:s.handleSubmit(e=>d(e,n)),children:r?(0,em.__)("Update","tutor-pro"):(0,em.__)("Save","tutor-pro")})]}),children:/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:!u.isLoading,fallback:/*#__PURE__*/(0,t/* .jsx */.Y)(eE,{}),children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:Yq.wrapper,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:Yq.questionInfo,children:/*#__PURE__*/(0,t/* .jsx */.Y)(YK,{},s.watch("question_id"))}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:Yq.rightPanel,children:/*#__PURE__*/(0,t/* .jsx */.Y)(AV,{},s.watch("question_id"))})]})})})}))})}})};/* ESM default export */const YU=Yj;var Yq={wrapper:/*#__PURE__*/(0,o/* .css */.AH)("margin:0 auto;display:grid;grid-template-columns:1fr 353px;height:100%;width:100%;padding-left:",ey/* .spacing["32"] */.YK["32"],";",ey/* .Breakpoint.smallTablet */.EA.smallTablet,"{grid-template-columns:1fr;padding-inline:",ey/* .spacing["24"] */.YK["24"],";}",ey/* .Breakpoint.mobile */.EA.mobile,"{padding-inline:",ey/* .spacing["16"] */.YK["16"],";}"),questionInfo:/*#__PURE__*/(0,o/* .css */.AH)("padding-block:",ey/* .spacing["20"] */.YK["20"],";padding-right:",ey/* .spacing["32"] */.YK["32"],";display:flex;flex-direction:column;gap:",ey/* .spacing["24"] */.YK["24"],";position:sticky;top:0;z-index:",ey/* .zIndex.positive */.fE.positive,";",ey/* .Breakpoint.smallTablet */.EA.smallTablet,"{position:unset;padding-right:0;}"),rightPanel:/*#__PURE__*/(0,o/* .css */.AH)("border-left:1px solid ",ey/* .colorTokens.stroke.divider */.I6.stroke.divider,";display:flex;flex-direction:column;gap:",ey/* .spacing["16"] */.YK["16"],";",ey/* .Breakpoint.smallTablet */.EA.smallTablet,"{border-left:none;padding-left:0;}")};// CONCATENATED MODULE: ./addons/content-bank/assets/react/manage-contents/utils/utils.ts
var YV=()=>{var e=new URL(window.location.href);var t=e.searchParams.get("collection_id");return t?Number(t):null};// CONCATENATED MODULE: ./addons/content-bank/assets/react/manage-contents/hooks/useCollectionId.ts
var YW=()=>{var[e,t]=(0,n.useState)(()=>YV());(0,n.useEffect)(()=>{var e=()=>{var e=YV();t(t=>t!==e?e:t)};var r=()=>e();window.addEventListener("popstate",r);var n=window.history.pushState;var i=window.history.replaceState;window.history.pushState=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++){r[i]=arguments[i]}n.apply(window.history,r);e()};window.history.replaceState=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++){r[n]=arguments[n]}i.apply(window.history,r);e()};return()=>{window.removeEventListener("popstate",r);window.history.pushState=n;window.history.replaceState=i}},[]);var r=(0,n.useCallback)(e=>{if(e===null||e===0){t(null);var r=new URL(window.location.href);r.searchParams.delete("collection_id");window.history.pushState({},"",r.toString());window.history.replaceState({},"",r.toString());return}var n=new URL(window.location.href);n.searchParams.set("collection_id",String(e));window.history.pushState({},"",n.toString())},[]);return{collectionId:e,updateCollectionId:r}};// CONCATENATED MODULE: ./addons/content-bank/assets/react/manage-contents/hooks/useQueryParam.ts
var Yz=new Set;var YG=false;var YQ=null;function Y$(){Yz.forEach(e=>e())}function YX(){if(YQ){clearTimeout(YQ)}YQ=setTimeout(()=>{Y$();YQ=null},0)}function YJ(){if(YG)return;YG=true;var e=history.pushState;var t=history.replaceState;history.pushState=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++){r[n]=arguments[n]}e.apply(this,r);YX()};history.replaceState=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++){r[n]=arguments[n]}t.apply(this,r);YX()};window.addEventListener("popstate",Y$)}function YZ(e,t){var{parseAs:r="string"}=t||{};var i=()=>{var t=new URL(window.location.href);if(r==="array"){var n=t.searchParams.getAll(e);return n.length>0?n:[]}var i;var a=(i=t.searchParams.get(e))!==null&&i!==void 0?i:"";if(r==="number"){if(a==="")return 0;var o=Number(a);return isNaN(o)?0:o}return a};var[a,o]=(0,n.useState)(()=>i());(0,n.useEffect)(()=>{var e=()=>{var e=i();o(t=>{if(r==="array"){var n=Array.isArray(t)?t:[];var i=Array.isArray(e)?e:[];return JSON.stringify(n)!==JSON.stringify(i)?e:t}return t!==e?e:t})};YJ();Yz.add(e);e();return()=>{Yz.delete(e)};// eslint-disable-next-line react-hooks/exhaustive-deps
},[e,r]);var s=(0,n.useCallback)(t=>{var n=new URL(window.location.href);if(r==="array"&&Array.isArray(t)){n.searchParams.delete(e);if(t.length>0){t.forEach(t=>{n.searchParams.append(e,String(t))})}}else{var i=t===""||t===0||Array.isArray(t)&&t.length===0||t===null||t===undefined;if(i){n.searchParams.delete(e)}else{n.searchParams.set(e,String(t))}}window.history.pushState({},"",n.toString());o(t);YX()},[e,r]);var l=(0,n.useCallback)(()=>{var t=new URL(window.location.href);t.searchParams.delete(e);window.history.pushState({},"",t.toString());var n=r==="array"?[]:r==="number"?0:"";o(n);YX()},[e,r]);return{value:a,setValue:s,remove:l}};// CONCATENATED MODULE: ./addons/content-bank/assets/react/manage-contents/components/FilterFields.tsx
function Y0(){var e=eg(["\n      padding-right: ",";\n    "]);Y0=function t(){return e};return e}var Y1=e=>{var{onFilterChange:r,initialValues:i}=e;var a=h1({defaultValues:i||{contentTypes:[],order:"asc"}});var[o,s]=(0,n.useState)(false);var l=(0,n.useRef)(null);var u=a.watch("order")||"asc";var c=a.watch("contentTypes")||[];var d=[{label:(0,em.__)("Lesson","tutor-pro"),value:"lesson"},...(0,ej/* .isAddonEnabled */.GR)(aT/* .Addons.TUTOR_ASSIGNMENTS */.oW.TUTOR_ASSIGNMENTS)?[{label:(0,em.__)("Assignment","tutor-pro"),value:"assignment"}]:[],{label:(0,em.__)("Question","tutor-pro"),value:"question"}];return/*#__PURE__*/(0,t/* .jsxs */.FD)(t/* .Fragment */.FK,{children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:Y6.wrapper,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:c.length>0,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{size:"small",variant:"text",buttonCss:Y6.clearButton,onClick:()=>{a.reset({contentTypes:[],order:"asc"});r(a.getValues())},children:(0,em.__)("Clear All","tutor-pro")})}),/*#__PURE__*/(0,t/* .jsxs */.FD)(eb/* ["default"] */.A,{ref:l,variant:"tertiary",size:aT/* .CURRENT_VIEWPORT.isAboveMobile */.vN.isAboveMobile?"regular":"small",icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"mageFilter",height:16,width:16}),buttonCss:Y6.filterButton({hasFilters:c.length>0}),onClick:()=>s(e=>!e),children:[/*#__PURE__*/(0,t/* .jsx */.Y)("span",{children:(0,em.__)("Filters","tutor-pro")}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:c.length>0,children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:Y6.filterCount,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:Y6.divider}),/*#__PURE__*/(0,t/* .jsx */.Y)("span",{children:c.length})]})})]}),/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"tertiary",size:aT/* .CURRENT_VIEWPORT.isAboveMobile */.vN.isAboveMobile?"regular":"small",isIconOnly:true,icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:u==="asc"?"sortASC":"sortDESC",width:18,height:18}),buttonCss:Y6.sortButton,onClick:()=>{var e=u==="asc"?"desc":"asc";a.setValue("order",e);r(ev(ep({},a.getValues()),{order:e}))},"aria-label":(0,em.__)("Order by","tutor-pro")})]}),/*#__PURE__*/(0,t/* .jsx */.Y)(a7,{isOpen:o,animationType:as.slideDown,closeOnEscape:true,closePopover:()=>{a.reset({contentTypes:(i===null||i===void 0?void 0:i.contentTypes)||[],order:(i===null||i===void 0?void 0:i.order)||"asc"});s(false)},triggerRef:l,maxWidth:"170px",children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:Y6.filterFieldsWrapper,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("h6",{children:(0,em.__)("Filter by","tutor-pro")}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:Y6.filterFields,children:/*#__PURE__*/(0,t/* .jsx */.Y)(fb,{each:d,children:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(ou,{label:e.label,value:e.value,checked:c.includes(e.value),onChange:t=>{var r=t?[...c,e.value]:c.filter(t=>t!==e.value);a.setValue("contentTypes",r)}},e.value)})}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:Y6.filterActions,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{size:"small",variant:"primary",onClick:()=>{r(a.getValues());s(false)},children:(0,em.__)("Apply Filters","tutor-pro")})})]})})]})};/* ESM default export */const Y2=Y1;var Y6={wrapper:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),";gap:",ey/* .spacing["8"] */.YK["8"],";flex-shrink:0;"),filterButton:e=>{var{hasFilters:t=false}=e;return/*#__PURE__*/(0,o/* .css */.AH)("height:40px;padding-inline:",ey/* .spacing["12"] */.YK["12"]," ",ey/* .spacing["16"] */.YK["16"],";background-color:",ey/* .colorTokens.background.white */.I6.background.white,";",t&&(0,o/* .css */.AH)(Y0(),ey/* .spacing["6"] */.YK["6"])," ",ey/* .Breakpoint.mobile */.EA.mobile,"{height:32px;}")},clearButton:/*#__PURE__*/(0,o/* .css */.AH)("flex-shrink:0;"),sortButton:/*#__PURE__*/(0,o/* .css */.AH)("flex-shrink:0;background-color:",ey/* .colorTokens.background.white */.I6.background.white,";color:",ey/* .colorTokens.icon["default"] */.I6.icon["default"],";"),divider:/*#__PURE__*/(0,o/* .css */.AH)("width:1px;height:24px;background-color:",ey/* .colorTokens.stroke.divider */.I6.stroke.divider,";"),filterCount:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;gap:",ey/* .spacing["8"] */.YK["8"],";margin-left:",ey/* .spacing["8"] */.YK["8"],";span{height:28px;width:28px;",eB/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;justify-content:center;border-radius:",ey/* .borderRadius["4"] */.Vq["4"],";background-color:",ey/* .colorTokens.primary["50"] */.I6.primary["50"],";color:",ey/* .colorTokens.text.brand */.I6.text.brand,";}",ey/* .Breakpoint.mobile */.EA.mobile,"{margin-left:",ey/* .spacing["4"] */.YK["4"],";span{height:22px;width:22px;}}"),filterFieldsWrapper:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),";h6{padding:",ey/* .spacing["12"] */.YK["12"]," ",ey/* .spacing["12"] */.YK["12"]," ",ey/* .spacing["6"] */.YK["6"]," ",ey/* .spacing["12"] */.YK["12"],";",eK/* .typography.caption */.I.caption(),";color:",ey/* .colorTokens.text.hints */.I6.text.hints,";border-bottom:1px solid ",ey/* .colorTokens.stroke.divider */.I6.stroke.divider,";}"),filterFields:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),";padding:",ey/* .spacing["6"] */.YK["6"]," ",ey/* .spacing["12"] */.YK["12"]," ",ey/* .spacing["6"] */.YK["6"]," ",ey/* .spacing["16"] */.YK["16"],";gap:",ey/* .spacing["12"] */.YK["12"],";background-color:",ey/* .colorTokens.surface.tutor */.I6.surface.tutor,";border-radius:",ey/* .borderRadius["8"] */.Vq["8"],";"),filterActions:/*#__PURE__*/(0,o/* .css */.AH)("padding:",ey/* .spacing["6"] */.YK["6"]," ",ey/* .spacing["12"] */.YK["12"]," ",ey/* .spacing["12"] */.YK["12"]," ",ey/* .spacing["12"] */.YK["12"],";button{width:100%;}")};// CONCATENATED MODULE: ./addons/content-bank/assets/react/manage-contents/components/ContentList.tsx
var Y4=[{label:(0,em.__)("Bulk Action","tutor-pro"),value:""},{label:(0,em.__)("Move to","tutor-pro"),value:"move_to"},{label:(0,em.__)("Delete","tutor-pro"),value:"delete"}];var Y5=e=>{var{contents:r,collection:i}=e;var{total_record:a,per_page:o,current_page:s,total_page:l,data:u=[]}=r||{total_record:0,per_page:10,current_page:1,total_page:0,data:[]};var{setValue:c}=YZ("paged");var{value:d,setValue:f}=YZ("order");var{value:p,setValue:h}=YZ("search");var{value:v,setValue:g}=YZ("content_types",{parseAs:"array"});var[m,b]=(0,n.useState)(p);var y=oc(m);var _=y6();var{collectionId:w}=YW();var[x,A]=(0,n.useState)({title:"asc",date:"asc"});var[k,E]=(0,n.useState)([]);var[I,C]=(0,n.useState)(Y4[0]);var{showModal:Y,updateModal:T,closeModal:S}=ah();(0,n.useEffect)(()=>{h(y);if(y.length){c("1")}// eslint-disable-next-line react-hooks/exhaustive-deps
},[y,h]);var O=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:false;var t=k.map(e=>e.ID);var r=u.map(e=>e.ID);if(e){var n=u.filter(e=>!t.includes(e.ID));E([...k,...n]);return}var i=k.filter(e=>!r.includes(e.ID));E(i)};var D=()=>{return u.length>0&&u.every(e=>k.map(e=>e.ID).includes(e.ID))};var F=e=>aY(function*(){T("content-bulk-delete-modal",{isLoading:true});var t=yield _.mutateAsync({collectionId:Number(w),contentIds:e});if(t.status_code===200){E([]);C(Y4[0]);S()}})();var R=()=>aY(function*(){var e=k.map(e=>e.ID);if(I.value==="move_to"){Y({component:AN,props:{title:(0,em.__)("Move to Collection","tutor-pro"),contentIds:e},depthIndex:ey/* .zIndex.highest */.fE.highest})}if(I.value==="delete"){Y({id:"content-bulk-delete-modal",component:oH,props:{title:(0,em.__)("Delete Content","tutor-pro"),description:(0,em.__)("Are you sure you want to delete these items?","tutor-pro"),isLoading:_.isPending,onConfirm:()=>F(e)},depthIndex:ey/* .zIndex.highest */.fE.highest})}})();var P=e=>{A(t=>ev(ep({},t),{[e]:t[e]==="asc"?"desc":"asc"}))};var M=e=>{if(e==="title"){P("title");return u.sort((e,t)=>{return x.title==="asc"?e.post_title.localeCompare(t.post_title):t.post_title.localeCompare(e.post_title)})}else{P("date");return u.sort((e,t)=>{return(0,oe.dateI18n)((0,oe.getSettings)().formats.date,e.post_date)>(0,oe.dateI18n)((0,oe.getSettings)().formats.date,t.post_date)?x.date==="asc"?1:-1:x.date==="asc"?-1:1})}};var H=[{Header:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:Y7.tableLabel,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(ou,{onChange:O,checked:D(),isIndeterminate:k.length>0&&!D()}),(0,em.__)("Title","tutor-pro")]}),css:Y7.titleColumn,sortProperty:"title",Cell:e=>{return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:Y7.titleWrapper,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(ou,{onChange:()=>{var t=k.filter(t=>t.ID!==e.ID);var r=(t===null||t===void 0?void 0:t.length)===k.length;if(r){E([...t,e])}else{E(t)}},checked:k.map(e=>e.ID).includes(e.ID)}),e.post_title]})}},{Header:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:Y7.tableLabel,children:(0,em.__)("Type","tutor-pro")}),Cell:e=>{var r;return/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:Y7.type,children:(r=AP[e.post_type])!==null&&r!==void 0?r:e.post_type})}},{Header:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:Y7.tableLabel,children:(0,em.__)("Linked Courses","tutor-pro")}),Cell:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(Y3,{content:e}),css:Y7.linkedCourseColumn},{Header:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:Y7.tableLabel,children:(0,em.__)("Date","tutor-pro")}),sortProperty:"date",Cell:e=>{return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:Y7.dateWrapper,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{children:(0,oe.dateI18n)((0,oe.getSettings)().formats.date,e.post_date)}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:Y7.time,children:(0,oe.dateI18n)((0,oe.getSettings)().formats.time,e.post_date)})]})}},{Header:"",Cell:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(Y8,{content:e,collection:i})}];return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:Y7.wrapper,children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:Y7.filtersWrapper,children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:Y7.bulkActions,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(oE,{size:aT/* .CURRENT_VIEWPORT.isAboveMobile */.vN.isAboveMobile?"regular":"small",options:Y4,value:I,onChange:C,isClearable:false}),/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"primary",size:aT/* .CURRENT_VIEWPORT.isAboveMobile */.vN.isAboveMobile?"regular":"small",isOutlined:true,buttonCss:Y7.buttonCss,onClick:R,disabled:!I.value||k.length===0,children:(0,em.__)("Apply","tutor-pro")})]}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:Y7.filtersRight,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(Y2,{initialValues:{contentTypes:v||[],order:d||"desc"},onFilterChange:e=>{g(e.contentTypes);f(e.order)}}),/*#__PURE__*/(0,t/* .jsx */.Y)(eG,{value:m,onChange:b,variant:"search",placeholder:(0,em.__)("Search...","tutor-pro"),isClearable:true,size:aT/* .CURRENT_VIEWPORT.isAboveMobile */.vN.isAboveMobile?"regular":"small"})]})]}),/*#__PURE__*/(0,t/* .jsx */.Y)(o$,{columns:H,data:u,isBordered:true,isRounded:true,rowStyle:Y7.tableRow,colors:{bodyRowDefault:ey/* .colorTokens.background.white */.I6.background.white},querySortProperties:["title","date"],querySortDirections:x,onSortClick:e=>{var t=M(e);return t}}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:l>1,children:/*#__PURE__*/(0,t/* .jsx */.Y)(oK,{currentPage:s,onPageChange:e=>{c(String(e));window.scroll(0,0)},totalItems:a,itemsPerPage:o})})]})};var Y3=e=>{var{content:r}=e;var i=(0,n.useRef)(null);var[a,o]=(0,n.useState)(false);return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{ref:i,css:Y7.linkedCourses,onClick:()=>o(true),"data-cy":"linked-courses-popover",children:[r.linked_courses.total,/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:r.linked_courses.total>0,children:/*#__PURE__*/(0,t/* .jsx */.Y)(a7,{arrow:true,isOpen:a,triggerRef:i,closePopover:()=>o(false),maxWidth:"300px",children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:Y7.linkedCoursesPopover,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("h5",{children:(0,em.__)("Linked Courses:","tutor-pro")}),/*#__PURE__*/(0,t/* .jsx */.Y)("ul",{children:/*#__PURE__*/(0,t/* .jsx */.Y)(fb,{each:r.linked_courses.courses,children:e=>/*#__PURE__*/(0,t/* .jsx */.Y)("li",{children:e.post_title},e.ID)})}),/*#__PURE__*/(0,t/* .jsx */.Y)("p",{children:r.linked_courses.more_text})]})})})]})};var Y8=e=>{var{content:r,collection:i}=e;var[a,o]=(0,n.useState)(false);var{showModal:s,updateModal:l,closeModal:u}=ah();var{collectionId:c}=YW();var d=y6();var f=_d();var p={"cb-lesson":AE,"cb-assignment":_b,"cb-question":YU};var h=e=>{s({component:p[e]||AE,props:{collectionId:Number(c),contentId:r.ID,subtitle:(i===null||i===void 0?void 0:i.post_title)||""},depthIndex:ey/* .zIndex.highest */.fE.highest})};var v=()=>aY(function*(){var e=yield f.mutateAsync({contentIds:[r.ID]});if(e.status_code===200){o(false)}})();var g=e=>aY(function*(){l("content-delete-modal",{isLoading:true});var t=yield d.mutateAsync({collectionId:Number(c),contentIds:e});if(t.status_code===200){u()}})();return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:Y7.actionsWrapper,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"tertiary",size:"small",onClick:()=>h(r.post_type),children:(0,em.__)("Edit","tutor-pro")}),/*#__PURE__*/(0,t/* .jsxs */.FD)(o8,{isOpen:a,onClick:()=>o(true),closePopover:()=>o(false),dotsOrientation:"vertical",maxWidth:"170px",isInverse:true,arrow:true,closeOnEscape:false,size:"small",wrapperCss:Y7.threeDotWrapper,"data-cy":"content-actions-popover",children:[/*#__PURE__*/(0,t/* .jsx */.Y)(o8.Option,{text:(0,em.__)("Duplicate","tutor-pro"),icon:f.isPending?/*#__PURE__*/(0,t/* .jsx */.Y)(eT,{size:24}):/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{width:24,height:24,name:"copyPaste"}),disabled:f.isPending,onClick:v,"data-cy":"duplicate-content"}),/*#__PURE__*/(0,t/* .jsx */.Y)(o8.Option,{text:(0,em.__)("Move to","tutor-pro"),icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{width:24,height:24,name:"assignment"}),onClick:()=>{o(false);s({component:AN,props:{title:(0,em.__)("Move to Collection","tutor-pro"),contentIds:[r.ID]},depthIndex:ey/* .zIndex.highest */.fE.highest})},buttonCss:Y7.borderedButton,"data-cy":"move-content"}),/*#__PURE__*/(0,t/* .jsx */.Y)(o8.Option,{isTrash:true,text:(0,em.__)("Delete","tutor-pro"),icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{width:24,height:24,name:"delete"}),onClick:()=>{o(false);s({id:"content-delete-modal",component:oH,props:{title:(0,em.__)("Delete Content","tutor-pro"),description:(0,em.__)("Are you sure you want to delete this content?","tutor-pro"),isLoading:d.isPending,onConfirm:()=>g([r.ID])},depthIndex:ey/* .zIndex.highest */.fE.highest})},"data-cy":"delete-content"})]})]})};/* ESM default export */const Y9=Y5;var Y7={wrapper:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",ey/* .spacing["16"] */.YK["16"],";"),filtersWrapper:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),"    align-items:center;justify-content:space-between;flex-wrap:wrap;gap:",ey/* .spacing["16"] */.YK["16"],";"),bulkActions:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),"    align-items:center;gap:",ey/* .spacing["8"] */.YK["8"],";"),buttonCss:/*#__PURE__*/(0,o/* .css */.AH)("padding:",ey/* .spacing["8"] */.YK["8"]," ",ey/* .spacing["24"] */.YK["24"],";"),filtersRight:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),"    align-items:center;gap:",ey/* .spacing["8"] */.YK["8"],";"),tableRow:/*#__PURE__*/(0,o/* .css */.AH)("border-bottom:1px solid ",ey/* .colorTokens.border.tertiary */.I6.border.tertiary,";"),tableLabel:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.small */.I.small("regular"),";color:",ey/* .colorTokens.text.hints */.I6.text.hints,";",eB/* .styleUtils.display.flex */.x.display.flex(),"    align-items:center;gap:",ey/* .spacing["12"] */.YK["12"],";"),titleWrapper:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.caption */.I.caption("medium"),";",eB/* .styleUtils.display.flex */.x.display.flex(),"    align-items:center;gap:",ey/* .spacing["12"] */.YK["12"],";"),type:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.caption */.I.caption("regular"),";color:",ey/* .colorTokens.text.subdued */.I6.text.subdued,";"),linkedCourses:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.small */.I.small("medium"),";color:",ey/* .colorTokens.text.brand */.I6.text.brand,";cursor:pointer;"),linkedCoursesPopover:/*#__PURE__*/(0,o/* .css */.AH)("padding:",ey/* .spacing["16"] */.YK["16"],";",eK/* .typography.tiny */.I.tiny("medium"),";& > h5{",eK/* .typography.tiny */.I.tiny("medium"),";margin-bottom:",ey/* .spacing["10"] */.YK["10"],";color:",ey/* .colorTokens.text.subdued */.I6.text.subdued,";}& > ul{",eB/* .styleUtils.display.flex */.x.display.flex(),"      flex-direction:column;gap:",ey/* .spacing["8"] */.YK["8"],";padding-left:",ey/* .spacing["12"] */.YK["12"],";margin-left:0px;margin-bottom:",ey/* .spacing["10"] */.YK["10"],";color:",ey/* .colorTokens.text.title */.I6.text.title,";li{list-style:auto;}}& > p{",eK/* .typography.small */.I.small("medium"),";margin-bottom:0px;color:",ey/* .colorTokens.text.brand */.I6.text.brand,";}"),dateWrapper:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.caption */.I.caption("regular"),";color:",ey/* .colorTokens.text.title */.I6.text.title,";white-space:nowrap;"),time:/*#__PURE__*/(0,o/* .css */.AH)("color:",ey/* .colorTokens.text.subdued */.I6.text.subdued,";"),actionsWrapper:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),"    justify-content:end;align-items:center;gap:",ey/* .spacing["8"] */.YK["8"],";"),threeDotWrapper:/*#__PURE__*/(0,o/* .css */.AH)("background-color:transparent;"),paginatorWrapper:/*#__PURE__*/(0,o/* .css */.AH)("margin-top:",ey/* .spacing["16"] */.YK["16"],";"),borderedButton:/*#__PURE__*/(0,o/* .css */.AH)("border-bottom:1px solid ",ey/* .colorTokens.stroke.divider */.I6.stroke.divider,";"),titleColumn:/*#__PURE__*/(0,o/* .css */.AH)("min-width:400px;"),linkedCourseColumn:/*#__PURE__*/(0,o/* .css */.AH)("white-space:nowrap;")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/fields/FormCheckbox.tsx
var Te=e=>{var{field:r,fieldState:n,disabled:i,value:a,onChange:o,label:s,description:l,helpText:u,isHidden:c,labelCss:d}=e;return/*#__PURE__*/(0,t/* .jsx */.Y)(fv,{field:r,fieldState:n,isHidden:c,children:e=>{var{css:n}=e,c=(0,eJ._)(e,["css"]);return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:Tr.wrapper,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(ou,(0,eX._)((0,e$._)({},r,c),{inputCss:n,labelCss:d,value:a,disabled:i,checked:r.value,label:s,onChange:()=>{r.onChange(!r.value);if(o){o(!r.value)}}})),u&&/*#__PURE__*/(0,t/* .jsx */.Y)(d9,{content:u,placement:"top",allowHTML:true,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"info",width:20,height:20})})]}),l&&/*#__PURE__*/(0,t/* .jsx */.Y)("p",{css:Tr.description,children:l})]})}})};/* ESM default export */const Tt=Te;var Tr={wrapper:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;align-items:center;gap:",ey/* .spacing["6"] */.YK["6"],";& > div{display:flex;color:",ey/* .colorTokens.icon["default"] */.I6.icon["default"],";}"),description:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.small */.I.small(),"    color:",ey/* .colorTokens.text.hints */.I6.text.hints,";padding-left:30px;margin-top:",ey/* .spacing["6"] */.YK["6"],";")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/modals/CourseListModal/SearchField.tsx
var Tn=e=>{var{onFilterItems:r}=e;var i=h1({defaultValues:{search:""}});var a=oc(i.watch("search"));(0,n.useEffect)(()=>{r((0,e$._)({},a.length>0&&{search:a}))},[r,a]);return/*#__PURE__*/(0,t/* .jsx */.Y)(py,{control:i.control,name:"search",render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(ya,(0,eX._)((0,e$._)({},e),{content:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"search",width:24,height:24}),placeholder:(0,em.__)("Search...","tutor-pro"),showVerticalBar:false}))})};/* ESM default export */const Ti=Tn;// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/services/course.ts
var Ta=e=>{return mX.get(mZ.GET_COURSE_LIST,{params:e})};var To=e=>{var{params:t,isEnabled:r}=e;return yX({queryKey:["PrerequisiteCourses",t],queryFn:()=>Ta((0,e$._)({exclude:t.exclude,limit:t.limit,offset:t.offset,filter:t.filter},t.post_status&&{post_status:t.post_status})).then(e=>e.data),placeholderData:I,enabled:r})};var Ts=e=>{var{courseId:t,builder:r}=e;return wpAjaxInstance.post(endpoints.TUTOR_UNLINK_PAGE_BUILDER,{course_id:t,builder:r})};var Tl=()=>{return useMutation({mutationFn:Ts})};var Tu=e=>{return mX.get(mZ.BUNDLE_LIST,{params:e})};var Tc=e=>{var{params:t,isEnabled:r}=e;return yX({queryKey:["PrerequisiteCourses",t],queryFn:()=>Tu((0,e$._)({exclude:t.exclude,limit:t.limit,offset:t.offset,filter:t.filter},t.post_status&&{post_status:t.post_status})).then(e=>e.data),placeholderData:I,enabled:r})};// CONCATENATED MODULE: ../tutor/assets/react/v3/public/images/course-placeholder.png
const Td=r.p+"images/course-placeholder-3ae4bdaf.png";// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/modals/CourseListModal/CourseListTable.tsx
var Tf=e=>{var{form:r,type:i="courses"}=e;var a,o,s,l;var{pageInfo:u,onPageChange:c,itemsPerPage:d,offset:f,onFilterItems:p}=AC();var h=(0,n.useMemo)(()=>r.watch(i)||[],[r,i]);var v=(0,n.useMemo)(()=>h.map(e=>e.id),[h]);var g=(0,n.useMemo)(()=>({offset:f,limit:d,filter:u.filter,post_status:"any",exclude:[]}),[f,d,u.filter]);var m=To({params:g,isEnabled:i==="courses"});var b=Tc({params:g,isEnabled:i==="course-bundle"});var y=(0,n.useMemo)(()=>{var e,t;var r,n;return i==="courses"?(r=(e=m.data)===null||e===void 0?void 0:e.results)!==null&&r!==void 0?r:[]:(n=(t=b.data)===null||t===void 0?void 0:t.results)!==null&&n!==void 0?n:[]},[i,(a=m.data)===null||a===void 0?void 0:a.results,(o=b.data)===null||o===void 0?void 0:o.results]);var _=(0,n.useMemo)(()=>y.map(e=>e.id),[y]);var w=(0,n.useMemo)(()=>y.length>0&&y.every(e=>v.includes(e.id)),[y,v]);var x=(0,n.useCallback)(e=>{if(e){// Add all fetched items that aren't already selected
var t=y.filter(e=>!v.includes(e.id));r.setValue(i,[...h,...t])}else{// Keep only items that aren't in the current view
var n=h.filter(e=>!_.includes(e.id));r.setValue(i,n)}},[y,v,_,h,r,i]);var A=(0,n.useCallback)(e=>{var t=v.includes(e.id);if(t){r.setValue(i,h.filter(t=>t.id!==e.id))}else{r.setValue(i,[...h,e])}},[v,h,r,i]);var k=(0,n.useMemo)(()=>[{Header:y.length?/*#__PURE__*/(0,t/* .jsx */.Y)(ou,{onChange:x,checked:!(m.isLoading||m.isRefetching)&&w,label:(0,em.__)("Name","tutor-pro"),labelCss:Th.checkboxLabel,"aria-label":(0,em.__)("Select all items","tutor-pro")}):"#",Cell:e=>/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:Th.checkboxWrapper,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(ou,{onChange:()=>A(e),checked:v.includes(e.id),"aria-label":"".concat((0,em.__)("Select","tutor-pro")," ").concat(e.title)}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:Th.courseItemWrapper,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("img",{src:e.image||Td,css:Th.thumbnail,alt:e.title||(0,em.__)("Course item","tutor-pro")}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:Th.title,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{children:e.title}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:i==="course-bundle"&&(e===null||e===void 0?void 0:e.total_courses),children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{children:/* translators: %d is the total number of courses */(0,em.sprintf)((0,em.__)("Total Courses: %d","tutor-pro"),e.total_courses||0)})})]})]})]})}],[y.length,x,m.isLoading,m.isRefetching,w,A,v,i]);if(m.isLoading||b.isLoading){return/*#__PURE__*/(0,t/* .jsx */.Y)(eI,{"aria-label":(0,em.__)("Loading","tutor-pro")})}if(!m.data&&!b.data){return/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:Th.errorMessage,role:"alert","aria-live":"assertive",children:(0,em.__)("Something went wrong","tutor-pro")})}var E,I;var C=i==="courses"?(E=(s=m.data)===null||s===void 0?void 0:s.total_items)!==null&&E!==void 0?E:0:(I=(l=b.data)===null||l===void 0?void 0:l.total_items)!==null&&I!==void 0?I:0;return/*#__PURE__*/(0,t/* .jsxs */.FD)(t/* .Fragment */.FK,{children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:Th.tableActions,children:/*#__PURE__*/(0,t/* .jsx */.Y)(Ti,{onFilterItems:p})}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:Th.tableWrapper,children:/*#__PURE__*/(0,t/* .jsx */.Y)(o$,{columns:k,data:y,itemsPerPage:d,loading:m.isFetching||m.isRefetching})}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:Th.paginatorWrapper,children:/*#__PURE__*/(0,t/* .jsx */.Y)(oK,{currentPage:u.page,onPageChange:c,totalItems:C,itemsPerPage:d})})]})};/* ESM default export */const Tp=/*#__PURE__*/i().memo(Tf);var Th={tableLabel:/*#__PURE__*/(0,o/* .css */.AH)("text-align:left;"),tablePriceLabel:/*#__PURE__*/(0,o/* .css */.AH)("text-align:right;"),tableActions:/*#__PURE__*/(0,o/* .css */.AH)("padding:",ey/* .spacing["20"] */.YK["20"],";"),tableWrapper:/*#__PURE__*/(0,o/* .css */.AH)("max-height:calc(100vh - 350px);overflow:auto;"),checkboxWrapper:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;align-items:center;gap:",ey/* .spacing["12"] */.YK["12"],";"),checkboxLabel:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.body */.I.body(),";color:",ey/* .colorTokens.text.primary */.I6.text.primary,";"),paginatorWrapper:/*#__PURE__*/(0,o/* .css */.AH)("margin:",ey/* .spacing["20"] */.YK["20"]," ",ey/* .spacing["16"] */.YK["16"],";"),courseItemWrapper:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;align-items:center;gap:",ey/* .spacing["16"] */.YK["16"],";"),bundleBadge:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.tiny */.I.tiny(),";display:inline-block;padding:0px ",ey/* .spacing["8"] */.YK["8"],";background-color:#9342e7;color:",ey/* .colorTokens.text.white */.I6.text.white,";border-radius:",ey/* .borderRadius["40"] */.Vq["40"],";"),subscriptionBadge:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.tiny */.I.tiny(),";display:flex;align-items:center;width:fit-content;padding:0px ",ey/* .spacing["6"] */.YK["6"]," 0px ",ey/* .spacing["4"] */.YK["4"],";background-color:",ey/* .colorTokens.color.warning["90"] */.I6.color.warning["90"],";color:",ey/* .colorTokens.text.white */.I6.text.white,";border-radius:",ey/* .borderRadius["40"] */.Vq["40"],";"),selectedBadge:/*#__PURE__*/(0,o/* .css */.AH)("margin-left:",ey/* .spacing["4"] */.YK["4"],";",eK/* .typography.tiny */.I.tiny(),";padding:",ey/* .spacing["4"] */.YK["4"]," ",ey/* .spacing["8"] */.YK["8"],";background-color:",ey/* .colorTokens.background.disable */.I6.background.disable,";color:",ey/* .colorTokens.text.title */.I6.text.title,";border-radius:",ey/* .borderRadius["2"] */.Vq["2"],";white-space:nowrap;"),title:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.caption */.I.caption(),";color:",ey/* .colorTokens.text.primary */.I6.text.primary,";",eB/* .styleUtils.text.ellipsis */.x.text.ellipsis(2),";text-wrap:pretty;div:is(:last-of-type):not(:only-of-type){margin-top:",ey/* .spacing["4"] */.YK["4"],";",eK/* .typography.small */.I.small("medium"),";color:",ey/* .colorTokens.text.hints */.I6.text.hints,";}"),thumbnail:/*#__PURE__*/(0,o/* .css */.AH)("width:76px;height:48px;border-radius:",ey/* .borderRadius["4"] */.Vq["4"],";object-fit:cover;object-position:center;"),priceWrapper:/*#__PURE__*/(0,o/* .css */.AH)("min-width:200px;text-align:right;[data-button]{display:none;}"),price:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.caption */.I.caption(),";display:flex;gap:",ey/* .spacing["4"] */.YK["4"],";justify-content:end;"),startingFrom:/*#__PURE__*/(0,o/* .css */.AH)("color:",ey/* .colorTokens.text.hints */.I6.text.hints,";"),discountPrice:/*#__PURE__*/(0,o/* .css */.AH)("text-decoration:line-through;color:",ey/* .colorTokens.text.subdued */.I6.text.subdued,";"),errorMessage:/*#__PURE__*/(0,o/* .css */.AH)("height:100px;display:flex;align-items:center;justify-content:center;")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/modals/CourseListModal/index.tsx
function Tv(e){var{title:r,closeModal:n,actions:i,form:a,type:o="courses"}=e;var s=a.getValues(o)||[];var l=h1({defaultValues:{courses:s,"course-bundle":s}});var u=(o==="courses"?l.watch("courses"):l.watch("course-bundle"))||[];var c=()=>{var e=l.getValues(o)||[];a.setValue(o,[...e]);l.setValue(o,[]);n({action:"CONFIRM"})};return/*#__PURE__*/(0,t/* .jsxs */.FD)(oR,{onClose:()=>n({action:"CLOSE"}),title:/* translators: %s is the number of selected items */u.length>0?(0,em.sprintf)((0,em.__)("%s selected","tutor-pro"),u.length):r,actions:i,maxWidth:720,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(Tp,{form:l,type:o}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:Tm.footer,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{size:"small",variant:"text",onClick:()=>n({action:"CLOSE"}),children:(0,em.__)("Cancel","tutor-pro")}),/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{size:"small",variant:"primary",onClick:c,disabled:u.length===0,"data-cy":"add-courses",children:(0,em.__)("Add","tutor-pro")})]})]})}/* ESM default export */const Tg=Tv;var Tm={footer:/*#__PURE__*/(0,o/* .css */.AH)("box-shadow:0px 1px 0px 0px #e4e5e7 inset;height:56px;display:flex;align-items:center;justify-content:end;gap:",ey/* .spacing["16"] */.YK["16"],";padding-inline:",ey/* .spacing["16"] */.YK["16"],";")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/modals/ImportErrorListModal.tsx
var Tb=e=>{var{errors:r,closeModal:n}=e;var i={topics:(0,em.__)("Topic","tutor-pro"),lesson:(0,em.__)("Lesson","tutor-pro"),tutor_quiz:(0,em.__)("Quiz","tutor-pro"),tutor_assignments:(0,em.__)("Assignment","tutor-pro"),"cb-question":(0,em.__)("Content Bank Question","tutor-pro"),"cb-lesson":(0,em.__)("Content Bank Lesson","tutor-pro"),"cb-assignment":(0,em.__)("Content Bank Assignment","tutor-pro")};var a=[{Header:"#",Cell:(e,r)=>/*#__PURE__*/(0,t/* .jsx */.Y)("span",{css:T_.index,children:r+1}),width:"50px"},{Header:(0,em.__)("Title","tutor-pro"),Cell:e=>/*#__PURE__*/(0,t/* .jsx */.Y)("span",{children:e})}];var o=(e,r)=>{if(!r.length)return null;return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:T_.errors,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("h4",{css:eK/* .typography.body */.I.body("medium"),children:e}),/*#__PURE__*/(0,t/* .jsx */.Y)(o$,{columns:a,data:r,isBordered:true,isRounded:true,headerHeight:40})]})};return/*#__PURE__*/(0,t/* .jsx */.Y)(oR,{title:(0,em.__)("Import Errors","tutor-pro"),subtitle:(0,em.__)("Error occurred in the following items","tutor-pro"),onClose:n,icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"warning",height:24,width:24}),maxWidth:700,children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:T_.wrapper,children:(0,ej/* .getObjectEntries */.w9)(r||{}).map(e=>{var[t,r=[]]=e;var n=t;var a;var s=(a=i[n])!==null&&a!==void 0?a:t;return o(s,r)})})})};/* ESM default export */const Ty=Tb;var T_={wrapper:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),"    gap:",ey/* .spacing["20"] */.YK["20"],";padding:",ey/* .spacing["16"] */.YK["16"]," ",ey/* .spacing["24"] */.YK["24"]," ",ey/* .spacing["24"] */.YK["24"]," ",ey/* .spacing["24"] */.YK["24"],";max-height:90vh;",eB/* .styleUtils.overflowYAuto */.x.overflowYAuto,"    table{th{",eK/* .typography.caption */.I.caption("medium"),";}td{padding:",ey/* .spacing["8"] */.YK["8"]," ",ey/* .spacing["12"] */.YK["12"],";",eK/* .typography.caption */.I.caption(),";}}"),index:/*#__PURE__*/(0,o/* .css */.AH)("text-align:center;color:",ey/* .colorTokens.text.hints */.I6.text.hints,";"),errors:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),"    gap:",ey/* .spacing["8"] */.YK["8"],";")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/services/import-export.ts
var Tw=e=>{var{course_ids:t,context:r}=e;return mX.get(mZ.GET_EXPORTABLE_CONTENT,{params:(0,e$._)({course_ids:t},r?{context:r}:{})})};var Tx=function(){var{course_ids:e,context:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var r=!!fy/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;return yX({queryKey:["ExportableContent",e,t],queryFn:()=>Tw({course_ids:e,context:t}).then(e=>e.data),enabled:r})};// CONCATENATED MODULE: ../tutor/assets/react/v3/public/images/import-export/import-error.webp
const TA=r.p+"images/import-error-6599c0e7.webp";// CONCATENATED MODULE: ../tutor/assets/react/v3/public/images/import-export/import-inprogress.webp
const Tk=r.p+"images/import-inprogress-bcfaaf30.webp";// CONCATENATED MODULE: ../tutor/assets/react/v3/public/images/import-export/import-success.webp
const TE=r.p+"images/import-success-dc81355e.webp";// CONCATENATED MODULE: ./addons/content-bank/assets/react/manage-contents/components/modals/ImportFromCoursesModal.tsx
function TI(){var e=eg(["\n      align-items: center;\n      padding: "," "," "," ",";\n      gap: ",";\n\n      img {\n        width: 109px;\n      }\n    "]);TI=function t(){return e};return e}function TC(){var e=eg(["\n      flex-direction: column;\n    "]);TC=function t(){return e};return e}var TY=e=>{var t,r,n,i,a,o;var s=e.find(e=>e.key==="courses");if(!s){return{courseCount:0,lessonCount:0,assignmentCount:0,questionsCount:0,courseIds:[]}}var l=((r=s.contents)===null||r===void 0?void 0:(t=r.find(e=>e.key==="lesson"))===null||t===void 0?void 0:t.count)||0;var u=((i=s.contents)===null||i===void 0?void 0:(n=i.find(e=>e.key==="tutor_assignments"))===null||n===void 0?void 0:n.count)||0;var c=((o=s.contents)===null||o===void 0?void 0:(a=o.find(e=>e.key==="questions"))===null||a===void 0?void 0:a.count)||0;var d=s.count||0;var f=s.ids||[];return{courseCount:d,lessonCount:l,assignmentCount:u,questionsCount:c,courseIds:f}};var TT=e=>{var{closeModal:r,onImport:i,state:a,progress:o,totalCourses:s=0,hasError:l,importedCourses:u=0,failedCourseIds:c=[],importErrors:d}=e;var f=h1({defaultValues:{courses__ids:[],courses__lesson:false,courses__tutor_quiz:false,courses__tutor_assignments:false},shouldFocusError:true});var p=h1({defaultValues:{courses:[]},shouldFocusError:true});var h=p.watch("courses");var v=h.length>0;var[g,m]=(0,n.useState)(false);var{showModal:b}=ah();var{data:y,isLoading:_}=Tx({course_ids:h.map(e=>e.id),context:"content_bank"});var w=y===null||y===void 0?void 0:y.filter(e=>e.key==="courses"&&e.count);var{courseIds:x,courseCount:A,lessonCount:k,assignmentCount:E,questionsCount:I}=TY(w||[]);var C=(e,r)=>/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:TO.labelWithCount,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("span",{children:e}),/*#__PURE__*/(0,t/* .jsxs */.FD)("span",{"data-count":true,children:["(",r,")"]})]});var Y=(e,t,r)=>{if(r===0){return(0,em.sprintf)((0,em.__)("Importing data: %1$d/%2$d","tutor-pro"),e,t)}var n=(0,em.sprintf)((0,em._n)("Failed: %d","Failed: %d",r,"tutor-pro"),r);return(0,em.sprintf)((0,em.__)("Importing data: %1$d/%2$d %3$s","tutor-pro"),e,t,n)};var T=e=>{var t={courses_ids:!v?x:h.map(e=>e.id),sub_contents:[...e.courses__lesson?["lesson"]:[],...e.courses__tutor_quiz?["tutor_quiz"]:[],...e.courses__tutor_assignments?["tutor_assignments"]:[]]};i===null||i===void 0?void 0:i(t)};var S=()=>{var e=f.watch();return x.length===0||k===0&&E===0&&I===0||e.courses__lesson===false&&e.courses__tutor_quiz===false&&e.courses__tutor_assignments===false};var O=()=>/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:!_,fallback:/*#__PURE__*/(0,t/* .jsx */.Y)(eI,{}),children:/*#__PURE__*/(0,t/* .jsxs */.FD)(t/* .Fragment */.FK,{children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:TO.wrapper,children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:TO.formHeader,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:TO.headerWithAction,children:/*#__PURE__*/(0,t/* .jsxs */.FD)(ag/* ["default"] */.A,{when:v,fallback:C((0,em.__)("All Courses","tutor-pro"),A),children:[C((0,em.__)("Selected Courses","tutor-pro"),h.length),/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"danger",size:"small",onClick:()=>p.reset(),icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"cross",width:16,height:16}),children:(0,em.__)("Clear","tutor-pro")})]})})}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{children:/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"secondary",buttonCss:TO.selectButton,size:"small","data-cy":"select-courses",onClick:()=>{b({component:Tg,props:{// @ts-ignore
    form:p,title:(0,em.__)("Select Courses","tutor-pro"),type:"courses"},depthIndex:ey/* .zIndex.highest */.fE.highest})},children:v?(0,em.__)("Edit Specific Courses","tutor-pro"):(0,em.__)("Select Specific Courses","tutor-pro")})})]}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:TO.checkboxGroup,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{children:/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{control:f.control,name:"courses__tutor_quiz",render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(Tt,ev(ep({},e),{disabled:I===0,label:C((0,em.__)("Questions","tutor-pro"),I)}))})}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{children:/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{control:f.control,name:"courses__lesson",render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(Tt,ev(ep({},e),{disabled:k===0,label:C((0,em.__)("Lessons","tutor-pro"),k)}))})}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:(0,ej/* .isAddonEnabled */.GR)(aT/* .Addons.TUTOR_ASSIGNMENTS */.oW.TUTOR_ASSIGNMENTS),children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{children:/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{control:f.control,name:"courses__tutor_assignments",render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(Tt,ev(ep({},e),{disabled:E===0,label:C((0,em.__)("Assignments","tutor-pro"),E)}))})})})]})]}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:TO.formFooter,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{onClick:()=>r({action:"CLOSE"}),variant:"text",size:"small",children:(0,em.__)("Cancel","tutor-pro")}),/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{size:"small",type:"submit",onClick:f.handleSubmit(T),disabled:S(),"data-cy":"import-from-courses",children:(0,em.__)("Import","tutor-pro")})]})]})});var D=()=>/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:TO.progress({isComplete:false}),children:[/*#__PURE__*/(0,t/* .jsx */.Y)("img",{src:Tk,alt:(0,em.__)("Importing","tutor-pro")}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:TO.progressHeader({isComplete:false}),children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:eK/* .typography.caption */.I.caption(),children:(0,em.__)("Importing","tutor-pro")}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:TO.progressCount,children:[o,"%"]})]}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:TO.progressBar({progress:o})}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:TO.progressInfo,children:u?Y(u,s,c.length):(0,em.__)("Importing in progress","tutor-pro")})]});var F=()=>/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:TO.progress({isComplete:true}),children:[/*#__PURE__*/(0,t/* .jsx */.Y)("img",{src:l?TA:TE,alt:l?(0,em.__)("Import Failed!","tutor-pro"):(0,em.__)("Import Complete!","tutor-pro")}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:TO.progressHeader({isComplete:true}),children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:TO.title,children:l?(0,em.__)("Import Failed!","tutor-pro"):(0,em.__)("Import Complete!","tutor-pro")}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:TO.subtitle,children:l?u?(0,em.__)("Some data could not be imported. Please check the details below.","tutor-pro"):(0,em.__)("No data were imported.","tutor-pro"):(0,em.__)("Content from the selected courses has been added to the Content Bank.","tutor-pro")})]}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:u,children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:TO.reportList,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:!l,children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:TO.reportWrapper,children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:TO.report,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{"data-check-icon":true,name:"checkFilledWhite",width:24,height:24}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:TO.reportInfo,children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:TO.reportLeft,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{children:(0,em.__)("Successfully Imported form","tutor-pro")}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{children:(0,em.sprintf)((0,em._nx)("%d Course","%d Courses",u||0,"imported","tutor-pro"),u||0)})]})})]})})}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:c.length>0&&!l,children:/*#__PURE__*/(0,t/* .jsxs */.FD)("button",{css:[eB/* .styleUtils.resetButton */.x.resetButton,TO.reportWrapper],onClick:()=>m(!g),children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:TO.report,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{"data-cross-icon":true,name:"crossCircle",width:28,height:28}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:TO.reportInfo,children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:TO.reportLeft,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{children:(0,em.__)("Failed to Import form","tutor-pro")}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{children:(0,em.sprintf)((0,em._nx)("%d Course","%d Courses",c.length,"failed","tutor-pro"),c.length)})]}),/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{"data-down-icon":true,name:"chevronDown",width:24,height:24})]})]}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:g,children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:TO.reportLeft,children:c.map(e=>/*#__PURE__*/(0,t/* .jsx */.Y)("span",{"data-course-id":true,children:e},e))})})]})})]})}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:TO.footer,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:Object.keys(d||{}).length>0,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"tertiary",size:"small",onClick:()=>{b({component:Ty,props:{errors:d},depthIndex:ey/* .zIndex.highest */.fE.highest})},children:(0,em.__)("Error Report","tutor-pro")})}),/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"primary",size:"small",onClick:()=>r({action:"CONFIRM"}),children:(0,em.__)("Okay","tutor-pro")})]})]});var R={initial:O,progress:D,complete:F};return/*#__PURE__*/(0,t/* .jsx */.Y)(oR,{title:a==="initial"&&(0,em.__)("Import from Courses","tutor-pro"),onClose:()=>r({action:"CLOSE"}),entireHeader:(a==="progress"||a==="complete")&&/*#__PURE__*/(0,t/* .jsx */.Y)(t/* .Fragment */.FK,{children:" "}),icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"import",width:24,height:24}),maxWidth:a==="initial"?600:500,isCloseAble:a!=="progress",children:R[a]()})};/* ESM default export */const TS=TT;var TO={wrapper:/*#__PURE__*/(0,o/* .css */.AH)("margin:",ey/* .spacing["16"] */.YK["16"]," ",ey/* .spacing["20"] */.YK["20"],";padding:",ey/* .spacing["16"] */.YK["16"],";border-radius:",ey/* .spacing["12"] */.YK["12"],";border:1px solid ",ey/* .colorTokens.stroke.divider */.I6.stroke.divider,";"),formHeader:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),";justify-content:space-between;align-items:center;margin-bottom:",ey/* .spacing["10"] */.YK["10"],";"),headerWithAction:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("row"),";align-items:center;gap:",ey/* .spacing["8"] */.YK["8"],";"),selectButton:/*#__PURE__*/(0,o/* .css */.AH)("background-color:",ey/* .colorTokens.background.white */.I6.background.white,";"),labelWithCount:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.caption */.I.caption(),";[data-count]{color:",ey/* .colorTokens.text.hints */.I6.text.hints,";margin-left:",ey/* .spacing["2"] */.YK["2"],";}"),checkboxGroup:/*#__PURE__*/(0,o/* .css */.AH)("display:grid;grid-template-columns:1fr 1fr 1fr;padding:",ey/* .spacing["16"] */.YK["16"],";gap:",ey/* .spacing["8"] */.YK["8"],";flex-wrap:wrap;width:100%;border:1px solid ",ey/* .colorTokens.stroke.divider */.I6.stroke.divider,";border-radius:",ey/* .borderRadius["8"] */.Vq["8"],";"),formFooter:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),";justify-content:flex-end;gap:",ey/* .spacing["16"] */.YK["16"],";border-top:1px solid ",ey/* .colorTokens.stroke.divider */.I6.stroke.divider,";padding:",ey/* .spacing["16"] */.YK["16"],";"),progress:e=>{var{isComplete:t=false}=e;return/*#__PURE__*/(0,o/* .css */.AH)("width:100%;",eB/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",ey/* .spacing["4"] */.YK["4"],";padding:",ey/* .spacing["32"] */.YK["32"]," 91px ",ey/* .spacing["48"] */.YK["48"]," 91px;img{align-self:center;width:82px;height:'auto';object-fit:contain;object-position:center;margin-bottom:",ey/* .spacing["36"] */.YK["36"],";}",t&&(0,o/* .css */.AH)(TI(),ey/* .spacing["32"] */.YK["32"],ey/* .spacing["32"] */.YK["32"],ey/* .spacing["48"] */.YK["48"],ey/* .spacing["32"] */.YK["32"],ey/* .spacing["24"] */.YK["24"]))},progressHeader:e=>{var{isComplete:t=true}=e;return/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),";justify-content:space-between;",t&&(0,o/* .css */.AH)(TC()))},progressCount:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.flexCenter */.x.flexCenter(),";",eK/* .typography.tiny */.I.tiny("bold"),";padding:",ey/* .spacing["2"] */.YK["2"]," ",ey/* .spacing["8"] */.YK["8"],";background-color:",ey/* .colorTokens.background.status.success */.I6.background.status.success,";color:",ey/* .colorTokens.text.success */.I6.text.success,";border-radius:",ey/* .borderRadius["12"] */.Vq["12"],";"),progressBar:e=>{var{progress:t=0}=e;return/*#__PURE__*/(0,o/* .css */.AH)("position:relative;width:100%;height:6px;background-color:",ey/* .colorTokens.color.black["10"] */.I6.color.black["10"],";border-radius:",ey/* .borderRadius["50"] */.Vq["50"],";overflow:hidden;&::after{content:'';position:absolute;top:0;left:0;width:100%;height:100%;background-color:",ey/* .colorTokens.bg.success */.I6.bg.success,";border-radius:",ey/* .borderRadius["50"] */.Vq["50"],";transition:width 0.3s ease-in;width:",t,"%;}")},progressInfo:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.small */.I.small(),";color:",ey/* .colorTokens.text.subdued */.I6.text.subdued,";"),reportList:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",ey/* .spacing["8"] */.YK["8"],";width:100%;"),reportWrapper:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",ey/* .spacing["12"] */.YK["12"],";background-color:",ey/* .colorTokens.primary["30"] */.I6.primary["30"],";border-radius:",ey/* .borderRadius["6"] */.Vq["6"],";padding:",ey/* .spacing["8"] */.YK["8"]," ",ey/* .spacing["12"] */.YK["12"],";"),report:/*#__PURE__*/(0,o/* .css */.AH)("width:100%;",eB/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;gap:",ey/* .spacing["12"] */.YK["12"],";[data-check-icon]{color:",ey/* .colorTokens.icon.success */.I6.icon.success,";flex-shrink:0;}[data-cross-icon]{color:",ey/* .colorTokens.icon.error */.I6.icon.error,";flex-shrink:0;}[data-down-icon]{color:",ey/* .colorTokens.icon["default"] */.I6.icon["default"],";flex-shrink:0;}"),title:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.heading6 */.I.heading6("medium"),";text-align:center;"),subtitle:/*#__PURE__*/(0,o/* .css */.AH)(eK/* .typography.caption */.I.caption(),";color:",ey/* .colorTokens.text.subdued */.I6.text.subdued,";text-align:center;"),footer:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),";gap:",ey/* .spacing["8"] */.YK["8"],";"),reportInfo:/*#__PURE__*/(0,o/* .css */.AH)("width:100%;",eB/* .styleUtils.display.flex */.x.display.flex(),";justify-content:space-between;align-items:center;"),reportLeft:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("row"),";align-items:center;gap:",ey/* .spacing["8"] */.YK["8"],";flex-wrap:wrap;div:first-of-type{",eK/* .typography.small */.I.small(),";color:",ey/* .colorTokens.text.title */.I6.text.title,";}div:last-of-type{",eK/* .typography.small */.I.small("medium"),";color:",ey/* .colorTokens.text.primary */.I6.text.primary,";}[data-course-id]{",eK/* .typography.caption */.I.caption(),";color:",ey/* .colorTokens.text.subdued */.I6.text.subdued,";padding:",ey/* .spacing["4"] */.YK["4"]," ",ey/* .spacing["8"] */.YK["8"],";border-radius:",ey/* .borderRadius["4"] */.Vq["4"],";background-color:",ey/* .colorTokens.background.white */.I6.background.white,";}")};// CONCATENATED MODULE: ./addons/content-bank/assets/react/manage-contents/assets/images/empty-state-content-2x.webp
const TD=r.p+"images/empty-state-content-2x-ce2b4891.webp";// CONCATENATED MODULE: ./addons/content-bank/assets/react/manage-contents/assets/images/empty-state-content.webp
const TF=r.p+"images/empty-state-content-08ff97d3.webp";// CONCATENATED MODULE: ./addons/content-bank/assets/react/manage-contents/components/CollectionDetails.tsx
var TR="250px";var TP=1;var TM=()=>{var e;var{collectionId:r}=YW();var{value:i}=YZ("paged");var{value:a}=YZ("order");var{value:o}=YZ("search");var{value:s}=YZ("content_types",{parseAs:"array"});var[l,u]=(0,n.useState)(null);var c=(0,n.useRef)(null);var d=(0,n.useRef)(null);var f=ec();var p={};var h=AR(ep({collection_id:r,per_page:Number(fy/* .tutorConfig.settings.pagination_per_page */.P.settings.pagination_per_page||10)},a&&{order:a===null||a===void 0?void 0:a.toUpperCase()},i&&{page:i},o&&{search:o},s&&{content_types:s}));var v=_v();var{showModal:g,updateModal:m}=ah();var b=(0,n.useMemo)(()=>h===null||h===void 0?void 0:h.data,[h.data]);if(h.isLoading){return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:TN.wrapper,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eM,{width:"50%",height:40,animation:true}),/*#__PURE__*/(0,t/* .jsx */.Y)(eM,{width:"100%",height:247,animation:true})]})}var y=[{key:"question",icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"quiz",width:24,height:24}),label:(0,em.__)("Question","tutor-pro"),onClick:()=>{w("cb-question");u(null)},show:e=>e==="empty_state"},{key:"lesson",icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"lesson",width:24,height:24}),label:(0,em.__)("Lesson","tutor-pro"),onClick:()=>{w("cb-lesson");u(null)},show:()=>true},{key:"assignment",icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"assignment",width:24,height:24}),label:(0,em.__)("Assignment","tutor-pro"),onClick:()=>{w("cb-assignment");u(null)},show:()=>(0,ej/* .isAddonEnabled */.GR)(aT/* .Addons.TUTOR_ASSIGNMENTS */.oW.TUTOR_ASSIGNMENTS)},{key:"import",icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"import",width:24,height:24}),label:(0,em.__)("Import from Courses","tutor-pro"),onClick:()=>{w("import");u(null)},bordered:true,show:()=>true}];var _=e=>/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:TN.popoverOptionWrapper,children:y.filter(t=>t.show?t.show(e):true).map(e=>/*#__PURE__*/(0,t/* .jsxs */.FD)("button",{type:"button",css:[TN.popoverOption,e.bordered&&TN.borderedOption],onClick:e.onClick,"data-cy":"".concat(e.key,"-content-modal"),children:[e.icon,/*#__PURE__*/(0,t/* .jsx */.Y)("span",{children:e.label})]},e.key))});var w=e=>{switch(e){case"cb-question":var t;g({component:YU,props:{collectionId:Number(r),subtitle:(b===null||b===void 0?void 0:(t=b.collection)===null||t===void 0?void 0:t.post_title)||(0,em.__)("Add Question","tutor-pro")},depthIndex:ey/* .zIndex.highest */.fE.highest});break;case"cb-lesson":var n;g({component:AE,props:{collectionId:Number(r),subtitle:(b===null||b===void 0?void 0:(n=b.collection)===null||n===void 0?void 0:n.post_title)||(0,em.__)("Add Lesson","tutor-pro")},depthIndex:ey/* .zIndex.highest */.fE.highest});break;case"cb-assignment":var i;g({component:_b,props:{collectionId:Number(r),subtitle:(b===null||b===void 0?void 0:(i=b.collection)===null||i===void 0?void 0:i.post_title)||(0,em.__)("Add Assignment","tutor-pro")},depthIndex:ey/* .zIndex.highest */.fE.highest});break;case"import":g({id:"import-from-courses-modal",component:TS,props:{state:"initial",progress:50,onImport:e=>{x(e)}},depthIndex:ey/* .zIndex.highest */.fE.highest});break}};var x=e=>aY(function*(){var t;if(!r)return;m("import-from-courses-modal",{state:"progress",progress:0});var n=e.courses_ids;var i=[];var a=0;var o=false;var s=(e,t)=>Array.from({length:Math.ceil(e.length/t)},(r,n)=>e.slice(n*t,n*t+t));var l=s(n,TP);for(var u=0;u<l.length;u++){var c=l[u];try{var d,h;var g=yield v.mutateAsync(ev(ep({collection_id:Number(r)},e),{courses_ids:c}));var b;var y=(b=g===null||g===void 0?void 0:(d=g.data)===null||d===void 0?void 0:d.failed_courses)!==null&&b!==void 0?b:[];var _=c.length-y.length;a+=_;if(y.length){i.push(...y);o=true}p=(g===null||g===void 0?void 0:(h=g.data)===null||h===void 0?void 0:h.errors)||{};m("import-from-courses-modal",{state:"progress",progress:Math.round((u+1)/l.length*100),failedCourseIds:i,totalCourses:n.length,importedCourses:a})}catch(e){i.push(...c);o=true;m("import-from-courses-modal",{state:"progress",progress:Math.round((u+1)/l.length*100),failedCourseIds:i,totalCourses:n.length,importedCourses:a})}}m("import-from-courses-modal",{state:"complete",progress:100,importedCourses:a,failedCourseIds:i,hasError:i.length===n.length&&o||!!((t=v.data)===null||t===void 0?void 0:t.data.errors),onImport:e=>x(e),importErrors:p});f.invalidateQueries({queryKey:["ContentBankContents"]});f.invalidateQueries({queryKey:["ContentBankCollectionsInfinity"]})})();return/*#__PURE__*/(0,t/* .jsxs */.FD)(t/* .Fragment */.FK,{children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:TN.wrapper,children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:TN.titleWrapper,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("h5",{children:b===null||b===void 0?void 0:(e=b.collection)===null||e===void 0?void 0:e.post_title}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:TN.titleActions,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{size:aT/* .CURRENT_VIEWPORT.isAboveMobile */.vN.isAboveMobile?"regular":"small",variant:"primary",onClick:()=>w("cb-question"),buttonCss:TN.addQuestionButton,"data-cy":"question-content-modal",children:(0,em.__)("Add Question","tutor-pro")}),/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{ref:d,size:aT/* .CURRENT_VIEWPORT.isAboveMobile */.vN.isAboveMobile?"regular":"small",variant:"tertiary",buttonCss:TN.plusButtonCss,onClick:()=>u("header"),"data-cy":"content-create-popover",children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"plus",height:24,width:24})})]})]}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:!b||Number(b.collection.count_stats.total)===0,fallback:/*#__PURE__*/(0,t/* .jsx */.Y)(Y9,{contents:b,collection:b===null||b===void 0?void 0:b.collection}),children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:TN.emptyStateWrapper,children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:TN.emptyState,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("h6",{children:(0,em.__)("Add and manage reusable content","tutor-pro")}),/*#__PURE__*/(0,t/* .jsx */.Y)("p",{children:(0,em.__)("Create quizzes, lessons, and assignments once and reuse them across your courses.","tutor-pro")}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{"data-actions":true,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{ref:c,size:aT/* .CURRENT_VIEWPORT.isAboveMobile */.vN.isAboveMobile?"regular":"small",variant:"primary",icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"plus",height:24,width:24}),onClick:()=>u("empty_state"),buttonCss:TN.addButtonCss,children:(0,em.__)("Add","tutor-pro")})})]}),/*#__PURE__*/(0,t/* .jsx */.Y)("img",{src:TF,srcSet:"".concat(TF," 1x, ").concat(TD," 2x"),alt:(0,em.__)("An empty state illustration for content bank","tutor-pro")})]})})]}),/*#__PURE__*/(0,t/* .jsx */.Y)(a7,{isOpen:l==="header",closePopover:()=>u(null),placement:aq.BOTTOM_RIGHT,triggerRef:d,maxWidth:TR,animationType:as.slideDown,children:_("header")}),/*#__PURE__*/(0,t/* .jsx */.Y)(a7,{isOpen:l==="empty_state",closePopover:()=>u(null),placement:aq.BOTTOM_LEFT,triggerRef:c,maxWidth:TR,animationType:as.slideDown,children:_("empty_state")})]})};/* ESM default export */const TH=TM;var TN={wrapper:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),";width:100%;gap:",ey/* .spacing["16"] */.YK["16"],";padding:",ey/* .spacing["16"] */.YK["16"]," ",ey/* .spacing["0"] */.YK["0"]," ",ey/* .spacing["16"] */.YK["16"]," ",ey/* .spacing["32"] */.YK["32"],";",ey/* .Breakpoint.mobile */.EA.mobile,"{padding:",ey/* .spacing["16"] */.YK["16"]," ",ey/* .spacing["0"] */.YK["0"],";}h5{",eK/* .typography.heading5 */.I.heading5("medium"),";}",ey/* .Breakpoint.mobile */.EA.mobile,"{padding:",ey/* .spacing["8"] */.YK["8"]," 1px;h5{",eK/* .typography.heading6 */.I.heading6("medium"),";}}"),titleWrapper:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:",ey/* .spacing["16"] */.YK["16"],";"),titleActions:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;align-items:center;flex-wrap:wrap;gap:",ey/* .spacing["8"] */.YK["8"],";"),plusButtonCss:/*#__PURE__*/(0,o/* .css */.AH)("padding:",ey/* .spacing["8"] */.YK["8"]," ",ey/* .spacing["10"] */.YK["10"],";background-color:",ey/* .colorTokens.background.white */.I6.background.white,";"),addQuestionButton:/*#__PURE__*/(0,o/* .css */.AH)("padding-inline:",ey/* .spacing["16"] */.YK["16"],";"),addButtonCss:/*#__PURE__*/(0,o/* .css */.AH)("padding-inline:",ey/* .spacing["16"] */.YK["16"]," ",ey/* .spacing["20"] */.YK["20"],";"),emptyStateWrapper:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),";gap:",ey/* .spacing["24"] */.YK["24"],";width:100%;align-items:center;justify-content:space-between;padding:42px ",ey/* .spacing["56"] */.YK["56"]," 42px ",ey/* .spacing["32"] */.YK["32"],";background-color:",ey/* .colorTokens.background.white */.I6.background.white,";border-radius:",ey/* .borderRadius["12"] */.Vq["12"],";border:1px solid ",ey/* .colorTokens.stroke.divider */.I6.stroke.divider,";img{width:218px;flex-shrink:0;}",ey/* .Breakpoint.mobile */.EA.mobile,"{flex-direction:column-reverse;}"),emptyState:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),";width:100%;gap:",ey/* .spacing["8"] */.YK["8"],";h6{",eK/* .typography.heading6 */.I.heading6("medium"),";}p{",eK/* .typography.body */.I.body("regular"),";color:",ey/* .colorTokens.text.hints */.I6.text.hints,";}[data-actions]{margin-top:",ey/* .spacing["12"] */.YK["12"],";}"),popoverOptionWrapper:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),";width:100%;padding-block:",ey/* .spacing["8"] */.YK["8"],";"),popoverOption:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.resetButton */.x.resetButton,";color:",ey/* .colorTokens.text.title */.I6.text.title,";width:100%;padding:",ey/* .spacing["6"] */.YK["6"]," ",ey/* .spacing["16"] */.YK["16"]," ",ey/* .spacing["6"] */.YK["6"]," ",ey/* .spacing["20"] */.YK["20"],";transition:background-color 0.3s ease-in-out;display:flex;align-items:center;gap:",ey/* .spacing["10"] */.YK["10"],";",eK/* .typography.caption */.I.caption("regular"),";border:2px solid transparent;div{",eB/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;gap:",ey/* .spacing["4"] */.YK["4"],";}&:focus,&:active,&:hover{background:",ey/* .colorTokens.background.hover */.I6.background.hover,";color:",ey/* .colorTokens.text.title */.I6.text.title,";}"),borderedOption:/*#__PURE__*/(0,o/* .css */.AH)("border-top:1px solid ",ey/* .colorTokens.stroke.divider */.I6.stroke.divider,";padding-block:",ey/* .spacing["10"] */.YK["10"]," ",ey/* .spacing["6"] */.YK["6"],";")};// CONCATENATED MODULE: ./addons/content-bank/assets/react/manage-contents/components/modals/SaveCollectionModal.tsx
var TL=e=>{var{closeModal:r,collectionId:i,name:a}=e;var o=h1({defaultValues:{name:a||""},shouldFocusError:true});var{updateCollectionId:s}=YW();var l=yZ();var u=e=>aY(function*(){if(l.isPending){return}var t=ev(ep({},i&&{id:i}),{name:e.name});var n=yield l.mutateAsync(t);if(n.status_code===200||n.status_code===201){if(n.data&&!i){s(Number(n.data))}r({action:"CONFIRM"})}})();(0,n.useEffect)(()=>{var e=setTimeout(()=>{o.setFocus("name")},250);return()=>clearTimeout(e);// eslint-disable-next-line react-hooks/exhaustive-deps
},[]);return/*#__PURE__*/(0,t/* .jsx */.Y)(oR,{onClose:()=>r({action:"CLOSE"}),title:i?(0,em.__)("Edit Collection","tutor-pro"):(0,em.__)("Create Collection","tutor-pro"),maxWidth:560,children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:TB.wrapper,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("form",{css:TB.formWrapper,onSubmit:o.handleSubmit(u),children:/*#__PURE__*/(0,t/* .jsx */.Y)(sD,{name:"name",control:o.control,rules:bP(),render:e=>/*#__PURE__*/(0,t/* .jsx */.Y)(b2,ev(ep({},e),{type:"text",label:(0,em.__)("Name","tutor-pro"),placeholder:(0,em.__)("Enter your collection name","tutor-pro")}))})}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:TB.formFooter,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{onClick:()=>r({action:"CLOSE"}),variant:"text",size:"small",children:(0,em.__)("Cancel","tutor-pro")}),/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{size:"small",type:"submit",onClick:o.handleSubmit(u),loading:l.isPending,"data-cy":"save-collection-button",children:i?(0,em.__)("Update","tutor-pro"):(0,em.__)("Create","tutor-pro")})]})]})})};/* ESM default export */const TK=TL;var TB={wrapper:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",ey/* .spacing["20"] */.YK["20"],";"),formWrapper:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",ey/* .spacing["20"] */.YK["20"],";padding:",ey/* .spacing["16"] */.YK["16"]," ",ey/* .spacing["16"] */.YK["16"]," 0 ",ey/* .spacing["16"] */.YK["16"],";"),formFooter:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),";justify-content:flex-end;gap:",ey/* .spacing["16"] */.YK["16"],";border-top:1px solid ",ey/* .colorTokens.stroke.divider */.I6.stroke.divider,";padding:",ey/* .spacing["16"] */.YK["16"],";")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/utils/url.ts
function Tj(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"string";var r=new URLSearchParams(window.location.search);if(!r.has(e)){return null}var n=r.get(e);switch(t){case"string":return String(n);case"number":return Number(n);case"boolean":return Boolean(n);default:return n}}var TU=e=>{var{exclude:t}=e;var r=new URLSearchParams(window.location.search);var n=[];for(var i of r.keys()){if(!t.includes(i)){n.push(i)}}n.forEach(e=>{r.delete(e)});var a=r.toString()?"".concat(window.location.pathname,"?").concat(r.toString()):window.location.pathname;window.history.replaceState({},"",a)};var Tq=e=>{var t=JSON.stringify(e);return btoa(encodeURIComponent(t))};var TV=(e,t)=>{try{var r=decodeURIComponent(atob(e));return JSON.parse(r)}catch(e){// eslint-disable-next-line no-console
console.error("Failed to decode parameters:",e);if(t!==undefined){return t}throw e}};// CONCATENATED MODULE: ./addons/content-bank/assets/react/manage-contents/components/CollectionItem.tsx
function TW(){var e=eg(["\n        background-color: ",";\n        color: ",";\n\n        [data-count] {\n          color: ",";\n        }\n      "]);TW=function t(){return e};return e}function Tz(){var e=eg(["\n      background-color: ",";\n      color: ",";\n\n      [data-count] {\n        color: ",";\n      }\n    "]);Tz=function t(){return e};return e}var TG=/*#__PURE__*/(0,n.memo)(e=>{var{item:r,onDelete:i}=e;var{showModal:a,updateModal:o,closeModal:s}=ah();var{collectionId:l,updateCollectionId:u}=YW();var c=y1();var d=_u();var[f,p]=(0,n.useState)(false);var h=(0,n.useCallback)(()=>{if(l!==r.ID){u(r.ID);TU({exclude:["collection_id","page"]})}window.scrollTo({top:0,behavior:"smooth"})},[l,r.ID,u]);var v=(0,n.useCallback)(()=>{p(false);a({component:TK,props:{collectionId:r.ID,name:r.post_title},depthIndex:ey/* .zIndex.highest */.fE.highest})},[r.ID,r.post_title,a]);var g=(0,n.useCallback)(()=>aY(function*(){var e=yield d.mutateAsync(Number(r.ID));if(e.status_code===200){p(false);u(Number(e.data))}})(),[d,r.ID,u]);var m=(0,n.useCallback)(()=>aY(function*(){o("collection-delete-modal",{isLoading:true});var e=yield c.mutateAsync(Number(r.ID));if(e.status_code===200){p(false);i===null||i===void 0?void 0:i(Number(r.ID))}s();// eslint-disable-next-line react-hooks/exhaustive-deps
    })(),[c,r.ID,i]);var b=e=>{var t={referrer:"tutor-content-bank",type:e,collection_id:r.ID,collection_title:r.post_title,lesson_count:r.count_stats.lesson,assignment_count:r.count_stats.assignment,question_count:r.count_stats.question,total:r.count_stats.total};var n=Tq(t);var i=encodeURIComponent(decodeURIComponent(n));window.location.replace("".concat(fy/* ["default"].TUTOR_IMPORT_EXPORT_PAGE */.A.TUTOR_IMPORT_EXPORT_PAGE,"&referrer=").concat(i))};var y=String(l)===String(r.ID);return/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{"data-cy":y?"selected-collection":"collection",role:"button",tabIndex:0,css:T$.collectionItem({isSelected:y,isThreeDotOpen:f}),onClick:h,children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{"data-label-count":true,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("span",{"data-label":true,children:r.post_title}),/*#__PURE__*/(0,t/* .jsxs */.FD)("span",{"data-count":true,children:[" (",r.count_stats.total,")"]})]}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{"data-three-dot":true,children:/*#__PURE__*/(0,t/* .jsxs */.FD)(o8,{isOpen:f,onClick:e=>{e.stopPropagation();p(!f)},placement:aq.BOTTOM,closePopover:()=>p(false),dotsOrientation:"vertical",maxWidth:"170px",isInverse:true,arrow:true,closeOnEscape:false,size:"small",wrapperCss:T$.threeDotWrapper,"data-cy":"collection-actions-popover",children:[/*#__PURE__*/(0,t/* .jsx */.Y)(o8.Option,{text:(0,em.__)("Rename","tutor-pro"),icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{width:24,height:24,name:"edit"}),"data-cy":"rename-collection",onClick:e=>{e.stopPropagation();v()}}),/*#__PURE__*/(0,t/* .jsx */.Y)(o8.Option,{text:(0,em.__)("Duplicate","tutor-pro"),disabled:d.isPending,"data-cy":"duplicate-collection",icon:d.isPending?/*#__PURE__*/(0,t/* .jsx */.Y)(eT,{size:24}):/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{width:24,height:24,name:"copyPaste"}),onClick:e=>{e.stopPropagation();g()}}),/*#__PURE__*/(0,t/* .jsx */.Y)(o8.Option,{text:(0,em.__)("Delete","tutor-pro"),icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{width:24,height:24,name:"delete"}),"data-cy":"delete-collection",isTrash:true,onClick:e=>{e.stopPropagation();p(false);a({id:"collection-delete-modal",component:oH,props:{title:(0,em.__)("Delete Collection","tutor-pro"),description:(0,em.__)("Are you sure you want to delete this collection?","tutor-pro"),isLoading:c.isPending,onConfirm:()=>m()},depthIndex:ey/* .zIndex.highest */.fE.highest})}}),/*#__PURE__*/(0,t/* .jsx */.Y)(o8.Option,{text:(0,em.__)("Import","tutor-pro"),icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{width:24,height:24,name:"import"}),buttonCss:T$.borderedButton,onClick:e=>{e.stopPropagation();b("import")}}),/*#__PURE__*/(0,t/* .jsx */.Y)(o8.Option,{text:(0,em.__)("Export","tutor-pro"),icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{width:24,height:24,name:"export"}),onClick:e=>{e.stopPropagation();b("export")}})]})})]})});TG.displayName="CollectionItem";/* ESM default export */const TQ=TG;var T$={collectionItem:e=>{var{isSelected:t,isThreeDotOpen:r}=e;return/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),";justify-content:space-between;align-items:center;",eK/* .typography.body */.I.body("medium"),";color:",ey/* .colorTokens.text.title */.I6.text.title,";padding:",ey/* .spacing["8"] */.YK["8"]," ",ey/* .spacing["8"] */.YK["8"]," ",ey/* .spacing["8"] */.YK["8"]," ",ey/* .spacing["16"] */.YK["16"],";background-color:",r?ey/* .colorTokens.background.white */.I6.background.white:"transparent",";cursor:pointer;transition:background-color 0.3s ease-in-out,color 0.3s ease-in-out;[data-label-count]{",eB/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;gap:",ey/* .spacing["2"] */.YK["2"],";flex:1;}[data-label]{",eB/* .styleUtils.text.ellipsis */.x.text.ellipsis(1),";}[data-count]{",eK/* .typography.body */.I.body("regular"),";color:",ey/* .colorTokens.text.hints */.I6.text.hints,";}[data-three-dot]{z-index:1;opacity:",r?1:0,";transition:opacity 0.15s ease-in-out;color:",ey/* .colorTokens.icon["default"] */.I6.icon["default"],";cursor:pointer;}&:hover{[data-three-dot]{opacity:1;}",!t&&(0,o/* .css */.AH)(TW(),ey/* .colorTokens.background.active */.I6.background.active,ey/* .colorTokens.brand.blue */.I6.brand.blue,ey/* .colorTokens.text.subdued */.I6.text.subdued),"}&:active,&:focus{border-color:",ey/* .colorTokens.stroke.divider */.I6.stroke.divider,";background-color:",ey/* .colorTokens.background.white */.I6.background.white,";color:",ey/* .colorTokens.text.brand */.I6.text.brand,";[data-count]{color:",ey/* .colorTokens.stroke.brand */.I6.stroke.brand,";}}",t&&(0,o/* .css */.AH)(Tz(),ey/* .colorTokens.background.white */.I6.background.white,ey/* .colorTokens.text.brand */.I6.text.brand,ey/* .colorTokens.stroke.brand */.I6.stroke.brand))},threeDotWrapper:/*#__PURE__*/(0,o/* .css */.AH)("background-color:transparent;"),borderedButton:/*#__PURE__*/(0,o/* .css */.AH)("border-top:1px solid ",ey/* .colorTokens.stroke.divider */.I6.stroke.divider,";")};// CONCATENATED MODULE: ./addons/content-bank/assets/react/manage-contents/assets/images/empty-state-2x.webp
const TX=r.p+"images/empty-state-2x-1b8aa1e4.webp";// CONCATENATED MODULE: ./addons/content-bank/assets/react/manage-contents/assets/images/empty-state.webp
const TJ=r.p+"images/empty-state-d3d689b5.webp";// CONCATENATED MODULE: ./addons/content-bank/assets/react/manage-contents/components/Collections.tsx
function TZ(){var e=eg(["\n        left: -240px;\n      "]);TZ=function t(){return e};return e}var T0="64px";var T1="78px";var T2=e=>{var{menuCollapsed:r}=e;var i,a,o,s,l;var[u,c]=(0,n.useState)({value:"",isSearchEnabled:false});var d=oc(u.value,300);var{showModal:f,hasModalOnStack:p}=ah();var{collectionId:h,updateCollectionId:v}=YW();var g=AD({page:1,per_page:10,search:d});var m=((a=g.data)===null||a===void 0?void 0:(i=a.pages)===null||i===void 0?void 0:i.reduce((e,t)=>{if(t.data&&Array.isArray(t.data)){return[...e,...t.data]}return e},[]))||[];var b=((l=g.data)===null||l===void 0?void 0:(s=l.pages)===null||s===void 0?void 0:(o=s[0])===null||o===void 0?void 0:o.total_record)||0;var{intersectionEntry:y,intersectionElementRef:_}=of({dependencies:[m.length]});var w=!g.isLoading&&!g.isRefetching&&!u.isSearchEnabled&&m.length===0;var x=(0,n.useCallback)(()=>{f({component:TK,depthIndex:ey/* .zIndex.highest */.fE.highest})},[f]);(0,n.useEffect)(()=>{if((y===null||y===void 0?void 0:y.isIntersecting)&&g.hasNextPage&&m.length>0){g.fetchNextPage()}},[y,g,m.length]);(0,n.useEffect)(()=>{if(g.isLoading||u.isSearchEnabled){return}if(m.length>0&&!h){var e=m[0];if(e){v(e.ID)}else{v(null)}}else if(h&&m.length===0){v(null)}// eslint-disable-next-line react-hooks/exhaustive-deps
},[g.isLoading,m]);if(g.isLoading&&!u.isSearchEnabled){return/*#__PURE__*/(0,t/* .jsx */.Y)(eI,{})}return/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:w,fallback:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:T4.wrapper,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:T4.leftWrapper(r),children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:T4.left,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:T4.leftHeader,children:/*#__PURE__*/(0,t/* .jsxs */.FD)(ag/* ["default"] */.A,{when:!u.isSearchEnabled,fallback:/*#__PURE__*/(0,t/* .jsxs */.FD)(t/* .Fragment */.FK,{children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eG,{value:u.value,onChange:e=>c(ev(ep({},u),{value:e})),placeholder:(0,em.__)("Search...","tutor-pro"),autoFocus:true,variant:"search",inputCss:T4.searchInput}),/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{size:"small",variant:"text",onClick:()=>c({value:"",isSearchEnabled:false}),disabled:p,buttonCss:T4.actionButton,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"cross",height:24,width:24})})]}),children:[/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{"data-header":true,children:[/*#__PURE__*/(0,t/* .jsx */.Y)("span",{children:(0,em.__)("Collections","tutor-pro")}),/*#__PURE__*/(0,t/* .jsxs */.FD)("span",{"data-collection-count":true,children:[" (",b||1,")"]})]}),/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:T4.actionsWrapper,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{size:"small",variant:"text",onClick:()=>c({value:"",isSearchEnabled:true}),disabled:p,buttonCss:T4.actionButton,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"search",height:24,width:24})}),/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{size:"small",variant:"tertiary",onClick:x,disabled:p,buttonCss:T4.actionButton,"data-cy":"open-new-collection-modal",children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"plus",height:24,width:24})})]})]})}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:T4.collectionsList,children:/*#__PURE__*/(0,t/* .jsxs */.FD)(ag/* ["default"] */.A,{when:m.length>0,fallback:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:T4.notFound,children:(0,em.__)("No collections found.","tutor-pro")}),children:[/*#__PURE__*/(0,t/* .jsx */.Y)(fb,{each:m,children:(e,r)=>/*#__PURE__*/(0,t/* .jsx */.Y)(TQ,{item:e,onDelete:e=>{if(e===0||Number(h)!==Number(e)){return}var t=m[r-1]||m[r+1];if(t){v(t.ID)}else{v(null)}c({value:"",isSearchEnabled:false})}},"".concat(e.ID,"-").concat(h))}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{ref:_}),/*#__PURE__*/(0,t/* .jsx */.Y)(ag/* ["default"] */.A,{when:(y===null||y===void 0?void 0:y.isIntersecting)&&g.hasNextPage,children:/*#__PURE__*/(0,t/* .jsx */.Y)(fb,{each:Array.from({length:5}),children:(e,r)=>/*#__PURE__*/(0,t/* .jsx */.Y)("div",{"data-skeleton":true,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eM,{width:"100%",height:40,animation:true},r)})})})]})})]})}),/*#__PURE__*/(0,t/* .jsx */.Y)("div",{children:/*#__PURE__*/(0,t/* .jsx */.Y)(TH,{},h)})]}),children:/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:T4.emptyStateWrapper,children:/*#__PURE__*/(0,t/* .jsx */.Y)(aE,{wrapperCss:T4.emptyState,emptyStateImage:TJ,emptyStateImage2x:TX,title:(0,em.__)("You haven’t created any collections yet","tutor-pro"),description:(0,em.__)("Create a collection of reusable Questions, Lessons, and Assignments to use across courses.","tutor-pro"),actions:/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"primary",icon:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"plus",height:24,width:24}),onClick:x,"data-cy":"open-new-collection-modal",children:(0,em.__)("Create New Collection","tutor-pro")}),removeBorder:false})})})};T2.displayName="Collections";/* ESM default export */const T6=T2;var T4={wrapper:/*#__PURE__*/(0,o/* .css */.AH)("max-width:1380px;padding-inline:",ey/* .spacing["20"] */.YK["20"],";margin-inline:auto;display:grid;grid-template-columns:240px 1fr;",ey/* .Breakpoint.mobile */.EA.mobile,"{display:block;}"),leftWrapper:e=>/*#__PURE__*/(0,o/* .css */.AH)("border-inline:1px solid ",ey/* .colorTokens.stroke.divider */.I6.stroke.divider,";",ey/* .Breakpoint.mobile */.EA.mobile,"{position:fixed;width:238px;height:calc(100% - (",aT/* .WP_ADMIN_BAR_HEIGHT_MOBILE */.TF," + ",T0," + 3px));top:calc(",aT/* .WP_ADMIN_BAR_HEIGHT_MOBILE */.TF," + ",T0," + 3px);left:20px;background-color:white;z-index:1;transition:left 0.25s ease-in-out;",e&&(0,o/* .css */.AH)(TZ()),"}"),left:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),";position:sticky;top:calc(",aT/* .WP_ADMIN_BAR_HEIGHT */.I4," + ",T0," + 3px);",ey/* .Breakpoint.mobile */.EA.mobile,"{height:100%;top:calc(",aT/* .WP_ADMIN_BAR_HEIGHT_MOBILE */.TF," + ",T0," + 3px);}"),leftHeader:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),";justify-content:space-between;align-items:center;padding:",ey/* .spacing["20"] */.YK["20"]," ",ey/* .spacing["16"] */.YK["16"],";border-bottom:1px solid ",ey/* .colorTokens.stroke.divider */.I6.stroke.divider,";background-color:",ey/* .colorTokens.surface.navbar */.I6.surface.navbar,";position:sticky;top:0;z-index:",ey/* .zIndex.header */.fE.header,";[data-header]{",eK/* .typography.body */.I.body("medium"),";[data-collection-count]{color:",ey/* .colorTokens.text.hints */.I6.text.hints,";}}"),actionsWrapper:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;gap:",ey/* .spacing["8"] */.YK["8"],";"),actionButton:/*#__PURE__*/(0,o/* .css */.AH)("padding:",ey/* .spacing["4"] */.YK["4"]," ",ey/* .spacing["6"] */.YK["6"],";"),collectionsList:/*#__PURE__*/(0,o/* .css */.AH)(eB/* .styleUtils.display.flex */.x.display.flex("column"),";",eB/* .styleUtils.overflowYAuto */.x.overflowYAuto,";scrollbar-gutter:unset;max-height:calc(100vh - ",aT/* .WP_ADMIN_BAR_HEIGHT */.I4," - ",T0," - ",T1,");",ey/* .Breakpoint.mobile */.EA.mobile,"{max-height:calc(100vh - ",aT/* .WP_ADMIN_BAR_HEIGHT_MOBILE */.TF," - ",T0," - ",T1,");}[data-skeleton]{padding:",ey/* .spacing["4"] */.YK["4"]," ",ey/* .spacing["4"] */.YK["4"]," 0 ",ey/* .spacing["4"] */.YK["4"],";}"),emptyStateWrapper:/*#__PURE__*/(0,o/* .css */.AH)("margin-top:40px;max-width:795px;margin-inline:auto;padding:",ey/* .spacing["0"] */.YK["0"]," ",ey/* .spacing["16"] */.YK["16"],";"),emptyState:/*#__PURE__*/(0,o/* .css */.AH)("gap:",ey/* .spacing["24"] */.YK["24"],";padding:",ey/* .spacing["40"] */.YK["40"],";img{padding-top:",ey/* .spacing["12"] */.YK["12"],";width:136px;}h5{",eK/* .typography.heading6 */.I.heading6("medium"),";}[data-actions]{margin-top:",ey/* .spacing["8"] */.YK["8"],";}"),notFound:/*#__PURE__*/(0,o/* .css */.AH)("padding:",ey/* .spacing["20"] */.YK["20"],";"),searchInput:/*#__PURE__*/(0,o/* .css */.AH)("max-height:32px;")};// CONCATENATED MODULE: ./addons/content-bank/assets/react/manage-contents/components/Topbar.tsx
var T5=e=>{var{onMenuClick:r}=e;return/*#__PURE__*/(0,t/* .jsx */.Y)("div",{css:T8.wrapper,children:/*#__PURE__*/(0,t/* .jsxs */.FD)("div",{css:T8.header,children:[/*#__PURE__*/(0,t/* .jsx */.Y)(eb/* ["default"] */.A,{variant:"tertiary",size:"small",onClick:r,buttonCss:T8.menuButton,children:/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"bars",width:20,height:20})}),/*#__PURE__*/(0,t/* .jsx */.Y)(eL/* ["default"] */.A,{name:"contentBank",height:24,width:24}),/*#__PURE__*/(0,t/* .jsx */.Y)("h5",{children:(0,em.__)("Content Bank","tutor-pro")})]})})};/* ESM default export */const T3=T5;var T8={wrapper:/*#__PURE__*/(0,o/* .css */.AH)("position:sticky;top:",aT/* .WP_ADMIN_BAR_HEIGHT */.I4,";border-bottom:1px solid ",ey/* .colorTokens.stroke.divider */.I6.stroke.divider,";background-color:",ey/* .colorTokens.surface.navbar */.I6.surface.navbar,";z-index:",ey/* .zIndex.header */.fE.header,";",ey/* .Breakpoint.mobile */.EA.mobile,"{top:",aT/* .WP_ADMIN_BAR_HEIGHT_MOBILE */.TF,";}"),header:/*#__PURE__*/(0,o/* .css */.AH)("max-width:1380px;padding:",ey/* .spacing["16"] */.YK["16"]," ",ey/* .spacing["20"] */.YK["20"],";margin-inline:auto;",eB/* .styleUtils.display.flex */.x.display.flex(),";gap:",ey/* .spacing["8"] */.YK["8"],";align-items:center;svg{color:",ey/* .colorTokens.icon.hover */.I6.icon.hover,";fill:none;}h5{margin:0;",eK/* .typography.heading5 */.I.heading5(),"}"),menuButton:/*#__PURE__*/(0,o/* .css */.AH)("padding:",ey/* .spacing["6"] */.YK["6"],";border-radius:",ey/* .borderRadius["4"] */.Vq["4"],";display:none;",ey/* .Breakpoint.mobile */.EA.mobile,"{display:flex;}")};// CONCATENATED MODULE: ./addons/content-bank/assets/react/manage-contents/components/layout/Main.tsx
var T9=()=>{var[e,r]=(0,n.useState)(true);return/*#__PURE__*/(0,t/* .jsxs */.FD)(t/* .Fragment */.FK,{children:[/*#__PURE__*/(0,t/* .jsx */.Y)(T3,{onMenuClick:()=>r(!e)}),/*#__PURE__*/(0,t/* .jsx */.Y)(T6,{menuCollapsed:e})]})};/* ESM default export */const T7=T9;// CONCATENATED MODULE: ../tutor/node_modules/@emotion/sheet/dist/emotion-sheet.esm.js
var Se=false;/*

Based off glamor's StyleSheet, thanks Sunil ❤️

high performance StyleSheet for css-in-js systems

- uses multiple style tags behind the scenes for millions of rules
- uses `insertRule` for appending in production for *much* faster performance

// usage

import { StyleSheet } from '@emotion/sheet'

let styleSheet = new StyleSheet({ key: '', container: document.head })

styleSheet.insert('#box { border: 1px solid red; }')
- appends a css rule into the stylesheet

styleSheet.flush()
- empties the stylesheet of all its contents

*/function St(e){if(e.sheet){return e.sheet}// this weirdness brought to you by firefox
/* istanbul ignore next */for(var t=0;t<document.styleSheets.length;t++){if(document.styleSheets[t].ownerNode===e){return document.styleSheets[t]}}// this function should always return with a value
// TS can't understand it though so we make it stop complaining here
return undefined}function Sr(e){var t=document.createElement("style");t.setAttribute("data-emotion",e.key);if(e.nonce!==undefined){t.setAttribute("nonce",e.nonce)}t.appendChild(document.createTextNode(""));t.setAttribute("data-s","");return t}var Sn=/*#__PURE__*/function(){// Using Node instead of HTMLElement since container may be a ShadowRoot
function e(e){var t=this;this._insertTag=function(e){var r;if(t.tags.length===0){if(t.insertionPoint){r=t.insertionPoint.nextSibling}else if(t.prepend){r=t.container.firstChild}else{r=t.before}}else{r=t.tags[t.tags.length-1].nextSibling}t.container.insertBefore(e,r);t.tags.push(e)};this.isSpeedy=e.speedy===undefined?!Se:e.speedy;this.tags=[];this.ctr=0;this.nonce=e.nonce;// key is the value of the data-emotion attribute, it's used to identify different sheets
this.key=e.key;this.container=e.container;this.prepend=e.prepend;this.insertionPoint=e.insertionPoint;this.before=null}var t=e.prototype;t.hydrate=function e(e){e.forEach(this._insertTag)};t.insert=function e(e){// the max length is how many rules we have per style tag, it's 65000 in speedy mode
// it's 1 in dev because we insert source maps that map a single rule to a location
// and you can only have one source map per style tag
if(this.ctr%(this.isSpeedy?65e3:1)===0){this._insertTag(Sr(this))}var t=this.tags[this.tags.length-1];if(this.isSpeedy){var r=St(t);try{// this is the ultrafast version, works across browsers
// the big drawback is that the css won't be editable in devtools
r.insertRule(e,r.cssRules.length)}catch(e){}}else{t.appendChild(document.createTextNode(e))}this.ctr++};t.flush=function e(){this.tags.forEach(function(e){var t;return(t=e.parentNode)==null?void 0:t.removeChild(e)});this.tags=[];this.ctr=0};return e}();// CONCATENATED MODULE: ../tutor/node_modules/@emotion/cache/node_modules/stylis/src/Utility.js
/**
 * @param {number}
 * @return {number}
 */var Si=Math.abs;/**
 * @param {number}
 * @return {string}
 */var Sa=String.fromCharCode;/**
 * @param {object}
 * @return {object}
 */var So=Object.assign;/**
 * @param {string} value
 * @param {number} length
 * @return {number}
 */function Ss(e,t){return Sf(e,0)^45?(((t<<2^Sf(e,0))<<2^Sf(e,1))<<2^Sf(e,2))<<2^Sf(e,3):0}/**
 * @param {string} value
 * @return {string}
 */function Sl(e){return e.trim()}/**
 * @param {string} value
 * @param {RegExp} pattern
 * @return {string?}
 */function Su(e,t){return(e=t.exec(e))?e[0]:e}/**
 * @param {string} value
 * @param {(string|RegExp)} pattern
 * @param {string} replacement
 * @return {string}
 */function Sc(e,t,r){return e.replace(t,r)}/**
 * @param {string} value
 * @param {string} search
 * @return {number}
 */function Sd(e,t){return e.indexOf(t)}/**
 * @param {string} value
 * @param {number} index
 * @return {number}
 */function Sf(e,t){return e.charCodeAt(t)|0}/**
 * @param {string} value
 * @param {number} begin
 * @param {number} end
 * @return {string}
 */function Sp(e,t,r){return e.slice(t,r)}/**
 * @param {string} value
 * @return {number}
 */function Sh(e){return e.length}/**
 * @param {any[]} value
 * @return {number}
 */function Sv(e){return e.length}/**
 * @param {any} value
 * @param {any[]} array
 * @return {any}
 */function Sg(e,t){return t.push(e),e}/**
 * @param {string[]} array
 * @param {function} callback
 * @return {string}
 */function Sm(e,t){return e.map(t).join("")};// CONCATENATED MODULE: ../tutor/node_modules/@emotion/cache/node_modules/stylis/src/Tokenizer.js
var Sb=1;var Sy=1;var S_=0;var Sw=0;var Sx=0;var SA="";/**
 * @param {string} value
 * @param {object | null} root
 * @param {object | null} parent
 * @param {string} type
 * @param {string[] | string} props
 * @param {object[] | string} children
 * @param {number} length
 */function Sk(e,t,r,n,i,a,o){return{value:e,root:t,parent:r,type:n,props:i,children:a,line:Sb,column:Sy,length:o,return:""}}/**
 * @param {object} root
 * @param {object} props
 * @return {object}
 */function SE(e,t){return So(Sk("",null,null,"",null,null,0),e,{length:-e.length},t)}/**
 * @return {number}
 */function SI(){return Sx}/**
 * @return {number}
 */function SC(){Sx=Sw>0?Sf(SA,--Sw):0;if(Sy--,Sx===10)Sy=1,Sb--;return Sx}/**
 * @return {number}
 */function SY(){Sx=Sw<S_?Sf(SA,Sw++):0;if(Sy++,Sx===10)Sy=1,Sb++;return Sx}/**
 * @return {number}
 */function ST(){return Sf(SA,Sw)}/**
 * @return {number}
 */function SS(){return Sw}/**
 * @param {number} begin
 * @param {number} end
 * @return {string}
 */function SO(e,t){return Sp(SA,e,t)}/**
 * @param {number} type
 * @return {number}
 */function SD(e){switch(e){// \0 \t \n \r \s whitespace token
case 0:case 9:case 10:case 13:case 32:return 5;// ! + , / > @ ~ isolate token
case 33:case 43:case 44:case 47:case 62:case 64:case 126:// ; { } breakpoint token
case 59:case 123:case 125:return 4;// : accompanied token
case 58:return 3;// " ' ( [ opening delimit token
case 34:case 39:case 40:case 91:return 2;// ) ] closing delimit token
case 41:case 93:return 1}return 0}/**
 * @param {string} value
 * @return {any[]}
 */function SF(e){return Sb=Sy=1,S_=Sh(SA=e),Sw=0,[]}/**
 * @param {any} value
 * @return {any}
 */function SR(e){return SA="",e}/**
 * @param {number} type
 * @return {string}
 */function SP(e){return Sl(SO(Sw-1,SK(e===91?e+2:e===40?e+1:e)))}/**
 * @param {string} value
 * @return {string[]}
 */function SM(e){return SR(SN(SF(e)))}/**
 * @param {number} type
 * @return {string}
 */function SH(e){while(Sx=ST())if(Sx<33)SY();else break;return SD(e)>2||SD(Sx)>3?"":" "}/**
 * @param {string[]} children
 * @return {string[]}
 */function SN(e){while(SY())switch(SD(Sx)){case 0:append(Sj(Sw-1),e);break;case 2:append(SP(Sx),e);break;default:append(from(Sx),e)}return e}/**
 * @param {number} index
 * @param {number} count
 * @return {string}
 */function SL(e,t){while(--t&&SY())// not 0-9 A-F a-f
if(Sx<48||Sx>102||Sx>57&&Sx<65||Sx>70&&Sx<97)break;return SO(e,SS()+(t<6&&ST()==32&&SY()==32))}/**
 * @param {number} type
 * @return {number}
 */function SK(e){while(SY())switch(Sx){// ] ) " '
case e:return Sw;// " '
case 34:case 39:if(e!==34&&e!==39)SK(Sx);break;// (
case 40:if(e===41)SK(e);break;// \
case 92:SY();break}return Sw}/**
 * @param {number} type
 * @param {number} index
 * @return {number}
 */function SB(e,t){while(SY())// //
if(e+Sx===47+10)break;else if(e+Sx===42+42&&ST()===47)break;return"/*"+SO(t,Sw-1)+"*"+Sa(e===47?e:SY())}/**
 * @param {number} index
 * @return {string}
 */function Sj(e){while(!SD(ST()))SY();return SO(e,Sw)};// CONCATENATED MODULE: ../tutor/node_modules/@emotion/cache/node_modules/stylis/src/Enum.js
var SU="-ms-";var Sq="-moz-";var SV="-webkit-";var SW="comm";var Sz="rule";var SG="decl";var SQ="@page";var S$="@media";var SX="@import";var SJ="@charset";var SZ="@viewport";var S0="@supports";var S1="@document";var S2="@namespace";var S6="@keyframes";var S4="@font-face";var S5="@counter-style";var S3="@font-feature-values";var S8="@layer";// CONCATENATED MODULE: ../tutor/node_modules/@emotion/cache/node_modules/stylis/src/Serializer.js
/**
 * @param {object[]} children
 * @param {function} callback
 * @return {string}
 */function S9(e,t){var r="";var n=Sv(e);for(var i=0;i<n;i++)r+=t(e[i],i,e,t)||"";return r}/**
 * @param {object} element
 * @param {number} index
 * @param {object[]} children
 * @param {function} callback
 * @return {string}
 */function S7(e,t,r,n){switch(e.type){case S8:if(e.children.length)break;case SX:case SG:return e.return=e.return||e.value;case SW:return"";case S6:return e.return=e.value+"{"+S9(e.children,n)+"}";case Sz:e.value=e.props.join(",")}return Sh(r=S9(e.children,n))?e.return=e.value+"{"+r+"}":""};// CONCATENATED MODULE: ../tutor/node_modules/@emotion/cache/node_modules/stylis/src/Middleware.js
/**
 * @param {function[]} collection
 * @return {function}
 */function Oe(e){var t=Sv(e);return function(r,n,i,a){var o="";for(var s=0;s<t;s++)o+=e[s](r,n,i,a)||"";return o}}/**
 * @param {function} callback
 * @return {function}
 */function Ot(e){return function(t){if(!t.root){if(t=t.return)e(t)}}}/**
 * @param {object} element
 * @param {number} index
 * @param {object[]} children
 * @param {function} callback
 */function Or(e,t,r,n){if(e.length>-1){if(!e.return)switch(e.type){case DECLARATION:e.return=prefix(e.value,e.length,r);return;case KEYFRAMES:return serialize([copy(e,{value:replace(e.value,"@","@"+WEBKIT)})],n);case RULESET:if(e.length)return combine(e.props,function(t){switch(match(t,/(::plac\w+|:read-\w+)/)){// :read-(only|write)
case":read-only":case":read-write":return serialize([copy(e,{props:[replace(t,/:(read-\w+)/,":"+MOZ+"$1")]})],n);// :placeholder
case"::placeholder":return serialize([copy(e,{props:[replace(t,/:(plac\w+)/,":"+WEBKIT+"input-$1")]}),copy(e,{props:[replace(t,/:(plac\w+)/,":"+MOZ+"$1")]}),copy(e,{props:[replace(t,/:(plac\w+)/,MS+"input-$1")]})],n)}return""})}}}/**
 * @param {object} element
 * @param {number} index
 * @param {object[]} children
 */function On(e){switch(e.type){case RULESET:e.props=e.props.map(function(t){return combine(tokenize(t),function(t,r,n){switch(charat(t,0)){// \f
case 12:return substr(t,1,strlen(t));// \0 ( + > ~
case 0:case 40:case 43:case 62:case 126:return t;// :
case 58:if(n[++r]==="global")n[r]="",n[++r]="\f"+substr(n[r],r=1,-1);// \s
case 32:return r===1?"":t;default:switch(r){case 0:e=t;return sizeof(n)>1?"":t;case r=sizeof(n)-1:case 2:return r===2?t+e+e:t+e;default:return t}}})})}};// CONCATENATED MODULE: ../tutor/node_modules/@emotion/cache/node_modules/stylis/src/Parser.js
/**
 * @param {string} value
 * @return {object[]}
 */function Oi(e){return SR(Oa("",null,null,null,[""],e=SF(e),0,[0],e))}/**
 * @param {string} value
 * @param {object} root
 * @param {object?} parent
 * @param {string[]} rule
 * @param {string[]} rules
 * @param {string[]} rulesets
 * @param {number[]} pseudo
 * @param {number[]} points
 * @param {string[]} declarations
 * @return {object}
 */function Oa(e,t,r,n,i,a,o,s,l){var u=0;var c=0;var d=o;var f=0;var p=0;var h=0;var v=1;var g=1;var m=1;var b=0;var y="";var _=i;var w=a;var x=n;var A=y;while(g)switch(h=b,b=SY()){// (
case 40:if(h!=108&&Sf(A,d-1)==58){if(Sd(A+=Sc(SP(b),"&","&\f"),"&\f")!=-1)m=-1;break}// " ' [
case 34:case 39:case 91:A+=SP(b);break;// \t \n \r \s
case 9:case 10:case 13:case 32:A+=SH(h);break;// \
case 92:A+=SL(SS()-1,7);continue;// /
case 47:switch(ST()){case 42:case 47:Sg(Os(SB(SY(),SS()),t,r),l);break;default:A+="/"}break;// {
case 123*v:s[u++]=Sh(A)*m;// } ; \0
case 125*v:case 59:case 0:switch(b){// \0 }
case 0:case 125:g=0;// ;
case 59+c:if(m==-1)A=Sc(A,/\f/g,"");if(p>0&&Sh(A)-d)Sg(p>32?Ol(A+";",n,r,d-1):Ol(Sc(A," ","")+";",n,r,d-2),l);break;// @ ;
case 59:A+=";";// { rule/at-rule
default:Sg(x=Oo(A,t,r,u,c,i,s,y,_=[],w=[],d),a);if(b===123)if(c===0)Oa(A,t,x,x,_,a,d,s,w);else switch(f===99&&Sf(A,3)===110?100:f){// d l m s
case 100:case 108:case 109:case 115:Oa(e,x,x,n&&Sg(Oo(e,x,x,0,0,i,s,y,i,_=[],d),w),i,w,d,s,n?_:w);break;default:Oa(A,x,x,x,[""],w,0,s,w)}}u=c=p=0,v=m=1,y=A="",d=o;break;// :
case 58:d=1+Sh(A),p=h;default:if(v<1){if(b==123)--v;else if(b==125&&v++==0&&SC()==125)continue}switch(A+=Sa(b),b*v){// &
case 38:m=c>0?1:(A+="\f",-1);break;// ,
case 44:s[u++]=(Sh(A)-1)*m,m=1;break;// @
case 64:// -
if(ST()===45)A+=SP(SY());f=ST(),c=d=Sh(y=A+=Sj(SS())),b++;break;// -
case 45:if(h===45&&Sh(A)==2)v=0}}return a}/**
 * @param {string} value
 * @param {object} root
 * @param {object?} parent
 * @param {number} index
 * @param {number} offset
 * @param {string[]} rules
 * @param {number[]} points
 * @param {string} type
 * @param {string[]} props
 * @param {string[]} children
 * @param {number} length
 * @return {object}
 */function Oo(e,t,r,n,i,a,o,s,l,u,c){var d=i-1;var f=i===0?a:[""];var p=Sv(f);for(var h=0,v=0,g=0;h<n;++h)for(var m=0,b=Sp(e,d+1,d=Si(v=o[h])),y=e;m<p;++m)if(y=Sl(v>0?f[m]+" "+b:Sc(b,/&\f/g,f[m])))l[g++]=y;return Sk(e,t,r,i===0?Sz:s,l,u,c)}/**
 * @param {number} value
 * @param {object} root
 * @param {object?} parent
 * @return {object}
 */function Os(e,t,r){return Sk(e,t,r,SW,Sa(SI()),Sp(e,2,-2),0)}/**
 * @param {string} value
 * @param {object} root
 * @param {object?} parent
 * @param {number} length
 * @return {object}
 */function Ol(e,t,r,n){return Sk(e,t,r,SG,Sp(e,0,n),Sp(e,n+1,-1),n)};// CONCATENATED MODULE: ../tutor/node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js
var Ou=function e(e,t,r){var n=0;var i=0;while(true){n=i;i=ST();// &\f
if(n===38&&i===12){t[r]=1}if(SD(i)){break}SY()}return SO(e,Sw)};var Oc=function e(e,t){// pretend we've started with a comma
var r=-1;var n=44;do{switch(SD(n)){case 0:// &\f
if(n===38&&ST()===12){// this is not 100% correct, we don't account for literal sequences here - like for example quoted strings
// stylis inserts \f after & to know when & where it should replace this sequence with the context selector
// and when it should just concatenate the outer and inner selectors
// it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here
t[r]=1}e[r]+=Ou(Sw-1,t,r);break;case 2:e[r]+=SP(n);break;case 4:// comma
if(n===44){// colon
e[++r]=ST()===58?"&\f":"";t[r]=e[r].length;break}// fallthrough
default:e[r]+=Sa(n)}}while(n=SY())return e};var Od=function e(e,t){return SR(Oc(SF(e),t))};// WeakSet would be more appropriate, but only WeakMap is supported in IE11
var Of=/* #__PURE__ */new WeakMap;var Op=function e(e){if(e.type!=="rule"||!e.parent||// positive .length indicates that this rule contains pseudo
// negative .length indicates that this rule has been already prefixed
e.length<1){return}var t=e.value;var r=e.parent;var n=e.column===r.column&&e.line===r.line;while(r.type!=="rule"){r=r.parent;if(!r)return}// short-circuit for the simplest case
if(e.props.length===1&&t.charCodeAt(0)!==58&&!Of.get(r)){return}// if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)
// then the props has already been manipulated beforehand as they that array is shared between it and its "rule parent"
if(n){return}Of.set(e,true);var i=[];var a=Od(t,i);var o=r.props;for(var s=0,l=0;s<a.length;s++){for(var u=0;u<o.length;u++,l++){e.props[l]=i[s]?a[s].replace(/&\f/g,o[u]):o[u]+" "+a[s]}}};var Oh=function e(e){if(e.type==="decl"){var t=e.value;if(t.charCodeAt(0)===108&&// charcode for b
t.charCodeAt(2)===98){// this ignores label
e["return"]="";e.value=""}}};/* eslint-disable no-fallthrough */function Ov(e,t){switch(Ss(e,t)){// color-adjust
case 5103:return SV+"print-"+e+e;// animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)
case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return SV+e+e;// appearance, user-select, transform, hyphens, text-size-adjust
case 5349:case 4246:case 4810:case 6968:case 2756:return SV+e+Sq+e+SU+e+e;// flex, flex-direction
case 6828:case 4268:return SV+e+SU+e+e;// order
case 6165:return SV+e+SU+"flex-"+e+e;// align-items
case 5187:return SV+e+Sc(e,/(\w+).+(:[^]+)/,SV+"box-$1$2"+SU+"flex-$1$2")+e;// align-self
case 5443:return SV+e+SU+"flex-item-"+Sc(e,/flex-|-self/,"")+e;// align-content
case 4675:return SV+e+SU+"flex-line-pack"+Sc(e,/align-content|flex-|-self/,"")+e;// flex-shrink
case 5548:return SV+e+SU+Sc(e,"shrink","negative")+e;// flex-basis
case 5292:return SV+e+SU+Sc(e,"basis","preferred-size")+e;// flex-grow
case 6060:return SV+"box-"+Sc(e,"-grow","")+SV+e+SU+Sc(e,"grow","positive")+e;// transition
case 4554:return SV+Sc(e,/([^-])(transform)/g,"$1"+SV+"$2")+e;// cursor
case 6187:return Sc(Sc(Sc(e,/(zoom-|grab)/,SV+"$1"),/(image-set)/,SV+"$1"),e,"")+e;// background, background-image
case 5495:case 3959:return Sc(e,/(image-set\([^]*)/,SV+"$1"+"$`$1");// justify-content
case 4968:return Sc(Sc(e,/(.+:)(flex-)?(.*)/,SV+"box-pack:$3"+SU+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+SV+e+e;// (margin|padding)-inline-(start|end)
case 4095:case 3583:case 4068:case 2532:return Sc(e,/(.+)-inline(.+)/,SV+"$1$2")+e;// (min|max)?(width|height|inline-size|block-size)
case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:// stretch, max-content, min-content, fill-available
if(Sh(e)-1-t>6)switch(Sf(e,t+1)){// (m)ax-content, (m)in-content
case 109:// -
if(Sf(e,t+4)!==45)break;// (f)ill-available, (f)it-content
case 102:return Sc(e,/(.+:)(.+)-([^]+)/,"$1"+SV+"$2-$3"+"$1"+Sq+(Sf(e,t+3)==108?"$3":"$2-$3"))+e;// (s)tretch
case 115:return~Sd(e,"stretch")?Ov(Sc(e,"stretch","fill-available"),t)+e:e}break;// position: sticky
case 4949:// (s)ticky?
if(Sf(e,t+1)!==115)break;// display: (flex|inline-flex)
case 6444:switch(Sf(e,Sh(e)-3-(~Sd(e,"!important")&&10))){// stic(k)y
case 107:return Sc(e,":",":"+SV)+e;// (inline-)?fl(e)x
case 101:return Sc(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+SV+(Sf(e,14)===45?"inline-":"")+"box$3"+"$1"+SV+"$2$3"+"$1"+SU+"$2box$3")+e}break;// writing-mode
case 5936:switch(Sf(e,t+11)){// vertical-l(r)
case 114:return SV+e+SU+Sc(e,/[svh]\w+-[tblr]{2}/,"tb")+e;// vertical-r(l)
case 108:return SV+e+SU+Sc(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;// horizontal(-)tb
case 45:return SV+e+SU+Sc(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return SV+e+SU+e+e}return e}var Og=function e(e,t,r,n){if(e.length>-1){if(!e["return"])switch(e.type){case SG:e["return"]=Ov(e.value,e.length);break;case S6:return S9([SE(e,{value:Sc(e.value,"@","@"+SV)})],n);case Sz:if(e.length)return Sm(e.props,function(t){switch(Su(t,/(::plac\w+|:read-\w+)/)){// :read-(only|write)
case":read-only":case":read-write":return S9([SE(e,{props:[Sc(t,/:(read-\w+)/,":"+Sq+"$1")]})],n);// :placeholder
case"::placeholder":return S9([SE(e,{props:[Sc(t,/:(plac\w+)/,":"+SV+"input-$1")]}),SE(e,{props:[Sc(t,/:(plac\w+)/,":"+Sq+"$1")]}),SE(e,{props:[Sc(t,/:(plac\w+)/,SU+"input-$1")]})],n)}return""})}}};var Om=[Og];var Ob=function e(e){var t=e.key;if(t==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");// get SSRed styles out of the way of React's hydration
// document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)
// note this very very intentionally targets all style elements regardless of the key to ensure
// that creating a cache works inside of render of a React component
Array.prototype.forEach.call(r,function(e){// we want to only move elements which have a space in the data-emotion attribute value
// because that indicates that it is an Emotion 11 server-side rendered style elements
// while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector
// Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)
// so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles
// will not result in the Emotion 10 styles being destroyed
var t=e.getAttribute("data-emotion");if(t.indexOf(" ")===-1){return}document.head.appendChild(e);e.setAttribute("data-s","")})}var n=e.stylisPlugins||Om;var i={};var a;var o=[];{a=e.container||document.head;Array.prototype.forEach.call(// means that the style elements we're looking at are only Emotion 11 server-rendered style elements
document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){var t=e.getAttribute("data-emotion").split(" ");for(var r=1;r<t.length;r++){i[t[r]]=true}o.push(e)})}var s;var l=[Op,Oh];{var u;var c=[S7,Ot(function(e){u.insert(e)})];var d=Oe(l.concat(n,c));var f=function e(e){return S9(Oi(e),d)};s=function e(e,t,r,n){u=r;f(e?e+"{"+t.styles+"}":t.styles);if(n){p.inserted[t.name]=true}}}var p={key:t,sheet:new Sn({key:t,container:a,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:s};p.sheet.hydrate(o);return p};// EXTERNAL MODULE: ./node_modules/@emotion/react/dist/emotion-element-d59e098f.esm.js
var Oy=r(8663);// EXTERNAL MODULE: ../tutor/node_modules/cssjanus/src/cssjanus.js
var O_=r(4131);var Ow=/*#__PURE__*/r.n(O_);// CONCATENATED MODULE: ../tutor/node_modules/stylis/src/Enum.js
var Ox="-ms-";var OA="-moz-";var Ok="-webkit-";var OE="comm";var OI="rule";var OC="decl";var OY="@page";var OT="@media";var OS="@import";var OO="@charset";var OD="@viewport";var OF="@supports";var OR="@document";var OP="@namespace";var OM="@keyframes";var OH="@font-face";var ON="@counter-style";var OL="@font-feature-values";var OK="@layer";var OB="@scope";// CONCATENATED MODULE: ../tutor/node_modules/stylis/src/Serializer.js
/**
 * @param {object[]} children
 * @param {function} callback
 * @return {string}
 */function Oj(e,t){var r="";for(var n=0;n<e.length;n++)r+=t(e[n],n,e,t)||"";return r}/**
 * @param {object} element
 * @param {number} index
 * @param {object[]} children
 * @param {function} callback
 * @return {string}
 */function OU(e,t,r,n){switch(e.type){case LAYER:if(e.children.length)break;case IMPORT:case NAMESPACE:case DECLARATION:return e.return=e.return||e.value;case COMMENT:return"";case KEYFRAMES:return e.return=e.value+"{"+Oj(e.children,n)+"}";case RULESET:if(!strlen(e.value=e.props.join(",")))return""}return strlen(r=Oj(e.children,n))?e.return=e.value+"{"+r+"}":""};// CONCATENATED MODULE: ../tutor/node_modules/stylis/src/Utility.js
/**
 * @param {number}
 * @return {number}
 */var Oq=Math.abs;/**
 * @param {number}
 * @return {string}
 */var OV=String.fromCharCode;/**
 * @param {object}
 * @return {object}
 */var OW=Object.assign;/**
 * @param {string} value
 * @param {number} length
 * @return {number}
 */function Oz(e,t){return OJ(e,0)^45?(((t<<2^OJ(e,0))<<2^OJ(e,1))<<2^OJ(e,2))<<2^OJ(e,3):0}/**
 * @param {string} value
 * @return {string}
 */function OG(e){return e.trim()}/**
 * @param {string} value
 * @param {RegExp} pattern
 * @return {string?}
 */function OQ(e,t){return(e=t.exec(e))?e[0]:e}/**
 * @param {string} value
 * @param {(string|RegExp)} pattern
 * @param {string} replacement
 * @return {string}
 */function O$(e,t,r){return e.replace(t,r)}/**
 * @param {string} value
 * @param {string} search
 * @param {number} position
 * @return {number}
 */function OX(e,t,r){return e.indexOf(t,r)}/**
 * @param {string} value
 * @param {number} index
 * @return {number}
 */function OJ(e,t){return e.charCodeAt(t)|0}/**
 * @param {string} value
 * @param {number} begin
 * @param {number} end
 * @return {string}
 */function OZ(e,t,r){return e.slice(t,r)}/**
 * @param {string} value
 * @return {number}
 */function O0(e){return e.length}/**
 * @param {any[]} value
 * @return {number}
 */function O1(e){return e.length}/**
 * @param {any} value
 * @param {any[]} array
 * @return {any}
 */function O2(e,t){return t.push(e),e}/**
 * @param {string[]} array
 * @param {function} callback
 * @return {string}
 */function O6(e,t){return e.map(t).join("")}/**
 * @param {string[]} array
 * @param {RegExp} pattern
 * @return {string[]}
 */function O4(e,t){return e.filter(function(e){return!OQ(e,t)})};// CONCATENATED MODULE: ../tutor/node_modules/stylis/src/Tokenizer.js
var O5=1;var O3=1;var O8=0;var O9=0;var O7=0;var De="";/**
 * @param {string} value
 * @param {object | null} root
 * @param {object | null} parent
 * @param {string} type
 * @param {string[] | string} props
 * @param {object[] | string} children
 * @param {object[]} siblings
 * @param {number} length
 */function Dt(e,t,r,n,i,a,o,s){return{value:e,root:t,parent:r,type:n,props:i,children:a,line:O5,column:O3,length:o,return:"",siblings:s}}/**
 * @param {object} root
 * @param {object} props
 * @return {object}
 */function Dr(e,t){return assign(Dt("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}/**
 * @param {object} root
 */function Dn(e){while(e.root)e=Dr(e.root,{children:[e]});append(e,e.siblings)}/**
 * @return {number}
 */function Di(){return O7}/**
 * @return {number}
 */function Da(){O7=O9>0?OJ(De,--O9):0;if(O3--,O7===10)O3=1,O5--;return O7}/**
 * @return {number}
 */function Do(){O7=O9<O8?OJ(De,O9++):0;if(O3++,O7===10)O3=1,O5++;return O7}/**
 * @return {number}
 */function Ds(){return OJ(De,O9)}/**
 * @return {number}
 */function Dl(){return O9}/**
 * @param {number} begin
 * @param {number} end
 * @return {string}
 */function Du(e,t){return OZ(De,e,t)}/**
 * @param {number} type
 * @return {number}
 */function Dc(e){switch(e){// \0 \t \n \r \s whitespace token
case 0:case 9:case 10:case 13:case 32:return 5;// ! + , / > @ ~ isolate token
case 33:case 43:case 44:case 47:case 62:case 64:case 126:// ; { } breakpoint token
case 59:case 123:case 125:return 4;// : accompanied token
case 58:return 3;// " ' ( [ opening delimit token
case 34:case 39:case 40:case 91:return 2;// ) ] closing delimit token
case 41:case 93:return 1}return 0}/**
 * @param {string} value
 * @return {any[]}
 */function Dd(e){return O5=O3=1,O8=O0(De=e),O9=0,[]}/**
 * @param {any} value
 * @return {any}
 */function Df(e){return De="",e}/**
 * @param {number} type
 * @return {string}
 */function Dp(e){return OG(Du(O9-1,Db(e===91?e+2:e===40?e+1:e)))}/**
 * @param {string} value
 * @return {string[]}
 */function Dh(e){return Df(Dg(Dd(e)))}/**
 * @param {number} type
 * @return {string}
 */function Dv(e){while(O7=Ds())if(O7<33)Do();else break;return Dc(e)>2||Dc(O7)>3?"":" "}/**
 * @param {string[]} children
 * @return {string[]}
 */function Dg(e){while(Do())switch(Dc(O7)){case 0:append(D_(O9-1),e);break;case 2:append(Dp(O7),e);break;default:append(from(O7),e)}return e}/**
 * @param {number} index
 * @param {number} count
 * @return {string}
 */function Dm(e,t){while(--t&&Do())// not 0-9 A-F a-f
if(O7<48||O7>102||O7>57&&O7<65||O7>70&&O7<97)break;return Du(e,Dl()+(t<6&&Ds()==32&&Do()==32))}/**
 * @param {number} type
 * @return {number}
 */function Db(e){while(Do())switch(O7){// ] ) " '
case e:return O9;// " '
case 34:case 39:if(e!==34&&e!==39)Db(O7);break;// (
case 40:if(e===41)Db(e);break;// \
case 92:Do();break}return O9}/**
 * @param {number} type
 * @param {number} index
 * @return {number}
 */function Dy(e,t){while(Do())// //
if(e+O7===47+10)break;else if(e+O7===42+42&&Ds()===47)break;return"/*"+Du(t,O9-1)+"*"+OV(e===47?e:Do())}/**
 * @param {number} index
 * @return {string}
 */function D_(e){while(!Dc(Ds()))Do();return Du(e,O9)};// CONCATENATED MODULE: ../tutor/node_modules/stylis/src/Parser.js
/**
 * @param {string} value
 * @return {object[]}
 */function Dw(e){return Df(Dx("",null,null,null,[""],e=Dd(e),0,[0],e))}/**
 * @param {string} value
 * @param {object} root
 * @param {object?} parent
 * @param {string[]} rule
 * @param {string[]} rules
 * @param {string[]} rulesets
 * @param {number[]} pseudo
 * @param {number[]} points
 * @param {string[]} declarations
 * @return {object}
 */function Dx(e,t,r,n,i,a,o,s,l){var u=0;var c=0;var d=o;var f=0;var p=0;var h=0;var v=1;var g=1;var m=1;var b=0;var y="";var _=i;var w=a;var x=n;var A=y;while(g)switch(h=b,b=Do()){// (
case 40:if(h!=108&&OJ(A,d-1)==58){if(OX(A+=O$(Dp(b),"&","&\f"),"&\f",Oq(u?s[u-1]:0))!=-1)m=-1;break}// " ' [
case 34:case 39:case 91:A+=Dp(b);break;// \t \n \r \s
case 9:case 10:case 13:case 32:A+=Dv(h);break;// \
case 92:A+=Dm(Dl()-1,7);continue;// /
case 47:switch(Ds()){case 42:case 47:O2(Dk(Dy(Do(),Dl()),t,r,l),l);if((Dc(h||1)==5||Dc(Ds()||1)==5)&&O0(A)&&OZ(A,-1,void 0)!==" ")A+=" ";break;default:A+="/"}break;// {
case 123*v:s[u++]=O0(A)*m;// } ; \0
case 125*v:case 59:case 0:switch(b){// \0 }
case 0:case 125:g=0;// ;
case 59+c:if(m==-1)A=O$(A,/\f/g,"");if(p>0&&(O0(A)-d||v===0&&h===47))O2(p>32?DE(A+";",n,r,d-1,l):DE(O$(A," ","")+";",n,r,d-2,l),l);break;// @ ;
case 59:A+=";";// { rule/at-rule
default:O2(x=DA(A,t,r,u,c,i,s,y,_=[],w=[],d,a),a);if(b===123)if(c===0)Dx(A,t,x,x,_,a,d,s,w);else{switch(f){// c(ontainer)
case 99:if(OJ(A,3)===110)break;// l(ayer)
case 108:if(OJ(A,2)===97)break;default:c=0;// d(ocument) m(edia) s(upports)
case 100:case 109:case 115:}if(c)Dx(e,x,x,n&&O2(DA(e,x,x,0,0,i,s,y,i,_=[],d,w),w),i,w,d,s,n?_:w);else Dx(A,x,x,x,[""],w,0,s,w)}}u=c=p=0,v=m=1,y=A="",d=o;break;// :
case 58:d=1+O0(A),p=h;default:if(v<1){if(b==123)--v;else if(b==125&&v++==0&&Da()==125)continue}switch(A+=OV(b),b*v){// &
case 38:m=c>0?1:(A+="\f",-1);break;// ,
case 44:s[u++]=(O0(A)-1)*m,m=1;break;// @
case 64:// -
if(Ds()===45)A+=Dp(Do());f=Ds(),c=d=O0(y=A+=D_(Dl())),b++;break;// -
case 45:if(h===45&&O0(A)==2)v=0}}return a}/**
 * @param {string} value
 * @param {object} root
 * @param {object?} parent
 * @param {number} index
 * @param {number} offset
 * @param {string[]} rules
 * @param {number[]} points
 * @param {string} type
 * @param {string[]} props
 * @param {string[]} children
 * @param {number} length
 * @param {object[]} siblings
 * @return {object}
 */function DA(e,t,r,n,i,a,o,s,l,u,c,d){var f=i-1;var p=i===0?a:[""];var h=O1(p);for(var v=0,g=0,m=0;v<n;++v)for(var b=0,y=OZ(e,f+1,f=Oq(g=o[v])),_=e;b<h;++b)if(_=OG(g>0?p[b]+" "+y:O$(y,/&\f/g,p[b])))l[m++]=_;return Dt(e,t,r,i===0?OI:s,l,u,c,d)}/**
 * @param {number} value
 * @param {object} root
 * @param {object?} parent
 * @param {object[]} siblings
 * @return {object}
 */function Dk(e,t,r,n){return Dt(e,t,r,OE,OV(Di()),OZ(e,2,-2),0,n)}/**
 * @param {string} value
 * @param {object} root
 * @param {object?} parent
 * @param {number} length
 * @param {object[]} siblings
 * @return {object}
 */function DE(e,t,r,n,i){return Dt(e,t,r,OC,OZ(e,0,n),OZ(e,n+1,-1),n,i)};// CONCATENATED MODULE: ../tutor/node_modules/stylis-plugin-rtl/dist/stylis-rtl.js
function DI(e,t,r){switch(e.type){case OS:case OC:case OE:return e.return=e.return||e.value;case OI:{e.value=Array.isArray(e.props)?e.props.join(","):e.props;if(Array.isArray(e.children)){e.children.forEach(function(e){if(e.type===OE)e.children=e.value})}}}var n=Oj(Array.prototype.concat(e.children),DI);return O0(n)?e.return=e.value+"{"+n+"}":""}function DC(e,t,r,n){if(e.type===OM||e.type===OF||e.type===OI&&(!e.parent||e.parent.type===OT||e.parent.type===OI)){var i=Ow().transform(DI(e,t,r));e.children=i?Dw(i)[0].children:[];e.return=""}}// stable identifier that will not be dropped by minification unless the whole module
// is unused
Object.defineProperty(DC,"name",{value:"stylisRTLPlugin"});/* ESM default export */const DY=DC;//# sourceMappingURL=stylis-rtl.js.map
;// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/RTLProvider.tsx
var DT=Ob({stylisPlugins:[DY],key:"rtl"});var DS=e=>{var{children:r}=e;if(aT/* .isRTL */.V8){return/*#__PURE__*/(0,t/* .jsx */.Y)(Oy.C,{value:DT,children:r})}return/*#__PURE__*/(0,t/* .jsx */.Y)(t/* .Fragment */.FK,{children:r})};/* ESM default export */const DO=DS;// CONCATENATED MODULE: ./addons/content-bank/assets/react/manage-contents/components/layout/App.tsx
function DD(){var[e]=(0,n.useState)(()=>new es({defaultOptions:{queries:{retry:false,refetchOnWindowFocus:false,networkMode:"always"},mutations:{retry:false,networkMode:"always"}}}));return/*#__PURE__*/(0,t/* .jsx */.Y)(DO,{children:/*#__PURE__*/(0,t/* .jsx */.Y)(ed,{client:e,children:/*#__PURE__*/(0,t/* .jsx */.Y)(fH,{position:"bottom-center",children:/*#__PURE__*/(0,t/* .jsxs */.FD)(av,{children:[/*#__PURE__*/(0,t/* .jsx */.Y)(o/* .Global */.mL,{styles:[(0,eB/* .createGlobalCss */.v)()]}),/*#__PURE__*/(0,t/* .jsx */.Y)(T7,{})]})})})})}/* ESM default export */const DF=DD;// CONCATENATED MODULE: ./addons/content-bank/assets/react/manage-contents.tsx
var DR=a.createRoot(document.getElementById("tutor-content-bank-root"));DR.render(/*#__PURE__*/(0,t/* .jsx */.Y)(i().StrictMode,{children:/*#__PURE__*/(0,t/* .jsx */.Y)(oT,{children:/*#__PURE__*/(0,t/* .jsx */.Y)(DF,{})})}))})()})();