"use strict";(self["webpackChunktutor"]=self["webpackChunktutor"]||[]).push([["410"],{79017:function(e,t,n){n.d(t,{Aw:()=>o,L4:()=>s,bO:()=>l});/* import */var r=n(41594);/* import */var i=/*#__PURE__*/n.n(r);const a={display:"none"};function o(e){let{id:t,value:n}=e;return i().createElement("div",{id:t,style:a},n)}function s(e){let{id:t,announcement:n,ariaLiveType:r="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":r,"aria-atomic":true},n)}function l(){const[e,t]=(0,r.useState)("");const n=(0,r.useCallback)(e=>{if(e!=null){t(e)}},[]);return{announce:n,announcement:e}}//# sourceMappingURL=accessibility.esm.js.map
},7697:function(e,t,n){n.d(t,{AN:()=>eY,FR:()=>_,Hd:()=>tT,MS:()=>m,Mp:()=>tc,PM:()=>tf,Pf:()=>eO,Sj:()=>W,Vy:()=>I,fF:()=>tg,fp:()=>C,sl:()=>j,uN:()=>eb,vL:()=>eg,y$:()=>D,zM:()=>tb});/* import */var r=n(41594);/* import */var i=/*#__PURE__*/n.n(r);/* import */var a=n(75206);/* import */var o=/*#__PURE__*/n.n(a);/* import */var s=n(37893);/* import */var l=n(79017);const u=/*#__PURE__*/(0,r.createContext)(null);function d(e){const t=(0,r.useContext)(u);(0,r.useEffect)(()=>{if(!t){throw new Error("useDndMonitor must be used within a children of <DndContext>")}const n=t(e);return n},[e,t])}function c(){const[e]=(0,r.useState)(()=>new Set);const t=(0,r.useCallback)(t=>{e.add(t);return()=>e.delete(t)},[e]);const n=(0,r.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>{var t;return(t=e[n])==null?void 0:t.call(e,r)})},[e]);return[n,t]}const p={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 h={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;if(n){return"Draggable item "+t.id+" was moved over droppable area "+n.id+"."}return"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;if(n){return"Draggable item "+t.id+" was dropped over droppable area "+n.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 v(e){let{announcements:t=h,container:n,hiddenTextDescribedById:o,screenReaderInstructions:u=p}=e;const{announce:c,announcement:v}=(0,l/* .useAnnouncement */.bO)();const f=(0,s/* .useUniqueId */.YG)("DndLiveRegion");const[g,m]=(0,r.useState)(false);(0,r.useEffect)(()=>{m(true)},[]);d((0,r.useMemo)(()=>({onDragStart(e){let{active:n}=e;c(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;if(t.onDragMove){c(t.onDragMove({active:n,over:r}))}},onDragOver(e){let{active:n,over:r}=e;c(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;c(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;c(t.onDragCancel({active:n,over:r}))}}),[c,t]));if(!g){return null}const _=i().createElement(i().Fragment,null,i().createElement(l/* .HiddenText */.Aw,{id:o,value:u.draggable}),i().createElement(l/* .LiveRegion */.L4,{id:f,announcement:v}));return n?(0,a.createPortal)(_,n):_}var f;(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"})(f||(f={}));function g(){}function m(e,t){return(0,r.useMemo)(()=>({sensor:e,options:t!=null?t:{}}),[e,t])}function _(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return(0,r.useMemo)(()=>[...t].filter(e=>e!=null),[...t])}const b=/*#__PURE__*/Object.freeze({x:0,y:0});/**
 * Returns the distance between two points
 */function y(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function w(e,t){const n=(0,s/* .getEventCoordinates */.e_)(e);if(!n){return"0 0"}const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}/**
 * Sort collisions from smallest to greatest value
 */function A(e,t){let{data:{value:n}}=e;let{data:{value:r}}=t;return n-r}/**
 * Sort collisions from greatest to smallest value
 */function Y(e,t){let{data:{value:n}}=e;let{data:{value:r}}=t;return r-n}/**
 * Returns the coordinates of the corners of a given rectangle:
 * [TopLeft {x, y}, TopRight {x, y}, BottomLeft {x, y}, BottomRight {x, y}]
 */function k(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function I(e,t){if(!e||e.length===0){return null}const[n]=e;return t?n[t]:n}/**
 * Returns the coordinates of the center of a given ClientRect
 */function q(e,t,n){if(t===void 0){t=e.left}if(n===void 0){n=e.top}return{x:t+e.width*.5,y:n+e.height*.5}}/**
 * Returns the closest rectangles from an array of rectangles to the center of a given
 * rectangle.
 */const C=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=q(t,t.left,t.top);const a=[];for(const e of r){const{id:t}=e;const r=n.get(t);if(r){const n=y(q(r),i);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(A)};/**
 * Returns the closest rectangles from an array of rectangles to the corners of
 * another rectangle.
 */const D=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=k(t);const a=[];for(const e of r){const{id:t}=e;const r=n.get(t);if(r){const n=k(r);const o=i.reduce((e,t,r)=>{return e+y(n[r],t)},0);const s=Number((o/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:s}})}}return a.sort(A)};/**
 * Returns the intersecting rectangle area between two rectangles
 */function E(e,t){const n=Math.max(t.top,e.top);const r=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-r;const s=a-n;if(r<i&&n<a){const n=t.width*t.height;const r=e.width*e.height;const i=o*s;const a=i/(n+r-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 S=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const e of r){const{id:r}=e;const a=n.get(r);if(a){const n=E(a,t);if(n>0){i.push({id:r,data:{droppableContainer:e,value:n}})}}}return i.sort(Y)};/**
 * Check if a given point is contained within a bounding rectangle
 */function z(e,t){const{top:n,left:r,bottom:i,right:a}=t;return n<=e.y&&e.y<=i&&r<=e.x&&e.x<=a}/**
 * Returns the rectangles that the pointer is hovering over
 */const T=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(!r){return[]}const i=[];for(const e of t){const{id:t}=e;const a=n.get(t);if(a&&z(r,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 n=k(a);const o=n.reduce((e,t)=>{return e+y(r,t)},0);const s=Number((o/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:s}})}}return i.sort(A)};function M(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function H(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:b}function P(e){return function t(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++){r[i-1]=arguments[i]}return r.reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}const O=/*#__PURE__*/P(1);function F(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 N(e,t,n){const r=F(t);if(!r){return e}const{scaleX:i,scaleY:a,x:o,y:s}=r;const l=e.left-o-(1-i)*parseFloat(n);const u=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(" ")+1));const d=i?e.width/i:e.width;const c=a?e.height/a:e.height;return{width:d,height:c,top:u,right:l+d,bottom:u+c,left:l}}const K={ignoreTransform:false};/**
 * Returns the bounding client rect of an element relative to the viewport.
 */function W(e,t){if(t===void 0){t=K}let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=(0,s/* .getWindow */.zk)(e).getComputedStyle(e);if(t){n=N(n,t,r)}}const{top:r,left:i,width:a,height:o,bottom:l,right:u}=n;return{top:r,left:i,width:a,height:o,bottom:l,right:u}}/**
 * 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 R(e){return W(e,{ignoreTransform:true})}function L(e){const t=e.innerWidth;const n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function U(e,t){if(t===void 0){t=(0,s/* .getWindow */.zk)(e).getComputedStyle(e)}return t.position==="fixed"}function B(e,t){if(t===void 0){t=(0,s/* .getWindow */.zk)(e).getComputedStyle(e)}const n=/(auto|scroll|overlay)/;const r=["overflow","overflowX","overflowY"];return r.some(e=>{const r=t[e];return typeof r==="string"?n.test(r):false})}function j(e,t){const n=[];function r(i){if(t!=null&&n.length>=t){return n}if(!i){return n}if((0,s/* .isDocument */.wz)(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement)){n.push(i.scrollingElement);return n}if(!(0,s/* .isHTMLElement */.sb)(i)||(0,s/* .isSVGElement */.xZ)(i)){return n}if(n.includes(i)){return n}const a=(0,s/* .getWindow */.zk)(e).getComputedStyle(i);if(i!==e){if(B(i,a)){n.push(i)}}if(U(i,a)){return n}return r(i.parentNode)}if(!e){return n}return r(e)}function V(e){const[t]=j(e,1);return t!=null?t:null}function Q(e){if(!s/* .canUseDOM */.Sw||!e){return null}if((0,s/* .isWindow */.l6)(e)){return e}if(!(0,s/* .isNode */.Ll)(e)){return null}if((0,s/* .isDocument */.wz)(e)||e===(0,s/* .getOwnerDocument */.TW)(e).scrollingElement){return window}if((0,s/* .isHTMLElement */.sb)(e)){return e}return null}function G(e){if((0,s/* .isWindow */.l6)(e)){return e.scrollX}return e.scrollLeft}function $(e){if((0,s/* .isWindow */.l6)(e)){return e.scrollY}return e.scrollTop}function X(e){return{x:G(e),y:$(e)}}var Z;(function(e){e[e["Forward"]=1]="Forward";e[e["Backward"]=-1]="Backward"})(Z||(Z={}));function J(e){if(!s/* .canUseDOM */.Sw||!e){return false}return e===document.scrollingElement}function ee(e){const t={x:0,y:0};const n=J(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth};const r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};const i=e.scrollTop<=t.y;const a=e.scrollLeft<=t.x;const o=e.scrollTop>=r.y;const s=e.scrollLeft>=r.x;return{isTop:i,isLeft:a,isBottom:o,isRight:s,maxScroll:r,minScroll:t}}const et={x:.2,y:.2};function en(e,t,n,r,i){let{top:a,left:o,right:s,bottom:l}=n;if(r===void 0){r=10}if(i===void 0){i=et}const{isTop:u,isBottom:d,isLeft:c,isRight:p}=ee(e);const h={x:0,y:0};const v={x:0,y:0};const f={height:t.height*i.y,width:t.width*i.x};if(!u&&a<=t.top+f.height){// Scroll Up
h.y=Z.Backward;v.y=r*Math.abs((t.top+f.height-a)/f.height)}else if(!d&&l>=t.bottom-f.height){// Scroll Down
h.y=Z.Forward;v.y=r*Math.abs((t.bottom-f.height-l)/f.height)}if(!p&&s>=t.right-f.width){// Scroll Right
h.x=Z.Forward;v.x=r*Math.abs((t.right-f.width-s)/f.width)}else if(!c&&o<=t.left+f.width){// Scroll Left
h.x=Z.Backward;v.x=r*Math.abs((t.left+f.width-o)/f.width)}return{direction:h,speed:v}}function er(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:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function ei(e){return e.reduce((e,t)=>{return(0,s/* .add */.WQ)(e,X(t))},b)}function ea(e){return e.reduce((e,t)=>{return e+G(t)},0)}function eo(e){return e.reduce((e,t)=>{return e+$(t)},0)}function es(e,t){if(t===void 0){t=W}if(!e){return}const{top:n,left:r,bottom:i,right:a}=t(e);const o=V(e);if(!o){return}if(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth){e.scrollIntoView({block:"center",inline:"center"})}}const el=[["x",["left","right"],ea],["y",["top","bottom"],eo]];class eu{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 n=j(t);const r=ei(n);this.rect={...e};this.width=e.width;this.height=e.height;for(const[e,t,i]of el){for(const a of t){Object.defineProperty(this,a,{get:()=>{const t=i(n);const o=r[e]-t;return this.rect[a]+o},enumerable:true})}}Object.defineProperty(this,"rect",{enumerable:false})}}class ed{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,n){var r;(r=this.target)==null?void 0:r.addEventListener(e,t,n);this.listeners.push([e,t,n])}}function ec(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}=(0,s/* .getWindow */.zk)(e);return e instanceof t?e:(0,s/* .getOwnerDocument */.TW)(e)}function ep(e,t){const n=Math.abs(e.x);const r=Math.abs(e.y);if(typeof t==="number"){return Math.sqrt(n**2+r**2)>t}if("x"in t&&"y"in t){return n>t.x&&r>t.y}if("x"in t){return n>t.x}if("y"in t){return r>t.y}return false}var eh;(function(e){e["Click"]="click";e["DragStart"]="dragstart";e["Keydown"]="keydown";e["ContextMenu"]="contextmenu";e["Resize"]="resize";e["SelectionChange"]="selectionchange";e["VisibilityChange"]="visibilitychange"})(eh||(eh={}));function ev(e){e.preventDefault()}function ef(e){e.stopPropagation()}var eg;(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"})(eg||(eg={}));const em={start:[eg.Space,eg.Enter],cancel:[eg.Esc],end:[eg.Space,eg.Enter,eg.Tab]};const e_=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case eg.Right:return{...n,x:n.x+25};case eg.Left:return{...n,x:n.x-25};case eg.Down:return{...n,y:n.y+25};case eg.Up:return{...n,y:n.y-25}}return undefined};class eb{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 ed((0,s/* .getOwnerDocument */.TW)(t));this.windowListeners=new ed((0,s/* .getWindow */.zk)(t));this.handleKeyDown=this.handleKeyDown.bind(this);this.handleCancel=this.handleCancel.bind(this);this.attach()}attach(){this.handleStart();this.windowListeners.add(eh.Resize,this.handleCancel);this.windowListeners.add(eh.VisibilityChange,this.handleCancel);setTimeout(()=>this.listeners.add(eh.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props;const n=e.node.current;if(n){es(n)}t(b)}handleKeyDown(e){if((0,s/* .isKeyboardEvent */.kx)(e)){const{active:t,context:n,options:r}=this.props;const{keyboardCodes:i=em,coordinateGetter:a=e_,scrollBehavior:o="smooth"}=r;const{code:l}=e;if(i.end.includes(l)){this.handleEnd(e);return}if(i.cancel.includes(l)){this.handleCancel(e);return}const{collisionRect:u}=n.current;const d=u?{x:u.left,y:u.top}:b;if(!this.referenceCoordinates){this.referenceCoordinates=d}const c=a(e,{active:t,context:n.current,currentCoordinates:d});if(c){const t=(0,s/* .subtract */.Re)(c,d);const r={x:0,y:0};const{scrollableAncestors:i}=n.current;for(const n of i){const i=e.code;const{isTop:a,isRight:s,isLeft:l,isBottom:u,maxScroll:d,minScroll:p}=ee(n);const h=er(n);const v={x:Math.min(i===eg.Right?h.right-h.width/2:h.right,Math.max(i===eg.Right?h.left:h.left+h.width/2,c.x)),y:Math.min(i===eg.Down?h.bottom-h.height/2:h.bottom,Math.max(i===eg.Down?h.top:h.top+h.height/2,c.y))};const f=i===eg.Right&&!s||i===eg.Left&&!l;const g=i===eg.Down&&!u||i===eg.Up&&!a;if(f&&v.x!==c.x){const e=n.scrollLeft+t.x;const a=i===eg.Right&&e<=d.x||i===eg.Left&&e>=p.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
n.scrollTo({left:e,behavior:o});return}if(a){r.x=n.scrollLeft-e}else{r.x=i===eg.Right?n.scrollLeft-d.x:n.scrollLeft-p.x}if(r.x){n.scrollBy({left:-r.x,behavior:o})}break}else if(g&&v.y!==c.y){const e=n.scrollTop+t.y;const a=i===eg.Down&&e<=d.y||i===eg.Up&&e>=p.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
n.scrollTo({top:e,behavior:o});return}if(a){r.y=n.scrollTop-e}else{r.y=i===eg.Down?n.scrollTop-d.y:n.scrollTop-p.y}if(r.y){n.scrollBy({top:-r.y,behavior:o})}break}}this.handleMove(e,(0,s/* .add */.WQ)((0,s/* .subtract */.Re)(c,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault();n(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()}}eb.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=em,onActivation:i}=t;let{active:a}=n;const{code:o}=e.nativeEvent;if(r.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 ey(e){return Boolean(e&&"distance"in e)}function ew(e){return Boolean(e&&"delay"in e)}class ex{constructor(e,t,n){var r;if(n===void 0){n=ec(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=(0,s/* .getOwnerDocument */.TW)(a);this.documentListeners=new ed(this.document);this.listeners=new ed(n);this.windowListeners=new ed((0,s/* .getWindow */.zk)(a));this.initialCoordinates=(r=(0,s/* .getEventCoordinates */.e_)(i))!=null?r:b;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:n}}}=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(eh.Resize,this.handleCancel);this.windowListeners.add(eh.DragStart,ev);this.windowListeners.add(eh.VisibilityChange,this.handleCancel);this.windowListeners.add(eh.ContextMenu,ev);this.documentListeners.add(eh.Keydown,this.handleKeydown);if(t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options})){return this.handleStart()}if(ew(t)){this.timeoutId=setTimeout(this.handleStart,t.delay);this.handlePending(t);return}if(ey(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:n,onPending:r}=this.props;r(n,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(eh.Click,ef,{capture:true});// Remove any text selection from the document
this.removeTextSelection();// Prevent further text selection while dragging
this.documentListeners.add(eh.SelectionChange,this.removeTextSelection);t(e)}}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:i}=this;const{onMove:a,options:{activationConstraint:o}}=i;if(!r){return}const l=(t=(0,s/* .getEventCoordinates */.e_)(e))!=null?t:b;const u=(0,s/* .subtract */.Re)(r,l);// Constraint validation
if(!n&&o){if(ey(o)){if(o.tolerance!=null&&ep(u,o.tolerance)){return this.handleCancel()}if(ep(u,o.distance)){return this.handleStart()}}if(ew(o)){if(ep(u,o.tolerance)){return this.handleCancel()}}this.handlePending(o,u);return}if(e.cancelable){e.preventDefault()}a(l)}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===eg.Esc){this.handleCancel()}}removeTextSelection(){var e;(e=this.document.getSelection())==null?void 0:e.removeAllRanges()}}const eA={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class eY extends ex{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 n=(0,s/* .getOwnerDocument */.TW)(t.target);super(e,eA,n)}}eY.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e;let{onActivation:r}=t;if(!n.isPrimary||n.button!==0){return false}r==null?void 0:r({event:n});return true}}];const ek={move:{name:"mousemove"},end:{name:"mouseup"}};var eI;(function(e){e[e["RightClick"]=2]="RightClick"})(eI||(eI={}));class eq extends ex{constructor(e){super(e,ek,(0,s/* .getOwnerDocument */.TW)(e.event.target))}}eq.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e;let{onActivation:r}=t;if(n.button===eI.RightClick){return false}r==null?void 0:r({event:n});return true}}];const eC={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class eD extends ex{constructor(e){super(e,eC)}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(eC.move.name,e,{capture:false,passive:false});return function t(){window.removeEventListener(eC.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(){}}}eD.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e;let{onActivation:r}=t;const{touches:i}=n;if(i.length>1){return false}r==null?void 0:r({event:n});return true}}];var eE;(function(e){e[e["Pointer"]=0]="Pointer";e[e["DraggableRect"]=1]="DraggableRect"})(eE||(eE={}));var eS;(function(e){e[e["TreeOrder"]=0]="TreeOrder";e[e["ReversedTreeOrder"]=1]="ReversedTreeOrder"})(eS||(eS={}));function ez(e){let{acceleration:t,activator:n=eE.Pointer,canScroll:i,draggingRect:a,enabled:o,interval:l=5,order:u=eS.TreeOrder,pointerCoordinates:d,scrollableAncestors:c,scrollableAncestorRects:p,delta:h,threshold:v}=e;const f=eM({delta:h,disabled:!o});const[g,m]=(0,s/* .useInterval */.$$)();const _=(0,r.useRef)({x:0,y:0});const b=(0,r.useRef)({x:0,y:0});const y=(0,r.useMemo)(()=>{switch(n){case eE.Pointer:return d?{top:d.y,bottom:d.y,left:d.x,right:d.x}:null;case eE.DraggableRect:return a}},[n,a,d]);const w=(0,r.useRef)(null);const A=(0,r.useCallback)(()=>{const e=w.current;if(!e){return}const t=_.current.x*b.current.x;const n=_.current.y*b.current.y;e.scrollBy(t,n)},[]);const Y=(0,r.useMemo)(()=>u===eS.TreeOrder?[...c].reverse():c,[u,c]);(0,r.useEffect)(()=>{if(!o||!c.length||!y){m();return}for(const e of Y){if((i==null?void 0:i(e))===false){continue}const n=c.indexOf(e);const r=p[n];if(!r){continue}const{direction:a,speed:o}=en(e,r,y,t,v);for(const e of["x","y"]){if(!f[e][a[e]]){o[e]=0;a[e]=0}}if(o.x>0||o.y>0){m();w.current=e;g(A,l);_.current=o;b.current=a;return}}_.current={x:0,y:0};b.current={x:0,y:0};m()},[t,A,i,m,o,l,JSON.stringify(y),JSON.stringify(f),g,c,Y,p,JSON.stringify(v)])}const eT={x:{[Z.Backward]:false,[Z.Forward]:false},y:{[Z.Backward]:false,[Z.Forward]:false}};function eM(e){let{delta:t,disabled:n}=e;const r=(0,s/* .usePrevious */.ZC)(t);return(0,s/* .useLazyMemo */.KG)(e=>{if(n||!r||!e){// Reset scroll intent tracking when auto-scrolling is disabled
return eT}const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};// Keep track of the user intent to scroll in each direction for both axis
return{x:{[Z.Backward]:e.x[Z.Backward]||i.x===-1,[Z.Forward]:e.x[Z.Forward]||i.x===1},y:{[Z.Backward]:e.y[Z.Backward]||i.y===-1,[Z.Forward]:e.y[Z.Forward]||i.y===1}}},[n,t,r])}function eH(e,t){const n=t!=null?e.get(t):undefined;const r=n?n.node.current:null;return(0,s/* .useLazyMemo */.KG)(e=>{var n;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(n=r!=null?r:e)!=null?n:null},[r,t])}function eP(e,t){return(0,r.useMemo)(()=>e.reduce((e,n)=>{const{sensor:r}=n;const i=r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}));return[...e,...i]},[]),[e,t])}var eO;(function(e){e[e["Always"]=0]="Always";e[e["BeforeDragging"]=1]="BeforeDragging";e[e["WhileDragging"]=2]="WhileDragging"})(eO||(eO={}));var eF;(function(e){e["Optimized"]="optimized"})(eF||(eF={}));const eN=/*#__PURE__*/new Map;function eK(e,t){let{dragging:n,dependencies:i,config:a}=t;const[o,l]=(0,r.useState)(null);const{frequency:u,measure:d,strategy:c}=a;const p=(0,r.useRef)(e);const h=_();const v=(0,s/* .useLatestValue */.YN)(h);const f=(0,r.useCallback)(function(e){if(e===void 0){e=[]}if(v.current){return}l(t=>{if(t===null){return e}return t.concat(e.filter(e=>!t.includes(e)))})},[v]);const g=(0,r.useRef)(null);const m=(0,s/* .useLazyMemo */.KG)(t=>{if(h&&!n){return eN}if(!t||t===eN||p.current!==e||o!=null){const t=new Map;for(let n of e){if(!n){continue}if(o&&o.length>0&&!o.includes(n.id)&&n.rect.current){// This container does not need to be re-measured
t.set(n.id,n.rect.current);continue}const e=n.node.current;const r=e?new eu(d(e),e):null;n.rect.current=r;if(r){t.set(n.id,r)}}return t}return t},[e,o,n,h,d]);(0,r.useEffect)(()=>{p.current=e},[e]);(0,r.useEffect)(()=>{if(h){return}f()},[n,h]);(0,r.useEffect)(()=>{if(o&&o.length>0){l(null)}},[JSON.stringify(o)]);(0,r.useEffect)(()=>{if(h||typeof u!=="number"||g.current!==null){return}g.current=setTimeout(()=>{f();g.current=null},u)},[u,h,f,...i]);return{droppableRects:m,measureDroppableContainers:f,measuringScheduled:o!=null};function _(){switch(c){case eO.Always:return false;case eO.BeforeDragging:return n;default:return!n}}}function eW(e,t){return(0,s/* .useLazyMemo */.KG)(n=>{if(!e){return null}if(n){return n}return typeof t==="function"?t(e):e},[t,e])}function eR(e,t){return eW(e,t)}/**
 * Returns a new MutationObserver instance.
 * If `MutationObserver` is undefined in the execution environment, returns `undefined`.
 */function eL(e){let{callback:t,disabled:n}=e;const i=(0,s/* .useEvent */._q)(t);const a=(0,r.useMemo)(()=>{if(n||typeof window==="undefined"||typeof window.MutationObserver==="undefined"){return undefined}const{MutationObserver:e}=window;return new e(i)},[i,n]);(0,r.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 eU(e){let{callback:t,disabled:n}=e;const i=(0,s/* .useEvent */._q)(t);const a=(0,r.useMemo)(()=>{if(n||typeof window==="undefined"||typeof window.ResizeObserver==="undefined"){return undefined}const{ResizeObserver:e}=window;return new e(i)},[n]);(0,r.useEffect)(()=>{return()=>a==null?void 0:a.disconnect()},[a]);return a}function eB(e){return new eu(W(e),e)}function ej(e,t,n){if(t===void 0){t=eB}const[i,a]=(0,r.useState)(null);function o(){a(r=>{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=r!=null?r:n)!=null?i:null}const a=t(e);if(JSON.stringify(r)===JSON.stringify(a)){return r}return a})}const l=eL({callback(t){if(!e){return}for(const n of t){const{type:t,target:r}=n;if(t==="childList"&&r instanceof HTMLElement&&r.contains(e)){o();break}}}});const u=eU({callback:o});(0,s/* .useIsomorphicLayoutEffect */.Es)(()=>{o();if(e){u==null?void 0:u.observe(e);l==null?void 0:l.observe(document.body,{childList:true,subtree:true})}else{u==null?void 0:u.disconnect();l==null?void 0:l.disconnect()}},[e]);return i}function eV(e){const t=eW(e);return H(e,t)}const eQ=[];function eG(e){const t=(0,r.useRef)(e);const n=(0,s/* .useLazyMemo */.KG)(n=>{if(!e){return eQ}if(n&&n!==eQ&&e&&t.current&&e.parentNode===t.current.parentNode){return n}return j(e)},[e]);(0,r.useEffect)(()=>{t.current=e},[e]);return n}function e$(e){const[t,n]=(0,r.useState)(null);const i=(0,r.useRef)(e);// To-do: Throttle the handleScroll callback
const a=(0,r.useCallback)(e=>{const t=Q(e.target);if(!t){return}n(e=>{if(!e){return null}e.set(t,X(t));return new Map(e)})},[]);(0,r.useEffect)(()=>{const t=i.current;if(e!==t){r(t);const o=e.map(e=>{const t=Q(e);if(t){t.addEventListener("scroll",a,{passive:true});return[t,X(t)]}return null}).filter(e=>e!=null);n(o.length?new Map(o):null);i.current=e}return()=>{r(e);r(t)};function r(e){e.forEach(e=>{const t=Q(e);t==null?void 0:t.removeEventListener("scroll",a)})}},[a,e]);return(0,r.useMemo)(()=>{if(e.length){return t?Array.from(t.values()).reduce((e,t)=>(0,s/* .add */.WQ)(e,t),b):ei(e)}return b},[e,t])}function eX(e,t){if(t===void 0){t=[]}const n=(0,r.useRef)(null);(0,r.useEffect)(()=>{n.current=null},t);(0,r.useEffect)(()=>{const t=e!==b;if(t&&!n.current){n.current=e}if(!t&&n.current){n.current=null}},[e]);return n.current?(0,s/* .subtract */.Re)(e,n.current):b}function eZ(e){(0,r.useEffect)(()=>{if(!s/* .canUseDOM */.Sw){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 eJ(e,t){return(0,r.useMemo)(()=>{return e.reduce((e,n)=>{let{eventName:r,handler:i}=n;e[r]=e=>{i(e,t)};return e},{})},[e,t])}function e0(e){return(0,r.useMemo)(()=>e?L(e):null,[e])}const e1=[];function e2(e,t){if(t===void 0){t=W}const[n]=e;const i=e0(n?(0,s/* .getWindow */.zk)(n):null);const[a,o]=(0,r.useState)(e1);function l(){o(()=>{if(!e.length){return e1}return e.map(e=>J(e)?i:new eu(t(e),e))})}const u=eU({callback:l});(0,s/* .useIsomorphicLayoutEffect */.Es)(()=>{u==null?void 0:u.disconnect();l();e.forEach(e=>u==null?void 0:u.observe(e))},[e]);return a}function e4(e){if(!e){return null}if(e.children.length>1){return e}const t=e.children[0];return(0,s/* .isHTMLElement */.sb)(t)?t:e}function e6(e){let{measure:t}=e;const[n,i]=(0,r.useState)(null);const a=(0,r.useCallback)(e=>{for(const{target:n}of e){if((0,s/* .isHTMLElement */.sb)(n)){i(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}}},[t]);const o=eU({callback:a});const l=(0,r.useCallback)(e=>{const n=e4(e);o==null?void 0:o.disconnect();if(n){o==null?void 0:o.observe(n)}i(n?t(n):null)},[t,o]);const[u,d]=(0,s/* .useNodeRef */.lk)(l);return(0,r.useMemo)(()=>({nodeRef:u,rect:n,setRef:d}),[n,u,d])}const e5=[{sensor:eY,options:{}},{sensor:eb,options:{}}];const e3={current:{}};const e8={draggable:{measure:R},droppable:{measure:R,strategy:eO.WhileDragging,frequency:eF.Optimized},dragOverlay:{measure:W}};class e9 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,n;return(t=(n=this.get(e))==null?void 0:n.node.current)!=null?t:undefined}}const e7={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:/*#__PURE__*/new Map,droppableRects:/*#__PURE__*/new Map,droppableContainers:/*#__PURE__*/new e9,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:g},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:e8,measureDroppableContainers:g,windowRect:null,measuringScheduled:false};const te={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:g,draggableNodes:/*#__PURE__*/new Map,over:null,measureDroppableContainers:g};const tt=/*#__PURE__*/(0,r.createContext)(te);const tn=/*#__PURE__*/(0,r.createContext)(e7);function tr(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new e9}}}function ti(e,t){switch(t.type){case f.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case f.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 f.DragEnd:case f.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case f.RegisterDroppable:{const{element:n}=t;const{id:r}=n;const i=new e9(e.droppable.containers);i.set(r,n);return{...e,droppable:{...e.droppable,containers:i}}}case f.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t;const a=e.droppable.containers.get(n);if(!a||r!==a.key){return e}const o=new e9(e.droppable.containers);o.set(n,{...a,disabled:i});return{...e,droppable:{...e.droppable,containers:o}}}case f.UnregisterDroppable:{const{id:n,key:r}=t;const i=e.droppable.containers.get(n);if(!i||r!==i.key){return e}const a=new e9(e.droppable.containers);a.delete(n);return{...e,droppable:{...e.droppable,containers:a}}}default:{return e}}}function ta(e){let{disabled:t}=e;const{active:n,activatorEvent:i,draggableNodes:a}=(0,r.useContext)(tt);const o=(0,s/* .usePrevious */.ZC)(i);const l=(0,s/* .usePrevious */.ZC)(n==null?void 0:n.id);// Restore keyboard focus on the activator node
(0,r.useEffect)(()=>{if(t){return}if(!i&&o&&l!=null){if(!(0,s/* .isKeyboardEvent */.kx)(o)){return}if(document.activeElement===o.target){// No need to restore focus
return}const e=a.get(l);if(!e){return}const{activatorNode:t,node:n}=e;if(!t.current&&!n.current){return}requestAnimationFrame(()=>{for(const e of[t.current,n.current]){if(!e){continue}const t=(0,s/* .findFirstFocusableNode */.ag)(e);if(t){t.focus();break}}})}},[i,t,a,l,o]);return null}function to(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>{return t({transform:e,...r})},n):n}function ts(e){return(0,r.useMemo)(()=>({draggable:{...e8.draggable,...e==null?void 0:e.draggable},droppable:{...e8.droppable,...e==null?void 0:e.droppable},dragOverlay:{...e8.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 tl(e){let{activeNode:t,measure:n,initialRect:i,config:a=true}=e;const o=(0,r.useRef)(false);const{x:l,y:u}=typeof a==="boolean"?{x:a,y:a}:a;(0,s/* .useIsomorphicLayoutEffect */.Es)(()=>{const e=!l&&!u;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 r=t==null?void 0:t.node.current;if(!r||r.isConnected===false){// Return early if there is no attached node ref or if the node is
// disconnected from the document.
return}const a=n(r);const s=H(a,i);if(!l){s.x=0}if(!u){s.y=0}// Only perform layout shift scroll compensation once
o.current=true;if(Math.abs(s.x)>0||Math.abs(s.y)>0){const e=V(r);if(e){e.scrollBy({top:s.y,left:s.x})}}},[t,l,u,i,n])}const tu=/*#__PURE__*/(0,r.createContext)({...b,scaleX:1,scaleY:1});var td;(function(e){e[e["Uninitialized"]=0]="Uninitialized";e[e["Initializing"]=1]="Initializing";e[e["Initialized"]=2]="Initialized"})(td||(td={}));const tc=/*#__PURE__*/(0,r.memo)(function e(e){var t,n,o,l;let{id:d,accessibility:p,autoScroll:h=true,children:g,sensors:m=e5,collisionDetection:_=S,measuring:b,modifiers:y,...w}=e;const A=(0,r.useReducer)(ti,undefined,tr);const[Y,k]=A;const[q,C]=c();const[D,E]=(0,r.useState)(td.Uninitialized);const z=D===td.Initialized;const{draggable:{active:T,nodes:H,translate:P},droppable:{containers:F}}=Y;const N=T!=null?H.get(T):null;const K=(0,r.useRef)({initial:null,translated:null});const W=(0,r.useMemo)(()=>{var e;return T!=null?{id:T,// It's possible for the active node to unmount while dragging
data:(e=N==null?void 0:N.data)!=null?e:e3,rect:K}:null},[T,N]);const R=(0,r.useRef)(null);const[L,U]=(0,r.useState)(null);const[B,j]=(0,r.useState)(null);const V=(0,s/* .useLatestValue */.YN)(w,Object.values(w));const Q=(0,s/* .useUniqueId */.YG)("DndDescribedBy",d);const G=(0,r.useMemo)(()=>F.getEnabled(),[F]);const $=ts(b);const{droppableRects:X,measureDroppableContainers:Z,measuringScheduled:J}=eK(G,{dragging:z,dependencies:[P.x,P.y],config:$.droppable});const ee=eH(H,T);const et=(0,r.useMemo)(()=>B?(0,s/* .getEventCoordinates */.e_)(B):null,[B]);const en=eF();const er=eR(ee,$.draggable.measure);tl({activeNode:T!=null?H.get(T):null,config:en.layoutShiftCompensation,initialRect:er,measure:$.draggable.measure});const ei=ej(ee,$.draggable.measure,er);const ea=ej(ee?ee.parentElement:null);const eo=(0,r.useRef)({activatorEvent:null,active:null,activeNode:ee,collisionRect:null,collisions:null,droppableRects:X,draggableNodes:H,draggingNode:null,draggingNodeRect:null,droppableContainers:F,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null});const es=F.getNodeFor((t=eo.current.over)==null?void 0:t.id);const el=e6({measure:$.dragOverlay.measure});// Use the rect of the drag overlay if it is mounted
const eu=(n=el.nodeRef.current)!=null?n:ee;const ed=z?(o=el.rect)!=null?o:ei:null;const ec=Boolean(el.nodeRef.current&&el.rect);// The delta between the previous and new position of the draggable node
// is only relevant when there is no drag overlay
const ep=eV(ec?null:ei);// Get the window rect of the dragging node
const eh=e0(eu?(0,s/* .getWindow */.zk)(eu):null);// Get scrollable ancestors of the dragging node
const ev=eG(z?es!=null?es:ee:null);const ef=e2(ev);// Apply modifiers
const eg=to(y,{transform:{x:P.x-ep.x,y:P.y-ep.y,scaleX:1,scaleY:1},activatorEvent:B,active:W,activeNodeRect:ei,containerNodeRect:ea,draggingNodeRect:ed,over:eo.current.over,overlayNodeRect:el.rect,scrollableAncestors:ev,scrollableAncestorRects:ef,windowRect:eh});const em=et?(0,s/* .add */.WQ)(et,P):null;const e_=e$(ev);// Represents the scroll delta since dragging was initiated
const eb=eX(e_);// Represents the scroll delta since the last time the active node rect was measured
const ey=eX(e_,[ei]);const ew=(0,s/* .add */.WQ)(eg,eb);const ex=ed?O(ed,eg):null;const eA=W&&ex?_({active:W,collisionRect:ex,droppableRects:X,droppableContainers:G,pointerCoordinates:em}):null;const eY=I(eA,"id");const[ek,eI]=(0,r.useState)(null);// When there is no drag overlay used, we need to account for the
// window scroll delta
const eq=ec?eg:(0,s/* .add */.WQ)(eg,ey);const eC=M(eq,(l=ek==null?void 0:ek.rect)!=null?l:null,ei);const eD=(0,r.useRef)(null);const eE=(0,r.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(R.current==null){return}const i=H.get(R.current);if(!i){return}const o=e.nativeEvent;const s=new n({active:R.current,activeNode:i,event:o,options:r,// Sensors need to be instantiated with refs for arguments that change over time
// otherwise they are frozen in time with the stale arguments
context:eo,onAbort(e){const t=H.get(e);if(!t){return}const{onDragAbort:n}=V.current;const r={id:e};n==null?void 0:n(r);q({type:"onDragAbort",event:r})},onPending(e,t,n,r){const i=H.get(e);if(!i){return}const{onDragPending:a}=V.current;const o={id:e,constraint:t,initialCoordinates:n,offset:r};a==null?void 0:a(o);q({type:"onDragPending",event:o})},onStart(e){const t=R.current;if(t==null){return}const n=H.get(t);if(!n){return}const{onDragStart:r}=V.current;const i={activatorEvent:o,active:{id:t,data:n.data,rect:K}};(0,a.unstable_batchedUpdates)(()=>{r==null?void 0:r(i);E(td.Initializing);k({type:f.DragStart,initialCoordinates:e,active:t});q({type:"onDragStart",event:i});U(eD.current);j(o)})},onMove(e){k({type:f.DragMove,coordinates:e})},onEnd:l(f.DragEnd),onCancel:l(f.DragCancel)});eD.current=s;function l(e){return async function t(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=eo.current;let s=null;if(t&&i){const{cancelDrop:a}=V.current;s={activatorEvent:o,active:t,collisions:n,delta:i,over:r};if(e===f.DragEnd&&typeof a==="function"){const t=await Promise.resolve(a(s));if(t){e=f.DragCancel}}}R.current=null;(0,a.unstable_batchedUpdates)(()=>{k({type:e});E(td.Uninitialized);eI(null);U(null);j(null);eD.current=null;const t=e===f.DragEnd?"onDragEnd":"onDragCancel";if(s){const e=V.current[t];e==null?void 0:e(s);q({type:t,event:s})}})}}},[H]);const eS=(0,r.useCallback)((e,t)=>{return(n,r)=>{const i=n.nativeEvent;const a=H.get(r);if(R.current!==null||// No active draggable
!a||// Event has already been captured
i.dndKit||i.defaultPrevented){return}const o={active:a};const s=e(n,t.options,o);if(s===true){i.dndKit={capturedBy:t.sensor};R.current=r;eE(n,t)}}},[H,eE]);const eT=eP(m,eS);eZ(m);(0,s/* .useIsomorphicLayoutEffect */.Es)(()=>{if(ei&&D===td.Initializing){E(td.Initialized)}},[ei,D]);(0,r.useEffect)(()=>{const{onDragMove:e}=V.current;const{active:t,activatorEvent:n,collisions:r,over:i}=eo.current;if(!t||!n){return}const o={active:t,activatorEvent:n,collisions:r,delta:{x:ew.x,y:ew.y},over:i};(0,a.unstable_batchedUpdates)(()=>{e==null?void 0:e(o);q({type:"onDragMove",event:o})})},[ew.x,ew.y]);(0,r.useEffect)(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=eo.current;if(!e||R.current==null||!t||!i){return}const{onDragOver:o}=V.current;const s=r.get(eY);const l=s&&s.rect.current?{id:s.id,rect:s.rect.current,data:s.data,disabled:s.disabled}:null;const u={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:l};(0,a.unstable_batchedUpdates)(()=>{eI(l);o==null?void 0:o(u);q({type:"onDragOver",event:u})})},[eY]);(0,s/* .useIsomorphicLayoutEffect */.Es)(()=>{eo.current={activatorEvent:B,active:W,activeNode:ee,collisionRect:ex,collisions:eA,droppableRects:X,draggableNodes:H,draggingNode:eu,draggingNodeRect:ed,droppableContainers:F,over:ek,scrollableAncestors:ev,scrollAdjustedTranslate:ew};K.current={initial:ed,translated:ex}},[W,ee,eA,ex,H,eu,ed,X,F,ek,ev,ew]);ez({...en,delta:P,draggingRect:ex,pointerCoordinates:em,scrollableAncestors:ev,scrollableAncestorRects:ef});const eM=(0,r.useMemo)(()=>{const e={active:W,activeNode:ee,activeNodeRect:ei,activatorEvent:B,collisions:eA,containerNodeRect:ea,dragOverlay:el,draggableNodes:H,droppableContainers:F,droppableRects:X,over:ek,measureDroppableContainers:Z,scrollableAncestors:ev,scrollableAncestorRects:ef,measuringConfiguration:$,measuringScheduled:J,windowRect:eh};return e},[W,ee,ei,B,eA,ea,el,H,F,X,ek,Z,ev,ef,$,J,eh]);const eO=(0,r.useMemo)(()=>{const e={activatorEvent:B,activators:eT,active:W,activeNodeRect:ei,ariaDescribedById:{draggable:Q},dispatch:k,draggableNodes:H,over:ek,measureDroppableContainers:Z};return e},[B,eT,W,ei,k,Q,H,ek,Z]);return i().createElement(u.Provider,{value:C},i().createElement(tt.Provider,{value:eO},i().createElement(tn.Provider,{value:eM},i().createElement(tu.Provider,{value:eC},g)),i().createElement(ta,{disabled:(p==null?void 0:p.restoreFocus)===false})),i().createElement(v,{...p,hiddenTextDescribedById:Q}));function eF(){const e=(L==null?void 0:L.autoScrollEnabled)===false;const t=typeof h==="object"?h.enabled===false:h===false;const n=z&&!e&&!t;if(typeof h==="object"){return{...h,enabled:n}}return{enabled:n}}});const tp=/*#__PURE__*/(0,r.createContext)(null);const th="button";const tv="Draggable";function tf(e){let{id:t,data:n,disabled:i=false,attributes:a}=e;const o=(0,s/* .useUniqueId */.YG)(tv);const{activators:l,activatorEvent:u,active:d,activeNodeRect:c,ariaDescribedById:p,draggableNodes:h,over:v}=(0,r.useContext)(tt);const{role:f=th,roleDescription:g="draggable",tabIndex:m=0}=a!=null?a:{};const _=(d==null?void 0:d.id)===t;const b=(0,r.useContext)(_?tu:tp);const[y,w]=(0,s/* .useNodeRef */.lk)();const[A,Y]=(0,s/* .useNodeRef */.lk)();const k=eJ(l,t);const I=(0,s/* .useLatestValue */.YN)(n);(0,s/* .useIsomorphicLayoutEffect */.Es)(()=>{h.set(t,{id:t,key:o,node:y,activatorNode:A,data:I});return()=>{const e=h.get(t);if(e&&e.key===o){h.delete(t)}}},[h,t]);const q=(0,r.useMemo)(()=>({role:f,tabIndex:m,"aria-disabled":i,"aria-pressed":_&&f===th?true:undefined,"aria-roledescription":g,"aria-describedby":p.draggable}),[i,f,m,_,g,p.draggable]);return{active:d,activatorEvent:u,activeNodeRect:c,attributes:q,isDragging:_,listeners:i?undefined:k,node:y,over:v,setNodeRef:w,setActivatorNodeRef:Y,transform:b}}function tg(){return(0,r.useContext)(tn)}const tm="Droppable";const t_={timeout:25};function tb(e){let{data:t,disabled:n=false,id:i,resizeObserverConfig:a}=e;const o=(0,s/* .useUniqueId */.YG)(tm);const{active:l,dispatch:u,over:d,measureDroppableContainers:c}=(0,r.useContext)(tt);const p=(0,r.useRef)({disabled:n});const h=(0,r.useRef)(false);const v=(0,r.useRef)(null);const g=(0,r.useRef)(null);const{disabled:m,updateMeasurementsFor:_,timeout:b}={...t_,...a};const y=(0,s/* .useLatestValue */.YN)(_!=null?_:i);const w=(0,r.useCallback)(()=>{if(!h.current){// ResizeObserver invokes the `handleResize` callback as soon as `observe` is called,
// assuming the element is rendered and displayed.
h.current=true;return}if(g.current!=null){clearTimeout(g.current)}g.current=setTimeout(()=>{c(Array.isArray(y.current)?y.current:[y.current]);g.current=null},b)},[b]);const A=eU({callback:w,disabled:m||!l});const Y=(0,r.useCallback)((e,t)=>{if(!A){return}if(t){A.unobserve(t);h.current=false}if(e){A.observe(e)}},[A]);const[k,I]=(0,s/* .useNodeRef */.lk)(Y);const q=(0,s/* .useLatestValue */.YN)(t);(0,r.useEffect)(()=>{if(!A||!k.current){return}A.disconnect();h.current=false;A.observe(k.current)},[k,A]);(0,r.useEffect)(()=>{u({type:f.RegisterDroppable,element:{id:i,key:o,disabled:n,node:k,rect:v,data:q}});return()=>u({type:f.UnregisterDroppable,key:o,id:i})},[i]);(0,r.useEffect)(()=>{if(n!==p.current.disabled){u({type:f.SetDroppableDisabled,id:i,key:o,disabled:n});p.current.disabled=n}},[i,o,n,u]);return{active:l,rect:v,isOver:(d==null?void 0:d.id)===i,node:k,over:d,setNodeRef:I}}function ty(e){let{animation:t,children:n}=e;const[a,o]=(0,r.useState)(null);const[l,u]=(0,r.useState)(null);const d=(0,s/* .usePrevious */.ZC)(n);if(!n&&!a&&d){o(d)}(0,s/* .useIsomorphicLayoutEffect */.Es)(()=>{if(!l){return}const e=a==null?void 0:a.key;const n=a==null?void 0:a.props.id;if(e==null||n==null){o(null);return}Promise.resolve(t(n,l)).then(()=>{o(null)})},[t,a,l]);return i().createElement(i().Fragment,null,n,a?(0,r.cloneElement)(a,{ref:u}):null)}const tw={x:0,y:0,scaleX:1,scaleY:1};function tx(e){let{children:t}=e;return i().createElement(tt.Provider,{value:te},i().createElement(tu.Provider,{value:tw},t))}const tA={position:"fixed",touchAction:"none"};const tY=e=>{const t=(0,s/* .isKeyboardEvent */.kx)(e);return t?"transform 250ms ease":undefined};const tk=/*#__PURE__*/(0,r.forwardRef)((e,t)=>{let{as:n,activatorEvent:r,adjustScale:a,children:o,className:l,rect:u,style:d,transform:c,transition:p=tY}=e;if(!u){return null}const h=a?c:{...c,scaleX:1,scaleY:1};const v={...tA,width:u.width,height:u.height,top:u.top,left:u.left,transform:s/* .CSS.Transform.toString */.Ks.Transform.toString(h),transformOrigin:a&&r?w(r,u):undefined,transition:typeof p==="function"?p(r):p,...d};return i().createElement(n,{className:l,style:v,ref:t},o)});const tI=e=>t=>{let{active:n,dragOverlay:r}=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]=n.node.style.getPropertyValue(e);n.node.style.setProperty(e,t)}}if(a!=null&&a.dragOverlay){for(const[e,t]of Object.entries(a.dragOverlay)){if(t===undefined){continue}r.node.style.setProperty(e,t)}}if(o!=null&&o.active){n.node.classList.add(o.active)}if(o!=null&&o.dragOverlay){r.node.classList.add(o.dragOverlay)}return function e(){for(const[e,t]of Object.entries(i)){n.node.style.setProperty(e,t)}if(o!=null&&o.active){n.node.classList.remove(o.active)}}};const tq=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:s/* .CSS.Transform.toString */.Ks.Transform.toString(t)},{transform:s/* .CSS.Transform.toString */.Ks.Transform.toString(n)}]};const tC={duration:250,easing:"ease",keyframes:tq,sideEffects:/*#__PURE__*/tI({styles:{active:{opacity:"0"}}})};function tD(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return(0,s/* .useEvent */._q)((e,a)=>{if(t===null){return}const o=n.get(e);if(!o){return}const l=o.node.current;if(!l){return}const u=e4(a);if(!u){return}const{transform:d}=(0,s/* .getWindow */.zk)(a).getComputedStyle(a);const c=F(d);if(!c){return}const p=typeof t==="function"?t:tE(t);es(l,i.draggable.measure);return p({active:{id:e,data:o.data,node:l,rect:i.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:a,rect:i.dragOverlay.measure(u)},droppableContainers:r,measuringConfiguration:i,transform:c})})}function tE(e){const{duration:t,easing:n,sideEffects:r,keyframes:i}={...tC,...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 d={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 c={x:s.x-u.x,y:s.y-u.y,...d};const p=i({...l,active:a,dragOverlay:o,transform:{initial:s,final:c}});const[h]=p;const v=p[p.length-1];if(JSON.stringify(h)===JSON.stringify(v)){// The start and end keyframes are the same, infer that there is no animation needed.
return}const f=r==null?void 0:r({active:a,dragOverlay:o,...l});const g=o.node.animate(p,{duration:t,easing:n,fill:"forwards"});return new Promise(e=>{g.onfinish=()=>{f==null?void 0:f();e()}})}}let tS=0;function tz(e){return(0,r.useMemo)(()=>{if(e==null){return}tS++;return tS},[e])}const tT=/*#__PURE__*/i().memo(e=>{let{adjustScale:t=false,children:n,dropAnimation:a,style:o,transition:s,modifiers:l,wrapperElement:u="div",className:d,zIndex:c=999}=e;const{activatorEvent:p,active:h,activeNodeRect:v,containerNodeRect:f,draggableNodes:g,droppableContainers:m,dragOverlay:_,over:b,measuringConfiguration:y,scrollableAncestors:w,scrollableAncestorRects:A,windowRect:Y}=tg();const k=(0,r.useContext)(tu);const I=tz(h==null?void 0:h.id);const q=to(l,{activatorEvent:p,active:h,activeNodeRect:v,containerNodeRect:f,draggingNodeRect:_.rect,over:b,overlayNodeRect:_.rect,scrollableAncestors:w,scrollableAncestorRects:A,transform:k,windowRect:Y});const C=eW(v);const D=tD({config:a,draggableNodes:g,droppableContainers:m,measuringConfiguration:y});// 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 E=C?_.setRef:undefined;return i().createElement(tx,null,i().createElement(ty,{animation:D},h&&I?i().createElement(tk,{key:I,id:h.id,ref:E,as:u,activatorEvent:p,adjustScale:t,className:d,transition:s,rect:C,style:{zIndex:c,...o},transform:q},n):null))});//# sourceMappingURL=core.esm.js.map
},97313:function(e,t,n){n.d(t,{Q_:()=>d});/* import */var r=n(37893);function i(e){return t=>{let{transform:n}=t;return{...n,x:Math.ceil(n.x/e)*e,y:Math.ceil(n.y/e)*e}}}const a=e=>{let{transform:t}=e;return{...t,y:0}};function o(e,t,n){const r={...e};if(t.top+e.y<=n.top){r.y=n.top-t.top}else if(t.bottom+e.y>=n.top+n.height){r.y=n.top+n.height-t.bottom}if(t.left+e.x<=n.left){r.x=n.left-t.left}else if(t.right+e.x>=n.left+n.width){r.x=n.left+n.width-t.right}return r}const s=e=>{let{containerNodeRect:t,draggingNodeRect:n,transform:r}=e;if(!n||!t){return r}return o(r,n,t)};const l=e=>{let{draggingNodeRect:t,transform:n,scrollableAncestorRects:r}=e;const i=r[0];if(!t||!i){return n}return o(n,t,i)};const u=e=>{let{transform:t}=e;return{...t,x:0}};const d=e=>{let{transform:t,draggingNodeRect:n,windowRect:r}=e;if(!n||!r){return t}return o(t,n,r)};const c=e=>{let{activatorEvent:t,draggingNodeRect:n,transform:r}=e;if(n&&t){const e=getEventCoordinates(t);if(!e){return r}const i=e.x-n.left;const a=e.y-n.top;return{...r,x:r.x+i-n.width/2,y:r.y+a-n.height/2}}return r};//# sourceMappingURL=modifiers.esm.js.map
},905:function(e,t,n){n.d(t,{JR:()=>P,_G:()=>b,gB:()=>Y,gl:()=>z,uU:()=>I});/* import */var r=n(41594);/* import */var i=/*#__PURE__*/n.n(r);/* import */var a=n(7697);/* import */var o=n(37893);/**
 * Move an array item to a different position. Returns a new array with the item moved to the new position.
 */function s(e,t,n){const r=e.slice();r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]);return r}/**
 * Swap an array item to a different position. Returns a new array with the item swapped to the new position.
 */function l(e,t,n){const r=e.slice();r[t]=e[n];r[n]=e[t];return r}function u(e,t){return e.reduce((e,n,r)=>{const i=t.get(n);if(i){e[r]=i}return e},Array(e.length))}function d(e){return e!==null&&e>=0}function c(e,t){if(e===t){return true}if(e.length!==t.length){return false}for(let n=0;n<e.length;n++){if(e[n]!==t[n]){return false}}return true}function p(e){if(typeof e==="boolean"){return{draggable:e,droppable:e}}return e}// To-do: We should be calculating scale transformation
const h=/* unused pure expression or super */null&&{scaleX:1,scaleY:1};const v=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:i,overIndex:a,index:o}=e;const s=(t=n[i])!=null?t:r;if(!s){return null}const l=f(n,o,i);if(o===i){const e=n[a];if(!e){return null}return{x:i<a?e.left+e.width-(s.left+s.width):e.left-s.left,y:0,...h}}if(o>i&&o<=a){return{x:-s.width-l,y:0,...h}}if(o<i&&o>=a){return{x:s.width+l,y:0,...h}}return{x:0,y:0,...h}};function f(e,t,n){const r=e[t];const i=e[t-1];const a=e[t+1];if(!r||!i&&!a){return 0}if(n<t){return i?r.left-(i.left+i.width):a.left-(r.left+r.width)}return a?a.left-(r.left+r.width):r.left-(i.left+i.width)}const g=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e;const a=s(t,r,n);const o=t[i];const l=a[i];if(!l||!o){return null}return{x:l.left-o.left,y:l.top-o.top,scaleX:l.width/o.width,scaleY:l.height/o.height}};const m=e=>{let{activeIndex:t,index:n,rects:r,overIndex:i}=e;let a;let o;if(n===t){a=r[n];o=r[i]}if(n===i){a=r[n];o=r[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 _={scaleX:1,scaleY:1};const b=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:i,rects:a,overIndex:o}=e;const s=(t=a[n])!=null?t:r;if(!s){return null}if(i===n){const e=a[o];if(!e){return null}return{x:0,y:n<o?e.top+e.height-(s.top+s.height):e.top-s.top,..._}}const l=y(a,i,n);if(i>n&&i<=o){return{x:0,y:-s.height-l,..._}}if(i<n&&i>=o){return{x:0,y:s.height+l,..._}}return{x:0,y:0,..._}};function y(e,t,n){const r=e[t];const i=e[t-1];const a=e[t+1];if(!r){return 0}if(n<t){return i?r.top-(i.top+i.height):a?a.top-(r.top+r.height):0}return a?a.top-(r.top+r.height):i?r.top-(i.top+i.height):0}const w="Sortable";const A=/*#__PURE__*/i().createContext({activeIndex:-1,containerId:w,disableTransforms:false,items:[],overIndex:-1,useDragOverlay:false,sortedRects:[],strategy:g,disabled:{draggable:false,droppable:false}});function Y(e){let{children:t,id:n,items:s,strategy:l=g,disabled:d=false}=e;const{active:h,dragOverlay:v,droppableRects:f,over:m,measureDroppableContainers:_}=(0,a/* .useDndContext */.fF)();const b=(0,o/* .useUniqueId */.YG)(w,n);const y=Boolean(v.rect!==null);const Y=(0,r.useMemo)(()=>s.map(e=>typeof e==="object"&&"id"in e?e.id:e),[s]);const k=h!=null;const I=h?Y.indexOf(h.id):-1;const q=m?Y.indexOf(m.id):-1;const C=(0,r.useRef)(Y);const D=!c(Y,C.current);const E=q!==-1&&I===-1||D;const S=p(d);(0,o/* .useIsomorphicLayoutEffect */.Es)(()=>{if(D&&k){_(Y)}},[D,Y,k,_]);(0,r.useEffect)(()=>{C.current=Y},[Y]);const z=(0,r.useMemo)(()=>({activeIndex:I,containerId:b,disabled:S,disableTransforms:E,items:Y,overIndex:q,useDragOverlay:y,sortedRects:u(Y,f),strategy:l}),[I,b,S.draggable,S.droppable,E,Y,q,f,y,l]);return i().createElement(A.Provider,{value:z},t)}const k=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return s(n,r,i).indexOf(t)};const I=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:l,transition:u}=e;if(!u||!r){return false}if(s!==a&&i===o){return false}if(n){return true}return o!==i&&t===l};const q={duration:200,easing:"ease"};const C="transform";const D=/*#__PURE__*/o/* .CSS.Transition.toString */.Ks.Transition.toString({property:C,duration:0,easing:"linear"});const E={roleDescription:"sortable"};/*
 * When the index of an item changes while sorting,
 * we need to temporarily disable the transforms
 */function S(e){let{disabled:t,index:n,node:i,rect:s}=e;const[l,u]=(0,r.useState)(null);const d=(0,r.useRef)(n);(0,o/* .useIsomorphicLayoutEffect */.Es)(()=>{if(!t&&n!==d.current&&i.current){const e=s.current;if(e){const t=(0,a/* .getClientRect */.Sj)(i.current,{ignoreTransform:true});const n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};if(n.x||n.y){u(n)}}}if(n!==d.current){d.current=n}},[t,n,i,s]);(0,r.useEffect)(()=>{if(l){u(null)}},[l]);return l}function z(e){let{animateLayoutChanges:t=I,attributes:n,disabled:i,data:s,getNewIndex:l=k,id:u,strategy:c,resizeObserverConfig:p,transition:h=q}=e;const{items:v,containerId:f,activeIndex:g,disabled:m,disableTransforms:_,sortedRects:b,overIndex:y,useDragOverlay:w,strategy:Y}=(0,r.useContext)(A);const z=T(i,m);const M=v.indexOf(u);const H=(0,r.useMemo)(()=>({sortable:{containerId:f,index:M,items:v},...s}),[f,s,M,v]);const P=(0,r.useMemo)(()=>v.slice(v.indexOf(u)),[v,u]);const{rect:O,node:F,isOver:N,setNodeRef:K}=(0,a/* .useDroppable */.zM)({id:u,data:H,disabled:z.droppable,resizeObserverConfig:{updateMeasurementsFor:P,...p}});const{active:W,activatorEvent:R,activeNodeRect:L,attributes:U,setNodeRef:B,listeners:j,isDragging:V,over:Q,setActivatorNodeRef:G,transform:$}=(0,a/* .useDraggable */.PM)({id:u,data:H,attributes:{...E,...n},disabled:z.draggable});const X=(0,o/* .useCombinedRefs */.jn)(K,B);const Z=Boolean(W);const J=Z&&!_&&d(g)&&d(y);const ee=!w&&V;const et=ee&&J?$:null;const en=c!=null?c:Y;const er=J?et!=null?et:en({rects:b,activeNodeRect:L,activeIndex:g,overIndex:y,index:M}):null;const ei=d(g)&&d(y)?l({id:u,items:v,activeIndex:g,overIndex:y}):M;const ea=W==null?void 0:W.id;const eo=(0,r.useRef)({activeId:ea,items:v,newIndex:ei,containerId:f});const es=v!==eo.current.items;const el=t({active:W,containerId:f,isDragging:V,isSorting:Z,id:u,index:M,items:v,newIndex:eo.current.newIndex,previousItems:eo.current.items,previousContainerId:eo.current.containerId,transition:h,wasDragging:eo.current.activeId!=null});const eu=S({disabled:!el,index:M,node:F,rect:O});(0,r.useEffect)(()=>{if(Z&&eo.current.newIndex!==ei){eo.current.newIndex=ei}if(f!==eo.current.containerId){eo.current.containerId=f}if(v!==eo.current.items){eo.current.items=v}},[Z,ei,f,v]);(0,r.useEffect)(()=>{if(ea===eo.current.activeId){return}if(ea!=null&&eo.current.activeId==null){eo.current.activeId=ea;return}const e=setTimeout(()=>{eo.current.activeId=ea},50);return()=>clearTimeout(e)},[ea]);return{active:W,activeIndex:g,attributes:U,data:H,rect:O,index:M,newIndex:ei,items:v,isOver:N,isSorting:Z,isDragging:V,listeners:j,node:F,overIndex:y,over:Q,setNodeRef:X,setActivatorNodeRef:G,setDroppableNodeRef:K,setDraggableNodeRef:B,transform:eu!=null?eu:er,transition:ed()};function ed(){if(eu||// Or to prevent items jumping to back to their "new" position when items change
es&&eo.current.newIndex===M){return D}if(ee&&!(0,o/* .isKeyboardEvent */.kx)(R)||!h){return undefined}if(Z||el){return o/* .CSS.Transition.toString */.Ks.Transition.toString({...h,property:C})}return undefined}}function T(e,t){var n,r;if(typeof e==="boolean"){return{draggable:e,// Backwards compatibility
droppable:false}}return{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}function M(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 H=[a/* .KeyboardCode.Down */.vL.Down,a/* .KeyboardCode.Right */.vL.Right,a/* .KeyboardCode.Up */.vL.Up,a/* .KeyboardCode.Left */.vL.Left];const P=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:s,over:l,scrollableAncestors:u}}=t;if(H.includes(e.code)){e.preventDefault();if(!n||!r){return}const t=[];s.getEnabled().forEach(n=>{if(!n||n!=null&&n.disabled){return}const o=i.get(n.id);if(!o){return}switch(e.code){case a/* .KeyboardCode.Down */.vL.Down:if(r.top<o.top){t.push(n)}break;case a/* .KeyboardCode.Up */.vL.Up:if(r.top>o.top){t.push(n)}break;case a/* .KeyboardCode.Left */.vL.Left:if(r.left>o.left){t.push(n)}break;case a/* .KeyboardCode.Right */.vL.Right:if(r.left<o.left){t.push(n)}break}});const d=(0,a/* .closestCorners */.y$)({active:n,collisionRect:r,droppableRects:i,droppableContainers:t,pointerCoordinates:null});let c=(0,a/* .getFirstCollision */.Vy)(d,"id");if(c===(l==null?void 0:l.id)&&d.length>1){c=d[1].id}if(c!=null){const e=s.get(n.id);const t=s.get(c);const l=t?i.get(t.id):null;const d=t==null?void 0:t.node.current;if(d&&l&&e&&t){const n=(0,a/* .getScrollableAncestors */.sl)(d);const i=n.some((e,t)=>u[t]!==e);const s=O(e,t);const c=F(e,t);const p=i||!s?{x:0,y:0}:{x:c?r.width-l.width:0,y:c?r.height-l.height:0};const h={x:l.left,y:l.top};const v=p.x&&p.y?h:(0,o/* .subtract */.Re)(h,p);return v}}}return undefined};function O(e,t){if(!M(e)||!M(t)){return false}return e.data.current.sortable.containerId===t.data.current.sortable.containerId}function F(e,t){if(!M(e)||!M(t)){return false}if(!O(e,t)){return false}return e.data.current.sortable.index<t.data.current.sortable.index}//# sourceMappingURL=sortable.esm.js.map
},37893:function(e,t,n){n.d(t,{$$:()=>g,Es:()=>v,KG:()=>_,Ks:()=>S,Ll:()=>l,Re:()=>I,Sw:()=>o,TW:()=>h,WQ:()=>k,YG:()=>A,YN:()=>m,ZC:()=>y,_q:()=>f,ag:()=>T,e_:()=>E,jn:()=>a,kx:()=>C,l6:()=>s,lk:()=>b,sb:()=>c,wz:()=>d,xZ:()=>p,zk:()=>u});/* import */var r=n(41594);/* import */var i=/*#__PURE__*/n.n(r);function a(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return(0,r.useMemo)(()=>e=>{t.forEach(t=>t(e))},t)}// https://github.com/facebook/react/blob/master/packages/shared/ExecutionEnvironment.js
const o=typeof window!=="undefined"&&typeof window.document!=="undefined"&&typeof window.document.createElement!=="undefined";function s(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 l(e){return"nodeType"in e}function u(e){var t,n;if(!e){return window}if(s(e)){return e}if(!l(e)){return window}return(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window}function d(e){const{Document:t}=u(e);return e instanceof t}function c(e){if(s(e)){return false}return e instanceof u(e).HTMLElement}function p(e){return e instanceof u(e).SVGElement}function h(e){if(!e){return document}if(s(e)){return e.document}if(!l(e)){return document}if(d(e)){return e}if(c(e)||p(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 v=o?r.useLayoutEffect:r.useEffect;function f(e){const t=(0,r.useRef)(e);v(()=>{t.current=e});return(0,r.useCallback)(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++){n[r]=arguments[r]}return t.current==null?void 0:t.current(...n)},[])}function g(){const e=(0,r.useRef)(null);const t=(0,r.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]);const n=(0,r.useCallback)(()=>{if(e.current!==null){clearInterval(e.current);e.current=null}},[]);return[t,n]}function m(e,t){if(t===void 0){t=[e]}const n=(0,r.useRef)(e);v(()=>{if(n.current!==e){n.current=e}},t);return n}function _(e,t){const n=(0,r.useRef)();return(0,r.useMemo)(()=>{const t=e(n.current);n.current=t;return t},[...t])}function b(e){const t=f(e);const n=(0,r.useRef)(null);const i=(0,r.useCallback)(e=>{if(e!==n.current){t==null?void 0:t(e,n.current)}n.current=e},[]);return[n,i]}function y(e){const t=(0,r.useRef)();(0,r.useEffect)(()=>{t.current=e},[e]);return t.current}let w={};function A(e,t){return(0,r.useMemo)(()=>{if(t){return t}const n=w[e]==null?0:w[e]+1;w[e]=n;return e+"-"+n},[e,t])}function Y(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++){r[i-1]=arguments[i]}return r.reduce((t,n)=>{const r=Object.entries(n);for(const[n,i]of r){const r=t[n];if(r!=null){t[n]=r+e*i}}return t},{...t})}}const k=/*#__PURE__*/Y(1);const I=/*#__PURE__*/Y(-1);function q(e){return"clientX"in e&&"clientY"in e}function C(e){if(!e){return false}const{KeyboardEvent:t}=u(e.target);return t&&e instanceof t}function D(e){if(!e){return false}const{TouchEvent:t}=u(e.target);return t&&e instanceof t}/**
 * Returns the normalized x and y coordinates for mouse and touch events.
 */function E(e){if(D(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}if(q(e)){return{x:e.clientX,y:e.clientY}}return null}const S=/*#__PURE__*/Object.freeze({Translate:{toString(e){if(!e){return}const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e){return}const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(!e){return}return[S.Translate.toString(e),S.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}});const z="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function T(e){if(e.matches(z)){return e}return e.querySelector(z)}//# sourceMappingURL=utilities.esm.js.map
},44996:function(e,t,n){n.d(t,{A:()=>l});/* import */var r=n(7656);/* import */var i=/*#__PURE__*/n.n(r);/* import */var a=n(38761);/* import */var o=/*#__PURE__*/n.n(a);// Imports
var s=o()(i());// Module
s.push([e.id,`/* Variables declaration */
.rdp-root {
  --rdp-accent-color: blue; /* The accent color used for selected days and UI elements. */
  --rdp-accent-background-color: #f0f0ff; /* The accent background color used for selected days and UI elements. */

  --rdp-day-height: 44px; /* The height of the day cells. */
  --rdp-day-width: 44px; /* The width of the day cells. */

  --rdp-day_button-border-radius: 100%; /* The border radius of the day cells. */
  --rdp-day_button-border: 2px solid transparent; /* The border of the day cells. */
  --rdp-day_button-height: 42px; /* The height of the day cells. */
  --rdp-day_button-width: 42px; /* The width of the day cells. */

  --rdp-selected-border: 2px solid var(--rdp-accent-color); /* The border of the selected days. */
  --rdp-disabled-opacity: 0.5; /* The opacity of the disabled days. */
  --rdp-outside-opacity: 0.75; /* The opacity of the days outside the current month. */
  --rdp-today-color: var(--rdp-accent-color); /* The color of the today's date. */

  --rdp-dropdown-gap: 0.5rem; /* The gap between the dropdowns used in the month captons. */

  --rdp-months-gap: 2rem; /* The gap between the months in the multi-month view. */

  --rdp-nav_button-disabled-opacity: 0.5; /* The opacity of the disabled navigation buttons. */
  --rdp-nav_button-height: 2.25rem; /* The height of the navigation buttons. */
  --rdp-nav_button-width: 2.25rem; /* The width of the navigation buttons. */
  --rdp-nav-height: 2.75rem; /* The height of the navigation bar. */

  --rdp-range_middle-background-color: var(--rdp-accent-background-color); /* The color of the background for days in the middle of a range. */
  --rdp-range_middle-color: inherit; /* The color of the range text. */

  --rdp-range_start-color: white; /* The color of the range text. */
  --rdp-range_start-background: linear-gradient(
    var(--rdp-gradient-direction),
    transparent 50%,
    var(--rdp-range_middle-background-color) 50%
  ); /* Used for the background of the start of the selected range. */
  --rdp-range_start-date-background-color: var(--rdp-accent-color); /* The background color of the date when at the start of the selected range. */

  --rdp-range_end-background: linear-gradient(
    var(--rdp-gradient-direction),
    var(--rdp-range_middle-background-color) 50%,
    transparent 50%
  ); /* Used for the background of the end of the selected range. */
  --rdp-range_end-color: white; /* The color of the range text. */
  --rdp-range_end-date-background-color: var(--rdp-accent-color); /* The background color of the date when at the end of the selected range. */

  --rdp-week_number-border-radius: 100%; /* The border radius of the week number. */
  --rdp-week_number-border: 2px solid transparent; /* The border of the week number. */

  --rdp-week_number-height: var(--rdp-day-height); /* The height of the week number cells. */
  --rdp-week_number-opacity: 0.75; /* The opacity of the week number. */
  --rdp-week_number-width: var(--rdp-day-width); /* The width of the week number cells. */
  --rdp-weeknumber-text-align: center; /* The text alignment of the weekday cells. */

  --rdp-weekday-opacity: 0.75; /* The opacity of the weekday. */
  --rdp-weekday-padding: 0.5rem 0rem; /* The padding of the weekday. */
  --rdp-weekday-text-align: center; /* The text alignment of the weekday cells. */

  --rdp-gradient-direction: 90deg;

  --rdp-animation_duration: 0.3s;
  --rdp-animation_timing: cubic-bezier(0.4, 0, 0.2, 1);
}

.rdp-root[dir="rtl"] {
  --rdp-gradient-direction: -90deg;
}

.rdp-root[data-broadcast-calendar="true"] {
  --rdp-outside-opacity: unset;
}

/* Root of the component. */
.rdp-root {
  position: relative; /* Required to position the navigation toolbar. */
  box-sizing: border-box;
}

.rdp-root * {
  box-sizing: border-box;
}

.rdp-day {
  width: var(--rdp-day-width);
  height: var(--rdp-day-height);
  text-align: center;
}

.rdp-day_button {
  background: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  justify-content: center;
  align-items: center;
  display: flex;

  width: var(--rdp-day_button-width);
  height: var(--rdp-day_button-height);
  border: var(--rdp-day_button-border);
  border-radius: var(--rdp-day_button-border-radius);
}

.rdp-day_button:disabled {
  cursor: revert;
}

.rdp-caption_label {
  z-index: 1;

  position: relative;
  display: inline-flex;
  align-items: center;

  white-space: nowrap;
  border: 0;
}

.rdp-dropdown:focus-visible ~ .rdp-caption_label {
  outline: 5px auto Highlight;
  /* biome-ignore lint/suspicious/noDuplicateProperties: backward compatibility */
  outline: 5px auto -webkit-focus-ring-color;
}

.rdp-button_next,
.rdp-button_previous {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  -moz-appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  appearance: none;

  width: var(--rdp-nav_button-width);
  height: var(--rdp-nav_button-height);
}

.rdp-button_next:disabled,
.rdp-button_next[aria-disabled="true"],
.rdp-button_previous:disabled,
.rdp-button_previous[aria-disabled="true"] {
  cursor: revert;

  opacity: var(--rdp-nav_button-disabled-opacity);
}

.rdp-chevron {
  display: inline-block;
  fill: var(--rdp-accent-color);
}

.rdp-root[dir="rtl"] .rdp-nav .rdp-chevron {
  transform: rotate(180deg);
  transform-origin: 50%;
}

.rdp-dropdowns {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--rdp-dropdown-gap);
}
.rdp-dropdown {
  z-index: 2;

  /* Reset */
  opacity: 0;
  appearance: none;
  position: absolute;
  inset-block-start: 0;
  inset-block-end: 0;
  inset-inline-start: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  cursor: inherit;
  border: none;
  line-height: inherit;
}

.rdp-dropdown_root {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.rdp-dropdown_root[data-disabled="true"] .rdp-chevron {
  opacity: var(--rdp-disabled-opacity);
}

.rdp-month_caption {
  display: flex;
  align-content: center;
  height: var(--rdp-nav-height);
  font-weight: bold;
  font-size: large;
}

.rdp-root[data-nav-layout="around"] .rdp-month,
.rdp-root[data-nav-layout="after"] .rdp-month {
  position: relative;
}

.rdp-root[data-nav-layout="around"] .rdp-month_caption {
  justify-content: center;
  margin-inline-start: var(--rdp-nav_button-width);
  margin-inline-end: var(--rdp-nav_button-width);
  position: relative;
}

.rdp-root[data-nav-layout="around"] .rdp-button_previous {
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  height: var(--rdp-nav-height);
  display: inline-flex;
}

.rdp-root[data-nav-layout="around"] .rdp-button_next {
  position: absolute;
  inset-inline-end: 0;
  top: 0;
  height: var(--rdp-nav-height);
  display: inline-flex;
  justify-content: center;
}

.rdp-months {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: var(--rdp-months-gap);
  max-width: fit-content;
}

.rdp-month_grid {
  border-collapse: collapse;
}

.rdp-nav {
  position: absolute;
  inset-block-start: 0;
  inset-inline-end: 0;

  display: flex;
  align-items: center;

  height: var(--rdp-nav-height);
}

.rdp-weekday {
  opacity: var(--rdp-weekday-opacity);
  padding: var(--rdp-weekday-padding);
  font-weight: 500;
  font-size: smaller;
  text-align: var(--rdp-weekday-text-align);
  text-transform: var(--rdp-weekday-text-transform);
}

.rdp-week_number {
  opacity: var(--rdp-week_number-opacity);
  font-weight: 400;
  font-size: small;
  height: var(--rdp-week_number-height);
  width: var(--rdp-week_number-width);
  border: var(--rdp-week_number-border);
  border-radius: var(--rdp-week_number-border-radius);
  text-align: var(--rdp-weeknumber-text-align);
}

/* DAY MODIFIERS */
.rdp-today:not(.rdp-outside) {
  color: var(--rdp-today-color);
}

.rdp-selected {
  font-weight: bold;
  font-size: large;
}

.rdp-selected .rdp-day_button {
  border: var(--rdp-selected-border);
}

.rdp-outside {
  opacity: var(--rdp-outside-opacity);
}

.rdp-disabled:not(.rdp-selected) {
  opacity: var(--rdp-disabled-opacity);
}

.rdp-hidden {
  visibility: hidden;
  color: var(--rdp-range_start-color);
}

.rdp-range_start {
  background: var(--rdp-range_start-background);
}

.rdp-range_start .rdp-day_button {
  background-color: var(--rdp-range_start-date-background-color);
  color: var(--rdp-range_start-color);
}

.rdp-range_middle {
  background-color: var(--rdp-range_middle-background-color);
}

.rdp-range_middle .rdp-day_button {
  border: unset;
  border-radius: unset;
  color: var(--rdp-range_middle-color);
}

.rdp-range_end {
  background: var(--rdp-range_end-background);
  color: var(--rdp-range_end-color);
}

.rdp-range_end .rdp-day_button {
  color: var(--rdp-range_start-color);
  background-color: var(--rdp-range_end-date-background-color);
}

.rdp-range_start.rdp-range_end {
  background: revert;
}

.rdp-focusable {
  cursor: pointer;
}

@keyframes rdp-slide_in_left {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes rdp-slide_in_right {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes rdp-slide_out_left {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

@keyframes rdp-slide_out_right {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(100%);
  }
}

.rdp-weeks_before_enter {
  animation: rdp-slide_in_left var(--rdp-animation_duration)
    var(--rdp-animation_timing) forwards;
}

.rdp-weeks_before_exit {
  animation: rdp-slide_out_left var(--rdp-animation_duration)
    var(--rdp-animation_timing) forwards;
}

.rdp-weeks_after_enter {
  animation: rdp-slide_in_right var(--rdp-animation_duration)
    var(--rdp-animation_timing) forwards;
}

.rdp-weeks_after_exit {
  animation: rdp-slide_out_right var(--rdp-animation_duration)
    var(--rdp-animation_timing) forwards;
}

.rdp-root[dir="rtl"] .rdp-weeks_after_enter {
  animation: rdp-slide_in_left var(--rdp-animation_duration)
    var(--rdp-animation_timing) forwards;
}

.rdp-root[dir="rtl"] .rdp-weeks_before_exit {
  animation: rdp-slide_out_right var(--rdp-animation_duration)
    var(--rdp-animation_timing) forwards;
}

.rdp-root[dir="rtl"] .rdp-weeks_before_enter {
  animation: rdp-slide_in_right var(--rdp-animation_duration)
    var(--rdp-animation_timing) forwards;
}

.rdp-root[dir="rtl"] .rdp-weeks_after_exit {
  animation: rdp-slide_out_left var(--rdp-animation_duration)
    var(--rdp-animation_timing) forwards;
}

@keyframes rdp-fade_in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes rdp-fade_out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.rdp-caption_after_enter {
  animation: rdp-fade_in var(--rdp-animation_duration)
    var(--rdp-animation_timing) forwards;
}

.rdp-caption_after_exit {
  animation: rdp-fade_out var(--rdp-animation_duration)
    var(--rdp-animation_timing) forwards;
}

.rdp-caption_before_enter {
  animation: rdp-fade_in var(--rdp-animation_duration)
    var(--rdp-animation_timing) forwards;
}

.rdp-caption_before_exit {
  animation: rdp-fade_out var(--rdp-animation_duration)
    var(--rdp-animation_timing) forwards;
}
`,""]);// Exports
/* export default */const l=s},38761:function(e){/*
  MIT License http://www.opensource.org/licenses/mit-license.php
  Author Tobias Koppers @sokra
*/e.exports=function(e){var t=[];// return the list of modules as css string
t.toString=function t(){return this.map(function(t){var n="";var r=typeof t[5]!=="undefined";if(t[4]){n+="@supports (".concat(t[4],") {")}if(t[2]){n+="@media ".concat(t[2]," {")}if(r){n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")}n+=e(t);if(r){n+="}"}if(t[2]){n+="}"}if(t[4]){n+="}"}return n}).join("")};// import a list of modules into the list
t.i=function e(e,n,r,i,a){if(typeof e==="string"){e=[[null,e,undefined]]}var o={};if(r){for(var s=0;s<this.length;s++){var l=this[s][0];if(l!=null){o[l]=true}}}for(var u=0;u<e.length;u++){var d=[].concat(e[u]);if(r&&o[d[0]]){continue}if(typeof a!=="undefined"){if(typeof d[5]==="undefined"){d[5]=a}else{d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}");d[5]=a}}if(n){if(!d[2]){d[2]=n}else{d[1]="@media ".concat(d[2]," {").concat(d[1],"}");d[2]=n}}if(i){if(!d[4]){d[4]="".concat(i)}else{d[1]="@supports (".concat(d[4],") {").concat(d[1],"}");d[4]=i}}t.push(d)}};return t}},7656:function(e){e.exports=function(e){return e[1]}},55042:function(e,t,n){t.__esModule=true;t["default"]=f;var r=o(n(65734));var i=o(n(19340));var a=o(n(32108));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 d=/^#[a-fA-F0-9]{4}$/;var c=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i;var p=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;var h=/^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 v=/^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 f(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 n=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:n}}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(d)){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 f=c.exec(t);if(f){return{red:parseInt(""+f[1],10),green:parseInt(""+f[2],10),blue:parseInt(""+f[3],10)}}var g=p.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=h.exec(t);if(m){var _=parseInt(""+m[1],10);var b=parseInt(""+m[2],10)/100;var y=parseInt(""+m[3],10)/100;var w="rgb("+(0,r["default"])(_,b,y)+")";var A=c.exec(w);if(!A){throw new a["default"](4,t,w)}return{red:parseInt(""+A[1],10),green:parseInt(""+A[2],10),blue:parseInt(""+A[3],10)}}var Y=v.exec(t.substring(0,50));if(Y){var k=parseInt(""+Y[1],10);var I=parseInt(""+Y[2],10)/100;var q=parseInt(""+Y[3],10)/100;var C="rgb("+(0,r["default"])(k,I,q)+")";var D=c.exec(C);if(!D){throw new a["default"](4,t,C)}return{red:parseInt(""+D[1],10),green:parseInt(""+D[2],10),blue:parseInt(""+D[3],10),alpha:parseFloat(""+Y[4])>1?parseFloat(""+Y[4])/100:parseFloat(""+Y[4])}}throw new a["default"](5)}e.exports=t["default"]},63292:function(e,t,n){t.__esModule=true;t["default"]=s;var r=o(n(155));var i=o(n(92590));var a=o(n(32108));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,n){if(typeof e==="number"&&typeof t==="number"&&typeof n==="number"){return(0,r["default"])("#"+(0,i["default"])(e)+(0,i["default"])(t)+(0,i["default"])(n))}else if(typeof e==="object"&&t===undefined&&n===undefined){return(0,r["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"]},18853:function(e,t,n){t.__esModule=true;t["default"]=s;var r=o(n(55042));var i=o(n(63292));var a=o(n(32108));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,n,o){if(typeof e==="string"&&typeof t==="number"){var s=(0,r["default"])(e);return"rgba("+s.red+","+s.green+","+s.blue+","+t+")"}else if(typeof e==="number"&&typeof t==="number"&&typeof n==="number"&&typeof o==="number"){return o>=1?(0,i["default"])(e,t,n):"rgba("+e+","+t+","+n+","+o+")"}else if(typeof e==="object"&&t===undefined&&n===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"]},32108:function(e,t){t.__esModule=true;t["default"]=void 0;function n(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function r(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,n)}function n(){return a(e,arguments,u(this).constructor)}n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:false,writable:true,configurable:true}});return l(n,e)};return i(e)}function a(e,t,n){if(o())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&l(i,n.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 d=/* 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 c(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r=t[0];var i=[];var a;for(a=1;a<t.length;a+=1){i.push(t[a])}i.forEach(function(e){r=r.replace(/%[a-z]/,e)});return r}/**
 * Create an error file out of errors.md for development and a simple web link to the full errors
 * in production mode.
 * @private
 */var p=t["default"]=/*#__PURE__*/function(e){r(t,e);function t(t){var r;if(true){r=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 n(r)}return t}(/*#__PURE__*/i(Error));e.exports=t["default"]},65734:function(e,t){t.__esModule=true;t["default"]=void 0;function n(e){return Math.round(e*255)}function r(e,t,r){return n(e)+","+n(t)+","+n(r)}function i(e,t,n,i){if(i===void 0){i=r}if(t===0){// achromatic
return i(n,n,n)}// formulae from https://en.wikipedia.org/wiki/HSL_and_HSV
var a=(e%360+360)%360/60;var o=(1-Math.abs(2*n-1))*t;var s=o*(1-Math.abs(a%2-1));var l=0;var u=0;var d=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;d=s}else if(a>=3&&a<4){u=s;d=o}else if(a>=4&&a<5){l=s;d=o}else if(a>=5&&a<6){l=o;d=s}var c=n-o/2;var p=l+c;var h=u+c;var v=d+c;return i(p,h,v)}var a=t["default"]=i;e.exports=t["default"]},19340:function(e,t){t.__esModule=true;t["default"]=void 0;var n={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 r(e){if(typeof e!=="string")return e;var t=e.toLowerCase();return n[t]?"#"+n[t]:e}var i=t["default"]=r;e.exports=t["default"]},92590:function(e,t){t.__esModule=true;t["default"]=void 0;function n(e){var t=e.toString(16);return t.length===1?"0"+t:t}var r=t["default"]=n;e.exports=t["default"]},155:function(e,t){t.__esModule=true;t["default"]=void 0;/**
 * Reduces hex values if possible e.g. #ff8866 to #f86
 * @private
 */var n=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 r=t["default"]=n;e.exports=t["default"]},30779:function(e,t,n){/* import */var r=n(33392);/* import */var i=/*#__PURE__*/n.n(r);/* import */var a=n(66017);/* import */var o=/*#__PURE__*/n.n(a);/* import */var s=n(26011);/* import */var l=/*#__PURE__*/n.n(s);/* import */var u=n(33936);/* import */var d=/*#__PURE__*/n.n(u);/* import */var c=n(50188);/* import */var p=/*#__PURE__*/n.n(c);/* import */var h=n(16825);/* import */var v=/*#__PURE__*/n.n(h);/* import */var f=n(44996);var g={};g.styleTagTransform=v();g.setAttributes=d();g.insert=l().bind(null,"head");g.domAPI=o();g.insertStyleElement=p();var m=i()(f/* ["default"] */.A,g);/* unused export default */var _=f/* ["default"] */.A&&f/* ["default"].locals */.A.locals?f/* ["default"].locals */.A.locals:undefined},33392:function(e){var t=[];function n(e){var n=-1;for(var r=0;r<t.length;r++){if(t[r].identifier===e){n=r;break}}return n}function r(e,r){var a={};var o=[];for(var s=0;s<e.length;s++){var l=e[s];var u=r.base?l[0]+r.base:l[0];var d=a[u]||0;var c="".concat(u," ").concat(d);a[u]=d+1;var p=n(c);var h={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(p!==-1){t[p].references++;t[p].updater(h)}else{var v=i(h,r);r.byIndex=s;t.splice(s,0,{identifier:c,updater:v,references:1})}o.push(c)}return o}function i(e,t){var n=t.domAPI(t);n.update(e);var r=function t(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer){return}n.update(e=t)}else{n.remove()}};return r}e.exports=function(e,i){i=i||{};e=e||[];var a=r(e,i);return function e(e){e=e||[];for(var o=0;o<a.length;o++){var s=a[o];var l=n(s);t[l].references--}var u=r(e,i);for(var d=0;d<a.length;d++){var c=a[d];var p=n(c);if(t[p].references===0){t[p].updater();t.splice(p,1)}}a=u}}},26011:function(e){var t={};/* istanbul ignore next  */function n(e){if(typeof t[e]==="undefined"){var n=document.querySelector(e);// Special case to return head of iframe instead of iframe itself
if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement){try{// This will throw an exception if access to iframe is blocked
// due to cross-origin restrictions
n=n.contentDocument.head}catch(e){// istanbul ignore next
n=null}}t[e]=n}return t[e]}/* istanbul ignore next  */function r(e,t){var r=n(e);if(!r){throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.")}r.appendChild(t)}e.exports=r},50188:function(e){/* istanbul ignore next  */function t(e){var t=document.createElement("style");e.setAttributes(t,e.attributes);e.insert(t,e.options);return t}e.exports=t},33936:function(e,t,n){/* istanbul ignore next  */function r(e){var t=true?n.nc:0;if(t){e.setAttribute("nonce",t)}}e.exports=r},66017:function(e){/* istanbul ignore next  */function t(e,t,n){var r="";if(n.supports){r+="@supports (".concat(n.supports,") {")}if(n.media){r+="@media ".concat(n.media," {")}var i=typeof n.layer!=="undefined";if(i){r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")}r+=n.css;if(i){r+="}"}if(n.media){r+="}"}if(n.supports){r+="}"}var a=n.sourceMap;if(a&&typeof btoa!=="undefined"){r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")}// For old IE
/* istanbul ignore if  */t.styleTagTransform(r,e,t.options)}function n(e){// istanbul ignore if
if(e.parentNode===null){return false}e.parentNode.removeChild(e)}/* istanbul ignore next  */function r(e){if(typeof document==="undefined"){return{update:function e(){},remove:function e(){}}}var r=e.insertStyleElement(e);return{update:function n(n){t(r,e,n)},remove:function e(){n(r)}}}e.exports=r},16825:function(e){/* istanbul ignore next  */function t(e,t){if(t.styleSheet){t.styleSheet.cssText=e}else{while(t.firstChild){t.removeChild(t.firstChild)}t.appendChild(document.createTextNode(e))}}e.exports=t},13190:function(e,t,n){e.exports=n.p+"js/images/3d-d74232c4.png"},22286:function(e,t,n){e.exports=n.p+"js/images/black-and-white-a1d197c0.png"},43623:function(e,t,n){e.exports=n.p+"js/images/concept-ad427b25.png"},71801:function(e,t,n){e.exports=n.p+"js/images/dreamy-72eab497.png"},64613:function(e,t,n){e.exports=n.p+"js/images/filmic-91db8802.png"},36265:function(e,t,n){e.exports=n.p+"js/images/illustration-19074f05.png"},47035:function(e,t,n){e.exports=n.p+"js/images/neon-bfde2ac7.png"},50861:function(e,t,n){e.exports=n.p+"js/images/none-2088b52b.jpg"},92895:function(e,t,n){e.exports=n.p+"js/images/painting-db63dd8a.png"},47719:function(e,t,n){e.exports=n.p+"js/images/photo-7d69e05e.png"},26371:function(e,t,n){e.exports=n.p+"js/images/retro-bcc8eda3.png"},8031:function(e,t,n){e.exports=n.p+"js/images/sketch-319bbedf.png"},8452:function(e,t,n){e.exports=n.p+"js/images/not-found-2x-5f9812df.webp"},27895:function(e,t,n){e.exports=n.p+"js/images/not-found-4fa6c9c0.webp"},67290:function(e,t,n){e.exports=n.p+"js/images/generate-image-2x-7d387dcf.webp"},34837:function(e,t,n){e.exports=n.p+"js/images/generate-image-3e5f50a6.webp"},89041:function(e,t,n){// EXPORTS
n.d(t,{A:()=>/* binding */S});// EXTERNAL MODULE: ./node_modules/.pnpm/@swc+helpers@0.5.17/node_modules/@swc/helpers/esm/_object_spread.js
var r=n(41147);// EXTERNAL MODULE: ./node_modules/.pnpm/@swc+helpers@0.5.17/node_modules/@swc/helpers/esm/_object_spread_props.js
var i=n(14206);// EXTERNAL MODULE: ./node_modules/.pnpm/@emotion+react@11.14.0_@types+react@18.3.1_react@18.3.1/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js
var a=n(52639);// EXTERNAL MODULE: ./assets/src/js/v3/entries/course-builder/contexts/CourseBuilderSlotContext.tsx
var o=n(79100);// EXTERNAL MODULE: external "React"
var s=n(41594);// EXTERNAL MODULE: ./node_modules/.pnpm/@swc+helpers@0.5.17/node_modules/@swc/helpers/esm/_define_property.js
var l=n(38125);// EXTERNAL MODULE: ./assets/src/js/v3/shared/atoms/Alert.tsx
var u=n(47918);// CONCATENATED MODULE: ./assets/src/js/v3/shared/components/ComponentErrorBoundary.tsx
class d extends s.Component{static getDerivedStateFromError(e){return{hasError:true,error:e}}componentDidCatch(e,t){var n,r;// eslint-disable-next-line no-console
console.error("Error rendering ".concat(this.props.componentName,":"),e,t);(n=(r=this.props).onError)===null||n===void 0?void 0:n.call(r,e,t)}render(){var{children:e,fallback:t,showError:n}=this.props;var{hasError:r,error:i}=this.state;if(r){if(t){return t}return n?/*#__PURE__*/(0,a/* .jsxs */.FD)(u/* ["default"] */.A,{type:"danger",children:["Error rendering ",this.props.componentName,": ",(i===null||i===void 0?void 0:i.message)||(i===null||i===void 0?void 0:i.toString())]}):null}return e}constructor(...e){super(...e),(0,l._)(this,"state",{hasError:false,error:null})}}(0,l._)(d,"defaultProps",{showError:true,componentName:"Component"});/* export default */const c=d;// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/ContentRenderer.tsx
var p=e=>{var{component:t}=e;return/*#__PURE__*/(0,a/* .jsx */.Y)(c,{componentName:"content",children:t})};/* export default */const h=p;// EXTERNAL MODULE: ./node_modules/.pnpm/react-hook-form@7.67.0_react@18.3.1/node_modules/react-hook-form/dist/index.esm.mjs
var v=n(78346);// EXTERNAL MODULE: ./assets/src/js/v3/shared/components/fields/FormCheckbox.tsx
var f=n(95377);// EXTERNAL MODULE: ./assets/src/js/v3/shared/components/fields/FormDateInput.tsx
var g=n(26036);// EXTERNAL MODULE: ./assets/src/js/v3/shared/components/fields/FormFileUploader.tsx
var m=n(46062);// EXTERNAL MODULE: ./assets/src/js/v3/shared/components/fields/FormImageInput.tsx
var _=n(75031);// EXTERNAL MODULE: ./assets/src/js/v3/shared/components/fields/FormInput.tsx
var b=n(91224);// EXTERNAL MODULE: ./assets/src/js/v3/shared/components/fields/FormRadioGroup.tsx
var y=n(33552);// EXTERNAL MODULE: ./assets/src/js/v3/shared/components/fields/FormSelectInput.tsx
var w=n(99864);// EXTERNAL MODULE: ./assets/src/js/v3/shared/components/fields/FormSwitch.tsx
var A=n(9694);// EXTERNAL MODULE: ./assets/src/js/v3/shared/components/fields/FormTextareaInput.tsx
var Y=n(74054);// EXTERNAL MODULE: ./assets/src/js/v3/shared/components/fields/FormTimeInput.tsx
var k=n(87797);// EXTERNAL MODULE: ./assets/src/js/v3/shared/components/fields/FormVideoInput.tsx + 2 modules
var I=n(94232);// EXTERNAL MODULE: ./assets/src/js/v3/shared/components/fields/FormWPEditor.tsx
var q=n(15004);// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/FieldRenderer.tsx
var C=e=>{var{name:t,label:n,buttonText:o,helpText:s,infoText:l,placeholder:d,type:p,options:h,defaultValue:C,rules:D,form:E}=e;// eslint-disable-next-line @typescript-eslint/no-explicit-any
var S=e=>{var v=(()=>{switch(p){case"text":return/*#__PURE__*/(0,a/* .jsx */.Y)(b/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:n,placeholder:d,helpText:s}));case"number":return/*#__PURE__*/(0,a/* .jsx */.Y)(b/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"number",label:n,placeholder:d,helpText:s}));case"password":return/*#__PURE__*/(0,a/* .jsx */.Y)(b/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"password",label:n,placeholder:d,helpText:s}));case"textarea":return/*#__PURE__*/(0,a/* .jsx */.Y)(Y/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:n,placeholder:d,helpText:s}));case"select":return/*#__PURE__*/(0,a/* .jsx */.Y)(w/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:n,options:h||[],placeholder:d,helpText:s}));case"radio":return/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:n,options:h||[]}));case"checkbox":return/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:n}));case"switch":return/*#__PURE__*/(0,a/* .jsx */.Y)(A/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:n,helpText:s}));case"date":return/*#__PURE__*/(0,a/* .jsx */.Y)(g/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:n,placeholder:d,helpText:s}));case"time":return/*#__PURE__*/(0,a/* .jsx */.Y)(k/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:n,placeholder:d,helpText:s}));case"image":return/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:n,buttonText:o,helpText:s,infoText:l}));case"video":return/*#__PURE__*/(0,a/* .jsx */.Y)(I/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:n,buttonText:o,helpText:s,infoText:l}));case"uploader":return/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:n,buttonText:o,helpText:s}));case"WPEditor":return/*#__PURE__*/(0,a/* .jsx */.Y)(q/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:n,placeholder:d,helpText:s}));default:return/*#__PURE__*/(0,a/* .jsxs */.FD)(u/* ["default"] */.A,{type:"danger",children:["Unsupported field type: ",p]})}})();return/*#__PURE__*/(0,a/* .jsx */.Y)(c,{componentName:"field ".concat(t),onError:(e,n)=>{// eslint-disable-next-line no-console
console.warn("Field ".concat(t," failed to render:"),{error:e,errorInfo:n})},children:v})};return/*#__PURE__*/(0,a/* .jsx */.Y)(v/* .Controller */.xI,{name:t,control:E.control,defaultValue:C!==null&&C!==void 0?C:"",rules:D,render:e=>S(e)})};/* export default */const D=C;// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/CourseBuilderSlot.tsx
var E=e=>{var{section:t,namePrefix:n,form:s}=e;var{fields:l,contents:u}=(0,o/* .useCourseBuilderSlot */._)();var d=()=>{var e=t.split(".");// eslint-disable-next-line @typescript-eslint/no-explicit-any
var n=l;for(var r of e){if(!n[r])return[];n=n[r]}return Array.isArray(n)?n:[]};var c=()=>{var e=t.split(".");// eslint-disable-next-line @typescript-eslint/no-explicit-any
var n=u;for(var r of e){if(!n[r])return[];n=n[r]}return Array.isArray(n)?n:[]};return/*#__PURE__*/(0,a/* .jsxs */.FD)(a/* .Fragment */.FK,{children:[d().map(e=>/*#__PURE__*/(0,a/* .jsx */.Y)(D,(0,i._)((0,r._)({form:s},e),{name:n?"".concat(n).concat(e.name):e.name}),e.name)),c().map((e,t)=>{var{component:n}=e;return/*#__PURE__*/(0,a/* .jsx */.Y)(h,{component:n},t)})]})};/* export default */const S=E},51243:function(e,t,n){n.d(t,{A:()=>K});/* import */var r=n(93640);/* import */var i=n(41147);/* import */var a=n(14206);/* import */var o=n(60599);/* import */var s=n(52639);/* import */var l=n(41594);/* import */var u=/*#__PURE__*/n.n(l);/* import */var d=n(78346);/* import */var c=n(42771);/* import */var p=n(12470);/* import */var h=/*#__PURE__*/n.n(p);/* import */var v=n(1896);/* import */var f=n(25074);/* import */var g=n(56705);/* import */var m=n(95377);/* import */var _=n(26036);/* import */var b=n(91224);/* import */var y=n(99864);/* import */var w=n(74054);/* import */var A=n(87797);/* import */var Y=n(74412);/* import */var k=n(19393);/* import */var I=n(13448);/* import */var q=n(81547);/* import */var C=n(59189);/* import */var D=n(34092);/* import */var E=n(43642);/* import */var S=n(52874);/* import */var z=n(49842);/* import */var T=n(18528);/* import */var M=n(23334);/* import */var H=n(24628);/* import */var P=n(60297);function O(){var e=(0,o._)(["\n      box-shadow: ",";\n    "]);O=function t(){return e};return e}var F=(0,P/* .getCourseId */.p)();var N=e=>{var{onCancel:t,data:n,topicId:o,meetingId:u}=e;var{ref:c,isScrolling:h}=(0,E/* .useIsScrolling */.$)({defaultValue:true});var I=(0,H/* .useGoogleMeetDetailsQuery */.OJ)(u?u:"",o?o:"");var q=n!==null&&n!==void 0?n:I.data;var S,P,O;var N=(0,D/* .useFormWithGlobalError */.p)({defaultValues:{meeting_name:(S=q===null||q===void 0?void 0:q.post_title)!==null&&S!==void 0?S:"",meeting_summary:(P=q===null||q===void 0?void 0:q.post_content)!==null&&P!==void 0?P:"",meeting_start_date:(q===null||q===void 0?void 0:q.meeting_data.start_datetime)?(0,v/* .format */.GP)(new Date(q.meeting_data.start_datetime),k/* .DateFormats.yearMonthDay */.UA.yearMonthDay):"",meeting_start_time:(q===null||q===void 0?void 0:q.meeting_data.start_datetime)?(0,v/* .format */.GP)(new Date(q.meeting_data.start_datetime),k/* .DateFormats.hoursMinutes */.UA.hoursMinutes):"",meeting_end_date:(q===null||q===void 0?void 0:q.meeting_data.end_datetime)?(0,v/* .format */.GP)(new Date(q.meeting_data.end_datetime),k/* .DateFormats.yearMonthDay */.UA.yearMonthDay):"",meeting_end_time:(q===null||q===void 0?void 0:q.meeting_data.end_datetime)?(0,v/* .format */.GP)(new Date(q.meeting_data.end_datetime),k/* .DateFormats.hoursMinutes */.UA.hoursMinutes):"",meeting_timezone:(O=q===null||q===void 0?void 0:q.meeting_data.timezone)!==null&&O!==void 0?O:"",meeting_enrolledAsAttendee:(q===null||q===void 0?void 0:q.meeting_data.attendees)==="Yes"},shouldFocusError:true,mode:"onChange"});var K=(0,M/* .useSaveGoogleMeetMutation */.Cz)();var R=Y/* .tutorConfig.timezones */.P.timezones;var L=Object.keys(R).map(e=>({label:R[e],value:e}));var U=e=>(0,r._)(function*(){if(!F){return}var n=yield K.mutateAsync((0,a._)((0,i._)({},q&&{"post-id":Number(q.ID),"event-id":q.meeting_data.id},o&&{topic_id:o}),{object_id:F,meeting_title:e.meeting_name,meeting_summary:e.meeting_summary,meeting_start_date:e.meeting_start_date,meeting_start_time:e.meeting_start_time,meeting_end_date:e.meeting_end_date,meeting_end_time:e.meeting_end_time,meeting_attendees_enroll_students:e.meeting_enrolledAsAttendee?"Yes":"No",meeting_timezone:e.meeting_timezone,attendees:e.meeting_enrolledAsAttendee?"Yes":"No"}));if(n.status_code===200||n.status_code===201){t();N.reset()}})();(0,l.useEffect)(()=>{if((0,z/* .isDefined */.O9)(q)){N.reset({meeting_name:q.post_title,meeting_summary:q.post_content,meeting_start_date:q.meeting_data.start_datetime?(0,v/* .format */.GP)(new Date(q.meeting_data.start_datetime),k/* .DateFormats.yearMonthDay */.UA.yearMonthDay):"",meeting_start_time:q.meeting_data.start_datetime?(0,v/* .format */.GP)(new Date(q.meeting_data.start_datetime),k/* .DateFormats.hoursMinutes */.UA.hoursMinutes):"",meeting_end_date:q.meeting_data.end_datetime?(0,v/* .format */.GP)(new Date(q.meeting_data.end_datetime),k/* .DateFormats.yearMonthDay */.UA.yearMonthDay):"",meeting_end_time:q.meeting_data.end_datetime?(0,v/* .format */.GP)(new Date(q.meeting_data.end_datetime),k/* .DateFormats.hoursMinutes */.UA.hoursMinutes):"",meeting_timezone:q.meeting_data.timezone,meeting_enrolledAsAttendee:q.meeting_data.attendees==="Yes"})}var e=setTimeout(()=>{N.setFocus("meeting_name")},250);return()=>{clearTimeout(e)};// eslint-disable-next-line react-hooks/exhaustive-deps
},[q]);return/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:W.container,children:[/*#__PURE__*/(0,s/* .jsx */.Y)("div",{css:W.formWrapper,ref:c,children:/*#__PURE__*/(0,s/* .jsxs */.FD)(C/* ["default"] */.A,{when:!I.isLoading,fallback:/*#__PURE__*/(0,s/* .jsx */.Y)(g/* .LoadingOverlay */.p8,{}),children:[/*#__PURE__*/(0,s/* .jsx */.Y)(d/* .Controller */.xI,{name:"meeting_name",control:N.control,rules:{required:(0,p.__)("Name is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(b/* ["default"] */.A,(0,a._)((0,i._)({},e),{label:(0,p.__)("Meeting Name","tutor"),placeholder:(0,p.__)("Enter meeting name","tutor")}))}),/*#__PURE__*/(0,s/* .jsx */.Y)(d/* .Controller */.xI,{name:"meeting_summary",control:N.control,rules:{required:(0,p.__)("Summary is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(w/* ["default"] */.A,(0,a._)((0,i._)({},e),{label:(0,p.__)("Meeting Summary","tutor"),placeholder:(0,p.__)("Enter meeting summary","tutor"),rows:3,enableResize:true}))}),/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:W.meetingDateTimeWrapper,children:[/*#__PURE__*/(0,s/* .jsx */.Y)("div",{css:W.dateLabel,children:(0,p.__)("Meeting Start Date","tutor")}),/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:W.meetingDateTime,children:[/*#__PURE__*/(0,s/* .jsx */.Y)(d/* .Controller */.xI,{name:"meeting_start_date",control:N.control,rules:{required:(0,p.__)("Start date is required","tutor"),validate:T/* .invalidDateRule */.Kh},render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(_/* ["default"] */.A,(0,a._)((0,i._)({},e),{placeholder:(0,p.__)("Start date","tutor"),disabledBefore:new Date().toISOString()}))}),/*#__PURE__*/(0,s/* .jsx */.Y)(d/* .Controller */.xI,{name:"meeting_start_time",control:N.control,rules:{required:(0,p.__)("Start time is required","tutor"),validate:T/* .invalidTimeRule */.XA},render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(A/* ["default"] */.A,(0,a._)((0,i._)({},e),{placeholder:(0,p.__)("Start time","tutor")}))})]})]}),/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:W.meetingDateTimeWrapper,children:[/*#__PURE__*/(0,s/* .jsx */.Y)("div",{css:W.dateLabel,children:(0,p.__)("Meeting End Date","tutor")}),/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:W.meetingDateTime,children:[/*#__PURE__*/(0,s/* .jsx */.Y)(d/* .Controller */.xI,{name:"meeting_end_date",control:N.control,rules:{required:(0,p.__)("End date is required","tutor"),validate:{invalidDate:T/* .invalidDateRule */.Kh,checkEndDate:e=>{var t=N.watch("meeting_start_date");var n=e;if(t&&n){return new Date(t)>new Date(n)?(0,p.__)("End date should be greater than start date","tutor"):undefined}return undefined}},deps:["meeting_start_date"]},render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(_/* ["default"] */.A,(0,a._)((0,i._)({},e),{placeholder:(0,p.__)("End date","tutor"),disabledBefore:N.watch("meeting_start_date")||new Date().toISOString()}))}),/*#__PURE__*/(0,s/* .jsx */.Y)(d/* .Controller */.xI,{name:"meeting_end_time",control:N.control,rules:{required:(0,p.__)("End time is required","tutor"),validate:{invalidTime:T/* .invalidTimeRule */.XA,checkEndTime:e=>{var t=N.watch("meeting_start_date");var n=N.watch("meeting_start_time");var r=N.watch("meeting_end_date");var i=e;if(t&&r&&n&&i){return new Date("".concat(t," ").concat(n))>new Date("".concat(r," ").concat(i))?(0,p.__)("End time should be greater than start time","tutor"):undefined}return undefined}},deps:["meeting_start_time","meeting_start_date","meeting_end_date"]},render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(A/* ["default"] */.A,(0,a._)((0,i._)({},e),{placeholder:(0,p.__)("End time","tutor")}))})]})]}),/*#__PURE__*/(0,s/* .jsx */.Y)(d/* .Controller */.xI,{name:"meeting_timezone",control:N.control,rules:{required:(0,p.__)("Timezone is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(y/* ["default"] */.A,(0,a._)((0,i._)({},e),{label:(0,p.__)("Timezone","tutor"),placeholder:(0,p.__)("Select timezone","tutor"),options:L,selectOnFocus:true,isSearchable:true}))}),/*#__PURE__*/(0,s/* .jsx */.Y)(d/* .Controller */.xI,{name:"meeting_enrolledAsAttendee",control:N.control,render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(m/* ["default"] */.A,(0,a._)((0,i._)({},e),{label:(0,p.__)("Add enrolled students as attendees","tutor")}))})]})}),/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:W.buttonWrapper({isScrolling:h}),children:[/*#__PURE__*/(0,s/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",size:"small",onClick:t,children:(0,p.__)("Cancel","tutor")}),/*#__PURE__*/(0,s/* .jsx */.Y)(f/* ["default"] */.A,{"data-cy":"save-google-meeting",loading:K.isPending,variant:"primary",size:"small",onClick:N.handleSubmit(U),children:q||u?(0,p.__)("Update Meeting","tutor"):(0,p.__)("Create Meeting","tutor")})]})]})};/* export default */const K=N;var W={container:/*#__PURE__*/(0,c/* .css */.AH)(S/* .styleUtils.display.flex */.x.display.flex("column"),"    background:",I/* .colorTokens.background.white */.I6.background.white,";padding-block:",I/* .spacing["12"] */.YK["12"],";border-radius:",I/* .borderRadius.card */.Vq.card,";box-shadow:",I/* .shadow.popover */.r7.popover,";",q/* .typography.caption */.I.caption("regular"),";* > label{font-size:",I/* .fontSize["15"] */.J["15"],";color:",I/* .colorTokens.text.title */.I6.text.title,";}"),formWrapper:/*#__PURE__*/(0,c/* .css */.AH)(S/* .styleUtils.display.flex */.x.display.flex("column"),";",S/* .styleUtils.overflowYAuto */.x.overflowYAuto,";padding-inline:",I/* .spacing["12"] */.YK["12"],";padding-bottom:",I/* .spacing["8"] */.YK["8"],";gap:",I/* .spacing["12"] */.YK["12"],";height:400px;"),dateLabel:/*#__PURE__*/(0,c/* .css */.AH)(q/* .typography.caption */.I.caption("medium"),"    color:",I/* .colorTokens.text.title */.I6.text.title,";"),meetingDateTimeWrapper:/*#__PURE__*/(0,c/* .css */.AH)(S/* .styleUtils.display.flex */.x.display.flex("column"),"    gap:",I/* .spacing["6"] */.YK["6"],";"),meetingDateTime:/*#__PURE__*/(0,c/* .css */.AH)(S/* .styleUtils.display.flex */.x.display.flex(),"    justify-content:space-between;align-items:flex-start;gap:",I/* .spacing["6"] */.YK["6"],";"),buttonWrapper:e=>{var{isScrolling:t=false}=e;return/*#__PURE__*/(0,c/* .css */.AH)(S/* .styleUtils.display.flex */.x.display.flex(),"    padding-top:",I/* .spacing["8"] */.YK["8"],";padding-inline:",I/* .spacing["12"] */.YK["12"],";justify-content:flex-end;gap:",I/* .spacing["8"] */.YK["8"],";z-index:",I/* .zIndex.positive */.fE.positive,";",t&&(0,c/* .css */.AH)(O(),I/* .shadow.scrollable */.r7.scrollable))}}},59799:function(e,t,n){n.d(t,{A:()=>N});/* import */var r=n(93640);/* import */var i=n(41147);/* import */var a=n(14206);/* import */var o=n(60599);/* import */var s=n(52639);/* import */var l=n(41594);/* import */var u=/*#__PURE__*/n.n(l);/* import */var d=n(78346);/* import */var c=n(42771);/* import */var p=n(12470);/* import */var h=/*#__PURE__*/n.n(p);/* import */var v=n(1896);/* import */var f=n(25074);/* import */var g=n(56705);/* import */var m=n(26036);/* import */var _=n(91224);/* import */var b=n(99864);/* import */var y=n(74054);/* import */var w=n(87797);/* import */var A=n(74412);/* import */var Y=n(19393);/* import */var k=n(13448);/* import */var I=n(81547);/* import */var q=n(59189);/* import */var C=n(34092);/* import */var D=n(43642);/* import */var E=n(52874);/* import */var S=n(49842);/* import */var z=n(18528);/* import */var T=n(23334);/* import */var M=n(24628);/* import */var H=n(60297);function P(){var e=(0,o._)(["\n      box-shadow: ",";\n    "]);P=function t(){return e};return e}var O=(0,H/* .getCourseId */.p)();var F=e=>{var{onCancel:t,data:n,meetingHost:o,topicId:u,meetingId:c}=e;var h;var{ref:k,isScrolling:I}=(0,D/* .useIsScrolling */.$)({defaultValue:true});var E=(0,M/* .useZoomMeetingDetailsQuery */.gK)(c?c:"",u?u:"");var H=n!==null&&n!==void 0?n:E.data;var P,F;var N=(F=(P=H===null||H===void 0?void 0:H.meeting_starts_at)!==null&&P!==void 0?P:H===null||H===void 0?void 0:H.meeting_data.start_time)!==null&&F!==void 0?F:"";var W,R,L,U,B,j;var V=(0,C/* .useFormWithGlobalError */.p)({defaultValues:{meeting_name:(W=H===null||H===void 0?void 0:H.post_title)!==null&&W!==void 0?W:"",meeting_summary:(R=H===null||H===void 0?void 0:H.post_content)!==null&&R!==void 0?R:"",meeting_date:N?(0,v/* .format */.GP)(new Date(N),Y/* .DateFormats.yearMonthDay */.UA.yearMonthDay):"",meeting_time:N?(0,v/* .format */.GP)(new Date(N),Y/* .DateFormats.hoursMinutes */.UA.hoursMinutes):"",meeting_duration:(H===null||H===void 0?void 0:H.meeting_data.duration)?String(H===null||H===void 0?void 0:H.meeting_data.duration):"40",meeting_duration_unit:(L=H===null||H===void 0?void 0:H.meeting_data.duration_unit)!==null&&L!==void 0?L:"min",meeting_timezone:(U=H===null||H===void 0?void 0:H.meeting_data.timezone)!==null&&U!==void 0?U:"",auto_recording:(B=H===null||H===void 0?void 0:(h=H.meeting_data.settings)===null||h===void 0?void 0:h.auto_recording)!==null&&B!==void 0?B:"none",meeting_password:(j=H===null||H===void 0?void 0:H.meeting_data.password)!==null&&j!==void 0?j:"",meeting_host:Object.keys(o).length===1?Object.keys(o)[0]:""},shouldFocusError:true,mode:"onChange"});var Q=(0,T/* .useSaveZoomMeetingMutation */.s1)();var G=A/* .tutorConfig.timezones */.P.timezones;var $=Object.keys(G).map(e=>({label:G[e],value:e}));var X=Object.keys(o).map(e=>({label:o[e],value:e}));var Z=e=>(0,r._)(function*(){if(!O){return}var n=yield Q.mutateAsync((0,a._)((0,i._)({},H&&{meeting_id:Number(H.ID)},u&&{topic_id:Number(u)}),{course_id:O,meeting_title:e.meeting_name,meeting_summary:e.meeting_summary,meeting_date:e.meeting_date,meeting_time:e.meeting_time,meeting_duration:Number(e.meeting_duration),meeting_duration_unit:e.meeting_duration_unit,meeting_timezone:e.meeting_timezone,auto_recording:e.auto_recording,meeting_password:e.meeting_password,click_form:u?"course_builder":"metabox",meeting_host:e.meeting_host}));if(n.data){t();V.reset()}})();(0,l.useEffect)(()=>{if((0,S/* .isDefined */.O9)(H)){var e;var t;V.reset({meeting_name:H.post_title,meeting_summary:H.post_content,meeting_date:N?(0,v/* .format */.GP)(new Date(N),Y/* .DateFormats.yearMonthDay */.UA.yearMonthDay):"",meeting_time:N?(0,v/* .format */.GP)(new Date(N),Y/* .DateFormats.hoursMinutes */.UA.hoursMinutes):"",meeting_duration:String(H.meeting_data.duration),meeting_duration_unit:H.meeting_data.duration_unit,meeting_timezone:H.meeting_data.timezone,auto_recording:(t=(e=H.meeting_data.settings)===null||e===void 0?void 0:e.auto_recording)!==null&&t!==void 0?t:"none",meeting_password:H.meeting_data.password,meeting_host:H.meeting_data.host_id})}var n=setTimeout(()=>{V.setFocus("meeting_name")},250);return()=>{clearTimeout(n)};// eslint-disable-next-line react-hooks/exhaustive-deps
},[H]);return/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:K.container,children:[/*#__PURE__*/(0,s/* .jsx */.Y)("div",{css:K.formWrapper,ref:k,children:/*#__PURE__*/(0,s/* .jsxs */.FD)(q/* ["default"] */.A,{when:!E.isLoading,fallback:/*#__PURE__*/(0,s/* .jsx */.Y)(g/* .LoadingOverlay */.p8,{}),children:[/*#__PURE__*/(0,s/* .jsx */.Y)(d/* .Controller */.xI,{name:"meeting_name",control:V.control,rules:{required:(0,p.__)("Name is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(_/* ["default"] */.A,(0,a._)((0,i._)({},e),{label:(0,p.__)("Meeting Name","tutor"),placeholder:(0,p.__)("Enter meeting name","tutor")}))}),/*#__PURE__*/(0,s/* .jsx */.Y)(d/* .Controller */.xI,{name:"meeting_summary",control:V.control,rules:{required:(0,p.__)("Summary is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(y/* ["default"] */.A,(0,a._)((0,i._)({},e),{label:(0,p.__)("Meeting Summary","tutor"),placeholder:(0,p.__)("Enter meeting summary","tutor"),rows:3,enableResize:true}))}),/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:K.meetingDateTimeWrapper,children:[/*#__PURE__*/(0,s/* .jsx */.Y)(d/* .Controller */.xI,{name:"meeting_date",control:V.control,rules:{required:(0,p.__)("Date is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(m/* ["default"] */.A,(0,a._)((0,i._)({},e),{label:(0,p.__)("Meeting Date","tutor"),placeholder:(0,p.__)("Enter meeting date","tutor"),disabledBefore:new Date().toISOString()}))}),/*#__PURE__*/(0,s/* .jsx */.Y)(d/* .Controller */.xI,{name:"meeting_time",control:V.control,rules:{required:(0,p.__)("Time is required","tutor"),validate:z/* .invalidTimeRule */.XA},render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(w/* ["default"] */.A,(0,a._)((0,i._)({},e),{placeholder:(0,p.__)("Start time","tutor")}))}),/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:K.meetingTimeWrapper,children:[/*#__PURE__*/(0,s/* .jsx */.Y)(d/* .Controller */.xI,{name:"meeting_duration",control:V.control,rules:{required:(0,p.__)("Duration is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(_/* ["default"] */.A,(0,a._)((0,i._)({},e),{label:(0,p.__)("Meeting Duration","tutor"),placeholder:(0,p.__)("Duration","tutor"),type:"number",selectOnFocus:true}))}),/*#__PURE__*/(0,s/* .jsx */.Y)(d/* .Controller */.xI,{name:"meeting_duration_unit",control:V.control,rules:{required:(0,p.__)("Duration unit is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(b/* ["default"] */.A,(0,a._)((0,i._)({},e),{label:/*#__PURE__*/(0,s/* .jsx */.Y)("span",{children:" "}),options:[{label:(0,p.__)("Minutes","tutor"),value:"min"},{label:(0,p.__)("Hours","tutor"),value:"hr"}]}))})]})]}),/*#__PURE__*/(0,s/* .jsx */.Y)(d/* .Controller */.xI,{name:"meeting_timezone",control:V.control,rules:{required:(0,p.__)("Timezone is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(b/* ["default"] */.A,(0,a._)((0,i._)({},e),{label:(0,p.__)("Timezone","tutor"),placeholder:(0,p.__)("Select timezone","tutor"),options:$,selectOnFocus:true,isSearchable:true}))}),/*#__PURE__*/(0,s/* .jsx */.Y)(d/* .Controller */.xI,{name:"auto_recording",control:V.control,rules:{required:(0,p.__)("Auto recording is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(b/* ["default"] */.A,(0,a._)((0,i._)({},e),{label:(0,p.__)("Auto Recording","tutor"),placeholder:(0,p.__)("Select auto recording option","tutor"),options:[{label:(0,p.__)("No recordings","tutor"),value:"none"},{label:(0,p.__)("Local","tutor"),value:"local"},{label:(0,p.__)("Cloud","tutor"),value:"cloud"}]}))}),/*#__PURE__*/(0,s/* .jsx */.Y)(d/* .Controller */.xI,{name:"meeting_password",control:V.control,rules:{required:(0,p.__)("Password is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(_/* ["default"] */.A,(0,a._)((0,i._)({},e),{label:(0,p.__)("Meeting Password","tutor"),placeholder:(0,p.__)("Enter meeting password","tutor"),type:"password",isPassword:true}))}),/*#__PURE__*/(0,s/* .jsx */.Y)(d/* .Controller */.xI,{name:"meeting_host",control:V.control,rules:{required:(0,p.__)("Meeting host is required","tutor")},render:e=>/*#__PURE__*/(0,s/* .jsx */.Y)(b/* ["default"] */.A,(0,a._)((0,i._)({},e),{label:(0,p.__)("Meeting Host","tutor"),placeholder:(0,p.__)("Enter meeting host","tutor"),options:X,disabled:(0,S/* .isDefined */.O9)(H),selectOnFocus:true,isSearchable:true}))})]})}),/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:K.buttonWrapper({isScrolling:I}),children:[/*#__PURE__*/(0,s/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",size:"small",onClick:t,children:(0,p.__)("Cancel","tutor")}),/*#__PURE__*/(0,s/* .jsx */.Y)(f/* ["default"] */.A,{"data-cy":"save-zoom-meeting",loading:Q.isPending,variant:"primary",size:"small",onClick:V.handleSubmit(Z),children:H||c?(0,p.__)("Update Meeting","tutor"):(0,p.__)("Create Meeting","tutor")})]})]})};/* export default */const N=F;var K={container:/*#__PURE__*/(0,c/* .css */.AH)(E/* .styleUtils.display.flex */.x.display.flex("column"),"    background:",k/* .colorTokens.background.white */.I6.background.white,";padding-block:",k/* .spacing["12"] */.YK["12"],";border-radius:",k/* .borderRadius.card */.Vq.card,";box-shadow:",k/* .shadow.popover */.r7.popover,";",I/* .typography.caption */.I.caption("regular"),";* > label{font-size:",k/* .fontSize["15"] */.J["15"],";color:",k/* .colorTokens.text.title */.I6.text.title,";}"),formWrapper:/*#__PURE__*/(0,c/* .css */.AH)(E/* .styleUtils.display.flex */.x.display.flex("column"),";",E/* .styleUtils.overflowYAuto */.x.overflowYAuto,";padding-inline:",k/* .spacing["12"] */.YK["12"],";padding-bottom:",k/* .spacing["8"] */.YK["8"],";gap:",k/* .spacing["12"] */.YK["12"],";height:400px;"),meetingDateTimeWrapper:/*#__PURE__*/(0,c/* .css */.AH)(E/* .styleUtils.display.flex */.x.display.flex("column"),"    gap:",k/* .spacing["6"] */.YK["6"],";"),meetingTimeWrapper:/*#__PURE__*/(0,c/* .css */.AH)(E/* .styleUtils.display.flex */.x.display.flex(),"    justify-content:space-between;align-items:flex-start;gap:",k/* .spacing["6"] */.YK["6"],";"),buttonWrapper:e=>{var{isScrolling:t=false}=e;return/*#__PURE__*/(0,c/* .css */.AH)(E/* .styleUtils.display.flex */.x.display.flex(),"    padding-top:",k/* .spacing["8"] */.YK["8"],";padding-inline:",k/* .spacing["12"] */.YK["12"],";justify-content:flex-end;gap:",k/* .spacing["8"] */.YK["8"],";z-index:",k/* .zIndex.positive */.fE.positive,";",t&&(0,c/* .css */.AH)(P(),k/* .shadow.scrollable */.r7.scrollable))}}},6267:function(e,t,n){n.d(t,{A:()=>m});/* import */var r=n(60599);/* import */var i=n(52639);/* import */var a=n(75688);/* import */var o=n(42771);/* import */var s=n(12470);/* import */var l=/*#__PURE__*/n.n(s);/* import */var u=n(25074);/* import */var d=n(46225);/* import */var c=n(19393);/* import */var p=n(13448);/* import */var h=n(81547);/* import */var v=n(59189);function f(){var e=(0,r._)(["\n      transform: rotate(180deg);\n    "]);f=function t(){return e};return e}var g=e=>{var{title:t,backUrl:n,rightButton:r,isExternalUrl:o}=e;var l=(0,a/* .useNavigate */.Zp)();var p=()=>{if(n){if(o){window.location.href=n;return}l(n)}else{l(-1)}};return/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:_.wrapper,children:[/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:_.left,children:[/*#__PURE__*/(0,i/* .jsx */.Y)(v/* ["default"] */.A,{when:n,children:/*#__PURE__*/(0,i/* .jsx */.Y)(u/* ["default"] */.A,{isIconOnly:true,size:"small",variant:"text","aria-label":(0,s.__)("Back","tutor"),buttonCss:_.button({isRTL:c/* .isRTL */.V8}),onClick:p,icon:/*#__PURE__*/(0,i/* .jsx */.Y)(d/* ["default"] */.A,{name:"back",width:32,height:32})})}),/*#__PURE__*/(0,i/* .jsx */.Y)("h6",{css:_.title,children:t})]}),r]})};/* export default */const m=g;var _={wrapper:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;align-items:center;justify-content:space-between;"),left:/*#__PURE__*/(0,o/* .css */.AH)("display:flex;align-items:center;gap:",p/* .spacing["16"] */.YK["16"],";"),button:e=>{var{isRTL:t}=e;return/*#__PURE__*/(0,o/* .css */.AH)("padding:0;border-radius:",p/* .borderRadius["2"] */.Vq["2"],";",t&&(0,o/* .css */.AH)(f()))},title:/*#__PURE__*/(0,o/* .css */.AH)(h/* .typography.heading6 */.I.heading6("medium"),";")}},45934:function(e,t,n){n.d(t,{A:()=>y});/* import */var r=n(41147);/* import */var i=n(14206);/* import */var a=n(52639);/* import */var o=n(78346);/* import */var s=n(75688);/* import */var l=n(42771);/* import */var u=n(12470);/* import */var d=/*#__PURE__*/n.n(u);/* import */var c=n(25074);/* import */var p=n(46225);/* import */var h=n(19393);/* import */var v=n(13448);/* import */var f=n(59189);/* import */var g=n(73755);/* import */var m=n(36068);/* import */var _=n(43414);var b=e=>{var{styleModifier:t}=e;var{steps:n,setSteps:d}=(0,_/* .useCourseNavigator */._)();var b=(0,s/* .useNavigate */.Zp)();var y=(0,g/* .useCurrentPath */.G)(m/* ["default"] */.A);var A=(0,o/* .useFormContext */.xW)();var Y=n.findIndex(e=>e.path===y);var k=Math.max(-1,Y-1);var I=Math.min(n.length,Y+1);var q=n[k];var C=n[I];var D=A.watch("post_title");var E=()=>{d(e=>{return e.map((e,t)=>{if(t===Y){return(0,i._)((0,r._)({},e),{isActive:false})}if(t===k){return(0,i._)((0,r._)({},e),{isActive:true})}return e})});b(q.path)};var S=()=>{d(e=>{return e.map((e,t)=>{if(t===Y){return(0,i._)((0,r._)({},e),{isActive:false})}if(t===I){return(0,i._)((0,r._)({},e),{isActive:true})}return e})});b(C.path)};return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:[w.wrapper,t],children:[/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{when:Y>0,children:/*#__PURE__*/(0,a/* .jsx */.Y)(c/* ["default"] */.A,{variant:"tertiary",iconPosition:"right",size:"small",onClick:E,buttonCss:/*#__PURE__*/(0,l/* .css */.AH)("padding:",v/* .spacing["4"] */.YK["4"],";svg{color:",v/* .colorTokens.icon["default"] */.I6.icon["default"],";}"),disabled:k<0,children:/*#__PURE__*/(0,a/* .jsx */.Y)(p/* ["default"] */.A,{name:!h/* .isRTL */.V8?"chevronLeft":"chevronRight",height:24,width:24})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{when:Y<n.length-1&&D,children:/*#__PURE__*/(0,a/* .jsx */.Y)(c/* ["default"] */.A,{variant:"tertiary",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(p/* ["default"] */.A,{name:!h/* .isRTL */.V8?"chevronRight":"chevronLeft",height:24,width:24}),iconPosition:"right",size:"small",onClick:S,buttonCss:/*#__PURE__*/(0,l/* .css */.AH)("padding:",v/* .spacing["4"] */.YK["4"]," ",v/* .spacing["4"] */.YK["4"]," ",v/* .spacing["4"] */.YK["4"]," ",v/* .spacing["12"] */.YK["12"],";svg{color:",v/* .colorTokens.icon["default"] */.I6.icon["default"],";}"),disabled:!D||I>=n.length,children:(0,u.__)("Next","tutor")})})]})};/* export default */const y=b;var w={wrapper:/*#__PURE__*/(0,l/* .css */.AH)("width:100%;display:flex;justify-content:end;height:32px;align-items:center;gap:",v/* .spacing["16"] */.YK["16"],";")}},14169:function(e,t,n){// ESM COMPAT FLAG
n.r(t);// EXPORTS
n.d(t,{"default":()=>/* binding */g6});// EXTERNAL MODULE: ./node_modules/.pnpm/@swc+helpers@0.5.17/node_modules/@swc/helpers/esm/_object_spread.js
var r=n(41147);// EXTERNAL MODULE: ./node_modules/.pnpm/@swc+helpers@0.5.17/node_modules/@swc/helpers/esm/_object_spread_props.js
var i=n(14206);// EXTERNAL MODULE: ./node_modules/.pnpm/@emotion+react@11.14.0_@types+react@18.3.1_react@18.3.1/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js
var a=n(52639);// EXTERNAL MODULE: external "React"
var o=n(41594);var s=/*#__PURE__*/n.n(o);// EXTERNAL MODULE: external "ReactDOM"
var l=n(75206);// EXTERNAL MODULE: ./node_modules/.pnpm/react-router@6.30.2_react@18.3.1/node_modules/react-router/dist/index.js
var u=n(75688);// EXTERNAL MODULE: ./node_modules/.pnpm/@dnd-kit+core@6.3.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@dnd-kit/core/dist/core.esm.js
var d=n(7697);// EXTERNAL MODULE: ./node_modules/.pnpm/@dnd-kit+modifiers@9.0.0_@dnd-kit+core@6.3.1_react-dom@18.3.1_react@18.3.1__react@18.3.1__react@18.3.1/node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js
var c=n(97313);// EXTERNAL MODULE: ./node_modules/.pnpm/@dnd-kit+sortable@10.0.0_@dnd-kit+core@6.3.1_react-dom@18.3.1_react@18.3.1__react@18.3.1__react@18.3.1/node_modules/@dnd-kit/sortable/dist/sortable.esm.js
var p=n(905);// EXTERNAL MODULE: ./node_modules/.pnpm/@emotion+react@11.14.0_@types+react@18.3.1_react@18.3.1/node_modules/@emotion/react/dist/emotion-react.browser.esm.js
var h=n(42771);// EXTERNAL MODULE: external "wp.i18n"
var v=n(12470);// EXTERNAL MODULE: ./assets/src/js/v3/shared/atoms/Button.tsx
var f=n(25074);// EXTERNAL MODULE: ./assets/src/js/v3/shared/atoms/LoadingSpinner.tsx
var g=n(56705);// EXTERNAL MODULE: ./assets/src/js/v3/shared/atoms/SVGIcon.tsx
var m=n(46225);// EXTERNAL MODULE: ./assets/src/js/v3/shared/config/styles.ts
var _=n(13448);// EXTERNAL MODULE: ./assets/src/js/v3/shared/controls/For.tsx
var b=n(3013);// EXTERNAL MODULE: ./assets/src/js/v3/shared/controls/Show.tsx
var y=n(59189);// EXTERNAL MODULE: ./assets/src/js/v3/shared/molecules/EmptyState.tsx
var w=n(92795);// EXTERNAL MODULE: ./assets/src/js/v3/shared/utils/dndkit.ts
var A=n(66317);// EXTERNAL MODULE: ./assets/src/js/v3/shared/utils/style-utils.ts
var Y=n(52874);// EXTERNAL MODULE: ./assets/src/js/v3/shared/utils/util.ts + 4 modules
var k=n(33231);// EXTERNAL MODULE: ./node_modules/.pnpm/@swc+helpers@0.5.17/node_modules/@swc/helpers/esm/_tagged_template_literal.js
var I=n(60599);// EXTERNAL MODULE: ./node_modules/.pnpm/@dnd-kit+utilities@3.2.2_react@18.3.1/node_modules/@dnd-kit/utilities/dist/utilities.esm.js
var q=n(37893);// EXTERNAL MODULE: ./node_modules/.pnpm/@react-spring+web@9.7.5_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@react-spring/web/dist/react-spring_web.modern.mjs
var C=n(76035);// EXTERNAL MODULE: ./assets/src/js/v3/shared/utils/types.ts
var D=n(49842);// EXTERNAL MODULE: ./node_modules/.pnpm/@swc+helpers@0.5.17/node_modules/@swc/helpers/esm/_async_to_generator.js
var E=n(93640);// EXTERNAL MODULE: ./node_modules/.pnpm/react-hook-form@7.67.0_react@18.3.1/node_modules/react-hook-form/dist/index.esm.mjs
var S=n(78346);// EXTERNAL MODULE: ./node_modules/.pnpm/@tanstack+react-query@5.62.15_react@18.3.1/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js
var z=n(92965);// EXTERNAL MODULE: ./assets/src/js/v3/shared/atoms/ProBadge.tsx
var T=n(84492);// EXTERNAL MODULE: ./assets/src/js/v3/shared/atoms/Tooltip.tsx
var M=n(90453);// EXTERNAL MODULE: ./assets/src/js/v3/shared/components/modals/Modal.tsx
var H=n(17944);// EXTERNAL MODULE: ./assets/src/js/v3/shared/config/config.ts
var P=n(74412);// EXTERNAL MODULE: ./assets/src/js/v3/shared/config/constants.ts
var O=n(19393);// EXTERNAL MODULE: ./assets/src/js/v3/shared/config/typography.ts
var F=n(81547);// EXTERNAL MODULE: ./assets/src/js/v3/shared/hooks/useAnimation.tsx
var N=n(31569);// EXTERNAL MODULE: ./assets/src/js/v3/shared/hooks/usePortalPopover.tsx
var K=n(84206);// EXTERNAL MODULE: ./assets/src/js/v3/shared/molecules/ConfirmationPopover.tsx
var W=n(57503);// EXTERNAL MODULE: ./assets/src/js/v3/shared/molecules/Popover.tsx
var R=n(21678);// EXTERNAL MODULE: ./assets/src/js/v3/entries/course-builder/components/additional/meeting/GoogleMeetForm.tsx
var L=n(51243);// EXTERNAL MODULE: ./assets/src/js/v3/entries/course-builder/components/additional/meeting/ZoomMeetingForm.tsx
var U=n(59799);// EXTERNAL MODULE: ./assets/src/js/v3/shared/components/fields/FormDateInput.tsx
var B=n(26036);// EXTERNAL MODULE: ./assets/src/js/v3/shared/components/fields/FormFileUploader.tsx
var j=n(46062);// EXTERNAL MODULE: ./assets/src/js/v3/shared/components/fields/FormInput.tsx
var V=n(91224);// EXTERNAL MODULE: ./assets/src/js/v3/shared/components/fields/FormInputWithContent.tsx
var Q=n(6977);// EXTERNAL MODULE: ./assets/src/js/v3/shared/components/fields/FormSelectInput.tsx
var G=n(99864);// EXTERNAL MODULE: ./assets/src/js/v3/shared/components/fields/FormSwitch.tsx
var $=n(9694);// EXTERNAL MODULE: ./node_modules/.pnpm/@swc+helpers@0.5.17/node_modules/@swc/helpers/esm/_object_without_properties.js + 1 modules
var X=n(17900);// EXTERNAL MODULE: ./assets/src/js/v3/shared/hooks/useDebounce.ts
var Z=n(44486);// EXTERNAL MODULE: ./assets/src/js/v3/public/images/not-found.webp
var J=n(27895);// EXTERNAL MODULE: ./assets/src/js/v3/public/images/not-found-2x.webp
var ee=n(8452);// EXTERNAL MODULE: ./assets/src/js/v3/shared/components/fields/FormFieldWrapper.tsx
var et=n(42263);// CONCATENATED MODULE: ./assets/src/js/v3/shared/components/fields/FormTopicPrerequisites.tsx
function en(){var e=(0,I._)(["\n      box-shadow: ",";\n    "]);en=function t(){return e};return e}function er(){var e=(0,I._)(["\n        background-color: ",";\n        border-color: ",";\n\n        [data-visually-hidden] {\n          opacity: 1;\n        }\n      "]);er=function t(){return e};return e}function ei(){var e=(0,I._)(["\n      padding-left: ",";\n    "]);ei=function t(){return e};return e}var ea={lesson:{name:"lesson",color:_/* .colorTokens.icon["default"] */.I6.icon["default"]},tutor_quiz:{name:"quiz",color:_/* .colorTokens.design.warning */.I6.design.warning},tutor_assignments:{name:"assignment",color:_/* .colorTokens.icon.processing */.I6.icon.processing},tutor_zoom_meeting:{name:"zoomColorize",color:""},"tutor-google-meet":{name:"googleMeetColorize",color:""},tutor_h5p_quiz:{name:"quiz",color:_/* .colorTokens.icon.warning */.I6.icon.warning}};var eo=e=>{var{field:t,fieldState:n,options:s,onChange:l=k/* .noop */.lQ,handleSearchOnChange:u,label:d,placeholder:c="",disabled:p,readOnly:f,loading:_,isSearchable:A=false,helpText:Y}=e;var I=t.value||[];var q=I.map(e=>String(e));var C=s.reduce((e,t)=>{return t.contents.reduce((e,t)=>{if(q.includes(String(t.ID))){e.push(t)}return e},e)},[]);var D=(0,o.useRef)(null);var[E,S]=(0,o.useState)(false);var[z,T]=(0,o.useState)("");var M=(0,Z/* .useDebounce */.d)(z);var H=s.reduce((e,t)=>{var n=t.contents.filter(e=>e.post_type!=="tutor-google-meet"&&e.post_type!=="tutor_zoom_meeting"&&!q.includes(String(e.ID)));if(n.length===0){return e}if(t.title.toLowerCase().includes(M.toLowerCase())){e.push((0,i._)((0,r._)({},t),{contents:n}))}else{var a=t.contents.filter(e=>e.post_title.toLowerCase().includes(M.toLowerCase()));if(a.length===0){return e}e.push((0,i._)((0,r._)({},t),{contents:a}))}return e},[]);(0,o.useEffect)(()=>{if(u){u(M)}else{// Handle local filter
}},[M,u]);var P=e=>{if(Array.isArray(I)){var n=I.filter(t=>String(t)!==String(e));t.onChange(n);l(n)}};return/*#__PURE__*/(0,a/* .jsx */.Y)(et/* ["default"] */.A,{fieldState:n,field:t,label:d,disabled:p,readOnly:f,helpText:Y,children:e=>{var{css:n}=e,o=(0,X._)(e,["css"]);return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:el.mainWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{ref:D,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:el.inputWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:el.leftIcon,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"search",width:24,height:24})}),/*#__PURE__*/(0,a/* .jsx */.Y)("input",(0,i._)((0,r._)({},o),{onClick:e=>{e.stopPropagation();S(e=>!e)},onKeyDown:e=>{if(e.key==="Enter"){e.preventDefault();S(e=>!e)}if(e.key==="Tab"){S(false)}},className:"tutor-input-field",css:[n,el.input],autoComplete:"off",readOnly:f||!A,placeholder:c,value:z,onChange:e=>{T(e.target.value)}}))]})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:I.length>0,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!_,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(g/* .LoadingSection */.YE,{}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(w/* ["default"] */.A,{size:"small",emptyStateImage:J,emptyStateImage2x:ee,imageAltText:(0,v.__)("Illustration of a no course selected","tutor"),title:(0,v.__)("No topic content selected","tutor"),description:(0,v.__)("Select a topic content to add as a prerequisite","tutor")})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:el.courseList,children:/*#__PURE__*/(0,a/* .jsx */.Y)(b/* ["default"] */.A,{each:C,children:e=>{var t;return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:el.groupItems({onPopover:false}),children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:el.iconAndTitle({onPopover:false}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:((t=ea[e.post_type])===null||t===void 0?void 0:t.name)||"lesson",width:24,height:24,style:/*#__PURE__*/(0,h/* .css */.AH)("color:",ea[e.post_type].color,";")}),/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:el.title,title:e.post_title,children:e.post_title}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:e.post_type==="tutor_quiz"&&e.total_question,children:/*#__PURE__*/(0,a/* .jsx */.Y)("span",{"data-question-count":true,css:F/* .typography.tiny */.I.tiny(),children:/* translators: %d is the number of questions */(0,v.sprintf)((0,v.__)("(%d questions)","tutor"),e.total_question)})})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:el.removeButton,"data-visually-hidden":true,onClick:()=>P(e.ID),children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"times",width:14,height:14})})]},e.ID)}})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(R/* ["default"] */.A,{triggerRef:D,isOpen:E,dependencies:[H.length],animationType:N/* .AnimationType.slideDown */.J6.slideDown,closePopover:()=>{S(false);T("")},children:/*#__PURE__*/(0,a/* .jsx */.Y)("ul",{css:[el.options],children:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:H.length>0,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)("li",{css:el.emptyOption,children:/*#__PURE__*/(0,a/* .jsx */.Y)("p",{children:(0,v.__)("No topics content found","tutor")})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(b/* ["default"] */.A,{each:H,children:e=>/*#__PURE__*/(0,a/* .jsxs */.FD)("li",{css:el.group,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:el.groupTitle,title:e.title,children:e.title}),/*#__PURE__*/(0,a/* .jsx */.Y)(b/* ["default"] */.A,{each:e.contents,children:e=>{var n;return/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:el.groupItems({onPopover:true}),onClick:()=>{var n=[...I,e.ID];t.onChange(n);l(n);S(false);T("")},children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:el.iconAndTitle({onPopover:true}),"data-content-icon":true,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:((n=ea[e.post_type])===null||n===void 0?void 0:n.name)||"lesson",width:24,height:24,style:/*#__PURE__*/(0,h/* .css */.AH)("color:",ea[e.post_type].color,";")}),/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:el.title,title:e.post_title,children:e.post_title}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:e.post_type==="tutor_quiz"&&e.total_question,children:/*#__PURE__*/(0,a/* .jsx */.Y)("span",{"data-question-count":true,css:F/* .typography.tiny */.I.tiny(),children:/* translators: %d is the number of questions */(0,v.sprintf)((0,v.__)("(%d questions)","tutor"),e.total_question)})})]})},e.ID)}})]},e.id)})})})})]})}})};/* export default */const es=eo;var el={mainWrapper:/*#__PURE__*/(0,h/* .css */.AH)("width:100%;"),inputWrapper:/*#__PURE__*/(0,h/* .css */.AH)("width:100%;display:flex;justify-content:space-between;align-items:center;position:relative;"),leftIcon:/*#__PURE__*/(0,h/* .css */.AH)("position:absolute;left:",_/* .spacing["8"] */.YK["8"],";top:",_/* .spacing["8"] */.YK["8"],";color:",_/* .colorTokens.icon["default"] */.I6.icon["default"],";display:flex;"),input:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.body */.I.body(),";width:100%;padding-right:",_/* .spacing["32"] */.YK["32"],";padding-left:",_/* .spacing["36"] */.YK["36"],";",Y/* .styleUtils.textEllipsis */.x.textEllipsis,";border:1px solid ",_/* .colorTokens.stroke["default"] */.I6.stroke["default"],";&.tutor-input-field{padding-right:",_/* .spacing["32"] */.YK["32"],";padding-left:",_/* .spacing["36"] */.YK["36"],";}"),courseList:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),"    gap:",_/* .spacing["8"] */.YK["8"],";max-height:256px;height:100%;margin-top:",_/* .spacing["8"] */.YK["8"],";",Y/* .styleUtils.overflowYAuto */.x.overflowYAuto,";padding:1px;"),options:/*#__PURE__*/(0,h/* .css */.AH)("z-index:",_/* .zIndex.dropdown */.fE.dropdown,";background-color:",_/* .colorTokens.background.white */.I6.background.white,";list-style-type:none;box-shadow:",_/* .shadow.popover */.r7.popover,";padding:",_/* .spacing["4"] */.YK["4"]," 0;margin:0;max-height:400px;border-radius:",_/* .borderRadius["6"] */.Vq["6"],";",Y/* .styleUtils.overflowYAuto */.x.overflowYAuto,";"),removeButton:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.resetButton */.x.resetButton,";position:absolute;top:50%;right:",_/* .spacing["8"] */.YK["8"],";transform:translateY(-50%);display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:",_/* .borderRadius.circle */.Vq.circle,";background:",_/* .colorTokens.background.white */.I6.background.white,";&:focus,&:active,&:hover{background:",_/* .colorTokens.background.white */.I6.background.white,";}svg{color:",_/* .colorTokens.icon["default"] */.I6.icon["default"],";transition:color 0.3s ease-in-out;}:hover{svg{color:",_/* .colorTokens.icon.hover */.I6.icon.hover,";}}:focus{box-shadow:",_/* .shadow.focus */.r7.focus,";}"),emptyOption:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.caption */.I.caption("medium"),";padding:",_/* .spacing["8"] */.YK["8"],";text-align:center;"),group:/*#__PURE__*/(0,h/* .css */.AH)("padding:",_/* .spacing["10"] */.YK["10"]," 0;:not(:last-child){border-bottom:1px solid ",_/* .colorTokens.stroke.divider */.I6.stroke.divider,";}"),groupTitle:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.small */.I.small("semiBold"),";",Y/* .styleUtils.text.ellipsis */.x.text.ellipsis(1),";padding-inline:",_/* .spacing["10"] */.YK["10"],";margin-bottom:",_/* .spacing["8"] */.YK["8"],";"),groupItems:e=>{var{onPopover:t}=e;return/*#__PURE__*/(0,h/* .css */.AH)("position:relative;width:100%;padding:",_/* .spacing["10"] */.YK["10"]," ",_/* .spacing["8"] */.YK["8"],";border-radius:",_/* .borderRadius["6"] */.Vq["6"],";border:1px solid transparent;display:flex;justify-content:space-between;align-items:center;gap:",_/* .spacing["8"] */.YK["8"],";background-color:",_/* .colorTokens.background.white */.I6.background.white,";cursor:",t?"pointer":"default",";[data-content-icon]{display:flex;height:",t?"20px":"24px",";}[data-visually-hidden]{opacity:0;}",!t&&(0,h/* .css */.AH)(en(),_/* .shadow.card */.r7.card),"    &:hover,&:focus,&:active{background-color:",_/* .colorTokens.background.hover */.I6.background.hover,";",!t&&(0,h/* .css */.AH)(er(),_/* .colorTokens.background.white */.I6.background.white,_/* .colorTokens.stroke["default"] */.I6.stroke["default"]),"}",_/* .Breakpoint.smallTablet */.EA.smallTablet,"{[data-visually-hidden]{opacity:1;}}")},title:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.caption */.I.caption(),";color:",_/* .colorTokens.text.title */.I6.text.title,";display:flex;align-items:center;gap:",_/* .spacing["4"] */.YK["4"],";"),iconAndTitle:e=>{var{onPopover:t}=e;return/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.text.ellipsis */.x.text.ellipsis(1),";display:flex;align-items:center;gap:",_/* .spacing["8"] */.YK["8"],";",t&&(0,h/* .css */.AH)(ei(),_/* .spacing["16"] */.YK["16"]),"    svg{flex-shrink:0;}span{text-align:left;",Y/* .styleUtils.text.ellipsis */.x.text.ellipsis(1),";}[data-question-count]{flex-shrink:0;text-decoration:none;}")}};// EXTERNAL MODULE: ./assets/src/js/v3/shared/components/fields/FormWPEditor.tsx
var eu=n(15004);// EXTERNAL MODULE: ./assets/src/js/v3/shared/components/modals/ModalWrapper.tsx
var ed=n(37547);// EXTERNAL MODULE: ./assets/src/js/v3/shared/hooks/useFormWithGlobalError.ts
var ec=n(34092);// EXTERNAL MODULE: ./assets/src/js/v3/shared/utils/validation.ts
var ep=n(18528);// EXTERNAL MODULE: ./assets/src/js/v3/entries/course-builder/components/CourseBuilderSlot.tsx + 3 modules
var eh=n(89041);// EXTERNAL MODULE: ./assets/src/js/v3/entries/course-builder/contexts/CourseBuilderSlotContext.tsx
var ev=n(79100);// EXTERNAL MODULE: ./assets/src/js/v3/entries/course-builder/services/curriculum.ts
var ef=n(24628);// EXTERNAL MODULE: ./assets/src/js/v3/entries/course-builder/utils/utils.ts
var eg=n(60297);// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/modals/AssignmentModal.tsx
var em=(0,eg/* .getCourseId */.p)();var e_=[{label:(0,v.__)("Weeks","tutor"),value:"weeks"},{label:(0,v.__)("Days","tutor"),value:"days"},{label:(0,v.__)("Hours","tutor"),value:"hours"}];var eb=e=>{var{assignmentId:t="",topicId:n,closeModal:s,icon:l,title:u,subtitle:d,contentDripType:c}=e;var p;var{fields:h}=(0,ev/* .useCourseBuilderSlot */._)();var _=!!P/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var b=((p=P/* .tutorConfig.settings */.P.settings)===null||p===void 0?void 0:p.chatgpt_enable)==="on";var w=(0,ef/* .useAssignmentDetailsQuery */.pR)(t,n);var A=(0,ef/* .useSaveAssignmentMutation */.$2)(em);var Y=(0,z/* .useQueryClient */.jE)();var{data:I}=w;var q=Y.getQueryData(["Topic",em]);var C=(0,ec/* .useFormWithGlobalError */.p)({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,is_retry_allowed:true,attempts_allowed:5,content_drip_settings:{unlock_date:"",after_xdays_of_enroll:"",prerequisites:[]}},shouldFocusError:true,mode:"onChange"});var D=C.formState.dirtyFields&&Object.keys(C.formState.dirtyFields).length>0;var T=C.watch("is_retry_allowed");(0,o.useEffect)(()=>{if(I){var e,t,n;C.reset((0,r._)({title:I.post_title||"",summary:(0,k/* .normalizeLineEndings */.EW)(I.post_content)||"",attachments:I.attachments||[],time_duration:{value:I.assignment_option.time_duration.value||"0",time:I.assignment_option.time_duration.time||"weeks"},deadline_from_start:I.assignment_option.deadline_from_start==="1"?true:false,total_mark:I.assignment_option.total_mark||10,pass_mark:I.assignment_option.pass_mark||5,upload_files_limit:I.assignment_option.upload_files_limit||1,upload_file_size_limit:I.assignment_option.upload_file_size_limit||2,is_retry_allowed:I.assignment_option.is_retry_allowed==="1"?true:false,attempts_allowed:I.assignment_option.attempts_allowed||10,content_drip_settings:{unlock_date:(I===null||I===void 0?void 0:(e=I.content_drip_settings)===null||e===void 0?void 0:e.unlock_date)||"",after_xdays_of_enroll:(I===null||I===void 0?void 0:(t=I.content_drip_settings)===null||t===void 0?void 0:t.after_xdays_of_enroll)||"",prerequisites:(I===null||I===void 0?void 0:(n=I.content_drip_settings)===null||n===void 0?void 0:n.prerequisites)||[]}},Object.fromEntries((0,k/* .findSlotFields */.DE)({fields:h.Curriculum.Lesson}).map(e=>[e,I[e]]))),{keepDirty:false})}var i=setTimeout(()=>{C.setFocus("title")},0);return()=>{clearTimeout(i)};// eslint-disable-next-line react-hooks/exhaustive-deps
},[I]);var M=e=>(0,E._)(function*(){var r=(0,ef/* .convertAssignmentDataToPayload */.sC)(e,t,n,c,(0,k/* .findSlotFields */.DE)({fields:h.Curriculum.Assignment}));var i=yield A.mutateAsync(r);if(i.status_code===200||i.status_code===201){s({action:"CONFIRM"})}})();return/*#__PURE__*/(0,a/* .jsx */.Y)(ed/* ["default"] */.A,{onClose:()=>s({action:"CLOSE"}),icon:D?/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"warning",width:24,height:24}):l,title:D?O/* .CURRENT_VIEWPORT.isAboveDesktop */.vN.isAboveDesktop?(0,v.__)("Unsaved Changes","tutor"):"":u,subtitle:O/* .CURRENT_VIEWPORT.isAboveSmallMobile */.vN.isAboveSmallMobile?d:"",maxWidth:1070,actions:D&&/*#__PURE__*/(0,a/* .jsxs */.FD)(a/* .Fragment */.FK,{children:[/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",size:"small",onClick:()=>{if(t){C.reset()}else{s({action:"CLOSE"})}},children:t?(0,v.__)("Discard Changes","tutor"):(0,v.__)("Cancel","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{"data-cy":"save-assignment",loading:A.isPending,variant:"primary",size:"small",onClick:C.handleSubmit(M),children:t?(0,v.__)("Update","tutor"):(0,v.__)("Save","tutor")})]}),children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:ew.wrapper,children:/*#__PURE__*/(0,a/* .jsxs */.FD)(y/* ["default"] */.A,{when:!w.isLoading,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(g/* .LoadingOverlay */.p8,{}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:ew.assignmentInfo,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"title",control:C.control,rules:(0,r._)({required:(0,v.__)("Assignment title is required","tutor")},(0,ep/* .maxLimitRule */.wA)(255)),render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(V/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,v.__)("Title","tutor"),placeholder:(0,v.__)("Enter Assignment Title","tutor"),generateWithAi:!_||b,isClearable:true}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"summary",control:C.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(eu/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,v.__)("Content","tutor"),placeholder:(0,v.__)("Enter Assignment Content","tutor"),generateWithAi:!_||b}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(eh/* ["default"] */.A,{section:"Curriculum.Assignment.after_description",form:C})]})}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:ew.rightPanel,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"attachments",control:C.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(j/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,v.__)("Attachments","tutor"),buttonText:(0,v.__)("Upload Attachment","tutor"),selectMultiple:true}))}),/*#__PURE__*/(0,a/* .jsxs */.FD)(y/* ["default"] */.A,{when:(0,k/* .isAddonEnabled */.GR)(O/* .Addons.CONTENT_DRIP */.oW.CONTENT_DRIP),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:c==="specific_days",children:/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"content_drip_settings.after_xdays_of_enroll",control:C.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(V/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"number",label:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:ew.contentDripLabel,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"contentDrip",height:24,width:24}),(0,v.__)("Available after days","tutor")]}),helpText:(0,v.__)("This assignment will be available after the given number of days.","tutor"),placeholder:"0",selectOnFocus:true}))})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:c==="unlock_by_date",children:/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"content_drip_settings.unlock_date",control:C.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(B/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:ew.contentDripLabel,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"contentDrip",height:24,width:24}),(0,v.__)("Unlock Date","tutor")]}),placeholder:(0,v.__)("Select Unlock Date","tutor"),helpText:(0,v.__)("This assignment will be available from the given date. Leave empty to make it available immediately.","tutor")}))})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:c==="after_finishing_prerequisites",children:/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"content_drip_settings.prerequisites",control:C.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(es,(0,i._)((0,r._)({},e),{label:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:ew.contentDripLabel,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"contentDrip",height:24,width:24}),(0,v.__)("Prerequisites","tutor")]}),placeholder:(0,v.__)("Select Prerequisite","tutor"),options:q.reduce((e,a)=>{if(String(a.id)===String(n)){e.push((0,i._)((0,r._)({},a),{contents:a.contents.filter(e=>String(e.ID)!==String(t))}))}else{e.push(a)}return e},[])||[],isSearchable:true,helpText:(0,v.__)("Select items that should be complete before this item","tutor")}))})})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:ew.timeLimit,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"time_duration.value",control:C.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(V/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"number",label:(0,v.__)("Time Limit","tutor"),placeholder:"0",dataAttribute:"data-time-limit",selectOnFocus:true}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"time_duration.time",control:C.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(G/* ["default"] */.A,(0,i._)((0,r._)({},e),{options:e_,removeOptionsMinWidth:true,dataAttribute:"data-time-limit-unit"}))})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"deadline_from_start",control:C.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)($/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,v.__)("Set Deadline From Assignment Start Time","tutor"),helpText:(0,v.__)("Each student will get their own deadline based on when they start the assignment.","tutor")}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"total_mark",control:C.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(V/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"number",label:(0,v.__)("Total Points","tutor"),placeholder:"0",selectOnFocus:true}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"pass_mark",control:C.control,rules:{validate:e=>{if(Number(e)>Number(C.getValues("total_mark"))){return(0,v.__)("Pass mark cannot be greater than total mark","tutor")}return true}},render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(V/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"number",label:(0,v.__)("Minimum Pass Points","tutor"),placeholder:"0",selectOnFocus:true}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"upload_files_limit",control:C.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(V/* ["default"] */.A,(0,i._)((0,r._)({},e),{placeholder:"0",type:"number",label:(0,v.__)("File Upload Limit","tutor"),helpText:(0,v.__)("Define the number of files that a student can upload in this assignment. Input 0 to disable the option to upload.","tutor"),selectOnFocus:true}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"upload_file_size_limit",control:C.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(Q/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"number",label:(0,v.__)("Maximum File Size Limit","tutor"),placeholder:"0",content:(0,v.__)("MB","tutor"),contentPosition:"right"}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"is_retry_allowed",control:C.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)($/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,v.__)("Allow Assignment Resubmission","tutor")}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:T,children:/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"attempts_allowed",control:C.control,rules:(0,i._)((0,r._)({},(0,ep/* .requiredRule */.WN)()),{validate:e=>{if(e>=1&&e<=20){return true}return(0,v.__)("Allowed attempts must be between 1 and 20","tutor")}}),render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(V/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"number",label:(0,v.__)("Maximum Resubmission Attempts","tutor"),helpText:(0,v.__)("Set how many times students can resubmit even after the deadline.","tutor"),selectOnFocus:true}))})}),/*#__PURE__*/(0,a/* .jsx */.Y)(eh/* ["default"] */.A,{section:"Curriculum.Assignment.bottom_of_sidebar",form:C})]})]})})})};/* export default */const ey=eb;var ew={wrapper:/*#__PURE__*/(0,h/* .css */.AH)("margin:0 auto;display:grid;grid-template-columns:1fr 338px;width:100%;height:100%;padding-inline:",_/* .spacing["32"] */.YK["32"],";",_/* .Breakpoint.smallTablet */.EA.smallTablet,"{grid-template-columns:1fr;padding-inline:",_/* .spacing["24"] */.YK["24"],";}",_/* .Breakpoint.mobile */.EA.mobile,"{padding-inline:",_/* .spacing["16"] */.YK["16"],";}"),assignmentInfo:/*#__PURE__*/(0,h/* .css */.AH)("padding-block:",_/* .spacing["24"] */.YK["24"],";padding-right:",_/* .spacing["32"] */.YK["32"],";display:flex;flex-direction:column;gap:",_/* .spacing["24"] */.YK["24"],";position:sticky;top:0;z-index:",_/* .zIndex.positive */.fE.positive,";",_/* .Breakpoint.smallTablet */.EA.smallTablet,"{position:unset;padding-right:0;}"),rightPanel:/*#__PURE__*/(0,h/* .css */.AH)("border-left:1px solid ",_/* .colorTokens.stroke.divider */.I6.stroke.divider,";display:flex;flex-direction:column;gap:",_/* .spacing["16"] */.YK["16"],";padding-block:",_/* .spacing["24"] */.YK["24"],";padding-left:",_/* .spacing["32"] */.YK["32"],";",_/* .Breakpoint.smallTablet */.EA.smallTablet,"{border-left:none;padding-left:0;}"),timeLimit:/*#__PURE__*/(0,h/* .css */.AH)("display:grid;align-items:end;grid-template-columns:1fr 100px;& input{border:1px solid ",_/* .colorTokens.stroke["default"] */.I6.stroke["default"],";&[data-time-limit]{border-radius:",_/* .borderRadius["6"] */.Vq["6"]," 0 0 ",_/* .borderRadius["6"] */.Vq["6"],";border-right:none;&:focus{border-right:1px solid ",_/* .colorTokens.stroke["default"] */.I6.stroke["default"],";z-index:",_/* .zIndex.positive */.fE.positive,";}}&[data-time-limit-unit]{border-radius:0 ",_/* .borderRadius["6"] */.Vq["6"]," ",_/* .borderRadius["6"] */.Vq["6"]," 0;}}"),uploadAttachment:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;flex-direction:column;gap:",_/* .spacing["8"] */.YK["8"],";"),uploadLabel:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.body */.I.body(),"    color:",_/* .colorTokens.text.title */.I6.text.title,";"),contentDripLabel:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;align-items:center;svg{margin-right:",_/* .spacing["4"] */.YK["4"],";color:",_/* .colorTokens.icon.success */.I6.icon.success,";}")};// EXTERNAL MODULE: ./assets/src/js/v3/shared/components/fields/FormImageInput.tsx
var ex=n(75031);// EXTERNAL MODULE: ./assets/src/js/v3/shared/components/fields/FormVideoInput.tsx + 2 modules
var eA=n(94232);// EXTERNAL MODULE: ./node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/format.js
var eY=n(1896);// EXTERNAL MODULE: ./assets/src/js/v3/shared/atoms/CheckBox.tsx
var ek=n(81253);// EXTERNAL MODULE: ./assets/src/js/v3/shared/components/modals/BasicModalWrapper.tsx
var eI=n(4429);// EXTERNAL MODULE: ./assets/src/js/v3/shared/atoms/Skeleton.tsx
var eq=n(1883);// CONCATENATED MODULE: ./assets/src/js/v3/shared/molecules/Table.tsx
function eC(){var e=(0,I._)(["\n      border: 1px solid ",";\n      border-radius: ",";\n    "]);eC=function t(){return e};return e}function eD(){var e=(0,I._)(["\n      border-bottom: 1px solid ",";\n    "]);eD=function t(){return e};return e}function eE(){var e=(0,I._)(["\n      &:nth-of-type(even) {\n        background-color: ",";\n      }\n    "]);eE=function t(){return e};return e}function eS(){var e=(0,I._)(["\n        background-color: ",";\n      "]);eS=function t(){return e};return e}function ez(){var e=(0,I._)(["\n        background-color: ",";\n      "]);ez=function t(){return e};return e}function eT(){var e=(0,I._)(["\n        :last-of-type {\n          border-bottom: none;\n        }\n      "]);eT=function t(){return e};return e}var eM={bodyRowSelected:_/* .colorTokens.background.active */.I6.background.active,bodyRowHover:_/* .colorTokens.background.hover */.I6.background.hover};var eH=e=>{var{columns:t,data:n,entireHeader:r=null,headerHeight:i=60,noHeader:o=false,isStriped:s=false,isRounded:l=false,stripedBySelectedIndex:u=[],colors:d={},isBordered:c=true,loading:p=false,itemsPerPage:v=1,querySortProperties:f,querySortDirections:g={},onSortClick:_,renderInLastRow:b,rowStyle:y,sortIcons:w={asc:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"sortASC",height:16,width:16}),desc:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"sortDESC",height:16,width:16})}}=e;var A=(e,n)=>{return/*#__PURE__*/(0,a/* .jsx */.Y)("tr",{css:[eO.tableRow({isBordered:c,isStriped:s}),eO.bodyTr({colors:d,isSelected:u.includes(e),isRounded:l}),y],children:t.map((e,t)=>{return/*#__PURE__*/(0,a/* .jsx */.Y)("td",{css:[eO.td,{width:e.width}],children:n(e)},t)})},e)};var Y=e=>{var t=null;var n=e.sortProperty;if(!n){return e.Header}if(f===null||f===void 0?void 0:f.includes(n)){if((g===null||g===void 0?void 0:g[n])==="asc"){t=w.asc}else{t=w.desc}}return/*#__PURE__*/(0,a/* .jsxs */.FD)("button",{type:"button",css:eO.headerWithIcon,onClick:()=>_===null||_===void 0?void 0:_(n),children:[e.Header,t&&t]})};var I=()=>{if(r){return/*#__PURE__*/(0,a/* .jsx */.Y)("th",{css:eO.th,colSpan:t.length,children:r})}return t.map((e,t)=>{if(e.Header!==null){return/*#__PURE__*/(0,a/* .jsx */.Y)("th",{css:[eO.th,e.css,{width:e.width}],colSpan:e.headerColSpan,children:Y(e)},t)}})};var q=()=>{if(p){return(0,k/* .range */.y1)(v).map(e=>A(e,()=>/*#__PURE__*/(0,a/* .jsx */.Y)(eq/* ["default"] */.A,{animation:true,height:20,width:"".concat((0,k/* .getRandom */.G0)(40,80),"%")})))}if(!n.length){return/*#__PURE__*/(0,a/* .jsx */.Y)("tr",{css:eO.tableRow({isBordered:false,isStriped:false}),children:/*#__PURE__*/(0,a/* .jsx */.Y)("td",{colSpan:t.length,css:[eO.td,/*#__PURE__*/(0,h/* .css */.AH)("text-align:center;")],children:"No Data!"})})}var e=n.map((e,t)=>{return A(t,n=>{return"Cell"in n?n.Cell(e,t):n.accessor(e,t)})});if(b){b=/*#__PURE__*/(0,a/* .jsx */.Y)("tr",{children:/*#__PURE__*/(0,a/* .jsx */.Y)("td",{css:eO.td,children:b})},e.length);e.push(b)}return e};return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:eO.tableContainer({isRounded:l}),children:/*#__PURE__*/(0,a/* .jsxs */.FD)("table",{css:eO.table,children:[!o&&/*#__PURE__*/(0,a/* .jsx */.Y)("thead",{children:/*#__PURE__*/(0,a/* .jsx */.Y)("tr",{css:[eO.tableRow({isBordered:c,isStriped:s}),{height:i}],children:I()})}),/*#__PURE__*/(0,a/* .jsx */.Y)("tbody",{children:q()})]})})};/* export default */const eP=eH;var eO={tableContainer:e=>{var{isRounded:t}=e;return/*#__PURE__*/(0,h/* .css */.AH)("display:block;width:100%;overflow-x:auto;",t&&(0,h/* .css */.AH)(eC(),_/* .colorTokens.stroke.divider */.I6.stroke.divider,_/* .borderRadius["6"] */.Vq["6"]))},headerWithIcon:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.resetButton */.x.resetButton,";",F/* .typography.body */.I.body(),";color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";display:flex;gap:",_/* .spacing["8"] */.YK["8"],";align-items:center;svg{color:",_/* .colorTokens.text.primary */.I6.text.primary,";}"),table:/*#__PURE__*/(0,h/* .css */.AH)("width:100%;border-collapse:collapse;border:none;"),tableRow:e=>{var{isBordered:t,isStriped:n}=e;return/*#__PURE__*/(0,h/* .css */.AH)(t&&(0,h/* .css */.AH)(eD(),_/* .colorTokens.stroke.divider */.I6.stroke.divider)," ",n&&(0,h/* .css */.AH)(eE(),_/* .colorTokens.background.active */.I6.background.active))},th:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.body */.I.body(),";background-color:",_/* .colorTokens.background.white */.I6.background.white,";color:",_/* .colorTokens.text.primary */.I6.text.primary,";padding:0 ",_/* .spacing["16"] */.YK["16"],";border:none;"),bodyTr:e=>{var{colors:t,isSelected:n,isRounded:r}=e;var{bodyRowDefault:i,bodyRowSelectedHover:a,bodyRowHover:o=eM.bodyRowHover,bodyRowSelected:s=eM.bodyRowSelected}=t;return/*#__PURE__*/(0,h/* .css */.AH)(i&&(0,h/* .css */.AH)(eS(),i),"      &:hover{background-color:",n&&a?a:o,";}",n&&(0,h/* .css */.AH)(ez(),s)," ",r&&(0,h/* .css */.AH)(eT()))},td:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.body */.I.body(),";padding:",_/* .spacing["16"] */.YK["16"],";border:none;")};// EXTERNAL MODULE: ./node_modules/.pnpm/@tanstack+react-query@5.62.15_react@18.3.1/node_modules/@tanstack/react-query/build/modern/useQuery.js
var eF=n(37586);// EXTERNAL MODULE: ./assets/src/js/v3/shared/utils/api.ts
var eN=n(77239);// EXTERNAL MODULE: ./assets/core/ts/utils/endpoints.ts
var eK=n(94812);// CONCATENATED MODULE: ./assets/src/js/v3/shared/services/h5p.ts
var eW=e=>{return eN/* .wpAjaxInstance.post */.b.post(eK/* ["default"].GET_H5P_LESSON_CONTENT */.A.GET_H5P_LESSON_CONTENT,{search_filter:e})};var eR=(e,t)=>{return(0,eF/* .useQuery */.I)({queryKey:["H5PLessonContents",e],queryFn:()=>eW(e).then(e=>e.data),enabled:t==="lesson"})};var eL=e=>{return eN/* .wpAjaxInstance.post */.b.post(eK/* ["default"].GET_H5P_QUIZ_CONTENT */.A.GET_H5P_QUIZ_CONTENT,{search_filter:e})};var eU=(e,t)=>{return(0,eF/* .useQuery */.I)({queryKey:["H5PQuizContents",e],queryFn:()=>eL(e).then(e=>e.data),enabled:t==="tutor_h5p_quiz"})};// CONCATENATED MODULE: ./assets/src/js/v3/shared/components/modals/H5PContentListModal.tsx
var eB=e=>{var{title:t,closeModal:n,onAddContent:s,contentType:l,addedContentIds:u=[]}=e;var d=(0,ec/* .useFormWithGlobalError */.p)({defaultValues:{search:""}});var c=(0,Z/* .useDebounce */.d)(d.watch("search"),300);var p=eU(c,l);var h=eR(c,l);var[g,_]=(0,o.useState)([]);var b=l==="tutor_h5p_quiz"?p.data:h.data;var w=b===null||b===void 0?void 0:b.output.filter(e=>!u.includes(String(e.id)));var A=[{Header:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{"data-index":true,css:eV.tableLabel,children:(w===null||w===void 0?void 0:w.length)?/*#__PURE__*/(0,a/* .jsx */.Y)(ek/* ["default"] */.A,{onChange:e=>{if(e){_((w===null||w===void 0?void 0:w.filter(e=>!u.includes(String(e.id))))||[])}else{_([])}},checked:g.length===((w===null||w===void 0?void 0:w.filter(e=>!u.includes(String(e.id))))||[]).length,isIndeterminate:g.length>0&&g.length<((w===null||w===void 0?void 0:w.filter(e=>!u.includes(String(e.id))))||[]).length}):"#"}),Cell:e=>{return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:F/* .typography.caption */.I.caption(),children:/*#__PURE__*/(0,a/* .jsx */.Y)(ek/* ["default"] */.A,{onChange:t=>{if(t){_([...g,e])}else{_(g.filter(t=>t.id!==e.id))}},checked:g.map(e=>e.id).includes(e.id)&&!u.includes(String(e.id))})})}},{Header:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:eV.tableLabel,children:(0,v.__)("Title","tutor")}),Cell:e=>{return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:eV.title,children:e.title})}},{Header:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:eV.tableLabel,children:(0,v.__)("Content Type","tutor")}),Cell:e=>{return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:F/* .typography.caption */.I.caption(),children:e.content_type})}},{Header:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:eV.tableLabel,children:(0,v.__)("Created At","tutor")}),Cell:e=>{return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:F/* .typography.caption */.I.caption(),children:(0,eY/* .format */.GP)(new Date(e.updated_at),O/* .DateFormats.yearMonthDayHourMinuteSecond */.UA.yearMonthDayHourMinuteSecond)})}}];return/*#__PURE__*/(0,a/* .jsxs */.FD)(eI/* ["default"] */.A,{title:/* translators: %s is the number of selected items */g.length>0?(0,v.sprintf)((0,v.__)("%s selected","tutor"),g.length):t,onClose:()=>n({action:"CLOSE"}),maxWidth:920,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:eV.searchWrapper,children:/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:d.control,name:"search",render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(Q/* ["default"] */.A,(0,i._)((0,r._)({},e),{placeholder:(0,v.__)("Search by title","tutor"),showVerticalBar:false,content:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"search",width:24,height:24})}))})}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:eV.tableWrapper,children:/*#__PURE__*/(0,a/* .jsx */.Y)(eP,{columns:A,data:w||[],loading:p.isLoading||h.isLoading})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:w===null||w===void 0?void 0:w.length,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:eV.footer,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{size:"small",variant:"text",onClick:()=>n({action:"CLOSE"}),children:(0,v.__)("Cancel","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{type:"submit",size:"small",variant:"primary",onClick:()=>{s(g);n({action:"CONFIRM"})},disabled:!g.length,children:(0,v.__)("Add","tutor")})]})})]})};/* export default */const ej=eB;var eV={searchWrapper:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;padding:",_/* .spacing["20"] */.YK["20"],";"),tableWrapper:/*#__PURE__*/(0,h/* .css */.AH)("max-height:calc(100vh - 350px);overflow:auto;tr{td:first-of-type{padding-left:",_/* .spacing["20"] */.YK["20"],";}td:last-of-type{padding-right:",_/* .spacing["20"] */.YK["20"],";}}"),tableLabel:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.body */.I.body("medium"),";text-align:left;color:",_/* .colorTokens.text.primary */.I6.text.primary,";&[data-index]{padding-left:",_/* .spacing["4"] */.YK["4"],";}"),title:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.text.ellipsis */.x.text.ellipsis(2),"    width:100%;text-align:left;",F/* .typography.caption */.I.caption(),";min-width:340px;max-width:400px;"),footer:/*#__PURE__*/(0,h/* .css */.AH)("box-shadow:",_/* .shadow.dividerTop */.r7.dividerTop,";height:56px;display:flex;align-items:center;justify-content:end;gap:",_/* .spacing["16"] */.YK["16"],";padding-inline:",_/* .spacing["16"] */.YK["16"],";")};// EXTERNAL MODULE: ./assets/src/js/v3/shared/hooks/useVisibilityControl.tsx
var eQ=n(78988);// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/modals/LessonModal.tsx
var eG=(0,eg/* .getCourseId */.p)();var e$=e=>{var{lessonId:t="",topicId:n,closeModal:s,icon:l,title:u,subtitle:d,contentDripType:c}=e;var p,h,_,b;var w=!!P/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var A=((p=P/* .tutorConfig.settings */.P.settings)===null||p===void 0?void 0:p.chatgpt_enable)==="on";var Y=P/* .tutorConfig.enable_lesson_classic_editor */.P.enable_lesson_classic_editor==="1";var I=((h=P/* .tutorConfig.settings */.P.settings)===null||h===void 0?void 0:h.hide_admin_bar_for_users)==="off";var q=(_=P/* .tutorConfig.current_user.roles */.P.current_user.roles)===null||_===void 0?void 0:_.includes(O/* .TutorRoles.ADMINISTRATOR */.gt.ADMINISTRATOR);var C=(b=P/* .tutorConfig.current_user.roles */.P.current_user.roles)===null||b===void 0?void 0:b.includes(O/* .TutorRoles.TUTOR_INSTRUCTOR */.gt.TUTOR_INSTRUCTOR);var D=Y&&(q||C&&I);var F=(0,ef/* .useLessonDetailsQuery */.Cx)(t,n);var N=(0,ef/* .useSaveLessonMutation */.K3)(eG);var K=(0,z/* .useQueryClient */.jE)();var{showModal:W}=(0,H/* .useModal */.h)();var{data:R,isLoading:L}=F;var U=K.getQueryData(["Topic",eG]);var{fields:G}=(0,ev/* .useCourseBuilderSlot */._)();var X=(0,eQ/* ["default"] */.A)(O/* .VisibilityControlKeys.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO_PLAYBACK_TIME */.qP.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO_PLAYBACK_TIME);var Z=(0,eQ/* ["default"] */.A)(O/* .VisibilityControlKeys.COURSE_BUILDER.CURRICULUM.LESSON.LESSON_PREVIEW */.qP.COURSE_BUILDER.CURRICULUM.LESSON.LESSON_PREVIEW);var J=(0,eQ/* ["default"] */.A)(O/* .VisibilityControlKeys.COURSE_BUILDER.CURRICULUM.LESSON.FEATURED_IMAGE */.qP.COURSE_BUILDER.CURRICULUM.LESSON.FEATURED_IMAGE);var ee=(0,eQ/* ["default"] */.A)(O/* .VisibilityControlKeys.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO */.qP.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO);var et=(0,eQ/* ["default"] */.A)(O/* .VisibilityControlKeys.COURSE_BUILDER.CURRICULUM.LESSON.EXERCISE_FILES */.qP.COURSE_BUILDER.CURRICULUM.LESSON.EXERCISE_FILES);var en=(0,ec/* .useFormWithGlobalError */.p)({defaultValues:{title:"",description:"",thumbnail:null,tutor_attachments:[],lesson_preview:false,video:null,duration:{hour:0,minute:0,second:0},content_drip_settings:{unlock_date:"",after_xdays_of_enroll:"",prerequisites:[]}},shouldFocusError:true,mode:"onChange"});var er=en.formState.dirtyFields&&Object.keys(en.formState.dirtyFields).length>0;var ei=Boolean(c!==""||X||J||ee||et||(0,k/* .isAddonEnabled */.GR)(O/* .Addons.TUTOR_COURSE_PREVIEW */.oW.TUTOR_COURSE_PREVIEW)&&Z);(0,o.useEffect)(()=>{if(R&&!L){var e,t,n,i,a,o;en.reset((0,r._)({title:R.post_title||"",description:(0,k/* .normalizeLineEndings */.EW)(R.post_content)||"",thumbnail:{id:R.thumbnail_id?Number(R.thumbnail_id):0,title:"",url:R.thumbnail||""},tutor_attachments:R.attachments||[],lesson_preview:R.is_preview||false,video:R.video||null,duration:{hour:((e=R.video.runtime)===null||e===void 0?void 0:e.hours)||0,minute:((t=R.video.runtime)===null||t===void 0?void 0:t.minutes)||0,second:((n=R.video.runtime)===null||n===void 0?void 0:n.seconds)||0},content_drip_settings:{unlock_date:(R===null||R===void 0?void 0:(i=R.content_drip_settings)===null||i===void 0?void 0:i.unlock_date)||"",after_xdays_of_enroll:(R===null||R===void 0?void 0:(a=R.content_drip_settings)===null||a===void 0?void 0:a.after_xdays_of_enroll)||"",prerequisites:(R===null||R===void 0?void 0:(o=R.content_drip_settings)===null||o===void 0?void 0:o.prerequisites)||[]}},Object.fromEntries((0,k/* .findSlotFields */.DE)({fields:G.Curriculum.Lesson}).map(e=>[e,R[e]]))))}var s=document.querySelector(".button.insert-media.add_media");var l=document.querySelector(".add-h5p-content-button");if(s&&l){s.after(l)}var u=setTimeout(()=>{en.setFocus("title")},0);return()=>{clearTimeout(u)};// eslint-disable-next-line react-hooks/exhaustive-deps
},[R,L]);var ea=e=>(0,E._)(function*(){var r=(0,ef/* .convertLessonDataToPayload */.R6)(e,t,n,c,(0,k/* .findSlotFields */.DE)({fields:G.Curriculum.Lesson}));var i=yield N.mutateAsync(r);if(i.data){s({action:"CONFIRM"})}})();var eo=()=>{var e=en.getValues("description");var t=e.match(/\[h5p id="(\d+)"\]/g)||[];var n=t.map(e=>{var t;var n=((t=e.match(/\[h5p id="(\d+)"\]/))===null||t===void 0?void 0:t[1])||"";return String(n)});var r=t=>{var n=e=>{return'[h5p id="'.concat(e.id,'"]')};var r=t.map(n);en.setValue("description","".concat(e,"\n").concat(r.join("\n")),{shouldDirty:true})};W({component:ej,props:{title:(0,v.__)("Select H5P Content","tutor"),onAddContent:r,contentType:"lesson",addedContentIds:n}})};return/*#__PURE__*/(0,a/* .jsx */.Y)(ed/* ["default"] */.A,{onClose:()=>s({action:"CLOSE"}),icon:er?/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"warning",width:24,height:24}):l,title:er?O/* .CURRENT_VIEWPORT.isAboveDesktop */.vN.isAboveDesktop?(0,v.__)("Unsaved Changes","tutor"):"":u,subtitle:O/* .CURRENT_VIEWPORT.isAboveSmallMobile */.vN.isAboveSmallMobile?d:"",maxWidth:1070,actions:er&&/*#__PURE__*/(0,a/* .jsxs */.FD)(a/* .Fragment */.FK,{children:[/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",size:"small",onClick:()=>{if(t){en.reset()}else{s({action:"CLOSE"})}},children:t?(0,v.__)("Discard Changes","tutor"):(0,v.__)("Cancel","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{"data-cy":"save-lesson",loading:N.isPending,variant:"primary",size:"small",onClick:en.handleSubmit(ea),children:t?(0,v.__)("Update","tutor"):(0,v.__)("Save","tutor")})]}),children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:eZ.wrapper({hasRightSidebar:ei}),children:/*#__PURE__*/(0,a/* .jsxs */.FD)(y/* ["default"] */.A,{when:!F.isLoading,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(g/* .LoadingOverlay */.p8,{}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:eZ.lessonInfo({hasRightSidebar:ei}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"title",control:en.control,rules:(0,r._)({required:(0,v.__)("Lesson title is required.","tutor")},(0,ep/* .maxLimitRule */.wA)(255)),render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(V/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,v.__)("Name","tutor"),placeholder:(0,v.__)("Enter Lesson Name","tutor"),generateWithAi:!w||A,isClearable:true}))}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:eZ.description,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"description",control:en.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(eu/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:eZ.descriptionLabel,children:[(0,v.__)("Content","tutor"),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:D,children:/*#__PURE__*/(0,a/* .jsx */.Y)(M/* ["default"] */.A,{content:(0,v.__)("Save the lesson first to use the WP Editor.","tutor"),delay:200,disabled:!!t,children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",size:"small",onClick:()=>{window.open("".concat(P/* .tutorConfig.site_url */.P.site_url,"/wp-admin/post.php?post=").concat(t,"&action=edit"),"_blank","noopener")},icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"edit",width:24,height:24}),buttonCss:eZ.wpEditorButton,disabled:!t,children:(0,v.__)("WP Editor","tutor")})})})]}),placeholder:(0,v.__)("Enter Lesson Description","tutor"),generateWithAi:!w||A}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:w&&(0,k/* .isAddonEnabled */.GR)(O/* .Addons.H5P_INTEGRATION */.oW.H5P_INTEGRATION),fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!w,children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{css:eZ.addH5PContentButton({isPro:false}),type:"reset",className:"add-h5p-content-button",disabled:true,children:/*#__PURE__*/(0,a/* .jsx */.Y)(T/* ["default"] */.A,{children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{"data-button-text":true,children:(0,v.__)("Add H5P Content","tutor")})})})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{className:"add-h5p-content-button",css:eZ.addH5PContentButton,type:"button",onClick:eo,children:(0,v.__)("Add H5P Content","tutor")})})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(eh/* ["default"] */.A,{section:"Curriculum.Lesson.after_description",form:en})]})}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:eZ.rightPanel,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"thumbnail",control:en.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(ex/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,v.__)("Featured Image","tutor"),buttonText:(0,v.__)("Upload Image","tutor"),infoText:/* translators: %s is the maximum allowed upload file size (e.g., "2MB") */(0,v.sprintf)((0,v.__)("JPEG, PNG, GIF, and WebP formats, up to %s","tutor"),(0,k/* .formatBytes */.z3)(Number((P/* .tutorConfig */.P===null||P/* .tutorConfig */.P===void 0?void 0:P/* .tutorConfig.max_upload_size */.P.max_upload_size)||0))),visibilityKey:O/* .VisibilityControlKeys.COURSE_BUILDER.CURRICULUM.LESSON.FEATURED_IMAGE */.qP.COURSE_BUILDER.CURRICULUM.LESSON.FEATURED_IMAGE}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"video",control:en.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(eA/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,v.__)("Video","tutor"),buttonText:(0,v.__)("Upload Video","tutor"),infoText:(0,v.sprintf)((0,v.__)("MP4, and WebM formats, up to %s","tutor"),(0,k/* .formatBytes */.z3)(Number((P/* .tutorConfig */.P===null||P/* .tutorConfig */.P===void 0?void 0:P/* .tutorConfig.max_upload_size */.P.max_upload_size)||0))),onGetDuration:e=>{en.setValue("duration.hour",e.hours);en.setValue("duration.minute",e.minutes);en.setValue("duration.second",e.seconds)},visibilityKey:O/* .VisibilityControlKeys.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO */.qP.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:X,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:eZ.durationWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:eZ.additionLabel,children:(0,v.__)("Video Playback Time","tutor")}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:eZ.duration,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"duration.hour",control:en.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(Q/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"number",content:/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:eZ.durationContent,children:(0,v.__)("hour","tutor")}),contentPosition:"right",placeholder:"0",showVerticalBar:false,visibilityKey:O/* .VisibilityControlKeys.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO_PLAYBACK_TIME */.qP.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO_PLAYBACK_TIME}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"duration.minute",control:en.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(Q/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"number",content:/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:eZ.durationContent,children:(0,v.__)("min","tutor")}),contentPosition:"right",placeholder:"0",showVerticalBar:false,visibilityKey:O/* .VisibilityControlKeys.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO_PLAYBACK_TIME */.qP.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO_PLAYBACK_TIME}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"duration.second",control:en.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(Q/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"number",content:/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:eZ.durationContent,children:(0,v.__)("sec","tutor")}),contentPosition:"right",placeholder:"0",showVerticalBar:false,visibilityKey:O/* .VisibilityControlKeys.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO_PLAYBACK_TIME */.qP.COURSE_BUILDER.CURRICULUM.LESSON.VIDEO_PLAYBACK_TIME}))})]})]})}),/*#__PURE__*/(0,a/* .jsxs */.FD)(y/* ["default"] */.A,{when:(0,k/* .isAddonEnabled */.GR)(O/* .Addons.CONTENT_DRIP */.oW.CONTENT_DRIP),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:c==="specific_days",children:/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"content_drip_settings.after_xdays_of_enroll",control:en.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(V/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"number",label:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:eZ.contentDripLabel,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"contentDrip",height:24,width:24}),(0,v.__)("Available after days","tutor")]}),helpText:(0,v.__)("This lesson will be available after the given number of days.","tutor"),placeholder:"0",selectOnFocus:true}))})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:c==="unlock_by_date",children:/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"content_drip_settings.unlock_date",control:en.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(B/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:eZ.contentDripLabel,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"contentDrip",height:24,width:24}),(0,v.__)("Unlock Date","tutor")]}),placeholder:(0,v.__)("Select Unlock Date","tutor"),helpText:(0,v.__)("This lesson will be available from the given date. Leave empty to make it available immediately.","tutor")}))})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:c==="after_finishing_prerequisites",children:/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"content_drip_settings.prerequisites",control:en.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(es,(0,i._)((0,r._)({},e),{label:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:eZ.contentDripLabel,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"contentDrip",height:24,width:24}),(0,v.__)("Prerequisites","tutor")]}),placeholder:(0,v.__)("Select Prerequisite","tutor"),options:U.reduce((e,a)=>{if(String(a.id)===String(n)){e.push((0,i._)((0,r._)({},a),{contents:a.contents.filter(e=>String(e.ID)!==String(t))}))}else{e.push(a)}return e},[])||[],isSearchable:true,helpText:(0,v.__)("Select items that should be complete before this item","tutor")}))})})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"tutor_attachments",control:en.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(j/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,v.__)("Exercise Files","tutor"),buttonText:(0,v.__)("Upload Attachment","tutor"),selectMultiple:true,visibilityKey:O/* .VisibilityControlKeys.COURSE_BUILDER.CURRICULUM.LESSON.EXERCISE_FILES */.qP.COURSE_BUILDER.CURRICULUM.LESSON.EXERCISE_FILES}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!w||Z&&(0,k/* .isAddonEnabled */.GR)(O/* .Addons.TUTOR_COURSE_PREVIEW */.oW.TUTOR_COURSE_PREVIEW),children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:eZ.lessonPreview,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"lesson_preview",control:en.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)($/* ["default"] */.A,(0,i._)((0,r._)({},e),{disabled:!w,label:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:eZ.previewLabel,children:[(0,v.__)("Lesson Preview","tutor"),!w&&/*#__PURE__*/(0,a/* .jsx */.Y)(T/* ["default"] */.A,{size:"small",content:(0,v.__)("Pro","tutor")})]}),helpText:(0,v.__)("If checked, any user/guest can view this lesson without enrolling in the course.","tutor"),visibilityKey:O/* .VisibilityControlKeys.COURSE_BUILDER.CURRICULUM.LESSON.LESSON_PREVIEW */.qP.COURSE_BUILDER.CURRICULUM.LESSON.LESSON_PREVIEW}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:en.watch("lesson_preview"),children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:eZ.previewInfo,children:(0,v.__)("This lesson is now available for preview. Users and guests can view it without enrolling in the course.","tutor")})})]})}),/*#__PURE__*/(0,a/* .jsx */.Y)(eh/* ["default"] */.A,{section:"Curriculum.Lesson.bottom_of_sidebar",form:en})]})]})})})};/* export default */const eX=e$;var eZ={wrapper:e=>{var{hasRightSidebar:t=true}=e;return/*#__PURE__*/(0,h/* .css */.AH)("margin:0 auto;display:grid;grid-template-columns:",t?"1fr 338px":"1fr",";height:100%;width:100%;padding-inline:",_/* .spacing["32"] */.YK["32"],";",_/* .Breakpoint.smallTablet */.EA.smallTablet,"{grid-template-columns:1fr;padding-inline:",_/* .spacing["24"] */.YK["24"],";}",_/* .Breakpoint.mobile */.EA.mobile,"{padding-inline:",_/* .spacing["16"] */.YK["16"],";}")},lessonInfo:e=>{var{hasRightSidebar:t=true}=e;return/*#__PURE__*/(0,h/* .css */.AH)("padding-block:",_/* .spacing["20"] */.YK["20"],";padding-right:",t&&_/* .spacing["32"] */.YK["32"],";display:flex;flex-direction:column;gap:",_/* .spacing["24"] */.YK["24"],";position:sticky;top:0;z-index:",_/* .zIndex.positive */.fE.positive,";",_/* .Breakpoint.smallTablet */.EA.smallTablet,"{position:unset;padding-right:0;}")},description:/*#__PURE__*/(0,h/* .css */.AH)("position:relative;"),descriptionLabel:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;align-items:center;justify-content:space-between;height:32px;"),addH5PContentButton:e=>{var{isPro:t=true}=e;return/*#__PURE__*/(0,h/* .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]{",Y/* .styleUtils.flexCenter */.x.flexCenter(),";padding:0 10px;}:hover:not(:disabled){background:",_/* .colorTokens.background.white */.I6.background.white,";color:#3e64de;}:disabled{cursor:not-allowed;position:relative;top:auto;left:auto;opacity:0.5;}")},rightPanel:/*#__PURE__*/(0,h/* .css */.AH)("border-left:1px solid ",_/* .colorTokens.stroke.divider */.I6.stroke.divider,";display:flex;flex-direction:column;gap:",_/* .spacing["16"] */.YK["16"],";padding-block:",_/* .spacing["20"] */.YK["20"],";padding-left:",_/* .spacing["32"] */.YK["32"],";",_/* .Breakpoint.smallTablet */.EA.smallTablet,"{border-left:none;padding-left:0;}"),durationWrapper:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;flex-direction:column;gap:",_/* .spacing["8"] */.YK["8"],";"),duration:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;align-items:flex-end;gap:",_/* .spacing["8"] */.YK["8"],";"),durationContent:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.small */.I.small(),";color:",_/* .colorTokens.text.hints */.I6.text.hints,";"),additionLabel:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.body */.I.body(),"    color:",_/* .colorTokens.text.title */.I6.text.title,";"),lessonPreview:/*#__PURE__*/(0,h/* .css */.AH)("background-color:",_/* .colorTokens.background.white */.I6.background.white,";padding:",_/* .spacing["12"] */.YK["12"],";border:1px solid ",_/* .colorTokens.stroke["default"] */.I6.stroke["default"],";border-radius:",_/* .borderRadius["8"] */.Vq["8"],";"),previewLabel:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;align-items:center;gap:",_/* .spacing["4"] */.YK["4"],";"),contentDripLabel:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;align-items:center;svg{margin-right:",_/* .spacing["4"] */.YK["4"],";color:",_/* .colorTokens.icon.success */.I6.icon.success,";}"),previewInfo:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.small */.I.small(),";text-align:center;color:",_/* .colorTokens.text.title */.I6.text.title,";padding:",_/* .spacing["8"] */.YK["8"]," ",_/* .spacing["24"] */.YK["24"],";background:",_/* .colorTokens.background.status.success */.I6.background.status.success,";border-radius:",_/* .borderRadius["4"] */.Vq["4"],";margin-top:",_/* .spacing["12"] */.YK["12"],";"),wpEditorButton:/*#__PURE__*/(0,h/* .css */.AH)("margin-left:",_/* .spacing["4"] */.YK["4"],";color:",_/* .colorTokens.text.brand */.I6.text.brand,";svg{color:",_/* .colorTokens.icon.brand */.I6.icon.brand,";}&:hover:not(:disabled){text-decoration:underline;}")};// EXTERNAL MODULE: ./assets/src/js/v3/shared/atoms/Toast.tsx
var eJ=n(40925);// EXTERNAL MODULE: ./assets/src/js/v3/shared/components/fields/FormTextareaInput.tsx
var e0=n(74054);// CONCATENATED MODULE: ./assets/src/js/v3/shared/components/fields/quiz/FormQuestionTitle.tsx
function e1(){var e=(0,I._)(["\n      min-height: 40px;\n      padding-inline: "," ",";\n      border-radius: ",";\n    "]);e1=function t(){return e};return e}function e2(){var e=(0,I._)(["\n      &:hover {\n        background-color: ",";\n        color: ",";\n\n        [data-action-buttons] {\n          opacity: ",";\n        }\n      }\n    "]);e2=function t(){return e};return e}function e4(){var e=(0,I._)(["\n      display: block;\n      background-color: ",";\n      color: ",";\n      padding: 0;\n      cursor: default;\n    "]);e4=function t(){return e};return e}function e6(){var e=(0,I._)(["\n        ","\n      "]);e6=function t(){return e};return e}function e5(){var e=(0,I._)(["\n      ","\n      padding: "," ",";\n      border-radius: ",";\n    "]);e5=function t(){return e};return e}function e3(){var e=(0,I._)(["\n      opacity: 1;\n    "]);e3=function t(){return e};return e}var e8=e=>{var{maxLimit:t,maxHeight:n,field:s,fieldState:l,disabled:u,readOnly:d,loading:c,placeholder:p,helpText:h,onChange:g,onKeyDown:_,isHidden:b,isSecondary:w=false,removeBorder:A,dataAttribute:Y,isInlineLabel:k=false,style:I,wrapperCss:q,selectOnFocus:C=false,size:E="regular",isEdit:S,onToggleEdit:z}=e;var T;var M=(T=s.value)!==null&&T!==void 0?T:"";var H=(0,o.useRef)(null);var P=(0,D/* .isDefined */.O9)(S);var[O,F]=(0,o.useState)(!M?true:false);var N=P?S:O;var[K,W]=(0,o.useState)(M);var R=undefined;if(t){R={maxLimit:t,inputCharacter:M.toString().length}}var L=(0,r._)({},(0,D/* .isDefined */.O9)(Y)&&{[Y]:true});(0,o.useEffect)(()=>{if(N&&H.current){H.current.focus();W(M)}V();// eslint-disable-next-line react-hooks/exhaustive-deps
},[N]);var U=e=>{if(!P){F(e)}z===null||z===void 0?void 0:z(e)};var B=()=>{U(false)};var j=()=>{s.onChange(K);U(false)};var V=()=>{if(H.current){var e=H.current;var t=e.offsetHeight;var r=e.scrollHeight;if(r>t){if(n&&r>n){e.style.height="".concat(n,"px");e.style.overflowY="auto"}else{e.style.height="".concat(r,"px");e.style.overflowY="hidden"}}}};return/*#__PURE__*/(0,a/* .jsx */.Y)(et/* ["default"] */.A,{field:s,fieldState:l,disabled:u,readOnly:d,loading:c,helpText:h,isHidden:b,characterCount:R,isSecondary:w,removeBorder:A,isInlineLabel:k,inputStyle:I,children:e=>{return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{role:"button",css:[e7.container({isEdit:N,isDisabled:u||false,size:E}),q],"aria-label":(0,v.__)("Question title field","tutor"),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!N,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{"data-placeholder":true,css:e7.placeholder({size:E}),onClick:()=>!u&&U(true),onKeyDown:e=>{if(e.key==="Enter"||e.key===" "){U(true)}},children:s.value||p})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:N,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:e7.inputContainer({hasValueChanged:!!K&&s.value!==K,size:E}),children:/*#__PURE__*/(0,a/* .jsx */.Y)("textarea",(0,i._)((0,r._)({},s,e,L),{className:"tutor-input-field",rows:2,ref:e=>{s.ref(e);// @ts-ignore
H.current=e;// this is not ideal but it is the only way to set ref to the input element
},value:M,placeholder:p,onChange:e=>{var{value:t}=e.target;s.onChange(t);if(g){g(t)}},onKeyDown:e=>{if(e.key==="Enter"&&(e.ctrlKey||e.metaKey)){e.preventDefault();B()}else if(e.key==="Escape"){e.preventDefault();j()}_===null||_===void 0?void 0:_(e.key)},onInput:V,onPaste:V,onFocus:e=>{if(C){e.target.select()}},autoComplete:"off"}))})}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{"data-action-buttons":true,css:e7.actionButtonWrapper({isEdit:N}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:N,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{buttonCss:e7.actionButton,variant:"text",size:"small",onClick:()=>U(true),"aria-label":(0,v.__)("Edit question title","tutor"),"data-question-title-edit-button":true,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"edit",height:24,width:24})}),children:/*#__PURE__*/(0,a/* .jsxs */.FD)(a/* .Fragment */.FK,{children:[/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:s.value!==K&&s.value,children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{buttonCss:e7.actionButton,variant:"text",size:"small",onClick:B,disabled:s.value===K,"aria-label":(0,v.__)("Save question title","tutor"),children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"checkMark",height:24,width:24})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!!M&&K,children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{buttonCss:e7.actionButton,variant:"text",size:"small",onClick:j,"aria-label":(0,v.__)("Cancel question title","tutor"),children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"lineCross",height:24,width:24})})})]})})})]})}})};/* export default */const e9=e8;var e7={container:e=>{var{isEdit:t,isDisabled:n,size:r}=e;return/*#__PURE__*/(0,h/* .css */.AH)("display:grid;align-items:center;gap:",_/* .spacing["8"] */.YK["8"],";grid-template-columns:1fr auto;min-height:50px;padding-inline:",_/* .spacing["8"] */.YK["8"]," ",_/* .spacing["16"] */.YK["16"],";padding-block:",_/* .spacing["8"] */.YK["8"],";border-radius:",_/* .borderRadius["6"] */.Vq["6"],";",r==="small"&&(0,h/* .css */.AH)(e1(),_/* .spacing["4"] */.YK["4"],_/* .spacing["8"] */.YK["8"],_/* .borderRadius["4"] */.Vq["4"])," ",!n&&(0,h/* .css */.AH)(e2(),_/* .colorTokens.background.white */.I6.background.white,_/* .colorTokens.text.subdued */.I6.text.subdued,!n?1:0)," ",t&&(0,h/* .css */.AH)(e4(),_/* .colorTokens.background.white */.I6.background.white,_/* .colorTokens.text.subdued */.I6.text.subdued)," ",_/* .Breakpoint.smallTablet */.EA.smallTablet,"{[data-action-buttons]{opacity:1;}}")},inputContainer:e=>{var{hasValueChanged:t,size:n}=e;return/*#__PURE__*/(0,h/* .css */.AH)("position:relative;display:flex;transition:background 0.15s ease-in-out;& textarea{",F/* .typography.heading6 */.I.heading6(),"      color:",_/* .colorTokens.text.primary */.I6.text.primary,";border:none;background:none;padding:0;width:100%;padding:",_/* .spacing["8"] */.YK["8"]," ",_/* .spacing["16"] */.YK["16"],";background-color:",_/* .colorTokens.background.white */.I6.background.white,";&.tutor-input-field{padding-right:",t?_/* .spacing["64"] */.YK["64"]:_/* .spacing["32"] */.YK["32"],";}",n==="small"&&(0,h/* .css */.AH)(e6(),F/* .typography.caption */.I.caption()),"}")},placeholder:e=>{var{size:t}=e;return/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.heading6 */.I.heading6(),"    color:",_/* .colorTokens.text.hints */.I6.text.hints,";border-radius:",_/* .borderRadius["6"] */.Vq["6"],";",t==="small"&&(0,h/* .css */.AH)(e5(),F/* .typography.caption */.I.caption(),_/* .spacing["4"] */.YK["4"],_/* .spacing["8"] */.YK["8"],_/* .borderRadius["4"] */.Vq["4"]))},actionButtonWrapper:e=>{var{isEdit:t}=e;return/*#__PURE__*/(0,h/* .css */.AH)("position:",t?"absolute":"static",";height:100%;right:",_/* .spacing["4"] */.YK["4"],";top:0;display:flex;align-items:center;gap:",_/* .spacing["8"] */.YK["8"],";opacity:0;transition:opacity 0.15s ease-in-out;",t&&(0,h/* .css */.AH)(e3()))},actionButton:/*#__PURE__*/(0,h/* .css */.AH)("color:",_/* .colorTokens.icon.subdued */.I6.icon.subdued,";")};// EXTERNAL MODULE: ./assets/src/js/v3/shared/molecules/Tabs.tsx
var te=n(88893);// CONCATENATED MODULE: ./assets/src/js/v3/shared/utils/quiz.ts
var tt=(e,t)=>{if(t===e){return null}if(e===D/* .QuizDataStatus.NEW */.cW.NEW){return D/* .QuizDataStatus.NEW */.cW.NEW}if((e===D/* .QuizDataStatus.UPDATE */.cW.UPDATE||e===D/* .QuizDataStatus.NO_CHANGE */.cW.NO_CHANGE)&&t===D/* .QuizDataStatus.UPDATE */.cW.UPDATE){return D/* .QuizDataStatus.UPDATE */.cW.UPDATE}return D/* .QuizDataStatus.NO_CHANGE */.cW.NO_CHANGE};var tn=e=>{if(e){var t=e.question_type;if(t==="h5p"){return true}var n=e.question_answers||[];var r=n.every(e=>e.is_saved);var i=n.some(e=>e.is_correct==="1");if(n.length===0&&t!=="open_ended"&&t!=="short_answer"){return{message:(0,v.__)("Please add an option.","tutor"),type:"add_option"}}if(!r){return{message:(0,v.__)("Please finish editing all newly created options.","tutor"),type:"save_option"}}if(["true_false","multiple_choice"].includes(t)&&!i){return{message:(0,v.__)("Please select a correct answer.","tutor"),type:"correct_option"}}if(t==="matching"){var a=e.question_settings.is_image_matching;var o=n.every(e=>e.answer_title);if(!o){return{message:(0,v.__)("Please add titles to all options.","tutor"),type:"save_option"}}if(a){var s=n.every(e=>e.image_url);if(!s){return{message:(0,v.__)("Please add images to all options.","tutor"),type:"question"}}}else{var l=n.every(e=>e.answer_two_gap_match);if(!l){return{message:(0,v.__)("Please add matched text to all options.","tutor"),type:"save_option"}}}}if(t==="scale"){var u=n[0];if(u===null||u===void 0?void 0:u.answer_two_gap_match){try{var d,c;var p=JSON.parse(u.answer_two_gap_match);var h;var f=Number((h=(d=p.config)===null||d===void 0?void 0:d.min)!==null&&h!==void 0?h:0);var g;var m=Number((g=(c=p.config)===null||c===void 0?void 0:c.max)!==null&&g!==void 0?g:100);if(!Number.isNaN(f)&&!Number.isNaN(m)&&m<=f){return{message:(0,v.__)("The maximum value must be greater than the minimum value.","tutor"),type:"question"}}var _=Number(p.value);if(!Number.isNaN(f)&&!Number.isNaN(m)&&!Number.isNaN(_)&&(_<f||_>m)){return{message:(0,v.__)("The correct value must be between the minimum and maximum values.","tutor"),type:"question"}}}catch(e){// Invalid JSON; other validation may apply elsewhere.
}}}if(t==="coordinates"){var b=n[0];var y=e.question_settings.coordinates_axis_range===20?20:10;var w=-y;var A=y;var Y=(b===null||b===void 0?void 0:b.answer_two_gap_match)||"";try{var k=JSON.parse(Y);var I=Array.isArray(k)?k:k&&typeof k==="object"?[k]:[];var q=I.length>0&&I.length<=5&&I.every(e=>{if(!e||typeof e!=="object")return false;var t=e;return typeof t.x==="number"&&typeof t.y==="number"&&Number.isInteger(t.x)&&Number.isInteger(t.y)&&t.x>=w&&t.x<=A&&t.y>=w&&t.y<=A});if(!q){return{message:(0,v.sprintf)(/* translators: 1: minimum coordinate value, 2: maximum coordinate value. */(0,v.__)("Please add valid coordinates in the range %1$d to %2$d.","tutor"),w,A),type:"question"}}}catch(e){return{message:(0,v.sprintf)(/* translators: 1: minimum coordinate value, 2: maximum coordinate value. */(0,v.__)("Please add valid coordinates in the range %1$d to %2$d.","tutor"),w,A),type:"question"}}}if(t==="draw_image"||t==="pin_image"){var C=n.some(e=>Boolean(e.answer_two_gap_match));if(!C){return{message:(0,v.__)("Please mark a valid area on the image.","tutor"),type:"question"}}}if(t==="puzzle"){var D=n.some(e=>Boolean(e.answer_two_gap_match)||Boolean(e.image_url));if(!D){return{message:(0,v.__)("Please upload a valid puzzle image.","tutor"),type:"question"}}}}return true};var tr=e=>{var t=e=>{if(e.image_url){return e.answer_view_format==="text_image"?D/* .QuizDataStatus.NO_CHANGE */.cW.NO_CHANGE:D/* .QuizDataStatus.UPDATE */.cW.UPDATE}return e.answer_view_format==="text"?D/* .QuizDataStatus.NO_CHANGE */.cW.NO_CHANGE:D/* .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);if(e.question_type==="draw_image"){var n=e.question_settings.draw_image_threshold_percent;if(n!==undefined&&n!==null&&!Number.isNaN(Number(n))){e.question_settings.draw_image_threshold_percent=Number(n)}}if(e.question_type==="puzzle"){var a=e.question_settings.puzzle_grid_size;if(a!==undefined&&a!==null&&!Number.isNaN(Number(a))){e.question_settings.puzzle_grid_size=Number(a)}}if(e.question_type==="coordinates"){var o=e.question_settings.coordinates_axis_range;if(o!==undefined&&o!==null&&!Number.isNaN(Number(o))){e.question_settings.coordinates_axis_range=Number(o)}}}e.question_answers=e.question_answers.map(e=>(0,i._)((0,r._)({},e),{_data_status:t(e),is_saved:true,answer_view_format:e.image_url?"text_image":"text"}));e.question_description=(0,k/* .normalizeLineEndings */.EW)(e.question_description)||"";e.answer_explanation=e.answer_explanation==='<p><br data-mce-bogus="1"></p>'?"":(0,k/* .normalizeLineEndings */.EW)(e.answer_explanation)||"";switch(e.question_type){case"single_choice":{return(0,i._)((0,r._)({},e),{_data_status:D/* .QuizDataStatus.UPDATE */.cW.UPDATE,question_type:"multiple_choice",question_answers:e.question_answers.map(e=>(0,i._)((0,r._)({},e),{_data_status:D/* .QuizDataStatus.UPDATE */.cW.UPDATE})),question_settings:(0,i._)((0,r._)({},e.question_settings),{question_type:"multiple_choice",has_multiple_correct_answer:false})})}case"multiple_choice":{return(0,i._)((0,r._)({},e),{_data_status:e.question_settings.has_multiple_correct_answer?D/* .QuizDataStatus.NO_CHANGE */.cW.NO_CHANGE:D/* .QuizDataStatus.UPDATE */.cW.UPDATE,question_settings:(0,i._)((0,r._)({},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,i._)((0,r._)({},e),{_data_status:e.question_settings.is_image_matching?D/* .QuizDataStatus.NO_CHANGE */.cW.NO_CHANGE:D/* .QuizDataStatus.UPDATE */.cW.UPDATE,question_settings:(0,i._)((0,r._)({},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,i._)((0,r._)({},e),{_data_status:D/* .QuizDataStatus.UPDATE */.cW.UPDATE,question_type:"matching",question_answers:e.question_answers.map(e=>(0,i._)((0,r._)({},e),{_data_status:D/* .QuizDataStatus.UPDATE */.cW.UPDATE})),question_settings:(0,i._)((0,r._)({},e.question_settings),{question_type:"matching",is_image_matching:true})})}default:return(0,i._)((0,r._)({},e),{_data_status:D/* .QuizDataStatus.NO_CHANGE */.cW.NO_CHANGE})}};var ti=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];var n=new Set(t);var a=e.map(e=>{if(e.question_type!=="draw_image"&&e.question_type!=="pin_image"){return e}var t=Array.isArray(e.question_answers)?e.question_answers:[];if(t.length<=1){return e}var[a,...o]=t;o.forEach(e=>{if(e._data_status!==D/* .QuizDataStatus.NEW */.cW.NEW&&e.answer_id){n.add(e.answer_id)}});return(0,i._)((0,r._)({},e),{question_answers:a?[a]:[]})});return{normalizedQuestions:a,deletedAnswerIds:Array.from(n)}};// EXTERNAL MODULE: ./assets/src/js/v3/shared/atoms/WPEditor.tsx
var ta=n(54184);// EXTERNAL MODULE: ./assets/src/js/v3/shared/components/FocusTrap.tsx
var to=n(75823);// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/modals/question-previews/CoordinatesPreview.tsx
var ts="data-tutor-coordinates-preview-script";var tl=e=>e===20?20:10;var tu="".concat(String(P/* .tutorConfig.tutor_url */.P.tutor_url||"").replace(/\/$/,""),"/assets/icons");var td=e=>"".concat(tu,"/").concat(e,".svg");/** Matches Pro `coordinates.php` eraser + {@link DrawImagePreview} Clear (SVGIcon + brand). */var tc=/*#__PURE__*/(0,h/* .css */.AH)("color:",_/* .colorTokens.text.brand */.I6.text.brand,";");/**
 * Learning-area parity: loads `tutor-pro/assets/js/coordinates-question.js` in the preview iframe
 * (same pattern as {@link ScalePreview} + Pro template `learning-area/quiz/questions/coordinates.php`).
 */var tp=e=>{var{axisRange:t}=e;var n=(0,o.useRef)(null);var r=tl(t);var i="preview";var s="tutor-coordinates-points-".concat(i);var l="tutor-coordinates-canvas-".concat(i);var u="tutor-coordinates-instruction-".concat(i);var d="tutor-coordinates-hover-".concat(i);(0,o.useEffect)(()=>{var e=n.current;if(!e){return}var t=e.ownerDocument;if(!t||t===document){return}if(t.head.querySelector("[".concat(ts,"]"))){e.removeAttribute("data-tutor-coordinates-init");var r=t.createElement("script");r.textContent="if(window._tutorCoordinatesInitAll){window._tutorCoordinatesInitAll();}";t.head.appendChild(r);return}var i=P/* .tutorConfig.site_url.replace */.P.site_url.replace(/\/$/,"");var a=t.createElement("script");a.setAttribute(ts,"1");a.textContent="\n      (function(){\n        var scriptEl = document.createElement('script');\n        scriptEl.src = '".concat(i,"/wp-content/plugins/tutor-pro/assets/js/coordinates-question.js';\n        scriptEl.onload = function(){\n          if(typeof window._tutorCoordinatesInitAll === 'function'){\n            window._tutorCoordinatesInitAll();\n          }\n        };\n        document.head.appendChild(scriptEl);\n      })();\n    ");t.head.appendChild(a)},[]);return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{ref:n,id:"tutor-coordinates-question-".concat(i),className:"tutor-quiz-question-options tutor-coordinates-question question-type-coordinates","data-question-type":"coordinates","data-question-id":i,"data-axis-range":String(r),"data-marker-hover":td("graph-marker-hover"),"data-marker-selected":td("graph-marker-selected"),"data-marker-wrong":td("graph-marker-wrong"),children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"tutor-coordinates-actions",children:/*#__PURE__*/(0,a/* .jsxs */.FD)("button",{type:"button",className:"tutor-coordinates-clear-prev tutor-coordinates-clear-button tutor-hidden","aria-label":(0,v.__)("Clear last point","tutor"),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"eraser",style:tc,width:18,height:18}),(0,v.__)("Clear","tutor")]})}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"tutor-coordinates-grid-container",children:/*#__PURE__*/(0,a/* .jsx */.Y)("canvas",{id:l,className:"tutor-coordinates-canvas",width:420,height:420,tabIndex:0,role:"application","aria-describedby":"".concat(u," ").concat(d),"aria-label":(0,v.__)("Coordinate grid: click or use arrow keys and Enter to select grid points.","tutor")})}),/*#__PURE__*/(0,a/* .jsx */.Y)("p",{id:u,className:"tutor-quiz-a11y-sr-only",children:(0,v.__)("Use arrow keys to move the active grid point, Enter to add it, and Backspace or Delete to remove the last point.","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)("p",{id:d,className:"tutor-coordinates-hover-display tutor-fs-7 tutor-color-secondary tutor-mb-12","aria-live":"polite"}),/*#__PURE__*/(0,a/* .jsx */.Y)("input",{type:"hidden",id:s,name:"preview[answers][coordinates][points]",defaultValue:""})]})};/* export default */const th=tp;// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/modals/question-previews/DrawImagePreview.tsx
var tv="data-tutor-draw-image-preview-script";/** Matches {@link FormDrawImage} Clear button icon (SVGIcon + brand color like quiz builder). */var tf=/*#__PURE__*/(0,h/* .css */.AH)("color:",_/* .colorTokens.text.brand */.I6.text.brand,";");/**
 * Loads `tutor-pro/assets/js/draw-image-question.js` in the preview iframe (same pattern as
 * {@link ScalePreview}, {@link CoordinatesPreview} + Pro `learning-area/quiz/questions/draw-image.php`).
 */var tg=e=>{var{answers:t}=e;var n,r;var i=(0,o.useRef)(null);var s=(n=t[0])===null||n===void 0?void 0:n.image_url;var l;var u=String((l=(r=t[0])===null||r===void 0?void 0:r.answer_id)!==null&&l!==void 0?l:"preview");var d="tutor-draw-image-instruction-".concat(u);var c="tutor-draw-image-status-".concat(u);(0,o.useEffect)(()=>{var e=i.current;if(!e){return}var t=e.ownerDocument;if(!t||t===document){return}if(t.head.querySelector("[".concat(tv,"]"))){var n=t.createElement("script");n.textContent="if(window._tutorDrawImageInitAll){window._tutorDrawImageInitAll();}";t.head.appendChild(n);return}var r=P/* .tutorConfig.site_url.replace */.P.site_url.replace(/\/$/,"");var a=t.createElement("script");a.setAttribute(tv,"1");a.textContent="\n			(function(){\n				var scriptEl = document.createElement('script');\n				scriptEl.src = '".concat(r,"/wp-content/plugins/tutor-pro/assets/js/draw-image-question.js';\n				scriptEl.onload = function(){\n					if(typeof window._tutorDrawImageInitAll === 'function'){\n						window._tutorDrawImageInitAll();\n					}\n				};\n				document.head.appendChild(scriptEl);\n			})();\n		");t.head.appendChild(a)},[s,u]);if(!s){return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"tutor-quiz-question-options",children:/*#__PURE__*/(0,a/* .jsx */.Y)("p",{className:"tutor-fs-7 tutor-color-secondary",children:(0,v.__)("No background image configured for this Image Marking question.","tutor")})})}return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{ref:i,id:"tutor-draw-image-question-".concat(u),className:"tutor-quiz-question-options tutor-draw-image-question","data-question-type":"draw_image","data-question-id":u,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"tutor-draw-image-actions tutor-mb-12",children:/*#__PURE__*/(0,a/* .jsxs */.FD)("button",{type:"button",className:"tutor-draw-image-clear-button tutor-hidden","aria-label":(0,v.__)("Clear drawing","tutor"),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"eraser",style:tf,width:18,height:18}),(0,v.__)("Clear","tutor")]})}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{className:"tutor-draw-image-wrapper",children:[/*#__PURE__*/(0,a/* .jsx */.Y)("img",{id:"tutor-draw-image-bg-".concat(u),src:s,alt:(0,v.__)("Draw on image question","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)("canvas",{id:"tutor-draw-image-canvas-".concat(u),className:"tutor-draw-image-canvas tutor-quiz-interaction-focus-target",tabIndex:0,role:"application","aria-describedby":"".concat(d," ").concat(c),"aria-label":(0,v.__)("Draw on image: use pointer or keyboard to mark your selection area.","tutor")})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("p",{id:d,className:"tutor-quiz-a11y-sr-only",children:(0,v.__)("Use arrow keys to move the drawing pointer. Press Space or Enter to start a freehand stroke, trace with arrow keys, then press Space or Enter again to finish and fill the selection. Escape cancels an in-progress stroke. C clears the saved selection.","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{id:c,className:"tutor-quiz-a11y-live-region tutor-quiz-a11y-sr-only","aria-live":"polite","aria-atomic":"true",role:"status"}),/*#__PURE__*/(0,a/* .jsx */.Y)("input",{type:"hidden",id:"tutor-draw-image-mask-".concat(u),name:"preview[answers][mask]",defaultValue:"",readOnly:true})]})};/* export default */const tm=tg;// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/modals/question-previews/FillInTheBlankPreview.tsx
var t_=(e,t,n,r)=>{var i=(e.answer_title||"").split("{dash}");return i.flatMap((o,s)=>{var l=[];var u="".concat(e.answer_id||t,"-").concat(s);if(o){l.push(/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:o},"".concat(e.answer_id||t,"-text-").concat(s)))}if(s<i.length-1){var d;l.push(/*#__PURE__*/(0,a/* .jsx */.Y)("input",{type:"text",className:"tutor-quiz-question-input",placeholder:(0,v.__)("Type your answer here","tutor"),value:(d=n[u])!==null&&d!==void 0?d:"",onChange:e=>r(u,e.target.value)},"".concat(e.answer_id||t,"-input-").concat(s)))}return l})};var tb=e=>{var{answers:t}=e;var[n,s]=(0,o.useState)({});var l=(e,t)=>{s(n=>(0,i._)((0,r._)({},n),{[e]:t}))};return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"tutor-quiz-question-options",children:/*#__PURE__*/(0,a/* .jsx */.Y)(b/* ["default"] */.A,{each:t,children:(e,t)=>/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"tutor-quiz-question-option",children:t_(e,t,n,l)},e.answer_id||t)})})};/* export default */const ty=tb;// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/modals/question-previews/ImageAnsweringPreview.tsx
var tw=e=>{var{answers:t}=e;var[n,s]=(0,o.useState)({});return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"tutor-quiz-question-options",children:/*#__PURE__*/(0,a/* .jsx */.Y)(b/* ["default"] */.A,{each:t,children:(e,t)=>{var o=String(e.answer_id||t);var l;return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{className:"tutor-quiz-question-option",children:[/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:e.image_url,children:/*#__PURE__*/(0,a/* .jsx */.Y)("img",{src:e.image_url,alt:e.answer_title})}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"tutor-input-field",children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"tutor-input-wrapper",children:/*#__PURE__*/(0,a/* .jsx */.Y)("input",{type:"text",className:"tutor-input tutor-input-content-clear tutor-quiz-question-input",placeholder:(0,v.__)("Write your answer here","tutor"),value:(l=n[o])!==null&&l!==void 0?l:"",onChange:e=>s(t=>(0,i._)((0,r._)({},t),{[o]:e.target.value}))})})})]},e.answer_id||t)}})})};/* export default */const tx=tw;// CONCATENATED MODULE: ./node_modules/.pnpm/@preact+signals-core@1.12.1/node_modules/@preact/signals-core/dist/signals-core.module.js
var tA=Symbol.for("preact-signals");function tY(){if(!(tD>1)){var e,t=!1;while(void 0!==tC){var n=tC;tC=void 0;tE++;while(void 0!==n){var r=n.o;n.o=void 0;n.f&=-3;if(!(8&n.f)&&tH(n))try{n.c()}catch(n){if(!t){e=n;t=!0}}n=r}}tE=0;tD--;if(t)throw e}else tD--}function tk(e){if(tD>0)return e();tD++;try{return e()}finally{tY()}}var tI=void 0;function tq(e){var t=tI;tI=void 0;try{return e()}finally{tI=t}}var tC=void 0,tD=0,tE=0,tS=0;function tz(e){if(void 0!==tI){var t=e.n;if(void 0===t||t.t!==tI){t={i:0,S:e,p:tI.s,n:void 0,t:tI,e:void 0,x:void 0,r:t};if(void 0!==tI.s)tI.s.n=t;tI.s=t;e.n=t;if(32&tI.f)e.S(t);return t}else if(-1===t.i){t.i=0;if(void 0!==t.n){t.n.p=t.p;if(void 0!==t.p)t.p.n=t.n;t.p=tI.s;t.n=void 0;tI.s.n=t;tI.s=t}return t}}}function tT(e,t){this.v=e;this.i=0;this.n=void 0;this.t=void 0;this.W=null==t?void 0:t.watched;this.Z=null==t?void 0:t.unwatched;this.name=null==t?void 0:t.name}tT.prototype.brand=tA;tT.prototype.h=function(){return!0};tT.prototype.S=function(e){var t=this,n=this.t;if(n!==e&&void 0===e.e){e.x=n;this.t=e;if(void 0!==n)n.e=e;else tq(function(){var e;null==(e=t.W)||e.call(t)})}};tT.prototype.U=function(e){var t=this;if(void 0!==this.t){var n=e.e,r=e.x;if(void 0!==n){n.x=r;e.e=void 0}if(void 0!==r){r.e=n;e.x=void 0}if(e===this.t){this.t=r;if(void 0===r)tq(function(){var e;null==(e=t.Z)||e.call(t)})}}};tT.prototype.subscribe=function(e){var t=this;return tU(function(){var n=t.value,r=tI;tI=void 0;try{e(n)}finally{tI=r}},{name:"sub"})};tT.prototype.valueOf=function(){return this.value};tT.prototype.toString=function(){return this.value+""};tT.prototype.toJSON=function(){return this.value};tT.prototype.peek=function(){var e=tI;tI=void 0;try{return this.value}finally{tI=e}};Object.defineProperty(tT.prototype,"value",{get:function(){var e=tz(this);if(void 0!==e)e.i=this.i;return this.v},set:function(e){if(e!==this.v){if(tE>100)throw new Error("Cycle detected");this.v=e;this.i++;tS++;tD++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{tY()}}}});function tM(e,t){return new tT(e,t)}function tH(e){for(var t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function tP(e){for(var t=e.s;void 0!==t;t=t.n){var n=t.S.n;if(void 0!==n)t.r=n;t.S.n=t;t.i=-1;if(void 0===t.n){e.s=t;break}}}function tO(e){var t=e.s,n=void 0;while(void 0!==t){var r=t.p;if(-1===t.i){t.S.U(t);if(void 0!==r)r.n=t.n;if(void 0!==t.n)t.n.p=r}else n=t;t.S.n=t.r;if(void 0!==t.r)t.r=void 0;t=r}e.s=n}function tF(e,t){tT.call(this,void 0);this.x=e;this.s=void 0;this.g=tS-1;this.f=4;this.W=null==t?void 0:t.watched;this.Z=null==t?void 0:t.unwatched;this.name=null==t?void 0:t.name}tF.prototype=new tT;tF.prototype.h=function(){this.f&=-3;if(1&this.f)return!1;if(32==(36&this.f))return!0;this.f&=-5;if(this.g===tS)return!0;this.g=tS;this.f|=1;if(this.i>0&&!tH(this)){this.f&=-2;return!0}var e=tI;try{tP(this);tI=this;var t=this.x();if(16&this.f||this.v!==t||0===this.i){this.v=t;this.f&=-17;this.i++}}catch(e){this.v=e;this.f|=16;this.i++}tI=e;tO(this);this.f&=-2;return!0};tF.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}tT.prototype.S.call(this,e)};tF.prototype.U=function(e){if(void 0!==this.t){tT.prototype.U.call(this,e);if(void 0===this.t){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}}};tF.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;void 0!==e;e=e.x)e.t.N()}};Object.defineProperty(tF.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=tz(this);this.h();if(void 0!==e)e.i=this.i;if(16&this.f)throw this.v;return this.v}});function tN(e,t){return new tF(e,t)}function tK(e){var t=e.u;e.u=void 0;if("function"==typeof t){tD++;var n=tI;tI=void 0;try{t()}catch(t){e.f&=-2;e.f|=8;tW(e);throw t}finally{tI=n;tY()}}}function tW(e){for(var t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0;e.s=void 0;tK(e)}function tR(e){if(tI!==this)throw new Error("Out-of-order effect");tO(this);tI=e;this.f&=-2;if(8&this.f)tW(this);tY()}function tL(e,t){this.x=e;this.u=void 0;this.s=void 0;this.o=void 0;this.f=32;this.name=null==t?void 0:t.name}tL.prototype.c=function(){var e=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();if("function"==typeof t)this.u=t}finally{e()}};tL.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1;this.f&=-9;tK(this);tP(this);tD++;var e=tI;tI=this;return tR.bind(this,e)};tL.prototype.N=function(){if(!(2&this.f)){this.f|=2;this.o=tC;tC=this}};tL.prototype.d=function(){this.f|=8;if(!(1&this.f))tW(this)};tL.prototype.dispose=function(){this.d()};function tU(e,t){var n=new tL(e,t);try{n.c()}catch(e){n.d();throw e}var r=n.d.bind(n);r[Symbol.dispose]=r;return r}//# sourceMappingURL=signals-core.module.js.map
;// CONCATENATED MODULE: ./node_modules/.pnpm/@dnd-kit+state@0.3.2/node_modules/@dnd-kit/state/dist/index.mjs
var tB=Object.create;var tj=Object.defineProperty;var tV=Object.defineProperties;var tQ=Object.getOwnPropertyDescriptor;var tG=Object.getOwnPropertyDescriptors;var t$=Object.getOwnPropertySymbols;var tX=Object.prototype.hasOwnProperty;var tZ=Object.prototype.propertyIsEnumerable;var tJ=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e);var t0=e=>{throw TypeError(e)};var t1=(e,t,n)=>t in e?tj(e,t,{enumerable:true,configurable:true,writable:true,value:n}):e[t]=n;var t2=(e,t)=>{for(var n in t||(t={}))if(tX.call(t,n))t1(e,n,t[n]);if(t$)for(var n of t$(t)){if(tZ.call(t,n))t1(e,n,t[n])}return e};var t4=(e,t)=>tV(e,tG(t));var t6=(e,t)=>tj(e,"name",{value:t,configurable:true});var t5=e=>{var t;return[,,,tB((t=e==null?void 0:e[tJ("metadata")])!=null?t:null)]};var t3=["class","method","getter","setter","accessor","field","value","get","set"];var t8=e=>e!==void 0&&typeof e!=="function"?t0("Function expected"):e;var t9=(e,t,n,r,i)=>({kind:t3[e],name:t,metadata:r,addInitializer:e=>n._?t0("Already initialized"):i.push(t8(e||null))});var t7=(e,t)=>t1(t,tJ("metadata"),e[3]);var ne=(e,t,n,r)=>{for(var i=0,a=e[t>>1],o=a&&a.length;i<o;i++)t&1?a[i].call(n):r=a[i].call(n,r);return r};var nt=(e,t,n,r,i,a)=>{var o,s,l,u,d,c=t&7,p=!!(t&8),h=!!(t&16);var v=c>3?e.length+1:c?p?1:2:0,f=t3[c+5];var g=c>3&&(e[v-1]=[]),m=e[v]||(e[v]=[]);var _=c&&(!h&&!p&&(i=i.prototype),c<5&&(c>3||!h)&&tQ(c<4?i:{get[n](){return ni(this,a)},set[n](x){return no(this,a,x)}},n));c?h&&c<4&&t6(a,(c>2?"set ":c>1?"get ":"")+n):t6(i,n);for(var b=r.length-1;b>=0;b--){u=t9(c,n,l={},e[3],m);if(c){u.static=p,u.private=h,d=u.access={has:h?e=>nr(i,e):e=>n in e};if(c^3)d.get=h?e=>(c^1?ni:ns)(e,i,c^4?a:_.get):e=>e[n];if(c>2)d.set=h?(e,t)=>no(e,i,t,c^4?a:_.set):(e,t)=>e[n]=t}s=(0,r[b])(c?c<4?h?a:_[f]:c>4?void 0:{get:_.get,set:_.set}:i,u),l._=1;if(c^4||s===void 0)t8(s)&&(c>4?g.unshift(s):c?h?a=s:_[f]=s:i=s);else if(typeof s!=="object"||s===null)t0("Object expected");else t8(o=s.get)&&(_.get=o),t8(o=s.set)&&(_.set=o),t8(o=s.init)&&g.unshift(o)}return c||t7(e,i),_&&tj(i,n,_),h?c^4?a:_:i};var nn=(e,t,n)=>t.has(e)||t0("Cannot "+n);var nr=(e,t)=>Object(t)!==t?t0('Cannot use the "in" operator on this value'):e.has(t);var ni=(e,t,n)=>(nn(e,t,"read from private field"),n?n.call(e):t.get(e));var na=(e,t,n)=>t.has(e)?t0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n);var no=(e,t,n,r)=>(nn(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var ns=(e,t,n)=>(nn(e,t,"access private method"),n);// src/index.ts
// src/computed.ts
function nl(e,t){if(t){let n;return tN(()=>{const r=e();if(r&&n&&t(n,r)){return n}n=r;return r})}return tN(e)}// src/comparators.ts
function nu(e,t){if(Object.is(e,t)){return true}if(e===null||t===null)return false;if(typeof e==="function"&&typeof t==="function"){return e===t}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size){return false}for(const n of e){if(!t.has(n)){return false}}return true}if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length){return false}const n=e.some((e,n)=>!nu(e,t[n]));return!n}if(typeof e==="object"&&typeof t==="object"){const n=Object.keys(e);const r=Object.keys(t);if(n.length!==r.length)return false;const i=n.some(n=>!nu(e[n],t[n]));return!i}return false}// src/decorators.ts
function nd({get:e},t){return{init(e){return tM(e)},get(){const t=e.call(this);return t.value},set(t){const n=e.call(this);if(n.peek()===t){return}n.value=t}}}function nc(e,t){const n=/* @__PURE__ */new WeakMap;return function(){let t=n.get(this);if(!t){t=nl(e.bind(this));n.set(this,t)}return t.value}}function np(e=true){return function(t,n){n.addInitializer(function(){const t=n.kind==="field"?this:n.static?this:Object.getPrototypeOf(this);const r=Object.getOwnPropertyDescriptor(t,n.name);if(r){Object.defineProperty(t,n.name,t4(t2({},r),{enumerable:e}))}})}}// src/effects.ts
function nh(...e){const t=e.map(e=>tU(e));return()=>t.forEach(e=>e())}// src/history.ts
var nv,nf,ng,nm,n_,nb,ny,nw,nx,nA,nY,nk,nI,nq,nC,nD,nE,nS,nz,nT;nb=[nd],n_=[nd],nm=[nd],ng=[np()],nf=[np()],nv=[np()];var nM=class{constructor(e,t=Object.is){this.defaultValue=e;this.equals=t;ne(ny,5,this);na(this,nk);// @ts-ignore
na(this,nw,ne(ny,8,this)),ne(ny,11,this);// @ts-ignore
na(this,nI,ne(ny,12,this)),ne(ny,15,this);// @ts-ignore
na(this,nE,ne(ny,16,this)),ne(ny,19,this);this.reset=this.reset.bind(this);this.reset()}get current(){return ni(this,nk,nz)}get initial(){return ni(this,nk,nA)}get previous(){return ni(this,nk,nC)}/** Set the current value */set current(e){const t=tq(()=>ni(this,nk,nz));if(e&&t&&this.equals(t,e)){return}tk(()=>{if(!ni(this,nk,nA)){no(this,nk,e,nY)}no(this,nk,t,nD);no(this,nk,e,nT)})}/** Reset the state to the initial value */reset(e=this.defaultValue){tk(()=>{no(this,nk,void 0,nD);no(this,nk,e,nY);no(this,nk,e,nT)})}};ny=t5(null);nw=new WeakMap;nk=new WeakSet;nI=new WeakMap;nE=new WeakMap;nx=nt(ny,20,"#initial",nb,nk,nw),nA=nx.get,nY=nx.set;nq=nt(ny,20,"#previous",n_,nk,nI),nC=nq.get,nD=nq.set;nS=nt(ny,20,"#current",nm,nk,nE),nz=nS.get,nT=nS.set;nt(ny,2,"current",ng,nM);nt(ny,2,"initial",nf,nM);nt(ny,2,"previous",nv,nM);t7(ny,nM);// src/snapshot.ts
function nH(e){return tq(()=>{const t={};for(const n in e){t[n]=e[n]}return t})}// src/store.ts
var nP;var nO=class{constructor(){na(this,nP,/* @__PURE__ */new WeakMap)}get(e,t){var n;return e?(n=ni(this,nP).get(e))==null?void 0:n.get(t):void 0}set(e,t,n){var r;if(!e)return;if(!ni(this,nP).has(e))ni(this,nP).set(e,/* @__PURE__ */new Map);return(r=ni(this,nP).get(e))==null?void 0:r.set(t,n)}clear(e){var t;return e?(t=ni(this,nP).get(e))==null?void 0:t.clear():void 0}};nP=new WeakMap;// CONCATENATED MODULE: ./node_modules/.pnpm/@dnd-kit+geometry@0.3.2/node_modules/@dnd-kit/geometry/dist/index.mjs
var nF=Object.create;var nN=Object.defineProperty;var nK=Object.getOwnPropertyDescriptor;var nW=Object.getOwnPropertySymbols;var nR=Object.prototype.hasOwnProperty;var nL=Object.prototype.propertyIsEnumerable;var nU=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e);var nB=e=>{throw TypeError(e)};var nj=Math.pow;var nV=(e,t,n)=>t in e?nN(e,t,{enumerable:true,configurable:true,writable:true,value:n}):e[t]=n;var nQ=(e,t)=>{for(var n in t||(t={}))if(nR.call(t,n))nV(e,n,t[n]);if(nW)for(var n of nW(t)){if(nL.call(t,n))nV(e,n,t[n])}return e};var nG=(e,t)=>nN(e,"name",{value:t,configurable:true});var n$=e=>{var t;return[,,,nF((t=e==null?void 0:e[nU("metadata")])!=null?t:null)]};var nX=["class","method","getter","setter","accessor","field","value","get","set"];var nZ=e=>e!==void 0&&typeof e!=="function"?nB("Function expected"):e;var nJ=(e,t,n,r,i)=>({kind:nX[e],name:t,metadata:r,addInitializer:e=>n._?nB("Already initialized"):i.push(nZ(e||null))});var n0=(e,t)=>nV(t,nU("metadata"),e[3]);var n1=(e,t,n,r)=>{for(var i=0,a=e[t>>1],o=a&&a.length;i<o;i++)t&1?a[i].call(n):r=a[i].call(n,r);return r};var n2=(e,t,n,r,i,a)=>{var o,s,l,u,d,c=t&7,p=!!(t&8),h=!!(t&16);var v=c>3?e.length+1:c?p?1:2:0,f=nX[c+5];var g=c>3&&(e[v-1]=[]),m=e[v]||(e[v]=[]);var _=c&&(!h&&!p&&(i=i.prototype),c<5&&(c>3||!h)&&nK(c<4?i:{get[n](){return n5(this,a)},set[n](x){return n8(this,a,x)}},n));c?h&&c<4&&nG(a,(c>2?"set ":c>1?"get ":"")+n):nG(i,n);for(var b=r.length-1;b>=0;b--){u=nJ(c,n,l={},e[3],m);if(c){u.static=p,u.private=h,d=u.access={has:h?e=>n6(i,e):e=>n in e};if(c^3)d.get=h?e=>(c^1?n5:n9)(e,i,c^4?a:_.get):e=>e[n];if(c>2)d.set=h?(e,t)=>n8(e,i,t,c^4?a:_.set):(e,t)=>e[n]=t}s=(0,r[b])(c?c<4?h?a:_[f]:c>4?void 0:{get:_.get,set:_.set}:i,u),l._=1;if(c^4||s===void 0)nZ(s)&&(c>4?g.unshift(s):c?h?a=s:_[f]=s:i=s);else if(typeof s!=="object"||s===null)nB("Object expected");else nZ(o=s.get)&&(_.get=o),nZ(o=s.set)&&(_.set=o),nZ(o=s.init)&&g.unshift(o)}return c||n0(e,i),_&&nN(i,n,_),h?c^4?a:_:i};var n4=(e,t,n)=>t.has(e)||nB("Cannot "+n);var n6=(e,t)=>Object(t)!==t?nB('Cannot use the "in" operator on this value'):e.has(t);var n5=(e,t,n)=>(n4(e,t,"read from private field"),n?n.call(e):t.get(e));var n3=(e,t,n)=>t.has(e)?nB("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n);var n8=(e,t,n,r)=>(n4(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var n9=(e,t,n)=>(n4(e,t,"access private method"),n);// src/point/Point.ts
var n7=class e{/**
   * @param {number} Coordinate of the point on the horizontal axis
   * @param {number} Coordinate of the point on the vertical axis
   */constructor(e,t){this.x=e;this.y=t}/**
   * Returns the delta between this point and another point.
   *
   * @param {Point} a - A point
   * @param {Point} b - Another point
   */static delta(t,n){return new e(t.x-n.x,t.y-n.y)}/**
   * Returns the distance (hypotenuse) between this point and another point.
   *
   * @param {Point} a - A point
   * @param {Point} b - Another point
   */static distance(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}/**
   * Returns true if both points are equal.
   *
   * @param {Point} a - A point
   * @param {Point} b - Another point
   */static equals(e,t){return e.x===t.x&&e.y===t.y}static from({x:t,y:n}){return new e(t,n)}};// src/shapes/Rectangle.ts
var re=class e{constructor(e,t,n,r){this.left=e;this.top=t;this.width=n;this.height=r;this.scale={x:1,y:1}}get inverseScale(){return{x:1/this.scale.x,y:1/this.scale.y}}translate(t,n){const{top:r,left:i,width:a,height:o,scale:s}=this;const l=new e(i+t,r+n,a,o);l.scale=nQ({},s);return l}get boundingRectangle(){const{width:e,height:t,left:n,top:r,right:i,bottom:a}=this;return{width:e,height:t,left:n,top:r,right:i,bottom:a}}get center(){const{left:e,top:t,right:n,bottom:r}=this;return new n7((e+n)/2,(t+r)/2)}get area(){const{width:e,height:t}=this;return e*t}equals(t){if(!(t instanceof e)){return false}const{left:n,top:r,width:i,height:a}=this;return n===t.left&&r===t.top&&i===t.width&&a===t.height}containsPoint(e){const{top:t,left:n,bottom:r,right:i}=this;return t<=e.y&&e.y<=r&&n<=e.x&&e.x<=i}intersectionArea(t){if(t instanceof e){return rt(this,t)}return 0}intersectionRatio(e){const{area:t}=this;const n=this.intersectionArea(e);const r=n/(e.area+t-n);return r}get bottom(){const{top:e,height:t}=this;return e+t}get right(){const{left:e,width:t}=this;return e+t}get aspectRatio(){const{width:e,height:t}=this;return e/t}get corners(){return[{x:this.left,y:this.top},{x:this.right,y:this.top},{x:this.left,y:this.bottom},{x:this.right,y:this.bottom}]}static from({top:t,left:n,width:r,height:i}){return new e(n,t,r,i)}static delta(e,t,n={x:"center",y:"center"}){const r=(e,t)=>{const r=n[t];const i=t==="x"?e.left:e.top;const a=t==="x"?e.width:e.height;if(r=="start")return i;if(r=="end")return i+a;return i+a/2};return n7.delta({x:r(e,"x"),y:r(e,"y")},{x:r(t,"x"),y:r(t,"y")})}static intersectionRatio(t,n){return e.from(t).intersectionRatio(e.from(n))}};function rt(e,t){const n=Math.max(t.top,e.top);const r=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-r;const s=a-n;if(r<i&&n<a){const e=o*s;return e}return 0}// src/position/position.ts
var rn,rr,ri,ra,ro;var rs=class extends(ri=nM,rr=[nc],rn=[nc],ri){constructor(e){const t=n7.from(e);super(t,(e,t)=>n7.equals(e,t));n1(ro,5,this);n3(this,ra,0);this.velocity={x:0,y:0}}get delta(){return n7.delta(this.current,this.initial)}get direction(){const{current:e,previous:t}=this;if(!t)return null;const n={x:e.x-t.x,y:e.y-t.y};if(!n.x&&!n.y){return null}if(Math.abs(n.x)>Math.abs(n.y)){return n.x>0?"right":"left"}return n.y>0?"down":"up"}get current(){return super.current}set current(e){const{current:t}=this;const n=n7.from(e);const r={x:n.x-t.x,y:n.y-t.y};const i=Date.now();const a=i-n5(this,ra);const o=e=>Math.round(e/a*100);tk(()=>{n8(this,ra,i);this.velocity={x:o(r.x),y:o(r.y)};super.current=n})}reset(e=this.defaultValue){super.reset(n7.from(e));this.velocity={x:0,y:0}}};ro=n$(ri);ra=new WeakMap;n2(ro,2,"delta",rr,rs);n2(ro,2,"direction",rn,rs);n0(ro,rs);// src/distance/distance.ts
function rl({x:e,y:t},n){const r=Math.abs(e);const i=Math.abs(t);if(typeof n==="number"){return Math.sqrt(nj(r,2)+nj(i,2))>n}if("x"in n&&"y"in n){return r>n.x&&i>n.y}if("x"in n){return r>n.x}if("y"in n){return i>n.y}return false}// src/types/axis.ts
var ru=/* @__PURE__ */(e=>{e["Horizontal"]="x";e["Vertical"]="y";return e})(ru||{});var rd=Object.values(ru);// CONCATENATED MODULE: ./node_modules/.pnpm/@dnd-kit+abstract@0.3.2/node_modules/@dnd-kit/abstract/index.js
var rc=Object.create;var rp=Object.defineProperty;var rh=Object.defineProperties;var rv=Object.getOwnPropertyDescriptor;var rf=Object.getOwnPropertyDescriptors;var rg=Object.getOwnPropertySymbols;var rm=Object.prototype.hasOwnProperty;var r_=Object.prototype.propertyIsEnumerable;var rb=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e);var ry=e=>{throw TypeError(e)};var rw=(e,t,n)=>t in e?rp(e,t,{enumerable:true,configurable:true,writable:true,value:n}):e[t]=n;var rx=(e,t)=>{for(var n in t||(t={}))if(rm.call(t,n))rw(e,n,t[n]);if(rg)for(var n of rg(t)){if(r_.call(t,n))rw(e,n,t[n])}return e};var rA=(e,t)=>rh(e,rf(t));var rY=(e,t)=>rp(e,"name",{value:t,configurable:true});var rk=(e,t)=>{var n={};for(var r in e)if(rm.call(e,r)&&t.indexOf(r)<0)n[r]=e[r];if(e!=null&&rg)for(var r of rg(e)){if(t.indexOf(r)<0&&r_.call(e,r))n[r]=e[r]}return n};var rI=e=>{var t;return[,,,rc((t=e==null?void 0:e[rb("metadata")])!=null?t:null)]};var rq=["class","method","getter","setter","accessor","field","value","get","set"];var rC=e=>e!==void 0&&typeof e!=="function"?ry("Function expected"):e;var rD=(e,t,n,r,i)=>({kind:rq[e],name:t,metadata:r,addInitializer:e=>n._?ry("Already initialized"):i.push(rC(e||null))});var rE=(e,t)=>rw(t,rb("metadata"),e[3]);var rS=(e,t,n,r)=>{for(var i=0,a=e[t>>1],o=a&&a.length;i<o;i++)t&1?a[i].call(n):r=a[i].call(n,r);return r};var rz=(e,t,n,r,i,a)=>{var o,s,l,u,d,c=t&7,p=!!(t&8),h=!!(t&16);var v=c>3?e.length+1:c?p?1:2:0,f=rq[c+5];var g=c>3&&(e[v-1]=[]),m=e[v]||(e[v]=[]);var _=c&&(!h&&!p&&(i=i.prototype),c<5&&(c>3||!h)&&rv(c<4?i:{get[n](){return rH(this,a)},set[n](x){return rO(this,a,x)}},n));c?h&&c<4&&rY(a,(c>2?"set ":c>1?"get ":"")+n):rY(i,n);for(var b=r.length-1;b>=0;b--){u=rD(c,n,l={},e[3],m);if(c){u.static=p,u.private=h,d=u.access={has:h?e=>rM(i,e):e=>n in e};if(c^3)d.get=h?e=>(c^1?rH:rF)(e,i,c^4?a:_.get):e=>e[n];if(c>2)d.set=h?(e,t)=>rO(e,i,t,c^4?a:_.set):(e,t)=>e[n]=t}s=(0,r[b])(c?c<4?h?a:_[f]:c>4?void 0:{get:_.get,set:_.set}:i,u),l._=1;if(c^4||s===void 0)rC(s)&&(c>4?g.unshift(s):c?h?a=s:_[f]=s:i=s);else if(typeof s!=="object"||s===null)ry("Object expected");else rC(o=s.get)&&(_.get=o),rC(o=s.set)&&(_.set=o),rC(o=s.init)&&g.unshift(o)}return c||rE(e,i),_&&rp(i,n,_),h?c^4?a:_:i};var rT=(e,t,n)=>t.has(e)||ry("Cannot "+n);var rM=(e,t)=>Object(t)!==t?ry('Cannot use the "in" operator on this value'):e.has(t);var rH=(e,t,n)=>(rT(e,t,"read from private field"),n?n.call(e):t.get(e));var rP=(e,t,n)=>t.has(e)?ry("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n);var rO=(e,t,n,r)=>(rT(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var rF=(e,t,n)=>(rT(e,t,"access private method"),n);// src/core/plugins/utilities.ts
function rN(e,t){return{plugin:e,options:t}}function rK(e){return t=>{return rN(e,t)}}function rW(e){if(typeof e==="function"){return{plugin:e,options:void 0}}return e}// src/core/plugins/plugin.ts
var rR,rL,rU,rB;rR=[nd];var rj=class{/**
   * Creates a new plugin instance.
   *
   * @param manager - The drag and drop manager that owns this plugin
   * @param options - Optional configuration for the plugin
   */constructor(e,t){this.manager=e;this.options=t;rP(this,rU,rS(rL,8,this,false)),rS(rL,11,this);rP(this,rB,/* @__PURE__ */new Set)}/**
   * Enables a disabled plugin instance.
   *
   * @remarks
   * This method triggers effects when called.
   */enable(){this.disabled=false}/**
   * Disables an enabled plugin instance.
   *
   * @remarks
   * This method triggers effects when called.
   */disable(){this.disabled=true}/**
   * Checks if the plugin instance is disabled.
   *
   * @returns true if the plugin is disabled
   * @remarks
   * This method does not trigger effects when accessed.
   */isDisabled(){return tq(()=>{return this.disabled})}/**
   * Configures a plugin instance with new options.
   *
   * @param options - The new options to apply
   */configure(e){this.options=e}/**
   * Registers an effect that will be cleaned up when the plugin is destroyed.
   *
   * @param callback - The effect callback to register
   * @returns A function to dispose of the effect
   */registerEffect(e){const t=tU(e.bind(this));rH(this,rB).add(t);return t}/**
   * Destroys a plugin instance and cleans up its resources.
   *
   * @remarks
   * This method:
   * - Calls all registered cleanup functions
   * - Should be overridden by subclasses to clean up additional resources
   */destroy(){rH(this,rB).forEach(e=>e())}/**
   * Configures a plugin constructor with options.
   *
   * @param options - The options to configure the constructor with
   * @returns The configured plugin constructor
   *
   * @remarks
   * This method is used to configure the options that the
   * plugin constructor will use to create plugin instances.
   */static configure(e){return rN(this,e)}};rL=rI(null);rU=new WeakMap;rB=new WeakMap;rz(rL,4,"disabled",rR,rj,rU);rE(rL,rj);var rV=class extends rj{};// src/core/plugins/registry.ts
var rQ;var rG=class{/**
   * Creates a new plugin registry.
   *
   * @param manager - The drag and drop manager that owns this registry
   */constructor(e){this.manager=e;this.instances=/* @__PURE__ */new Map;rP(this,rQ,[])}/**
   * Gets all registered plugin instances.
   *
   * @returns An array of all active plugin instances
   */get values(){return Array.from(this.instances.values())}/**
   * Sets the list of plugins to be used by the registry.
   *
   * @param entries - Array of plugin constructors or descriptors
   * @remarks
   * This method:
   * - Filters out duplicate plugins
   * - Unregisters plugins that are no longer in use
   * - Registers new plugins with their options
   */set values(e){const t=e.map(rW).reduceRight((e,t)=>{if(e.some(({plugin:e})=>e===t.plugin)){return e}return[t,...e]},[]);const n=t.map(({plugin:e})=>e);for(const e of rH(this,rQ)){if(!n.includes(e)){if(e.prototype instanceof rV){continue}this.unregister(e)}}for(const{plugin:e,options:n}of t){this.register(e,n)}rO(this,rQ,n)}/**
   * Gets a plugin instance by its constructor.
   *
   * @param plugin - The plugin constructor to look up
   * @returns The plugin instance or undefined if not found
   */get(e){const t=this.instances.get(e);return t}/**
   * Registers a new plugin instance.
   *
   * @param plugin - The plugin constructor to register
   * @param options - Optional configuration for the plugin
   * @returns The registered plugin instance
   * @remarks
   * If the plugin is already registered, its options will be updated
   * and the existing instance will be returned.
   */register(e,t){const n=this.instances.get(e);if(n){if(n.options!==t){n.options=t}return n}const r=new e(this.manager,t);this.instances.set(e,r);return r}/**
   * Unregisters a plugin instance.
   *
   * @param plugin - The plugin constructor to unregister
   * @remarks
   * This method:
   * - Destroys the plugin instance
   * - Removes it from the registry
   */unregister(e){const t=this.instances.get(e);if(t){t.destroy();this.instances.delete(e)}}/**
   * Destroys all registered plugin instances.
   *
   * @remarks
   * This method:
   * - Calls destroy() on all plugin instances
   * - Clears the registry
   */destroy(){for(const e of this.instances.values()){e.destroy()}this.instances.clear()}};rQ=new WeakMap;// src/core/collision/utilities.ts
function r$(e,t){if(e.priority===t.priority){if(e.type===t.type){return t.value-e.value}return t.type-e.type}return t.priority-e.priority}// src/core/collision/observer.ts
var rX=[];var rZ,rJ;var r0=class extends rj{/**
   * Creates a new CollisionObserver instance.
   *
   * @param manager - The drag drop manager instance
   */constructor(e){super(e);rP(this,rZ);rP(this,rJ);this.computeCollisions=this.computeCollisions.bind(this);rO(this,rJ,tM(rX));this.destroy=nh(()=>{const e=this.computeCollisions();const t=tq(()=>this.manager.dragOperation.position.current);if(e!==rX){const e=rH(this,rZ);rO(this,rZ,t);if(e&&t.x==e.x&&t.y==e.y){return}}else{rO(this,rZ,void 0)}rH(this,rJ).value=e},()=>{const{dragOperation:e}=this.manager;if(e.status.initialized){this.forceUpdate()}})}/**
   * Forces an immediate update of collision detection.
   *
   * @param immediate - If true, updates collisions immediately. If false, resets previous coordinates.
   */forceUpdate(e=true){tq(()=>{if(e){rH(this,rJ).value=this.computeCollisions()}else{rO(this,rZ,void 0)}})}/**
   * Computes collisions between draggable and droppable elements.
   *
   * @param entries - Optional array of droppable elements to check. If not provided, uses all registered droppables.
   * @param collisionDetector - Optional custom collision detector function
   * @returns Array of detected collisions, sorted by priority
   */computeCollisions(e,t){const{registry:n,dragOperation:r}=this.manager;const{source:i,shape:a,status:o}=r;if(!o.initialized||!a){return rX}const s=[];const l=[];for(const a of e!=null?e:n.droppables){if(a.disabled){continue}if(i&&!a.accepts(i)){continue}const e=t!=null?t:a.collisionDetector;if(!e){continue}l.push(a);void a.shape;const n=tq(()=>e({droppable:a,dragOperation:r}));if(n){if(a.collisionPriority!=null){n.priority=a.collisionPriority}s.push(n)}}if(l.length===0){return rX}s.sort(r$);return s}/**
   * Gets the current collisions signal value.
   */get collisions(){return rH(this,rJ).value}};rZ=new WeakMap;rJ=new WeakMap;// src/core/manager/events.ts
var r1=class{constructor(){this.registry=/* @__PURE__ */new Map}/**
   * Adds an event listener for the specified event type.
   *
   * @param name - The name of the event to listen for
   * @param handler - The function to call when the event occurs
   * @returns A function to remove the event listener
   */addEventListener(e,t){const{registry:n}=this;const r=new Set(n.get(e));r.add(t);n.set(e,r);return()=>this.removeEventListener(e,t)}/**
   * Removes an event listener for the specified event type.
   *
   * @param name - The name of the event
   * @param handler - The function to remove
   */removeEventListener(e,t){const{registry:n}=this;const r=new Set(n.get(e));r.delete(t);n.set(e,r)}/**
   * Dispatches an event to all registered listeners.
   *
   * @param name - The name of the event to dispatch
   * @param args - Arguments to pass to the event handlers
   */dispatch(e,...t){const{registry:n}=this;const r=n.get(e);if(!r){return}for(const e of r){e(...t)}}};var r2=class extends r1{/**
   * Creates a new drag and drop monitor.
   *
   * @param manager - The drag and drop manager to monitor
   */constructor(e){super();this.manager=e}/**
   * Dispatches a drag and drop event.
   *
   * @param type - The type of event to dispatch
   * @param event - The event data to dispatch
   */dispatch(e,t){const n=[t,this.manager];super.dispatch(e,...n)}};function r4(e,t=true){let n=false;return rA(rx({},e),{cancelable:t,get defaultPrevented(){return n},preventDefault(){if(!t){return}n=true}})}// src/core/collision/notifier.ts
var r6=class extends rV{constructor(e){super(e);const t=(e,t)=>e.map(({id:e})=>e).join("")===t.map(({id:e})=>e).join("");let n=[];this.destroy=nh(()=>{const{dragOperation:t,collisionObserver:r}=e;if(t.status.initializing){n=[];r.enable()}},()=>{const{collisionObserver:r,monitor:i}=e;const{collisions:a}=r;if(r.isDisabled()){return}const o=r4({collisions:a});i.dispatch("collision",o);if(o.defaultPrevented){return}if(t(a,n)){return}else{n=a}const[s]=a;tq(()=>{var t;if((s==null?void 0:s.id)!==((t=e.dragOperation.target)==null?void 0:t.id)){r.disable();e.actions.setDropTarget(s==null?void 0:s.id).then(()=>{r.enable()})}})})}};// src/core/collision/types.ts
var r5=/* @__PURE__ */(e=>{e[e["Lowest"]=0]="Lowest";e[e["Low"]=1]="Low";e[e["Normal"]=2]="Normal";e[e["High"]=3]="High";e[e["Highest"]=4]="Highest";return e})(r5||{});var r3=/* @__PURE__ */(e=>{e[e["Collision"]=0]="Collision";e[e["ShapeIntersection"]=1]="ShapeIntersection";e[e["PointerIntersection"]=2]="PointerIntersection";return e})(r3||{});var r8,r9,r7,ie,it,ir,ii,ia,io;ii=[nd],ir=[nc],it=[nc],ie=[nc],r7=[nc],r9=[nc],r8=[nc];var is=class{constructor(){rS(ia,5,this);rP(this,io,rS(ia,8,this,"idle"/* Idle */)),rS(ia,11,this)}get current(){return this.value}get idle(){return this.value==="idle"/* Idle */}get initializing(){return this.value==="initializing"/* Initializing */}get initialized(){const{value:e}=this;return e!=="idle"/* Idle */&&e!=="initialization-pending"/* InitializationPending */}get dragging(){return this.value==="dragging"/* Dragging */}get dropped(){return this.value==="dropped"/* Dropped */}/**
   * Sets the current status value.
   *
   * @param value - The new status value
   */set(e){this.value=e}};ia=rI(null);io=new WeakMap;rz(ia,4,"value",ii,is,io);rz(ia,2,"current",ir,is);rz(ia,2,"idle",it,is);rz(ia,2,"initializing",ie,is);rz(ia,2,"initialized",r7,is);rz(ia,2,"dragging",r9,is);rz(ia,2,"dropped",r8,is);rE(ia,is);// src/core/manager/actions.ts
var il=class{/**
   * Creates a new instance of drag actions.
   *
   * @param manager - The drag and drop manager instance
   */constructor(e){this.manager=e}/**
   * Sets the source of the drag operation.
   *
   * @param source - The draggable entity or its unique identifier
   */setDragSource(e){const{dragOperation:t}=this.manager;t.sourceIdentifier=typeof e==="string"||typeof e==="number"?e:e.id}/**
   * Sets the target of the drop operation.
   *
   * @param identifier - The unique identifier of the droppable entity or null/undefined
   * @returns A promise that resolves to true if the drop was prevented
   */setDropTarget(e){return tq(()=>{const{dragOperation:t}=this.manager;const n=e!=null?e:null;if(t.targetIdentifier===n){return Promise.resolve(false)}t.targetIdentifier=n;const r=r4({operation:t.snapshot()});if(t.status.dragging){this.manager.monitor.dispatch("dragover",r)}return this.manager.renderer.rendering.then(()=>r.defaultPrevented)})}/**
   * Starts a new drag operation.
   *
   * @param args - Configuration for the drag operation
   * @param args.event - The event that initiated the drag
   * @param args.source - The source draggable entity or its identifier
   * @param args.coordinates - The initial coordinates of the drag
   * @returns true if the drag operation started successfully
   * @throws {Error} If there is no drag source or another operation is active
   */start(e){return tq(()=>{const{dragOperation:t}=this.manager;if(e.source!=null){this.setDragSource(e.source)}const n=t.source;if(!n){throw new Error("Cannot start a drag operation without a drag source")}if(!t.status.idle){throw new Error("Cannot start a drag operation while another is active")}const r=new AbortController;const{event:i,coordinates:a}=e;tk(()=>{t.status.set("initialization-pending"/* InitializationPending */);t.shape=null;t.canceled=false;t.activatorEvent=i!=null?i:null;t.position.reset(a)});const o=r4({operation:t.snapshot()});this.manager.monitor.dispatch("beforedragstart",o);if(o.defaultPrevented){t.reset();r.abort();return r}t.status.set("initializing"/* Initializing */);t.controller=r;this.manager.renderer.rendering.then(()=>{if(r.signal.aborted)return;const{status:e}=t;if(e.current!=="initializing"/* Initializing */)return;t.status.set("dragging"/* Dragging */);this.manager.monitor.dispatch("dragstart",{nativeEvent:i,operation:t.snapshot(),cancelable:false})});return r})}/**
   * Moves the dragged entity to a new position.
   *
   * @param args - Configuration for the move operation
   * @param args.by - Relative coordinates to move by
   * @param args.to - Absolute coordinates to move to
   * @param args.event - The event that triggered the move
   * @param args.cancelable - Whether the move can be canceled
   * @param args.propagate - Whether to dispatch dragmove events
   */move(e){return tq(()=>{var t,n;const{dragOperation:r}=this.manager;const{status:i,controller:a}=r;if(!i.dragging||!a||a.signal.aborted){return}const o=r4({nativeEvent:e.event,operation:r.snapshot(),by:e.by,to:e.to},(t=e.cancelable)!=null?t:true);if((n=e.propagate)!=null?n:true){this.manager.monitor.dispatch("dragmove",o)}queueMicrotask(()=>{var t,n,i,a,s;if(o.defaultPrevented){return}const l=(s=e.to)!=null?s:{x:r.position.current.x+((n=(t=e.by)==null?void 0:t.x)!=null?n:0),y:r.position.current.y+((a=(i=e.by)==null?void 0:i.y)!=null?a:0)};r.position.current=l})})}/**
   * Stops the current drag operation.
   *
   * @param args - Configuration for stopping the operation
   * @param args.event - The event that triggered the stop
   * @param args.canceled - Whether the operation was canceled
   * @remarks
   * This method:
   * - Dispatches a dragend event
   * - Allows suspension of the operation
   * - Handles cleanup of the operation state
   */stop(e={}){return tq(()=>{var t,n;const{dragOperation:r}=this.manager;const{controller:i}=r;if(!i||i.signal.aborted)return;let a;const o=()=>{const e={resume:()=>{},abort:()=>{}};a=new Promise((t,n)=>{e.resume=t;e.abort=n});return e};i.abort();const s=()=>{this.manager.renderer.rendering.then(()=>{r.status.set("dropped"/* Dropped */);const e=tq(()=>{var e;return((e=r.source)==null?void 0:e.status)==="dropping"});const t=()=>{if(r.controller===i){r.controller=void 0}r.reset()};if(e){const{source:e}=r;const n=tU(()=>{if((e==null?void 0:e.status)==="idle"){n();t()}})}else{this.manager.renderer.rendering.then(t)}})};r.canceled=(t=e.canceled)!=null?t:false;this.manager.monitor.dispatch("dragend",{nativeEvent:e.event,operation:r.snapshot(),canceled:(n=e.canceled)!=null?n:false,suspend:o});if(a){a.then(s).catch(()=>r.reset())}else{s()}})}};var iu,id,ic,ip,ih,iv,ig,im,i_;ip=[nd],ic=[nd],id=[nd],iu=[nd];var ib=class{/**
   * Creates a new instance of the `Entity` class.
   *
   * @param input - An object containing the initial properties of the entity.
   * @param manager - The manager that controls the drag and drop operations.
   */constructor(e,t){rP(this,iv,rS(ih,8,this)),rS(ih,11,this);rP(this,ig,rS(ih,12,this)),rS(ih,15,this);rP(this,im,rS(ih,16,this)),rS(ih,19,this);rP(this,i_,rS(ih,20,this)),rS(ih,23,this);const{effects:n,id:r,data:i={},disabled:a=false,register:o=true}=e;let s=r;this.manager=t;this.id=r;this.data=i;this.disabled=a;this.effects=()=>{var e;return[()=>{const{id:e,manager:t}=this;if(e===s){return}t==null?void 0:t.registry.register(this);return()=>t==null?void 0:t.registry.unregister(this)},...(e=n==null?void 0:n())!=null?e:[]]};this.register=this.register.bind(this);this.unregister=this.unregister.bind(this);this.destroy=this.destroy.bind(this);if(t&&o){queueMicrotask(this.register)}}/**
   * A method that registers the entity with the manager.
   * @returns CleanupFunction | void
   */register(){var e;return(e=this.manager)==null?void 0:e.registry.register(this)}/**
   * A method that unregisters the entity from the manager.
   * @returns void
   */unregister(){var e;(e=this.manager)==null?void 0:e.registry.unregister(this)}/**
   * A method that cleans up the entity when it is no longer needed.
   * @returns void
   */destroy(){var e;(e=this.manager)==null?void 0:e.registry.unregister(this)}};ih=rI(null);iv=new WeakMap;ig=new WeakMap;im=new WeakMap;i_=new WeakMap;rz(ih,4,"manager",ip,ib,iv);rz(ih,4,"id",ic,ib,ig);rz(ih,4,"data",id,ib,im);rz(ih,4,"disabled",iu,ib,i_);rE(ih,ib);var iy=class{constructor(){this.map=tM(/* @__PURE__ */new Map);this.cleanupFunctions=/* @__PURE__ */new WeakMap;/**
     * Registers a entity in the registry.
     * @param key - The unique identifier of the entity.
     * @param value - The entity to register.
     * @returns A function that unregisters the entity.
     */this.register=(e,t)=>{const n=this.map.peek();const r=n.get(e);const i=()=>this.unregister(e,t);if(r===t)return i;if(r){const e=this.cleanupFunctions.get(r);e==null?void 0:e();this.cleanupFunctions.delete(r)}const a=new Map(n);a.set(e,t);this.map.value=a;const o=nh(...t.effects());this.cleanupFunctions.set(t,o);return i};/**
     * Unregisters an entity from the registry.
     * @param key - The unique identifier of the entity.
     * @param value - The entity instance to unregister.
     */this.unregister=(e,t)=>{const n=this.map.peek();if(n.get(e)!==t){return}const r=this.cleanupFunctions.get(t);r==null?void 0:r();this.cleanupFunctions.delete(t);const i=new Map(n);i.delete(e);this.map.value=i}}/**
   * Iterator for the EntityRegistry class.
   * @returns An iterator for the values in the map.
   */[Symbol.iterator](){return this.map.peek().values()}get value(){return this.map.value.values()}/**
   * Checks if a entity with the given identifier exists in the registry.
   * @param identifier - The unique identifier of the entity.
   * @returns True if the entity exists, false otherwise.
   */has(e){return this.map.value.has(e)}/**
   * Retrieves a entity from the registry using its identifier.
   * @param identifier - The unique identifier of the entity.
   * @returns The entity if it exists, undefined otherwise.
   */get(e){return this.map.value.get(e)}/**
   * Destroys all entries in the registry and clears the registry.
   */destroy(){for(const e of this){const t=this.cleanupFunctions.get(e);t==null?void 0:t();e.destroy()}this.map.value=/* @__PURE__ */new Map}};var iw,ix,iA,iY,ik,iI,iq,iC,iD,iE,iS;var iz=class extends(iq=ib,iI=[nd],ik=[nd],iY=[nd],iA=[nc],ix=[nc],iw=[nc],iq){constructor(e,t){var n=e,{modifiers:r,type:i,sensors:a}=n,o=rk(n,["modifiers","type","sensors"]);super(o,t);rS(iC,5,this);rP(this,iD,rS(iC,8,this)),rS(iC,11,this);rP(this,iE,rS(iC,12,this)),rS(iC,15,this);rP(this,iS,rS(iC,16,this,this.isDragSource?"dragging":"idle")),rS(iC,19,this);this.type=i;this.sensors=a;this.modifiers=r;this.alignment=o.alignment}get isDropping(){return this.status==="dropping"&&this.isDragSource}get isDragging(){return this.status==="dragging"&&this.isDragSource}get isDragSource(){var e,t;return((t=(e=this.manager)==null?void 0:e.dragOperation.source)==null?void 0:t.id)===this.id}};iC=rI(iq);iD=new WeakMap;iE=new WeakMap;iS=new WeakMap;rz(iC,4,"type",iI,iz,iD);rz(iC,4,"modifiers",ik,iz,iE);rz(iC,4,"status",iY,iz,iS);rz(iC,2,"isDropping",iA,iz);rz(iC,2,"isDragging",ix,iz);rz(iC,2,"isDragSource",iw,iz);rE(iC,iz);var iT,iM,iH,iP,iO,iF,iN,iK,iW,iR,iL,iU,iB;var ij=class extends(iN=ib,iF=[nd],iO=[nd],iP=[nd],iH=[nd],iM=[nd],iT=[nc],iN){constructor(e,t){var n=e,{accept:r,collisionDetector:i,collisionPriority:a,type:o}=n,s=rk(n,["accept","collisionDetector","collisionPriority","type"]);super(s,t);rS(iK,5,this);rP(this,iW,rS(iK,8,this)),rS(iK,11,this);rP(this,iR,rS(iK,12,this)),rS(iK,15,this);rP(this,iL,rS(iK,16,this)),rS(iK,19,this);rP(this,iU,rS(iK,20,this)),rS(iK,23,this);rP(this,iB,rS(iK,24,this)),rS(iK,27,this);this.accept=r;this.collisionDetector=i;this.collisionPriority=a;this.type=o}/**
   * Checks whether or not the droppable accepts a given draggable.
   *
   * @param draggable - The draggable to check
   * @returns true if the draggable can be dropped here
   */accepts(e){const{accept:t}=this;if(!t){return true}if(typeof t==="function"){return t(e)}if(!e.type){return false}if(Array.isArray(t)){return t.includes(e.type)}return e.type===t}get isDropTarget(){var e,t;return((t=(e=this.manager)==null?void 0:e.dragOperation.target)==null?void 0:t.id)===this.id}};iK=rI(iN);iW=new WeakMap;iR=new WeakMap;iL=new WeakMap;iU=new WeakMap;iB=new WeakMap;rz(iK,4,"accept",iF,ij,iW);rz(iK,4,"type",iO,ij,iR);rz(iK,4,"collisionDetector",iP,ij,iL);rz(iK,4,"collisionPriority",iH,ij,iU);rz(iK,4,"shape",iM,ij,iB);rz(iK,2,"isDropTarget",iT,ij);rE(iK,ij);// src/core/sensors/sensor.ts
var iV=class extends rj{/**
   * Creates a new sensor instance.
   *
   * @param manager - The drag drop manager instance
   * @param options - Optional sensor configuration
   */constructor(e,t){super(e,t);this.manager=e;this.options=t}};// src/core/sensors/activation.ts
var iQ=class extends AbortController{constructor(e,t){super();this.constraints=e;this.onActivate=t;this.activated=false;for(const t of e!=null?e:[]){t.controller=this}}onEvent(e){var t;if(this.activated)return;if((t=this.constraints)==null?void 0:t.length){for(const t of this.constraints){t.onEvent(e)}}else{this.activate(e)}}activate(e){if(this.activated)return;this.activated=true;this.onActivate(e)}abort(e){this.activated=false;super.abort(e)}};var iG;var i$=class{constructor(e){this.options=e;rP(this,iG)}set controller(e){rO(this,iG,e);e.signal.addEventListener("abort",()=>this.abort())}/**
   * Called when the activation is triggered.
   */activate(e){var t;(t=rH(this,iG))==null?void 0:t.activate(e)}};iG=new WeakMap;// src/core/modifiers/modifier.ts
var iX=class extends rj{/**
   * Creates a new modifier instance.
   *
   * @param manager - The drag and drop manager that owns this modifier
   * @param options - Optional configuration for the modifier
   */constructor(e,t){super(e,t);this.manager=e;this.options=t}/**
   * Applies the modifier to the current drag operation.
   *
   * @param operation - The current state of the drag operation
   * @returns The transformed coordinates
   *
   * @remarks
   * Override this method to implement custom transformation logic.
   * The default implementation returns the original transform unchanged.
   */apply(e){return e.transform}};// src/core/manager/registry.ts
var iZ=class{/**
   * Creates a new registry instance.
   *
   * @param manager - The drag and drop manager that owns this registry
   */constructor(e){/** Registry for draggable entities */this.draggables=new iy;/** Registry for droppable entities */this.droppables=new iy;this.plugins=new rG(e);this.sensors=new rG(e);this.modifiers=new rG(e)}register(e,t){if(e instanceof iz){return this.draggables.register(e.id,e)}if(e instanceof ij){return this.droppables.register(e.id,e)}if(e.prototype instanceof iX){return this.modifiers.register(e,t)}if(e.prototype instanceof iV){return this.sensors.register(e,t)}if(e.prototype instanceof rj){return this.plugins.register(e,t)}throw new Error("Invalid instance type")}unregister(e){if(e instanceof ib){if(e instanceof iz){return this.draggables.unregister(e.id,e)}if(e instanceof ij){return this.droppables.unregister(e.id,e)}return()=>{}}if(e.prototype instanceof iX){return this.modifiers.unregister(e)}if(e.prototype instanceof iV){return this.sensors.unregister(e)}if(e.prototype instanceof rj){return this.plugins.unregister(e)}throw new Error("Invalid instance type")}/**
   * Destroys all registered entities and cleans up resources.
   *
   * @remarks
   * This method:
   * - Destroys all draggable and droppable entities
   * - Destroys all plugins, sensors, and modifiers
   * - Cleans up any associated resources
   */destroy(){this.draggables.destroy();this.droppables.destroy();this.plugins.destroy();this.sensors.destroy();this.modifiers.destroy()}};var iJ,i0,i1,i2,i4,i6,i5,i3,i8,i9,i7,ae,at,an,ar,ai,aa,ao,as;i8=[nc],i3=[nd],i5=[nd],i6=[nd],i4=[nd],i2=[nd],i1=[nc],i0=[nc],iJ=[nc];var al=class{/**
   * Creates a new drag operation instance.
   *
   * @param manager - The drag and drop manager that owns this operation
   */constructor(e){rS(at,5,this);rP(this,i9);rP(this,i7);rP(this,ae,new nM(void 0,(e,t)=>e&&t?e.equals(t):e===t));/** Current status of the drag operation */this.status=new is;rP(this,an,rS(at,8,this,false)),rS(at,11,this);rP(this,ar,rS(at,12,this,null)),rS(at,15,this);rP(this,ai,rS(at,16,this,null)),rS(at,19,this);rP(this,aa,rS(at,20,this,null)),rS(at,23,this);rP(this,ao,rS(at,24,this,[])),rS(at,27,this);/** Current position of the dragged entity */this.position=new rs({x:0,y:0});rP(this,as,{x:0,y:0});rO(this,i9,e)}get shape(){const{current:e,initial:t,previous:n}=rH(this,ae);if(!e||!t){return null}return{current:e,initial:t,previous:n}}/**
   * Sets the shape of the dragged entity.
   *
   * @param value - The new shape or null to reset
   */set shape(e){if(!e){rH(this,ae).reset()}else{rH(this,ae).current=e}}get source(){var e;const t=this.sourceIdentifier;if(t==null)return null;const n=rH(this,i9).registry.draggables.get(t);if(n){rO(this,i7,n)}return(e=n!=null?n:rH(this,i7))!=null?e:null}get target(){var e;const t=this.targetIdentifier;return t!=null?(e=rH(this,i9).registry.droppables.get(t))!=null?e:null:null}get transform(){const{x:e,y:t}=this.position.delta;let n={x:e,y:t};for(const e of this.modifiers){n=e.apply(rA(rx({},this.snapshot()),{transform:n}))}rO(this,as,n);return n}/**
   * Creates a snapshot of the current drag operation state.
   *
   * @returns An immutable snapshot of the current operation state
   */snapshot(){return tq(()=>({source:this.source,target:this.target,activatorEvent:this.activatorEvent,transform:rH(this,as),shape:this.shape?nH(this.shape):null,position:nH(this.position),status:nH(this.status),canceled:this.canceled}))}/**
   * Resets the drag operation to its initial state.
   *
   * @remarks
   * This method:
   * - Sets status to idle
   * - Clears source and target identifiers
   * - Resets shape history
   * - Resets position and transform
   * - Clears modifiers
   */reset(){tk(()=>{this.status.set("idle"/* Idle */);this.sourceIdentifier=null;this.targetIdentifier=null;rH(this,ae).reset();this.position.reset({x:0,y:0});rO(this,as,{x:0,y:0});this.modifiers=[]})}};at=rI(null);i9=new WeakMap;i7=new WeakMap;ae=new WeakMap;an=new WeakMap;ar=new WeakMap;ai=new WeakMap;aa=new WeakMap;ao=new WeakMap;as=new WeakMap;rz(at,2,"shape",i8,al);rz(at,4,"canceled",i3,al,an);rz(at,4,"activatorEvent",i5,al,ar);rz(at,4,"sourceIdentifier",i6,al,ai);rz(at,4,"targetIdentifier",i4,al,aa);rz(at,4,"modifiers",i2,al,ao);rz(at,2,"source",i1,al);rz(at,2,"target",i0,al);rz(at,2,"transform",iJ,al);rE(at,al);// src/core/manager/renderer.ts
var au={get rendering(){return Promise.resolve()}};// src/core/manager/manager.ts
function ad(e,t){if(typeof e==="function"){return e(t)}return e!=null?e:t}var ac=class{/**
   * Creates a new drag and drop manager instance.
   *
   * @param config - Optional configuration for plugins, sensors, modifiers, and renderer
   */constructor(e){/**
     * Cleans up resources and stops any active drag operations.
     */this.destroy=()=>{if(!this.dragOperation.status.idle){this.actions.stop({canceled:true})}this.dragOperation.modifiers.forEach(e=>e.destroy());this.registry.destroy();this.collisionObserver.destroy()};var t;const n=e!=null?e:{};const r=ad(n.plugins,[]);const i=ad(n.sensors,[]);const a=ad(n.modifiers,[]);const o=(t=n.renderer)!=null?t:au;const s=new r2(this);const l=new iZ(this);this.registry=l;this.monitor=s;this.renderer=o;this.actions=new il(this);this.dragOperation=new al(this);this.collisionObserver=new r0(this);this.plugins=[r6,...r];this.modifiers=a;this.sensors=i;const{destroy:u}=this;const d=nh(()=>{var e,t,n;const r=tq(()=>this.dragOperation.modifiers);const i=this.modifiers;for(const e of r){if(!i.includes(e)){e.destroy()}}this.dragOperation.modifiers=(n=(t=(e=this.dragOperation.source)==null?void 0:e.modifiers)==null?void 0:t.map(e=>{const{plugin:t,options:n}=rW(e);return new t(this,n)}))!=null?n:i});this.destroy=()=>{d();u()}}/**
   * Gets the list of active plugins.
   *
   * @returns Array of active plugin instances
   */get plugins(){return this.registry.plugins.values}/**
   * Sets the list of plugins to be used by the manager.
   *
   * @param plugins - Array of plugin constructors or instances
   */set plugins(e){this.registry.plugins.values=e}/**
   * Gets the list of active modifiers.
   *
   * @returns Array of active modifier instances
   */get modifiers(){return this.registry.modifiers.values}/**
   * Sets the list of modifiers to be used by the manager.
   *
   * @param modifiers - Array of modifier constructors or instances
   */set modifiers(e){this.registry.modifiers.values=e}/**
   * Gets the list of active sensors.
   *
   * @returns Array of active sensor instances
   */get sensors(){return this.registry.sensors.values}/**
   * Sets the list of sensors to be used by the manager.
   *
   * @param sensors - Array of sensor constructors or instances
   */set sensors(e){this.registry.sensors.values=e}};//# sourceMappingURL=index.js.map
//# sourceMappingURL=index.js.map
;// CONCATENATED MODULE: ./node_modules/.pnpm/@dnd-kit+dom@0.3.2/node_modules/@dnd-kit/dom/utilities.js
var ap=e=>{throw TypeError(e)};var ah=(e,t,n)=>t.has(e)||ap("Cannot "+n);var av=(e,t,n)=>(ah(e,t,"read from private field"),t.get(e));var af=(e,t,n)=>t.has(e)?ap("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n);var ag=(e,t,n,r)=>(ah(e,t,"write to private field"),t.set(e,n),n);var am=(e,t,n)=>(ah(e,t,"access private method"),n);// src/utilities/type-guards/isKeyframeEffect.ts
function a_(e){if(!e)return false;if(e instanceof KeyframeEffect)return true;return"getKeyframes"in e&&typeof e.getKeyframes==="function"}// src/utilities/animations/getFinalKeyframe.ts
function ab(e,t){const n=e.getAnimations();if(n.length>0){for(const e of n){if(e.playState!=="running")continue;const{effect:n}=e;const r=a_(n)?n.getKeyframes():[];const i=r.filter(t);if(i.length>0){return[i[i.length-1],e]}}}return null}// src/utilities/bounding-rectangle/getBoundingRectangle.ts
function ay(e){const{width:t,height:n,top:r,left:i,bottom:a,right:o}=e.getBoundingClientRect();return{width:t,height:n,top:r,left:i,bottom:a,right:o}}// src/utilities/type-guards/isWindow.ts
function aw(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]"}// src/utilities/type-guards/isNode.ts
function ax(e){return"nodeType"in e}// src/utilities/execution-context/getWindow.ts
function aA(e){var t,n,r;if(!e){return window}if(aw(e)){return e}if(!ax(e)){return window}if("defaultView"in e){return(t=e.defaultView)!=null?t:window}return(r=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?r:window}// src/utilities/type-guards/isDocument.ts
function aY(e){const{Document:t}=aA(e);return e instanceof t||"nodeType"in e&&e.nodeType===Node.DOCUMENT_NODE}// src/utilities/type-guards/isHTMLElement.ts
function ak(e){if(!e||aw(e))return false;return e instanceof aA(e).HTMLElement||"namespaceURI"in e&&typeof e.namespaceURI==="string"&&e.namespaceURI.endsWith("html")}// src/utilities/type-guards/isSVGElement.ts
function aI(e){return e instanceof aA(e).SVGElement||"namespaceURI"in e&&typeof e.namespaceURI==="string"&&e.namespaceURI.endsWith("svg")}// src/utilities/execution-context/getDocument.ts
function aq(e){if(!e){return document}if(aw(e)){return e.document}if(!ax(e)){return document}if(aY(e)){return e}if(ak(e)||aI(e)){return e.ownerDocument}return document}// src/utilities/bounding-rectangle/getViewportBoundingRectangle.ts
function aC(e){var t,n,r,i;const{documentElement:a}=aq(e);const o=aA(e).visualViewport;const s=(t=o==null?void 0:o.width)!=null?t:a.clientWidth;const l=(n=o==null?void 0:o.height)!=null?n:a.clientHeight;const u=(r=o==null?void 0:o.offsetTop)!=null?r:0;const d=(i=o==null?void 0:o.offsetLeft)!=null?i:0;return{top:u,left:d,right:d+s,bottom:u+l,width:s,height:l}}// src/utilities/bounding-rectangle/isOverflowVisible.ts
function aD(e,t){if(aE(e)&&e.open===false){return false}const{overflow:n,overflowX:r,overflowY:i}=getComputedStyle(e);return n==="visible"&&r==="visible"&&i==="visible"}function aE(e){return e.tagName==="DETAILS"}// src/utilities/bounding-rectangle/getVisibleBoundingRectangle.ts
function aS(e,t=e.getBoundingClientRect(),n=0){var r,i,a,o,s;let l=t;const{ownerDocument:u}=e;const d=(r=u.defaultView)!=null?r:window;let c=e.parentElement;while(c&&c!==u.documentElement){if(!aD(c)){const e=c.getBoundingClientRect();const t=n*(e.bottom-e.top);const r=n*(e.right-e.left);const i=n*(e.bottom-e.top);const a=n*(e.right-e.left);l={top:Math.max(l.top,e.top-t),right:Math.min(l.right,e.right+r),bottom:Math.min(l.bottom,e.bottom+i),left:Math.max(l.left,e.left-a),width:0,// Will be calculated next
height:0};l.width=l.right-l.left;l.height=l.bottom-l.top}c=c.parentElement}const p=d.visualViewport;const h=(i=p==null?void 0:p.offsetTop)!=null?i:0;const v=(a=p==null?void 0:p.offsetLeft)!=null?a:0;const f=(o=p==null?void 0:p.width)!=null?o:d.innerWidth;const g=(s=p==null?void 0:p.height)!=null?s:d.innerHeight;const m=n*g;const _=n*f;l={top:Math.max(l.top,h-m),right:Math.min(l.right,v+f+_),bottom:Math.min(l.bottom,h+g+m),left:Math.max(l.left,v-_),width:0,// Will be calculated next
height:0};l.width=l.right-l.left;l.height=l.bottom-l.top;if(l.width<0){l.width=0}if(l.height<0){l.height=0}return l}// src/utilities/coordinates/getEventCoordinates.ts
function az(e){return{x:e.clientX,y:e.clientY}}// src/utilities/execution-context/canUseDOM.ts
var aT=typeof window!=="undefined"&&typeof window.document!=="undefined"&&typeof window.document.createElement!=="undefined";// src/utilities/execution-context/getDocuments.ts
function aM(e=document,t=/* @__PURE__ */new Set){if(t.has(e))return[];t.add(e);const n=[e];for(const r of Array.from(e.querySelectorAll("iframe, frame"))){try{const e=r.contentDocument;if(e&&!t.has(e)){n.push(...aM(e,t))}}catch(e){}}try{const r=e.defaultView;if(r&&r!==window.top){const i=r.parent;if(i&&i.document&&i.document!==e){n.push(...aM(i.document,t))}}}catch(e){}return n}// src/utilities/execution-context/isSafari.ts
function aH(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}// src/utilities/execution-context/getFixedPositionOffset.ts
function aP(){var e,t;const n=aH()?window.visualViewport:null;return{x:(e=n==null?void 0:n.offsetLeft)!=null?e:0,y:(t=n==null?void 0:n.offsetTop)!=null?t:0}}// src/utilities/type-guards/isShadowRoot.ts
function aO(e){if(!e||!ax(e))return false;return e instanceof aA(e).ShadowRoot}// src/utilities/execution-context/getRoot.ts
function aF(e){if(e&&ax(e)){let t=e.getRootNode();if(aO(t)){return t}else if(t instanceof Document){return t}}return aq(e)}// src/utilities/execution-context/prefersReducedMotion.ts
function aN(e){return e.matchMedia("(prefers-reduced-motion: reduce)").matches}// src/utilities/element/cloneElement.ts
function aK(e){const t="input, textarea, select, canvas, [contenteditable]";const n=e.cloneNode(true);const r=Array.from(e.querySelectorAll(t));const i=Array.from(n.querySelectorAll(t));i.forEach((e,t)=>{const n=r[t];if(aW(e)&&aW(n)){if(e.type!=="file"){e.value=n.value}if(e.type==="radio"&&e.name){e.name=`Cloned__${e.name}`}}if(aR(e)&&aR(n)&&n.width>0&&n.height>0){const t=e.getContext("2d");t==null?void 0:t.drawImage(n,0,0)}});return n}function aW(e){return"value"in e}function aR(e){return e.tagName==="CANVAS"}// src/utilities/element/getElementFromPoint.ts
function aL(e,{x:t,y:n}){const r=e.elementFromPoint(t,n);if(aU(r)){const{contentDocument:e}=r;if(e){const{left:i,top:a}=r.getBoundingClientRect();return aL(e,{x:t-i,y:n-a})}}return r}function aU(e){return(e==null?void 0:e.tagName)==="IFRAME"}// src/utilities/element/proxiedElements.ts
var aB=/* @__PURE__ */new WeakMap;// src/utilities/element/isInteractiveElement.ts
function aj(e){return Boolean(e.closest(`
      input:not([disabled]),
      select:not([disabled]),
      textarea:not([disabled]),
      button:not([disabled]),
      a[href],
      [contenteditable]:not([contenteditable="false"])
    `))}// src/utilities/event-listeners/Listeners.ts
var aV=class{constructor(){this.entries=/* @__PURE__ */new Set;this.clear=()=>{for(const e of this.entries){const[t,{type:n,listener:r,options:i}]=e;t.removeEventListener(n,r,i)}this.entries.clear()}}bind(e,t){const n=Array.isArray(e)?e:[e];const r=Array.isArray(t)?t:[t];const i=[];for(const e of n){for(const t of r){const{type:n,listener:r,options:a}=t;const o=[e,t];e.addEventListener(n,r,a);this.entries.add(o);i.push(o)}}return function e(){for(const[e,{type:t,listener:n,options:r}]of i){e.removeEventListener(t,n,r)}}}};// src/utilities/frame/getFrameElement.ts
function aQ(e){const t=e==null?void 0:e.ownerDocument.defaultView;if(t&&t.self!==t.parent){return t.frameElement}}// src/utilities/frame/getFrameElements.ts
function aG(e){const t=/* @__PURE__ */new Set;let n=aQ(e);while(n){t.add(n);n=aQ(n)}return t}// src/utilities/scheduling/timeout.ts
function a$(e,t){const n=setTimeout(e,t);return()=>clearTimeout(n)}// src/utilities/scheduling/throttle.ts
function aX(e,t){const n=()=>performance.now();let r;let i;return function(...a){const o=this;if(!i){e.apply(o,a);i=n()}else{r==null?void 0:r();r=a$(()=>{e.apply(o,a);i=n()},t-(n()-i))}}}// src/utilities/bounding-rectangle/isRectEqual.ts
function aZ(e,t){if(e===t)return true;if(!e||!t)return false;return e.top==t.top&&e.left==t.left&&e.right==t.right&&e.bottom==t.bottom}// src/utilities/bounding-rectangle/isVisible.ts
function aJ(e,t=e.getBoundingClientRect()){const{width:n,height:r}=aS(e,t);return n>0&&r>0}// src/utilities/observers/ResizeNotifier.ts
var a0=aT?ResizeObserver:class e{observe(){}unobserve(){}disconnect(){}};var a1;var a2=class extends a0{constructor(e){super(t=>{if(!av(this,a1)){ag(this,a1,true);return}e(t,this)});af(this,a1,false)}};a1=new WeakMap;// src/utilities/observers/PositionObserver.ts
var a4=Array.from({length:100},(e,t)=>t/100);var a6=75;var a5,a3,a8,a9,a7,oe,ot,on,or,oi,oa;var oo=class{constructor(e,t,n={debug:false,skipInitial:false}){this.element=e;this.callback=t;af(this,or);this.disconnect=()=>{var e,t,n;ag(this,ot,true);(e=av(this,a8))==null?void 0:e.disconnect();(t=av(this,a9))==null?void 0:t.disconnect();av(this,a7).disconnect();(n=av(this,oe))==null?void 0:n.remove()};af(this,a5,true);af(this,a3);af(this,a8);af(this,a9);af(this,a7);af(this,oe);af(this,ot,false);af(this,on,aX(()=>{var e,t,n;const{element:r}=this;(e=av(this,a9))==null?void 0:e.disconnect();if(av(this,ot)||!av(this,a5)||!r.isConnected){return}const i=(t=r.ownerDocument)!=null?t:document;const{innerHeight:a,innerWidth:o}=(n=i.defaultView)!=null?n:window;const s=r.getBoundingClientRect();const l=aS(r,s);const{top:u,left:d,bottom:c,right:p}=l;const h=-Math.floor(u);const v=-Math.floor(d);const f=-Math.floor(o-p);const g=-Math.floor(a-c);const m=`${h}px ${f}px ${g}px ${v}px`;this.boundingClientRect=s;ag(this,a9,new IntersectionObserver(e=>{const[t]=e;const{intersectionRect:n}=t;const i=t.intersectionRatio!==1?t.intersectionRatio:re.intersectionRatio(n,aS(r));if(i!==1){av(this,on).call(this)}},{threshold:a4,rootMargin:m,root:i}));av(this,a9).observe(r);am(this,or,oi).call(this)},a6));this.boundingClientRect=e.getBoundingClientRect();ag(this,a5,aJ(e,this.boundingClientRect));let r=true;this.callback=e=>{if(r){r=false;if(n.skipInitial)return}t(e)};const i=e.ownerDocument;if(n==null?void 0:n.debug){ag(this,oe,document.createElement("div"));av(this,oe).style.background="rgba(0,0,0,0.15)";av(this,oe).style.position="fixed";av(this,oe).style.pointerEvents="none";i.body.appendChild(av(this,oe))}ag(this,a7,new IntersectionObserver(t=>{var n,r;const i=t[t.length-1];const{boundingClientRect:a,isIntersecting:o}=i;const{width:s,height:l}=a;const u=av(this,a5);ag(this,a5,o);if(!s&&!l)return;if(u&&!o){(n=av(this,a9))==null?void 0:n.disconnect();this.callback(null);(r=av(this,a8))==null?void 0:r.disconnect();ag(this,a8,void 0);if(av(this,oe))av(this,oe).style.visibility="hidden"}else{av(this,on).call(this)}if(o&&!av(this,a8)){ag(this,a8,new a2(av(this,on)));av(this,a8).observe(e)}},{threshold:a4,root:i}));if(av(this,a5)&&!n.skipInitial){this.callback(this.boundingClientRect)}av(this,a7).observe(e)}};a5=new WeakMap;a3=new WeakMap;a8=new WeakMap;a9=new WeakMap;a7=new WeakMap;oe=new WeakMap;ot=new WeakMap;on=new WeakMap;or=new WeakSet;oi=function(){if(av(this,ot))return;am(this,or,oa).call(this);if(aZ(this.boundingClientRect,av(this,a3)))return;this.callback(this.boundingClientRect);ag(this,a3,this.boundingClientRect)};oa=function(){if(av(this,oe)){const{top:e,left:t,width:n,height:r}=aS(this.element);av(this,oe).style.overflow="hidden";av(this,oe).style.visibility="visible";av(this,oe).style.top=`${Math.floor(e)}px`;av(this,oe).style.left=`${Math.floor(t)}px`;av(this,oe).style.width=`${Math.floor(n)}px`;av(this,oe).style.height=`${Math.floor(r)}px`}};// src/utilities/observers/FrameObserver.ts
var os=/* @__PURE__ */new WeakMap;var ol=/* @__PURE__ */new WeakMap;function ou(e,t){let n=os.get(e);if(!n){const t=new oo(e,t=>{const n=os.get(e);if(!n)return;n.callbacks.forEach(e=>e(t))},{skipInitial:true});n={disconnect:t.disconnect,callbacks:/* @__PURE__ */new Set}}n.callbacks.add(t);os.set(e,n);return()=>{n.callbacks.delete(t);if(n.callbacks.size===0){os.delete(e);n.disconnect()}}}function od(e,t){const n=/* @__PURE__ */new Set;for(const r of e){const e=ou(r,t);n.add(e)}return()=>n.forEach(e=>e())}function oc(e,t){var n;const r=e.ownerDocument;if(!ol.has(r)){const e=new AbortController;const t=/* @__PURE__ */new Set;document.addEventListener("scroll",e=>t.forEach(t=>t(e)),{capture:true,passive:true,signal:e.signal});ol.set(r,{disconnect:()=>e.abort(),listeners:t})}const{listeners:i,disconnect:a}=(n=ol.get(r))!=null?n:{};if(!i||!a)return()=>{};i.add(t);return()=>{i.delete(t);if(i.size===0){a();ol.delete(r)}}}var op,oh,ov,of;var og=class{constructor(e,t,n){this.callback=t;af(this,op);af(this,oh,false);af(this,ov);af(this,of,aX(e=>{if(av(this,oh))return;if(!e.target)return;if("contains"in e.target&&typeof e.target.contains==="function"){for(const t of av(this,ov)){if(e.target.contains(t)){this.callback(av(this,op).boundingClientRect);break}}}},a6));const r=aG(e);const i=od(r,t);const a=oc(e,av(this,of));ag(this,ov,r);ag(this,op,new oo(e,t,n));this.disconnect=()=>{if(av(this,oh))return;ag(this,oh,true);i();a();av(this,op).disconnect()}}};op=new WeakMap;oh=new WeakMap;ov=new WeakMap;of=new WeakMap;// src/utilities/popover/supportsPopover.ts
function om(e){return"showPopover"in e&&"hidePopover"in e&&typeof e.showPopover==="function"&&typeof e.hidePopover==="function"}// src/utilities/popover/showPopover.ts
function o_(e){try{if(om(e)&&e.isConnected&&e.hasAttribute("popover")&&// This selector can throw an error in browsers that don't support it
!e.matches(":popover-open")){e.showPopover()}}catch(e){}}// src/utilities/popover/hidePopover.ts
function ob(e){try{if(om(e)&&e.isConnected&&e.hasAttribute("popover")&&// This selector can throw an error in browsers that don't support it
e.matches(":popover-open")){e.hidePopover()}}catch(e){}}// src/utilities/scroll/documentScrollingElement.ts
function oy(e){if(!aT||!e){return false}return e===aq(e).scrollingElement}// src/utilities/scroll/getScrollPosition.ts
function ow(e){var t,n;const r=aA(e);const i=oy(e)?aC(e):ay(e);const a=r.visualViewport;const o=oy(e)?{height:(t=a==null?void 0:a.height)!=null?t:r.innerHeight,width:(n=a==null?void 0:a.width)!=null?n:r.innerWidth}:{height:e.clientHeight,width:e.clientWidth};const s={current:{x:e.scrollLeft,y:e.scrollTop},max:{x:e.scrollWidth-o.width,y:e.scrollHeight-o.height}};const l=s.current.y<=0;const u=s.current.x<=0;const d=s.current.y>=s.max.y;const c=s.current.x>=s.max.x;return{rect:i,position:s,isTop:l,isLeft:u,isBottom:d,isRight:c}}// src/utilities/scroll/canScroll.ts
function ox(e,t){const{isTop:n,isBottom:r,isLeft:i,isRight:a,position:o}=ow(e);const{x:s,y:l}=t!=null?t:{x:0,y:0};const u=!n&&o.current.y+l>0;const d=!r&&o.current.y+l<o.max.y;const c=!i&&o.current.x+s>0;const p=!a&&o.current.x+s<o.max.x;return{top:u,bottom:d,left:c,right:p,x:c||p,y:u||d}}// src/utilities/scheduling/scheduler.ts
var oA=class{constructor(e){this.scheduler=e;this.pending=false;this.tasks=/* @__PURE__ */new Set;this.resolvers=/* @__PURE__ */new Set;this.flush=()=>{const{tasks:e,resolvers:t}=this;this.pending=false;this.tasks=/* @__PURE__ */new Set;this.resolvers=/* @__PURE__ */new Set;for(const t of e){t()}for(const e of t){e()}}}schedule(e){this.tasks.add(e);if(!this.pending){this.pending=true;this.scheduler(this.flush)}return new Promise(e=>this.resolvers.add(e))}};var oY=new oA(e=>{if(typeof requestAnimationFrame==="function"){requestAnimationFrame(e)}else{e()}});// src/utilities/styles/getComputedStyles.ts
var ok=new oA(e=>setTimeout(e,50));var oI=/* @__PURE__ */new Map;var oq=oI.clear.bind(oI);function oC(e,t=false){if(!t)return oD(e);let n=oI.get(e);if(n)return n;n=oD(e);oI.set(e,n);ok.schedule(oq);return n}function oD(e){return aA(e).getComputedStyle(e)}// src/utilities/scroll/isFixed.ts
function oE(e,t=oC(e,true)){return t.position==="fixed"||t.position==="sticky"}// src/utilities/scroll/isScrollable.ts
function oS(e,t=oC(e,true)){const n=/(auto|scroll|overlay)/;const r=["overflow","overflowX","overflowY"];return r.some(e=>{const r=t[e];return typeof r==="string"?n.test(r):false})}// src/utilities/scroll/getScrollableAncestors.ts
var oz={excludeElement:true,escapeShadowDOM:true};function oT(e,t=oz){const{limit:n,excludeElement:r,escapeShadowDOM:i}=t;const a=/* @__PURE__ */new Set;function o(t){if(n!=null&&a.size>=n){return a}if(!t){return a}if(aY(t)&&t.scrollingElement!=null&&!a.has(t.scrollingElement)){a.add(t.scrollingElement);return a}if(i&&aO(t)){return o(t.host)}if(!ak(t)){if(aI(t)){return o(t.parentElement)}return a}if(a.has(t)){return a}const s=oC(t,true);if(r&&t===e);else if(oS(t,s)){a.add(t)}if(oE(t,s)){const{scrollingElement:e}=t.ownerDocument;if(e)a.add(e);return a}return o(t.parentNode)}if(!e){return a}return o(e)}function oM(e){const[t]=oT(e,{limit:1});return t!=null?t:null}// src/utilities/frame/getFrameTransform.ts
function oH(e,t=window.frameElement){const n={x:0,y:0,scaleX:1,scaleY:1};if(!e)return n;let r=aQ(e);while(r){if(r===t){return n}const e=ay(r);const{x:i,y:a}=oP(r,e);n.x=n.x+e.left;n.y=n.y+e.top;n.scaleX=n.scaleX*i;n.scaleY=n.scaleY*a;r=aQ(r)}return n}function oP(e,t=ay(e)){const n=Math.round(t.width);const r=Math.round(t.height);if(ak(e)){return{x:n/e.offsetWidth,y:r/e.offsetHeight}}const i=oC(e,true);return{x:(parseFloat(i.width)||n)/n,y:(parseFloat(i.height)||r)/r}}// src/utilities/transform/parseScale.ts
function oO(e){if(e==="none"){return null}const t=e.split(" ");const n=parseFloat(t[0]);const r=parseFloat(t[1]);if(isNaN(n)&&isNaN(r)){return null}return{x:isNaN(n)?r:n,y:isNaN(r)?n:r}}// src/utilities/transform/parseTranslate.ts
function oF(e){if(e==="none"){return null}const[t,n,r="0"]=e.split(" ");const i={x:parseFloat(t),y:parseFloat(n),z:parseInt(r,10)};if(isNaN(i.x)&&isNaN(i.y)){return null}return{x:isNaN(i.x)?0:i.x,y:isNaN(i.y)?0:i.y,z:isNaN(i.z)?0:i.z}}// src/utilities/transform/parseTransform.ts
function oN(e){var t,n,r,i,a,o,s,l,u;const{scale:d,transform:c,translate:p}=e;const h=oO(d);const v=oF(p);const f=oK(c);if(!f&&!h&&!v){return null}const g={x:(t=h==null?void 0:h.x)!=null?t:1,y:(n=h==null?void 0:h.y)!=null?n:1};const m={x:(r=v==null?void 0:v.x)!=null?r:0,y:(i=v==null?void 0:v.y)!=null?i:0};const _={x:(a=f==null?void 0:f.x)!=null?a:0,y:(o=f==null?void 0:f.y)!=null?o:0,scaleX:(s=f==null?void 0:f.scaleX)!=null?s:1,scaleY:(l=f==null?void 0:f.scaleY)!=null?l:1};return{x:m.x+_.x,y:m.y+_.y,z:(u=v==null?void 0:v.z)!=null?u:0,scaleX:g.x*_.scaleX,scaleY:g.y*_.scaleY}}function oK(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}// src/utilities/scroll/detectScrollIntent.ts
var oW=/* @__PURE__ */(e=>{e[e["Idle"]=0]="Idle";e[e["Forward"]=1]="Forward";e[e["Reverse"]=-1]="Reverse";return e})(oW||{});var oR={x:.2,y:.2};var oL={x:10,y:10};function oU(e,t,n,r=25,i=oR,a=oL){const{x:o,y:s}=t;const{rect:l,isTop:u,isBottom:d,isLeft:c,isRight:p}=ow(e);const h=oH(e);const v=oC(e,true);const f=oN(v);const g=f!==null?(f==null?void 0:f.scaleX)<0:false;const m=f!==null?(f==null?void 0:f.scaleY)<0:false;const _=new re(l.left*h.scaleX+h.x,l.top*h.scaleY+h.y,l.width*h.scaleX,l.height*h.scaleY);const b={x:0/* Idle */,y:0/* Idle */};const y={x:0,y:0};const w={height:_.height*i.y,width:_.width*i.x};if((!u||m&&!d)&&s<=_.top+w.height&&(n==null?void 0:n.y)!==1/* Forward */&&o>=_.left-a.x&&o<=_.right+a.x){b.y=m?1/* Forward */:-1/* Reverse */;y.y=r*Math.abs((_.top+w.height-s)/w.height)}else if((!d||m&&!u)&&s>=_.bottom-w.height&&(n==null?void 0:n.y)!==-1/* Reverse */&&o>=_.left-a.x&&o<=_.right+a.x){b.y=m?-1/* Reverse */:1/* Forward */;y.y=r*Math.abs((_.bottom-w.height-s)/w.height)}if((!p||g&&!c)&&o>=_.right-w.width&&(n==null?void 0:n.x)!==-1/* Reverse */&&s>=_.top-a.y&&s<=_.bottom+a.y){b.x=g?-1/* Reverse */:1/* Forward */;y.x=r*Math.abs((_.right-w.width-o)/w.width)}else if((!c||g&&!p)&&o<=_.left+w.width&&(n==null?void 0:n.x)!==1/* Forward */&&s>=_.top-a.y&&s<=_.bottom+a.y){b.x=g?1/* Forward */:-1/* Reverse */;y.x=r*Math.abs((_.left+w.width-o)/w.width)}return{direction:b,speed:y}}// src/utilities/scroll/scrollIntoViewIfNeeded.ts
function oB(e){return"scrollIntoViewIfNeeded"in e&&typeof e.scrollIntoViewIfNeeded==="function"}function oj(e,t=false){if(oB(e)){e.scrollIntoViewIfNeeded(t);return}if(!ak(e)){return e.scrollIntoView()}var n=oM(e);if(!ak(n)){return}const r=oC(n,true),i=parseInt(r.getPropertyValue("border-top-width")),a=parseInt(r.getPropertyValue("border-left-width")),o=e.offsetTop-n.offsetTop<n.scrollTop,s=e.offsetTop-n.offsetTop+e.clientHeight-i>n.scrollTop+n.clientHeight,l=e.offsetLeft-n.offsetLeft<n.scrollLeft,u=e.offsetLeft-n.offsetLeft+e.clientWidth-a>n.scrollLeft+n.clientWidth,d=o&&!s;if((o||s)&&t){n.scrollTop=e.offsetTop-n.offsetTop-n.clientHeight/2-i+e.clientHeight/2}if((l||u)&&t){n.scrollLeft=e.offsetLeft-n.offsetLeft-n.clientWidth/2-a+e.clientWidth/2}if((o||s||l||u)&&!t){e.scrollIntoView(d)}}// src/utilities/transform/applyTransform.ts
function oV(e,t,n){const{scaleX:r,scaleY:i,x:a,y:o}=t;const s=e.left+a+(1-r)*parseFloat(n);const l=e.top+o+(1-i)*parseFloat(n.slice(n.indexOf(" ")+1));const u=r?e.width*r:e.width;const d=i?e.height*i:e.height;return{width:u,height:d,top:l,right:s+u,bottom:l+d,left:s}}// src/utilities/transform/inverseTransform.ts
function oQ(e,t,n){const{scaleX:r,scaleY:i,x:a,y:o}=t;const s=e.left-a-(1-r)*parseFloat(n);const l=e.top-o-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1));const u=r?e.width/r:e.width;const d=i?e.height/i:e.height;return{width:u,height:d,top:l,right:s+u,bottom:l+d,left:s}}// src/utilities/transform/animateTransform.ts
function oG({element:e,keyframes:t,options:n}){return e.animate(t,n).finished}// src/utilities/transform/computeTranslate.ts
function o$(e,t=oC(e).translate,n=true){if(n){const t=ab(e,e=>"translate"in e);if(t){const{translate:e=""}=t[0];if(typeof e==="string"){const t=oF(e);if(t){return t}}}}if(t){const e=oF(t);if(e){return e}}return{x:0,y:0,z:0}}// src/utilities/animations/forceFinishAnimations.ts
var oX=new oA(e=>setTimeout(e,0));var oZ=/* @__PURE__ */new Map;var oJ=oZ.clear.bind(oZ);function o0(e){const t=e.ownerDocument;let n=oZ.get(t);if(n)return n;n=t.getAnimations();oZ.set(t,n);oX.schedule(oJ);const r=n.filter(t=>a_(t.effect)&&t.effect.target===e);oZ.set(e,r);return n}function o1(e,t){const n=o0(e).filter(e=>{var n,r;if(a_(e.effect)){const{target:i}=e.effect;const a=(r=i&&((n=t.isValidTarget)==null?void 0:n.call(t,i)))!=null?r:true;if(a){return e.effect.getKeyframes().some(e=>{for(const n of t.properties){if(e[n])return true}})}}}).map(e=>{const{effect:t,currentTime:n}=e;const r=t==null?void 0:t.getComputedTiming().duration;if(e.pending||e.playState==="finished")return;if(typeof r=="number"&&typeof n=="number"&&n<r){e.currentTime=r;return()=>{e.currentTime=n}}});if(n.length>0){return()=>n.forEach(e=>e==null?void 0:e())}}// src/utilities/shapes/DOMRectangle.ts
var o2=class extends re{constructor(e,t={}){var n,r,i,a;const{frameTransform:o=oH(e),ignoreTransforms:s,getBoundingClientRect:l=ay}=t;const u=o1(e,{properties:["transform","translate","scale","width","height"],isValidTarget:t=>(t!==e||aH())&&t.contains(e)});const d=l(e);let{top:c,left:p,width:h,height:v}=d;let f;const g=oC(e);const m=oN(g);const _={x:(n=m==null?void 0:m.scaleX)!=null?n:1,y:(r=m==null?void 0:m.scaleY)!=null?r:1};const b=o4(e,g);u==null?void 0:u();if(m){f=oQ(d,m,g.transformOrigin);if(s||b){c=f.top;p=f.left;h=f.width;v=f.height}}const y={width:(i=f==null?void 0:f.width)!=null?i:h,height:(a=f==null?void 0:f.height)!=null?a:v};if(b&&!s&&f){const e=oV(f,b,g.transformOrigin);c=e.top;p=e.left;h=e.width;v=e.height;_.x=b.scaleX;_.y=b.scaleY}if(o){if(!s){p*=o.scaleX;h*=o.scaleX;c*=o.scaleY;v*=o.scaleY}p+=o.x;c+=o.y}super(p,c,h,v);this.scale=_;this.intrinsicWidth=y.width;this.intrinsicHeight=y.height}};function o4(e,t){var n;const r=e.getAnimations();let i=null;if(!r.length)return null;for(const e of r){if(e.playState!=="running")continue;const r=a_(e.effect)?e.effect.getKeyframes():[];const a=r[r.length-1];if(!a)continue;const{transform:o,translate:s,scale:l}=a;if(o||s||l){const e=oN({transform:typeof o==="string"&&o?o:t.transform,translate:typeof s==="string"&&s?s:t.translate,scale:typeof l==="string"&&l?l:t.scale});if(e){i=i?{x:i.x+e.x,y:i.y+e.y,z:(n=i.z)!=null?n:e.z,scaleX:i.scaleX*e.scaleX,scaleY:i.scaleY*e.scaleY}:e}}}return i}// src/utilities/type-guards/supportsStyle.ts
function o6(e){return"style"in e&&typeof e.style==="object"&&e.style!==null&&"setProperty"in e.style&&"removeProperty"in e.style&&typeof e.style.setProperty==="function"&&typeof e.style.removeProperty==="function"}// src/utilities/styles/Styles.ts
var o5=class{constructor(e){this.element=e;this.initial=/* @__PURE__ */new Map}set(e,t=""){const{element:n}=this;if(!o6(n)){return}for(const[r,i]of Object.entries(e)){const e=`${t}${r}`;if(!this.initial.has(e)){this.initial.set(e,n.style.getPropertyValue(e))}n.style.setProperty(e,typeof i==="string"?i:`${i}px`)}}remove(e,t=""){const{element:n}=this;if(!o6(n)){return}for(const r of e){const e=`${t}${r}`;n.style.removeProperty(e)}}reset(){const{element:e}=this;if(!o6(e)){return}for(const[t,n]of this.initial){e.style.setProperty(t,n)}if(e.getAttribute("style")===""){e.removeAttribute("style")}}};// src/utilities/type-guards/isElement.ts
function o3(e){if(!e)return false;return e instanceof aA(e).Element||ax(e)&&e.nodeType===Node.ELEMENT_NODE}// src/utilities/type-guards/isKeyboardEvent.ts
function o8(e){if(!e)return false;const{KeyboardEvent:t}=aA(e.target);return e instanceof t}// src/utilities/type-guards/isPointerEvent.ts
function o9(e){if(!e)return false;const{PointerEvent:t}=aA(e.target);return e instanceof t}// src/utilities/type-guards/supportsViewTransition.ts
function o7(e){return"startViewTransition"in e}// src/utilities/type-guards/isTextInput.ts
function se(e){if(!o3(e))return false;const{tagName:t}=e;return t==="INPUT"||t==="TEXTAREA"||st(e)}function st(e){return e.hasAttribute("contenteditable")&&e.getAttribute("contenteditable")!=="false"}// src/utilities/misc/generateUniqueId.ts
var sn={};function sr(e){const t=sn[e]==null?0:sn[e]+1;sn[e]=t;return`${e}-${t}`}//# sourceMappingURL=utilities.js.map
//# sourceMappingURL=utilities.js.map
;// CONCATENATED MODULE: ./node_modules/.pnpm/@dnd-kit+collision@0.3.2/node_modules/@dnd-kit/collision/dist/index.js
// src/algorithms/pointerIntersection.ts
var si=({dragOperation:e,droppable:t})=>{const n=e.position.current;if(!n){return null}const{id:r}=t;if(!t.shape){return null}if(t.shape.containsPoint(n)){const e=n7.distance(t.shape.center,n);return{id:r,value:1/e,type:r3.PointerIntersection,priority:r5.High}}return null};// src/algorithms/shapeIntersection.ts
var sa=({dragOperation:e,droppable:t})=>{const{shape:n}=e;if(!t.shape||!(n==null?void 0:n.current)){return null}const r=n.current.intersectionArea(t.shape);if(r){const{position:i}=e;const a=n7.distance(t.shape.center,i.current);const o=r/(n.current.area+t.shape.area-r);const s=o/a;return{id:t.id,value:s,type:r3.ShapeIntersection,priority:r5.Normal}}return null};// src/algorithms/default.ts
var so=e=>{var t;return(t=si(e))!=null?t:sa(e)};// src/algorithms/closestCorners.ts
var ss=e=>{const{dragOperation:t,droppable:n}=e;const{shape:r,position:i}=t;if(!n.shape){return null}const a=r?re.from(r.current.boundingRectangle).corners:void 0;const o=re.from(n.shape.boundingRectangle).corners.reduce((e,t,n)=>{var r;return e+n7.distance(n7.from(t),(r=a==null?void 0:a[n])!=null?r:i.current)},0);const s=o/4;return{id:n.id,value:1/s,type:r3.Collision,priority:r5.Normal}};// src/algorithms/closestCenter.ts
var sl=e=>{var t;const{dragOperation:n,droppable:r}=e;const{shape:i,position:a}=n;if(!r.shape){return null}const o=so(e);if(o){return o}const s=Point4.distance(r.shape.center,(t=i==null?void 0:i.current.center)!=null?t:a.current);const l=1/s;return{id:r.id,value:l,type:CollisionType4.Collision,priority:CollisionPriority4.Normal}};// src/algorithms/directionBiased.ts
var su=({dragOperation:e,droppable:t})=>{if(!t.shape){return null}const{position:n,shape:r}=e;const{direction:i}=n;if(!r){return null}if(i===null){return so({dragOperation:e,droppable:t})}const{center:a}=r.current;const o=t.shape.boundingRectangle;const s=o.bottom>=a.y;const l=o.top<=a.y;const u=o.left<=a.x;const d=o.right>=a.x;if(i==="down"&&s||i==="up"&&l||i==="left"&&u||i==="right"&&d){const e=Point5.distance(t.shape.center,a);const n=e===0?1:1/e;return{id:t.id,value:n,type:CollisionType5.Collision,priority:CollisionPriority5.Normal}}return null};// src/algorithms/pointerDistance.ts
var sd=e=>{const{dragOperation:t,droppable:n}=e;const{position:r}=t;if(!n.shape){return null}const i=Point6.distance(n.shape.center,r.current);const a=1/i;return{id:n.id,value:a,type:CollisionType6.Collision,priority:CollisionPriority6.Normal}};// CONCATENATED MODULE: ./node_modules/.pnpm/@dnd-kit+dom@0.3.2/node_modules/@dnd-kit/dom/index.js
var sc=Object.create;var sp=Object.defineProperty;var sh=Object.defineProperties;var sv=Object.getOwnPropertyDescriptor;var sf=Object.getOwnPropertyDescriptors;var sg=Object.getOwnPropertySymbols;var sm=Object.prototype.hasOwnProperty;var s_=Object.prototype.propertyIsEnumerable;var sb=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e);var sy=e=>{throw TypeError(e)};var sw=(e,t,n)=>t in e?sp(e,t,{enumerable:true,configurable:true,writable:true,value:n}):e[t]=n;var sx=(e,t)=>{for(var n in t||(t={}))if(sm.call(t,n))sw(e,n,t[n]);if(sg)for(var n of sg(t)){if(s_.call(t,n))sw(e,n,t[n])}return e};var sA=(e,t)=>sh(e,sf(t));var sY=(e,t)=>sp(e,"name",{value:t,configurable:true});var sk=(e,t)=>{var n={};for(var r in e)if(sm.call(e,r)&&t.indexOf(r)<0)n[r]=e[r];if(e!=null&&sg)for(var r of sg(e)){if(t.indexOf(r)<0&&s_.call(e,r))n[r]=e[r]}return n};var sI=e=>{var t;return[,,,sc((t=e==null?void 0:e[sb("metadata")])!=null?t:null)]};var sq=["class","method","getter","setter","accessor","field","value","get","set"];var sC=e=>e!==void 0&&typeof e!=="function"?sy("Function expected"):e;var sD=(e,t,n,r,i)=>({kind:sq[e],name:t,metadata:r,addInitializer:e=>n._?sy("Already initialized"):i.push(sC(e||null))});var sE=(e,t)=>sw(t,sb("metadata"),e[3]);var sS=(e,t,n,r)=>{for(var i=0,a=e[t>>1],o=a&&a.length;i<o;i++)t&1?a[i].call(n):r=a[i].call(n,r);return r};var sz=(e,t,n,r,i,a)=>{var o,s,l,u,d,c=t&7,p=!!(t&8),h=!!(t&16);var v=c>3?e.length+1:c?p?1:2:0,f=sq[c+5];var g=c>3&&(e[v-1]=[]),m=e[v]||(e[v]=[]);var _=c&&(!h&&!p&&(i=i.prototype),c<5&&(c>3||!h)&&sv(c<4?i:{get[n](){return sH(this,a)},set[n](x){return sO(this,a,x)}},n));c?h&&c<4&&sY(a,(c>2?"set ":c>1?"get ":"")+n):sY(i,n);for(var b=r.length-1;b>=0;b--){u=sD(c,n,l={},e[3],m);if(c){u.static=p,u.private=h,d=u.access={has:h?e=>sM(i,e):e=>n in e};if(c^3)d.get=h?e=>(c^1?sH:sF)(e,i,c^4?a:_.get):e=>e[n];if(c>2)d.set=h?(e,t)=>sO(e,i,t,c^4?a:_.set):(e,t)=>e[n]=t}s=(0,r[b])(c?c<4?h?a:_[f]:c>4?void 0:{get:_.get,set:_.set}:i,u),l._=1;if(c^4||s===void 0)sC(s)&&(c>4?g.unshift(s):c?h?a=s:_[f]=s:i=s);else if(typeof s!=="object"||s===null)sy("Object expected");else sC(o=s.get)&&(_.get=o),sC(o=s.set)&&(_.set=o),sC(o=s.init)&&g.unshift(o)}return c||sE(e,i),_&&sp(i,n,_),h?c^4?a:_:i};var sT=(e,t,n)=>t.has(e)||sy("Cannot "+n);var sM=(e,t)=>Object(t)!==t?sy('Cannot use the "in" operator on this value'):e.has(t);var sH=(e,t,n)=>(sT(e,t,"read from private field"),n?n.call(e):t.get(e));var sP=(e,t,n)=>t.has(e)?sy("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n);var sO=(e,t,n,r)=>(sT(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var sF=(e,t,n)=>(sT(e,t,"access private method"),n);// src/core/plugins/accessibility/defaults.ts
var sN={role:"button",roleDescription:"draggable"};var sK=`dnd-kit-description`;var sW=`dnd-kit-announcement`;var sR={draggable:`To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item in a given direction. Press space again to drop the item in its new position, or press escape to cancel.`};var sL={dragstart({operation:{source:e}}){if(!e)return;return`Picked up draggable item ${e.id}.`},dragover({operation:{source:e,target:t}}){if(!e||e.id===(t==null?void 0:t.id))return;if(t){return`Draggable item ${e.id} was moved over droppable target ${t.id}.`}return`Draggable item ${e.id} is no longer over a droppable target.`},dragend({operation:{source:e,target:t},canceled:n}){if(!e)return;if(n){return`Dragging was cancelled. Draggable item ${e.id} was dropped.`}if(t){return`Draggable item ${e.id} was dropped over droppable target ${t.id}`}return`Draggable item ${e.id} was dropped.`}};// src/core/plugins/accessibility/utilities.ts
function sU(e){const t=e.tagName.toLowerCase();return["input","select","textarea","a","button"].includes(t)}// src/core/plugins/accessibility/HiddenText.ts
function sB(e,t){const n=document.createElement("div");n.id=e;n.style.setProperty("display","none");n.textContent=t;return n}// src/core/plugins/accessibility/LiveRegion.ts
function sj(e){const t=document.createElement("div");t.id=e;t.setAttribute("role","status");t.setAttribute("aria-live","polite");t.setAttribute("aria-atomic","true");t.style.setProperty("position","fixed");t.style.setProperty("width","1px");t.style.setProperty("height","1px");t.style.setProperty("margin","-1px");t.style.setProperty("border","0");t.style.setProperty("padding","0");t.style.setProperty("overflow","hidden");t.style.setProperty("clip","rect(0 0 0 0)");t.style.setProperty("clip-path","inset(100%)");t.style.setProperty("white-space","nowrap");return t}// src/core/plugins/accessibility/Accessibility.ts
var sV=["dragover","dragmove"];var sQ=class extends rj{constructor(e,t){super(e);const{id:n,idPrefix:{description:r=sK,announcement:i=sW}={},announcements:a=sL,screenReaderInstructions:o=sR,debounce:s=500}=t!=null?t:{};const l=n?`${r}-${n}`:sr(r);const u=n?`${i}-${n}`:sr(i);let d;let c;let p;let h;const v=(e=h)=>{if(!p||!e)return;if((p==null?void 0:p.nodeValue)!==e){p.nodeValue=e}};const f=()=>oY.schedule(v);const g=sG(f,s);const m=Object.entries(a).map(([e,t])=>{return this.manager.monitor.addEventListener(e,(n,r)=>{const i=p;if(!i)return;const a=t==null?void 0:t(n,r);if(a&&i.nodeValue!==a){h=a;if(sV.includes(e)){g()}else{f();g.cancel()}}})});const _=()=>{let e=[];if(!(d==null?void 0:d.isConnected)){d=sB(l,o.draggable);e.push(d)}if(!(c==null?void 0:c.isConnected)){c=sj(u);p=document.createTextNode("");c.appendChild(p);e.push(c)}if(e.length>0){document.body.append(...e)}};const b=/* @__PURE__ */new Set;function y(){for(const e of b){e()}}this.registerEffect(()=>{var e;b.clear();for(const t of this.manager.registry.draggables.value){const n=(e=t.handle)!=null?e:t.element;if(n){if(!d||!c){b.add(_)}if((!sU(n)||aH())&&!n.hasAttribute("tabindex")){b.add(()=>n.setAttribute("tabindex","0"))}if(!n.hasAttribute("role")&&!(n.tagName.toLowerCase()==="button")){b.add(()=>n.setAttribute("role",sN.role))}if(!n.hasAttribute("aria-roledescription")){b.add(()=>n.setAttribute("aria-roledescription",sN.roleDescription))}if(!n.hasAttribute("aria-describedby")){b.add(()=>n.setAttribute("aria-describedby",l))}for(const e of["aria-pressed","aria-grabbed"]){const r=String(t.isDragging);if(n.getAttribute(e)!==r){b.add(()=>n.setAttribute(e,r))}}const e=String(t.disabled);if(n.getAttribute("aria-disabled")!==e){b.add(()=>n.setAttribute("aria-disabled",e))}}}if(b.size>0){oY.schedule(y)}});this.destroy=()=>{super.destroy();d==null?void 0:d.remove();c==null?void 0:c.remove();m.forEach(e=>e())}}};function sG(e,t){let n;const r=()=>{clearTimeout(n);n=setTimeout(e,t)};r.cancel=()=>clearTimeout(n);return r}var s$=class extends rj{constructor(e,t){super(e,t);this.manager=e;const n=nl(()=>{var e;return aq((e=this.manager.dragOperation.source)==null?void 0:e.element)});this.destroy=tU(()=>{var e;const{dragOperation:t}=this.manager;const{cursor:r="grabbing",nonce:i}=(e=this.options)!=null?e:{};if(t.status.initialized){const e=n.value;const t=e.createElement("style");if(i){t.setAttribute("nonce",i)}t.textContent=`* { cursor: ${r} !important; }`;e.head.appendChild(t);return()=>t.remove()}})}};var sX=/* @__PURE__ */new Map;var sZ,sJ,s0,s1,s2,s4,s6,s5,s3,s8,s9,s7,le;var lt=class extends(s2=rV,s1=[nd],s0=[nc],sJ=[nc],sZ=[nc],s2){constructor(e){super(e);sS(s6,5,this);sP(this,s3);sP(this,s4,/* @__PURE__ */new Set);sP(this,s5,sS(s6,8,this,/* @__PURE__ */new Set)),sS(s6,11,this);this.registerEffect(sF(this,s3,s8))}/**
   * Registers CSS rules to be injected into the active drag operation's
   * document and shadow roots. The StyleSheetManager handles tracking
   * which roots need the styles and cleaning up when they're no longer needed.
   *
   * Returns a cleanup function that unregisters the rules.
   */register(e){sH(this,s4).add(e);return()=>{sH(this,s4).delete(e)}}/**
   * Adds an additional root to track for style injection.
   * Returns a cleanup function that removes the root.
   */addRoot(e){tq(()=>{const t=new Set(this.additionalRoots);t.add(e);this.additionalRoots=t});return()=>{tq(()=>{const t=new Set(this.additionalRoots);t.delete(e);this.additionalRoots=t})}}get sourceRoot(){var e;const{source:t}=this.manager.dragOperation;return aF((e=t==null?void 0:t.element)!=null?e:null)}get targetRoot(){var e;const{target:t}=this.manager.dragOperation;return aF((e=t==null?void 0:t.element)!=null?e:null)}get roots(){const{status:e}=this.manager.dragOperation;if(e.initializing||e.initialized){const e=[this.sourceRoot,this.targetRoot].filter(e=>e!=null);return /* @__PURE__ */new Set([...e,...this.additionalRoots])}return /* @__PURE__ */new Set}};s6=sI(s2);s4=new WeakMap;s5=new WeakMap;s3=new WeakSet;s8=function(){const{roots:e}=this;const t=[];for(const n of e){for(const e of sH(this,s4)){t.push(sF(this,s3,s9).call(this,n,e))}}return()=>{for(const e of t){e()}}};s9=function(e,t){let n=sX.get(e);if(!n){n=/* @__PURE__ */new Map;sX.set(e,n)}let r=n.get(t);if(!r){const i=aY(e)?sF(this,s3,s7).call(this,e,n,t):sF(this,s3,le).call(this,e,n,t);if(!i){return()=>{}}r=i;n.set(t,r)}r.refCount++;let i=false;return()=>{if(i)return;i=true;r.refCount--;if(r.refCount===0){r.cleanup()}}};/**
 * For Document roots, prepend a <style> element to <head> so that any
 * @layer declarations appear before layers from regular stylesheets,
 * giving them the lowest cascade priority.
 */s7=function(e,t,n){const r=e.createElement("style");r.textContent=n;e.head.prepend(r);const i=new MutationObserver(t=>{for(const n of t){for(const t of Array.from(n.removedNodes)){if(t===r){e.head.prepend(r);return}}}});i.observe(e.head,{childList:true});return{refCount:0,cleanup:()=>{i.disconnect();r.remove();t.delete(n);if(t.size===0){sX.delete(e)}}}};/**
 * For ShadowRoot roots, use adoptedStyleSheets to avoid DOM side effects
 * like interfering with :first-child or :nth-child selectors.
 */le=function(e,t,n){if(!("adoptedStyleSheets"in e&&Array.isArray(e.adoptedStyleSheets))&&"production"!=="production"){}const r=e.ownerDocument.defaultView;const{CSSStyleSheet:i}=r!=null?r:{};if(!i){if(false){}return null}const a=new i;a.replaceSync(n);e.adoptedStyleSheets.push(a);return{refCount:0,cleanup:()=>{var r;if(aO(e)&&((r=e.host)==null?void 0:r.isConnected)){const t=e.adoptedStyleSheets.indexOf(a);if(t!==-1){e.adoptedStyleSheets.splice(t,1)}}t.delete(n);if(t.size===0){sX.delete(e)}}}};sz(s6,4,"additionalRoots",s1,lt,s5);sz(s6,2,"sourceRoot",s0,lt);sz(s6,2,"targetRoot",sJ,lt);sz(s6,2,"roots",sZ,lt);sE(s6,lt);// src/core/plugins/feedback/constants.ts
var ln="data-dnd-";var lr=`${ln}dropping`;var li="--dnd-";var la=`${ln}dragging`;var lo=`${ln}placeholder`;var ls=[la,lo,"popover","aria-pressed","aria-grabbing"];var ll=["view-transition-name"];var lu=`
  :is(:root,:host) [${la}] {
    position: fixed !important;
    pointer-events: none !important;
    touch-action: none;
    z-index: calc(infinity);
    will-change: translate;
    top: var(${li}top, 0px) !important;
    left: var(${li}left, 0px) !important;
    right: unset !important;
    bottom: unset !important;
    width: var(${li}width, auto);
    max-width: var(${li}width, auto);
    height: var(${li}height, auto);
    max-height: var(${li}height, auto);
    transition: var(${li}transition) !important;
  }

  :is(:root,:host) [${lo}] {
    transition: none;
  }

  :is(:root,:host) [${lo}='hidden'] {
    visibility: hidden;
  }

  [${la}] * {
    pointer-events: none !important;
  }

  [${la}]:not([${lr}]) {
    translate: var(${li}translate) !important;
  }

  [${la}][style*='${li}scale'] {
    scale: var(${li}scale) !important;
    transform-origin: var(${li}transform-origin) !important;
  }

  @layer dnd-kit {
    :where([${la}][popover]) {
      overflow: visible;
      background: unset;
      border: unset;
      margin: unset;
      padding: unset;
      color: inherit;

      &:is(input, button) {
        border: revert;
        background: revert;
      }
    }
  }
  [${la}]::backdrop, [${ln}overlay]:not([${la}]) {
    display: none;
    visibility: hidden;
  }
`.replace(/\n+/g," ").replace(/\s+/g," ").trim();function ld(e,t="hidden"){return tq(()=>{const{element:n,manager:r}=e;if(!n||!r)return;const i=lc(n,r.registry.droppables);const a=[];const o=aK(n);const{remove:s}=o;lp(i,o,a);lh(o,t);o.remove=()=>{a.forEach(e=>e());s.call(o)};return o})}function lc(e,t){const n=/* @__PURE__ */new Map;for(const r of t){if(!r.element)continue;if(e===r.element||e.contains(r.element)){const e=`${ln}${sr("dom-id")}`;r.element.setAttribute(e,"");n.set(r,e)}}return n}function lp(e,t,n){for(const[r,i]of e){if(!r.element)continue;const e=`[${i}]`;const a=t.matches(e)?t:t.querySelector(e);r.element.removeAttribute(i);if(!a)continue;const o=r.element;r.proxy=a;a.removeAttribute(i);aB.set(o,a);n.push(()=>{aB["delete"](o);r.proxy=void 0})}}function lh(e,t="hidden"){e.setAttribute("inert","true");e.setAttribute("tab-index","-1");e.setAttribute("aria-hidden","true");e.setAttribute(lo,t)}function lv(e,t){if(e===t)return true;return aQ(e)===aQ(t)}function lf(e){const{target:t}=e;if("newState"in e&&e.newState==="closed"&&o3(t)&&t.hasAttribute("popover")){requestAnimationFrame(()=>o_(t))}}function lg(e){return e.tagName==="TR"}function lm(e,t,n){const r=new MutationObserver(r=>{let i=false;for(const n of r){if(n.target!==e){i=true;continue}if(n.type!=="attributes"){continue}const r=n.attributeName;if(r.startsWith("aria-")||ls.includes(r)){continue}const a=e.getAttribute(r);if(r==="style"){if(o6(e)&&o6(t)){const n=e.style;for(const e of Array.from(t.style)){if(n.getPropertyValue(e)===""){t.style.removeProperty(e)}}for(const e of Array.from(n)){if(ll.includes(e)||e.startsWith(li)){continue}const r=n.getPropertyValue(e);t.style.setProperty(e,r)}}}else if(a!==null){t.setAttribute(r,a)}else{t.removeAttribute(r)}}if(i&&n){t.innerHTML=e.innerHTML}});r.observe(e,{attributes:true,subtree:true,childList:true});return r}function l_(e,t,n){const r=new MutationObserver(r=>{for(const i of r){if(i.addedNodes.length===0)continue;for(const r of Array.from(i.addedNodes)){if(r.contains(e)&&e.nextElementSibling!==t){e.insertAdjacentElement("afterend",t);o_(n);return}if(r.contains(t)&&t.previousElementSibling!==e){t.insertAdjacentElement("beforebegin",e);o_(n);return}}}});r.observe(e.ownerDocument.body,{childList:true,subtree:true});return r}function lb(e){return new ResizeObserver(()=>{var t,n;const r=new o2(e.placeholder,{frameTransform:e.frameTransform,ignoreTransforms:true});const i=(t=e.transformOrigin)!=null?t:{x:1,y:1};const a=(e.width-r.width)*i.x+e.delta.x;const o=(e.height-r.height)*i.y+e.delta.y;const s=aP();e.styles.set({width:r.width-e.widthOffset,height:r.height-e.heightOffset,top:e.top+o+s.y,left:e.left+a+s.x},li);(n=e.getElementMutationObserver())==null?void 0:n.takeRecords();if(lg(e.element)&&lg(e.placeholder)){const t=Array.from(e.element.cells);const n=Array.from(e.placeholder.cells);if(!e.getSavedCellWidths()){e.setSavedCellWidths(t.map(e=>e.style.width))}for(const[e,r]of t.entries()){const t=n[e];r.style.width=`${t.getBoundingClientRect().width}px`}}e.dragOperation.shape=new o2(e.feedbackElement)})}var ly=250;var lw="ease";function lx(e){var t,n,r,i;const{animation:a}=e;if(typeof a==="function"){const t=a({element:e.element,feedbackElement:e.feedbackElement,placeholder:e.placeholder,translate:e.translate,moved:e.moved});Promise.resolve(t).then(()=>{e.cleanup();requestAnimationFrame(e.restoreFocus)});return}const{duration:o=ly,easing:s=lw}=a!=null?a:{};o_(e.feedbackElement);const[,l]=(t=ab(e.feedbackElement,e=>"translate"in e))!=null?t:[];l==null?void 0:l.pause();const u=(n=e.placeholder)!=null?n:e.element;const d={frameTransform:lv(e.feedbackElement,u)?null:void 0};const c=new o2(e.feedbackElement,d);const p=(r=oF(oC(e.feedbackElement).translate))!=null?r:e.translate;const h=new o2(u,d);const v=re.delta(c,h,e.alignment);const f={x:p.x-v.x,y:p.y-v.y};const g=Math.round(c.intrinsicHeight)!==Math.round(h.intrinsicHeight)?{minHeight:[`${c.intrinsicHeight}px`,`${h.intrinsicHeight}px`],maxHeight:[`${c.intrinsicHeight}px`,`${h.intrinsicHeight}px`]}:{};const m=Math.round(c.intrinsicWidth)!==Math.round(h.intrinsicWidth)?{minWidth:[`${c.intrinsicWidth}px`,`${h.intrinsicWidth}px`],maxWidth:[`${c.intrinsicWidth}px`,`${h.intrinsicWidth}px`]}:{};e.styles.set({transition:e.transition},li);e.feedbackElement.setAttribute(lr,"");(i=e.getElementMutationObserver())==null?void 0:i.takeRecords();oG({element:e.feedbackElement,keyframes:sA(sx(sx({},g),m),{translate:[`${p.x}px ${p.y}px 0`,`${f.x}px ${f.y}px 0`]}),options:{duration:aN(aA(e.feedbackElement))?0:e.moved||e.feedbackElement!==e.element?o:0,easing:s}}).then(()=>{e.feedbackElement.removeAttribute(lr);l==null?void 0:l.finish();e.cleanup();requestAnimationFrame(e.restoreFocus)})}// src/core/plugins/feedback/Feedback.ts
var lA,lY,lk,lI,lq,lC,lD;var lE=class e extends(lY=rj,lA=[nd],lY){constructor(e,t){super(e,t);sP(this,lq);sP(this,lI,sS(lk,8,this)),sS(lk,11,this);this.state={initial:{},current:{}};const n=e.registry.plugins.get(lt);const r=n==null?void 0:n.register(lu);if(r){const e=this.destroy.bind(this);this.destroy=()=>{r();e()}}this.registerEffect(sF(this,lq,lC).bind(this,n));this.registerEffect(sF(this,lq,lD))}};lk=sI(lY);lI=new WeakMap;lq=new WeakSet;lC=function(e){const{overlay:t}=this;if(!t||!e)return;const n=aF(t);if(!n)return;return e.addRoot(n)};lD=function(){var e,t,n;const{state:r,manager:i,options:a}=this;const{dragOperation:o}=i;const{position:s,source:l,status:u}=o;if(u.idle){r.current={};r.initial={};return}if(!l)return;const{element:d,feedback:c}=l;if(!d||c==="none"||!u.initialized||u.initializing){return}const{initial:p}=r;const h=(e=this.overlay)!=null?e:d;const v=oH(h);const f=oH(d);const g=!lv(d,h);const m=new o2(d,{frameTransform:g?f:null,ignoreTransforms:!g});const _={x:f.scaleX/v.scaleX,y:f.scaleY/v.scaleY};let{width:b,height:y,top:w,left:A}=m;if(g){b=b/_.x;y=y/_.y}const Y=new o5(h);const{transition:k,translate:I,boxSizing:q,paddingBlockStart:C,paddingBlockEnd:D,paddingInlineStart:E,paddingInlineEnd:S,borderInlineStartWidth:z,borderInlineEndWidth:T,borderBlockStartWidth:M,borderBlockEndWidth:H}=oC(d);const P=c==="clone";const O=q==="content-box";const F=O?parseInt(E)+parseInt(S)+parseInt(z)+parseInt(T):0;const N=O?parseInt(C)+parseInt(D)+parseInt(M)+parseInt(H):0;const K=c!=="move"&&!this.overlay?ld(l,P?"clone":"hidden"):null;const W=tq(()=>o8(i.dragOperation.activatorEvent));if(I!=="none"){const e=oF(I);if(e&&!p.translate){p.translate=e}}if(!p.transformOrigin){const e=tq(()=>s.current);p.transformOrigin={x:(e.x-A*v.scaleX-v.x)/(b*v.scaleX),y:(e.y-w*v.scaleY-v.y)/(y*v.scaleY)}}const{transformOrigin:R}=p;const L=w*v.scaleY+v.y;const U=A*v.scaleX+v.x;if(!p.coordinates){p.coordinates={x:U,y:L};if(_.x!==1||_.y!==1){const{scaleX:e,scaleY:t}=f;const{x:n,y:r}=R;p.coordinates.x+=(b*e-b)*n;p.coordinates.y+=(y*t-y)*r}}if(!p.dimensions){p.dimensions={width:b,height:y}}if(!p.frameTransform){p.frameTransform=v}const B={x:p.coordinates.x-U,y:p.coordinates.y-L};const j={width:(p.dimensions.width*p.frameTransform.scaleX-b*v.scaleX)*R.x,height:(p.dimensions.height*p.frameTransform.scaleY-y*v.scaleY)*R.y};const V={x:B.x/v.scaleX+j.width,y:B.y/v.scaleY+j.height};const Q={left:A+V.x,top:w+V.y};h.setAttribute(la,"true");const G=tq(()=>o.transform);const $=(t=p.translate)!=null?t:{x:0,y:0};const X=G.x*v.scaleX+$.x;const Z=G.y*v.scaleY+$.y;const J=aP();Y.set({width:b-F,height:y-N,top:Q.top+J.y,left:Q.left+J.x,translate:`${X}px ${Z}px 0`,transition:k?`${k}, translate 0ms linear`:"",scale:g?`${_.x} ${_.y}`:"","transform-origin":`${R.x*100}% ${R.y*100}%`},li);if(K){d.insertAdjacentElement("afterend",K);if(a==null?void 0:a.rootElement){const e=typeof a.rootElement==="function"?a.rootElement(l):a.rootElement;e.appendChild(d)}}if(om(h)){if(!h.hasAttribute("popover")){h.setAttribute("popover","manual")}o_(h);h.addEventListener("beforetoggle",lf)}let ee;let et;let en;const er=lb({placeholder:K,element:d,feedbackElement:h,frameTransform:v,transformOrigin:R,width:b,height:y,top:w,left:A,widthOffset:F,heightOffset:N,delta:V,styles:Y,dragOperation:o,getElementMutationObserver:()=>ee,getSavedCellWidths:()=>en,setSavedCellWidths:e=>{en=e}});const ei=new o2(h);tq(()=>o.shape=ei);const ea=aA(h);const eo=e=>{this.manager.actions.stop({event:e})};const es=aN(ea);if(W){ea.addEventListener("resize",eo)}if(tq(()=>l.status)==="idle"){requestAnimationFrame(()=>l.status="dragging")}if(K){er.observe(K);ee=lm(d,K,P);et=l_(d,K,h)}const el=(n=i.dragOperation.source)==null?void 0:n.id;const eu=()=>{var e;if(!W||el==null)return;const t=i.registry.draggables.get(el);const n=(e=t==null?void 0:t.handle)!=null?e:t==null?void 0:t.element;if(ak(n)){n.focus()}};const ed=()=>{var e;ee==null?void 0:ee.disconnect();et==null?void 0:et.disconnect();er.disconnect();ea.removeEventListener("resize",eo);if(om(h)){h.removeEventListener("beforetoggle",lf);h.removeAttribute("popover")}h.removeAttribute(la);Y.reset();if(en&&lg(d)){const t=Array.from(d.cells);for(const[n,r]of t.entries()){r.style.width=(e=en[n])!=null?e:""}}l.status="idle";const t=r.current.translate!=null;if(K&&(t||K.parentElement!==h.parentElement)&&h.isConnected){K.replaceWith(h)}K==null?void 0:K.remove()};const ec=a==null?void 0:a.dropAnimation;const ep=this;const eh=nh(// Update transform on move
()=>{var e;const{transform:t,status:n}=o;if(!t.x&&!t.y&&!r.current.translate){return}if(n.dragging){const n=(e=p.translate)!=null?e:{x:0,y:0};const i={x:t.x/v.scaleX+n.x,y:t.y/v.scaleY+n.y};const a=r.current.translate;const s=tq(()=>o.modifiers);const l=tq(()=>{var e;return(e=o.shape)==null?void 0:e.current});const u=W&&!es?"250ms cubic-bezier(0.25, 1, 0.5, 1)":"0ms linear";Y.set({transition:`${k}, translate ${u}`,translate:`${i.x}px ${i.y}px 0`},li);ee==null?void 0:ee.takeRecords();if(l&&l!==ei&&a&&!s.length){const e=n7.delta(i,a);o.shape=re.from(l.boundingRectangle).translate(e.x*v.scaleX,e.y*v.scaleY)}else{o.shape=new o2(h)}r.current.translate=i}},// Drop animation
function(){if(o.status.dropped){this.dispose();l.status="dropping";const e=ep.dropAnimation!==void 0?ep.dropAnimation:ec;let t=r.current.translate;const n=t!=null;if(!t&&d!==h){t={x:0,y:0}}if(!t||e===null){ed();return}i.renderer.rendering.then(()=>{lx({element:d,feedbackElement:h,placeholder:K,translate:t,moved:n,transition:k,alignment:l.alignment,styles:Y,animation:e!=null?e:void 0,getElementMutationObserver:()=>ee,cleanup:ed,restoreFocus:eu})})}});return()=>{ed();eh()}};sz(lk,4,"overlay",lA,lE,lI);sE(lk,lE);lE.configure=rK(lE);var lS=lE;var lz=true;var lT=false;var lM,lH,lP,lO,lF,lN,lK;lO=(lP=[nd],oW.Forward),lH=(lM=[nd],oW.Reverse);var lW=class{constructor(){sP(this,lN,sS(lF,8,this,lz)),sS(lF,11,this);sP(this,lK,sS(lF,12,this,lz)),sS(lF,15,this)}isLocked(e){if(e===oW.Idle){return false}if(e==null){return this[oW.Forward]===lz&&this[oW.Reverse]===lz}return this[e]===lz}unlock(e){if(e===oW.Idle){return}this[e]=lT}};lF=sI(null);lN=new WeakMap;lK=new WeakMap;sz(lF,4,lO,lP,lW,lN);sz(lF,4,lH,lM,lW,lK);sE(lF,lW);// src/core/plugins/scrolling/ScrollIntent.ts
var lR=[oW.Forward,oW.Reverse];var lL=class{constructor(){this.x=new lW;this.y=new lW}isLocked(){return this.x.isLocked()&&this.y.isLocked()}};var lU=class extends rj{constructor(e){super(e);const t=tM(new lL);let n=null;this.signal=t;tU(()=>{const{status:r}=e.dragOperation;if(!r.initialized){n=null;t.value=new lL;return}const{delta:i}=e.dragOperation.position;if(n){const e={x:lB(i.x,n.x),y:lB(i.y,n.y)};const r=t.peek();tk(()=>{for(const t of rd){for(const n of lR){if(e[t]===n){r[t].unlock(n)}}}t.value=r})}n=i})}get current(){return this.signal.peek()}};function lB(e,t){return Math.sign(e-t)}// src/core/plugins/scrolling/Scroller.ts
var lj,lV,lQ,lG,l$,lX;var lZ=class extends(lV=rV,lj=[nd],lV){constructor(e){super(e);sP(this,lG,sS(lQ,8,this,false)),sS(lQ,11,this);sP(this,l$);sP(this,lX,()=>{if(!sH(this,l$)){return}const{element:e,by:t}=sH(this,l$);if(t.y)e.scrollTop+=t.y;if(t.x)e.scrollLeft+=t.x});this.scroll=e=>{var t;if(this.disabled){return false}const n=this.getScrollableElements();if(!n){sO(this,l$,void 0);return false}const{position:r}=this.manager.dragOperation;const i=r==null?void 0:r.current;if(i){const{by:r}=e!=null?e:{};const a=r?{x:lJ(r.x),y:lJ(r.y)}:void 0;const o=a?void 0:this.scrollIntentTracker.current;if(o==null?void 0:o.isLocked()){return false}for(const e of n){const n=ox(e,r);if(n.x||n.y){const{speed:n,direction:s}=oU(e,i,a);if(o){for(const e of rd){if(o[e].isLocked(s[e])){n[e]=0;s[e]=0}}}if(s.x||s.y){const{x:i,y:a}=r!=null?r:s;const o=i*n.x;const l=a*n.y;if(o||l){const n=(t=sH(this,l$))==null?void 0:t.by;if(this.autoScrolling&&n){const e=n.x&&!o||n.y&&!l;if(e)continue}sO(this,l$,{element:e,by:{x:o,y:l}});oY.schedule(sH(this,lX));return true}}}}}sO(this,l$,void 0);return false};let t=null;let n=null;const r=nl(()=>{const{position:n,source:r}=e.dragOperation;if(!n){return null}const i=aL(aF(r==null?void 0:r.element),n.current);if(i){t=i}return i!=null?i:t});const i=nl(()=>{const t=r.value;const{documentElement:i}=aq(t);if(!t||t===i){const{target:t}=e.dragOperation;const r=t==null?void 0:t.element;if(r){const e=oT(r,{excludeElement:false});n=e;return e}}if(t){const e=oT(t,{excludeElement:false});if(this.autoScrolling&&n&&e.size<(n==null?void 0:n.size)){return n}n=e;return e}n=null;return null},nu);this.getScrollableElements=()=>{return i.value};this.scrollIntentTracker=new lU(e);this.destroy=e.monitor.addEventListener("dragmove",t=>{if(this.disabled||t.defaultPrevented||!o8(e.dragOperation.activatorEvent)||!t.by){return}if(this.scroll({by:t.by})){t.preventDefault()}})}};lQ=sI(lV);lG=new WeakMap;l$=new WeakMap;lX=new WeakMap;sz(lQ,4,"autoScrolling",lj,lZ,lG);sE(lQ,lZ);function lJ(e){if(e>0){return oW.Forward}if(e<0){return oW.Reverse}return oW.Idle}// src/utilities/scheduling/scheduler.ts
var l0=class{constructor(e){this.scheduler=e;this.pending=false;this.tasks=/* @__PURE__ */new Set;this.resolvers=/* @__PURE__ */new Set;this.flush=()=>{const{tasks:e,resolvers:t}=this;this.pending=false;this.tasks=/* @__PURE__ */new Set;this.resolvers=/* @__PURE__ */new Set;for(const t of e){t()}for(const e of t){e()}}}schedule(e){this.tasks.add(e);if(!this.pending){this.pending=true;this.scheduler(this.flush)}return new Promise(e=>this.resolvers.add(e))}};var l1=new l0(e=>{if(typeof requestAnimationFrame==="function"){requestAnimationFrame(e)}else{e()}});// src/core/plugins/scrolling/AutoScroller.ts
var l2=10;var l4=class extends rj{constructor(e,t){super(e);const n=e.registry.plugins.get(lZ);if(!n){throw new Error("AutoScroller plugin depends on Scroller plugin")}this.destroy=tU(()=>{if(this.disabled){return}const{position:t,status:r}=e.dragOperation;if(r.dragging){const e=n.scroll();if(e){n.autoScrolling=true;const e=setInterval(()=>l1.schedule(n.scroll),l2);return()=>{clearInterval(e)}}else{n.autoScrolling=false}}})}};var l6={capture:true,passive:true};var l5;var l3=class extends rV{constructor(e){super(e);sP(this,l5);this.handleScroll=()=>{if(sH(this,l5)==null){sO(this,l5,setTimeout(()=>{this.manager.collisionObserver.forceUpdate(false);sO(this,l5,void 0)},50))}};const{dragOperation:t}=this.manager;this.destroy=tU(()=>{var e,n,r;const i=t.status.dragging;if(i){const i=(r=(n=(e=t.source)==null?void 0:e.element)==null?void 0:n.ownerDocument)!=null?r:document;i.addEventListener("scroll",this.handleScroll,l6);return()=>{i.removeEventListener("scroll",this.handleScroll,l6)}}})}};l5=new WeakMap;var l8=class extends rj{constructor(e,t){super(e,t);this.manager=e;this.destroy=tU(()=>{var e;const{dragOperation:t}=this.manager;const{nonce:n}=(e=this.options)!=null?e:{};if(t.status.initialized){const e=document.createElement("style");if(n){e.setAttribute("nonce",n)}e.textContent=`* { user-select: none !important; -webkit-user-select: none !important; }`;document.head.appendChild(e);l9();document.addEventListener("selectionchange",l9,{capture:true});return()=>{document.removeEventListener("selectionchange",l9,{capture:true});e.remove()}}})}};function l9(){var e;(e=document.getSelection())==null?void 0:e.removeAllRanges()}var l7=Object.freeze({offset:10,keyboardCodes:{start:["Space","Enter"],cancel:["Escape"],end:["Space","Enter","Tab"],up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]},preventActivation(e,t){var n;const r=(n=t.handle)!=null?n:t.element;return e.target!==r}});var ue;var ut=class e extends iV{constructor(e,t){super(e);this.manager=e;this.options=t;sP(this,ue,[]);this.listeners=new aV;this.handleSourceKeyDown=(e,t,n)=>{if(this.disabled||e.defaultPrevented){return}if(!o3(e.target)){return}if(t.disabled){return}const{keyboardCodes:r=l7.keyboardCodes,preventActivation:i=l7.preventActivation}=n!=null?n:{};if(!r.start.includes(e.code)){return}if(!this.manager.dragOperation.status.idle){return}if(i==null?void 0:i(e,t))return;this.handleStart(e,t,n)}}bind(e,t=this.options){const n=tU(()=>{var n;const r=(n=e.handle)!=null?n:e.element;const i=n=>{if(o8(n)){this.handleSourceKeyDown(n,e,t)}};if(r){r.addEventListener("keydown",i);return()=>{r.removeEventListener("keydown",i)}}});return n}handleStart(e,t,n){const{element:r}=t;if(!r){throw new Error("Source draggable does not have an associated element")}e.preventDefault();e.stopImmediatePropagation();oj(r);const{center:i}=new o2(r);const a=this.manager.actions.start({event:e,coordinates:{x:i.x,y:i.y},source:t});if(a.signal.aborted)return this.cleanup();this.sideEffects();const o=aq(r);const s=[this.listeners.bind(o,[{type:"keydown",listener:e=>this.handleKeyDown(e,t,n),options:{capture:true}}])];sH(this,ue).push(...s)}handleKeyDown(e,t,n){const{keyboardCodes:r=l7.keyboardCodes}=n!=null?n:{};if(ur(e,[...r.end,...r.cancel])){e.preventDefault();const t=ur(e,r.cancel);this.handleEnd(e,t);return}if(ur(e,r.up)){this.handleMove("up",e)}else if(ur(e,r.down)){this.handleMove("down",e)}if(ur(e,r.left)){this.handleMove("left",e)}else if(ur(e,r.right)){this.handleMove("right",e)}}handleEnd(e,t){this.manager.actions.stop({event:e,canceled:t});this.cleanup()}handleMove(e,t){var n,r;const{shape:i}=this.manager.dragOperation;const a=t.shiftKey?5:1;let o={x:0,y:0};let s=(r=(n=this.options)==null?void 0:n.offset)!=null?r:l7.offset;if(typeof s==="number"){s={x:s,y:s}}if(!i){return}switch(e){case"up":o={x:0,y:-s.y*a};break;case"down":o={x:0,y:s.y*a};break;case"left":o={x:-s.x*a,y:0};break;case"right":o={x:s.x*a,y:0};break}if(o.x||o.y){t.preventDefault();this.manager.actions.move({event:t,by:o})}}sideEffects(){const e=this.manager.registry.plugins.get(l4);if((e==null?void 0:e.disabled)===false){e.disable();sH(this,ue).push(()=>{e.enable()})}}cleanup(){sH(this,ue).forEach(e=>e());sO(this,ue,[])}destroy(){this.cleanup();this.listeners.clear()}};ue=new WeakMap;ut.configure=rK(ut);ut.defaults=l7;var un=ut;function ur(e,t){return t.includes(e.code)}var ui;var ua=class extends i${constructor(){super(...arguments);sP(this,ui)}onEvent(e){switch(e.type){case"pointerdown":sO(this,ui,az(e));break;case"pointermove":if(!sH(this,ui))return;const{x:t,y:n}=az(e);const r={x:t-sH(this,ui).x,y:n-sH(this,ui).y};const{tolerance:i}=this.options;if(i&&rl(r,i)){this.abort();return}if(rl(r,this.options.value)){this.activate(e)}break;case"pointerup":this.abort();break}}abort(){sO(this,ui,void 0)}};ui=new WeakMap;var uo,us;var ul=class extends i${constructor(){super(...arguments);sP(this,uo);sP(this,us)}onEvent(e){switch(e.type){case"pointerdown":sO(this,us,az(e));sO(this,uo,setTimeout(()=>this.activate(e),this.options.value));break;case"pointermove":if(!sH(this,us))return;const{x:t,y:n}=az(e);const r={x:t-sH(this,us).x,y:n-sH(this,us).y};if(rl(r,this.options.tolerance)){this.abort()}break;case"pointerup":this.abort();break}}abort(){if(sH(this,uo)){clearTimeout(sH(this,uo));sO(this,us,void 0);sO(this,uo,void 0)}}};uo=new WeakMap;us=new WeakMap;// src/core/sensors/pointer/PointerActivationConstraints.ts
var uu=class{};uu.Delay=ul;uu.Distance=ua;// src/core/sensors/pointer/PointerSensor.ts
var ud=Object.freeze({activationConstraints(e,t){var n;const{pointerType:r,target:i}=e;if(r==="mouse"&&o3(i)&&(t.handle===i||((n=t.handle)==null?void 0:n.contains(i)))){return void 0}if(r==="touch"){return[new uu.Delay({value:250,tolerance:5})]}if(se(i)&&!e.defaultPrevented){return[new uu.Delay({value:200,tolerance:0})]}return[new uu.Delay({value:200,tolerance:10}),new uu.Distance({value:5})]},preventActivation(e,t){var n;const{target:r}=e;if(r===t.element)return false;if(r===t.handle)return false;if(!o3(r))return false;if((n=t.handle)==null?void 0:n.contains(r))return false;return aj(r)}});var uc;var up=class e extends iV{constructor(e,t){super(e);this.manager=e;this.options=t;sP(this,uc,/* @__PURE__ */new Set);this.listeners=new aV;this.latest={event:void 0,coordinates:void 0};this.handleMove=()=>{const{event:e,coordinates:t}=this.latest;if(!e||!t){return}this.manager.actions.move({event:e,to:t})};this.handleCancel=this.handleCancel.bind(this);this.handlePointerUp=this.handlePointerUp.bind(this);this.handleKeyDown=this.handleKeyDown.bind(this)}activationConstraints(e,t,n=this.options){const{activationConstraints:r=ud.activationConstraints}=n!=null?n:{};const i=typeof r==="function"?r(e,t):r;return i}bind(e,t=this.options){const n=tU(()=>{var n;const r=new AbortController;const{signal:i}=r;const a=n=>{if(o9(n)){this.handlePointerDown(n,e,t)}};let o=[(n=e.handle)!=null?n:e.element];if(t==null?void 0:t.activatorElements){if(Array.isArray(t.activatorElements)){o=t.activatorElements}else{o=t.activatorElements(e)}}for(const e of o){if(!e)continue;u_(e.ownerDocument.defaultView);e.addEventListener("pointerdown",a,{signal:i})}return()=>r.abort()});return n}handlePointerDown(e,t,n){if(this.disabled||!e.isPrimary||e.button!==0||!o3(e.target)||t.disabled||uv(e)||!this.manager.dragOperation.status.idle){return}const{preventActivation:r=ud.preventActivation}=n!=null?n:{};if(r==null?void 0:r(e,t)){return}const{target:i}=e;const a=ak(i)&&i.draggable&&i.getAttribute("draggable")==="true";const o=oH(t.element);const{x:s,y:l}=az(e);this.initialCoordinates={x:s*o.scaleX+o.x,y:l*o.scaleY+o.y};const u=this.activationConstraints(e,t,n);e.sensor=this;const d=new iQ(u,e=>this.handleStart(t,e));d.signal.onabort=()=>this.handleCancel(e);d.onEvent(e);this.controller=d;const c=aM();const p=this.listeners.bind(c,[{type:"pointermove",listener:e=>this.handlePointerMove(e,t)},{type:"pointerup",listener:this.handlePointerUp,options:{capture:true}},{type:"pointercancel",listener:this.handleCancel},{// Cancel activation if there is a competing Drag and Drop interaction
type:"dragstart",listener:a?this.handleCancel:uf,options:{capture:true}}]);const h=()=>{p();this.initialCoordinates=void 0};sH(this,uc).add(h)}handlePointerMove(e,t){var n,r;if(((n=this.controller)==null?void 0:n.activated)===false){(r=this.controller)==null?void 0:r.onEvent(e);return}if(this.manager.dragOperation.status.dragging){const n=az(e);const r=oH(t.element);n.x=n.x*r.scaleX+r.x;n.y=n.y*r.scaleY+r.y;e.preventDefault();e.stopPropagation();this.latest.event=e;this.latest.coordinates=n;oY.schedule(this.handleMove)}}handlePointerUp(e){const{status:t}=this.manager.dragOperation;if(!t.idle){e.preventDefault();e.stopPropagation();const n=!t.initialized;this.manager.actions.stop({event:e,canceled:n})}this.cleanup()}handleKeyDown(e){if(e.key==="Escape"){e.preventDefault();this.handleCancel(e)}}handleStart(e,t){const{manager:n,initialCoordinates:r}=this;if(!r||!n.dragOperation.status.idle){return}if(t.defaultPrevented){return}const i=n.actions.start({coordinates:r,event:t,source:e});if(i.signal.aborted)return this.cleanup();t.preventDefault();const a=aq(t.target);const o=a.body;o.setPointerCapture(t.pointerId);const s=o3(t.target)?[t.target,o]:o;const l=this.listeners.bind(s,[{// Prevent scrolling on touch devices
type:"touchmove",listener:uf,options:{passive:false}},{// Prevent click events
type:"click",listener:uf},{type:"contextmenu",listener:uf},{type:"keydown",listener:this.handleKeyDown}]);sH(this,uc).add(l)}handleCancel(e){const{dragOperation:t}=this.manager;if(t.status.initialized){this.manager.actions.stop({event:e,canceled:true})}this.cleanup()}cleanup(){this.latest={event:void 0,coordinates:void 0};sH(this,uc).forEach(e=>e());sH(this,uc).clear()}destroy(){this.cleanup();this.listeners.clear()}};uc=new WeakMap;up.configure=rK(up);up.defaults=ud;var uh=up;function uv(e){return"sensor"in e}function uf(e){e.preventDefault()}function ug(){}var um=/* @__PURE__ */new WeakSet;function u_(e){if(!e||um.has(e)){return}e.addEventListener("touchmove",ug,{capture:false,passive:false});um.add(e)}// src/core/manager/manager.ts
var ub={modifiers:[],plugins:[sQ,l4,s$,lS,l8],sensors:[uh,un]};var uy=class extends ac{constructor(e={}){const t=ad(e.plugins,ub.plugins);const n=ad(e.sensors,ub.sensors);const r=ad(e.modifiers,ub.modifiers);super(sA(sx({},e),{plugins:[l3,lZ,lt,...t],sensors:n,modifiers:r}))}};var uw,ux,uA,uY,uk,uI,uq,uC;var uD=class extends(uY=iz,uA=[nd],ux=[nd],uw=[nd],uY){constructor(e,t){var n=e,{element:r,effects:i=()=>[],handle:a,feedback:o="default"}=n,s=sk(n,["element","effects","handle","feedback"]);super(sx({effects:()=>[...i(),()=>{var e,t;const{manager:n}=this;if(!n)return;const r=(t=(e=this.sensors)==null?void 0:e.map(rW))!=null?t:[...n.sensors];const i=r.map(e=>{const t=e instanceof iV?e:n.registry.register(e.plugin);const r=e instanceof iV?void 0:e.options;const i=t.bind(this,r);return i});return function e(){i.forEach(e=>e())}}]},s),t);sP(this,uI,sS(uk,8,this)),sS(uk,11,this);sP(this,uq,sS(uk,12,this)),sS(uk,15,this);sP(this,uC,sS(uk,16,this)),sS(uk,19,this);this.element=r;this.handle=a;this.feedback=o}};uk=sI(uY);uI=new WeakMap;uq=new WeakMap;uC=new WeakMap;sz(uk,4,"handle",uA,uD,uI);sz(uk,4,"element",ux,uD,uq);sz(uk,4,"feedback",uw,uD,uC);sE(uk,uD);var uE,uS,uz,uT,uM,uH,uP,uO,uF,uN;var uK=class extends(uz=ij,uS=[nd],uE=[nd],uz){constructor(e,t){var n=e,{element:r,effects:i=()=>[]}=n,a=sk(n,["element","effects"]);const{collisionDetector:o=so}=a;const s=e=>{const{manager:t,element:n}=this;if(!n||e===null){this.shape=void 0;return void 0}if(!t)return;const r=new o2(n);const i=tq(()=>this.shape);if(r&&(i==null?void 0:i.equals(r))){return i}this.shape=r;return r};const l=tM(false);super(sA(sx({},a),{collisionDetector:o,effects:()=>[...i(),()=>{const{element:e,manager:t}=this;if(!t)return;const{dragOperation:n}=t;const{source:r}=n;l.value=Boolean(r&&n.status.initialized&&e&&!this.disabled&&this.accepts(r))},()=>{const{element:e}=this;if(l.value&&e){const t=new og(e,s);return()=>{t.disconnect();this.shape=void 0}}},()=>{var e;if((e=this.manager)==null?void 0:e.dragOperation.status.initialized){return()=>{this.shape=void 0}}}]}),t);sP(this,uF);sP(this,uM,sS(uT,8,this)),sS(uT,11,this);sP(this,uN,sS(uT,12,this)),sS(uT,15,this);this.element=r;this.refreshShape=()=>s()}set element(e){sO(this,uF,e,uO)}get element(){var e;return(e=this.proxy)!=null?e:sH(this,uF,uP)}};uT=sI(uz);uM=new WeakMap;uF=new WeakSet;uN=new WeakMap;uH=sz(uT,20,"#element",uS,uF,uM),uP=uH.get,uO=uH.set;sz(uT,4,"proxy",uE,uK,uN);sE(uT,uK);//# sourceMappingURL=index.js.map
//# sourceMappingURL=index.js.map
;// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/modals/question-previews/MatchingPreview.tsx
var uW=(e,t)=>String(e.answer_id||t);var uR=e=>{var{answers:t,isImageMatching:n}=e;var s=(0,o.useRef)(null);var[l,u]=(0,o.useState)({});var d=[...t].sort((e,t)=>e.answer_order-t.answer_order);var c=(0,o.useMemo)(()=>t.reduce((e,t,n)=>{e[uW(t,n)]=t;return e},{}),[t]);(0,o.useEffect)(()=>{u({})},[t,n]);(0,o.useEffect)(()=>{var e=s.current;if(!e){return}var t=new uy({sensors:[uh,un]});var n=Array.from(e.querySelectorAll('.tutor-quiz-question-option[data-option="draggable"]')).map((e,n)=>{var r=e.querySelector("[data-grab-handle]");var i;return new uD({id:(i=e.dataset.id)!==null&&i!==void 0?i:String(n),element:e,handle:r!==null&&r!==void 0?r:undefined,feedback:"clone"},t)});var a=Array.from(e.querySelectorAll(".tutor-quiz-question-option-drop-zone")).map((e,n)=>{var r;return new uK({id:(r=e.dataset.dropZoneId)!==null&&r!==void 0?r:String(n),element:e},t)});t.monitor.addEventListener("dragstart",e=>{var t,n;(n=e.operation.source)===null||n===void 0?void 0:(t=n.element)===null||t===void 0?void 0:t.setAttribute("data-option","dragging")});t.monitor.addEventListener("dragend",e=>{var t,n,a,o;(n=e.operation.source)===null||n===void 0?void 0:(t=n.element)===null||t===void 0?void 0:t.setAttribute("data-option","draggable");var s=(a=e.operation.source)===null||a===void 0?void 0:a.id;var l=(o=e.operation.target)===null||o===void 0?void 0:o.id;if(!s||!l){return}u(e=>(0,i._)((0,r._)({},e),{[String(l)]:String(s)}))});return()=>{n.forEach(e=>e.destroy());a.forEach(e=>e.destroy())}},[t]);return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{ref:s,className:"tutor-flex tutor-flex-column tutor-gap-7 tutor-sm-gap-5",children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"tutor-quiz-question-options","data-image-matching":n?"1":"0",children:/*#__PURE__*/(0,a/* .jsx */.Y)(b/* ["default"] */.A,{each:t,children:(e,t)=>{var i=uW(e,t);var o=l[i]?c[l[i]]:null;var s=o?n?o.answer_title:o.answer_two_gap_match:"";return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{className:"tutor-quiz-question-option",children:[/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:n&&e.image_url,fallback:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{"data-title":true,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"tutor-quiz-question-option-number",children:e.answer_order||t+1}),e.answer_title]}),children:/*#__PURE__*/(0,a/* .jsx */.Y)("img",{src:e.image_url,alt:e.answer_title})}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"tutor-quiz-question-option-drop-zone","data-drop-placeholder-text":(0,v.__)("Drop here","tutor"),"data-drop-zone-id":i,tabIndex:0,children:/*#__PURE__*/(0,a/* .jsxs */.FD)(y/* ["default"] */.A,{when:o,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)("span",{"data-drop-placeholder":true,className:"tutor-text-subdued",children:(0,v.__)("Drop here","tutor")}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{"data-option":"dropped","data-id":l[i],children:s}),/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",className:"tutor-preview-drop-clear","aria-label":(0,v.__)("Clear matched answer","tutor"),onClick:()=>u(e=>{var t=(0,r._)({},e);delete t[i];return t}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"cross",width:16,height:16})})]})})]},e.answer_id||t)}})}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{className:"tutor-quiz-question-draggable",children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{className:"tutor-quiz-question-draggable-header",children:[/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"drag",width:20,height:20}),/*#__PURE__*/(0,a/* .jsx */.Y)("span",{className:"tutor-text-small tutor-font-medium",children:(0,v.__)("Drag from here","tutor")})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"tutor-quiz-question-options",children:/*#__PURE__*/(0,a/* .jsx */.Y)(b/* ["default"] */.A,{each:d,children:(e,t)=>/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{className:"tutor-quiz-question-option","data-option":"draggable","data-id":e.answer_id,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{"data-title":true,children:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:n,fallback:e.answer_two_gap_match,children:e.answer_title})}),/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button","data-grab-handle":true,"aria-label":e.answer_title,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"grabHandle",width:24,height:24})})]},e.answer_id||t)})})]})]})};/* export default */const uL=uR;// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/modals/question-previews/MultipleChoicePreview.tsx
var uU=e=>{var{answers:t,hasMultipleCorrectAnswer:n}=e;var[r,i]=(0,o.useState)([]);var s=e=>{i(t=>{if(!n){return[e]}return t.includes(e)?t.filter(t=>t!==e):[...t,e]})};var l=(e,t)=>{if(e.key===" "||e.key==="Enter"){e.preventDefault();s(t)}};return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"tutor-quiz-question-options",children:/*#__PURE__*/(0,a/* .jsx */.Y)(b/* ["default"] */.A,{each:t,children:(e,t)=>{var i=!!e.image_url;var o=String(e.answer_id||t);var u="tutor-question-preview-answer-".concat(o);var d=r.includes(o);return/*#__PURE__*/(0,a/* .jsx */.Y)("label",{className:"tutor-quiz-question-option","data-preview-selected":d?"true":undefined,tabIndex:0,onKeyDown:e=>l(e,o),children:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!i,fallback:/*#__PURE__*/(0,a/* .jsxs */.FD)(a/* .Fragment */.FK,{children:[/*#__PURE__*/(0,a/* .jsx */.Y)("input",{type:n?"checkbox":"radio",className:"tutor-hidden",name:"tutor-question-preview-answer",value:o,checked:d,onChange:()=>s(o),tabIndex:-1}),/*#__PURE__*/(0,a/* .jsx */.Y)("img",{src:e.image_url,alt:e.answer_title}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{"data-title":true,children:e.answer_title})]}),children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"tutor-input-field",children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{className:"tutor-input-wrapper",children:[/*#__PURE__*/(0,a/* .jsx */.Y)("input",{id:u,type:n?"checkbox":"radio",className:n?"tutor-checkbox":"tutor-radio",name:"tutor-question-preview-answer",value:o,checked:d,onChange:()=>s(o),tabIndex:-1}),/*#__PURE__*/(0,a/* .jsx */.Y)("label",{htmlFor:u,children:e.answer_title})]})})})},e.answer_id||t)}})})};/* export default */const uB=uU;// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/modals/question-previews/OpenEndedPreview.tsx
var uj=e=>{var{questionType:t}=e;var[n,r]=(0,o.useState)("");return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"tutor-quiz-question-options",children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"tutor-input-field",children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"tutor-input-wrapper",children:/*#__PURE__*/(0,a/* .jsx */.Y)("textarea",{className:"tutor-input tutor-text-area tutor-input-content-clear tutor-quiz-question-input",placeholder:t==="short_answer"?(0,v.__)("Type your short answer here","tutor"):(0,v.__)("Type your answer here","tutor"),rows:5,value:n,onChange:e=>r(e.target.value)})})})})};/* export default */const uV=uj;// CONCATENATED MODULE: ./node_modules/.pnpm/@dnd-kit+dom@0.3.2/node_modules/@dnd-kit/dom/sortable.js
var uQ=Object.create;var uG=Object.defineProperty;var u$=Object.defineProperties;var uX=Object.getOwnPropertyDescriptor;var uZ=Object.getOwnPropertyDescriptors;var uJ=Object.getOwnPropertySymbols;var u0=Object.prototype.hasOwnProperty;var u1=Object.prototype.propertyIsEnumerable;var u2=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e);var u4=e=>{throw TypeError(e)};var u6=(e,t,n)=>t in e?uG(e,t,{enumerable:true,configurable:true,writable:true,value:n}):e[t]=n;var u5=(e,t)=>{for(var n in t||(t={}))if(u0.call(t,n))u6(e,n,t[n]);if(uJ)for(var n of uJ(t)){if(u1.call(t,n))u6(e,n,t[n])}return e};var u3=(e,t)=>u$(e,uZ(t));var u8=(e,t)=>{var n={};for(var r in e)if(u0.call(e,r)&&t.indexOf(r)<0)n[r]=e[r];if(e!=null&&uJ)for(var r of uJ(e)){if(t.indexOf(r)<0&&u1.call(e,r))n[r]=e[r]}return n};var u9=e=>{var t;return[,,,uQ((t=void 0)!=null?t:null)]};var u7=["class","method","getter","setter","accessor","field","value","get","set"];var de=e=>e!==void 0&&typeof e!=="function"?u4("Function expected"):e;var dt=(e,t,n,r,i)=>({kind:u7[e],name:t,metadata:r,addInitializer:e=>n._?u4("Already initialized"):i.push(de(e||null))});var dn=(e,t)=>u6(t,u2("metadata"),e[3]);var dr=(e,t,n,r)=>{for(var i=0,a=e[t>>1],o=a&&a.length;i<o;i++)t&1?a[i].call(n):r=a[i].call(n,r);return r};var di=(e,t,n,r,i,a)=>{var o,s,l,u,d,c=t&7,p=false,h=false;var v=e.length+1,f=u7[c+5];var g=e[v-1]=[],m=e[v]||(e[v]=[]);var _=(i=i.prototype,uX({get[n](){return ds(this,a)},set[n](x){return du(this,a,x)}},n));for(var b=r.length-1;b>=0;b--){u=dt(c,n,l={},e[3],m);{u.static=p,u.private=h,d=u.access={has:e=>n in e};d.get=e=>e[n];d.set=(e,t)=>e[n]=t}s=(0,r[b])({get:_.get,set:_.set},u),l._=1;if(s===void 0)de(s)&&(_[f]=s);else if(typeof s!=="object"||s===null)u4("Object expected");else de(o=s.get)&&(_.get=o),de(o=s.set)&&(_.set=o),de(o=s.init)&&g.unshift(o)}return _&&uG(i,n,_),i};var da=(e,t,n)=>t.has(e)||u4("Cannot "+n);var ds=(e,t,n)=>(da(e,t,"read from private field"),t.get(e));var dl=(e,t,n)=>t.has(e)?u4("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n);var du=(e,t,n,r)=>(da(e,t,"write to private field"),t.set(e,n),n);// src/sortable/utilities.ts
function dd(e){return e instanceof dj||e instanceof dB}function dc(e){return dd(e.source)&&dd(e.target)}// src/sortable/plugins/SortableKeyboardPlugin.ts
var dp=10;var dh=class extends rj{constructor(e){super(e);const t=tU(()=>{const{dragOperation:t}=e;if(!o8(t.activatorEvent)){return}if(!dd(t.source)){return}if(t.status.initialized){const t=e.registry.plugins.get(lZ);if(t){t.disable();return()=>t.enable()}}});const n=e.monitor.addEventListener("dragmove",(e,t)=>{queueMicrotask(()=>{if(this.disabled||e.defaultPrevented||!e.nativeEvent){return}const{dragOperation:n}=t;if(!o8(e.nativeEvent)){return}if(!dd(n.source)){return}if(!n.shape){return}const{actions:r,collisionObserver:i,registry:a}=t;const{by:o}=e;if(!o){return}const s=dv(o);const{source:l,target:u}=n;const{center:d}=n.shape.current;const c=[];const p=[];tk(()=>{for(const e of a.droppables){const{id:t}=e;if(!e.accepts(l)||t===(u==null?void 0:u.id)&&dd(e)||!e.element){continue}let n=e.shape;const r=new o2(e.element,{getBoundingClientRect:e=>aS(e,void 0,.2)});if(!r.height||!r.width)continue;if(s=="down"&&d.y+dp<r.center.y||s=="up"&&d.y-dp>r.center.y||s=="left"&&d.x-dp>r.center.x||s=="right"&&d.x+dp<r.center.x){c.push(e);e.shape=r;p.push(()=>e.shape=n)}}});e.preventDefault();i.disable();const h=i.computeCollisions(c,ss);tk(()=>p.forEach(e=>e()));const[v]=h;if(!v){return}const{id:f}=v;const{index:g,group:m}=l.sortable;r.setDropTarget(f).then(()=>{const{source:e,target:t,shape:a}=n;if(!e||!dd(e)||!a){return}const{index:o,group:s,target:l}=e.sortable;const u=g!==o||m!==s;const d=u?l:t==null?void 0:t.element;if(!d)return;oj(d);const c=new o2(d);if(!c){return}const p=re.delta(c,re.from(a.current.boundingRectangle),e.alignment);r.move({by:p});if(u){r.setDropTarget(e.id).then(()=>i.enable())}else{i.enable()}})})});this.destroy=()=>{n();t()}}};function dv(e){const{x:t,y:n}=e;if(t>0){return"right"}else if(t<0){return"left"}else if(n>0){return"down"}else if(n<0){return"up"}}// ../helpers/dist/index.js
var df=Object.defineProperty;var dg=Object.defineProperties;var dm=Object.getOwnPropertyDescriptors;var d_=Object.getOwnPropertySymbols;var db=Object.prototype.hasOwnProperty;var dy=Object.prototype.propertyIsEnumerable;var dw=(e,t,n)=>t in e?df(e,t,{enumerable:true,configurable:true,writable:true,value:n}):e[t]=n;var dx=(e,t)=>{for(var n in t||(t={}))if(db.call(t,n))dw(e,n,t[n]);if(d_)for(var n of d_(t)){if(dy.call(t,n))dw(e,n,t[n])}return e};var dA=(e,t)=>dg(e,dm(t));function dY(e,t,n){if(t===n){return e}const r=e.slice();r.splice(n,0,r.splice(t,1)[0]);return r}function dk(e){return"initialIndex"in e&&typeof e.initialIndex==="number"&&"index"in e&&typeof e.index==="number"}function dI(e,t,n){var r,i,a;const{source:o,target:s,canceled:l}=t.operation;if(!o||!s||l){if("preventDefault"in t)t.preventDefault();return e}const u=(e,t)=>e===t||typeof e==="object"&&"id"in e&&e.id===t;if(Array.isArray(e)){const r=e.findIndex(e=>u(e,o.id));const i=e.findIndex(e=>u(e,s.id));if(r===-1||i===-1){if(dk(o)){const r=o.initialIndex;const i=o.index;if(r===i||r<0||r>=e.length){if("preventDefault"in t)t.preventDefault();return e}return n(e,r,i)}return e}if(!l&&"index"in o&&typeof o.index==="number"){const t=o.index;if(t!==r){return n(e,r,t)}}return n(e,r,i)}const d=Object.entries(e);let c=-1;let p;let h=-1;let v;for(const[e,t]of d){if(c===-1){c=t.findIndex(e=>u(e,o.id));if(c!==-1){p=e}}if(h===-1){h=t.findIndex(e=>u(e,s.id));if(h!==-1){v=e}}if(c!==-1&&h!==-1){break}}if(c===-1&&dk(o)){const r=o.initialGroup;const i=o.initialIndex;const a=o.group;const s=o.index;if(r==null||a==null||!(r in e)||!(a in e)){if("preventDefault"in t)t.preventDefault();return e}if(r===a&&i===s){if("preventDefault"in t)t.preventDefault();return e}if(r===a){return dA(dx({},e),{[r]:n(e[r],i,s)})}const l=e[r][i];return dA(dx({},e),{[r]:[...e[r].slice(0,i),...e[r].slice(i+1)],[a]:[...e[a].slice(0,s),l,...e[a].slice(s)]})}if(!o.manager)return e;const{dragOperation:f}=o.manager;const g=(i=(r=f.shape)==null?void 0:r.current.center)!=null?i:f.position.current;if(v==null){if(s.id in e){const t=s.shape&&g.y>s.shape.center.y?e[s.id].length:0;v=s.id;h=t}}if(p==null||v==null||p===v&&c===h){if(p!=null&&p===v&&c===h&&dk(o)){const t=o.group!=null&&o.group!==p;const r=o.index!==c;if(t||r){const t=(a=o.group)!=null?a:p;if(t in e){if(p===t){return dA(dx({},e),{[p]:n(e[p],c,o.index)})}const r=e[p][c];return dA(dx({},e),{[p]:[...e[p].slice(0,c),...e[p].slice(c+1)],[t]:[...e[t].slice(0,o.index),r,...e[t].slice(o.index)]})}}}if("preventDefault"in t)t.preventDefault();return e}if(p===v){return dA(dx({},e),{[p]:n(e[p],c,h)})}const m=s.shape&&Math.round(g.y)>Math.round(s.shape.center.y);const _=m?1:0;const b=e[p][c];return dA(dx({},e),{[p]:[...e[p].slice(0,c),...e[p].slice(c+1)],[v]:[...e[v].slice(0,h+_),b,...e[v].slice(h+_)]})}function dq(e,t){return dI(e,t,dY)}var dC="__default__";var dD=class extends rj{constructor(e){super(e);const t=()=>{const t=/* @__PURE__ */new Map;for(const n of e.registry.droppables){if(n instanceof dj){const{sortable:e}=n;const{group:r}=e;let i=t.get(r);if(!i){i=/* @__PURE__ */new Set;t.set(r,i)}i.add(e)}}for(const[e,n]of t){t.set(e,new Set(dz(n)))}return t};const n=[e.monitor.addEventListener("dragover",(e,n)=>{if(this.disabled){return}const{dragOperation:r}=n;const{source:i,target:a}=r;if(!dd(i)||!dd(a)){return}if(i.sortable===a.sortable){return}const o=t();const s=i.sortable.group===a.sortable.group;const l=o.get(i.sortable.group);const u=s?l:o.get(a.sortable.group);if(!l||!u)return;queueMicrotask(()=>{if(e.defaultPrevented)return;n.renderer.rendering.then(()=>{var r,d,c;const p=t();for(const[e,t]of o.entries()){const n=Array.from(t).entries();for(const[t,i]of n){if(i.index!==t||i.group!==e||!((r=p.get(e))==null?void 0:r.has(i))){return}}}const h=i.sortable.element;const v=a.sortable.element;if(!v||!h){return}if(!s&&a.id===i.sortable.group){return}const f=dz(l);const g=s?f:dz(u);const m=(d=i.sortable.group)!=null?d:dC;const _=(c=a.sortable.group)!=null?c:dC;const b={[m]:f,[_]:g};const y=dq(b,e);if(b===y)return;const w=y[_].indexOf(i.sortable);const A=y[_].indexOf(a.sortable);n.collisionObserver.disable();dE(h,w,v,A);tk(()=>{for(const[e,t]of y[m].entries()){t.index=e}if(!s){for(const[e,t]of y[_].entries()){t.group=a.sortable.group;t.index=e}}});n.actions.setDropTarget(i.id).then(()=>n.collisionObserver.enable())})})}),e.monitor.addEventListener("dragend",(e,n)=>{if(!e.canceled){return}const{dragOperation:r}=n;const{source:i}=r;if(!dd(i)){return}if(i.sortable.initialIndex===i.sortable.index&&i.sortable.initialGroup===i.sortable.group){return}queueMicrotask(()=>{const e=t();const r=e.get(i.sortable.initialGroup);if(!r)return;n.renderer.rendering.then(()=>{for(const[t,n]of e.entries()){const e=Array.from(n).entries();for(const[n,r]of e){if(r.index!==n||r.group!==t){return}}}const t=dz(r);const n=i.sortable.element;const a=t[i.sortable.initialIndex];const o=a==null?void 0:a.element;if(!a||!o||!n){return}dE(n,a.index,o,i.index);tk(()=>{for(const[t,n]of e.entries()){const e=Array.from(n).values();for(const t of e){t.index=t.initialIndex;t.group=t.initialGroup}}})})})})];this.destroy=()=>{for(const e of n){e()}}}};function dE(e,t,n,r){const i=r<t?"afterend":"beforebegin";n.insertAdjacentElement(i,e)}function dS(e,t){return e.index-t.index}function dz(e){return Array.from(e).sort(dS)}// src/sortable/sortable.ts
var dT=[dh,dD];var dM={duration:250,easing:"cubic-bezier(0.25, 1, 0.5, 1)",idle:false};var dH=new nO;var dP,dO,dF,dN,dK,dW,dR,dL;dO=[nd],dP=[nd];var dU=class{constructor(e,t){dl(this,dN,dr(dF,8,this)),dr(dF,11,this);dl(this,dK);dl(this,dW);dl(this,dR,dr(dF,12,this)),dr(dF,15,this);dl(this,dL);this.register=()=>{tk(()=>{var e,t;(e=this.manager)==null?void 0:e.registry.register(this.droppable);(t=this.manager)==null?void 0:t.registry.register(this.draggable)});return()=>this.unregister()};this.unregister=()=>{tk(()=>{var e,t;(e=this.manager)==null?void 0:e.registry.unregister(this.droppable);(t=this.manager)==null?void 0:t.registry.unregister(this.draggable)})};this.destroy=()=>{tk(()=>{this.droppable.destroy();this.draggable.destroy()})};var n=e,{effects:r=()=>[],group:i,index:a,sensors:o,type:s,transition:l=dM,plugins:u=dT}=n,d=u8(n,["effects","group","index","sensors","type","transition","plugins"]);this.droppable=new dj(d,t,this);this.draggable=new dB(u3(u5({},d),{effects:()=>[()=>{var e,t,n;const r=(e=this.manager)==null?void 0:e.dragOperation.status;if((r==null?void 0:r.initializing)&&this.id===((n=(t=this.manager)==null?void 0:t.dragOperation.source)==null?void 0:n.id)){dH.clear(this.manager)}if(r==null?void 0:r.dragging){dH.set(this.manager,this.id,tq(()=>({initialIndex:this.index,initialGroup:this.group})))}},()=>{const{index:e,group:t,manager:n}=this;const r=ds(this,dW);const i=ds(this,dK);if(e!==r||t!==i){du(this,dW,e);du(this,dK,t);this.animate()}},()=>{const{target:e}=this;const{feedback:t,isDragSource:n}=this.draggable;if(t=="move"&&n){this.droppable.disabled=!e}},()=>{const{manager:e}=this;for(const t of u){e==null?void 0:e.registry.register(t)}},...r()],type:s,sensors:o}),t,this);du(this,dL,d.element);this.manager=t;this.index=a;du(this,dW,a);this.group=i;du(this,dK,i);this.type=s;this.transition=l}get initialIndex(){var e,t;return(t=(e=dH.get(this.manager,this.id))==null?void 0:e.initialIndex)!=null?t:this.index}get initialGroup(){var e,t;return(t=(e=dH.get(this.manager,this.id))==null?void 0:e.initialGroup)!=null?t:this.group}animate(){tq(()=>{const{manager:e,transition:t}=this;const{shape:n}=this.droppable;if(!e)return;const{idle:r}=e.dragOperation.status;if(!n||!t||r&&!t.idle){return}e.renderer.rendering.then(()=>{const{element:r}=this;if(!r){return}const i=this.refreshShape();if(!i){return}const a={x:n.boundingRectangle.left-i.boundingRectangle.left,y:n.boundingRectangle.top-i.boundingRectangle.top};const{translate:o}=oC(r);const s=o$(r,o,false);const l=o$(r,o);if(a.x||a.y){const n=aN(aA(r))?u3(u5({},t),{duration:0}):t;oG({element:r,keyframes:{translate:[`${s.x+a.x}px ${s.y+a.y}px ${s.z}`,`${l.x}px ${l.y}px ${l.z}`]},options:n}).then(()=>{if(!e.dragOperation.status.dragging){this.droppable.shape=void 0}})}})})}get manager(){return this.draggable.manager}set manager(e){tk(()=>{this.draggable.manager=e;this.droppable.manager=e})}set element(e){tk(()=>{const t=ds(this,dL);const n=this.droppable.element;const r=this.draggable.element;if(!n||n===t){this.droppable.element=e}if(!r||r===t){this.draggable.element=e}du(this,dL,e)})}get element(){var e,t;const n=ds(this,dL);if(!n)return;return(t=(e=aB.get(n))!=null?e:n)!=null?t:this.droppable.element}set target(e){this.droppable.element=e}get target(){return this.droppable.element}set source(e){this.draggable.element=e}get source(){return this.draggable.element}get disabled(){return this.draggable.disabled&&this.droppable.disabled}set feedback(e){this.draggable.feedback=e}set disabled(e){tk(()=>{this.droppable.disabled=e;this.draggable.disabled=e})}set data(e){tk(()=>{this.droppable.data=e;this.draggable.data=e})}set handle(e){this.draggable.handle=e}set id(e){tk(()=>{this.droppable.id=e;this.draggable.id=e})}get id(){return this.droppable.id}set sensors(e){this.draggable.sensors=e}set modifiers(e){this.draggable.modifiers=e}set collisionPriority(e){this.droppable.collisionPriority=e}set collisionDetector(e){this.droppable.collisionDetector=e!=null?e:so}set alignment(e){this.draggable.alignment=e}get alignment(){return this.draggable.alignment}set type(e){tk(()=>{this.droppable.type=e;this.draggable.type=e})}get type(){return this.draggable.type}set accept(e){this.droppable.accept=e}get accept(){return this.droppable.accept}get isDropTarget(){return this.droppable.isDropTarget}/**
   * A boolean indicating whether the sortable item is the source of a drag operation.
   */get isDragSource(){return this.draggable.isDragSource}/**
   * A boolean indicating whether the sortable item is being dragged.
   */get isDragging(){return this.draggable.isDragging}/**
   * A boolean indicating whether the sortable item is being dropped.
   */get isDropping(){return this.draggable.isDropping}get status(){return this.draggable.status}refreshShape(){return this.droppable.refreshShape()}accepts(e){return this.droppable.accepts(e)}};dF=u9();dN=new WeakMap;dK=new WeakMap;dW=new WeakMap;dR=new WeakMap;dL=new WeakMap;di(dF,4,"index",dO,dU,dN);di(dF,4,"group",dP,dU,dR);dn(dF,dU);var dB=class extends uD{constructor(e,t,n){super(e,t);this.sortable=n}get index(){return this.sortable.index}get initialIndex(){return this.sortable.initialIndex}get group(){return this.sortable.group}get initialGroup(){return this.sortable.initialGroup}};var dj=class extends uK{constructor(e,t,n){super(e,t);this.sortable=n}get index(){return this.sortable.index}get group(){return this.sortable.group}};//# sourceMappingURL=sortable.js.map
//# sourceMappingURL=sortable.js.map
;// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/modals/question-previews/OrderingPreview.tsx
var dV=(e,t)=>String(e.answer_id||t);var dQ=e=>{var{answers:t}=e;var n=(0,o.useRef)(null);var[r,i]=(0,o.useState)(()=>t.map(dV));var s=(0,o.useMemo)(()=>t.reduce((e,t,n)=>{e[dV(t,n)]=t;return e},{}),[t]);(0,o.useEffect)(()=>{i(t.map(dV))},[t]);(0,o.useEffect)(()=>{var e=n.current;if(!e){return}var t=new uy({sensors:[uh,un]});var r=Array.from(e.querySelectorAll('.tutor-quiz-question-option[data-option="draggable"]')).map((e,n)=>{var r=e.querySelector("[data-grab-handle]");var i;return new dU({id:(i=e.dataset.id)!==null&&i!==void 0?i:String(n),index:n,element:e,handle:r!==null&&r!==void 0?r:undefined},t)});t.monitor.addEventListener("dragstart",e=>{var t,n;(n=e.operation.source)===null||n===void 0?void 0:(t=n.element)===null||t===void 0?void 0:t.setAttribute("data-option","dragging")});t.monitor.addEventListener("dragend",t=>{var n,r;(r=t.operation.source)===null||r===void 0?void 0:(n=r.element)===null||n===void 0?void 0:n.setAttribute("data-option","draggable");requestAnimationFrame(()=>{var t=Array.from(e.querySelectorAll(".tutor-quiz-question-option[data-id]")).flatMap(e=>e.dataset.id?[e.dataset.id]:[]);i([...new Set(t)])})});return()=>{r.forEach(e=>e.destroy())}},[r]);return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{ref:n,className:"tutor-quiz-question-options",children:/*#__PURE__*/(0,a/* .jsx */.Y)(b/* ["default"] */.A,{each:r,children:(e,t)=>{var n=s[e];if(!n){return null}return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{className:"tutor-quiz-question-option","data-option":"draggable","data-id":e,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{"data-option-order":true,children:t+1}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{"data-title":true,children:[n.image_url?/*#__PURE__*/(0,a/* .jsx */.Y)("img",{src:n.image_url,alt:n.answer_title}):null,/*#__PURE__*/(0,a/* .jsx */.Y)("div",{"data-question-title":true,children:n.answer_title})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button","data-grab-handle":true,"aria-label":n.answer_title,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"grabHandle",width:24,height:24})})]},e)}})})};/* export default */const dG=dQ;// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/modals/question-previews/PinImagePreview.tsx
var d$="data-tutor-pin-image-preview-script";/**
 * Loads `tutor-pro/assets/js/pin-image-question.js` in the preview iframe (same pattern as
 * {@link ScalePreview}, {@link CoordinatesPreview} + Pro `learning-area/quiz/questions/pin-image.php`).
 */var dX=e=>{var{answers:t}=e;var n,r;var i=(0,o.useRef)(null);var s=(n=t[0])===null||n===void 0?void 0:n.image_url;var l;var u=String((l=(r=t[0])===null||r===void 0?void 0:r.answer_id)!==null&&l!==void 0?l:"preview");var d="tutor-pin-image-instruction-".concat(u);var c="tutor-pin-image-status-".concat(u);(0,o.useEffect)(()=>{var e=i.current;if(!e){return}var t=e.ownerDocument;if(!t||t===document){return}if(t.head.querySelector("[".concat(d$,"]"))){var n=t.createElement("script");n.textContent="if(window._tutorPinImageInitAll){window._tutorPinImageInitAll();}";t.head.appendChild(n);return}var r=P/* .tutorConfig.site_url.replace */.P.site_url.replace(/\/$/,"");var a=t.createElement("script");a.setAttribute(d$,"1");a.textContent="\n			(function(){\n				var scriptEl = document.createElement('script');\n				scriptEl.src = '".concat(r,"/wp-content/plugins/tutor-pro/assets/js/pin-image-question.js';\n				scriptEl.onload = function(){\n					if(typeof window._tutorPinImageInitAll === 'function'){\n						window._tutorPinImageInitAll();\n					}\n				};\n				document.head.appendChild(scriptEl);\n			})();\n		");t.head.appendChild(a)},[s,u]);if(!s){return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"tutor-quiz-question-options",children:/*#__PURE__*/(0,a/* .jsx */.Y)("p",{className:"tutor-fs-7 tutor-color-secondary",children:(0,v.__)("No background image configured for this Pin question.","tutor")})})}return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{ref:i,id:"tutor-pin-image-question-".concat(u),className:"tutor-quiz-question-options tutor-pin-image-question","data-question-type":"pin_image","data-question-id":u,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{className:"tutor-pin-image-wrapper",tabIndex:0,role:"application","aria-describedby":"".concat(d," ").concat(c),"aria-label":(0,v.__)("Pin on image: click or use keyboard to place and move your pin.","tutor"),children:[/*#__PURE__*/(0,a/* .jsx */.Y)("img",{id:"tutor-pin-image-bg-".concat(u),src:s,alt:(0,v.__)("Pin on image question","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)("span",{className:"tutor-pin-image-marker","aria-hidden":"true"})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("p",{id:d,className:"tutor-quiz-a11y-sr-only",children:(0,v.__)("Press Enter to place the pin. Use arrow keys to nudge the position, Shift with arrow keys for larger steps, and C to clear the pin.","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{id:c,className:"tutor-quiz-a11y-live-region tutor-quiz-a11y-sr-only","aria-live":"polite","aria-atomic":"true",role:"status"}),/*#__PURE__*/(0,a/* .jsx */.Y)("input",{type:"hidden",id:"tutor-pin-image-x-".concat(u),name:"preview[answers][pin][x]",defaultValue:"",readOnly:true}),/*#__PURE__*/(0,a/* .jsx */.Y)("input",{type:"hidden",id:"tutor-pin-image-y-".concat(u),name:"preview[answers][pin][y]",defaultValue:"",readOnly:true})]})};/* export default */const dZ=dX;// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/modals/question-previews/PuzzlePreview.tsx
var dJ="data-tutor-puzzle-preview-script";var d0=e=>{var t=typeof e==="number"?e:Number(e);var n=Number.isFinite(t)&&t>0?Math.round(t):4;return Math.max(2,Math.min(7,n))};/**
 * Course Builder puzzle preview — loads Tutor Pro `puzzle-question.js` in the preview iframe
 * (same pattern as {@link DrawImagePreview}, {@link PinImagePreview}, {@link ScalePreview}).
 */var d1=e=>{var{answers:t,gridSize:n,questionId:r}=e;var i=t[0];var s=(i===null||i===void 0?void 0:i.image_url)||(i===null||i===void 0?void 0:i.answer_two_gap_match)||"";var l=d0(n);var u=(0,o.useRef)(null);(0,o.useEffect)(()=>{if(!s){return}var e=u.current;if(!e){return}var t=e.ownerDocument;if(!t||t===document){return}if(t.head.querySelector("[".concat(dJ,"]"))){var n=t.createElement("script");n.textContent="if(window._tutorPuzzlePreviewInitAll){window._tutorPuzzlePreviewInitAll();}";t.head.appendChild(n);return}var r=P/* .tutorConfig.site_url.replace */.P.site_url.replace(/\/$/,"");var i=t.createElement("script");i.setAttribute(dJ,"1");i.textContent="\n			(function(){\n				var scriptEl = document.createElement('script');\n				scriptEl.src = '".concat(r,"/wp-content/plugins/tutor-pro/assets/js/puzzle-question.js';\n				scriptEl.onload = function(){\n					if(typeof window._tutorPuzzlePreviewInitAll === 'function'){\n						window._tutorPuzzlePreviewInitAll();\n					}\n				};\n				document.head.appendChild(scriptEl);\n			})();\n		");t.head.appendChild(i)},[s,l,r]);if(!s){return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"quiz-question-ans-choice-area tutor-mt-40 tutor-puzzle-question question-type-puzzle",children:/*#__PURE__*/(0,a/* .jsx */.Y)("p",{className:"tutor-fs-7 tutor-color-secondary",children:(0,v.__)("No source image configured for this Puzzle question.","tutor")})})}if(!P/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url){return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"quiz-question-ans-choice-area tutor-mt-40 tutor-puzzle-question question-type-puzzle",children:/*#__PURE__*/(0,a/* .jsx */.Y)("p",{className:"tutor-fs-7 tutor-color-secondary",children:(0,v.__)("Puzzle preview requires Tutor LMS Pro.","tutor")})})}var d="tutor-puzzle-state-preview-".concat(r);var c="tutor-puzzle-instruction-".concat(r);var p="tutor-puzzle-status-".concat(r);var h="".concat(c," ").concat(p);return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{ref:u,className:"quiz-question-ans-choice-area tutor-mt-40 tutor-puzzle-question question-type-puzzle","data-tutor-puzzle-defer-init":"true","data-question-type":"puzzle","data-question-id":String(r),"data-grid-size":String(l),"data-image-url":s,"data-puzzle-token":"",children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{className:"tutor-puzzle-playground tutor-quiz-interaction-focus-target",tabIndex:0,role:"application","aria-describedby":h,"aria-label":(0,v.__)("Puzzle board: use arrow keys to choose a slot, then press Enter to place the selected piece.","tutor"),children:[/*#__PURE__*/(0,a/* .jsx */.Y)("img",{className:"tutor-puzzle-reference-image",src:s,alt:(0,v.__)("Puzzle reference image","tutor"),style:{opacity:.3}}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"tutor-puzzle-slots","aria-hidden":"true"})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"tutor-puzzle-scatter tutor-quiz-interaction-focus-target",tabIndex:0,role:"listbox","aria-describedby":h,"aria-label":(0,v.__)("Puzzle pieces: use arrow keys to choose a piece, then Tab to the board and press Enter to place it.","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)("p",{id:c,className:"tutor-quiz-a11y-sr-only",children:(0,v.__)("In the piece pool, use arrow keys to select a piece. Tab to the puzzle board, use arrow keys to select a slot, and press Enter to place the piece at that slot. Pieces snap only when correct; wrong placements stay on the board like drag-and-drop. Press Backspace or Delete on the board to return a piece to the pool. Progress counts locked pieces only.","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{id:p,className:"tutor-quiz-a11y-live-region tutor-quiz-a11y-sr-only","aria-live":"polite","aria-atomic":"true",role:"status"}),/*#__PURE__*/(0,a/* .jsx */.Y)("input",{type:"hidden",id:d,name:"",value:""})]})};/* export default */const d2=d1;// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/modals/question-previews/ScalePreview.tsx
var d4="data-tutor-scale-preview-script";var d6=e=>{var{answers:t}=e;var n,r;var i=(0,o.useRef)(null);var s;var l=(s=(n=t[0])===null||n===void 0?void 0:n.answer_two_gap_match)!==null&&s!==void 0?s:"";var u={};try{var d=JSON.parse(l);var c;u=(c=d===null||d===void 0?void 0:d.config)!==null&&c!==void 0?c:{}}catch(e){// use defaults
}var p;var h=(p=u.min)!==null&&p!==void 0?p:0;var f;var g=(f=u.max)!==null&&f!==void 0?f:100;var _;var b=(_=u.step)!==null&&_!==void 0?_:1;var y;var w=(y=u.defaultValue)!==null&&y!==void 0?y:(h+g)/2;var A;var Y=(A=u.pxPerUnit)!==null&&A!==void 0?A:10;var k;var I=(k=u.labelEvery)!==null&&k!==void 0?k:Math.max(1,(g-h)/10);var q;var C=(q=u.minorTickEvery)!==null&&q!==void 0?q:Math.max(1,(g-h)/50);var D;var E=(D=u.precision)!==null&&D!==void 0?D:b<1?2:0;var S;// Unique IDs matching scale-question.js selectors
var z=String((S=(r=t[0])===null||r===void 0?void 0:r.answer_id)!==null&&S!==void 0?S:"preview");var T="tutor-scale-instruction-".concat(z);var M="tutor-scale-live-".concat(z);var H=JSON.stringify({min:h,max:g,step:b,defaultValue:w,pxPerUnit:Y,labelEvery:I,minorTickEvery:C,precision:E});(0,o.useEffect)(()=>{var e=i.current;if(!e)return;var t=e.ownerDocument;if(!t||t===document)return;if(t.head.querySelector("[".concat(d4,"]"))){// Script already present — reset the wrapper init flag so it re-initializes
e.removeAttribute("data-tutor-scale-init");// Re-trigger initAll via a tiny inline script on the iframe window
var n=t.createElement("script");n.textContent="if(window._tutorScaleInitAll){window._tutorScaleInitAll();}";t.head.appendChild(n);return}var r=P/* .tutorConfig.site_url.replace */.P.site_url.replace(/\/$/,"");var a=t.createElement("script");a.setAttribute(d4,"1");// Patch initAll onto window so we can call it on re-renders
a.textContent="\n      (function(){\n        var scriptEl = document.createElement('script');\n        scriptEl.src = '".concat(r,"/wp-content/plugins/tutor-pro/assets/js/scale-question.js';\n        scriptEl.onload = function(){\n          // Expose initAll for re-use on subsequent renders\n          if(typeof initAll === 'function'){ window._tutorScaleInitAll = function(){ initAll(false); }; }\n        };\n        document.head.appendChild(scriptEl);\n      })();\n    ");t.head.appendChild(a)},[]);return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{ref:i,id:"tutor-scale-question-".concat(z),className:"tutor-quiz-question-options tutor-scale-question","data-question-type":"scale","data-question-id":String(z),"data-scale-config":H,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{className:"tutor-scale-slider-wrapper",children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"tutor-scale-container",id:"tutor-scale-container-".concat(z),role:"slider",tabIndex:0,"aria-valuemin":h,"aria-valuemax":g,"aria-valuenow":w,"aria-valuetext":String(w),"aria-describedby":T,"aria-label":(0,v.__)("Interactive scale: drag or use arrow keys to select your answer value.","tutor"),children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"tutor-scale",id:"tutor-scale-".concat(z)})}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{className:"tutor-scale-bubble",id:"tutor-scale-bubble-".concat(z),children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"tutor-scale-bubble-value",children:w}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"tutor-scale-bubble-pointer"})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{className:"tutor-scale-instructions",children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"tutor-scale-hand-icon","aria-hidden":"true",children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"handSwipeRight",width:20,height:20})}),/*#__PURE__*/(0,a/* .jsx */.Y)("span",{id:T,className:"tutor-scale-instruction-text",children:(0,v.__)("Move the scale left or right to set the correct value","tutor")})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{id:M,className:"tutor-quiz-a11y-live-region tutor-quiz-a11y-sr-only","aria-live":"polite","aria-atomic":"true",role:"status"})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("input",{type:"hidden",id:"tutor-scale-value-".concat(z),name:"preview[answers][scale][value]",defaultValue:"",readOnly:true})]})};/* export default */const d5=d6;// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/modals/question-previews/TrueFalsePreview.tsx
var d3=e=>{var{answers:t}=e;var[n,r]=(0,o.useState)("");var i=(e,t)=>{if(e.key===" "||e.key==="Enter"){e.preventDefault();r(t)}};return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"tutor-quiz-question-options",children:/*#__PURE__*/(0,a/* .jsx */.Y)(b/* ["default"] */.A,{each:t,children:(e,t)=>{var o=String(e.answer_id||t);return/*#__PURE__*/(0,a/* .jsxs */.FD)("label",{className:"tutor-quiz-question-option","data-preview-selected":n===o?"true":undefined,tabIndex:0,onKeyDown:e=>i(e,o),children:[/*#__PURE__*/(0,a/* .jsx */.Y)("input",{className:"tutor-hidden",type:"radio",name:"tutor-question-preview-true-false",value:o,checked:n===o,onChange:()=>r(o)}),/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:(0,v.__)("True","tutor")===e.answer_title?"check2":"cross",width:20,height:20}),e.answer_title]},e.answer_id||t)}})})};/* export default */const d8=d3;// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/modals/question-previews/UnsupportedPreview.tsx
var d9=()=>/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"tutor-quiz-question-options",children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"tutor-quiz-question-option",children:(0,v.__)("Preview is not available for this question type yet.","tutor")})});/* export default */const d7=d9;// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/modals/QuestionPreviewModal.tsx
var ce=P/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;/**
 * Tutor Pro bundles several quiz question styles in `front.css`, including puzzle
 * (`tutor-pro/assets/src/scss/quiz/_quiz_puzzle.scss` → `front.css`), same pattern as the live quiz UI.
 */var ct="/wp-content/plugins/tutor-pro/assets/css/front.css";var cn='<!doctype html><html><head><meta charset="utf-8" /></head><body><div id="preview-root"></div></body></html>';var cr=["/wp-content/plugins/tutor/assets/css/tutor-learning-area.min.css","/wp-content/plugins/tutor/assets/css/tutor-core.min.css","/wp-content/plugins/tutor/assets/css/tutor-kids.min.css"];if(ce){cr.push(ct)}// Prefetch the stylesheets automatically so they are loaded in the background
// before the user even opens the preview modal.
if(typeof document!=="undefined"){var ci=P/* .tutorConfig.site_url.replace */.P.site_url.replace(/\/$/,"");if(ci){cr.forEach(e=>{var t=document.createElement("link");t.rel="prefetch";t.as="style";t.href="".concat(ci).concat(e);document.head.appendChild(t)})}}var ca=e=>{var{question:t,onClose:n}=e;var[r,i]=(0,o.useState)("desktop");var[s,u]=(0,o.useState)(false);var d=(0,o.useRef)(null);var[c,p]=(0,o.useState)(null);var h=cl(t);(0,o.useEffect)(()=>{var e=d.current;if(!e){return}var t=()=>{p(e.contentDocument)};t();e.addEventListener("load",t);return()=>{e.removeEventListener("load",t)}},[]);(0,o.useEffect)(()=>{if(!c){return}c.querySelectorAll('[data-preview-cloned="true"]').forEach(e=>e.remove());c.querySelectorAll('[data-preview-external-style="true"]').forEach(e=>e.remove());Array.from(document.querySelectorAll('style, link[rel="stylesheet"]')).forEach(e=>{var t=e.cloneNode(true);t.setAttribute("data-preview-cloned","true");c.head.appendChild(t)});var e=P/* .tutorConfig.site_url.replace */.P.site_url.replace(/\/$/,"");if(!e||cr.length===0){u(true);return}var t=0;var n=cr.length;var r=()=>{t++;if(t===n){u(true)}};cr.forEach(t=>{var n=c.createElement("link");n.rel="stylesheet";n.href="".concat(e).concat(t);n.setAttribute("data-preview-external-style","true");n.onload=r;n.onerror=r;c.head.appendChild(n)})},[c]);(0,o.useEffect)(()=>{var e;if(!(c===null||c===void 0?void 0:c.body)){return}c.body.setAttribute("data-preview-device",r);if(((e=P/* .tutorConfig.settings */.P.settings)===null||e===void 0?void 0:e.learning_mode)==="kids"){c.body.setAttribute("data-tutor-ui","kids");return}c.body.removeAttribute("data-tutor-ui")},[r,c]);(0,o.useEffect)(()=>{if(!c){return}var e=c.defaultView;if(!e){return}var t=()=>{var e;(e=c.body)===null||e===void 0?void 0:e.classList.add("tutor-keyboard-nav")};var n=()=>{var e;(e=c.body)===null||e===void 0?void 0:e.classList.remove("tutor-keyboard-nav")};var r=e=>{if(e.key==="Tab"){t()}};// Listen on BOTH outer window and iframe window.
// When Tab moves focus from outside the page into the iframe the keydown
// fires on the outer window, not iframeWindow — so we need both to catch
// the very first Tab that lands on the first input inside the iframe.
window.addEventListener("keydown",r);e.addEventListener("keydown",r);window.addEventListener("mousedown",n);e.addEventListener("mousedown",n);window.addEventListener("touchstart",n);e.addEventListener("touchstart",n);return()=>{window.removeEventListener("keydown",r);e.removeEventListener("keydown",r);window.removeEventListener("mousedown",n);e.removeEventListener("mousedown",n);window.removeEventListener("touchstart",n);e.removeEventListener("touchstart",n)}},[c]);(0,o.useLayoutEffect)(()=>{if(!c||!d.current){return}var e=d.current;var t=c.getElementById("preview-root");if(!t){return}var n=()=>{e.style.height="".concat(t.scrollHeight,"px")};n();if(typeof ResizeObserver==="undefined"){var r=requestAnimationFrame(n);return()=>{cancelAnimationFrame(r)}}var i=new ResizeObserver(()=>{n()});i.observe(t);return()=>{i.disconnect()}},[r,c,t]);return/*#__PURE__*/(0,a/* .jsx */.Y)(to/* ["default"] */.A,{blurPrevious:false,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:cp.container,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:cp.wrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:Y/* .styleUtils.crossButton */.x.crossButton,onClick:n,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"cross"})}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:cp.questionPreviewWrapper({activeTab:r}),children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:cp.scrollContainer,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("iframe",{ref:d,title:(0,v.__)("Question preview","tutor"),srcDoc:cn,css:cp.previewIframe({activeTab:r,cssLoaded:s})}),(c===null||c===void 0?void 0:c.getElementById("preview-root"))?/*#__PURE__*/(0,l.createPortal)(/*#__PURE__*/(0,a/* .jsx */.Y)(co,{question:t,previewQuestionStyleType:h},"".concat(t.question_id,"-").concat(t.question_type)),c.getElementById("preview-root")):null]})}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:cp.tabsWrapper,children:/*#__PURE__*/(0,a/* .jsx */.Y)(te/* ["default"] */.A,{wrapperCss:cp.tabsStyle,activeTab:r,onChange:e=>i(e),tabList:[{label:"",value:"desktop",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"mac",width:20,height:20})},{label:"",value:"mobile",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"iosPhone",width:24,height:24})}]})})]})})})};var co=e=>{var{question:t,previewQuestionStyleType:n}=e;return/*#__PURE__*/(0,a/* .jsxs */.FD)(a/* .Fragment */.FK,{children:[/*#__PURE__*/(0,a/* .jsx */.Y)("style",{children:cd()}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"tutor-preview-stage",children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"tutor-quiz tutor-quiz-submission",children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"tutor-quiz-question-wrapper",children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{className:"tutor-quiz-question","data-question":n,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{className:"tutor-quiz-question-header",children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"tutor-quiz-question-number",children:t.question_order||1}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{className:"tutor-quiz-question-title",children:[t.question_title,/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:t.question_description,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{className:"tutor-p2 tutor-text-secondary tutor-preview-description",children:/*#__PURE__*/(0,a/* .jsx */.Y)(ta/* ["default"] */.A,{value:t.question_description,readonly:true,min_height:24,onChange:()=>{}})})})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:t.question_settings.show_question_mark,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("span",{className:"tutor-badge tutor-badge-rounded tutor-text-secondary",children:[/*#__PURE__*/(0,a/* .jsx */.Y)("span",{className:"tutor-text-subdued",children:(0,v.__)("Points: ","tutor")}),t.question_settings.question_mark]})})]}),cu(t)]})})})})]})};var cs=e=>{if(e.question_type==="single_choice"){return"multiple_choice"}if(e.question_type==="matching"&&e.question_settings.is_image_matching){return"image_matching"}return e.question_type};var cl=e=>{var t=cs(e);if(t==="image_matching"){return"matching"}return t};var cu=e=>{switch(cs(e)){case"true_false":return/*#__PURE__*/(0,a/* .jsx */.Y)(d8,{answers:e.question_answers});case"multiple_choice":return/*#__PURE__*/(0,a/* .jsx */.Y)(uB,{answers:e.question_answers,hasMultipleCorrectAnswer:e.question_settings.has_multiple_correct_answer});case"open_ended":case"short_answer":return/*#__PURE__*/(0,a/* .jsx */.Y)(uV,{questionType:e.question_type});case"fill_in_the_blank":return/*#__PURE__*/(0,a/* .jsx */.Y)(ty,{answers:e.question_answers});case"matching":case"image_matching":return/*#__PURE__*/(0,a/* .jsx */.Y)(uL,{answers:e.question_answers,isImageMatching:!!e.question_settings.is_image_matching});case"image_answering":return/*#__PURE__*/(0,a/* .jsx */.Y)(tx,{answers:e.question_answers});case"ordering":return/*#__PURE__*/(0,a/* .jsx */.Y)(dG,{answers:e.question_answers});case"pin_image":var t,n;var r;return/*#__PURE__*/(0,a/* .jsx */.Y)(dZ,{answers:e.question_answers},"pin-".concat(String(e.question_id),"-").concat((r=(n=e.question_answers)===null||n===void 0?void 0:(t=n[0])===null||t===void 0?void 0:t.image_url)!==null&&r!==void 0?r:""));case"draw_image":var i,o;var s;return/*#__PURE__*/(0,a/* .jsx */.Y)(tm,{answers:e.question_answers},"draw-".concat(String(e.question_id),"-").concat((s=(o=e.question_answers)===null||o===void 0?void 0:(i=o[0])===null||i===void 0?void 0:i.image_url)!==null&&s!==void 0?s:""));case"scale":return/*#__PURE__*/(0,a/* .jsx */.Y)(d5,{answers:e.question_answers});case"coordinates":var l,u;var d;return/*#__PURE__*/(0,a/* .jsx */.Y)(th,{axisRange:(l=e.question_settings)===null||l===void 0?void 0:l.coordinates_axis_range},"coordinates-".concat(String(e.question_id),"-").concat((d=(u=e.question_settings)===null||u===void 0?void 0:u.coordinates_axis_range)!==null&&d!==void 0?d:""));case"puzzle":{var c,p;var h=(c=e.question_answers)===null||c===void 0?void 0:c[0];var v=(h===null||h===void 0?void 0:h.image_url)||(h===null||h===void 0?void 0:h.answer_two_gap_match)||"";var f;return/*#__PURE__*/(0,a/* .jsx */.Y)(d2,{answers:e.question_answers,gridSize:e.question_settings.puzzle_grid_size,questionId:e.question_id},"puzzle-".concat(e.question_id,"-").concat((f=(p=e.question_settings)===null||p===void 0?void 0:p.puzzle_grid_size)!==null&&f!==void 0?f:"","-").concat(encodeURIComponent(v)))}default:return/*#__PURE__*/(0,a/* .jsx */.Y)(d7,{})}};var cd=()=>"\n  :root {\n    color-scheme: light;\n  }\n\n  html,\n  body {\n    margin: 0;\n    padding: 0;\n    background: transparent;\n    box-sizing: border-box;\n  }\n\n  body {\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    min-height: 100%;\n    padding: 4px;\n  }\n\n  #preview-root {\n    box-sizing: border-box;\n    width: 100%;\n  }\n\n  .tutor-preview-stage {\n    width: 100%;\n    margin-inline: auto;\n  }\n  \n  .tutor-quiz-submission {\n    padding-top: 0;\n  }\n\n  .tutor-quiz-question-option, \n  .tutor-quiz-question-draggable-header {\n    svg {\n      width: 20px;\n      height: 20px;\n      color: var(--tutor-icon-idle);\n    }\n\n    .tutor-quiz-question-wrapper:has([data-question=\"ordering\"]) & {\n      svg {\n        width: 40px;\n        height: 40px;\n      }\n    }\n  }\n\n  [data-question=fill_in_the_blank] .tutor-quiz-question-input {\n    box-shadow: none;\n  }\n\n  .tutor-quiz-question-option > input.tutor-hidden {\n    display: none !important;\n  }\n\n  [data-grab-handle] {\n    border: 0;\n    background: transparent;\n    color: inherit;\n  }\n\n  .tutor-quiz-question-option-drop-zone {\n    position: relative;\n  }\n\n  .tutor-quiz-question-option-drop-zone [data-option='dropped'] {\n    width: 100%;\n  }\n\n  .tutor-preview-drop-clear {\n    display: inline-flex;\n    align-items: center;\n    justify-content: center;\n    border: 0;\n    padding: 2px;\n    margin-left: 8px;\n    background: transparent;\n    color: var(--tutor-icon-idle);\n    cursor: pointer;\n  }\n\n  .tutor-preview-drop-clear > svg {\n    width: 16px;\n    height: 16px;\n  }\n\n  /*\n   * Clear buttons: DrawImagePreview uses SVGIcon; CoordinatesPreview uses inline eraser SVG (coordinates script clones the button on re-init).\n   */\n  .tutor-coordinates-clear-button > svg,\n  .tutor-draw-image-clear-button > svg {\n    width: 18px;\n    height: 18px;\n    min-width: 18px;\n    min-height: 18px;\n    flex-shrink: 0;\n    color: inherit;\n  }\n\n  body[data-preview-device='mobile'] .tutor-draw-image-question .tutor-draw-image-wrapper,\n  body[data-preview-device='mobile'] .tutor-draw-image-question .tutor-draw-image-reference-inner,\n  body[data-preview-device='mobile'] .tutor-pin-image-question .tutor-pin-image-wrapper,\n  body[data-preview-device='mobile'] .tutor-pin-image-question .tutor-pin-image-reference-inner {\n    width: 100%;\n    height: auto;\n    max-width: 100%;\n  }\n\n  body[data-preview-device='mobile'] .tutor-draw-image-question .tutor-draw-image-wrapper > img,\n  body[data-preview-device='mobile'] .tutor-draw-image-question .tutor-draw-image-reference-bg,\n  body[data-preview-device='mobile'] .tutor-pin-image-question .tutor-pin-image-wrapper > img,\n  body[data-preview-device='mobile'] .tutor-pin-image-question .tutor-pin-image-reference-bg {\n    width: 100%;\n    height: auto;\n    max-width: 100%;\n  }\n\n  body[data-preview-device='mobile'] .tutor-draw-image-question .tutor-draw-image-canvas {\n    width: 100%;\n    height: 100%;\n  }\n\n  /* Keep draw/pin previews fully visible inside modal viewport. */\n  .tutor-quiz-question[data-question='draw_image'] .tutor-draw-image-wrapper,\n  .tutor-quiz-question[data-question='draw_image'] .tutor-draw-image-reference-inner,\n  .tutor-quiz-question[data-question='pin_image'] .tutor-pin-image-wrapper,\n  .tutor-quiz-question[data-question='pin_image'] .tutor-pin-image-reference-inner {\n    height: auto;\n    max-height: min(52vh, 460px);\n  }\n\n  .tutor-quiz-question[data-question='draw_image'] .tutor-draw-image-wrapper > img,\n  .tutor-quiz-question[data-question='draw_image'] .tutor-draw-image-reference-bg,\n  .tutor-quiz-question[data-question='pin_image'] .tutor-pin-image-wrapper > img,\n  .tutor-quiz-question[data-question='pin_image'] .tutor-pin-image-reference-bg {\n    width: auto;\n    height: auto;\n    max-width: 100%;\n    max-height: min(52vh, 460px);\n    object-fit: contain;\n  }\n\n  /* Coordinates graph is a square (canvas width 100% + aspect-ratio); cap like draw/pin so the modal does not scroll. */\n  .tutor-quiz-question[data-question='coordinates'] .tutor-coordinates-grid-container {\n    box-sizing: border-box;\n    width: min(100%, min(52vh, 460px));\n    max-width: 100%;\n    margin-inline: auto;\n  }\n\n  /*\n   * Puzzle preview: board capped at min(52vh, 460px) like draw/pin; piece pool grows with content\n   * (no internal scroll), same as the live student scatter area on mobile.\n   */\n  .tutor-quiz-question[data-question='puzzle'] .quiz-question-ans-choice-area.tutor-puzzle-question {\n    box-sizing: border-box;\n    width: 100%;\n    max-width: 100%;\n    min-width: 0;\n    align-items: center;\n    margin-top: 24px;\n  }\n\n  .tutor-quiz-question[data-question='puzzle'] .tutor-puzzle-playground {\n    box-sizing: border-box;\n    width: auto;\n    max-width: 100%;\n    max-height: min(52vh, 460px);\n    height: auto;\n    flex-shrink: 0;\n    margin-inline: auto;\n    overflow: hidden;\n  }\n\n  .tutor-quiz-question[data-question='puzzle'] .tutor-puzzle-reference-image {\n    display: block;\n    width: auto;\n    height: auto;\n    max-width: 100%;\n    max-height: min(52vh, 460px);\n    object-fit: contain;\n  }\n\n  .tutor-quiz-question[data-question='puzzle'] .tutor-puzzle-scatter {\n    box-sizing: border-box;\n    width: 100%;\n    max-width: 100%;\n    min-height: 96px;\n    margin-top: 12px;\n    overflow: visible;\n  }\n\n  /*\n   * Coordinates preview: default quiz styles use a row flex with justify-content flex-start on\n   * .tutor-quiz-question-options, which leaves the graph hugging the left. Match draw/pin layout\n   * and cap width so the grid sits centered in the preview column.\n   */\n  .tutor-quiz-question[data-question='coordinates'] .tutor-quiz-question-options.tutor-coordinates-question {\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    justify-content: center;\n    width: 100%;\n  }\n\n  .tutor-quiz-question[data-question='coordinates'] .tutor-coordinates-grid-container {\n    box-sizing: border-box;\n    width: 100%;\n    max-width: 420px;\n    margin-inline: auto;\n    align-items: stretch;\n  }\n\n  .tutor-keyboard-nav .tutor-quiz-question:has(:focus-visible) {\n    outline: 1px solid var(--tutor-color-brand, #3e64de);\n  }\n";/* export default */const cc=ca;var cp={container:/*#__PURE__*/(0,h/* .css */.AH)("position:relative;overflow:hidden;top:50%;left:50%;transform:translate(-50%,-50%);max-height:100vh;body:has(#wpadminbar) &{top:calc(50% + 16px);max-height:calc(100vh - 32px);}",_/* .Breakpoint.smallTablet */.EA.smallTablet,"{width:90%;}"),wrapper:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["16"] */.YK["16"],";align-items:center;"),questionPreviewWrapper:e=>{var{activeTab:t}=e;return/*#__PURE__*/(0,h/* .css */.AH)("display:flex;flex-direction:column;overflow:hidden;max-width:",t==="mobile"?"444px":"1220px",";height:calc(100vh - 180px);margin-inline:auto;width:100%;background-color:",_/* .colorTokens.surface.courseBuilder */.I6.surface.courseBuilder,";border-radius:",_/* .borderRadius["14"] */.Vq["14"],";transition:max-width 240ms cubic-bezier(0.22,1,0.36,1);@media (prefers-reduced-motion:reduce){transition:none;}")},scrollContainer:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.overflowYAuto */.x.overflowYAuto,";display:flex;justify-content:center;align-items:flex-start;flex:1;min-height:0;width:100%;padding:",_/* .spacing["12"] */.YK["12"],";"),previewIframe:e=>{var{activeTab:t,cssLoaded:n}=e;return/*#__PURE__*/(0,h/* .css */.AH)("width:100%;max-width:",t==="mobile"?"420px":"960px",";border:0;min-height:100%;background:transparent;display:block;margin-inline:auto;flex:0 0 auto;opacity:",n?1:0,";transition:max-width 240ms cubic-bezier(0.22,1,0.36,1),opacity 160ms ease;@media (prefers-reduced-motion:reduce){transition:none;}")},tabsWrapper:/*#__PURE__*/(0,h/* .css */.AH)("margin-top:",_/* .spacing["16"] */.YK["16"],";span{display:none;}"),tabsStyle:/*#__PURE__*/(0,h/* .css */.AH)("border:1px solid ",_/* .colorTokens.stroke.divider */.I6.stroke.divider,";border-radius:",_/* .borderRadius["8"] */.Vq["8"],";button{min-width:unset;max-height:44px;&[aria-selected='true']{background-color:#e4ebfc;border-radius:",_/* .borderRadius["8"] */.Vq["8"],";}}")};// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/contexts/QuizModalContext.tsx
var ch=/*#__PURE__*/(0,o.createContext)(null);var cv=()=>{var e=(0,o.useContext)(ch);if(!e){throw new Error("useQuizModalContext must be used within a QuizModalContextProvider")}return e};var cf=e=>{var{children:t,quizId:n,topicId:r,contentType:i,validationError:s}=e;var[l,u]=(0,o.useState)("");var d=(0,S/* .useFormContext */.xW)();var c=d.watch("questions")||[];var p=(0,o.useRef)(c);var[h,v]=(0,o.useState)(s||null);var f=c.findIndex(e=>e.question_id===l);(0,o.useEffect)(()=>{if(c.length===0){u("")}else if(p.current.length!==0&&p.current.length<c.length){var e=c.find(e=>!p.current.some(t=>String(t.question_id)===String(e.question_id)));u((e===null||e===void 0?void 0:e.question_id)||"")}else if(f===-1){u(c[0].question_id)}p.current=c;// eslint-disable-next-line react-hooks/exhaustive-deps
},[c.length]);(0,o.useEffect)(()=>{if(f===-1&&l){u("")}},[f,l]);return/*#__PURE__*/(0,a/* .jsx */.Y)(ch.Provider,{value:{activeQuestionIndex:f,activeQuestionId:l,setActiveQuestionId:u,quizId:n,validationError:h,setValidationError:v,contentType:i,topicId:r},children:typeof t==="function"?t({activeQuestionIndex:f,activeQuestionId:l,setActiveQuestionId:u,setValidationError:v}):t})};// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/curriculum/QuestionConditions.tsx
var cg={true_false:{label:(0,v.__)("True/False","tutor"),icon:"quizTrueFalse"},multiple_choice:{label:(0,v.__)("Multiple Choice","tutor"),icon:"quizMultiChoice"},open_ended:{label:(0,v.__)("Open Ended/Essay","tutor"),icon:"quizEssay"},fill_in_the_blank:{label:(0,v.__)("Fill in the Blanks","tutor"),icon:"quizFillInTheBlanks"},short_answer:{label:(0,v.__)("Short Answer","tutor"),icon:"quizShortAnswer"},matching:{label:(0,v.__)("Matching","tutor"),icon:"quizImageMatching"},image_answering:{label:(0,v.__)("Image Answering","tutor"),icon:"quizImageAnswer"},ordering:{label:(0,v.__)("Ordering","tutor"),icon:"quizOrdering"},draw_image:{label:(0,v.__)("Image Marking","tutor"),icon:"quizMarkInTheImage"},scale:{label:(0,v.__)("Range","tutor"),icon:"quizRange"},coordinates:{label:(0,v.__)("Graph","tutor"),icon:"quizGraph"},pin_image:{label:(0,v.__)("Pin","tutor"),icon:"quizPin"},puzzle:{label:(0,v.__)("Puzzle","tutor"),icon:"quizPuzzle"},h5p:{label:(0,v.__)("H5P","tutor"),icon:"quizTrueFalse"}};var cm=["multiple_choice","matching","image_answering"];var c_=()=>{var{activeQuestionIndex:e,activeQuestionId:t,validationError:n,setValidationError:s}=cv();var l=(0,S/* .useFormContext */.xW)();var{showModal:u,closeModal:d}=(0,H/* .useModal */.h)();var c=l.watch("questions.".concat(e));var p=l.watch("questions.".concat(e,".question_type"));var g=l.watch("questions.".concat(e,"._data_status"));var _=(0,o.useCallback)(()=>{u({component:cc,props:{question:c,onClose:()=>d()}})},[c,u,d]);(0,o.useEffect)(()=>{var e=e=>{if(e.altKey&&e.code==="KeyP"){e.preventDefault();_()}};window.addEventListener("keydown",e);return()=>window.removeEventListener("keydown",e)},[_]);if(!t){return/*#__PURE__*/(0,a/* .jsx */.Y)("p",{css:cy.emptyQuestions,children:(0,v.__)("Create/Select a question to view details","tutor")})}return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:cy.questionTypeWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:F/* .typography.caption */.I.caption("medium"),children:(0,v.__)("Question Type","tutor")}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:cy.questionTypeRow,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:cy.questionType,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:p?cg[p].icon:"quizTrueFalse",width:32,height:32}),/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:p?cg[p].label:""})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(M/* ["default"] */.A,{content:(0,v.__)("Preview (Option/Alt + P)","tutor"),children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{isOutlined:true,variant:"primary",size:"small",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"preview2",width:24,height:24}),onClick:_,children:(0,v.__)("Preview","tutor")})})]})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:cy.conditions,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("p",{children:(0,v.__)("Conditions:","tutor")}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:cy.conditionControls,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:p==="multiple_choice",children:/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:l.control,name:"questions.".concat(e,".question_settings.has_multiple_correct_answer"),render:t=>/*#__PURE__*/(0,a/* .jsx */.Y)($/* ["default"] */.A,(0,i._)((0,r._)({},t),{label:(0,v.__)("Multiple Correct Answer","tutor"),onChange:t=>{if(tt(g,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)){l.setValue("questions.".concat(e,"._data_status"),tt(g,D/* .QuizDataStatus.UPDATE */.cW.UPDATE))}// Reset all answers to incorrect on multiple correct answer toggle from true to false
    if(!t){l.setValue("questions.".concat(e,".question_answers"),l.getValues("questions.".concat(e,".question_answers")).map(e=>{return(0,i._)((0,r._)({},e),{is_correct:"0"})}))}}}))})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:p==="matching",children:/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:l.control,name:"questions.".concat(e,".question_settings.is_image_matching"),render:t=>/*#__PURE__*/(0,a/* .jsx */.Y)($/* ["default"] */.A,(0,i._)((0,r._)({},t),{label:(0,v.__)("Image Matching","tutor"),onChange:t=>{if(tt(g,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)){l.setValue("questions.".concat(e,"._data_status"),tt(g,D/* .QuizDataStatus.UPDATE */.cW.UPDATE))}if((n===null||n===void 0?void 0:n.type)==="question"&&!t){s(null)}}}))})}),/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:l.control,name:"questions.".concat(e,".question_settings.answer_required"),render:t=>/*#__PURE__*/(0,a/* .jsx */.Y)($/* ["default"] */.A,(0,i._)((0,r._)({},t),{label:(0,v.__)("Answer Required","tutor"),onChange:()=>{if(tt(g,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)){l.setValue("questions.".concat(e,"._data_status"),tt(g,D/* .QuizDataStatus.UPDATE */.cW.UPDATE))}}}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:cm.includes(p),children:/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:l.control,name:"questions.".concat(e,".question_settings.randomize_question"),render:t=>/*#__PURE__*/(0,a/* .jsx */.Y)($/* ["default"] */.A,(0,i._)((0,r._)({},t),{label:(0,v.__)("Randomize Choice","tutor"),onChange:()=>{if(tt(g,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)){l.setValue("questions.".concat(e,"._data_status"),tt(g,D/* .QuizDataStatus.UPDATE */.cW.UPDATE))}}}))})}),/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:l.control,name:"questions.".concat(e,".question_settings.question_mark"),rules:{min:0},render:t=>/*#__PURE__*/(0,a/* .jsx */.Y)(V/* ["default"] */.A,(0,i._)((0,r._)({},t),{label:(0,v.__)("Point For This Question","tutor"),type:"number",isInlineLabel:true,placeholder:"0",style:/*#__PURE__*/(0,h/* .css */.AH)("max-width:80px;"),onChange:()=>{if(tt(g,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)){l.setValue("questions.".concat(e,"._data_status"),tt(g,D/* .QuizDataStatus.UPDATE */.cW.UPDATE))}}}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:l.control,name:"questions.".concat(e,".question_settings.show_question_mark"),render:t=>/*#__PURE__*/(0,a/* .jsx */.Y)($/* ["default"] */.A,(0,i._)((0,r._)({},t),{label:(0,v.__)("Display Points","tutor"),onChange:()=>{if(tt(g,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)){l.setValue("questions.".concat(e,"._data_status"),tt(g,D/* .QuizDataStatus.UPDATE */.cW.UPDATE))}}}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(eh/* ["default"] */.A,{section:"Curriculum.Quiz.bottom_of_question_sidebar",namePrefix:"questions.".concat(e,"."),form:l})]})]})]},"".concat(t,"-").concat(e))};/* export default */const cb=c_;var cy={emptyQuestions:/*#__PURE__*/(0,h/* .css */.AH)("padding:",_/* .spacing["12"] */.YK["12"]," ",_/* .spacing["32"] */.YK["32"]," ",_/* .spacing["24"] */.YK["24"]," ",_/* .spacing["24"] */.YK["24"],";",F/* .typography.caption */.I.caption("medium"),";"),questionTypeWrapper:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";padding:",_/* .spacing["8"] */.YK["8"]," ",_/* .spacing["32"] */.YK["32"]," ",_/* .spacing["24"] */.YK["24"]," ",_/* .spacing["24"] */.YK["24"],";gap:",_/* .spacing["10"] */.YK["10"],";border-bottom:1px solid ",_/* .colorTokens.stroke.divider */.I6.stroke.divider,";"),questionTypeRow:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("row"),";align-items:center;gap:",_/* .spacing["10"] */.YK["10"],";justify-content:space-between;width:100%;"),questionType:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;align-items:center;gap:",_/* .spacing["10"] */.YK["10"],";"),conditions:/*#__PURE__*/(0,h/* .css */.AH)("padding:",_/* .spacing["8"] */.YK["8"]," ",_/* .spacing["32"] */.YK["32"]," ",_/* .spacing["24"] */.YK["24"]," ",_/* .spacing["24"] */.YK["24"],";p{",F/* .typography.body */.I.body("medium"),";color:",_/* .colorTokens.text.primary */.I6.text.primary,";}"),conditionControls:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["16"] */.YK["16"],";margin-top:",_/* .spacing["16"] */.YK["16"],";")};// EXTERNAL MODULE: ./assets/src/js/v3/shared/atoms/Alert.tsx
var cw=n(47918);// CONCATENATED MODULE: ./assets/src/js/v3/shared/components/fields/quiz/FormAnswerExplanation.tsx
function cx(){var e=(0,I._)(["\n      background-color: ",";\n      padding: "," ",";\n\n      &:hover {\n        background-color: ",";\n      }\n    "]);cx=function t(){return e};return e}function cA(){var e=(0,I._)(["\n      padding-inline: 0;\n      max-height: unset;\n      overflow: unset;\n    "]);cA=function t(){return e};return e}function cY(){var e=(0,I._)(["\n      padding: 0;\n    "]);cY=function t(){return e};return e}function ck(){var e=(0,I._)(["\n        background-color: transparent;\n      "]);ck=function t(){return e};return e}function cI(){var e=(0,I._)(["\n        resize: vertical;\n      "]);cI=function t(){return e};return e}function cq(){var e=(0,I._)(["\n      opacity: 1;\n    "]);cq=function t(){return e};return e}var cC=e=>{var{label:t,field:n,fieldState:r,disabled:i,loading:s,placeholder:l,helpText:u,onChange:d}=e;var c;var p=(c=n.value)!==null&&c!==void 0?c:"";var[h,g]=(0,o.useState)(false);var[m,_]=(0,o.useState)(p);return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:cE.wrapper({hasValue:!!p&&!h}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:h||p,children:/*#__PURE__*/(0,a/* .jsx */.Y)("label",{css:cE.answerLabel,children:t})}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:cE.editorWrapper({isEdit:h}),children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:cE.container({isEdit:h||!!p}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!p&&!h,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(eu/* ["default"] */.A,{field:n,fieldState:r,disabled:i,helpText:u,loading:s,readOnly:!h,onChange:d,placeholder:l,autoFocus:true,isMinimal:true}),children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:cE.placeholder,children:l})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:h,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{"data-action-buttons":true,css:cE.actionButtonWrapper({isEdit:h}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",size:"small",onClick:()=>{n.onChange(m);g(false)},children:(0,v.__)("Cancel","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"secondary",size:"small",onClick:()=>{var e;_((e=n.value)!==null&&e!==void 0?e:"");g(false)},disabled:n.value===m,children:(0,v.__)("Ok","tutor")})]})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!h,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{onClick:()=>{if(!h&&!i){g(true)}},onKeyDown:e=>{if((e.key==="Enter"||e.key===" ")&&!h){g(true)}},"data-overlay":true,tabIndex:0,role:"button"})})]})})]})};/* export default */const cD=cC;var cE={wrapper:e=>{var{hasValue:t}=e;return/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),"    gap:",_/* .spacing["10"] */.YK["10"],";border-radius:",_/* .borderRadius.card */.Vq.card,";",t&&(0,h/* .css */.AH)(cx(),_/* .colorTokens.color.success["30"] */.I6.color.success["30"],_/* .spacing["12"] */.YK["12"],_/* .spacing["24"] */.YK["24"],_/* .colorTokens.color.success["40"] */.I6.color.success["40"]))},editorWrapper:e=>{var{isEdit:t}=e;return/*#__PURE__*/(0,h/* .css */.AH)("position:relative;max-height:400px;overflow-y:scroll;",t&&(0,h/* .css */.AH)(cA()))},container:e=>{var{isEdit:t}=e;return/*#__PURE__*/(0,h/* .css */.AH)("position:relative;display:flex;flex-direction:column;gap:",_/* .spacing["16"] */.YK["16"],";min-height:48px;height:100%;width:100%;inset:0;border-radius:",_/* .borderRadius["6"] */.Vq["6"],";transition:background 0.15s ease-in-out;[data-overlay]{position:absolute;inset:0;opacity:1;:focus-visible{outline:2px solid ",_/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:-2px;border-radius:",_/* .borderRadius.card */.Vq.card,";}}& label{",F/* .typography.caption */.I.caption(),"      margin-bottom:",_/* .spacing["6"] */.YK["6"],";color:",_/* .colorTokens.text.title */.I6.text.title,";}",t&&(0,h/* .css */.AH)(cY()),"    &:hover{background-color:",_/* .colorTokens.background.white */.I6.background.white,";color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";cursor:text;[data-action-buttons]{opacity:1;}",t&&(0,h/* .css */.AH)(ck()),"}")},inputContainer:e=>/*#__PURE__*/(0,h/* .css */.AH)("position:relative;display:flex;& textarea{",F/* .typography.caption */.I.caption(),"      color:",_/* .colorTokens.text.title */.I6.text.title,";height:auto;padding:",_/* .spacing["8"] */.YK["8"]," ",_/* .spacing["12"] */.YK["12"],";resize:none;",e&&(0,h/* .css */.AH)(cI()),"}"),clearButton:/*#__PURE__*/(0,h/* .css */.AH)("position:absolute;right:",_/* .spacing["2"] */.YK["2"],";top:",_/* .spacing["2"] */.YK["2"],";width:36px;height:36px;border-radius:",_/* .borderRadius["2"] */.Vq["2"],";background:transparent;button{padding:",_/* .spacing["10"] */.YK["10"],";}"),placeholder:/*#__PURE__*/(0,h/* .css */.AH)("padding:",_/* .spacing["12"] */.YK["12"]," ",_/* .spacing["24"] */.YK["24"],";",F/* .typography.caption */.I.caption(),"    color:",_/* .colorTokens.text.hints */.I6.text.hints,";display:flex;align-items:center;height:100%;"),actionButtonWrapper:e=>{var{isEdit:t}=e;return/*#__PURE__*/(0,h/* .css */.AH)("display:flex;justify-content:flex-end;gap:",_/* .spacing["8"] */.YK["8"],";opacity:0;transition:opacity 0.15s ease-in-out;",t&&(0,h/* .css */.AH)(cq()))},answer:/*#__PURE__*/(0,h/* .css */.AH)("padding:",_/* .spacing["12"] */.YK["12"]," ",_/* .spacing["24"] */.YK["24"],";border-radius:",_/* .borderRadius.card */.Vq.card,";display:flex;flex-direction:column;gap:",_/* .spacing["16"] */.YK["16"],";background-color:",_/* .colorTokens.background.success.fill30 */.I6.background.success.fill30,";color:",_/* .colorTokens.text.title */.I6.text.title,";transition:background 0.15s ease-in-out;&:hover{background-color:",_/* .colorTokens.background.success.fill40 */.I6.background.success.fill40,";}"),answerLabel:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.caption */.I.caption(),"    color:",_/* .colorTokens.text.title */.I6.text.title,";"),answerParagraph:/*#__PURE__*/(0,h/* .css */.AH)("pre{",Y/* .styleUtils.overflowXAuto */.x.overflowXAuto,"}")};// CONCATENATED MODULE: ./assets/src/js/v3/shared/components/fields/quiz/FormQuestionDescription.tsx
function cS(){var e=(0,I._)(["\n      padding-inline: 0;\n      max-height: unset;\n      overflow: unset;\n    "]);cS=function t(){return e};return e}function cz(){var e=(0,I._)(["\n      &:hover,\n      &:has([data-overlay]:focus-visible) {\n        background-color: ",";\n        color: ",";\n\n        [data-action-buttons] {\n          opacity: 1;\n        }\n      }\n    "]);cz=function t(){return e};return e}function cT(){var e=(0,I._)(["\n      padding-inline: 0;\n    "]);cT=function t(){return e};return e}function cM(){var e=(0,I._)(["\n      opacity: 1;\n    "]);cM=function t(){return e};return e}var cH=!!P/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var cP=e=>{var{label:t,field:n,fieldState:r,disabled:i=false,loading:s,placeholder:l,helpText:u,onChange:d}=e;var c;var p=(c=n.value)!==null&&c!==void 0?c:"";var[h,g]=(0,o.useState)(false);var[m,_]=(0,o.useState)(p);var b=()=>{n.onChange(m);g(false)};var w=()=>{g(false);_(n.value||"")};var A=()=>{if(!h&&!i){g(true)}};var Y=e=>{if((e.key==="Enter"||e.key===" ")&&!h){e.preventDefault();g(true)}};return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:cF.editorWrapper({isEdit:h}),tabIndex:-1,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:cF.container({isEdit:h,isDisabled:i}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!h&&(!cH||!p),fallback:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:cF.editorContainer,"aria-hidden":!h,// @ts-ignore
inert:!h?"":undefined,children:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:cH,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(e0/* ["default"] */.A,{field:n,fieldState:r,label:t,disabled:i,helpText:u,loading:s,readOnly:!h,onChange:d,placeholder:l,autoResize:true,maxHeight:400}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(eu/* ["default"] */.A,{field:n,fieldState:r,label:t,disabled:i,helpText:u,loading:s,readOnly:!h,onChange:d,placeholder:l,min_height:100,max_height:400,autoFocus:true,toolbar1:"formatselect bold italic underline | bullist numlist | blockquote | alignleft aligncenter alignright | link unlink | ".concat(cH?" codesample":""," | wp_adv"),toolbar2:"strikethrough hr wp_more forecolor pastetext removeformat charmap outdent indent undo redo wp_help fullscreen"})})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:cF.placeholder,dangerouslySetInnerHTML:{__html:p||l||""},tabIndex:-1,"aria-hidden":"true"})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:h,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{"data-action-buttons":true,css:cF.actionButtonWrapper({isEdit:h}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",size:"small",onClick:b,children:(0,v.__)("Cancel","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"secondary",size:"small",onClick:w,disabled:p===m,children:(0,v.__)("Ok","tutor")})]})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!h,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{onClick:A,onKeyDown:Y,"data-overlay":true,tabIndex:0,role:"button","aria-label":p?(0,v.__)("Edit description","tutor"):(0,v.__)("Add description","tutor")})})]})})};/* export default */const cO=cP;var cF={editorWrapper:e=>{var{isEdit:t}=e;return/*#__PURE__*/(0,h/* .css */.AH)("position:relative;max-height:400px;overflow-y:auto;border-radius:",_/* .borderRadius["6"] */.Vq["6"],";",t&&(0,h/* .css */.AH)(cS()))},container:e=>{var{isEdit:t,isDisabled:n}=e;return/*#__PURE__*/(0,h/* .css */.AH)("position:relative;display:flex;flex-direction:column;gap:",_/* .spacing["16"] */.YK["16"],";min-height:64px;height:100%;width:100%;inset:0;padding-inline:",_/* .spacing["8"] */.YK["8"]," ",_/* .spacing["16"] */.YK["16"],";border-radius:",_/* .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 ",_/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:-2px;border-radius:",_/* .borderRadius.card */.Vq.card,";}}& label{",F/* .typography.caption */.I.caption(),";margin-bottom:",_/* .spacing["6"] */.YK["6"],";color:",_/* .colorTokens.text.title */.I6.text.title,";}",!n&&(0,h/* .css */.AH)(cz(),!t&&_/* .colorTokens.background.white */.I6.background.white,_/* .colorTokens.text.subdued */.I6.text.subdued)," ",t&&(0,h/* .css */.AH)(cT()))},editorContainer:/*#__PURE__*/(0,h/* .css */.AH)("position:relative;width:100%;"),placeholder:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.caption */.I.caption(),"    color:",_/* .colorTokens.text.hints */.I6.text.hints,";height:100%;inset:0;padding-block:",_/* .spacing["8"] */.YK["8"],";overflow-x:hidden;pointer-events:none;"),actionButtonWrapper:e=>{var{isEdit:t}=e;return/*#__PURE__*/(0,h/* .css */.AH)("display:flex;justify-content:flex-end;gap:",_/* .spacing["8"] */.YK["8"],";opacity:0;transition:opacity 0.15s ease-in-out;",t&&(0,h/* .css */.AH)(cM()))}};// CONCATENATED MODULE: ./assets/src/js/v3/shared/hooks/usePrevious.tsx
var cN=e=>{var t=(0,o.useRef)();(0,o.useEffect)(()=>{t.current=e},[e]);return t.current};// CONCATENATED MODULE: ./assets/src/js/v3/shared/atoms/TextInput.tsx
function cK(){var e=(0,I._)(["\n      flex-direction: row;\n      align-items: center;\n      gap: ",";\n      justify-content: space-between;\n      height: 32px;\n    "]);cK=function t(){return e};return e}function cW(){var e=(0,I._)(["\n      color: ",";\n    "]);cW=function t(){return e};return e}function cR(){var e=(0,I._)(["\n        padding-left: ",";\n      "]);cR=function t(){return e};return e}function cL(){var e=(0,I._)(["\n        height: 32px;\n        min-height: 32px;\n      "]);cL=function t(){return e};return e}var cU=e=>{var{label:t,isInlineLabel:n,type:r="text",value:i,disabled:s,readOnly:l,placeholder:u,onChange:d,onBlur:c,onKeyDown:p,onFocus:h,isClearable:v,handleMediaIconClick:g,variant:_="regular",focusOnMount:b=false,inputCss:y,autoFocus:w=false,size:A="regular"}=e;var Y=(0,o.useId)();var I=(0,o.useRef)(null);(0,o.useEffect)(()=>{if(!b||!I.current){return}I.current.focus()},[b]);return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:cj.inputContainer(n),children:[!!t&&/*#__PURE__*/(0,a/* .jsx */.Y)("label",{htmlFor:Y,css:cj.label(n),children:t}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:cj.inputWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("input",{ref:I,id:Y,type:"text",css:[cj.input(_,A),y],value:i||"",autoFocus:w,onChange:e=>{var{value:t}=e.target;var n=r==="number"?(0,k/* .parseNumberOnly */.TW)(t):t;d(n)},onKeyDown:e=>{p===null||p===void 0?void 0:p(e.key,e)},onBlur:e=>{var{value:t}=e.target;var n=r==="number"?(0,k/* .parseNumberOnly */.TW)(t):t;c===null||c===void 0?void 0:c(n)},onFocus:e=>{h===null||h===void 0?void 0:h(e)},placeholder:u,readOnly:l,disabled:s,autoComplete:"off","data-input":true}),_==="search"&&/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:cj.searchIcon,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"search",width:24,height:24})}),v&&!!i&&/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:cj.rightIconButton,children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",size:"small",onClick:()=>d(""),children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"cross",width:24,height:24})})}),!!g&&_!=="search"&&!i&&/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:cj.rightIconButton,children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",size:"small",onClick:g,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"upload"})})})]})]})};/* export default */const cB=cU;var cj={inputContainer:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:false;return/*#__PURE__*/(0,h/* .css */.AH)("display:flex;flex-direction:column;gap:",_/* .spacing["4"] */.YK["4"],";width:100%;",e&&(0,h/* .css */.AH)(cK(),_/* .spacing["12"] */.YK["12"]))},label:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:false;return/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.caption */.I.caption()," ",e&&(0,h/* .css */.AH)(cW(),_/* .colorTokens.text.primary */.I6.text.primary))},inputWrapper:/*#__PURE__*/(0,h/* .css */.AH)("position:relative;"),input:(e,t)=>/*#__PURE__*/(0,h/* .css */.AH)("&[data-input]{",F/* .typography.body */.I.body(),"      width:100%;height:40px;min-height:auto;border-radius:",_/* .borderRadius["5"] */.Vq["5"],";border:1px solid ",_/* .colorTokens.stroke["default"] */.I6.stroke["default"],";padding:0 ",_/* .spacing["32"] */.YK["32"]," 0 ",_/* .spacing["12"] */.YK["12"],";color:",_/* .colorTokens.text.primary */.I6.text.primary,";appearance:textfield;:focus{",Y/* .styleUtils.inputFocus */.x.inputFocus,";}::-webkit-outer-spin-button,::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}::placeholder{color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";}",e==="search"&&(0,h/* .css */.AH)(cR(),_/* .spacing["36"] */.YK["36"])," ",t==="small"&&(0,h/* .css */.AH)(cL()),"}"),rightIconButton:/*#__PURE__*/(0,h/* .css */.AH)("position:absolute;right:",_/* .spacing["4"] */.YK["4"],";top:",_/* .spacing["4"] */.YK["4"],";button{padding:",_/* .spacing["4"] */.YK["4"],";border-radius:",_/* .borderRadius["2"] */.Vq["2"],";}"),searchIcon:/*#__PURE__*/(0,h/* .css */.AH)("position:absolute;top:50%;left:",_/* .spacing["8"] */.YK["8"],";transform:translateY(-50%);color:",_/* .colorTokens.icon["default"] */.I6.icon["default"],";line-height:0;")};// CONCATENATED MODULE: ./assets/src/js/v3/shared/utils/quizBuilderA11y.ts
/**
 * Shared accessibility helpers for quiz interaction fields in the course builder.
 *
 * @package Tutor
 * @since 4.0.0
 *//**
 * Screen-reader-only text (matches tutor-pro quiz interaction a11y styles).
 */var cV=/*#__PURE__*/(0,h/* .css */.AH)("position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;");/**
 * Focus ring for keyboard-operable quiz interaction surfaces (canvas, grid, etc.).
 */var cQ=/*#__PURE__*/(0,h/* .css */.AH)("&:focus{outline:none;}&:focus-visible{outline:2px solid ",_/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:2px;}");/**
 * Announce text through a polite live region.
 */var cG=(e,t)=>{if(!e||typeof t!=="string"){return}var n=t.trim();if(!n){return}e.textContent="";if(typeof window.requestAnimationFrame==="function"){window.requestAnimationFrame(()=>{e.textContent=n});return}e.textContent=n};/**
 * Merge unique id references into aria-describedby.
 */var c$=(e,t)=>{if(!e||!t.length){return}var n=t.filter(e=>typeof e==="string"&&e.length>0&&document.getElementById(e));if(!n.length){return}var r=(e.getAttribute("aria-describedby")||"").split(/\s+/).filter(Boolean);var i=[];var a={};for(var o of r){if(!a[o]){a[o]=true;i.push(o)}}for(var s of n){if(!a[s]){a[s]=true;i.push(s)}}e.setAttribute("aria-describedby",i.join(" "))};/**
 * Normalize a keyboard event key (with legacy keyCode fallback).
 */var cX=e=>{if(e.key&&e.key!=="Unidentified"){return e.key}var t={37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown"};return t[e.keyCode]||""};var cZ=e=>e==="ArrowLeft"||e==="ArrowRight"||e==="ArrowUp"||e==="ArrowDown";/**
 * Move an integer grid cursor by one unit using arrow keys.
 */var cJ=(e,t,n)=>{var{min:r,max:i}=n;var a=e.x;var o=e.y;if(t==="ArrowLeft"){a-=1}else if(t==="ArrowRight"){a+=1}else if(t==="ArrowUp"){o+=1}else if(t==="ArrowDown"){o-=1}else{return null}a=Math.max(r,Math.min(i,a));o=Math.max(r,Math.min(i,o));return{x:a,y:o}};/**
 * Move a pixel cursor within canvas bounds using arrow keys.
 */var c0=(e,t,n,r)=>{if(!cZ(t)){return null}var i=typeof(r===null||r===void 0?void 0:r.step)==="number"&&r.step>0?r.step:8;var a=typeof(r===null||r===void 0?void 0:r.largeStep)==="number"&&r.largeStep>0?r.largeStep:24;var o=(r===null||r===void 0?void 0:r.shiftKey)?a:i;var s=Math.max(0,n.width);var l=Math.max(0,n.height);var u=e.x;var d=e.y;if(t==="ArrowLeft"){u-=o}else if(t==="ArrowRight"){u+=o}else if(t==="ArrowUp"){d-=o}else if(t==="ArrowDown"){d+=o}u=Math.max(0,Math.min(s,u));d=Math.max(0,Math.min(l,d));return{x:u,y:d}};// CONCATENATED MODULE: ./assets/src/js/v3/shared/components/fields/quiz/questions/FormCoordinates.tsx
/** Coordinates question field: instructor places correct answer points on the graph grid. */var c1=16;var c2=.3;var c4=420;var c6=27;var c5=.28;var c3=.85;var c8=5;var c9=2;var c7=[10,20].map(e=>({label:"".concat(e," ").concat((0,v.__)("Unit","tutor")),icon:e===10?"unit10":"unit20",value:e}));/**
 * Whether to draw a numeric label at this axis tick (every `AXIS_LABEL_STEP` units plus zero handling).
 */var pe=e=>e===0||Math.abs(e%c9)===0;/**
 * Normalizes stored or UI axis range to supported values (10 or 20 units).
 */var pt=e=>Number(e)===20?20:10;/**
 * Rounds to the nearest integer and clamps to `[-axisRange, axisRange]`.
 */var pn=(e,t)=>{var n=-t;var r=t;var i=Math.round(e);return Math.max(n,Math.min(r,i))};/**
 * Clamps a point so both coordinates lie within the current axis range.
 */var pr=(e,t)=>({x:pn(e.x,t),y:pn(e.y,t)});/**
 * Parses `answer_two_gap_match` JSON into up to five points (`MAX_COORDINATES`).
 * Accepts either an array of `{x,y}` or a legacy single object; invalid input yields `[]`.
 *
 * @param axisRange - When set, clamps each parsed point to the grid extent.
 */var pi=(e,t)=>{if(!e||typeof e!=="string")return[];try{var n=JSON.parse(e);if(Array.isArray(n)){var r=n.map(e=>{if(!e||typeof e!=="object")return null;var n=e;if(typeof n.x!=="number"||typeof n.y!=="number")return null;var r={x:Math.round(n.x),y:Math.round(n.y)};return typeof t==="number"?pr(r,t):r}).filter(Boolean);return r.slice(0,c8)}if(n&&typeof n==="object"){var i=n;if(typeof i.x==="number"&&typeof i.y==="number"){var a={x:Math.round(i.x),y:Math.round(i.y)};return[typeof t==="number"?pr(a,t):a]}}}catch(e){return[]}return[]};/**
 * Parses manual "x,y" text into a grid point; requires integers within `[-axisRange, axisRange]`.
 */var pa=(e,t)=>{var n=-t;var r=t;var i=(e!==null&&e!==void 0?e:"").trim();if(!i)return null;var a=i.split(",").map(e=>e.trim());if(a.length!==2)return null;var o=Number(a[0]);var s=Number(a[1]);if(!Number.isFinite(o)||!Number.isFinite(s))return null;if(!Number.isInteger(o)||!Number.isInteger(s))return null;if(o<n||o>r||s<n||s>r)return null;return{x:o,y:s}};/** Serializes a point for display and draft state (`"x,y"`). */var po=e=>"".concat(e.x,",").concat(e.y);/** i18n message shown when a stored point lies outside the current axis range. */var ps=e=>(0,v.sprintf)((0,v.__)("Range is from -%1$d to %2$d","tutor"),e,e);/** Absolute URL for overlay marker SVGs shipped with Tutor assets. */var pl=e=>"".concat(P/* .tutorConfig.tutor_url */.P.tutor_url,"assets/icons/").concat(e,".svg");/**
 * Maps graph coordinates to CSS pixel position within a square logical canvas (padding inset, y-up).
 */var pu=(e,t,n,r,i)=>{var a=e-2*c1;var o=e-2*c1;var s=c1+a/2;var l=c1+o/2;var u=Math.min(a,o)/(n-t);return{x:s+r*u,y:l-i*u}};/**
 * Converts pointer position in CSS pixels to the nearest grid intersection if within snap distance.
 * Returns `null` when not close enough to a lattice point or outside the axis bounds (student quiz parity).
 */var pd=(e,t,n,r,i)=>{var a=n-2*c1;var o=n-2*c1;var s=c1+a/2;var l=c1+o/2;var u=Math.min(a,o)/(i-r);var d=(e-s)/u;var c=(l-t)/u;var p=Math.round(d);var h=Math.round(c);var v=Math.abs(d-p);var f=Math.abs(c-h);if(v<=c2&&f<=c2&&p>=r&&p<=i&&h>=r&&h<=i){return{x:p,y:h}}return null};/** True if either coordinate falls outside `[-axisRange, axisRange]`. */var pc=(e,t)=>{var n=-t;var r=t;return e.x<n||e.x>r||e.y<n||e.y>r};/**
 * Renders the coordinates answer editor: list of points, canvas grid, axis range selector, and marker overlays.
 */var pp=e=>{var{field:t,activeQuestionIndex:n=0,axisRangeControllerProps:s}=e;var l;var u=(0,S/* .useFormContext */.xW)();var d=t.value;var c=Array.isArray(u===null||u===void 0?void 0:(l=u.getValues)===null||l===void 0?void 0:l.call(u,"questions"))?"questions.".concat(n,"._data_status"):"_data_status";var p;var h=u?(p=u.watch(c))!==null&&p!==void 0?p:D/* .QuizDataStatus.NO_CHANGE */.cW.NO_CHANGE:D/* .QuizDataStatus.NO_CHANGE */.cW.NO_CHANGE;var g=pt(s===null||s===void 0?void 0:s.field.value);var b=-g;var y=g;var w=(0,o.useId)();var A="".concat(w,"-instruction");var k="".concat(w,"-live-region");var I=(0,o.useRef)(null);var q=(0,o.useRef)(null);var C=(0,o.useRef)(null);var E=(0,o.useRef)(false);var[z,T]=(0,o.useState)(c4);var[H,P]=(0,o.useState)(false);var[O,F]=(0,o.useState)(null);var[N,K]=(0,o.useState)(()=>{var e;var t=pi((e=d===null||d===void 0?void 0:d.answer_two_gap_match)!==null&&e!==void 0?e:"");return t.length?t:[{x:0,y:0}]});var[W,R]=(0,o.useState)(()=>N.map(po));var[L,U]=(0,o.useState)(0);// Keep local editable state in sync when the persisted answer payload changes externally
// (e.g. question switch/reset), while preserving a valid active index.
(0,o.useEffect)(()=>{var e;var t=pi((e=d===null||d===void 0?void 0:d.answer_two_gap_match)!==null&&e!==void 0?e:"");var n=t.length?t:[{x:0,y:0}];K(n);R(n.map(po));U(e=>Math.max(0,Math.min(n.length-1,e)))},[d===null||d===void 0?void 0:d.answer_two_gap_match]);var B=(0,o.useCallback)(e=>{t.onChange(e)},[t]);/** Normalizes coordinates, syncs drafts/active index, and persists `answer_two_gap_match` on the option. */var j=(0,o.useCallback)(e=>{if(!d)return;var t=(e.length?e:[{x:0,y:0}]).slice(0,c8).map(e=>pr(e,g));K(t);R(t.map(po));U(e=>Math.max(0,Math.min(t.length-1,e)));B((0,i._)((0,r._)({},d,tt(d._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(d._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{answer_two_gap_match:JSON.stringify(t),is_saved:true}))},[g,d,B]);/** Draws axes, grid lines, and numeric tick labels on the backing canvas. */var V=(0,o.useCallback)((e,t,n)=>{var r=t-2*c1;var i=n-2*c1;var a=c1+r/2;var o=c1+i/2;var s=Math.min(r,i)/(y-b);var l=(e,t)=>({x:a+e*s,y:o-t*s});e.clearRect(0,0,t,n);var u=l(b,0).x;var d=l(y,0).x;var c=l(0,y).y;var p=l(0,b).y;e.strokeStyle="#cecfd2";e.lineWidth=.5;for(var h=b;h<=y;h++){if(h===0)continue;var v=l(h,0);e.beginPath();e.moveTo(v.x,c);e.lineTo(v.x,p);e.stroke();var f=l(0,h);e.beginPath();e.moveTo(u,f.y);e.lineTo(d,f.y);e.stroke()}e.strokeStyle="#0c111d";e.lineWidth=1.5;e.beginPath();e.moveTo(u,o);e.lineTo(d,o);e.stroke();e.beginPath();e.moveTo(a,c);e.lineTo(a,p);e.stroke();e.fillStyle=_/* .colorTokens.text.subdued */.I6.text.subdued;e.font="11px Arial";e.textAlign="center";e.textBaseline="top";for(var g=b;g<=y;g++){if(g===0||!pe(g))continue;var m=l(g,0);e.fillText(String(g),m.x,o+5)}e.textAlign="right";e.textBaseline="middle";for(var w=b;w<=y;w++){if(w===0||!pe(w))continue;var A=l(0,w);e.fillText(String(w),a-5,A.y)}e.textAlign="right";e.textBaseline="top";e.fillText("0",a-5,o+5)},[y,b]);// Measure the responsive square canvas container and subscribe to size changes so marker/layout math
// always uses the current rendered width; cleanup detaches observers/listeners and pending RAF.
(0,o.useEffect)(()=>{var e=C.current;if(!e){return}var t=()=>{T(Math.max(1,e.getBoundingClientRect().width||c4))};t();if(typeof ResizeObserver==="undefined"){window.addEventListener("resize",t);return()=>{window.removeEventListener("resize",t);if(Z.current!==null){cancelAnimationFrame(Z.current)}}}var n=new ResizeObserver(t);n.observe(e);return()=>{n.disconnect();if(Z.current!==null){cancelAnimationFrame(Z.current)}}},[]);// Redraw the canvas grid when either the logical canvas size or axis range math changes.
// Canvas pixels are imperative state, so this rendering side effect must run after React commits.
(0,o.useEffect)(()=>{var e=I.current;if(!e)return;var t=e.getContext("2d");if(!t)return;var n=z;var r=window.devicePixelRatio||1;var i=Math.max(1,Math.round(n*r));var a=Math.max(1,Math.round(n*r));if(e.width!==i||e.height!==a){e.width=i;e.height=a}e.style.width="".concat(n,"px");e.style.height="".concat(n,"px");var o=e.width/n;var s=e.height/n;t.setTransform(o,0,0,s,0,0);V(t,n,n)},[V,z]);var Q=(0,o.useRef)(null);var $=(0,o.useRef)(0);var X=(0,o.useRef)(c3);var Z=(0,o.useRef)(null);var[,J]=(0,o.useState)(0);/**
   * Eases hover marker opacity and scale toward the pointer target each frame (`HOVER_ALPHA_LERP`).
   */var ee=(0,o.useCallback)(()=>{Z.current=null;var e=Q.current?1:0;var t=Q.current?1:c3;var n=$.current;var r=X.current;n+=(e-n)*c5;r+=(t-r)*c5;if(Math.abs(e-n)<.01){n=e}if(Math.abs(t-r)<.01){r=t}$.current=n;X.current=r;J(e=>e+1);if(n!==e||r!==t){Z.current=requestAnimationFrame(ee)}},[]);/** Schedules one animation frame for hover easing if not already queued. */var et=(0,o.useCallback)(()=>{if(Z.current===null){Z.current=requestAnimationFrame(ee)}},[ee]);/** Clears eased hover preview state and cancels any pending hover animation frame. */var en=(0,o.useCallback)(()=>{Q.current=null;$.current=0;X.current=c3;if(Z.current!==null){cancelAnimationFrame(Z.current);Z.current=null}J(e=>e+1)},[]);/** Updates eased hover preview to the grid cell under the cursor, or clears it when not snapped. */var er=(0,o.useCallback)(e=>{var t=I.current;if(!t){return}var n=t.getBoundingClientRect();var r=Math.max(1,n.width||c4);var i=e.clientX-n.left;var a=e.clientY-n.top;var o=pd(i,a,r,b,y);if(!o){if(Q.current!==null||$.current>.01){en()}return}var s=Q.current;if((s===null||s===void 0?void 0:s.x)===o.x&&(s===null||s===void 0?void 0:s.y)===o.y){return}Q.current=o;if(!s){$.current=0;X.current=c3}et()},[en,y,b,et]);/** Hides hover preview when the pointer exits the canvas. */var ei=(0,o.useCallback)(()=>{if(Q.current!==null||$.current>.01){en()}},[en]);var ea=(0,o.useCallback)(e=>{cG(q.current,e)},[]);/** Apply a grid point to the active coordinate (click or keyboard Enter). */var eo=(0,o.useCallback)(e=>{if(!d){return}var t=N.findIndex(t=>t.x===e.x&&t.y===e.y);if(t!==-1){U(t);ea((0,v.sprintf)((0,v.__)("Coordinate (%1$d, %2$d) selected.","tutor"),e.x,e.y));return}var n=N.slice();n[L]={x:e.x,y:e.y};j(n);ea((0,v.sprintf)((0,v.__)("Coordinate set to (%1$d, %2$d).","tutor"),e.x,e.y))},[L,ea,j,N,d]);/** Sets the active coordinate slot to the clicked grid intersection (or focuses an existing match). */var es=(0,o.useCallback)(e=>{var t=I.current;if(!t||!d)return;var n=t.getBoundingClientRect();var r=Math.max(1,n.width||c4);var i=e.clientX-n.left;var a=e.clientY-n.top;var o=pd(i,a,r,b,y);if(!o){return}eo(o)},[eo,y,b,d]);var el=(0,o.useCallback)(()=>{E.current=true},[]);var eu=(0,o.useCallback)(()=>{c$(I.current,[A]);if(E.current){E.current=false;return}en();P(true);F(e=>{var t;return(t=e!==null&&e!==void 0?e:N[L])!==null&&t!==void 0?t:{x:0,y:0}})},[L,en,N,A]);var ed=(0,o.useCallback)(()=>{P(false);F(null)},[]);var ec=(0,o.useCallback)(e=>{var t=cX(e);if(t==="Enter"){e.preventDefault();var n;var r=(n=O!==null&&O!==void 0?O:N[L])!==null&&n!==void 0?n:{x:0,y:0};if(!H){P(true);F(r)}eo(r);return}if(t==="Backspace"||t==="Delete"){e.preventDefault();if(N.length<=1){ea((0,v.__)("At least one coordinate is required.","tutor"));return}var i=N.slice();i.splice(L,1);j(i);ea((0,v.__)("Coordinate removed.","tutor"));return}if(!cZ(t)){return}e.preventDefault();var a;var o=(a=O!==null&&O!==void 0?O:N[L])!==null&&a!==void 0?a:{x:0,y:0};if(!H){P(true)}var s=cJ(o,t,{min:b,max:y});if(!s){return}F(s);ea((0,v.sprintf)((0,v.__)("Grid position (%1$d, %2$d). Press Enter to set the active coordinate.","tutor"),s.x,s.y))},[L,ea,eo,j,N,H,O,y,b]);/**
   * Applies a new axis range via react-hook-form so the question stays dirty until explicitly saved
   * (including toggling 10 ↔ 20) and quiz data status reflects an update when a form context exists.
   */var ep=(0,o.useCallback)(e=>{var t=pt(Number(e.value));if(u&&(s===null||s===void 0?void 0:s.field.name)){u.setValue(s.field.name,t,{shouldDirty:true})}else{s===null||s===void 0?void 0:s.field.onChange(t)}if(!u){return}var n=tt(h,D/* .QuizDataStatus.UPDATE */.cW.UPDATE);if(n){u.setValue(c,n,{shouldDirty:true})}},[h,s,u,c]);if(!d){return null}return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:pv.wrapper,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:pv.card,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:pv.answerHeader,children:/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:pv.answerHeaderTitle,children:(0,v.__)("Coordinates","tutor")})}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:pv.list,children:N.map((e,t)=>{var n=t===L;var i=N.length>=c8;var o=N.length<=1;var s=pc(e,g);var l;return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:pv.listRow({isActive:n}),onClick:()=>U(t),onKeyDown:e=>{if(e.key==="Enter"||e.key===" "){e.preventDefault();U(t);var n;F((n=N[t])!==null&&n!==void 0?n:{x:0,y:0})}},role:"button",tabIndex:0,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:pv.rowTop,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:pv.rowIndex,children:t+1}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:pv.rowActions,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(M/* ["default"] */.A,{content:(0,v.__)("Duplicate","tutor"),delay:200,children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:Y/* .styleUtils.actionButton */.x.actionButton,onClick:e=>{e.stopPropagation();if(i)return;var n=N.slice();n.splice(t+1,0,(0,r._)({},N[t]));j(n);U(t+1)},disabled:i,"aria-label":(0,v.__)("Copy coordinate","tutor"),children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"copyPaste",width:24,height:24})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(M/* ["default"] */.A,{content:(0,v.__)("Delete","tutor"),delay:200,children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:Y/* .styleUtils.actionButton */.x.actionButton,onClick:e=>{e.stopPropagation();if(o)return;var n=N.slice();n.splice(t,1);j(n);U(e=>{if(e>t)return e-1;if(e===t)return Math.max(0,t-1);return e})},disabled:o,"aria-label":(0,v.__)("Delete coordinate","tutor"),children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"delete",width:24,height:24})})})]})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(cB,{value:(l=W[t])!==null&&l!==void 0?l:po(e),size:"small",inputCss:pv.rowInput,onChange:e=>{var n=W.slice();n[t]=e;R(n)},onBlur:e=>{var n=pa(e!==null&&e!==void 0?e:"",g);if(!n){R(e=>{var n=e.slice();var r;n[t]=po((r=N[t])!==null&&r!==void 0?r:{x:0,y:0});return n});return}var r=N.slice();r[t]=n;j(r)},onKeyDown:(e,t)=>{if(e!=="Enter")return;t.currentTarget.blur()},placeholder:(0,v.__)("x,y","tutor")}),s&&/*#__PURE__*/(0,a/* .jsx */.Y)("p",{css:pv.rowError,children:ps(g)})]},"coord-".concat(t))})}),/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",size:"small",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"plus",width:18,height:18}),buttonCss:pv.addButton,onClick:()=>{if(N.length>=c8)return;var e=N.concat([{x:0,y:0}]);j(e);U(e.length-1)},disabled:N.length>=c8,children:(0,v.__)("Add Coordinates","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)("p",{id:A,css:cV,children:(0,v.__)("Use arrow keys to move the active grid point, Enter to set it, and Backspace or Delete to remove the active coordinate.","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{id:k,ref:q,css:cV,"aria-live":"polite","aria-atomic":"true",role:"status"}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:pv.canvasWrap,ref:C,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("canvas",{ref:I,width:c4,height:c4,css:[pv.canvas,cQ],tabIndex:0,role:"application","aria-describedby":A,onPointerDown:el,onClick:es,onFocus:eu,onBlur:ed,onKeyDown:ec,onMouseMove:er,onMouseLeave:ei,"aria-label":(0,v.__)("Coordinate grid: click or use arrow keys and Enter to set the correct answer point.","tutor")}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:pv.markerLayer,"aria-hidden":true,children:[N.map((e,t)=>{var n=pu(z,b,y,e.x,e.y);var r=t===L;var i=c6/z*100;var o=pl("graph-marker-selected");return/*#__PURE__*/(0,a/* .jsx */.Y)("img",{src:o,alt:"",css:pv.markerImg,style:{left:"".concat(n.x/z*100,"%"),top:"".concat(n.y/z*100,"%"),width:"".concat(i,"%"),height:"".concat(i,"%"),objectFit:"contain",transform:"translate(-50%, -50%) scale(".concat(r?1.05:1,")")}},"coord-marker-".concat(t,"-").concat(e.x,"-").concat(e.y))}),H&&O?(()=>{var e=pu(z,b,y,O.x,O.y);var t=c6/z*100;return/*#__PURE__*/(0,a/* .jsx */.Y)("img",{src:pl("graph-marker-hover"),alt:"",css:pv.markerImg,style:{left:"".concat(e.x/z*100,"%"),top:"".concat(e.y/z*100,"%"),width:"".concat(t,"%"),height:"".concat(t,"%"),objectFit:"contain",transform:"translate(-50%, -50%)"}},"coord-grid-keyboard-preview")})():null,!H&&Q.current!==null&&$.current>.01?(()=>{var e=Q.current;if(!e){return null}var t=pu(z,b,y,e.x,e.y);var n=c6/z*100;return/*#__PURE__*/(0,a/* .jsx */.Y)("img",{src:pl("graph-marker-hover"),alt:"",css:pv.markerImg,style:{left:"".concat(t.x/z*100,"%"),top:"".concat(t.y/z*100,"%"),width:"".concat(n,"%"),height:"".concat(n,"%"),objectFit:"contain",opacity:$.current,transform:"translate(-50%, -50%) scale(".concat(Math.max(.8,X.current),")")}},"coord-grid-hover-preview")})():null]})]}),s&&/*#__PURE__*/(0,a/* .jsx */.Y)(G/* ["default"] */.A,(0,i._)((0,r._)({},s),{leftIconPadding:36,size:"small",options:c7,onChange:ep}))]})})};/* export default */const ph=pp;var pv={wrapper:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["24"] */.YK["24"],";",_/* .Breakpoint.smallMobile */.EA.smallMobile,"{padding-left:",_/* .spacing["8"] */.YK["8"],";}"),card:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["16"] */.YK["16"],";padding:",_/* .spacing["20"] */.YK["20"],";"),answerHeader:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("row"),";align-items:center;justify-content:space-between;gap:",_/* .spacing["12"] */.YK["12"],";"),answerHeaderTitle:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.body */.I.body("medium"),";color:",_/* .colorTokens.text.primary */.I6.text.primary,";"),hint:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.caption */.I.caption(),";color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";margin:0;"),list:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["12"] */.YK["12"],";"),listRow:e=>{var{isActive:t}=e;return/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["12"] */.YK["12"],";padding:",_/* .spacing["12"] */.YK["12"],";border-radius:",_/* .borderRadius.card */.Vq.card,";border:",t?"1px solid ".concat(_/* .colorTokens.stroke.brand */.I6.stroke.brand):"none",";background:",_/* .colorTokens.background.white */.I6.background.white,";cursor:pointer;&:focus-visible{outline:2px solid ",_/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:0;}")},rowTop:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("row"),";align-items:center;justify-content:space-between;gap:",_/* .spacing["8"] */.YK["8"],";width:100%;"),rowIndex:/*#__PURE__*/(0,h/* .css */.AH)("width:26px;height:26px;border-radius:6px;",Y/* .styleUtils.flexCenter */.x.flexCenter(),";",F/* .typography.caption */.I.caption("medium"),";color:",_/* .colorTokens.text.primary */.I6.text.primary,";background:",_/* .colorTokens.background.hover */.I6.background.hover,";flex-shrink:0;"),rowInput:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.small */.I.small(),";width:100%;padding:",_/* .spacing["10"] */.YK["10"]," ",_/* .spacing["12"] */.YK["12"],";border-radius:8px;color:",_/* .colorTokens.text.primary */.I6.text.primary,";background:",_/* .colorTokens.background.white */.I6.background.white,";&:focus{outline:2px solid ",_/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:1px;}"),rowActions:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("row"),";align-items:center;flex-shrink:0;gap:",_/* .spacing["8"] */.YK["8"],";"),rowError:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.caption */.I.caption(),";color:",_/* .colorTokens.text.error */.I6.text.error,";margin:0;"),addButton:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.small */.I.small("medium"),";width:fit-content;border:none;color:",_/* .colorTokens.text.brand */.I6.text.brand,";&:focus{border:none;box-shadow:none;}&:focus-visible{border:none;outline:2px solid ",_/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:2px;box-shadow:none;}&:disabled{opacity:0.5;cursor:not-allowed;}"),canvasWrap:/*#__PURE__*/(0,h/* .css */.AH)("display:block;position:relative;width:100%;aspect-ratio:1 / 1;overflow:hidden;background-color:",_/* .colorTokens.background.white */.I6.background.white,";border-radius:",_/* .borderRadius.card */.Vq.card,";"),markerLayer:/*#__PURE__*/(0,h/* .css */.AH)("position:absolute;inset:0;pointer-events:none;"),markerImg:/*#__PURE__*/(0,h/* .css */.AH)("position:absolute;display:block;object-fit:contain;object-position:center;transform-origin:center center;"),canvas:/*#__PURE__*/(0,h/* .css */.AH)("display:block;width:100%;height:100%;cursor:crosshair;border:1px solid #ececed;border-radius:",_/* .borderRadius.card */.Vq.card,";")};// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/curriculum/question-types/Coordinates.tsx
var pf=()=>{var e=(0,S/* .useFormContext */.xW)();var{activeQuestionId:t,activeQuestionIndex:n,validationError:o,setValidationError:s}=cv();var l="questions.".concat(n,".question_answers");var u="questions.".concat(n,".question_settings.coordinates_axis_range");var{fields:d}=(0,S/* .useFieldArray */.jz)({control:e.control,name:l});var c=(0,S/* .useController */.as)({control:e.control,name:u,defaultValue:10});if(d.length===0){return null}return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:pm.optionWrapper,children:/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:e.control,name:"questions.".concat(n,".question_answers.0"),render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(ph,(0,i._)((0,r._)({},e),{questionId:t,activeQuestionIndex:n,axisRangeControllerProps:c,validationError:o,setValidationError:s}))},JSON.stringify(d[0]))})};/* export default */const pg=pf;var pm={optionWrapper:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";padding-left:",_/* .spacing["40"] */.YK["40"],";")};// EXTERNAL MODULE: ./assets/src/js/v3/shared/atoms/ImageInput.tsx
var p_=n(12427);// CONCATENATED MODULE: ../tutor-pro/assets/src/js/quiz-type/shared/draw-on-image.js
/**
 * Shared "Draw on Image" core – canvas overlay, pointer events, base64 mask export.
 *
 * Used by draw-image-question.js (student quiz) and can be reused by other
 * quiz-type UIs. Exports init and constants; draw-image-question bundles this
 * and attaches window.TutorCore.drawOnImage for external use.
 *
 * @package TutorPro
 * @since 4.0.0
 */var pb=1;var py="rgba(0, 0, 255, 0.9)";/**
 * Initialize draw-on-image for one image + canvas (and optional hidden input).
 * Returns a destroy function to remove listeners (for React cleanup).
 *
 * @param {Object}   options
 * @param {HTMLImageElement}  options.image       Background image element.
 * @param {HTMLCanvasElement} options.canvas       Overlay canvas element.
 * @param {HTMLInputElement}  [options.hiddenInput] Optional hidden input to write base64 PNG into.
 * @param {number}            [options.brushSize=1] Brush size in pixels.
 * @param {string}            [options.strokeStyle] Stroke/fill style (default blue).
 * @param {function(string)} [options.onMaskChange] Callback(base64OrEmpty) when mask changes.
 * @param {string}            [options.initialMaskUrl] Optional data URL or URL of mask to draw on init.
 * @param {HTMLElement}       [options.interactionRoot] Container (e.g. image wrapper) for hover-to-draw; see activateOnHover.
 * @param {boolean}           [options.activateOnHover] When true and the device supports hover, the canvas is inactive until pointer enters interactionRoot (same pattern as Pin on Image learning area).
 * @param {boolean}           [options.clearOnDrawStart] When true, each new draw gesture clears any previous mask first.
 * @param {function():boolean} [options.canStartDrawing] Optional guard called before drawing starts; return false to block drawing.
 * @param {function()}         [options.onDrawStart] Optional callback fired when a drawing gesture starts.
 * @returns {{ destroy: function, clear: function }} Object with destroy() to remove listeners and clear() to reset mask.
 */function pw(e){if(!e||!e.image||!e.canvas){return{destroy:function e(){}}}var t=e.image;var n=e.canvas;var r=e.hiddenInput||null;var i=e.interactionRoot||null;var a=e.activateOnHover===true;var o=typeof e.brushSize==="number"?e.brushSize:pb;var s=typeof e.strokeStyle==="string"?e.strokeStyle:py;var l=typeof e.onMaskChange==="function"?e.onMaskChange:null;var u=e.clearOnDrawStart===true;var d=typeof e.canStartDrawing==="function"?e.canStartDrawing:null;var c=typeof e.onDrawStart==="function"?e.onDrawStart:null;var p={isDrawing:false,activePointerId:null,brushSize:o,lastX:0,lastY:0,pathStarted:false,hasMoved:false,lastMaskValue:""};var h=a&&i&&typeof window!=="undefined"&&window.matchMedia&&window.matchMedia("(hover: hover)").matches;var v=false;var f=null;var g=null;function m(){n.style.touchAction="none";if(!h){n.style.pointerEvents="auto";n.style.cursor="crosshair";return}var e=v||p.isDrawing;n.style.pointerEvents=e?"auto":"none";n.style.cursor=e?"crosshair":"default"}function _(){if(!t||!t.complete){return}var e=t.getBoundingClientRect();var r=e.width||t.naturalWidth;var i=e.height||t.naturalHeight;if(!r||!i){return}n.width=r;n.height=i;n.style.width=r+"px";n.style.height=i+"px";var a=n.getContext("2d");if(!a){return}a.clearRect(0,0,r,i);a.strokeStyle=s;a.fillStyle=s;a.lineCap="round";a.lineJoin="round";a.lineWidth=p.brushSize;// Keep existing mask aligned after responsive resizes (common on mobile).
if(p.lastMaskValue){var o=new Image;o.crossOrigin="anonymous";o.onload=function(){var e=n.getContext("2d");if(e&&n.width&&n.height){e.drawImage(o,0,0,n.width,n.height)}};o.src=p.lastMaskValue}}function b(){if(!n||!n.width||!n.height){return""}var e=document.createElement("canvas");e.width=n.width;e.height=n.height;return n.toDataURL("image/png")!==e.toDataURL("image/png")?n.toDataURL("image/png"):""}function y(){var e=b();p.lastMaskValue=e;if(r){r.value=e;if(typeof Event==="function"){// Some form libraries/watchers listen to `input`, not `change`.
// Also set `composed: true` to avoid event encapsulation issues.
r.dispatchEvent(new Event("input",{bubbles:true,composed:true}));r.dispatchEvent(new Event("change",{bubbles:true,composed:true}))}}if(l){l(e)}}function w(){var e=n.getContext("2d");if(!e||!n.width||!n.height){if(r){r.value=""}p.lastMaskValue="";if(l){l("")}return}e.clearRect(0,0,n.width,n.height);p.lastMaskValue="";y()}function A(e){e.strokeStyle=s;e.fillStyle=s;e.lineCap="round";e.lineJoin="round";e.lineWidth=p.brushSize}function Y(e,r){if(!t||!t.complete){return false}if(p.isDrawing){return false}if(d&&!d()){return false}var i=n.getContext("2d");if(!i){return false}if(u&&n.width&&n.height){// Match course-builder behavior: each new lasso replaces previous one.
i.clearRect(0,0,n.width,n.height)}p.isDrawing=true;p.lastX=e;p.lastY=r;p.pathStarted=true;p.hasMoved=false;A(i);i.beginPath();i.moveTo(e,r);if(c){c()}return true}function k(e,t){if(!p.isDrawing){return false}var r=n.getContext("2d");if(!r){return false}A(r);if(!p.pathStarted){r.beginPath();r.moveTo(e,t);p.pathStarted=true}else{r.lineTo(e,t);// Draw a thin preview stroke so users can see the lasso while tracing.
r.stroke()}p.hasMoved=true;p.lastX=e;p.lastY=t;return true}function I(){if(!p.isDrawing){return false}p.isDrawing=false;p.activePointerId=null;var e=n.getContext("2d");if(!e){p.pathStarted=false;return false}if(p.pathStarted){A(e);if(p.hasMoved){e.closePath();e.fill()}else{// Single click/tap: paint a dot.
e.beginPath();e.arc(p.lastX,p.lastY,p.brushSize/2,0,Math.PI*2);e.fill()}}p.pathStarted=false;y();m();return true}function q(){if(!p.isDrawing){return false}p.isDrawing=false;p.pathStarted=false;p.hasMoved=false;p.activePointerId=null;_();m();return true}function C(e){if(!n.width||!n.height){_()}var t=n.getContext("2d");if(!t||!n.width||!n.height){return}t.clearRect(0,0,n.width,n.height);var r=function r(){if(typeof e==="function"){e(t,n.width,n.height)}};if(p.lastMaskValue){var i=new Image;i.crossOrigin="anonymous";i.onload=function(){t.drawImage(i,0,0,n.width,n.height);r()};i.src=p.lastMaskValue;return}r()}function D(){C(null)}function E(e){var t=n.getBoundingClientRect();var r=n.width/t.width;var i=n.height/t.height;var a=e.clientX;var o=e.clientY;return{x:Math.max(0,Math.min(n.width,(a-t.left)*r)),y:Math.max(0,Math.min(n.height,(o-t.top)*i))}}function S(e){if(e.pointerType==="mouse"&&e.button!==0){return}if(!t||!t.complete){return}e.preventDefault();var r=E(e);if(!Y(r.x,r.y)){return}p.activePointerId=typeof e.pointerId==="number"?e.pointerId:null;if(typeof n.setPointerCapture==="function"&&p.activePointerId!==null){try{n.setPointerCapture(p.activePointerId)}catch(e){}}}function z(e){if(!p.isDrawing){return}if(p.activePointerId!==null&&e.pointerId!==p.activePointerId){return}e.preventDefault();var t=E(e);k(t.x,t.y)}function T(e){if(!p.isDrawing){return}if(p.activePointerId!==null&&e.pointerId!==p.activePointerId){return}e.preventDefault();if(p.activePointerId!==null&&typeof n.hasPointerCapture==="function"&&n.hasPointerCapture(p.activePointerId)&&typeof n.releasePointerCapture==="function"){try{n.releasePointerCapture(p.activePointerId)}catch(e){}}I()}var M=function e(){_()};function H(){n.addEventListener("pointerdown",S);n.addEventListener("pointermove",z);n.addEventListener("pointerup",T);n.addEventListener("pointercancel",T);n.addEventListener("pointerleave",T)}function P(){n.removeEventListener("pointerdown",S);n.removeEventListener("pointermove",z);n.removeEventListener("pointerup",T);n.removeEventListener("pointercancel",T);n.removeEventListener("pointerleave",T)}function O(){if(t&&t.complete){_()}if(t){t.addEventListener("load",_)}if(h){var r=function e(){v=true;m()};var a=function e(){v=false;m()};i.addEventListener("pointerenter",r);i.addEventListener("pointerleave",a);f=function e(){i.removeEventListener("pointerenter",r);i.removeEventListener("pointerleave",a)}}m();H();window.addEventListener("resize",M);g=new ResizeObserver(function(){_()});if(i){g.observe(i)}g.observe(t);// Optional: draw initial mask (e.g. saved instructor mask in course builder).
if(e.initialMaskUrl&&typeof e.initialMaskUrl==="string"&&e.initialMaskUrl.trim()!==""){p.lastMaskValue=e.initialMaskUrl;var o=new Image;o.crossOrigin="anonymous";o.onload=function(){var e=n.getContext("2d");if(e&&n.width&&n.height){e.drawImage(o,0,0,n.width,n.height);y()}};o.onerror=function(){};o.src=e.initialMaskUrl}}O();return{clear:function e(){w()},isDrawing:function e(){return p.isDrawing},startStrokeAt:function e(e,t){return Y(e,t)},continueStrokeAt:function e(e,t){return k(e,t)},finishStroke:function e(){return I()},cancelStroke:function e(){return q()},renderWithOverlay:function e(e){C(e)},restoreSavedMask:function e(){D()},syncCanvas:function e(){_()},destroy:function e(){P();window.removeEventListener("resize",M);if(g){g.disconnect();g=null}if(f){f();f=null}if(t){t.removeEventListener("load",_)}}}};// CONCATENATED MODULE: ./assets/src/js/v3/shared/hooks/useDrawOnImageField.ts
/**
 * Draw-on-image field interaction for the course builder (parity with learning-area draw-image-question.js).
 *
 * @package Tutor
 * @since 4.0.0
 */var px="rgba(0, 0, 255, 0.65)";var pA=e=>{var{imageRef:t,canvasRef:n,interactionRootRef:r,liveRegionRef:i,instructionId:a,liveRegionId:s,imageUrl:l,initialMaskUrl:u,strokeStyle:d,onMaskChange:c,onDrawStart:p}=e;var h=(0,o.useRef)(null);var f=(0,o.useRef)({x:0,y:0});var g=(0,o.useRef)(false);var m=(0,o.useRef)(false);var _=(0,o.useRef)();var b=(0,o.useRef)(null);var y=(0,o.useRef)(c);var w=(0,o.useRef)(p);var A=(0,o.useRef)(u);y.current=c;w.current=p;A.current=u;var Y=(0,o.useCallback)(e=>{cG(i.current,e)},[i]);var k=(0,o.useCallback)(()=>{var e=n.current;return{width:(e===null||e===void 0?void 0:e.width)||0,height:(e===null||e===void 0?void 0:e.height)||0}},[n]);var I=(0,o.useCallback)(()=>{var e=k();f.current={x:e.width/2,y:e.height/2}},[k]);var q=(0,o.useCallback)(()=>{var e=h.current;if(!e||!g.current||e.isDrawing()){return}e.renderWithOverlay(e=>{e.fillStyle=px;e.beginPath();e.arc(f.current.x,f.current.y,5,0,Math.PI*2);e.fill()})},[]);var C=(0,o.useCallback)(()=>{if(b.current!==null){cancelAnimationFrame(b.current)}b.current=requestAnimationFrame(()=>{b.current=null;q()})},[q]);var D=(0,o.useCallback)(()=>{var e=h.current;if(!e){return}if(e.isDrawing()){e.finishStroke();g.current=true;C();Y((0,v.__)("Selection completed.","tutor"));return}if(e.startStrokeAt(f.current.x,f.current.y)){var t;(t=w.current)===null||t===void 0?void 0:t.call(w);Y((0,v.__)("Drawing started. Use arrow keys to trace, then Space or Enter to finish.","tutor"))}},[Y,C]);(0,o.useEffect)(()=>{var e=t.current;var i=n.current;var o=r.current;if(!l||!e||!i){return}// Re-init only when the background image changes — not when the saved mask updates after each stroke.
if(h.current&&_.current===l){return}_.current=l;if(h.current){h.current.destroy();h.current=null}var u=pw({image:e,canvas:i,brushSize:pb,strokeStyle:d,interactionRoot:o||i.parentElement||undefined,// Builder: keep canvas interactive (avoid pointer-events hover toggling flicker).
activateOnHover:false,clearOnDrawStart:true,initialMaskUrl:A.current||undefined,onDrawStart:()=>{var e;g.current=false;(e=w.current)===null||e===void 0?void 0:e.call(w)},onMaskChange:e=>{y.current(e)}});h.current=u;var c=()=>{var e;m.current=true;g.current=false;(e=w.current)===null||e===void 0?void 0:e.call(w)};var p=()=>{c$(i,[a,s]);if(m.current){m.current=false;return}u.syncCanvas();I();g.current=true;C()};var q=()=>{g.current=false;if(u.isDrawing()){u.finishStroke()}};var E=e=>{var t=cX(e);if(t===" "||t==="Spacebar"||t==="Enter"){e.preventDefault();D();return}if(t==="Escape"){if(!u.isDrawing()){return}e.preventDefault();u.cancelStroke();g.current=true;C();Y((0,v.__)("Drawing cancelled.","tutor"));return}if(t==="Backspace"||t==="Delete"){if(!u.isDrawing()){Y((0,v.__)("Nothing to cancel.","tutor"));return}e.preventDefault();u.cancelStroke();g.current=true;C();Y((0,v.__)("Drawing cancelled.","tutor"));return}if(t==="c"||t==="C"){e.preventDefault();if(u.isDrawing()){u.cancelStroke()}u.clear();g.current=true;C();Y((0,v.__)("Selection cleared.","tutor"));return}if(!cZ(t)){return}e.preventDefault();var n=c0(f.current,t,k(),{shiftKey:e.shiftKey});if(!n){return}f.current=n;if(u.isDrawing()){u.continueStrokeAt(f.current.x,f.current.y);return}g.current=true;C()};i.addEventListener("mousedown",c);i.addEventListener("focus",p);i.addEventListener("blur",q);i.addEventListener("keydown",E);return()=>{if(b.current!==null){cancelAnimationFrame(b.current);b.current=null}i.removeEventListener("mousedown",c);i.removeEventListener("focus",p);i.removeEventListener("blur",q);i.removeEventListener("keydown",E);u.destroy();h.current=null;if(_.current===l){_.current=undefined}}},[Y,k,l,t,n,a,r,I,s,C,d,D]);var E=(0,o.useCallback)(()=>{var e;(e=h.current)===null||e===void 0?void 0:e.clear();g.current=true;C()},[C]);return{clearMask:E,announceStatus:Y}};// EXTERNAL MODULE: ./assets/src/js/v3/shared/hooks/useWpMedia.ts
var pY=n(75532);// CONCATENATED MODULE: ./assets/src/js/v3/shared/components/fields/quiz/questions/FormDrawImage.tsx
/** Instructor mask stroke/fill — same red as legacy builder lasso. */var pk="rgba(220, 53, 69, 0.95)";var pI=[40,50,60,70,80,90,100].map(e=>({label:"".concat(e,"%"),value:e}));var pq=e=>{var{field:t,precisionControllerProps:n,activeQuestionIndex:s=0}=e;var l;var u=(0,S/* .useFormContext */.xW)();var d=t.value;var c=Array.isArray(u===null||u===void 0?void 0:(l=u.getValues)===null||l===void 0?void 0:l.call(u,"questions"))?"questions.".concat(s,"._data_status"):"_data_status";var p;var h=u?(p=u.watch(c))!==null&&p!==void 0?p:D/* .QuizDataStatus.NO_CHANGE */.cW.NO_CHANGE:D/* .QuizDataStatus.NO_CHANGE */.cW.NO_CHANGE;var g=(0,o.useId)();var _="".concat(g,"-instruction");var b="".concat(g,"-live-region");var[w,A]=(0,o.useState)(false);var Y=(0,o.useRef)(null);var k=(0,o.useRef)(null);var I=(0,o.useRef)(null);var q=(0,o.useRef)(null);var C=(0,o.useCallback)(e=>{t.onChange(e)},[t]);var E=(0,o.useCallback)(e=>{if(!d){return}C((0,i._)((0,r._)({},d,tt(d._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(d._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{answer_two_gap_match:e,is_saved:true}));A(Boolean(e))},[d,C]);var{clearMask:z,announceStatus:T}=pA({imageRef:Y,canvasRef:k,interactionRootRef:I,liveRegionRef:q,instructionId:_,liveRegionId:b,imageUrl:d===null||d===void 0?void 0:d.image_url,initialMaskUrl:(d===null||d===void 0?void 0:d.answer_two_gap_match)||undefined,strokeStyle:pk,onMaskChange:E,onDrawStart:()=>A(true)});var{openMediaLibrary:M,resetFiles:H}=(0,pY/* ["default"] */.A)({options:{type:"image"},onChange:e=>{if(e&&!Array.isArray(e)&&d){var{id:t,url:n}=e;var a=(0,i._)((0,r._)({},d,tt(d._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(d._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{image_id:t,image_url:n,answer_two_gap_match:""});C(a);A(false)}},initialFiles:(d===null||d===void 0?void 0:d.image_id)?{id:Number(d.image_id),url:d.image_url||"",title:d.image_url||""}:null});var P=()=>{if(!d){return}z();T((0,v.__)("Correct area cleared.","tutor"))};var O=()=>{if(!d){return}var e=(0,i._)((0,r._)({},d,tt(d._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(d._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{image_id:undefined,image_url:""});C(e);H();A(false);z()};if(!d){return null}var F=w||Boolean(d===null||d===void 0?void 0:d.answer_two_gap_match);return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:pD.wrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:pD.card,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:pD.imageInputWrapper,children:/*#__PURE__*/(0,a/* .jsx */.Y)(p_/* ["default"] */.A,{value:(d===null||d===void 0?void 0:d.image_id)?{id:Number(d.image_id),url:d.image_url||"",title:d.image_url||""}:null,buttonText:(0,v.__)("Upload Image","tutor"),infoText:(0,v.__)("Upload the base image students will draw on.","tutor"),uploadHandler:M,clearHandler:O,emptyImageCss:pD.imageInputEmpty,previewImageCss:pD.imageInputPreview})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:d===null||d===void 0?void 0:d.image_url,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:pD.card,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:pD.answerHeader,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("span",{css:pD.answerHeaderTitle,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:pD.headerIcon,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"edit",width:20,height:20,"aria-hidden":true})}),(0,v.__)("Mark the correct area","tutor")]}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:F,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:pD.actionsRow,children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{type:"button",variant:"secondary",size:"small",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"eraser",style:pD.clearButtonIcon,width:18,height:18}),onClick:P,children:(0,v.__)("Clear","tutor")})})})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("p",{id:_,css:cV,children:(0,v.__)("Use arrow keys to move the drawing pointer. Press Space or Enter to start a freehand stroke, trace with arrow keys, then press Space or Enter again to finish and fill the selection. Escape cancels an in-progress stroke. C clears the saved selection.","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{id:b,ref:q,css:cV,"aria-live":"polite","aria-atomic":"true",role:"status"}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:pD.canvasOuter,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:pD.canvasInner,ref:I,className:"tutor-draw-image-wrapper",children:[/*#__PURE__*/(0,a/* .jsx */.Y)("img",{ref:Y,src:d===null||d===void 0?void 0:d.image_url,alt:(0,v.__)("Background image for marking correct area","tutor"),css:[pD.image,pD.answerImage]}),/*#__PURE__*/(0,a/* .jsx */.Y)("canvas",{ref:k,tabIndex:0,role:"application","aria-describedby":"".concat(_," ").concat(b),css:[pD.canvas,cQ],"aria-label":(0,v.__)("Draw on image: use pointer or keyboard to mark the correct answer area.","tutor")})]})}),n&&/*#__PURE__*/(0,a/* .jsx */.Y)(G/* ["default"] */.A,(0,i._)((0,r._)({},n),{label:(0,v.__)("Precision Level","tutor"),options:pI,helpText:(0,v.__)("Minimum overlap score between student and instructor markings. Larger or smaller marked areas lower the score.","tutor"),onChange:e=>{n.field.onChange(e.value);if(!u){return}if(tt(h,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)){u.setValue(c,tt(h,D/* .QuizDataStatus.UPDATE */.cW.UPDATE))}}})),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:d===null||d===void 0?void 0:d.answer_two_gap_match,children:/*#__PURE__*/(0,a/* .jsx */.Y)("p",{css:pD.savedHint,children:(0,v.__)("Answer zone saved. Students will be graded against this area.","tutor")})})]})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!(d===null||d===void 0?void 0:d.image_url),children:/*#__PURE__*/(0,a/* .jsx */.Y)("p",{css:pD.placeholder,children:(0,v.__)("First, upload your base image above. Then, proceed to the next step to draw the correct target zone.","tutor")})})]})};/* export default */const pC=pq;var pD={wrapper:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["24"] */.YK["24"],";",_/* .Breakpoint.smallMobile */.EA.smallMobile,"{padding-left:",_/* .spacing["8"] */.YK["8"],";}"),card:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["16"] */.YK["16"],";padding:",_/* .spacing["20"] */.YK["20"],";background:",_/* .colorTokens.surface.tutor */.I6.surface.tutor,";border:1px solid ",_/* .colorTokens.stroke.border */.I6.stroke.border,";border-radius:",_/* .borderRadius.card */.Vq.card,";"),imageInputWrapper:/*#__PURE__*/(0,h/* .css */.AH)("max-width:100%;"),imageInputEmpty:/*#__PURE__*/(0,h/* .css */.AH)("background-color:",_/* .colorTokens.background["default"] */.I6.background["default"],";height:210px;border-radius:",_/* .borderRadius.card */.Vq.card,";"),imageInputPreview:/*#__PURE__*/(0,h/* .css */.AH)("height:210px;"),answerHeader:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("row"),";align-items:center;justify-content:space-between;gap:",_/* .spacing["12"] */.YK["12"],";min-height:32px;"),answerHeaderTitle:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.body */.I.body("medium"),";color:",_/* .colorTokens.text.primary */.I6.text.primary,";",Y/* .styleUtils.display.flex */.x.display.flex("row"),";align-items:center;gap:",_/* .spacing["8"] */.YK["8"],";"),headerIcon:/*#__PURE__*/(0,h/* .css */.AH)("flex-shrink:0;color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";"),actionsRow:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("row"),";align-items:center;justify-content:flex-end;min-width:94px;min-height:32px;"),canvasOuter:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex(),";justify-content:center;width:100%;"),canvasInner:/*#__PURE__*/(0,h/* .css */.AH)("position:relative;display:inline-block;max-width:100%;border-radius:",_/* .borderRadius.card */.Vq.card,";overflow:hidden;",_/* .Breakpoint.smallMobile */.EA.smallMobile,"{display:block;width:100%;}img{display:block;width:auto;max-width:100%;height:auto;",_/* .Breakpoint.smallMobile */.EA.smallMobile,"{width:100%;}}"),image:/*#__PURE__*/(0,h/* .css */.AH)("display:block;max-width:100%;height:auto;"),answerImage:/*#__PURE__*/(0,h/* .css */.AH)("filter:grayscale(0.15);"),canvas:/*#__PURE__*/(0,h/* .css */.AH)("position:absolute;top:0;left:0;z-index:1;"),clearButtonIcon:/*#__PURE__*/(0,h/* .css */.AH)("color:",_/* .colorTokens.text.brand */.I6.text.brand,";"),savedHint:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.caption */.I.caption(),";color:",_/* .colorTokens.text.success */.I6.text.success,";margin:0;"),placeholder:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.caption */.I.caption(),";color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";")};// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/curriculum/question-types/DrawImage.tsx
var pE=()=>{var e;var t=(0,S/* .useFormContext */.xW)();var{activeQuestionId:n,activeQuestionIndex:o,validationError:s,setValidationError:l}=cv();var u="questions.".concat(o,".question_answers");var d="questions.".concat(o,".question_settings.draw_image_threshold_percent");var{fields:c}=(0,S/* .useFieldArray */.jz)({control:t.control,name:u});var p=(0,S/* .useController */.as)({control:t.control,name:d,defaultValue:70});// Only render Controller when the value exists to ensure field.value is always defined
if(c.length===0){return null}return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:pz.optionWrapper,children:/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:t.control,name:"questions.".concat(o,".question_answers.0"),render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(pC,(0,i._)((0,r._)({},e),{questionId:n,activeQuestionIndex:o,validationError:s,setValidationError:l,precisionControllerProps:p}))},(e=c[0])===null||e===void 0?void 0:e.id)})};/* export default */const pS=pE;var pz={optionWrapper:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["16"] */.YK["16"],";padding-left:",_/* .spacing["40"] */.YK["40"],";")};// CONCATENATED MODULE: ./assets/src/js/v3/shared/components/fields/quiz/questions/FormFillinTheBlanks.tsx
function pT(){var e=(0,I._)(["\n      background-color: ",";\n      box-shadow: 0 0 0 1px ",";\n\n      &:hover {\n        box-shadow: 0 0 0 1px ",";\n      }\n    "]);pT=function t(){return e};return e}function pM(){var e=(0,I._)(["\n      color: ",";\n    "]);pM=function t(){return e};return e}function pH(){var e=(0,I._)(["\n      color: ",";\n\n      span {\n        color: ",";\n      }\n    "]);pH=function t(){return e};return e}var pP=e=>{var{field:t,questionId:n,validationError:s,setValidationError:l}=e;var u,d,c,p;var h;var g=(h=t.value)!==null&&h!==void 0?h:{_data_status:D/* .QuizDataStatus.NEW */.cW.NEW,is_saved:false,answer_id:(0,k/* .nanoid */.Ak)(),answer_title:"",belongs_question_id:n,belongs_question_type:"fill_in_the_blank",answer_two_gap_match:"",answer_view_format:"text",answer_order:0,is_correct:"0"};var _=(0,o.useRef)(null);var w=(u=g.answer_two_gap_match)===null||u===void 0?void 0:u.split("|");var[A,I]=(0,o.useState)(!g.answer_title||!g.answer_two_gap_match);var[q,C]=(0,o.useState)(g);var S=((c=g.answer_title)===null||c===void 0?void 0:(d=c.match(/{dash}/g))===null||d===void 0?void 0:d.length)||0;var z=((p=g.answer_two_gap_match)===null||p===void 0?void 0:p.split("|").length)||0;var T=!!(g.answer_title&&g.answer_two_gap_match&&S!==z);(0,o.useEffect)(()=>{if((0,D/* .isDefined */.O9)(_.current)&&A){_.current.focus()}},[A]);return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:pF.option,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:pF.optionLabel({isEditing:A}),children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:pF.optionHeader,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:pF.optionTitle,children:(0,v.__)("Fill in the blanks","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:g.is_saved&&!A,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:pF.optionActions,children:/*#__PURE__*/(0,a/* .jsx */.Y)(M/* ["default"] */.A,{content:(0,v.__)("Edit","tutor"),children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:Y/* .styleUtils.actionButton */.x.actionButton,"data-edit-button":true,onClick:e=>{e.stopPropagation();I(true)},"data-visually-hidden":true,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"edit",width:24,height:24})})})})})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:pF.optionBody,children:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!g.is_saved||A,fallback:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:pF.placeholderWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:pF.optionPlaceholder({isTitle:!!g.answer_title}),children:g.answer_title?g.answer_title.replace(/{dash}/g,"_____"):(0,v.__)("Question title...","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:pF.optionPlaceholder({isCorrectAnswer:w===null||w===void 0?void 0:w.length}),children:w&&w.length>0?/*#__PURE__*/(0,a/* .jsx */.Y)(b/* ["default"] */.A,{each:w,children:(e,t)=>/*#__PURE__*/(0,a/* .jsxs */.FD)(o.Fragment,{children:[e,/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:t<(w?w.length-1:0),children:/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:"|"})})]},t)}):(0,v.__)("Correct Answer(s)...","tutor")})]}),children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:pF.optionInputWrapper,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:pF.inputWithHints,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("input",(0,i._)((0,r._)({},t),{ref:_,type:"text",placeholder:(0,v.__)("Question title...","tutor"),value:g.answer_title,onClick:e=>{e.stopPropagation()},onChange:e=>{t.onChange((0,i._)((0,r._)({},g,tt(g._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(g._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{answer_title:e.target.value}))},onKeyDown:e=>(0,E._)(function*(){e.stopPropagation();if((e.metaKey||e.ctrlKey)&&e.key==="Enter"&&g.answer_title){t.onChange((0,r._)({},g,tt(g._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(g._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)}));I(false)}})()})),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:pF.inputHints,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"info",height:20,width:20}),/*#__PURE__*/(0,a/* .jsx */.Y)("p",{children:(0,v.__)("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")})]})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:pF.inputWithHints,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("input",(0,i._)((0,r._)({},t),{type:"text",placeholder:(0,v.__)("Correct Answer(s)...","tutor"),value:w===null||w===void 0?void 0:w.join("|"),onClick:e=>{e.stopPropagation()},onChange:e=>{t.onChange((0,i._)((0,r._)({},g,tt(g._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(g._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{answer_two_gap_match:e.target.value}))},onKeyDown:e=>(0,E._)(function*(){if((e.metaKey||e.ctrlKey)&&e.key==="Enter"&&g.answer_two_gap_match){t.onChange((0,r._)({},g,tt(g._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(g._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE),is_saved:true}));if((s===null||s===void 0?void 0:s.type)==="save_option"){l===null||l===void 0?void 0:l(null)}I(false)}})()})),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:T,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:pF.errorMessage,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"info",height:20,width:20}),/*#__PURE__*/(0,a/* .jsx */.Y)("p",{children:(0,v.__)("Match the number of answers to the number of blanks {dash} in your question.","tutor")})]})}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:pF.inputHints,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"info",height:20,width:20}),/*#__PURE__*/(0,a/* .jsx */.Y)("p",{children:(0,v.__)("Separate multiple answers by a vertical bar |. 1 answer per {dash} variable is defined in the question. Example: Apple | Banana | Orange","tutor")})]})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:pF.optionInputButtons,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:g.is_saved,children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",size:"small",onClick:e=>{e.stopPropagation();I(false);t.onChange(q)},children:(0,v.__)("Cancel","tutor")})}),/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"secondary",size:"small",onClick:e=>(0,E._)(function*(){e.stopPropagation();if(T){return}t.onChange((0,r._)({},g,tt(g._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(g._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE),is_saved:true}));C((0,r._)({},g,tt(g._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(g._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE),is_saved:true}));if((s===null||s===void 0?void 0:s.type)==="save_option"){l===null||l===void 0?void 0:l(null)}I(false)})(),disabled:!g.answer_title||!g.answer_two_gap_match||T,children:(0,v.__)("Ok","tutor")})]})]})})})]})})};/* export default */const pO=pP;var pF={option:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex(),";",F/* .typography.caption */.I.caption("medium"),";align-items:center;color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";gap:",_/* .spacing["10"] */.YK["10"],";align-items:center;"),optionLabel:e=>{var{isEditing:t}=e;return/*#__PURE__*/(0,h/* .css */.AH)("display:flex;flex-direction:column;gap:",_/* .spacing["12"] */.YK["12"],";width:100%;border-radius:",_/* .borderRadius.card */.Vq.card,";padding:",_/* .spacing["12"] */.YK["12"]," ",_/* .spacing["16"] */.YK["16"],";transition:box-shadow 0.15s ease-in-out;background-color:",_/* .colorTokens.background.white */.I6.background.white,";[data-visually-hidden]{opacity:0;}&:hover{box-shadow:0 0 0 1px ",_/* .colorTokens.stroke.hover */.I6.stroke.hover,";[data-visually-hidden]{opacity:1;}}",t&&(0,h/* .css */.AH)(pT(),_/* .colorTokens.background.white */.I6.background.white,_/* .colorTokens.stroke.brand */.I6.stroke.brand,_/* .colorTokens.stroke.brand */.I6.stroke.brand))},optionHeader:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;justify-content:space-between;align-items:center;"),optionTitle:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.caption */.I.caption("medium"),";color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";"),optionActions:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;gap:",_/* .spacing["8"] */.YK["8"],";align-items:center;"),actionButton:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.resetButton */.x.resetButton,";color:",_/* .colorTokens.icon["default"] */.I6.icon["default"],";display:flex;cursor:pointer;"),optionBody:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;"),optionInputWrapper:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.optionInputWrapper */.x.optionInputWrapper,";gap:",_/* .spacing["16"] */.YK["16"],";"),placeholderWrapper:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;flex-direction:column;"),optionPlaceholder:e=>{var{isTitle:t,isCorrectAnswer:n}=e;return/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.body */.I.body(),";color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";padding-block:",_/* .spacing["4"] */.YK["4"],";display:flex;align-items:center;gap:",_/* .spacing["4"] */.YK["4"],";",t&&(0,h/* .css */.AH)(pM(),_/* .colorTokens.text.hints */.I6.text.hints)," ",n&&(0,h/* .css */.AH)(pH(),_/* .colorTokens.text.success */.I6.text.success,_/* .colorTokens.stroke.border */.I6.stroke.border))},inputWithHints:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;flex-direction:column;gap:",_/* .spacing["8"] */.YK["8"],";"),inputHints:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;gap:",_/* .spacing["4"] */.YK["4"],";",F/* .typography.small */.I.small(),";color:",_/* .colorTokens.text.hints */.I6.text.hints,";align-items:flex-start;svg{flex-shrink:0;}"),errorMessage:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;gap:",_/* .spacing["4"] */.YK["4"],";",F/* .typography.small */.I.small(),";color:",_/* .colorTokens.text.error */.I6.text.error,";align-items:flex-start;color:",_/* .colorTokens.text.error */.I6.text.error,";svg{flex-shrink:0;color:",_/* .colorTokens.icon.error */.I6.icon.error,";}"),optionInputButtons:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;justify-content:flex-end;gap:",_/* .spacing["8"] */.YK["8"],";")};// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/curriculum/question-types/FillinTheBlanks.tsx
var pN=()=>{var e=(0,S/* .useFormContext */.xW)();var{activeQuestionId:t,activeQuestionIndex:n,validationError:o,setValidationError:s}=cv();var{fields:l}=(0,S/* .useFieldArray */.jz)({control:e.control,name:"questions.".concat(n,".question_answers")});return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:pW.optionWrapper,children:/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:e.control,name:"questions.".concat(n,".question_answers.0"),render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(pO,(0,i._)((0,r._)({},e),{questionId:t,validationError:o,setValidationError:s}))},l.length?JSON.stringify(l[0]):"")})};/* export default */const pK=pN;var pW={optionWrapper:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";padding-left:",_/* .spacing["40"] */.YK["40"],";")};// CONCATENATED MODULE: ./assets/src/js/v3/shared/components/fields/quiz/questions/FormImageAnswering.tsx
function pR(){var e=(0,I._)(["\n      background-color: ",";\n      outline: 1px solid ",";\n\n      &:hover {\n        outline: 1px solid ",";\n      }\n    "]);pR=function t(){return e};return e}function pL(){var e=(0,I._)(["\n      background-color: ",";\n    "]);pL=function t(){return e};return e}function pU(){var e=(0,I._)(["\n      box-shadow: ",";\n    "]);pU=function t(){return e};return e}var pB=!!P/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var pj=e=>{var{index:t,onDuplicateOption:n,onRemoveOption:s,field:l,isOverlay:u=false,questionId:d,validationError:c,setValidationError:h}=e;var g,b;var w;var I=(w=l.value)!==null&&w!==void 0?w:{answer_id:(0,k/* .nanoid */.Ak)(),answer_title:"",is_correct:"0",belongs_question_id:d,belongs_question_type:"image_answering"};var C=(0,o.useRef)(null);var[S,z]=(0,o.useState)(!I.answer_title&&!I.image_id&&!I.image_url);var[H,P]=(0,o.useState)(I);var{attributes:O,listeners:F,setNodeRef:N,transform:K,transition:W,isDragging:R}=(0,p/* .useSortable */.gl)({id:((g=l.value)===null||g===void 0?void 0:g.answer_id)||0,animateLayoutChanges:A/* .animateLayoutChanges */.J});var{openMediaLibrary:L,resetFiles:U}=(0,pY/* ["default"] */.A)({options:{type:"image"},onChange:e=>{if(e&&!Array.isArray(e)){var{id:t,url:n}=e;l.onChange((0,i._)((0,r._)({},I,tt(I._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(I._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{image_id:t,image_url:n}))}},initialFiles:((b=l.value)===null||b===void 0?void 0:b.image_id)?{id:Number(I.image_id),url:I.image_url||"",title:I.image_url||""}:null});var B={transform:q/* .CSS.Transform.toString */.Ks.Transform.toString(K),transition:W,opacity:R?.3:undefined};var j=()=>{l.onChange((0,i._)((0,r._)({},I,tt(I._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(I._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{image_id:"",image_url:""}));U()};(0,o.useEffect)(()=>{if((0,D/* .isDefined */.O9)(C.current)&&S){C.current.focus()}},[S]);return/*#__PURE__*/(0,a/* .jsx */.Y)("div",(0,i._)((0,r._)({},O),{css:pQ.option,ref:N,style:B,tabIndex:-1,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:pQ.optionLabel({isEditing:S,isOverlay:u,isDragging:R}),onClick:()=>{z(true)},onKeyDown:e=>{e.stopPropagation();if(e.key==="Enter"||e.key===" "){z(true)}},children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:pQ.optionHeader,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:Y/* .styleUtils.optionCounter */.x.optionCounter({isEditing:S}),children:String.fromCharCode(65+t)}),/*#__PURE__*/(0,a/* .jsxs */.FD)(y/* ["default"] */.A,{when:!S&&I.is_saved,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("button",(0,i._)((0,r._)({},F),{type:"button",css:Y/* .styleUtils.optionDragButton */.x.optionDragButton({isOverlay:u}),"data-visually-hidden":true,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"dragVertical",height:24,width:24})})),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:pQ.optionActions,"data-visually-hidden":true,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(M/* ["default"] */.A,{content:(0,v.__)("Edit","tutor"),delay:200,children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:Y/* .styleUtils.actionButton */.x.actionButton,onClick:e=>{e.stopPropagation();z(true)},children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"edit",width:24,height:24})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(M/* ["default"] */.A,{content:(0,v.__)("Duplicate","tutor"),delay:200,children:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!pB,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:Y/* .styleUtils.actionButton */.x.actionButton,onClick:e=>{e.stopPropagation();n(I)},children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"copyPaste",width:24,height:24})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(T/* ["default"] */.A,{size:"tiny",children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{disabled:true,type:"button",css:Y/* .styleUtils.actionButton */.x.actionButton,onClick:k/* .noop */.lQ,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"copyPaste",width:24,height:24})})})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(M/* ["default"] */.A,{content:(0,v.__)("Delete","tutor"),delay:200,children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:Y/* .styleUtils.actionButton */.x.actionButton,onClick:e=>{e.stopPropagation();s()},children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"delete",width:24,height:24})})})]})]})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:pQ.optionBody,children:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:S,fallback:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:pQ.placeholderWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:I.image_url,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:pQ.imagePlaceholder,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"imagePreview",height:48,width:48})}),children:()=>/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:pQ.imagePlaceholder,children:/*#__PURE__*/(0,a/* .jsx */.Y)("img",{src:I.image_url,alt:I.image_url})})}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:pQ.optionPlaceholder,children:I.answer_title||(0,v.__)("Write answer option...","tutor")})]}),children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:Y/* .styleUtils.optionInputWrapper */.x.optionInputWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(p_/* ["default"] */.A,{value:{id:Number(I.image_id),url:I.image_url||"",title:I.image_url||""},buttonText:(0,v.__)("Upload Image","tutor"),infoText:(0,v.__)("Standard Size: 700x430 pixels","tutor"),uploadHandler:L,clearHandler:j,emptyImageCss:pQ.emptyImageInput,previewImageCss:pQ.previewImageInput}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:pQ.inputWithHints,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("input",(0,i._)((0,r._)({},l),{ref:C,type:"text",placeholder:(0,v.__)("Input answer here","tutor"),value:I.answer_title,onClick:e=>{e.stopPropagation()},onChange:e=>{l.onChange((0,i._)((0,r._)({},I,tt(I._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(I._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{answer_title:e.target.value}))},onKeyDown:e=>(0,E._)(function*(){e.stopPropagation();if((e.metaKey||e.ctrlKey)&&e.key==="Enter"&&I.answer_title){l.onChange((0,r._)({},I,tt(I._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(I._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE),is_saved:true}));if((c===null||c===void 0?void 0:c.type)==="save_option"){h===null||h===void 0?void 0:h(null)}z(false)}})()})),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:pQ.inputHints,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"info",height:20,width:20}),/*#__PURE__*/(0,a/* .jsxs */.FD)("p",{children:[(0,v.__)("Students need to type their answers exactly as you write them here. Use ","tutor"),/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:{fontWeight:_/* .fontWeight.semiBold */.Wy.semiBold},children:(0,v.__)("small caps","tutor")}),(0,v.__)(" when writing the answer.","tutor")]})]})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:pQ.optionInputButtons,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",size:"small",onClick:e=>{e.stopPropagation();z(false);l.onChange(H);if(!I.is_saved){s();if((c===null||c===void 0?void 0:c.type)==="save_option"){h===null||h===void 0?void 0:h(null)}}},children:(0,v.__)("Cancel","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"secondary",size:"small",onClick:e=>(0,E._)(function*(){e.stopPropagation();l.onChange((0,i._)((0,r._)({},I,tt(I._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(I._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{is_saved:true}));P((0,i._)((0,r._)({},I,tt(I._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(I._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{is_saved:true}));if((c===null||c===void 0?void 0:c.type)==="save_option"){h===null||h===void 0?void 0:h(null)}z(false)})(),disabled:!I.answer_title||!I.image_id,children:(0,v.__)("Ok","tutor")})]})]})})})]})}))};/* export default */const pV=pj;var pQ={option:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex(),";",F/* .typography.caption */.I.caption("medium"),";align-items:center;color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";gap:",_/* .spacing["10"] */.YK["10"],";align-items:center;"),optionLabel:e=>{var{isEditing:t,isOverlay:n,isDragging:r}=e;return/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),"    gap:",_/* .spacing["20"] */.YK["20"],";width:100%;border-radius:",_/* .borderRadius.card */.Vq.card,";padding:",_/* .spacing["12"] */.YK["12"]," ",_/* .spacing["16"] */.YK["16"],";background-color:",_/* .colorTokens.background.white */.I6.background.white,";[data-visually-hidden]{opacity:0;}&:hover{outline:1px solid ",_/* .colorTokens.stroke.hover */.I6.stroke.hover,";[data-visually-hidden]{opacity:1;}}",t&&(0,h/* .css */.AH)(pR(),_/* .colorTokens.background.white */.I6.background.white,_/* .colorTokens.stroke.brand */.I6.stroke.brand,_/* .colorTokens.stroke.brand */.I6.stroke.brand)," ",r&&(0,h/* .css */.AH)(pL(),_/* .colorTokens.stroke.hover */.I6.stroke.hover)," ",n&&(0,h/* .css */.AH)(pU(),_/* .shadow.drag */.r7.drag)," ",_/* .Breakpoint.smallTablet */.EA.smallTablet,"{[data-visually-hidden]{opacity:1;}}")},optionHeader:/*#__PURE__*/(0,h/* .css */.AH)("display:grid;grid-template-columns:1fr auto 1fr;align-items:center;:focus-within{[data-visually-hidden]{opacity:1;}}"),optionActions:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex(),"    gap:",_/* .spacing["8"] */.YK["8"],";place-self:center end;"),optionBody:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex()),placeholderWrapper:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),"    gap:",_/* .spacing["12"] */.YK["12"],";width:100%;"),imagePlaceholder:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.flexCenter */.x.flexCenter(),";height:210px;width:100%;background-color:",_/* .colorTokens.background["default"] */.I6.background["default"],";border-radius:",_/* .borderRadius.card */.Vq.card,";overflow:hidden;svg{color:",_/* .colorTokens.icon.hints */.I6.icon.hints,";}img{width:100%;height:100%;object-fit:cover;object-position:center;}"),emptyImageInput:/*#__PURE__*/(0,h/* .css */.AH)("background-color:",_/* .colorTokens.background["default"] */.I6.background["default"],";height:210px;"),previewImageInput:/*#__PURE__*/(0,h/* .css */.AH)("height:210px;"),optionPlaceholder:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.body */.I.body(),";color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";padding-block:",_/* .spacing["4"] */.YK["4"],";"),inputWithHints:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),"    gap:",_/* .spacing["8"] */.YK["8"],";"),inputHints:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex(),"    gap:",_/* .spacing["4"] */.YK["4"],";",F/* .typography.small */.I.small(),";color:",_/* .colorTokens.text.hints */.I6.text.hints,";align-items:flex-start;svg{flex-shrink:0;}"),optionInputButtons:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex(),"    justify-content:flex-end;gap:",_/* .spacing["8"] */.YK["8"],";")};// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/curriculum/question-types/ImageAnswering.tsx
var pG=()=>{var[e,t]=(0,o.useState)(null);var n=(0,S/* .useFormContext */.xW)();var{activeQuestionIndex:s,activeQuestionId:u,validationError:h,setValidationError:g}=cv();var{fields:_,append:w,insert:A,remove:Y,move:I}=(0,S/* .useFieldArray */.jz)({control:n.control,name:"questions.".concat(s,".question_answers")});var q=(0,d/* .useSensors */.FR)((0,d/* .useSensor */.MS)(d/* .PointerSensor */.AN,{activationConstraint:{distance:10}}),(0,d/* .useSensor */.MS)(d/* .KeyboardSensor */.uN,{coordinateGetter:p/* .sortableKeyboardCoordinates */.JR}));var C=(0,o.useMemo)(()=>{if(!e){return null}return _.find(t=>t.answer_id===e)},[e,_]);var E=()=>{w({_data_status:D/* .QuizDataStatus.NEW */.cW.NEW,is_saved:false,answer_id:(0,k/* .nanoid */.Ak)(),answer_title:"",is_correct:"0",belongs_question_id:u,belongs_question_type:"image_answering",answer_order:_.length,answer_two_gap_match:"",answer_view_format:""},{shouldFocus:true,focusName:"questions.".concat(s,".question_answers.").concat(_.length,".answer_title")});if((h===null||h===void 0?void 0:h.type)==="add_option"){g(null)}};var z=(e,t)=>{var n=(0,i._)((0,r._)({},t),{_data_status:D/* .QuizDataStatus.NEW */.cW.NEW,is_saved:true,answer_id:(0,k/* .nanoid */.Ak)(),answer_title:"".concat(t.answer_title," (copy)"),is_correct:"0"});var a=e+1;A(a,n)};var T=(e,t)=>{Y(e);if(t._data_status!==D/* .QuizDataStatus.NEW */.cW.NEW){n.setValue("deleted_answer_ids",[...n.getValues("deleted_answer_ids"),t.answer_id])}};return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:pX.optionWrapper,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)(d/* .DndContext */.Mp,{sensors:q,collisionDetection:d/* .closestCenter */.fp,modifiers:[c/* .restrictToWindowEdges */.Q_],onDragStart:e=>{t(e.active.id)},onDragEnd:e=>{var{active:n,over:r}=e;if(!r){return}if(n.id!==r.id){var i=_.findIndex(e=>e.answer_id===n.id);var a=_.findIndex(e=>e.answer_id===r.id);I(i,a)}t(null)},children:[/*#__PURE__*/(0,a/* .jsx */.Y)(p/* .SortableContext */.gB,{items:_.map(e=>(0,i._)((0,r._)({},e),{id:e.answer_id})),strategy:p/* .verticalListSortingStrategy */._G,children:/*#__PURE__*/(0,a/* .jsx */.Y)(b/* ["default"] */.A,{each:_,children:(e,t)=>/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:n.control,name:"questions.".concat(s,".question_answers.").concat(t),render:n=>/*#__PURE__*/(0,a/* .jsx */.Y)(pV,(0,i._)((0,r._)({},n),{onDuplicateOption:e=>z(t,e),onRemoveOption:()=>T(t,e),index:t,questionId:u,validationError:h,setValidationError:g}))},"".concat(e.answer_id,"-").concat(t))})}),/*#__PURE__*/(0,l.createPortal)(/*#__PURE__*/(0,a/* .jsx */.Y)(d/* .DragOverlay */.Hd,{children:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:C,children:t=>{var o=_.findIndex(e=>e.answer_id===t.answer_id);return/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:n.control,name:"questions.".concat(s,".question_answers.").concat(o),render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(pV,(0,i._)((0,r._)({},e),{onDuplicateOption:k/* .noop */.lQ,onRemoveOption:k/* .noop */.lQ,index:o,isOverlay:true,questionId:u}))},e)}})}),document.body)]}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",onClick:E,buttonContentCss:pX.addOptionButton,icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"plus",height:24,width:24}),children:(0,v.__)("Add Option","tutor")})})]})};/* export default */const p$=pG;var pX={optionWrapper:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["12"] */.YK["12"],";padding-left:",_/* .spacing["40"] */.YK["40"],";",_/* .Breakpoint.smallMobile */.EA.smallMobile,"{padding-left:",_/* .spacing["8"] */.YK["8"],";}"),addOptionButton:/*#__PURE__*/(0,h/* .css */.AH)("color:",_/* .colorTokens.text.brand */.I6.text.brand,";svg{color:",_/* .colorTokens.icon.brand */.I6.icon.brand,";}")};// CONCATENATED MODULE: ./assets/src/js/v3/shared/components/fields/quiz/questions/FormMatching.tsx
function pZ(){var e=(0,I._)(["\n      background-color: ",";\n      outline: 1px solid ",";\n\n      &:hover {\n        outline: 1px solid ",";\n      }\n    "]);pZ=function t(){return e};return e}function pJ(){var e=(0,I._)(["\n      background-color: ",";\n    "]);pJ=function t(){return e};return e}function p0(){var e=(0,I._)(["\n      box-shadow: ",";\n    "]);p0=function t(){return e};return e}function p1(){var e=(0,I._)(["\n      gap: ",";\n    "]);p1=function t(){return e};return e}var p2=!!P/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var p4=e=>{var{index:t,onDuplicateOption:n,onRemoveOption:s,field:l,isOverlay:u=false,isImageMatching:d,questionId:c,validationError:h,setValidationError:g}=e;var _,b;var w;var I=(w=l.value)!==null&&w!==void 0?w:{answer_id:"",answer_title:"",answer_two_gap_match:"",is_correct:"0",belongs_question_id:c,belongs_question_type:"matching"};var C=(0,o.useRef)(null);var[S,z]=(0,o.useState)(!I.answer_title||d?!I.image_url:!I.answer_two_gap_match);var[H,P]=(0,o.useState)(I);var{attributes:O,listeners:F,setNodeRef:N,transform:K,transition:W,isDragging:R}=(0,p/* .useSortable */.gl)({id:((_=l.value)===null||_===void 0?void 0:_.answer_id)||0,animateLayoutChanges:A/* .animateLayoutChanges */.J});var{openMediaLibrary:L,resetFiles:U}=(0,pY/* ["default"] */.A)({options:{type:"image"},onChange:e=>{if(e&&!Array.isArray(e)){var{id:t,url:n}=e;l.onChange((0,i._)((0,r._)({},I,tt(I._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(I._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{image_id:t,image_url:n}))}},initialFiles:((b=l.value)===null||b===void 0?void 0:b.image_id)?{id:Number(l.value.image_id),url:l.value.image_url||"",title:""}:null});var B={transform:q/* .CSS.Transform.toString */.Ks.Transform.toString(K),transition:W,opacity:R?.3:undefined};var j=()=>{l.onChange((0,i._)((0,r._)({},I,tt(I._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(I._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{image_id:"",image_url:""}));U()};(0,o.useEffect)(()=>{if((0,D/* .isDefined */.O9)(C.current)&&S){C.current.focus()}},[S]);return/*#__PURE__*/(0,a/* .jsx */.Y)("div",(0,i._)((0,r._)({},O),{css:p5.option,ref:N,tabIndex:-1,style:B,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:p5.optionLabel({isEditing:S,isDragging:R,isOverlay:u}),onClick:()=>{z(true)},onKeyDown:e=>{e.stopPropagation();if(e.key==="Enter"||e.key===" "){z(true)}},children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:p5.optionHeader,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:Y/* .styleUtils.optionCounter */.x.optionCounter({isEditing:S}),children:String.fromCharCode(65+t)}),/*#__PURE__*/(0,a/* .jsxs */.FD)(y/* ["default"] */.A,{when:!S&&I.is_saved,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("button",(0,i._)((0,r._)({},F),{type:"button",css:Y/* .styleUtils.optionDragButton */.x.optionDragButton({isOverlay:u}),"data-visually-hidden":true,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"dragVertical",height:24,width:24})})),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:p5.optionActions,"data-visually-hidden":true,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(M/* ["default"] */.A,{content:(0,v.__)("Edit","tutor"),delay:200,children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:Y/* .styleUtils.actionButton */.x.actionButton,"data-edit-button":true,onClick:e=>{e.stopPropagation();z(true)},children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"edit",width:24,height:24})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(M/* ["default"] */.A,{content:(0,v.__)("Duplicate","tutor"),delay:200,children:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!p2,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:Y/* .styleUtils.actionButton */.x.actionButton,onClick:e=>{e.stopPropagation();n(I)},children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"copyPaste",width:24,height:24})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(T/* ["default"] */.A,{size:"tiny",children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{disabled:true,type:"button",css:Y/* .styleUtils.actionButton */.x.actionButton,onClick:k/* .noop */.lQ,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"copyPaste",width:24,height:24})})})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(M/* ["default"] */.A,{content:(0,v.__)("Delete","tutor"),delay:200,children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:Y/* .styleUtils.actionButton */.x.actionButton,"data-visually-hidden":true,onClick:e=>{e.stopPropagation();s()},children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"delete",width:24,height:24})})})]})]})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:p5.optionBody,children:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:S,fallback:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:p5.placeholderWrapper({isImageMatching:d}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:d,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:p5.optionPlaceholder,children:I.answer_title||(0,v.__)("Answer title...","tutor")}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:I.image_url,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:p5.imagePlaceholder,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"imagePreview",height:48,width:48})}),children:()=>/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:p5.imagePlaceholder,children:/*#__PURE__*/(0,a/* .jsx */.Y)("img",{src:I.image_url,alt:I.image_url})})})}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:p5.optionPlaceholder,children:!d?I.answer_two_gap_match:I.answer_title})]}),children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:Y/* .styleUtils.optionInputWrapper */.x.optionInputWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:d,children:/*#__PURE__*/(0,a/* .jsx */.Y)(p_/* ["default"] */.A,{value:{id:Number(I.image_id),url:I.image_url||"",title:I.image_url||""},infoText:(0,v.__)("Standard Size: 700x430 pixels","tutor"),uploadHandler:L,clearHandler:j,emptyImageCss:p5.emptyImageInput,previewImageCss:p5.previewImageInput})}),/*#__PURE__*/(0,a/* .jsx */.Y)("input",(0,i._)((0,r._)({},l),{type:"text",ref:C,placeholder:!d?(0,v.__)("Question","tutor"):(0,v.__)("Image matched text..","tutor"),value:I.answer_title,onClick:e=>{e.stopPropagation()},onChange:e=>{l.onChange((0,i._)((0,r._)({},I,tt(I._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(I._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{answer_title:e.target.value}))},onKeyDown:e=>(0,E._)(function*(){e.stopPropagation();if((e.metaKey||e.ctrlKey)&&e.key==="Enter"&&I.answer_title&&I.answer_two_gap_match){l.onChange((0,r._)({},I,tt(I._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(I._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)}));z(false)}})()})),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!d,children:/*#__PURE__*/(0,a/* .jsx */.Y)("input",(0,i._)((0,r._)({},l),{type:"text",placeholder:(0,v.__)("Matched option..","tutor"),value:I.answer_two_gap_match,onClick:e=>{e.stopPropagation()},onChange:e=>{l.onChange((0,i._)((0,r._)({},I,tt(I._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(I._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{answer_two_gap_match:e.target.value}))},onKeyDown:e=>{e.stopPropagation();if((e.metaKey||e.ctrlKey)&&e.key==="Enter"&&I.answer_title&&I.answer_two_gap_match){l.onChange((0,r._)({},I,tt(I._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(I._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE),is_saved:true}));if((h===null||h===void 0?void 0:h.type)==="save_option"){g===null||g===void 0?void 0:g(null)}z(false)}}}))}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:p5.optionInputButtons,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",size:"small",onClick:e=>{e.stopPropagation();z(false);l.onChange(H);if(!I.is_saved){if((h===null||h===void 0?void 0:h.type)==="save_option"){g===null||g===void 0?void 0:g(null)}s()}},children:(0,v.__)("Cancel","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"secondary",size:"small",onClick:e=>{e.stopPropagation();l.onChange((0,i._)((0,r._)({},I,tt(I._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(I._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{is_saved:true}));P((0,i._)((0,r._)({},I,tt(I._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(I._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{is_saved:true}));if((h===null||h===void 0?void 0:h.type)==="save_option"){g===null||g===void 0?void 0:g(null)}z(false)},disabled:!I.answer_title||(d?!I.image_id:!I.answer_two_gap_match),children:(0,v.__)("Ok","tutor")})]})]})})})]})}))};/* export default */const p6=p4;var p5={option:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex(),";",F/* .typography.caption */.I.caption("medium"),";align-items:center;color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";gap:",_/* .spacing["10"] */.YK["10"],";align-items:center;"),optionLabel:e=>{var{isEditing:t,isDragging:n,isOverlay:r}=e;return/*#__PURE__*/(0,h/* .css */.AH)("display:flex;flex-direction:column;gap:",_/* .spacing["12"] */.YK["12"],";width:100%;border-radius:",_/* .borderRadius.card */.Vq.card,";padding:",_/* .spacing["12"] */.YK["12"]," ",_/* .spacing["16"] */.YK["16"],";background-color:",_/* .colorTokens.background.white */.I6.background.white,";[data-visually-hidden]{opacity:0;}&:hover{outline:1px solid ",_/* .colorTokens.stroke.hover */.I6.stroke.hover,";[data-visually-hidden]{opacity:1;}}",t&&(0,h/* .css */.AH)(pZ(),_/* .colorTokens.background.white */.I6.background.white,_/* .colorTokens.stroke.brand */.I6.stroke.brand,_/* .colorTokens.stroke.brand */.I6.stroke.brand)," ",n&&(0,h/* .css */.AH)(pJ(),_/* .colorTokens.stroke.hover */.I6.stroke.hover)," ",r&&(0,h/* .css */.AH)(p0(),_/* .shadow.drag */.r7.drag)," ",_/* .Breakpoint.smallTablet */.EA.smallTablet,"{[data-visually-hidden]{opacity:1;}}")},optionHeader:/*#__PURE__*/(0,h/* .css */.AH)("display:grid;grid-template-columns:1fr auto 1fr;align-items:center;&:focus-within{[data-visually-hidden]{opacity:1;}}"),optionActions:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex(),"    gap:",_/* .spacing["8"] */.YK["8"],";place-self:center end;"),actionButton:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.resetButton */.x.resetButton,";",Y/* .styleUtils.display.flex */.x.display.flex(),"    color:",_/* .colorTokens.icon["default"] */.I6.icon["default"],";cursor:pointer;&:disabled{cursor:not-allowed;color:",_/* .colorTokens.icon.disable.background */.I6.icon.disable.background,";}"),optionBody:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex()),placeholderWrapper:e=>{var{isImageMatching:t}=e;return/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),"    width:100%;",t&&(0,h/* .css */.AH)(p1(),_/* .spacing["12"] */.YK["12"]))},imagePlaceholder:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.flexCenter */.x.flexCenter(),";height:210px;width:100%;background-color:",_/* .colorTokens.background["default"] */.I6.background["default"],";border-radius:",_/* .borderRadius.card */.Vq.card,";overflow:hidden;svg{color:",_/* .colorTokens.icon.hints */.I6.icon.hints,";}img{width:100%;height:100%;object-fit:cover;object-position:center;}"),emptyImageInput:/*#__PURE__*/(0,h/* .css */.AH)("background-color:",_/* .colorTokens.background["default"] */.I6.background["default"],";height:210px;"),previewImageInput:/*#__PURE__*/(0,h/* .css */.AH)("height:210px;"),optionPlaceholder:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.body */.I.body(),";color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";padding-block:",_/* .spacing["4"] */.YK["4"],";"),optionInputWrapper:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),"    width:100%;gap:",_/* .spacing["12"] */.YK["12"],";"),optionInputButtons:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex(),"    justify-content:flex-end;gap:",_/* .spacing["8"] */.YK["8"],";")};// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/curriculum/question-types/Matching.tsx
var p3=()=>{var[e,t]=(0,o.useState)(null);var n=(0,S/* .useFormContext */.xW)();var{activeQuestionIndex:s,activeQuestionId:u,validationError:h,setValidationError:g}=cv();var{fields:_,append:w,insert:A,remove:Y,move:I}=(0,S/* .useFieldArray */.jz)({control:n.control,name:"questions.".concat(s,".question_answers")});var q=(0,S/* .useWatch */.FH)({control:n.control,name:"questions.".concat(s,".question_settings.is_image_matching"),defaultValue:false});var C=(0,d/* .useSensors */.FR)((0,d/* .useSensor */.MS)(d/* .PointerSensor */.AN,{activationConstraint:{distance:10}}),(0,d/* .useSensor */.MS)(d/* .KeyboardSensor */.uN,{coordinateGetter:p/* .sortableKeyboardCoordinates */.JR}));var E=(0,o.useMemo)(()=>{if(!e){return null}return _.find(t=>t.answer_id===e)},[e,_]);var z=()=>{w({_data_status:D/* .QuizDataStatus.NEW */.cW.NEW,is_saved:false,answer_id:(0,k/* .nanoid */.Ak)(),answer_title:"",is_correct:"0",belongs_question_id:u,belongs_question_type:q?"image_matching":"matching",answer_order:_.length,answer_two_gap_match:"",answer_view_format:""},{shouldFocus:true,focusName:"questions.".concat(s,".question_answers.").concat(_.length,".answer_title")});if((h===null||h===void 0?void 0:h.type)==="add_option"){g(null)}};var T=(e,t)=>{var n=(0,i._)((0,r._)({},t),{_data_status:D/* .QuizDataStatus.NEW */.cW.NEW,is_saved:true,answer_id:(0,k/* .nanoid */.Ak)(),answer_title:"".concat(t.answer_title," (copy)"),is_correct:"0"});var a=e+1;A(a,n)};var M=(e,t)=>{Y(e);if(t._data_status!==D/* .QuizDataStatus.NEW */.cW.NEW){n.setValue("deleted_answer_ids",[...n.getValues("deleted_answer_ids"),t.answer_id])}};return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:p9.optionWrapper,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)(d/* .DndContext */.Mp,{sensors:C,collisionDetection:d/* .closestCenter */.fp,modifiers:[c/* .restrictToWindowEdges */.Q_],onDragStart:e=>{t(e.active.id)},onDragEnd:e=>{var{active:n,over:r}=e;if(!r){return}if(n.id!==r.id){var i=_.findIndex(e=>e.answer_id===n.id);var a=_.findIndex(e=>e.answer_id===r.id);I(i,a)}t(null)},children:[/*#__PURE__*/(0,a/* .jsx */.Y)(p/* .SortableContext */.gB,{items:_.map(e=>(0,i._)((0,r._)({},e),{id:e.answer_id})),strategy:p/* .verticalListSortingStrategy */._G,children:/*#__PURE__*/(0,a/* .jsx */.Y)(b/* ["default"] */.A,{each:_,children:(e,t)=>/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:n.control,name:"questions.".concat(s,".question_answers.").concat(t),render:n=>/*#__PURE__*/(0,a/* .jsx */.Y)(p6,(0,i._)((0,r._)({},n),{index:t,onDuplicateOption:e=>T(t,e),onRemoveOption:()=>M(t,e),isImageMatching:q,questionId:u,validationError:h,setValidationError:g}))},"".concat(e.answer_id,"-").concat(t))})}),/*#__PURE__*/(0,l.createPortal)(/*#__PURE__*/(0,a/* .jsx */.Y)(d/* .DragOverlay */.Hd,{children:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:E,children:t=>{var o=_.findIndex(e=>e.answer_id===t.answer_id);return/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:n.control,name:"questions.".concat(s,".question_answers.").concat(o),render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(p6,(0,i._)((0,r._)({},e),{index:o,onDuplicateOption:k/* .noop */.lQ,onRemoveOption:k/* .noop */.lQ,isOverlay:true,isImageMatching:q,questionId:u}))},e)}})}),document.body)]}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",onClick:z,buttonContentCss:p9.addOptionButton,icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"plus",height:24,width:24}),children:(0,v.__)("Add Option","tutor")})})]})};/* export default */const p8=p3;var p9={optionWrapper:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["12"] */.YK["12"],";padding-left:",_/* .spacing["40"] */.YK["40"],";",_/* .Breakpoint.smallMobile */.EA.smallMobile,"{padding-left:",_/* .spacing["8"] */.YK["8"],";}"),addOptionButton:/*#__PURE__*/(0,h/* .css */.AH)("color:",_/* .colorTokens.text.brand */.I6.text.brand,";svg{color:",_/* .colorTokens.icon.brand */.I6.icon.brand,";}")};// CONCATENATED MODULE: ./assets/src/js/v3/shared/components/fields/quiz/questions/FormMultipleChoiceAndOrdering.tsx
function p7(){var e=(0,I._)(["\n        fill: none;\n      "]);p7=function t(){return e};return e}function he(){var e=(0,I._)(["\n          fill: ",";\n        "]);he=function t(){return e};return e}function ht(){var e=(0,I._)(["\n      [data-check-button] {\n        opacity: 1;\n        color: ",";\n        ","\n      }\n    "]);ht=function t(){return e};return e}function hn(){var e=(0,I._)(["\n      background-color: ",";\n      color: ",";\n\n      &:hover {\n        outline: 1px solid ",";\n      }\n    "]);hn=function t(){return e};return e}function hr(){var e=(0,I._)(["\n      background-color: ",";\n      outline: 1px solid ",";\n      &:hover {\n        outline: 1px solid ",";\n      }\n    "]);hr=function t(){return e};return e}function hi(){var e=(0,I._)(["\n      background-color: ",";\n    "]);hi=function t(){return e};return e}function ha(){var e=(0,I._)(["\n      box-shadow: ",";\n    "]);ha=function t(){return e};return e}var ho=!!P/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var hs=e=>{var{field:t,onDuplicateOption:n,onRemoveOption:s,onCheckCorrectAnswer:l,index:u,isOverlay:d=false,questionId:c,hasMultipleCorrectAnswer:h=false,questionType:g="multiple_choice",validationError:_,setValidationError:b}=e;var w,I;var C;var S=(C=t.value)!==null&&C!==void 0?C:{answer_id:(0,k/* .nanoid */.Ak)(),answer_title:"",is_correct:"0",belongs_question_id:c,belongs_question_type:"multiple_choice"};var z=(0,o.useRef)(null);var[H,P]=(0,o.useState)(!S.is_saved||!S.answer_title&&!S.image_url);var[O,F]=(0,o.useState)((0,D/* .isDefined */.O9)(S.image_id)&&(0,D/* .isDefined */.O9)(S.image_url));var[N,K]=(0,o.useState)(S);var{attributes:W,listeners:R,setNodeRef:L,transform:U,transition:B,isDragging:j}=(0,p/* .useSortable */.gl)({id:((w=t.value)===null||w===void 0?void 0:w.answer_id)||0,animateLayoutChanges:A/* .animateLayoutChanges */.J});var{openMediaLibrary:V,resetFiles:Q}=(0,pY/* ["default"] */.A)({options:{type:"image"},onChange:e=>{if(e&&!Array.isArray(e)){var{id:n,url:a}=e;t.onChange((0,i._)((0,r._)({},S,tt(S._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(S._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{image_id:n,image_url:a,answer_view_format:"text_image"}));F(true)}},initialFiles:((I=t.value)===null||I===void 0?void 0:I.image_id)?{id:Number(t.value.image_id),url:t.value.image_url||"",title:""}:null});var G={transform:q/* .CSS.Transform.toString */.Ks.Transform.toString(U),transition:B,opacity:j?.3:undefined};var $=()=>{Q();t.onChange((0,i._)((0,r._)({},S,tt(S._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(S._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{image_id:"",image_url:"",answer_view_format:"text"}));F(false)};(0,o.useEffect)(()=>{if((0,D/* .isDefined */.O9)(z.current)&&H){z.current.focus()}},[H]);return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",(0,i._)((0,r._)({},W),{css:hu.option({isSelected:!!Number(S.is_correct),isMultipleChoice:h}),tabIndex:-1,ref:L,style:G,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:g==="multiple_choice",children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{css:Y/* .styleUtils.optionCheckButton */.x.optionCheckButton,"data-check-button":true,type:"button",onClick:l,children:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:h,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:Number(S.is_correct)?"checkFilled":"check",height:32,width:32}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:Number(S.is_correct)?"checkSquareFilled":"checkSquare",height:32,width:32})})},S.is_correct)}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:hu.optionLabel({isSelected:!!Number(S.is_correct),isEditing:H,isDragging:j,isOverlay:d}),onClick:()=>{P(true)},onKeyDown:e=>{e.stopPropagation();if(e.key==="Enter"||e.key===" "){P(true)}},children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:hu.optionHeader({isEditing:H}),children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:hu.optionCounterAndButton,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:Y/* .styleUtils.optionCounter */.x.optionCounter({isSelected:!!Number(S.is_correct),isEditing:H}),children:String.fromCharCode(65+u)}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:H,children:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!O,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"removeImage",width:24,height:24}),onClick:e=>{e.stopPropagation();$()},children:(0,v.__)("Remove Image","tutor")}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",size:"small",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"addImage",width:24,height:24}),onClick:e=>{e.stopPropagation();V()},children:(0,v.__)("Add Image","tutor")})})})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)(y/* ["default"] */.A,{when:!H&&S.is_saved,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("button",(0,i._)((0,r._)({},R),{type:"button",css:Y/* .styleUtils.optionDragButton */.x.optionDragButton({isOverlay:d}),"data-visually-hidden":true,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"dragVertical",height:24,width:24})})),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:hu.optionActions,"data-visually-hidden":true,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(M/* ["default"] */.A,{content:(0,v.__)("Edit","tutor"),delay:200,children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:Y/* .styleUtils.actionButton */.x.actionButton,onClick:e=>{e.stopPropagation();P(true)},children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"edit",width:24,height:24})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(M/* ["default"] */.A,{content:(0,v.__)("Duplicate","tutor"),delay:200,children:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!ho,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:Y/* .styleUtils.actionButton */.x.actionButton,onClick:e=>{e.stopPropagation();n(S)},children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"copyPaste",width:24,height:24})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(T/* ["default"] */.A,{size:"tiny",children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{disabled:true,type:"button",css:Y/* .styleUtils.actionButton */.x.actionButton,onClick:k/* .noop */.lQ,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"copyPaste",width:24,height:24})})})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(M/* ["default"] */.A,{content:(0,v.__)("Delete","tutor"),delay:200,children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:Y/* .styleUtils.actionButton */.x.actionButton,onClick:e=>{e.stopPropagation();s()},children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"delete",width:24,height:24})})})]})]})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:hu.optionBody,children:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:H,fallback:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:hu.placeholderWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:S.image_url,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:hu.imagePlaceholder,children:/*#__PURE__*/(0,a/* .jsx */.Y)("img",{src:S.image_url,alt:S.image_url})})}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:hu.optionPlaceholder,children:S.answer_title||(0,v.__)("Write answer option...","tutor")})]}),children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:Y/* .styleUtils.optionInputWrapper */.x.optionInputWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:O,children:/*#__PURE__*/(0,a/* .jsx */.Y)(p_/* ["default"] */.A,{value:{id:Number(S.image_id),url:S.image_url||"",title:(0,v.__)("Image","tutor")},buttonText:(0,v.__)("Upload Image","tutor"),infoText:(0,v.__)("Size: 700x430 pixels","tutor"),uploadHandler:V,clearHandler:$,emptyImageCss:hu.emptyImageInput,previewImageCss:hu.previewImageInput})}),/*#__PURE__*/(0,a/* .jsx */.Y)("textarea",(0,i._)((0,r._)({},t),{ref:z,placeholder:(0,v.__)("Write option...","tutor"),value:S.answer_title,onClick:e=>{e.stopPropagation()},onChange:e=>{var{value:n}=e.target;t.onChange((0,i._)((0,r._)({},S,tt(S._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(S._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{answer_title:n}))},onKeyDown:e=>(0,E._)(function*(){e.stopPropagation();if((e.metaKey||e.ctrlKey)&&e.key==="Enter"&&S.answer_title){t.onChange((0,r._)({},S,tt(S._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(S._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE),is_saved:true}));if((_===null||_===void 0?void 0:_.type)==="save_option"){b===null||b===void 0?void 0:b(null)}P(false)}})()})),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:hu.optionInputButtons,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",size:"small",onClick:e=>{e.stopPropagation();P(false);t.onChange(N);if(!S.is_saved){if((_===null||_===void 0?void 0:_.type)==="save_option"){b===null||b===void 0?void 0:b(null)}s()}},children:(0,v.__)("Cancel","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"secondary",size:"small",onClick:e=>(0,E._)(function*(){e.stopPropagation();t.onChange((0,i._)((0,r._)({},S,tt(S._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(S._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{is_saved:true}));K((0,i._)((0,r._)({},S,tt(S._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(S._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{is_saved:true}));if((_===null||_===void 0?void 0:_.type)==="save_option"){b===null||b===void 0?void 0:b(null)}P(false)})(),disabled:!S.answer_title&&!S.image_url,children:(0,v.__)("Ok","tutor")})]})]})})})]})]}))};/* export default */const hl=hs;var hu={option:e=>{var{isSelected:t,isMultipleChoice:n}=e;return/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex(),";",F/* .typography.caption */.I.caption("medium"),";align-items:center;color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";gap:",_/* .spacing["10"] */.YK["10"],";align-items:center;[data-check-button]{color:",_/* .colorTokens.icon["default"] */.I6.icon["default"],";",!n&&(0,h/* .css */.AH)(p7()),"      &:focus-visible{opacity:1;}}&:hover{[data-check-button]{opacity:1;}}&:focus-within{[data-check-button]{opacity:1;}}",t&&(0,h/* .css */.AH)(ht(),_/* .colorTokens.bg.success */.I6.bg.success,!n&&(0,h/* .css */.AH)(he(),_/* .colorTokens.bg.success */.I6.bg.success))," ",_/* .Breakpoint.smallTablet */.EA.smallTablet,"{[data-check-button]{opacity:1;}}")},optionLabel:e=>{var{isSelected:t,isEditing:n,isDragging:r,isOverlay:i}=e;return/*#__PURE__*/(0,h/* .css */.AH)("display:flex;flex-direction:column;gap:",_/* .spacing["12"] */.YK["12"],";width:100%;border-radius:",_/* .borderRadius.card */.Vq.card,";padding:",_/* .spacing["12"] */.YK["12"]," ",_/* .spacing["16"] */.YK["16"],";background-color:",_/* .colorTokens.background.white */.I6.background.white,";[data-visually-hidden]{opacity:0;}&:hover{outline:1px solid ",_/* .colorTokens.stroke.hover */.I6.stroke.hover,";[data-visually-hidden]{opacity:1;}}",t&&(0,h/* .css */.AH)(hn(),_/* .colorTokens.background.success.fill40 */.I6.background.success.fill40,_/* .colorTokens.text.primary */.I6.text.primary,_/* .colorTokens.stroke.success.fill70 */.I6.stroke.success.fill70)," ",n&&(0,h/* .css */.AH)(hr(),_/* .colorTokens.background.white */.I6.background.white,t?_/* .colorTokens.stroke.success.fill70 */.I6.stroke.success.fill70:_/* .colorTokens.stroke.brand */.I6.stroke.brand,t?_/* .colorTokens.stroke.success.fill70 */.I6.stroke.success.fill70:_/* .colorTokens.stroke.brand */.I6.stroke.brand)," ",r&&(0,h/* .css */.AH)(hi(),_/* .colorTokens.stroke.hover */.I6.stroke.hover)," ",i&&(0,h/* .css */.AH)(ha(),_/* .shadow.drag */.r7.drag)," ",_/* .Breakpoint.smallTablet */.EA.smallTablet,"{[data-visually-hidden]{opacity:1;}}")},optionHeader:e=>{var{isEditing:t=false}=e;return/*#__PURE__*/(0,h/* .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,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex(),"    gap:",_/* .spacing["8"] */.YK["8"],";place-self:center start;button{padding:0;min-height:24px;}"),optionActions:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex(),"    gap:",_/* .spacing["8"] */.YK["8"],";place-self:center end;"),optionBody:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex()),placeholderWrapper:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),"    gap:",_/* .spacing["12"] */.YK["12"],";width:100%;"),imagePlaceholder:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.flexCenter */.x.flexCenter(),";height:210px;width:100%;background-color:",_/* .colorTokens.background["default"] */.I6.background["default"],";border-radius:",_/* .borderRadius.card */.Vq.card,";overflow:hidden;svg{color:",_/* .colorTokens.icon.hints */.I6.icon.hints,";}img{width:100%;height:100%;object-fit:cover;object-position:center;}"),emptyImageInput:/*#__PURE__*/(0,h/* .css */.AH)("background-color:",_/* .colorTokens.background["default"] */.I6.background["default"],";height:210px;"),previewImageInput:/*#__PURE__*/(0,h/* .css */.AH)("height:210px;"),optionPlaceholder:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.body */.I.body(),";color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";padding-block:",_/* .spacing["4"] */.YK["4"],";"),optionInputButtons:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex(),"    justify-content:flex-end;gap:",_/* .spacing["8"] */.YK["8"],";")};// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/curriculum/question-types/MultipleChoiceAndOrdering.tsx
function hd(){var e=(0,I._)(["\n      padding-left: ",";\n    "]);hd=function t(){return e};return e}function hc(){var e=(0,I._)(["\n      margin-left: ",";\n    "]);hc=function t(){return e};return e}var hp=()=>{var[e,t]=(0,o.useState)(null);var n=(0,S/* .useFormContext */.xW)();var{activeQuestionIndex:s,activeQuestionId:u,validationError:h,setValidationError:g}=cv();var _=(0,S/* .useWatch */.FH)({control:n.control,name:"questions.".concat(s,".question_settings.has_multiple_correct_answer"),defaultValue:false});var w=n.watch("questions.".concat(s,".question_type"));var{fields:A,append:Y,insert:I,remove:q,update:C,replace:E,move:z}=(0,S/* .useFieldArray */.jz)({control:n.control,name:"questions.".concat(s,".question_answers")});var T=(0,d/* .useSensors */.FR)((0,d/* .useSensor */.MS)(d/* .PointerSensor */.AN,{activationConstraint:{distance:10}}),(0,d/* .useSensor */.MS)(d/* .KeyboardSensor */.uN,{coordinateGetter:p/* .sortableKeyboardCoordinates */.JR}));var M=(0,S/* .useWatch */.FH)({control:n.control,name:"questions.".concat(s,".question_answers"),defaultValue:[]});var H=(0,o.useMemo)(()=>{if(!e){return null}return A.find(t=>t.answer_id===e)},[e,A]);var P=e=>{var t=M[e];if(_){C(e,(0,i._)((0,r._)({},t,tt(t._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(t._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{is_correct:t.is_correct==="1"?"0":"1"}))}else{var n=M.map(e=>(0,i._)((0,r._)({},e,tt(e._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(e._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{is_correct:e.answer_id===t.answer_id?"1":"0"}));E(n)}if((h===null||h===void 0?void 0:h.type)==="correct_option"){g(null)}};var O=()=>{Y({_data_status:D/* .QuizDataStatus.NEW */.cW.NEW,is_saved:false,answer_id:(0,k/* .nanoid */.Ak)(),answer_title:"",is_correct:"0",belongs_question_id:u,belongs_question_type:w,answer_order:A.length,answer_two_gap_match:"",answer_view_format:"text"},{shouldFocus:true,focusName:"questions.".concat(s,".question_answers.").concat(A.length,".answer_title")});if((h===null||h===void 0?void 0:h.type)==="add_option"){g(null)}};var F=(e,t)=>{var n=(0,i._)((0,r._)({},t),{_data_status:D/* .QuizDataStatus.NEW */.cW.NEW,is_saved:true,answer_id:(0,k/* .nanoid */.Ak)(),answer_title:"".concat(t.answer_title," (copy)"),is_correct:"0"});var a=e+1;I(a,n)};var N=(e,t)=>{q(e);if(t._data_status!==D/* .QuizDataStatus.NEW */.cW.NEW){n.setValue("deleted_answer_ids",[...n.getValues("deleted_answer_ids"),t.answer_id])}};return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:hv.optionWrapper({isOrdering:w==="ordering"}),children:[/*#__PURE__*/(0,a/* .jsxs */.FD)(d/* .DndContext */.Mp,{sensors:T,collisionDetection:d/* .closestCenter */.fp,modifiers:[c/* .restrictToWindowEdges */.Q_],onDragStart:e=>{t(e.active.id)},onDragEnd:e=>{var{active:n,over:r}=e;if(!r){return}if(n.id!==r.id){var i=A.findIndex(e=>e.answer_id===n.id);var a=A.findIndex(e=>e.answer_id===r.id);z(i,a)}t(null)},children:[/*#__PURE__*/(0,a/* .jsx */.Y)(p/* .SortableContext */.gB,{items:A.map(e=>(0,i._)((0,r._)({},e),{id:e.answer_id})),strategy:p/* .verticalListSortingStrategy */._G,children:/*#__PURE__*/(0,a/* .jsx */.Y)(b/* ["default"] */.A,{each:A,children:(e,t)=>/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:n.control,name:"questions.".concat(s,".question_answers.").concat(t),render:n=>/*#__PURE__*/(0,a/* .jsx */.Y)(hl,(0,i._)((0,r._)({},n),{onDuplicateOption:e=>F(t,e),onRemoveOption:()=>N(t,e),onCheckCorrectAnswer:()=>P(t),index:t,hasMultipleCorrectAnswer:_,questionType:w,questionId:u,validationError:h,setValidationError:g}))},"".concat(e.answer_id,"-").concat(e.is_correct))})}),/*#__PURE__*/(0,l.createPortal)(/*#__PURE__*/(0,a/* .jsx */.Y)(d/* .DragOverlay */.Hd,{children:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:H,children:t=>{var o=M.findIndex(e=>e.answer_id===t.answer_id);return/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:n.control,name:"questions.".concat(s,".question_answers.").concat(o),render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(hl,(0,i._)((0,r._)({},e),{onDuplicateOption:k/* .noop */.lQ,onRemoveOption:k/* .noop */.lQ,onCheckCorrectAnswer:k/* .noop */.lQ,index:o,isOverlay:true,hasMultipleCorrectAnswer:_,questionType:w,questionId:u}))},e)}})}),document.body)]}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:hv.addOptionButtonWrapper({isOrdering:w==="ordering"}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",onClick:O,buttonContentCss:hv.addOptionButton,icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"plus",height:24,width:24}),children:(0,v.__)("Add Option","tutor")})})]})};/* export default */const hh=hp;var hv={optionWrapper:e=>{var{isOrdering:t}=e;return/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["12"] */.YK["12"],";",t&&(0,h/* .css */.AH)(hd(),_/* .spacing["40"] */.YK["40"]))},addOptionButtonWrapper:e=>{var{isOrdering:t}=e;return/*#__PURE__*/(0,h/* .css */.AH)("margin-left:",_/* .spacing["48"] */.YK["48"],";",t&&(0,h/* .css */.AH)(hc(),_/* .spacing["8"] */.YK["8"]))},addOptionButton:/*#__PURE__*/(0,h/* .css */.AH)("color:",_/* .colorTokens.text.brand */.I6.text.brand,";svg{color:",_/* .colorTokens.icon.brand */.I6.icon.brand,";}")};// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/curriculum/question-types/OpenEndedAndShortAnswer.tsx
var hf=()=>{return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:hm.optionWrapper,children:/*#__PURE__*/(0,a/* .jsx */.Y)(cw/* ["default"] */.A,{icon:"bulb",children:(0,v.__)("No options are necessary for this question type","tutor")})})};/* export default */const hg=hf;var hm={optionWrapper:/*#__PURE__*/(0,h/* .css */.AH)("padding-left:",_/* .spacing["40"] */.YK["40"],";",_/* .Breakpoint.smallMobile */.EA.smallMobile,"{padding-left:",_/* .spacing["8"] */.YK["8"],";}")};// CONCATENATED MODULE: ./assets/src/js/v3/shared/components/fields/quiz/questions/FormPinImage.tsx
/** Instructor mask stroke/fill for valid pin region (same draw core as learning-area draw-on-image). */var h_="rgba(220, 53, 69, 0.95)";var hb=e=>{var{field:t}=e;var n=t.value;var s=(0,o.useId)();var l="".concat(s,"-instruction");var u="".concat(s,"-live-region");var[d,c]=(0,o.useState)(false);var p=(0,o.useRef)(null);var h=(0,o.useRef)(null);var g=(0,o.useRef)(null);var _=(0,o.useRef)(null);var b=(0,o.useCallback)(e=>{t.onChange(e)},[t]);var w=(0,o.useCallback)(e=>{if(!n){return}b((0,i._)((0,r._)({},n,tt(n._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(n._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{answer_two_gap_match:e,is_saved:true}));c(Boolean(e))},[n,b]);var{clearMask:A,announceStatus:Y}=pA({imageRef:p,canvasRef:h,interactionRootRef:g,liveRegionRef:_,instructionId:l,liveRegionId:u,imageUrl:n===null||n===void 0?void 0:n.image_url,initialMaskUrl:(n===null||n===void 0?void 0:n.answer_two_gap_match)||undefined,strokeStyle:h_,onMaskChange:w,onDrawStart:()=>c(true)});var{openMediaLibrary:k,resetFiles:I}=(0,pY/* ["default"] */.A)({options:{type:"image"},onChange:e=>{if(e&&!Array.isArray(e)&&n){var{id:t,url:a}=e;var o=(0,i._)((0,r._)({},n,tt(n._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(n._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{image_id:t,image_url:a,answer_two_gap_match:""});b(o);c(false)}},initialFiles:(n===null||n===void 0?void 0:n.image_id)?{id:Number(n.image_id),url:n.image_url||"",title:n.image_url||""}:null});var q=()=>{if(!n){return}A();Y((0,v.__)("Valid pin area cleared.","tutor"))};var C=()=>{if(!n){return}var e=(0,i._)((0,r._)({},n,tt(n._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(n._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{image_id:undefined,image_url:""});b(e);I();c(false);A()};if(!n){return null}var E=d||Boolean(n===null||n===void 0?void 0:n.answer_two_gap_match);return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:hw.wrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:hw.card,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:hw.imageInputWrapper,children:/*#__PURE__*/(0,a/* .jsx */.Y)(p_/* ["default"] */.A,{value:(n===null||n===void 0?void 0:n.image_id)?{id:Number(n.image_id),url:n.image_url||"",title:n.image_url||""}:null,buttonText:(0,v.__)("Upload Image","tutor"),infoText:(0,v.__)("Upload the base image students will pin on.","tutor"),uploadHandler:k,clearHandler:C,emptyImageCss:hw.imageInputEmpty,previewImageCss:hw.imageInputPreview})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:n===null||n===void 0?void 0:n.image_url,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:hw.card,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:hw.answerHeader,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("span",{css:hw.answerHeaderTitle,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:hw.headerIcon,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"edit",width:20,height:20,"aria-hidden":true})}),(0,v.__)("Mark the correct area","tutor")]}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:E,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:hw.actionsRow,children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{type:"button",variant:"secondary",size:"small",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"eraser",style:hw.clearButtonIcon,width:18,height:18}),onClick:q,children:(0,v.__)("Clear","tutor")})})})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("p",{id:l,css:cV,children:(0,v.__)("Use arrow keys to move the drawing pointer. Press Space or Enter to start a freehand stroke, trace with arrow keys, then press Space or Enter again to finish and fill the selection. Escape cancels an in-progress stroke. C clears the saved selection.","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{id:u,ref:_,css:cV,"aria-live":"polite","aria-atomic":"true",role:"status"}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:hw.canvasOuter,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:hw.canvasInner,ref:g,className:"tutor-draw-image-wrapper",children:[/*#__PURE__*/(0,a/* .jsx */.Y)("img",{ref:p,src:n===null||n===void 0?void 0:n.image_url,alt:(0,v.__)("Background image for pin area","tutor"),css:[hw.image,hw.answerImage]}),/*#__PURE__*/(0,a/* .jsx */.Y)("canvas",{ref:h,tabIndex:0,role:"application","aria-describedby":"".concat(l," ").concat(u),css:[hw.canvas,cQ],"aria-label":(0,v.__)("Mark the valid pin area: use pointer or keyboard to draw the accepted region.","tutor")})]})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:n===null||n===void 0?void 0:n.answer_two_gap_match,children:/*#__PURE__*/(0,a/* .jsx */.Y)("p",{css:hw.savedHint,children:(0,v.__)("Pin area saved. Students will be graded against this region.","tutor")})})]})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!(n===null||n===void 0?void 0:n.image_url),children:/*#__PURE__*/(0,a/* .jsx */.Y)("p",{css:hw.placeholder,children:(0,v.__)("Upload an image to define where students must drop a pin. Then mark the valid area in the next section.","tutor")})})]})};/* export default */const hy=hb;var hw={wrapper:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["24"] */.YK["24"],";",_/* .Breakpoint.smallMobile */.EA.smallMobile,"{padding-left:",_/* .spacing["8"] */.YK["8"],";}"),card:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["16"] */.YK["16"],";padding:",_/* .spacing["20"] */.YK["20"],";background:",_/* .colorTokens.surface.tutor */.I6.surface.tutor,";border-radius:",_/* .borderRadius.card */.Vq.card,";"),imageInputWrapper:/*#__PURE__*/(0,h/* .css */.AH)("max-width:100%;"),imageInputEmpty:/*#__PURE__*/(0,h/* .css */.AH)("background-color:",_/* .colorTokens.background["default"] */.I6.background["default"],";height:210px;border-radius:",_/* .borderRadius.card */.Vq.card,";"),imageInputPreview:/*#__PURE__*/(0,h/* .css */.AH)("height:210px;"),answerHeader:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("row"),";align-items:center;justify-content:space-between;gap:",_/* .spacing["12"] */.YK["12"],";min-height:32px;"),answerHeaderTitle:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.body */.I.body("medium"),";color:",_/* .colorTokens.text.primary */.I6.text.primary,";",Y/* .styleUtils.display.flex */.x.display.flex("row"),";align-items:center;gap:",_/* .spacing["8"] */.YK["8"],";"),headerIcon:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;flex-shrink:0;color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";"),canvasOuter:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex(),";justify-content:center;width:100%;"),canvasInner:/*#__PURE__*/(0,h/* .css */.AH)("position:relative;display:inline-block;max-width:100%;border-radius:",_/* .borderRadius.card */.Vq.card,";overflow:hidden;",_/* .Breakpoint.smallMobile */.EA.smallMobile,"{display:block;width:100%;}img{display:block;width:auto;max-width:100%;height:auto;",_/* .Breakpoint.smallMobile */.EA.smallMobile,"{width:100%;}}"),image:/*#__PURE__*/(0,h/* .css */.AH)("display:block;max-width:100%;height:auto;"),answerImage:/*#__PURE__*/(0,h/* .css */.AH)("filter:grayscale(0.1);"),canvas:/*#__PURE__*/(0,h/* .css */.AH)("position:absolute;top:0;left:0;z-index:1;"),actionsRow:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("row"),";align-items:center;justify-content:flex-end;min-width:94px;min-height:32px;gap:",_/* .spacing["12"] */.YK["12"],";flex-wrap:wrap;color:",_/* .colorTokens.text.brand */.I6.text.brand,";"),clearButtonIcon:/*#__PURE__*/(0,h/* .css */.AH)("color:",_/* .colorTokens.text.brand */.I6.text.brand,";"),savedHint:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.caption */.I.caption(),";color:",_/* .colorTokens.text.success */.I6.text.success,";margin:0;"),placeholder:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.caption */.I.caption(),";color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";")};// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/curriculum/question-types/PinImage.tsx
var hx=()=>{var e=(0,S/* .useFormContext */.xW)();var{activeQuestionId:t,activeQuestionIndex:n,validationError:o,setValidationError:s}=cv();var l="questions.".concat(n,".question_answers");var{fields:u}=(0,S/* .useFieldArray */.jz)({control:e.control,name:l});// Only render Controller when the value exists to ensure field.value is always defined
if(u.length===0){return null}return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:hY.optionWrapper,children:/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:e.control,name:"questions.".concat(n,".question_answers.0"),render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(hy,(0,i._)((0,r._)({},e),{questionId:t,validationError:o,setValidationError:s}))},JSON.stringify(u[0]))})};/* export default */const hA=hx;var hY={optionWrapper:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";padding-left:",_/* .spacing["40"] */.YK["40"],";")};// CONCATENATED MODULE: ./assets/src/js/v3/shared/components/fields/quiz/questions/FormPuzzle.tsx
var hk=e=>{var{field:t,activeQuestionIndex:n=0,gridSizeControllerProps:s,gridSizePath:l}=e;var u;var d=(0,S/* .useFormContext */.xW)();var c=t.value;var p=l!==null&&l!==void 0?l:"questions.".concat(n,".question_settings.puzzle_grid_size");var h=Array.isArray(d===null||d===void 0?void 0:(u=d.getValues)===null||u===void 0?void 0:u.call(d,"questions"))?"questions.".concat(n,"._data_status"):"_data_status";var f;var g=d?(f=d.watch(h))!==null&&f!==void 0?f:D/* .QuizDataStatus.NO_CHANGE */.cW.NO_CHANGE:D/* .QuizDataStatus.NO_CHANGE */.cW.NO_CHANGE;var m=(0,o.useMemo)(()=>[{value:2,difficulty:(0,v.__)("Easy","tutor")},{value:3,difficulty:(0,v.__)("Easy","tutor")},{value:4,difficulty:(0,v.__)("Medium","tutor")},{value:5,difficulty:(0,v.__)("Medium","tutor")},{value:6,difficulty:(0,v.__)("Hard","tutor")},{value:7,difficulty:(0,v.__)("Hard","tutor")}].map(e=>{var{value:t,difficulty:n}=e;return{label:"".concat(n," - ").concat(t,"×").concat(t," (").concat(t*t," ").concat((0,v.__)("pieces","tutor"),")"),value:t}}),[]);var _=(0,o.useCallback)(e=>{t.onChange(e)},[t]);var{openMediaLibrary:b,resetFiles:w}=(0,pY/* ["default"] */.A)({options:{type:"image"},onChange:e=>{if(e&&!Array.isArray(e)&&c){var{id:t,url:n}=e;var a=(0,i._)((0,r._)({},c,tt(c._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(c._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{image_id:t,image_url:n,answer_two_gap_match:n,is_saved:true});_(a)}},initialFiles:(c===null||c===void 0?void 0:c.image_id)?{id:Number(c.image_id),url:c.image_url||"",title:c.image_url||""}:null});var A=()=>{if(!c){return}w();_((0,i._)((0,r._)({},c,tt(c._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(c._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{image_id:undefined,image_url:"",answer_two_gap_match:"",is_saved:true}))};if(!c){return null}return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:hq.wrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:hq.card,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:hq.imageInputWrapper,children:/*#__PURE__*/(0,a/* .jsx */.Y)(p_/* ["default"] */.A,{value:(c===null||c===void 0?void 0:c.image_id)?{id:Number(c.image_id),url:c.image_url||"",title:c.image_url||""}:null,buttonText:(0,v.__)("Upload Puzzle Image","tutor"),infoText:(0,v.__)("Upload the source image that will be split into puzzle pieces.","tutor"),uploadHandler:b,clearHandler:A,emptyImageCss:hq.imageInputEmpty,previewImageCss:hq.imageInputPreview})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:c===null||c===void 0?void 0:c.image_url,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:hq.card,children:s?/*#__PURE__*/(0,a/* .jsx */.Y)(G/* ["default"] */.A,(0,i._)((0,r._)({},s),{label:(0,v.__)("Difficulty Level","tutor"),options:m,wrapperCss:hq.dropdownText,optionItemCss:hq.dropdownOptionText,helpText:(0,v.__)("Larger grids create more pieces and a harder puzzle for learners.","tutor"),onChange:e=>{s.field.onChange(e.value);if(tt(g,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)){d.setValue(h,tt(g,D/* .QuizDataStatus.UPDATE */.cW.UPDATE))}}})):/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:d.control,name:p,defaultValue:4,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(G/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,v.__)("Difficulty Level","tutor"),options:m,wrapperCss:hq.dropdownText,optionItemCss:hq.dropdownOptionText,helpText:(0,v.__)("Larger grids create more pieces and a harder puzzle for learners.","tutor"),onChange:t=>{e.field.onChange(t.value);if(tt(g,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)){d.setValue(h,tt(g,D/* .QuizDataStatus.UPDATE */.cW.UPDATE))}}}))})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!(c===null||c===void 0?void 0:c.image_url),children:/*#__PURE__*/(0,a/* .jsx */.Y)("p",{css:hq.placeholder,children:(0,v.__)("Upload an image first, then configure the grid size for the puzzle.","tutor")})})]})};/* export default */const hI=hk;var hq={wrapper:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["24"] */.YK["24"],";",_/* .Breakpoint.smallMobile */.EA.smallMobile,"{padding-left:",_/* .spacing["8"] */.YK["8"],";}"),card:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["16"] */.YK["16"],";padding:",_/* .spacing["20"] */.YK["20"],";background:",_/* .colorTokens.surface.tutor */.I6.surface.tutor,";border:1px solid ",_/* .colorTokens.stroke.border */.I6.stroke.border,";border-radius:",_/* .borderRadius.card */.Vq.card,";"),imageInputWrapper:/*#__PURE__*/(0,h/* .css */.AH)("max-width:100%;"),imageInputEmpty:/*#__PURE__*/(0,h/* .css */.AH)("background-color:",_/* .colorTokens.background["default"] */.I6.background["default"],";height:210px;border-radius:",_/* .borderRadius.card */.Vq.card,";"),imageInputPreview:/*#__PURE__*/(0,h/* .css */.AH)("height:210px;"),previewLabel:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.body */.I.body("medium"),";color:",_/* .colorTokens.text.primary */.I6.text.primary,";"),previewWrap:/*#__PURE__*/(0,h/* .css */.AH)("width:100%;aspect-ratio:1 / 1;border-radius:",_/* .borderRadius.card */.Vq.card,";overflow:hidden;border:1px solid ",_/* .colorTokens.stroke.border */.I6.stroke.border,";"),previewImage:/*#__PURE__*/(0,h/* .css */.AH)("width:100%;height:100%;object-fit:cover;cursor:pointer;"),placeholder:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.caption */.I.caption(),";color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";"),dropdownText:/*#__PURE__*/(0,h/* .css */.AH)("color:",_/* .colorTokens.text.subdued */.I6.text.subdued," !important;"),dropdownOptionText:/*#__PURE__*/(0,h/* .css */.AH)("button,button:hover,button:focus,button:active{color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";}")};// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/curriculum/question-types/Puzzle.tsx
var hC=()=>{var e;var t=(0,S/* .useFormContext */.xW)();var{activeQuestionId:n,activeQuestionIndex:o,validationError:s,setValidationError:l}=cv();var u="questions.".concat(o,".question_answers");var{fields:d}=(0,S/* .useFieldArray */.jz)({control:t.control,name:u});if(d.length===0){return null}return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:hE.optionWrapper,children:/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:t.control,name:"questions.".concat(o,".question_answers.0"),render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(hI,(0,i._)((0,r._)({},e),{questionId:n,activeQuestionIndex:o,validationError:s,setValidationError:l}))},(e=d[0])===null||e===void 0?void 0:e.id)})};/* export default */const hD=hC;var hE={optionWrapper:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["16"] */.YK["16"],";padding-left:",_/* .spacing["40"] */.YK["40"],";")};// CONCATENATED MODULE: ./assets/src/js/v3/shared/components/fields/quiz/questions/FormScale.tsx
/**
 * Form field for Scale quiz question type (instructor sets target value on scale).
 *
 * @package Tutor
 * @since 4.0.0
 */function hS(e){return(0,i._)((0,r._)({},e),{step:1})}function hz(e){if(!e||typeof e!=="string")return null;try{var t=JSON.parse(e);if(typeof t.value==="number"&&t.config){var n,r,i,a,o,s,l;return{value:t.value,config:hS({min:(n=t.config.min)!==null&&n!==void 0?n:0,max:(r=t.config.max)!==null&&r!==void 0?r:100,step:1,defaultValue:(i=t.config.defaultValue)!==null&&i!==void 0?i:50,pxPerUnit:(a=t.config.pxPerUnit)!==null&&a!==void 0?a:10,labelEvery:(o=t.config.labelEvery)!==null&&o!==void 0?o:10,minorTickEvery:(s=t.config.minorTickEvery)!==null&&s!==void 0?s:5,precision:(l=t.config.precision)!==null&&l!==void 0?l:0})}}}catch(e){// ignore
}return null}var hT=(0,v.__)("The maximum value must be greater than the minimum value.","tutor");var hM=(0,v.__)("The correct value must be between the minimum and maximum values.","tutor");var hH=e=>{e===null||e===void 0?void 0:e(e=>{var t=(e===null||e===void 0?void 0:e.type)==="question"&&[hT,hM].includes(e===null||e===void 0?void 0:e.message);return t?null:e})};var hP=(e,t)=>{if(e.max<=e.min){return hT}if(t<e.min||t>e.max){return hM}return null};var hO=e=>{var{field:t,setValidationError:n}=e;var s=t.value;var[l,u]=(0,o.useState)(()=>{var e;var t=hz((e=s===null||s===void 0?void 0:s.answer_two_gap_match)!==null&&e!==void 0?e:"");return t||{value:50,config:hS({min:0,max:100,step:1,defaultValue:50,pxPerUnit:10,labelEvery:10,minorTickEvery:5,precision:0})}});var[d,c]=(0,o.useState)(hS(l.config));(0,o.useEffect)(()=>{var e;var t=hz((e=s===null||s===void 0?void 0:s.answer_two_gap_match)!==null&&e!==void 0?e:"");if(t){u(t);c(hS(t.config))}},[s===null||s===void 0?void 0:s.answer_two_gap_match]);var p=(0,o.useCallback)(e=>{t.onChange(e)},[t]);var h=(0,o.useCallback)(e=>{if(!s)return;var t=JSON.stringify(e);p((0,i._)((0,r._)({},s,tt(s._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(s._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{answer_two_gap_match:t,is_saved:true}))},[s,p]);var f=(0,o.useCallback)((e,t)=>{var a=hS((0,i._)((0,r._)({},d),{[e]:t}));var o=hP(a,l.value);if(o){n===null||n===void 0?void 0:n({message:o,type:"question"})}else{hH(n)}c(a);var s=(0,i._)((0,r._)({},l),{config:a,value:l.value});u(s);h(s)},[d,l,h,n]);var g=(e,t)=>{var n=parseFloat(String(e));return Number.isFinite(n)?n:t};var m=(0,o.useCallback)(e=>{var t=hP(d,e);if(t){n===null||n===void 0?void 0:n({message:t,type:"question"})}else{hH(n)}var a=(0,i._)((0,r._)({},l),{value:e});u(a);h(a)},[d,l,h,n]);if(!s){return null}var _=d.max<=d.min;return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:hN.wrapper,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:hN.card,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:hN.answerHeader,children:/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:hN.answerHeaderTitle,children:(0,v.__)("Scale range","tutor")})}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:hN.configSection,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:hN.configGrid,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:hN.configField,children:/*#__PURE__*/(0,a/* .jsx */.Y)(cB,{label:(0,v.__)("Min value","tutor"),type:"number",size:"small",value:String(d.min),onChange:e=>f("min",g(e,0))})}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:hN.configField,children:/*#__PURE__*/(0,a/* .jsx */.Y)(cB,{label:(0,v.__)("Max value","tutor"),type:"number",size:"small",value:String(d.max),onChange:e=>f("max",g(e,100))})}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:hN.configField,children:/*#__PURE__*/(0,a/* .jsx */.Y)(cB,{label:(0,v.__)("Label entry","tutor"),type:"number",size:"small",value:String(d.labelEvery),onChange:e=>f("labelEvery",g(e,10))})})]})})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:hN.card,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:hN.answerSection,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:hN.configField,children:/*#__PURE__*/(0,a/* .jsx */.Y)(cB,{label:(0,v.__)("Correct Value","tutor"),type:"number",size:"small",value:String(l.value),onChange:e=>m(g(e,d.min)),placeholder:_?undefined:(0,v.sprintf)((0,v.__)("Between %1$s and %2$s","tutor"),String(d.min),String(d.max))})})})})]})};/* export default */const hF=hO;var hN={wrapper:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["24"] */.YK["24"],";",_/* .Breakpoint.smallMobile */.EA.smallMobile,"{padding-left:",_/* .spacing["8"] */.YK["8"],";}"),card:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["8"] */.YK["8"],";padding:",_/* .spacing["16"] */.YK["16"],";background:",_/* .colorTokens.surface.tutor */.I6.surface.tutor,";border-radius:",_/* .borderRadius.input */.Vq.input,";"),answerHeader:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("row"),";align-items:center;justify-content:space-between;gap:",_/* .spacing["12"] */.YK["12"],";"),answerHeaderTitle:/*#__PURE__*/(0,h/* .css */.AH)("font-family:",_/* .fontFamily.sfProDisplay */.mw.sfProDisplay,";font-weight:",_/* .fontWeight.medium */.Wy.medium,";font-size:",_/* .fontSize["15"] */.J["15"],";line-height:",_/* .lineHeight["24"] */.K_["24"],";letter-spacing:",_/* .letterSpacing.normal */.oU.normal,";color:",_/* .colorTokens.text.title */.I6.text.title,";"),configSection:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["12"] */.YK["12"],";"),answerSection:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";"),configGrid:/*#__PURE__*/(0,h/* .css */.AH)("display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:",_/* .spacing["8"] */.YK["8"],";",_/* .Breakpoint.smallTablet */.EA.smallTablet,"{grid-template-columns:1fr;}"),configField:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["4"] */.YK["4"],";")};// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/curriculum/question-types/Scale.tsx
var hK=()=>{var e=(0,S/* .useFormContext */.xW)();var{activeQuestionId:t,activeQuestionIndex:n,validationError:o,setValidationError:s}=cv();var l="questions.".concat(n,".question_answers");var{fields:u}=(0,S/* .useFieldArray */.jz)({control:e.control,name:l});if(u.length===0){return null}return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:hR.optionWrapper,children:/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:e.control,name:"questions.".concat(n,".question_answers.0"),render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(hF,(0,i._)((0,r._)({},e),{questionId:t,validationError:o,setValidationError:s}))},JSON.stringify(u[0]))})};/* export default */const hW=hK;var hR={optionWrapper:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";padding-left:",_/* .spacing["40"] */.YK["40"],";")};// CONCATENATED MODULE: ./assets/src/js/v3/shared/components/fields/quiz/questions/FormTrueFalse.tsx
function hL(){var e=(0,I._)(["\n      [data-check-button] {\n        opacity: 1;\n        color: ",";\n      }\n    "]);hL=function t(){return e};return e}function hU(){var e=(0,I._)(["\n      background-color: ",";\n      color: ",";\n\n      &:hover {\n        outline: 1px solid ",";\n      }\n    "]);hU=function t(){return e};return e}function hB(){var e=(0,I._)(["\n      background-color: ",";\n    "]);hB=function t(){return e};return e}function hj(){var e=(0,I._)(["\n      box-shadow: ",";\n    "]);hj=function t(){return e};return e}var hV=e=>{var{field:t,onCheckCorrectAnswer:n,isOverlay:o=false,questionId:s}=e;var l;var u=(l=t.value)!==null&&l!==void 0?l:{answer_id:(0,k/* .nanoid */.Ak)(),answer_title:"",is_correct:"0",belongs_question_id:s,belongs_question_type:"true_false"};var{attributes:d,listeners:c,setNodeRef:h,transform:v,transition:f,isDragging:g}=(0,p/* .useSortable */.gl)({id:u.answer_id||0,animateLayoutChanges:A/* .animateLayoutChanges */.J});var _={transform:q/* .CSS.Transform.toString */.Ks.Transform.toString(v),transition:f,opacity:g?.3:undefined};return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",(0,i._)((0,r._)({},d),{css:hG.option({isSelected:!!Number(u.is_correct),isOverlay:o}),tabIndex:-1,ref:h,style:_,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("button",{"data-check-button":true,type:"button",css:Y/* .styleUtils.optionCheckButton */.x.optionCheckButton,onClick:n,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:Number(u.is_correct)?"checkFilled":"check",height:32,width:32})}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:hG.optionLabel({isSelected:!!Number(u.is_correct),isDragging:g,isOverlay:o}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:u.answer_title}),/*#__PURE__*/(0,a/* .jsx */.Y)("button",(0,i._)((0,r._)({},c),{type:"button",css:Y/* .styleUtils.optionDragButton */.x.optionDragButton({isOverlay:o}),"data-visually-hidden":true,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"dragVertical",height:24,width:24})}))]})]}))};/* export default */const hQ=hV;var hG={option:e=>{var{isSelected:t,isOverlay:n}=e;return/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex(),";",F/* .typography.caption */.I.caption("medium"),";align-items:center;color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";gap:",_/* .spacing["10"] */.YK["10"],";height:48px;align-items:center;[data-check-button]{color:",_/* .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:",n?0:1,";}}",t&&(0,h/* .css */.AH)(hL(),_/* .colorTokens.bg.success */.I6.bg.success))},optionLabel:e=>{var{isSelected:t,isDragging:n,isOverlay:r}=e;return/*#__PURE__*/(0,h/* .css */.AH)("display:grid;grid-template-columns:1fr auto 1fr;align-items:center;width:100%;border-radius:",_/* .borderRadius.card */.Vq.card,";padding:",_/* .spacing["12"] */.YK["12"]," ",_/* .spacing["16"] */.YK["16"],";background-color:",_/* .colorTokens.background.white */.I6.background.white,";text-transform:capitalize;[data-visually-hidden]{opacity:0;}&:hover{outline:1px solid ",_/* .colorTokens.stroke.hover */.I6.stroke.hover,";[data-visually-hidden]{opacity:1;}}&:focus-within{[data-visually-hidden]{opacity:1;}}",t&&(0,h/* .css */.AH)(hU(),_/* .colorTokens.background.success.fill40 */.I6.background.success.fill40,_/* .colorTokens.text.primary */.I6.text.primary,_/* .colorTokens.stroke.success.fill70 */.I6.stroke.success.fill70)," ",n&&(0,h/* .css */.AH)(hB(),_/* .colorTokens.stroke.hover */.I6.stroke.hover)," ",r&&(0,h/* .css */.AH)(hj(),_/* .shadow.drag */.r7.drag)," ",_/* .Breakpoint.smallTablet */.EA.smallTablet,"{[data-visually-hidden]{opacity:1;}}")}};// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/curriculum/question-types/TrueFalse.tsx
function h$(){var e=(0,I._)(["\n      [data-check-icon] {\n        opacity: 1;\n        color: ",";\n      }\n    "]);h$=function t(){return e};return e}function hX(){var e=(0,I._)(["\n      background-color: ",";\n      color: ",";\n\n      &:hover {\n        box-shadow: 0 0 0 1px ",";\n      }\n    "]);hX=function t(){return e};return e}var hZ=()=>{var[e,t]=(0,o.useState)(null);var n=(0,S/* .useFormContext */.xW)();var{activeQuestionId:s,activeQuestionIndex:u}=cv();var{fields:h,move:v,replace:f}=(0,S/* .useFieldArray */.jz)({control:n.control,name:"questions.".concat(u,".question_answers")});var g=(0,d/* .useSensors */.FR)((0,d/* .useSensor */.MS)(d/* .PointerSensor */.AN,{activationConstraint:{distance:10}}),(0,d/* .useSensor */.MS)(d/* .KeyboardSensor */.uN,{coordinateGetter:p/* .sortableKeyboardCoordinates */.JR}));var m=(0,S/* .useWatch */.FH)({control:n.control,name:"questions.".concat(u,".question_answers"),defaultValue:[]});var _=(0,o.useMemo)(()=>{if(!e){return null}return h.find(t=>t.answer_id===e)},[e,h]);var w=e=>{var t=h[e];var n=m.map(e=>(0,i._)((0,r._)({},e,tt(e._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(e._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{is_correct:e.answer_id===t.answer_id?"1":"0"}));f(n)};(0,o.useEffect)(()=>{var e=m.filter(e=>{var t=h.findIndex(t=>t.answer_id===e.answer_id);var n=h[t]||{};return e.is_correct!==n.is_correct});if(e.length===0){return}var t=h.findIndex(t=>t.answer_id===e[0].answer_id);var a=[...m];a[t]=Object.assign({},a[t],{is_correct:"1"});for(var[o,s]of a.entries()){if(o!==t){a[o]=(0,i._)((0,r._)({},s,tt(s._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)&&{_data_status:tt(s._data_status,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)}),{is_correct:"0"})}}n.setValue("questions.".concat(u,".question_answers"),a);// eslint-disable-next-line react-hooks/exhaustive-deps
},[m]);return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:h0.optionWrapper,children:/*#__PURE__*/(0,a/* .jsxs */.FD)(d/* .DndContext */.Mp,{sensors:g,collisionDetection:d/* .closestCenter */.fp,modifiers:[c/* .restrictToWindowEdges */.Q_],onDragStart:e=>{t(e.active.id)},onDragEnd:e=>{var{active:n,over:r}=e;if(!r){return}if(n.id!==r.id){var i=h.findIndex(e=>e.answer_id===n.id);var a=h.findIndex(e=>e.answer_id===r.id);v(i,a)}t(null)},children:[/*#__PURE__*/(0,a/* .jsx */.Y)(p/* .SortableContext */.gB,{items:h.map(e=>(0,i._)((0,r._)({},e),{id:e.answer_id})),strategy:p/* .verticalListSortingStrategy */._G,children:/*#__PURE__*/(0,a/* .jsx */.Y)(b/* ["default"] */.A,{each:h,children:(e,t)=>/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:n.control,name:"questions.".concat(u,".question_answers.").concat(t),render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(hQ,(0,i._)((0,r._)({},e),{index:t,onCheckCorrectAnswer:()=>w(t),questionId:s}))},"".concat(e.answer_id,"-").concat(e.is_correct))})}),/*#__PURE__*/(0,l.createPortal)(/*#__PURE__*/(0,a/* .jsx */.Y)(d/* .DragOverlay */.Hd,{children:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:_,children:t=>{var o=h.findIndex(e=>e.answer_id===t.answer_id);return/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:n.control,name:"questions.".concat(u,".question_answers.").concat(o),render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(hQ,(0,i._)((0,r._)({},e),{index:o,onCheckCorrectAnswer:k/* .noop */.lQ,isOverlay:true,questionId:s}))},e)}})}),document.body)]})})};/* export default */const hJ=hZ;var h0={optionWrapper:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["12"] */.YK["12"],";"),option:e=>{var{isSelected:t}=e;return/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex(),";",F/* .typography.caption */.I.caption("medium"),";align-items:center;color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";gap:",_/* .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,h/* .css */.AH)(h$(),_/* .colorTokens.bg.success */.I6.bg.success))},optionLabel:e=>{var{isSelected:t}=e;return/*#__PURE__*/(0,h/* .css */.AH)("display:grid;grid-template-columns:1fr auto 1fr;align-items:center;width:100%;border-radius:",_/* .borderRadius.card */.Vq.card,";padding:",_/* .spacing["12"] */.YK["12"]," ",_/* .spacing["16"] */.YK["16"],";background-color:",_/* .colorTokens.background.white */.I6.background.white,";cursor:pointer;[data-visually-hidden]{opacity:0;}&:hover{box-shadow:0 0 0 1px ",_/* .colorTokens.stroke.hover */.I6.stroke.hover,";[data-visually-hidden]{opacity:1;}}",t&&(0,h/* .css */.AH)(hX(),_/* .colorTokens.background.success.fill40 */.I6.background.success.fill40,_/* .colorTokens.text.primary */.I6.text.primary,_/* .colorTokens.stroke.success.fill70 */.I6.stroke.success.fill70))},optionDragButton:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.resetButton */.x.resetButton," ",Y/* .styleUtils.flexCenter */.x.flexCenter(),"    transform:rotate(90deg);color:",_/* .colorTokens.icon["default"] */.I6.icon["default"],";cursor:grab;place-self:center center;&:focus,&:active,&:hover{background:none;color:",_/* .colorTokens.icon["default"] */.I6.icon["default"],";}")};// CONCATENATED MODULE: ./assets/src/js/v3/public/images/quiz-empty-state.webp
const h1=n.p+"js/images/quiz-empty-state-c7e2a8d9.webp";// CONCATENATED MODULE: ./assets/src/js/v3/public/images/quiz-empty-state-2x.webp
const h2=n.p+"js/images/quiz-empty-state-2x-0a35e435.webp";// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/curriculum/QuestionForm.tsx
var h4=!!P/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var h6=()=>{var{activeQuestionIndex:e,activeQuestionId:t,validationError:n,contentType:s}=cv();var l=cN(t);var u=(0,S/* .useFormContext */.xW)();var d=(0,o.useRef)(null);var c=u.watch("questions.".concat(e,".question_type"));var p=u.watch("questions")||[];var h=u.watch("questions.".concat(e,"._data_status"));var f={true_false:/*#__PURE__*/(0,a/* .jsx */.Y)(hJ,{},t),multiple_choice:/*#__PURE__*/(0,a/* .jsx */.Y)(hh,{},t),open_ended:/*#__PURE__*/(0,a/* .jsx */.Y)(hg,{},t),fill_in_the_blank:/*#__PURE__*/(0,a/* .jsx */.Y)(pK,{},t),short_answer:/*#__PURE__*/(0,a/* .jsx */.Y)(hg,{},t),matching:/*#__PURE__*/(0,a/* .jsx */.Y)(p8,{},t),image_answering:/*#__PURE__*/(0,a/* .jsx */.Y)(p$,{},t),ordering:/*#__PURE__*/(0,a/* .jsx */.Y)(hh,{},t),draw_image:/*#__PURE__*/(0,a/* .jsx */.Y)(pS,{},t),scale:/*#__PURE__*/(0,a/* .jsx */.Y)(hW,{},t),pin_image:/*#__PURE__*/(0,a/* .jsx */.Y)(hA,{},t),coordinates:/*#__PURE__*/(0,a/* .jsx */.Y)(pg,{},t),puzzle:/*#__PURE__*/(0,a/* .jsx */.Y)(hD,{},t)};(0,o.useEffect)(()=>{if(n&&d.current){d.current.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})}},[n]);if(!t&&!u.formState.isLoading&&p.length===0){return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:h3.emptyState,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("img",{css:h3.emptyStateImage,src:h1,srcSet:"".concat(h1," 1x, ").concat(h2," 2x"),alt:""}),/*#__PURE__*/(0,a/* .jsx */.Y)("p",{css:h3.emptyStateText,children:(0,v.__)("Enter a quiz title to begin. Choose from a variety of question types to keep things interesting!","tutor")})]})}return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:h3.questionForm(t===l),children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:h3.questionWithIndex,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:h3.questionIndex,children:[e+1,"."]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:h3.questionTitleAndDesc,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:u.control,rules:{required:(0,v.__)("Question title is required","tutor")},name:"questions.".concat(e,".question_title"),render:t=>{var n;return/*#__PURE__*/(0,a/* .jsx */.Y)(e9,(0,i._)((0,r._)({},t),{placeholder:(0,v.__)("Write your question here..","tutor"),disabled:s==="tutor_h5p_quiz",onChange:()=>{if(tt(h,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)){u.setValue("questions.".concat(e,"._data_status"),tt(h,D/* .QuizDataStatus.UPDATE */.cW.UPDATE))}},selectOnFocus:((n=p[e])===null||n===void 0?void 0:n._data_status)===D/* .QuizDataStatus.NEW */.cW.NEW}))}}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:s!=="tutor_h5p_quiz",fallback:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:h3.h5pShortCode,children:'[h5p id: "'.concat(u.watch("questions.".concat(e,".question_description")),'"]')})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:u.control,name:"questions.".concat(e,".question_description"),render:t=>/*#__PURE__*/(0,a/* .jsx */.Y)(cO,(0,i._)((0,r._)({},t),{placeholder:(0,v.__)("Description (optional)","tutor"),disabled:s==="tutor_h5p_quiz",onChange:()=>{if(tt(h,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)){u.setValue("questions.".concat(e,"._data_status"),tt(h,D/* .QuizDataStatus.UPDATE */.cW.UPDATE))}}}))})}),/*#__PURE__*/(0,a/* .jsx */.Y)(eh/* ["default"] */.A,{section:"Curriculum.Quiz.after_question_description",namePrefix:"questions.".concat(e,"."),form:u})]})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:n,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{ref:d,css:h3.alertWrapper,children:/*#__PURE__*/(0,a/* .jsx */.Y)(cw/* ["default"] */.A,{type:"danger",icon:"warning",children:n===null||n===void 0?void 0:n.message})},Math.random())}),f[c],/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:h4&&c!=="h5p",children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:h3.questionAnswer,children:/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:u.control,name:"questions.".concat(e,".answer_explanation"),render:t=>/*#__PURE__*/(0,a/* .jsx */.Y)(cD,(0,i._)((0,r._)({},t),{label:(0,v.__)("Answer Explanation","tutor"),placeholder:(0,v.__)("Write answer explanation...","tutor"),onChange:()=>{if(tt(h,D/* .QuizDataStatus.UPDATE */.cW.UPDATE)){u.setValue("questions.".concat(e,"._data_status"),tt(h,D/* .QuizDataStatus.UPDATE */.cW.UPDATE))}}}))})})})]},e)};/* export default */const h5=h6;var h3={questionForm:e=>/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";padding-right:",_/* .spacing["48"] */.YK["48"],";gap:",_/* .spacing["16"] */.YK["16"],";animation:",e?undefined:"fadeIn 0.25s ease-in-out",";@keyframes fadeIn{from{opacity:0;}to{opacity:1;}}",_/* .Breakpoint.smallMobile */.EA.smallMobile,"{padding-right:",_/* .spacing["8"] */.YK["8"],";}"),questionWithIndex:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("row"),";align-items:flex-start;padding-left:",_/* .spacing["40"] */.YK["40"],";gap:",_/* .spacing["4"] */.YK["4"],";",_/* .Breakpoint.smallMobile */.EA.smallMobile,"{padding-left:",_/* .spacing["8"] */.YK["8"],";}"),questionIndex:/*#__PURE__*/(0,h/* .css */.AH)("margin-top:",_/* .spacing["10"] */.YK["10"],";",F/* .typography.heading6 */.I.heading6(),";color:",_/* .colorTokens.text.hints */.I6.text.hints,";"),questionTitleAndDesc:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["8"] */.YK["8"],";width:100%;"),h5pShortCode:/*#__PURE__*/(0,h/* .css */.AH)("margin-left:",_/* .spacing["8"] */.YK["8"],";padding:",_/* .spacing["4"] */.YK["4"]," ",_/* .spacing["8"] */.YK["8"],";",F/* .typography.caption */.I.caption(),";color:",_/* .colorTokens.text.white */.I6.text.white,";background-color:#2575be;border-radius:",_/* .borderRadius.card */.Vq.card,";width:fit-content;font-family:'Fire Code',monospace;"),questionAnswer:/*#__PURE__*/(0,h/* .css */.AH)("padding-left:",_/* .spacing["40"] */.YK["40"],";",_/* .Breakpoint.smallMobile */.EA.smallMobile,"{padding-left:",_/* .spacing["8"] */.YK["8"],";}"),emptyState:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.flexCenter */.x.flexCenter("column"),";padding-left:",_/* .spacing["40"] */.YK["40"],";padding-right:",_/* .spacing["48"] */.YK["48"],";gap:",_/* .spacing["16"] */.YK["16"],";"),emptyStateImage:/*#__PURE__*/(0,h/* .css */.AH)("width:220px;height:auto;"),emptyStateText:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.small */.I.small(),";color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";text-align:center;max-width:330px;"),alertWrapper:/*#__PURE__*/(0,h/* .css */.AH)("padding-left:",_/* .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);}}")};// EXTERNAL MODULE: ./assets/src/js/v3/shared/atoms/MagicButton.tsx
var h8=n(78353);// EXTERNAL MODULE: ./assets/src/js/v3/shared/components/fields/FormCheckbox.tsx
var h9=n(95377);// EXTERNAL MODULE: ./assets/src/js/v3/shared/components/modals/ProIdentifierModal.tsx
var h7=n(19448);// EXTERNAL MODULE: ./assets/src/js/v3/shared/components/modals/SetupOpenAiModal.tsx
var ve=n(3311);// EXTERNAL MODULE: ./assets/src/js/v3/shared/services/magic-ai.ts
var vt=n(97200);// EXTERNAL MODULE: ./assets/src/js/v3/public/images/pro-placeholders/generate-course.webp
var vn=n(51693);// EXTERNAL MODULE: ./assets/src/js/v3/public/images/pro-placeholders/generate-course-2x.webp
var vr=n(79138);// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/curriculum/GenerateQuizWithAi.tsx
var vi=(0,eg/* .getCourseId */.p)();var va=[];var vo=[{label:(0,v.__)("True/False","tutor"),value:"true_false",icon:"quizTrueFalse"},{label:(0,v.__)("Multiple Choice","tutor"),value:"multiple_choice",icon:"quizMultiChoice"},{label:(0,v.__)("Short Answer","tutor"),value:"short_answer",icon:"quizShortAnswer"},{label:(0,v.__)("Open Ended/Essay","tutor"),value:"open_ended",icon:"quizEssay"}];var vs=[{label:(0,v.__)("Easy","tutor"),value:"easy",icon:"difficultyEasy"},{label:(0,v.__)("Medium","tutor"),value:"medium",icon:"difficultyNormal"},{label:(0,v.__)("Hard","tutor"),value:"hard",icon:"difficultyHard"}];var vl=()=>{var e;var t=(0,z/* .useQueryClient */.jE)();var{topicId:n}=cv();var{showModal:s}=(0,H/* .useModal */.h)();var{showToast:l}=(0,eJ/* .useToast */.d)();var[u,d]=(0,o.useState)(false);var c=(0,o.useRef)(null);var p=!!P/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var h=(e=P/* .tutorConfig.settings */.P.settings)===null||e===void 0?void 0:e.chatgpt_key_exist;var g=(0,S/* .useFormContext */.xW)();var{append:_}=(0,S/* .useFieldArray */.jz)({control:g.control,name:"questions"});var b=(0,vt/* .useGenerateAiQuizQuestionsMutation */.gA)();var w=(0,ec/* .useFormWithGlobalError */.p)({defaultValues:{topic_ids:[String(n)],question_types:{true_false:true,multiple_choice:true,short_answer:true,open_ended:true},difficulty_level:"medium",question_count:10}});var A=(0,ec/* .useFormWithGlobalError */.p)({defaultValues:{selected_topic_id:null}});var I=t.getQueryData(["Topic",vi]);var q=(0,o.useMemo)(()=>{var e=I===null||I===void 0?void 0:I.find(e=>String(e.id)===String(n));return(I===null||I===void 0?void 0:I.length)?I:[{id:n,title:(e===null||e===void 0?void 0:e.title)||(0,v.__)("Current Topic","tutor"),summary:"",contents:[]}]},[n,I]);var C;var T=(C=w.watch("topic_ids"))!==null&&C!==void 0?C:va;var M=w.watch("question_types");var O=Number(w.watch("question_count"));var F=w.watch("difficulty_level");var W=vo.filter(e=>M===null||M===void 0?void 0:M[e.value]).map(e=>e.value);var L=(0,o.useMemo)(()=>{return q.filter(e=>!T.includes(String(e.id))).map(e=>({label:e.title,value:String(e.id)}))},[T,q]);var U=q.filter(e=>T.includes(String(e.id)));var B=e=>{var t=Array.from(new Set([...w.getValues("topic_ids"),String(e.value)]));w.setValue("topic_ids",t,{shouldDirty:true});A.setValue("selected_topic_id",null)};var j=e=>{w.setValue("topic_ids",w.getValues("topic_ids").filter(t=>t!==e),{shouldDirty:true})};var Q=e=>(0,E._)(function*(){try{var t;var n={topic_ids:e.topic_ids.join(","),question_types:vo.filter(t=>e.question_types[t.value]).map(e=>e.value).join(","),difficulty_level:e.difficulty_level,number_of_questions:Number(e.question_count)};var r=yield b.mutateAsync(n);var i=Array.isArray(r.data)?r.data:[];var a;var o=(a=(t=g.getValues("questions"))===null||t===void 0?void 0:t.length)!==null&&a!==void 0?a:0;i.forEach((e,t)=>{var n=(0,k/* .nanoid */.Ak)();var r,i;var a={_data_status:D/* .QuizDataStatus.NEW */.cW.NEW,question_id:n,question_title:e.title,question_description:(r=e.description)!==null&&r!==void 0?r:"",question_type:e.type,question_mark:1,answer_explanation:"",question_order:o+t,question_settings:{question_type:e.type,answer_required:false,randomize_question:false,question_mark:1,show_question_mark:true,has_multiple_correct_answer:false,is_image_matching:false},question_answers:((i=e.options)!==null&&i!==void 0?i:[]).map((t,r)=>({_data_status:D/* .QuizDataStatus.NEW */.cW.NEW,is_saved:true,answer_id:(0,k/* .nanoid */.Ak)(),belongs_question_id:n,belongs_question_type:e.type,answer_title:t.name,is_correct:t.is_correct?"1":"0",answer_order:r,answer_two_gap_match:"",answer_view_format:"text"}))};_(a)});l({type:"success",message:(0,v.__)("Questions generated successfully","tutor")});d(false)}catch(e){// eslint-disable-next-line no-console
    console.error(e)}})();var $=()=>{if(!p){s({component:h7/* ["default"] */.A,props:{image:vn,image2x:vr}})}else if(!h){s({component:ve/* ["default"] */.A,props:{image:vn,image2x:vr}})}else{d(true)}};(0,o.useEffect)(()=>{w.setValue("topic_ids",[String(n)]);// eslint-disable-next-line react-hooks/exhaustive-deps
},[n]);return/*#__PURE__*/(0,a/* .jsxs */.FD)(a/* .Fragment */.FK,{children:[/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{isIconOnly:true,variant:"text",size:"small",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"magicAiColorize",width:24,height:24}),"data-generate-quiz-button":true,ref:c,type:"button","aria-label":(0,v.__)("Generate quiz using AI","tutor"),onClick:$}),/*#__PURE__*/(0,a/* .jsx */.Y)(R/* ["default"] */.A,{gap:4,maxWidth:"705px",placement:K/* .POPOVER_PLACEMENTS.BOTTOM */.zA.BOTTOM,triggerRef:c,isOpen:u,closePopover:()=>d(false),animationType:N/* .AnimationType.slideUp */.J6.slideUp,border:true,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("form",{onSubmit:w.handleSubmit(Q),children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:vd.generateQuizHeader,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:vd.generateQuizTitleWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"magicAiColorize",width:24,height:24}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:vd.generateQuizTitle,children:(0,v.__)("Generate Quiz Component","tutor")})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{type:"button",variant:"text",size:"small",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"cross",width:24,height:24}),isIconOnly:true,"aria-label":(0,v.__)("Close Popover","tutor"),onClick:()=>d(false)})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:vd.generateQuizBody,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:vd.generateQuizFieldGroup,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:A.control,name:"selected_topic_id",render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(G/* ["default"] */.A,(0,i._)((0,r._)({},e),{isSearchable:true,label:(0,v.__)("Select Topics","tutor"),options:L,placeholder:(0,v.__)("Search topics...","tutor"),onChange:B,leftIcon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"search",width:20,height:20}),hideCaret:true,wrapperCss:vd.selectInputStyle,disabled:L.length===0}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:U.length>0,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:vd.selectedTopicList,children:U.map(e=>/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:vd.selectedTopic,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("span",{title:e.title,children:e.title}),/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:vd.removeTopicButton,onClick:()=>j(String(e.id)),children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"cross2",width:12,height:12})})]},String(e.id)))})})]})}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:vd.generateQuizBodyRight,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:[vd.generateQuizFieldGroup,vd.generateQuizFieldGroupTypes],children:[/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:vd.generateQuizLabel,children:(0,v.__)("Question Types","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:vd.generateQuizCheckboxList,children:vo.map(e=>/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:w.control,name:"question_types.".concat(e.value),render:t=>/*#__PURE__*/(0,a/* .jsx */.Y)(h9/* ["default"] */.A,(0,i._)((0,r._)({},t),{label:/*#__PURE__*/(0,a/* .jsxs */.FD)("span",{css:vd.generateQuizQuestionTypeLabelText,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:e.icon,width:24,height:24}),e.label]}),labelCss:vd.generateQuizQuestionTypeLabel}))},e.value))})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:Y/* .styleUtils.fieldGroups */.x.fieldGroups(6),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:w.control,name:"difficulty_level",render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(G/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,v.__)("Difficulty Level","tutor"),iconSize:20,options:vs,wrapperCss:vd.selectInputStyle,placeholder:(0,v.__)("Select difficulty level","tutor")}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:w.control,name:"question_count",rules:{min:{value:1,message:(0,v.__)("Number of questions must be greater than 0","tutor")}},render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(V/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"number",label:(0,v.__)("Number of Questions","tutor"),placeholder:(0,v.__)("Number of questions","tutor")}))})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:vd.generateQuizButtonWrapper,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)(h8/* ["default"] */.A,{type:"submit",size:"default",roundedFull:false,disabled:b.isPending||!T.length||!W.length||O<1||Number.isNaN(O)||!F,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"magicAi",width:24,height:24}),b.isPending?(0,v.__)("Generating...","tutor"):(0,v.__)("Generate Now","tutor")]}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:vd.generateQuizButtonHelperText,children:(0,v.__)("AI will generate questions based on your selected topics and types.","tutor")})]})]})]})]})})]})};/* export default */const vu=vl;var vd={generateQuizHeader:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;align-items:center;justify-content:space-between;gap:",_/* .spacing["8"] */.YK["8"],";padding:",_/* .spacing["12"] */.YK["12"]," ",_/* .spacing["16"] */.YK["16"],";border-bottom:1px solid ",_/* .colorTokens.stroke.divider */.I6.stroke.divider,";"),generateQuizTitleWrapper:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;align-items:center;gap:",_/* .spacing["8"] */.YK["8"],";"),generateQuizTitle:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.body */.I.body("medium"),";"),generateQuizBody:/*#__PURE__*/(0,h/* .css */.AH)("display:grid;grid-template-columns:1fr 360px;gap:",_/* .spacing["32"] */.YK["32"],";padding:",_/* .spacing["16"] */.YK["16"]," ",_/* .spacing["20"] */.YK["20"],";",_/* .Breakpoint.mobile */.EA.mobile,"{grid-template-columns:1fr;max-height:calc(100vh - 62px);overflow:auto;}"),selectInputStyle:/*#__PURE__*/(0,h/* .css */.AH)("padding-left:",_/* .spacing["32"] */.YK["32"],"!important;"),generateQuizBodyRight:/*#__PURE__*/(0,h/* .css */.AH)("position:relative;&::before{content:'';position:absolute;top:0;left:-",_/* .spacing["16"] */.YK["16"],";width:1px;height:100%;background-color:",_/* .colorTokens.stroke.divider */.I6.stroke.divider,";",_/* .Breakpoint.mobile */.EA.mobile,"{display:none;}}"),generateQuizFieldGroup:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;flex-direction:column;gap:",_/* .spacing["8"] */.YK["8"],";"),generateQuizFieldGroupTypes:/*#__PURE__*/(0,h/* .css */.AH)("margin-bottom:",_/* .spacing["40"] */.YK["40"],";"),generateQuizLabel:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.caption */.I.caption("medium"),";color:",_/* .colorTokens.text.title */.I6.text.title,";"),generateQuizCheckboxList:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;flex-direction:column;gap:",_/* .spacing["10"] */.YK["10"],";"),generateQuizQuestionTypeLabelText:/*#__PURE__*/(0,h/* .css */.AH)("display:inline-flex;align-items:center;gap:",_/* .spacing["8"] */.YK["8"],";min-width:0;svg{flex:0 0 auto;}"),generateQuizQuestionTypeLabel:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;align-items:center;"),selectedTopicList:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;flex-direction:column;gap:",_/* .spacing["4"] */.YK["4"],";max-height:340px;overflow-y:auto;"),selectedTopic:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;align-items:center;justify-content:space-between;gap:",_/* .spacing["8"] */.YK["8"],";min-height:28px;border-radius:",_/* .borderRadius["4"] */.Vq["4"],";padding:",_/* .spacing["4"] */.YK["4"]," ",_/* .spacing["8"] */.YK["8"],";color:",_/* .colorTokens.text.title */.I6.text.title,";background-color:",_/* .colorTokens.action.secondary.gray */.I6.action.secondary.gray,";span{",F/* .typography.small */.I.small("medium"),";font-size:",_/* .fontSize["12"] */.J["12"],";",Y/* .styleUtils.text.ellipsis */.x.text.ellipsis(1),";}"),removeTopicButton:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.crossButton */.x.crossButton,";background-color:transparent;width:12px;height:12px;flex:0 0 auto;svg{color:",_/* .colorTokens.text.primary */.I6.text.primary,";}"),generateQuizButtonWrapper:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;flex-direction:column;justify-content:center;align-items:center;gap:",_/* .spacing["6"] */.YK["6"],";margin-top:",_/* .spacing["20"] */.YK["20"],";button{height:40px;span{gap:",_/* .spacing["4"] */.YK["4"],";}}"),generateQuizButtonHelperText:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.tiny */.I.tiny("regular"),";color:",_/* .colorTokens.text.hints */.I6.text.hints,";")};// EXTERNAL MODULE: ./assets/src/js/v3/shared/molecules/ThreeDots.tsx
var vc=n(98005);// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/curriculum/Question.tsx
function vp(){var e=(0,I._)(["\n      color: ",";\n      background-color: ",";\n      [data-icon-serial] {\n        border-top-right-radius: 3px;\n        border-bottom-right-radius: 3px;\n        border-color: transparent;\n      }\n    "]);vp=function t(){return e};return e}function vh(){var e=(0,I._)(["\n      [data-three-dots] {\n        opacity: 1;\n      }\n    "]);vh=function t(){return e};return e}function vv(){var e=(0,I._)(["\n      box-shadow: ",";\n      background-color: ",";\n      border-radius: ",";\n\n      :hover {\n        background-color: ",";\n      }\n    "]);vv=function t(){return e};return e}var vf={true_false:"quizTrueFalse",multiple_choice:"quizMultiChoice",open_ended:"quizEssay",fill_in_the_blank:"quizFillInTheBlanks",short_answer:"quizShortAnswer",matching:"quizImageMatching",image_answering:"quizImageAnswer",ordering:"quizOrdering",draw_image:"quizMarkInTheImage",scale:"quizRange",pin_image:"quizPin",coordinates:"quizGraph",puzzle:"quizPuzzle",h5p:"quizH5p"};var vg=!!P/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var vm=e=>{var{question:t,index:n,onDuplicateQuestion:s,onRemoveQuestion:l,isOverlay:u=false}=e;var{activeQuestionIndex:d,activeQuestionId:c,validationError:f,setActiveQuestionId:g,setValidationError:b,contentType:y}=cv();var w=(0,S/* .useFormContext */.xW)();var[Y,k]=(0,o.useState)(false);var I=(0,o.useRef)(null);var C=w.getValues("questions.".concat(d));var{attributes:D,listeners:E,setNodeRef:z,transform:M,transition:H,isDragging:P}=(0,p/* .useSortable */.gl)({id:t.question_id,animateLayoutChanges:A/* .animateLayoutChanges */.J});var O={transform:q/* .CSS.Transform.toString */.Ks.Transform.toString(M),transition:H,opacity:P?.3:undefined,background:P?_/* .colorTokens.stroke.hover */.I6.stroke.hover:undefined};(0,o.useEffect)(()=>{if(c===t.question_id){var e;(e=I.current)===null||e===void 0?void 0:e.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})}},[c,t.question_id]);return/*#__PURE__*/(0,h/* .createElement */.n)("div",(0,i._)((0,r._)({},D),{key:t.question_id,css:vb.questionItem({isActive:String(c)===String(t.question_id),isDragging:u,isThreeDotsOpen:Y}),ref:e=>{z(e);// @ts-expect-error
I.current=e},style:O,onClick:()=>{if(c===t.question_id){return}var e=tn(C);if(e!==true){b(e);return}b(null);g(t.question_id)},onKeyDown:e=>{if(e.key==="Enter"||e.key===" "){if(c===t.question_id){return}var n=tn(C);if(n!==true){b(n);return}b(null);g(t.question_id)}},children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:vb.iconAndSerial({isDragging:u}),"data-icon-serial":true,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("span",{"data-serial":true,children:n+1}),/*#__PURE__*/(0,a/* .jsx */.Y)("button",(0,i._)((0,r._)({"data-drag-icon":true},E),{type:"button",css:vb.dragButton,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{"data-drag-icon":true,name:"dragVertical",width:24,height:24})})),/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:vf[t.question_type],width:24,height:24,"data-question-icon":true})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:vb.questionTitle({isActive:String(c)===String(t.question_id)}),children:t.question_title}),/*#__PURE__*/(0,a/* .jsxs */.FD)(vc/* ["default"] */.A,{isOpen:Y,onClick:e=>{e.stopPropagation();var t=tn(C);k(true);if(t!==true){b(t)}},animationType:N/* .AnimationType.slideDown */.J6.slideDown,closePopover:()=>k(false),dotsOrientation:"vertical",maxWidth:vg?"150px":"160px",isInverse:true,size:"small","data-three-dots":true,children:[!f&&y!=="tutor_h5p_quiz"&&/*#__PURE__*/(0,a/* .jsx */.Y)(vc/* ["default"].Option */.A.Option,{text:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:vb.duplicate,children:[(0,v.__)("Duplicate","tutor"),!vg&&/*#__PURE__*/(0,a/* .jsx */.Y)(T/* ["default"] */.A,{size:"small",content:(0,v.__)("Pro","tutor")})]}),icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"duplicate",width:24,height:24}),disabled:!vg,onClick:e=>{e.stopPropagation();s(t);k(false)}}),/*#__PURE__*/(0,a/* .jsx */.Y)(vc/* ["default"].Option */.A.Option,{isTrash:true,text:(0,v.__)("Delete","tutor"),icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"delete",width:24,height:24}),onClick:e=>{e.stopPropagation();l();k(false)}})]})]}))};/* export default */const v_=vm;var vb={questionItem:e=>{var{isActive:t=false,isDragging:n=false,isThreeDotsOpen:r=false}=e;return/*#__PURE__*/(0,h/* .css */.AH)("padding:",_/* .spacing["10"] */.YK["10"]," ",_/* .spacing["8"] */.YK["8"]," ",_/* .spacing["10"] */.YK["10"]," ",_/* .spacing["28"] */.YK["28"],";display:flex;align-items:center;justify-content:space-between;gap:",_/* .spacing["12"] */.YK["12"],";border-bottom:1px solid ",_/* .colorTokens.stroke.divider */.I6.stroke.divider,";cursor:pointer;transition:border 0.3s ease-in-out,background-color 0.3s ease-in-out;[data-three-dots]{opacity:0;background:transparent;svg{color:",_/* .colorTokens.icon["default"] */.I6.icon["default"],";}:focus-visible{opacity:1;}}",t&&(0,h/* .css */.AH)(vp(),_/* .colorTokens.text.brand */.I6.text.brand,_/* .colorTokens.background.white */.I6.background.white)," ",r&&(0,h/* .css */.AH)(vh()),":hover{background-color:",_/* .colorTokens.background.hover */.I6.background.hover,";[data-serial]{display:none;}[data-drag-icon]{display:block;}[data-icon-serial]{border-top-right-radius:3px;border-bottom-right-radius:3px;border-color:transparent;}[data-three-dots]{opacity:1;}}:focus-visible{outline:2px solid ",_/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:-2px;border-radius:",_/* .borderRadius.card */.Vq.card,";[data-three-dots]{opacity:1;}}",n&&(0,h/* .css */.AH)(vv(),_/* .shadow.drag */.r7.drag,_/* .colorTokens.background.white */.I6.background.white,_/* .borderRadius.card */.Vq.card,_/* .colorTokens.background.white */.I6.background.white)," ",_/* .Breakpoint.smallMobile */.EA.smallMobile,"{padding:",_/* .spacing["8"] */.YK["8"]," ",_/* .spacing["8"] */.YK["8"]," ",_/* .spacing["8"] */.YK["8"]," ",_/* .spacing["8"] */.YK["8"],";[data-three-dots]{opacity:1;}}")},iconAndSerial:e=>{var{isDragging:t=false}=e;return/*#__PURE__*/(0,h/* .css */.AH)("display:grid;grid-template-columns:1fr 1fr;align-items:center;border-radius:3px 0 0 3px;width:64px;padding:",_/* .spacing["4"] */.YK["4"]," ",_/* .spacing["8"] */.YK["8"]," ",_/* .spacing["4"] */.YK["4"]," ",_/* .spacing["4"] */.YK["4"],";flex-shrink:0;column-gap:",_/* .spacing["12"] */.YK["12"],";place-items:center center;[data-drag-icon]{display:none;color:",_/* .colorTokens.icon.hints */.I6.icon.hints,";cursor:",t?"grabbing":"grab",";}[data-question-icon]{flex-shrink:0;}svg{flex-shrink:0;}[data-serial]{width:24px;display:block;",F/* .typography.caption */.I.caption("medium"),"      text-align:center;flex-grow:1;}")},questionTitle:e=>{var{isActive:t=false}=e;return/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.small */.I.small(t?"medium":"regular"),";color:",t?_/* .colorTokens.text.brand */.I6.text.brand:_/* .colorTokens.text.subdued */.I6.text.subdued,";flex-grow:1;")},duplicate:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;align-items:center;gap:",_/* .spacing["4"] */.YK["4"],";"),dragButton:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.resetButton */.x.resetButton,";&:focus,&:active,&:hover{background:none;}")};// CONCATENATED MODULE: ./assets/src/js/v3/shared/hooks/usePaginatedTable.ts
var vy=function(){var{limit:e=O/* .ITEMS_PER_PAGE */.re}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var[t,n]=(0,o.useState)({page:1,sortProperty:"",sortDirection:undefined,filter:{}});var i=t;var a=e*Math.max(0,i.page-1);var s=(0,o.useCallback)(e=>{n(t=>(0,r._)({},t,e))},[n]);var l=e=>s({page:e});var u=(0,o.useCallback)(e=>s({page:1,filter:e}),[s]);var d=e=>{var t={};if(e!==i.sortProperty){t={sortDirection:"asc",sortProperty:e}}else{t={sortDirection:i.sortDirection==="asc"?"desc":"asc",sortProperty:e}}s(t)};return{pageInfo:i,onPageChange:l,onColumnSort:d,offset:a,itemsPerPage:e,onFilterItems:u}};// CONCATENATED MODULE: ./assets/src/js/v3/shared/molecules/Paginator.tsx
var vw=e=>{var{currentPage:t,onPageChange:n,totalItems:r,itemsPerPage:i}=e;var s=Math.max(Math.ceil(r/i),1);var[l,u]=(0,o.useState)("");(0,o.useEffect)(()=>{u(t.toString())},[t]);var d=e=>{if(e<1||e>s){return}n(e)};return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:vA.wrapper,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:vA.pageStatus,children:[(0,v.__)("Page","tutor"),/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:/*#__PURE__*/(0,a/* .jsx */.Y)("input",{type:"text",css:vA.paginationInput,value:l,onChange:e=>{var{value:t}=e.currentTarget;var r=t.replace(/[^0-9]/g,"");var i=Number(r);if(i>0&&i<=s){u(r);n(i)}else if(!r){u(r)}},autoComplete:"off"})}),(0,v.__)("of","tutor")," ",/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:s})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:vA.pageController,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:vA.paginationButton,onClick:()=>d(t-1),disabled:t===1,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:!O/* .isRTL */.V8?"chevronLeft":"chevronRight",width:32,height:32})}),/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:vA.paginationButton,onClick:()=>d(t+1),disabled:t===s,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:!O/* .isRTL */.V8?"chevronRight":"chevronLeft",width:32,height:32})})]})]})};/* export default */const vx=vw;var vA={wrapper:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;justify-content:end;align-items:center;flex-wrap:wrap;gap:",_/* .spacing["8"] */.YK["8"],";height:36px;"),pageStatus:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.body */.I.body(),"    color:",_/* .colorTokens.text.title */.I6.text.title,";min-width:100px;"),paginationInput:/*#__PURE__*/(0,h/* .css */.AH)("outline:0;border:1px solid ",_/* .colorTokens.stroke["default"] */.I6.stroke["default"],";border-radius:",_/* .borderRadius["6"] */.Vq["6"],";margin:0 ",_/* .spacing["8"] */.YK["8"],";color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";padding:8px 12px;width:72px;&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none;margin:",_/* .spacing["0"] */.YK["0"],";}&[type='number']{-moz-appearance:textfield;}"),pageController:/*#__PURE__*/(0,h/* .css */.AH)("gap:",_/* .spacing["8"] */.YK["8"],";display:flex;justify-content:center;align-items:center;height:100%;"),paginationButton:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.resetButton */.x.resetButton,";background:",_/* .colorTokens.background.white */.I6.background.white,";color:",_/* .colorTokens.icon["default"] */.I6.icon["default"],";border-radius:",_/* .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:",_/* .colorTokens.icon["default"] */.I6.icon["default"],";}&:hover{background:",_/* .colorTokens.background["default"] */.I6.background["default"],";& > svg{color:",_/* .colorTokens.icon.brand */.I6.icon.brand,";}}&:disabled{background:",_/* .colorTokens.background.white */.I6.background.white,";& > svg{color:",_/* .colorTokens.icon.disable["default"] */.I6.icon.disable["default"],";}}")};// CONCATENATED MODULE: ./assets/src/js/v3/shared/services/content-bank.ts
var vY=e=>{return eN/* .wpAjaxInstance.get */.b.get(eK/* ["default"].GET_CONTENT_BANK_COLLECTIONS */.A.GET_CONTENT_BANK_COLLECTIONS,{params:e}).then(e=>e.data)};var vk=e=>{return(0,eF/* .useQuery */.I)({queryKey:["ContentBankCollections",e],queryFn:()=>vY((0,r._)({},e)),placeholderData:e=>e,enabled:!!e.page&&!!e.per_page})};var vI=e=>{return useInfiniteQuery({queryKey:["ContentBankCollectionsInfinity",e],queryFn:t=>{var{pageParam:n=1}=t;return vY(_object_spread_props(_object_spread({},e),{page:n}))},getNextPageParam:e=>e.current_page<e.total_page?e.current_page+1:undefined,initialPageParam:1,enabled:e.isEnabled&&!!e.per_page})};var vq=e=>{return eN/* .wpAjaxInstance.get */.b.get(eK/* ["default"].GET_CONTENT_BANK_CONTENTS */.A.GET_CONTENT_BANK_CONTENTS,{params:e}).then(e=>e.data)};var vC=e=>{return(0,eF/* .useQuery */.I)({queryFn:()=>vq(e),queryKey:["ContentBankContents",e],placeholderData:e=>e,enabled:!!e.collection_id})};var vD={"cb-lesson":(0,v.__)("Lesson","tutor"),"cb-assignment":(0,v.__)("Assignment","tutor"),"cb-question":(0,v.__)("Question","tutor")};// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/modals/ContentBankContentSelectModal/SearchField.tsx
var vE=e=>{var{onFilterItems:t}=e;var n=(0,ec/* .useFormWithGlobalError */.p)({defaultValues:{search:""}});var s=(0,Z/* .useDebounce */.d)(n.watch("search"));(0,o.useEffect)(()=>{t((0,r._)({},s.length>0&&{search:s}))},[t,s]);return/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:n.control,name:"search",render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(Q/* ["default"] */.A,(0,i._)((0,r._)({},e),{content:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"search",width:24,height:24}),contentCss:vz.contentCss,placeholder:(0,v.__)("Search...","tutor"),showVerticalBar:false}))})};/* export default */const vS=vE;var vz={contentCss:/*#__PURE__*/(0,h/* .css */.AH)("svg{color:",_/* .colorTokens.icon["default"] */.I6.icon["default"],";}")};// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/modals/ContentBankContentSelectModal/CollectionListTable.tsx
function vT(){var e=(0,I._)(["\n      padding-bottom: ",";\n    "]);vT=function t(){return e};return e}function vM(){var e=(0,I._)(["\n      tr {\n        &:last-of-type {\n          border-bottom: none;\n        }\n      }\n      td {\n        padding: 0;\n\n        [aria-disabled='true'] {\n          color: ",";\n        }\n\n        &:hover {\n          [data-collection-title] {\n            &:not([aria-disabled='true']) {\n              color: ",";\n            }\n          }\n        }\n      }\n    "]);vM=function t(){return e};return e}function vH(){var e=(0,I._)(["\n      td {\n        padding: ",";\n      }\n    "]);vH=function t(){return e};return e}function vP(){var e=(0,I._)(["\n      background-color: #e8f4fd;\n      color: ",";\n    "]);vP=function t(){return e};return e}function vO(){var e=(0,I._)(["\n      background-color: #e6f8f1;\n      color: ",";\n    "]);vO=function t(){return e};return e}function vF(){var e=(0,I._)(["\n      background-color: #fff5e6;\n      color: #ff7c02;\n    "]);vF=function t(){return e};return e}var vN=e=>{var{type:t}=e;var n,s;var{pageInfo:l,onPageChange:u,itemsPerPage:d,onFilterItems:c}=vy();var p=(0,S/* .useFormContext */.xW)();var h=vk((0,i._)((0,r._)({page:l.page,per_page:d},l.filter.search?{search:String(l.filter.search)}:{}),{hide_empty:1,context:t==="question"?"quiz_builder":"topic"}));var f=(0,o.useMemo)(()=>{var e;var t;return(t=(e=h.data)===null||e===void 0?void 0:e.data)!==null&&t!==void 0?t:[]},[h.data]);var m;var b=(m=(n=h.data)===null||n===void 0?void 0:n.total_record)!==null&&m!==void 0?m:0;var w;var A=Number((w=(s=h.data)===null||s===void 0?void 0:s.total_page)!==null&&w!==void 0?w:0);var Y=(0,o.useMemo)(()=>[{Cell:e=>{var n=Number(e.count_stats.lesson)||0;var r=Number(e.count_stats.assignment)||0;var i=Number(e.count_stats.question)||0;var o=t==="lesson_assignment"?n+r:i;return/*#__PURE__*/(0,a/* .jsxs */.FD)("button",{css:vW.collectionItemWrapper,onClick:()=>p.setValue("selectedCollection",e),onKeyDown:t=>{if(t.key==="Enter"||t.key===" "){t.preventDefault();p.setValue("selectedCollection",e)}},"aria-label":/* translators: %s is the collection title */(0,v.sprintf)((0,v.__)("Select collection: %s","tutor"),e.post_title),tabIndex:0,disabled:o===0,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:vW.title,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{"data-collection-title":true,"aria-disabled":o===0,children:e.post_title}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:(o!==null&&o!==void 0?o:0)>0,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{children:/* translators: %d is the total number of contents */(0,v.sprintf)((0,v._n)("%d Item","%d Items",o,"tutor"),o)})})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:o>0,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:vW.title,"aria-disabled":o===0,children:(0,v.__)("No Items","tutor")}),children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:vW.contentsWrapper,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)(y/* ["default"] */.A,{when:t==="lesson_assignment",children:[/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:n>0,children:/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:vW.contentBadge({type:"cb-lesson"}),children:/* translators: %d is the number of lessons */(0,v.sprintf)((0,v._n)("%d Lesson","%d Lessons",n,"tutor"),n)})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:r>0,children:/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:vW.contentBadge({type:"cb-assignment"}),children:/* translators: %d is the number of assignments */(0,v.sprintf)((0,v._n)("%d Assignment","%d Assignments",r,"tutor"),r)})})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:i>0&&t==="question",children:/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:vW.contentBadge({type:"cb-question"}),children:/* translators: %d is the number of questions */(0,v.sprintf)((0,v._n)("%d Question","%d Questions",i,"tutor"),i)})})]})})]})}}],[p,t]);if(h.isLoading){return/*#__PURE__*/(0,a/* .jsx */.Y)(g/* .LoadingSection */.YE,{"aria-label":(0,v.__)("Loading","tutor")})}if(!h.data){return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:vW.errorMessage,role:"alert","aria-live":"assertive",children:(0,v.__)("Something went wrong","tutor")})}return/*#__PURE__*/(0,a/* .jsxs */.FD)(a/* .Fragment */.FK,{children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:vW.tableActions,children:/*#__PURE__*/(0,a/* .jsx */.Y)(vS,{onFilterItems:c})}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:vW.tableWrapper({isLoading:h.isFetching||h.isRefetching,hasPagination:A>1,hasData:f.length>0}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(eP,{noHeader:true,columns:Y,data:f,itemsPerPage:d,loading:h.isFetching||h.isRefetching,colors:{bodyRowHover:_/* .colorTokens.background.white */.I6.background.white}})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:A>1,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:vW.paginatorWrapper,children:/*#__PURE__*/(0,a/* .jsx */.Y)(vx,{currentPage:l.page,onPageChange:u,totalItems:b,itemsPerPage:d})})})]})};/* export default */const vK=/*#__PURE__*/s().memo(vN);var vW={tableActions:/*#__PURE__*/(0,h/* .css */.AH)("padding:",_/* .spacing["20"] */.YK["20"],";"),tableWrapper:e=>{var{isLoading:t=false,hasPagination:n=false,hasData:r=true}=e;return/*#__PURE__*/(0,h/* .css */.AH)("max-height:calc(100vh - 350px);overflow:auto;border-top:1px solid ",_/* .colorTokens.stroke.divider */.I6.stroke.divider,";",!n&&(0,h/* .css */.AH)(vT(),_/* .spacing["12"] */.YK["12"])," ",!t&&(0,h/* .css */.AH)(vM(),_/* .colorTokens.text.disable */.I6.text.disable,_/* .colorTokens.text.brand */.I6.text.brand)," ",!r&&(0,h/* .css */.AH)(vH(),_/* .spacing["20"] */.YK["20"]))},paginatorWrapper:/*#__PURE__*/(0,h/* .css */.AH)("margin:",_/* .spacing["20"] */.YK["20"]," ",_/* .spacing["16"] */.YK["16"],";"),collectionItemWrapper:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.resetButton */.x.resetButton,";min-height:60px;width:100%;height:100%;padding:",_/* .spacing["12"] */.YK["12"]," ",_/* .spacing["24"] */.YK["24"]," ",_/* .spacing["12"] */.YK["12"]," ",_/* .spacing["20"] */.YK["20"],";",Y/* .styleUtils.display.flex */.x.display.flex("row"),";justify-content:space-between;align-items:center;gap:",_/* .spacing["16"] */.YK["16"],";&:hover{background-color:",_/* .colorTokens.background.hover */.I6.background.hover,";}&:disabled{cursor:not-allowed;pointer-events:none;background-color:",_/* .colorTokens.background.disable */.I6.background.disable,";}"),contentsWrapper:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;gap:",_/* .spacing["4"] */.YK["4"],";flex-shrink:0;"),contentBadge:e=>{var{type:t}=e;return/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.tiny */.I.tiny("medium"),";padding:",_/* .spacing["4"] */.YK["4"]," ",_/* .spacing["8"] */.YK["8"],";border-radius:",_/* .borderRadius["4"] */.Vq["4"],";white-space:nowrap;",t==="cb-lesson"&&(0,h/* .css */.AH)(vP(),_/* .colorTokens.icon.brand */.I6.icon.brand)," ",t==="cb-assignment"&&(0,h/* .css */.AH)(vO(),_/* .colorTokens.icon.processing */.I6.icon.processing)," ",t==="cb-question"&&(0,h/* .css */.AH)(vF()))},title:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.small */.I.small(),";color:",_/* .colorTokens.text.primary */.I6.text.primary,";",Y/* .styleUtils.text.ellipsis */.x.text.ellipsis(2),";text-wrap:pretty;div:is(:last-of-type):not(:only-of-type){",F/* .typography.small */.I.small(),";color:",_/* .colorTokens.text.hints */.I6.text.hints,";}"),errorMessage:/*#__PURE__*/(0,h/* .css */.AH)("height:100px;display:flex;align-items:center;justify-content:center;")};// CONCATENATED MODULE: ./assets/src/js/v3/shared/hooks/useIntersectionObserver.ts
var vR=function(){var{threshold:e=0,root:t=null,rootMargin:n="0%",freezeOnceVisible:r=false,dependencies:i=[]}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var a=(0,o.useRef)(null);var[s,l]=(0,o.useState)();var u=(s===null||s===void 0?void 0:s.isIntersecting)&&r;var d=e=>{var[t]=e;l(t)};(0,o.useEffect)(()=>{var r=a.current;var i=(0,D/* .isDefined */.O9)(window.IntersectionObserver);if(!i||u||!r){if(!r){l(undefined)}return}var o={threshold:e,root:t,rootMargin:n};var s=new IntersectionObserver(d,o);s.observe(r);return()=>s.disconnect();// eslint-disable-next-line react-hooks/exhaustive-deps
},[a.current,e,t,n,u,...i]);return{intersectionEntry:s,intersectionElementRef:a}};/* export default */const vL=vR;// CONCATENATED MODULE: ./assets/src/js/v3/shared/atoms/Select.tsx
function vU(){var e=(0,I._)(["\n      display: flex;\n      flex-direction: row;\n      align-items: center;\n      justify-content: space-between;\n\n      > div {\n        flex: 1;\n      }\n    "]);vU=function t(){return e};return e}function vB(){var e=(0,I._)(["\n      flex: 1;\n    "]);vB=function t(){return e};return e}function vj(){var e=(0,I._)(["\n        cursor: pointer;\n      "]);vj=function t(){return e};return e}function vV(){var e=(0,I._)(["\n        height: 32px;\n      "]);vV=function t(){return e};return e}function vQ(){var e=(0,I._)(["\n        color: ",";\n\n        &:hover {\n          text-decoration: underline;\n        }\n      "]);vQ=function t(){return e};return e}function vG(){var e=(0,I._)(["\n      pointer-events: none;\n\n      > button {\n        color: ",";\n      }\n    "]);vG=function t(){return e};return e}function v$(){var e=(0,I._)(["\n      > button {\n        ",";\n      }\n    "]);v$=function t(){return e};return e}function vX(){var e=(0,I._)(["\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    "]);vX=function t(){return e};return e}function vZ(){var e=(0,I._)(["\n      transform: rotate(180deg);\n    "]);vZ=function t(){return e};return e}function vJ(){var e=(0,I._)(["\n      display: none;\n    "]);vJ=function t(){return e};return e}var v0=20;var v1=e=>{var{options:t,onChange:n=k/* .noop */.lQ,clearOption:r=k/* .noop */.lQ,label:i,placeholder:s="",readOnly:l,isSearchable:u=false,isClearable:d=true,isInlineLabel:c=false,isFontWeight:p=false,value:h,caretSize:_=20,infiniteScroll:b=false,wrapperStyle:y,inputCss:w,disabled:A,size:Y="regular",optionsStyleVariant:I="regular"}=e;var q=(0,k/* .nanoid */.Ak)();var[C,D]=(0,o.useState)("");var[E,S]=(0,o.useState)("");var[z,T]=(0,o.useState)(false);var[M,H]=(0,o.useState)([]);var P=(0,o.useRef)(null);var O=(0,Z/* .useDebounce */.d)(E);(0,o.useEffect)(()=>{var e;var n;var r=(n=(e=t.find(e=>String(e.value)===String(h===null||h===void 0?void 0:h.value)))===null||e===void 0?void 0:e.label)!==null&&n!==void 0?n:"";D(r)},[t,h]);var F=(0,o.useMemo)(()=>{H([]);if(u){return t.filter(e=>{var{label:t}=e;return t.toLowerCase().startsWith(O.toLowerCase())})}return t},[O,u,t]);var{intersectionEntry:K,intersectionElementRef:W}=vL();var L=F.length>M.length;(0,o.useEffect)(()=>{if(!b){H(F);return}if(!(K===null||K===void 0?void 0:K.isIntersecting)||!L){return}var e=M.length;var t=e+v0;H(n=>[...n,...F.slice(e,t)]);// eslint-disable-next-line react-hooks/exhaustive-deps
},[F,K===null||K===void 0?void 0:K.isIntersecting]);return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:[v4.mainWrapper,y],children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:v4.inputLabelWrapper(c),ref:P,children:[!!i&&/*#__PURE__*/(0,a/* .jsx */.Y)("label",{htmlFor:q,css:v4.label(c),children:i}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:[v4.inputWrapper,w],children:[/*#__PURE__*/(0,a/* .jsx */.Y)("input",{id:q,onClick:()=>T(e=>!e),css:v4.input({isSearchable:u,size:Y}),autoComplete:"off",readOnly:l||!u,placeholder:s,value:C,onChange:e=>{D(e.target.value);S(e.target.value)},disabled:A,"data-select":true}),/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:v4.caretButton,onClick:()=>{T(e=>!e)},disabled:A||l||t.length===0,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"chevronDown",width:_,height:_,style:v4.toggleIcon({isOpen:z})})})]})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)(R/* ["default"] */.A,{triggerRef:P,isOpen:z,closePopover:()=>T(false),animationType:N/* .AnimationType.slideDown */.J6.slideDown,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("ul",{css:v4.options,children:[M.map(e=>/*#__PURE__*/(0,a/* .jsx */.Y)("li",{css:v4.optionItem({isSelected:e.value===(h===null||h===void 0?void 0:h.value),optionsStyleVariant:I,isDisabled:!!e.disabled}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",buttonCss:v4.optionButton({fontWeight:p?e.value:"inherit"}),onClick:()=>{D(e.label);S("");n(e);T(false)},children:e.label})},String(e.value))),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{ref:W,css:v4.spinnerWrapper({isVisible:L}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(g/* ["default"] */.Ay,{})})]}),d&&/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:v4.clearButton({isDisabled:C===""}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",disabled:C==="",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"delete"}),onClick:()=>{r();D("");S("");T(false)},children:(0,v.__)("Clear","tutor")})})]})]})};/* export default */const v2=v1;var v4={mainWrapper:/*#__PURE__*/(0,h/* .css */.AH)("width:100%;"),inputLabelWrapper:e=>/*#__PURE__*/(0,h/* .css */.AH)("width:100%;display:flex;flex-direction:column;gap:",_/* .spacing["4"] */.YK["4"],";",e&&(0,h/* .css */.AH)(vU())),label:e=>/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.caption */.I.caption()," ",e&&(0,h/* .css */.AH)(vB())),inputWrapper:/*#__PURE__*/(0,h/* .css */.AH)("width:100%;position:relative;"),input:e=>{var{isSearchable:t,size:n}=e;return/*#__PURE__*/(0,h/* .css */.AH)("&[data-select]{",F/* .typography.body */.I.body(),";width:100%;height:40px;background-color:",_/* .colorTokens.background.white */.I6.background.white,";border-radius:",_/* .borderRadius["6"] */.Vq["6"],";border:1px solid ",_/* .colorTokens.stroke["default"] */.I6.stroke["default"],";box-shadow:",_/* .shadow.input */.r7.input,";padding:",_/* .spacing["8"] */.YK["8"]," ",_/* .spacing["32"] */.YK["32"]," ",_/* .spacing["8"] */.YK["8"]," ",_/* .spacing["16"] */.YK["16"],";color:",_/* .colorTokens.text.primary */.I6.text.primary,";appearance:textfield;transition:all 0.15s ease-in-out;",!t&&(0,h/* .css */.AH)(vj()),":focus{",Y/* .styleUtils.inputFocus */.x.inputFocus,";}:disabled{color:",_/* .colorTokens.text.disable */.I6.text.disable,";cursor:not-allowed;}::-webkit-outer-spin-button,::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}::placeholder{color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";}",n==="small"&&(0,h/* .css */.AH)(vV()),"}")},clearButton:e=>{var{isDisabled:t=false}=e;return/*#__PURE__*/(0,h/* .css */.AH)("padding:",_/* .spacing["4"] */.YK["4"]," ",_/* .spacing["8"] */.YK["8"],";border-top:1px solid ",_/* .colorTokens.stroke["default"] */.I6.stroke["default"],";display:flex;justify-content:center;min-height:40px;& > button{padding:0;width:100%;font-size:",_/* .fontSize["12"] */.J["12"],";> span{justify-content:center;}",!t&&(0,h/* .css */.AH)(vQ(),_/* .colorTokens.text.title */.I6.text.title),"}")},options:/*#__PURE__*/(0,h/* .css */.AH)("list-style-type:none;max-height:500px;padding:",_/* .spacing["4"] */.YK["4"]," 0;margin:0;",Y/* .styleUtils.overflowYAuto */.x.overflowYAuto,";"),optionItem:e=>{var{isSelected:t=false,isDisabled:n=false,optionsStyleVariant:r="regular"}=e;return/*#__PURE__*/(0,h/* .css */.AH)(F/* .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;",n&&(0,h/* .css */.AH)(vG(),_/* .colorTokens.text.disable */.I6.text.disable),"    &:hover{background-color:",_/* .colorTokens.background.hover */.I6.background.hover,";}",r==="small"&&(0,h/* .css */.AH)(v$(),F/* .typography.caption */.I.caption())," ",t&&(0,h/* .css */.AH)(vX(),_/* .colorTokens.background.active */.I6.background.active,_/* .colorTokens.brand.blue */.I6.brand.blue,_/* .borderRadius["6"] */.Vq["6"],_/* .borderRadius["6"] */.Vq["6"]))},optionButton:e=>{var{fontWeight:t="inherit"}=e;return/*#__PURE__*/(0,h/* .css */.AH)("width:100%;justify-content:start;padding:",_/* .spacing["6"] */.YK["6"]," ",_/* .spacing["12"] */.YK["12"],";font-weight:",t,";color:",_/* .colorTokens.text.title */.I6.text.title,";:hover{text-decoration:none;}:focus{box-shadow:none;}")},toggleIcon:e=>{var{isOpen:t=false}=e;return/*#__PURE__*/(0,h/* .css */.AH)("color:",_/* .colorTokens.icon["default"] */.I6.icon["default"],";transition:transform 0.3s ease-in-out;",t&&(0,h/* .css */.AH)(vZ()))},optionsContainer:/*#__PURE__*/(0,h/* .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,h/* .css */.AH)(Y/* .styleUtils.resetButton */.x.resetButton,";position:absolute;top:0;bottom:0;right:",_/* .spacing["8"] */.YK["8"],";margin:auto 0;display:flex;align-items:center;"),spinnerWrapper:e=>{var{isVisible:t=false}=e;return/*#__PURE__*/(0,h/* .css */.AH)("width:100%;display:flex;justify-content:center;align-items:center;",!t&&(0,h/* .css */.AH)(vJ()))}};// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/modals/ContentBankContentSelectModal/FilterFields.tsx
function v6(){var e=(0,I._)(["\n      padding-right: ",";\n    "]);v6=function t(){return e};return e}var v5=e=>{var{onFilterChange:t,initialValues:n,type:s}=e;var l=(0,ec/* .useFormWithGlobalError */.p)({defaultValues:n||{contentTypes:[],order:"asc",questionTypes:[]}});var[u,d]=(0,o.useState)(false);var c=(0,o.useRef)(null);var p=l.watch("order")||"asc";var h=l.watch("contentTypes")||[];var g=l.watch("questionTypes")||[];var _=s==="question";var w=[{label:(0,v.__)("True/False","tutor"),value:"true_false",icon:"quizTrueFalse"},{label:(0,v.__)("Multiple Choice","tutor"),value:"multiple_choice",icon:"quizMultiChoice"},{label:(0,v.__)("Open Ended/Essay","tutor"),value:"open_ended",icon:"quizEssay"},{label:(0,v.__)("Fill in the Blanks","tutor"),value:"fill_in_the_blank",icon:"quizFillInTheBlanks"},{label:(0,v.__)("Short Answer","tutor"),value:"short_answer",icon:"quizShortAnswer"},{label:(0,v.__)("Matching","tutor"),value:"matching",icon:"quizImageMatching"},{label:(0,v.__)("Image Answering","tutor"),value:"image_answering",icon:"quizImageAnswer"},{label:(0,v.__)("Ordering","tutor"),value:"ordering",icon:"quizOrdering"},{label:(0,v.__)("Puzzle","tutor"),value:"puzzle",icon:"quizPuzzle"}];return/*#__PURE__*/(0,a/* .jsxs */.FD)(a/* .Fragment */.FK,{children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{"data-filter":true,css:v8.wrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!_&&h.length>0||_&&g.length>0,children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{size:"small",variant:"text",buttonCss:v8.clearButton,onClick:()=>{l.reset({contentTypes:[],questionTypes:[],order:"asc"});t(l.getValues())},children:(0,v.__)("Clear All","tutor")})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:_,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{children:/*#__PURE__*/(0,a/* .jsxs */.FD)(f/* ["default"] */.A,{ref:c,variant:"tertiary",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"mageFilter",height:16,width:16}),buttonCss:v8.filterButton({hasFilters:g.length>0}),onClick:()=>d(e=>!e),children:[/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:(0,v.__)("Filters","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:_&&g.length>0,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:v8.filterCount,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:v8.divider}),/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:g.length})]})})]})})}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"tertiary",isIconOnly:true,icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:p==="asc"?"sortASC":"sortDESC",width:18,height:18}),onClick:()=>{var e=p==="asc"?"desc":"asc";l.setValue("order",e);t((0,i._)((0,r._)({},l.getValues()),{order:e}))},"aria-label":(0,v.__)("Order by","tutor")})})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(R/* ["default"] */.A,{isOpen:u,closeOnEscape:true,animationType:N/* .AnimationType.slideDown */.J6.slideDown,closePopover:()=>{l.reset();d(false)},triggerRef:c,maxWidth:!_?"200px":"240px",children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:v8.filterFieldsWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("h6",{children:(0,v.__)("Filter by","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:v8.filterFields,children:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:_,children:/*#__PURE__*/(0,a/* .jsx */.Y)(b/* ["default"] */.A,{each:w,children:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(ek/* ["default"] */.A,{label:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:v8.questionType,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:e.icon,height:24,width:24}),/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:e.label})]}),checked:g.includes(e.value),onChange:t=>{var n=t?[...g,e.value]:g.filter(t=>t!==e.value);l.setValue("questionTypes",n)}})})})}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:v8.filterActions,children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{size:"small",variant:"primary",onClick:()=>{t(l.getValues());d(false)},children:(0,v.__)("Apply Filters","tutor")})})]})})]})};/* export default */const v3=v5;var v8={wrapper:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex(),";gap:",_/* .spacing["12"] */.YK["12"],";"),filterButton:e=>{var{hasFilters:t=false}=e;return/*#__PURE__*/(0,h/* .css */.AH)("height:40px;padding-inline:",_/* .spacing["12"] */.YK["12"]," ",_/* .spacing["16"] */.YK["16"],";background-color:",_/* .colorTokens.background.white */.I6.background.white,";",t&&(0,h/* .css */.AH)(v6(),_/* .spacing["6"] */.YK["6"]))},clearButton:/*#__PURE__*/(0,h/* .css */.AH)("flex-shrink:0;"),questionType:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;gap:",_/* .spacing["12"] */.YK["12"],";color:",_/* .colorTokens.text.primary */.I6.text.primary,";"),divider:/*#__PURE__*/(0,h/* .css */.AH)("width:1px;height:24px;background-color:",_/* .colorTokens.stroke.divider */.I6.stroke.divider,";"),filterCount:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;gap:",_/* .spacing["8"] */.YK["8"],";margin-left:",_/* .spacing["8"] */.YK["8"],";span{height:26px;width:26px;",Y/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;justify-content:center;border-radius:",_/* .borderRadius["4"] */.Vq["4"],";background-color:",_/* .colorTokens.primary["50"] */.I6.primary["50"],";color:",_/* .colorTokens.text.brand */.I6.text.brand,";}"),filterFieldsWrapper:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";h6{padding:",_/* .spacing["12"] */.YK["12"]," ",_/* .spacing["12"] */.YK["12"]," ",_/* .spacing["6"] */.YK["6"]," ",_/* .spacing["12"] */.YK["12"],";",F/* .typography.caption */.I.caption(),";color:",_/* .colorTokens.text.hints */.I6.text.hints,";border-bottom:1px solid ",_/* .colorTokens.stroke.divider */.I6.stroke.divider,";}"),filterFields:/*#__PURE__*/(0,h/* .css */.AH)("padding:",_/* .spacing["6"] */.YK["6"]," ",_/* .spacing["12"] */.YK["12"]," ",_/* .spacing["6"] */.YK["6"]," ",_/* .spacing["16"] */.YK["16"],";",Y/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["16"] */.YK["16"],";background-color:",_/* .colorTokens.surface.tutor */.I6.surface.tutor,";border-radius:",_/* .borderRadius["8"] */.Vq["8"],";"),filterActions:/*#__PURE__*/(0,h/* .css */.AH)("padding:",_/* .spacing["6"] */.YK["6"]," ",_/* .spacing["12"] */.YK["12"]," ",_/* .spacing["12"] */.YK["12"]," ",_/* .spacing["12"] */.YK["12"],";button{width:100%;}")};// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/modals/ContentBankContentSelectModal/ContentListTable.tsx
function v9(){var e=(0,I._)(["\n      background-color: #e8f4fd;\n      color: ",";\n    "]);v9=function t(){return e};return e}function v7(){var e=(0,I._)(["\n      background-color: #e6f8f1;\n      color: ",";\n    "]);v7=function t(){return e};return e}function fe(){var e=(0,I._)(["\n      background-color: #fff5e6;\n      color: #ff7c02;\n    "]);fe=function t(){return e};return e}var ft=()=>{var e,t;var{pageInfo:n,onPageChange:s,itemsPerPage:l,onFilterItems:u}=vy();var d=(0,S/* .useFormContext */.xW)();var c=d.watch("selectedCollection");var p=d.watch("existingContentIds");var[h,f]=(0,o.useState)("");var[_,b]=(0,o.useState)("asc");var[w,A]=(0,o.useState)("asc");var I;var q=vC((0,i._)((0,r._)({page:String(n.page),collection_id:(I=c===null||c===void 0?void 0:c.ID)!==null&&I!==void 0?I:null,content_types:h?[h]:["lesson","assignment"]},w?{order:w.toUpperCase()}:{},n.filter.search?{search:String(n.filter.search)}:{}),{exclude:p.map(e=>(0,eg/* .getIdWithoutPrefix */.E)("content-",e))}));var C=((e=q.data)===null||e===void 0?void 0:e.total_record)||0;var D=Number(((t=q.data)===null||t===void 0?void 0:t.total_page)||0);var E;var z=(E=c===null||c===void 0?void 0:c.post_title)!==null&&E!==void 0?E:(0,v.__)("All Contents","tutor");var T=d.watch("contents")||[];var M=T.map(e=>String(e.ID));var H=(0,o.useMemo)(()=>{var e;var t;return(t=(e=q.data)===null||e===void 0?void 0:e.data)!==null&&t!==void 0?t:[]},[q.data]);var P=()=>{d.setValue("selectedCollection",null);s(1);u({search:""})};var F=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:false;if(e){var t=H.filter(e=>!M.includes(String(e.ID)));d.setValue("contents",[...T,...t]);return}var n=T.filter(e=>!H.map(e=>String(e.ID)).includes(String(e.ID)));d.setValue("contents",n)};var N=()=>{return H.length>0&&H.every(e=>M.includes(String(e.ID)))};var K=()=>{b(e=>e==="asc"?"desc":"asc");return H.sort((e,t)=>{return _==="asc"?e.post_title.localeCompare(t.post_title):t.post_title.localeCompare(e.post_title)})};var W=(0,o.useMemo)(()=>{return[{value:"",label:(0,v.__)("All","tutor")},{value:"lesson",label:(0,v.__)("Lessons","tutor")},...(0,k/* .isAddonEnabled */.GR)(O/* .Addons.TUTOR_ASSIGNMENTS */.oW.TUTOR_ASSIGNMENTS)?[{value:"assignment",label:(0,v.__)("Assignments","tutor")}]:[]]},[]);var R=[{Header:C?/*#__PURE__*/(0,a/* .jsx */.Y)("div",{onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),css:fr.headerCheckboxWrapper,children:/*#__PURE__*/(0,a/* .jsx */.Y)(ek/* ["default"] */.A,{onChange:F,checked:q.isLoading||q.isRefetching?false:N(),label:(0,v.__)("Title","tutor"),labelCss:fr.tableTitle,isIndeterminate:H.length>0&&!N()&&T.length>0,"aria-label":(0,v.__)("Select all contents","tutor")})}):(0,v.__)("# Title","tutor"),sortProperty:"title",Cell:e=>{return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fr.checkboxWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(ek/* ["default"] */.A,{onChange:()=>{var t=d.watch("contents")||[];var n=t.filter(t=>String(t.ID)!==String(e.ID));var r=n.length===t.length;if(r){d.setValue("contents",[...n,e])}else{d.setValue("contents",n)}},checked:q.isLoading||q.isRefetching?false:M.includes(String(e.ID))}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:fr.checkboxLabel,children:e.post_title})]})}},{Header:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{"data-type":true,css:fr.tableTitle,children:(0,v.__)("Type","tutor")}),Cell:e=>{return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:fr.type,children:/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:fr.contentBadge({type:e.post_type}),children:vD[e.post_type]})})}}];if(q.isLoading){return/*#__PURE__*/(0,a/* .jsx */.Y)(g/* .LoadingSection */.YE,{})}if(!q.data){return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:fr.errorMessage,children:(0,v.__)("Something went wrong","tutor")})}return/*#__PURE__*/(0,a/* .jsx */.Y)(a/* .Fragment */.FK,{children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fr.wrapper,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fr.headerWithAction,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("button",{css:Y/* .styleUtils.backButton */.x.backButton,onClick:P,"aria-label":(0,v.__)("Go back to collection list","tutor"),children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"arrowLeft",height:24,width:24})}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fr.headerTitle,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("span",{children:[z," "]}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:C,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("span",{children:["(",/* translators: %d is the total number of contents */(0,v.sprintf)((0,v._n)("%d Item","%d Items",C,"tutor"),C),")"]})})]})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fr.tableActions,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(vS,{onFilterItems:u}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fr.tableFilters,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(v2,{"aria-label":(0,v.__)("Select content type","tutor"),options:W,value:h?W.find(e=>e.value===h)||W[0]:W[0],onChange:e=>{f(e.value)},isClearable:false,wrapperStyle:fr.selectInput}),/*#__PURE__*/(0,a/* .jsx */.Y)(v3,{type:"lesson_assignment",onFilterChange:e=>{A(e.order||"asc")}})]})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:fr.tableWrapper,children:/*#__PURE__*/(0,a/* .jsx */.Y)(eP,{headerHeight:48,isBordered:true,isRounded:true,columns:R,data:H,itemsPerPage:l,loading:q.isFetching||q.isRefetching,rowStyle:fr.tableRow,querySortProperties:["title"],querySortDirections:{title:w},onSortClick:e=>{if(e==="title"){var t=K();return t}}})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:D>1,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:fr.paginatorWrapper,children:/*#__PURE__*/(0,a/* .jsx */.Y)(vx,{currentPage:n.page,onPageChange:s,totalItems:C,itemsPerPage:l})})})]})})};/* export default */const fn=ft;var fr={tableActions:/*#__PURE__*/(0,h/* .css */.AH)("width:100%;display:grid;grid-template-columns:212px 1fr;justify-content:space-between;gap:",_/* .spacing["16"] */.YK["16"],";padding:",_/* .spacing["16"] */.YK["16"],";[data-filter]{justify-self:end;}"),tableWrapper:/*#__PURE__*/(0,h/* .css */.AH)("margin:0 ",_/* .spacing["16"] */.YK["16"]," ",_/* .spacing["12"] */.YK["12"]," ",_/* .spacing["16"] */.YK["16"],";max-height:calc(100vh - 350px);overflow:auto;th{border-bottom:1px solid ",_/* .colorTokens.stroke.divider */.I6.stroke.divider,";padding-inline:",_/* .spacing["20"] */.YK["20"],";}[data-type]{text-align:right;}td{padding:",_/* .spacing["12"] */.YK["12"]," ",_/* .spacing["20"] */.YK["20"],";}"),tableRow:/*#__PURE__*/(0,h/* .css */.AH)("border-bottom:1px solid ",_/* .colorTokens.border.tertiary */.I6.border.tertiary,";"),paginatorWrapper:/*#__PURE__*/(0,h/* .css */.AH)("margin:",_/* .spacing["20"] */.YK["20"]," ",_/* .spacing["16"] */.YK["16"],";"),headerWithAction:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("row"),";align-items:center;gap:",_/* .spacing["8"] */.YK["8"],";padding:0 ",_/* .spacing["16"] */.YK["16"]," ",_/* .spacing["12"] */.YK["12"]," ",_/* .spacing["16"] */.YK["16"],";border-bottom:1px solid ",_/* .colorTokens.stroke.divider */.I6.stroke.divider,";"),headerTitle:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.body */.I.body("medium"),";span{&:first-of-type{color:",_/* .colorTokens.text.title */.I6.text.title,";}}span:last-of-type:not(:only-of-type){",F/* .typography.tiny */.I.tiny("medium"),";color:",_/* .colorTokens.text.hints */.I6.text.hints,";}"),wrapper:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";"),tableTitle:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.small */.I.small("medium"),";color:",_/* .colorTokens.text.hints */.I6.text.hints,";"),headerCheckboxWrapper:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;align-items:center;"),checkboxLabel:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.caption */.I.caption("medium"),";color:",_/* .colorTokens.text.primary */.I6.text.primary,";"),checkboxWrapper:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("row"),";align-items:center;gap:",_/* .spacing["12"] */.YK["12"],";"),type:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("row"),";gap:",_/* .spacing["4"] */.YK["4"],";justify-content:end;"),contentBadge:e=>{var{type:t}=e;return/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.tiny */.I.tiny("medium"),";padding:",_/* .spacing["4"] */.YK["4"]," ",_/* .spacing["8"] */.YK["8"],";border-radius:",_/* .borderRadius["4"] */.Vq["4"],";white-space:nowrap;",t==="cb-lesson"&&(0,h/* .css */.AH)(v9(),_/* .colorTokens.icon.brand */.I6.icon.brand)," ",t==="cb-assignment"&&(0,h/* .css */.AH)(v7(),_/* .colorTokens.icon.processing */.I6.icon.processing),"  \n      ",t==="cb-question"&&(0,h/* .css */.AH)(fe()))},errorMessage:/*#__PURE__*/(0,h/* .css */.AH)("height:100px;",Y/* .styleUtils.display.flex */.x.display.flex("row"),";align-items:center;justify-content:center;"),tableFilters:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("row"),";justify-content:end;align-items:center;gap:",_/* .spacing["12"] */.YK["12"],";"),selectInput:/*#__PURE__*/(0,h/* .css */.AH)("max-width:150px;")};// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/modals/ContentBankContentSelectModal/QuestionListTable.tsx
var fi=[{label:(0,v.__)("True/False","tutor"),value:"true_false",icon:"quizTrueFalse",isPro:false},{label:(0,v.__)("Multiple Choice","tutor"),value:"multiple_choice",icon:"quizMultiChoice",isPro:false},{label:(0,v.__)("Open Ended/Essay","tutor"),value:"open_ended",icon:"quizEssay",isPro:false},{label:(0,v.__)("Fill in the Blanks","tutor"),value:"fill_in_the_blank",icon:"quizFillInTheBlanks",isPro:false},{label:(0,v.__)("Short Answer","tutor"),value:"short_answer",icon:"quizShortAnswer",isPro:true},{label:(0,v.__)("Matching","tutor"),value:"matching",icon:"quizImageMatching",isPro:true},{label:(0,v.__)("Image Answering","tutor"),value:"image_answering",icon:"quizImageAnswer",isPro:true},{label:(0,v.__)("Ordering","tutor"),value:"ordering",icon:"quizOrdering",isPro:true},{label:(0,v.__)("Image Marking","tutor"),value:"draw_image",icon:"quizMarkInTheImage",isPro:true},{label:(0,v.__)("Range","tutor"),value:"scale",icon:"quizRange",isPro:true},{label:(0,v.__)("Pin","tutor"),value:"pin_image",icon:"quizPin",isPro:true},{label:(0,v.__)("Graph","tutor"),value:"coordinates",icon:"quizGraph",isPro:true},{label:(0,v.__)("Puzzle","tutor"),value:"puzzle",icon:"quizPuzzle",isPro:true}];var fa=P/* .tutorConfig.is_legacy_learning_mode */.P.is_legacy_learning_mode?fi.filter(e=>e.value!=="draw_image"&&e.value!=="pin_image"&&e.value!=="scale"&&e.value!=="coordinates"&&e.value!=="puzzle"):fi;var fo=()=>{var e,t;var{pageInfo:n,onPageChange:i,itemsPerPage:s,onFilterItems:l}=vy();var u=(0,S/* .useFormContext */.xW)();var d=u.watch("selectedCollection");var[c,p]=(0,o.useState)([]);var[h,f]=(0,o.useState)("asc");var[_,b]=(0,o.useState)("asc");var w;var A=vC((0,r._)({page:String(n.page),collection_id:(w=d===null||d===void 0?void 0:d.ID)!==null&&w!==void 0?w:null,content_types:["question"],context:"quiz_builder"},_?{order:_.toUpperCase()}:{},c.length?{question_types:c}:{},n.filter.search?{search:String(n.filter.search)}:{}));var k=((e=A.data)===null||e===void 0?void 0:e.total_record)||0;var I=Number(((t=A.data)===null||t===void 0?void 0:t.total_page)||0);var q;var C=(q=d===null||d===void 0?void 0:d.post_title)!==null&&q!==void 0?q:(0,v.__)("All Contents","tutor");var D=u.watch("contents")||[];var E=D.map(e=>String(e.ID));var z=(0,o.useMemo)(()=>{var e;var t;return(t=(e=A.data)===null||e===void 0?void 0:e.data)!==null&&t!==void 0?t:[]},[A.data]);var T=()=>{u.setValue("selectedCollection",null);i(1);l({search:""})};var M=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:false;if(e){var t=z.filter(e=>!E.includes(String(e.ID)));u.setValue("contents",[...D,...t]);return}var n=D.filter(e=>!z.map(e=>String(e.ID)).includes(String(e.ID)));u.setValue("contents",n)};var H=()=>{return z.length>0&&z.every(e=>E.includes(String(e.ID)))};var P=()=>{f(e=>e==="asc"?"desc":"asc");return z.sort((e,t)=>{return h==="asc"?e.post_title.localeCompare(t.post_title):t.post_title.localeCompare(e.post_title)})};var O=[{Header:k?/*#__PURE__*/(0,a/* .jsx */.Y)("div",{onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),css:fl.headerCheckboxWrapper,children:/*#__PURE__*/(0,a/* .jsx */.Y)(ek/* ["default"] */.A,{onChange:M,checked:A.isLoading||A.isRefetching?false:H(),label:(0,v.__)("Title","tutor"),labelCss:fl.tableTitle,isIndeterminate:z.length>0&&!H()&&D.length>0,"aria-label":(0,v.__)("Select all questions","tutor")})}):(0,v.__)("# Title","tutor"),sortProperty:"title",name:"title",Cell:e=>{var t,n;var r=()=>{var t=u.watch("contents")||[];var n=t.filter(t=>String(t.ID)!==String(e.ID));var r=n.length===t.length;if(r){u.setValue("contents",[...n,e])}else{u.setValue("contents",n)}};return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fl.checkboxWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(ek/* ["default"] */.A,{onChange:r,checked:A.isLoading||A.isRefetching?false:E.includes(String(e.ID))}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fl.checkboxLabel,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:(t=fa.find(t=>t.value===e.question_type))===null||t===void 0?void 0:t.icon,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:(n=fa.find(t=>t.value===e.question_type))===null||n===void 0?void 0:n.icon,height:24,width:24})}),/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:e.post_title})]})]})}}];if(A.isLoading){return/*#__PURE__*/(0,a/* .jsx */.Y)(g/* .LoadingSection */.YE,{})}if(!A.data){return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:fl.errorMessage,children:(0,v.__)("Something went wrong","tutor")})}return/*#__PURE__*/(0,a/* .jsx */.Y)(a/* .Fragment */.FK,{children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fl.wrapper,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fl.headerWithAction,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("button",{css:Y/* .styleUtils.backButton */.x.backButton,onClick:T,"aria-label":(0,v.__)("Go back to collection list","tutor"),tabIndex:0,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"arrowLeft",height:24,width:24})}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fl.headerTitle,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("span",{children:[C," "]}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:k,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("span",{children:["(",/* translators: %d is the total number of contents */(0,v.sprintf)((0,v._n)("%d Item","%d Items",k,"tutor"),k),")"]})})]})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fl.tableActions,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(vS,{onFilterItems:l}),/*#__PURE__*/(0,a/* .jsx */.Y)(v3,{type:"question",onFilterChange:e=>{b(e.order);p(e.questionTypes||[])}})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:fl.tableWrapper,children:/*#__PURE__*/(0,a/* .jsx */.Y)(eP,{headerHeight:56,isBordered:true,isRounded:true,columns:O,data:z,itemsPerPage:s,loading:A.isFetching||A.isRefetching,querySortProperties:["title"],querySortDirections:{title:h},onSortClick:e=>{if(e==="title"){var t=P();return t}},rowStyle:fl.tableRow})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:I>1,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:fl.paginatorWrapper,children:/*#__PURE__*/(0,a/* .jsx */.Y)(vx,{currentPage:n.page,onPageChange:i,totalItems:k,itemsPerPage:s})})})]})})};/* export default */const fs=fo;var fl={tableActions:/*#__PURE__*/(0,h/* .css */.AH)("width:100%;display:grid;grid-template-columns:212px 1fr;justify-content:space-between;gap:",_/* .spacing["16"] */.YK["16"],";padding:",_/* .spacing["16"] */.YK["16"],";[data-filter]{justify-self:end;}"),tableWrapper:/*#__PURE__*/(0,h/* .css */.AH)("margin:0 ",_/* .spacing["16"] */.YK["16"]," ",_/* .spacing["12"] */.YK["12"]," ",_/* .spacing["16"] */.YK["16"],";max-height:calc(100vh - 350px);overflow:auto;th{border-bottom:1px solid ",_/* .colorTokens.stroke.divider */.I6.stroke.divider,";}[data-type]{text-align:right;}"),tableRow:/*#__PURE__*/(0,h/* .css */.AH)("border-bottom:1px solid ",_/* .colorTokens.border.tertiary */.I6.border.tertiary,";"),paginatorWrapper:/*#__PURE__*/(0,h/* .css */.AH)("margin:",_/* .spacing["20"] */.YK["20"]," ",_/* .spacing["16"] */.YK["16"],";"),headerWithAction:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("row"),";align-items:center;gap:",_/* .spacing["8"] */.YK["8"],";padding:0 ",_/* .spacing["16"] */.YK["16"]," ",_/* .spacing["12"] */.YK["12"]," ",_/* .spacing["16"] */.YK["16"],";border-bottom:1px solid ",_/* .colorTokens.stroke.divider */.I6.stroke.divider,";"),headerTitle:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.body */.I.body("medium"),";span{&:first-of-type{color:",_/* .colorTokens.text.title */.I6.text.title,";}}span:last-of-type:not(:only-of-type){",F/* .typography.tiny */.I.tiny("medium"),";color:",_/* .colorTokens.text.hints */.I6.text.hints,";}"),wrapper:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";"),tableTitle:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.small */.I.small("regular"),";color:",_/* .colorTokens.text.hints */.I6.text.hints,";"),headerCheckboxWrapper:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;align-items:center;"),checkboxLabel:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;gap:",_/* .spacing["12"] */.YK["12"],";",F/* .typography.caption */.I.caption("medium"),";color:",_/* .colorTokens.text.primary */.I6.text.primary,";svg{flex-shrink:0;}span{width:100%;",Y/* .styleUtils.text.ellipsis */.x.text.ellipsis(1),";}"),checkboxWrapper:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;align-items:center;gap:",_/* .spacing["12"] */.YK["12"],";"),type:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;gap:",_/* .spacing["4"] */.YK["4"],";justify-content:end;"),errorMessage:/*#__PURE__*/(0,h/* .css */.AH)("height:100px;display:flex;align-items:center;justify-content:center;")};// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/modals/ContentBankContentSelectModal/index.tsx
var fu=(0,eg/* .getCourseId */.p)();var fd=e=>{var{closeModal:t,actions:n,onAddContent:o,type:s,topicId:l,contents:u,nextContentOrder:d}=e;var c;var p=(0,ec/* .useFormWithGlobalError */.p)({defaultValues:{selectedCollection:null,contents:[],existingContentIds:(c=u===null||u===void 0?void 0:u.map(e=>e.ID))!==null&&c!==void 0?c:[]}});var h=(0,ef/* .useAddContentBankContentToCourseMutation */.SS)();var g=e=>(0,E._)(function*(){o===null||o===void 0?void 0:o(e.contents);if(s==="lesson_assignment"){var n=yield h.mutateAsync({course_id:fu,topic_id:l||"",content_ids:e.contents.map(e=>e.ID),next_content_order:d||0});if(n.status_code===200){t({action:"CONFIRM"});return}}t({action:"CONFIRM"})})();var _=p.watch("selectedCollection");return/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .FormProvider */.Op,(0,i._)((0,r._)({},p),{children:/*#__PURE__*/(0,a/* .jsxs */.FD)(eI/* ["default"] */.A,{onClose:()=>t({action:"CLOSE"}),title:(0,v.__)("Content Bank","tutor"),entireHeader:_&&/*#__PURE__*/(0,a/* .jsx */.Y)(a/* .Fragment */.FK,{children:" "}),icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"contentBank",height:24,width:24}),actions:n,maxWidth:720,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!_,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:s==="lesson_assignment",fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(fs,{}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(fn,{})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(vK,{type:s})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:p.watch("selectedCollection"),children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fp.footer,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{size:"small",variant:"text",onClick:()=>t({action:"CLOSE"}),children:(0,v.__)("Cancel","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{size:"small",variant:"primary",onClick:p.handleSubmit(g),disabled:p.watch("contents").length===0,loading:s==="lesson_assignment"&&h.isPending,"data-cy":"add-content-button",children:(0,v.__)("Add","tutor")})]})})]})}))};/* export default */const fc=fd;var fp={footer:/*#__PURE__*/(0,h/* .css */.AH)("box-shadow:0px 1px 0px 0px #e4e5e7 inset;height:56px;display:flex;align-items:center;justify-content:end;gap:",_/* .spacing["16"] */.YK["16"],";padding-inline:",_/* .spacing["16"] */.YK["16"],";")};// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/curriculum/QuestionList.tsx
var fh=[{label:(0,v.__)("True/False","tutor"),value:"true_false",icon:"quizTrueFalse",isPro:false},{label:(0,v.__)("Multiple Choice","tutor"),value:"multiple_choice",icon:"quizMultiChoice",isPro:false},{label:(0,v.__)("Open Ended/Essay","tutor"),value:"open_ended",icon:"quizEssay",isPro:false},{label:(0,v.__)("Fill in the Blanks","tutor"),value:"fill_in_the_blank",icon:"quizFillInTheBlanks",isPro:false},{label:(0,v.__)("Short Answer","tutor"),value:"short_answer",icon:"quizShortAnswer",isPro:true}];var fv=[{label:(0,v.__)("Matching","tutor"),value:"matching",icon:"quizImageMatching",isPro:true},{label:(0,v.__)("Image Answering","tutor"),value:"image_answering",icon:"quizImageAnswer",isPro:true},{label:(0,v.__)("Ordering","tutor"),value:"ordering",icon:"quizOrdering",isPro:true},{label:(0,v.__)("Image Marking","tutor"),value:"draw_image",icon:"quizMarkInTheImage",isPro:true},{label:(0,v.__)("Range","tutor"),value:"scale",icon:"quizRange",isPro:true},{label:(0,v.__)("Pin","tutor"),value:"pin_image",icon:"quizPin",isPro:true},{label:(0,v.__)("Graph","tutor"),value:"coordinates",icon:"quizGraph",isPro:true},{label:(0,v.__)("Puzzle","tutor"),value:"puzzle",icon:"quizPuzzle",isPro:true}];var ff=!!P/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var fg=e=>{var{isEditing:t}=e;var n=(0,o.useMemo)(()=>{var e=["draw_image","pin_image","scale","coordinates","puzzle"];var t=t=>t.map(t=>P/* .tutorConfig.is_legacy_learning_mode */.P.is_legacy_learning_mode&&e.includes(t.value)?(0,i._)((0,r._)({},t),{isLegacyDisabled:true}):t);return{basic:t(fh),interactive:t(fv)}},[]);var[s,u]=(0,o.useState)(null);var[h,g]=(0,o.useState)(false);var _=(0,o.useRef)(null);var w=(0,o.useRef)(null);var A=(0,S/* .useFormContext */.xW)();var{contentType:I,activeQuestionIndex:q,validationError:C,setActiveQuestionId:E,setValidationError:z}=cv();var{remove:F,append:W,insert:L,move:U,fields:B}=(0,S/* .useFieldArray */.jz)({control:A.control,name:"questions"});var{showModal:j}=(0,H/* .useModal */.h)();var V=(0,d/* .useSensors */.FR)((0,d/* .useSensor */.MS)(d/* .PointerSensor */.AN,{activationConstraint:{distance:10}}),(0,d/* .useSensor */.MS)(d/* .KeyboardSensor */.uN,{coordinateGetter:p/* .sortableKeyboardCoordinates */.JR}));var Q=(0,o.useMemo)(()=>{if(!s){return null}return B.find(e=>e.question_id===s)},[s,B]);var G=A.watch("questions")||[];var $=A.getValues("questions.".concat(q));var X=(e,t)=>{var n=tn($);if(n!==true){z(n);g(false);return}var i=(0,k/* .nanoid */.Ak)();W({_data_status:D/* .QuizDataStatus.NEW */.cW.NEW,question_id:i,/* translators: %d is the question number */question_title:e==="h5p"?t===null||t===void 0?void 0:t.title:(0,v.sprintf)((0,v.__)("Question %d","tutor"),B.length+1),question_description:e==="h5p"?t===null||t===void 0?void 0:t.id:"",question_type:e,question_answers:e==="true_false"?[{answer_id:(0,k/* .nanoid */.Ak)(),_data_status:D/* .QuizDataStatus.NEW */.cW.NEW,is_saved:true,answer_title:(0,v.__)("True","tutor"),is_correct:"1",answer_order:1,answer_two_gap_match:"",answer_view_format:"text",belongs_question_id:i,belongs_question_type:"true_false"},{answer_id:(0,k/* .nanoid */.Ak)(),is_saved:true,_data_status:D/* .QuizDataStatus.NEW */.cW.NEW,answer_title:(0,v.__)("False","tutor"),is_correct:"0",answer_order:2,answer_two_gap_match:"",answer_view_format:"text",belongs_question_id:i,belongs_question_type:"true_false"}]:e==="fill_in_the_blank"?[{_data_status:D/* .QuizDataStatus.NEW */.cW.NEW,is_saved:false,answer_id:(0,k/* .nanoid */.Ak)(),answer_title:"",belongs_question_id:i,belongs_question_type:"fill_in_the_blank",answer_two_gap_match:"",answer_view_format:"",answer_order:0,is_correct:"0"}]:e==="draw_image"?[{_data_status:D/* .QuizDataStatus.NEW */.cW.NEW,is_saved:false,answer_id:(0,k/* .nanoid */.Ak)(),answer_title:"",belongs_question_id:i,belongs_question_type:"draw_image",answer_two_gap_match:"",answer_view_format:"draw_image",answer_order:0,is_correct:"1"}]:e==="coordinates"?[{_data_status:D/* .QuizDataStatus.NEW */.cW.NEW,is_saved:false,answer_id:(0,k/* .nanoid */.Ak)(),answer_title:"",belongs_question_id:i,belongs_question_type:"coordinates",answer_two_gap_match:"",answer_view_format:"coordinates",answer_order:0,is_correct:"1"}]:e==="pin_image"?[{_data_status:D/* .QuizDataStatus.NEW */.cW.NEW,is_saved:true,answer_id:(0,k/* .nanoid */.Ak)(),answer_title:"",belongs_question_id:i,belongs_question_type:"pin_image",answer_two_gap_match:"",answer_view_format:"pin_image",answer_order:0,is_correct:"1"}]:e==="scale"?[{_data_status:D/* .QuizDataStatus.NEW */.cW.NEW,// Keep the initial default scale config valid for immediate save flow.
is_saved:true,answer_id:(0,k/* .nanoid */.Ak)(),answer_title:"",belongs_question_id:i,belongs_question_type:"scale",answer_two_gap_match:JSON.stringify({value:50,config:{min:0,max:100,step:1,defaultValue:50,pxPerUnit:10,labelEvery:10,minorTickEvery:5,precision:0}}),answer_view_format:"scale",answer_order:0,is_correct:"1"}]:e==="puzzle"?[{_data_status:D/* .QuizDataStatus.NEW */.cW.NEW,is_saved:true,answer_id:(0,k/* .nanoid */.Ak)(),answer_title:"",belongs_question_id:i,belongs_question_type:"puzzle",answer_two_gap_match:"",answer_view_format:"puzzle",answer_order:0,is_correct:"1"}]:[],answer_explanation:"",question_mark:1,question_order:B.length+1,question_settings:(0,r._)({answer_required:false,question_mark:I==="tutor_h5p_quiz"?0:1,question_type:e,randomize_question:false,show_question_mark:false},e==="draw_image"&&{draw_image_threshold_percent:70},e==="puzzle"&&{puzzle_grid_size:4},e==="coordinates"&&{coordinates_axis_range:10})});z(null);E(i);g(false)};var Z=e=>{var t=tn($);if(t!==true){z(t);g(false);return}var n=e.map(e=>{// Converts a ContentBankContent question to the QuizQuestion format expected by the quiz builder.
var t=tr(e.question);return(0,i._)((0,r._)({},t),{_data_status:D/* .QuizDataStatus.NEW */.cW.NEW,is_cb_question:true,// this is to ensure unique question_id for each question
question_id:"".concat(t.question_id,"-").concat((0,k/* .nanoid */.Ak)()),question_answers:t.question_answers.map(e=>(0,i._)((0,r._)({},e),{_data_status:D/* .QuizDataStatus.NEW */.cW.NEW}))})});W(n)};var J=e=>{for(var t of e){X("h5p",t)}};var ee=(e,t)=>{var n=A.watch("questions.".concat(t));if(!n||C){return}var a=(0,i._)((0,r._)({},e),{question_id:(0,k/* .nanoid */.Ak)(),_data_status:D/* .QuizDataStatus.NEW */.cW.NEW,question_title:"".concat(n.question_title," (copy)"),question_answers:n.question_answers.map(e=>(0,i._)((0,r._)({},e),{answer_id:(0,k/* .nanoid */.Ak)(),_data_status:D/* .QuizDataStatus.NEW */.cW.NEW}))});var o=t+1;L(o,a)};var et=(e,t)=>{if(t._data_status===D/* .QuizDataStatus.NEW */.cW.NEW){var n=t.question_type==="draw_image"||t.question_type==="pin_image"||t.question_type==="puzzle";if(n){var r=(t.question_answers||[]).flatMap(e=>[e.answer_two_gap_match,e.image_url]).map(e=>typeof e==="string"?e.trim():"").filter(Boolean);if(r.length>0){A.setValue("deleted_temp_mask_values",[...A.getValues("deleted_temp_mask_values")||[],...r])}}}F(e);if(q===e){E("");z(null)}if(t._data_status!==D/* .QuizDataStatus.NEW */.cW.NEW){A.setValue("deleted_question_ids",[...A.getValues("deleted_question_ids"),t.question_id])}};var en=e=>{var{active:t,over:n}=e;if(!n||t.id===n.id){return}var r=B.findIndex(e=>e.question_id===t.id);var i=B.findIndex(e=>e.question_id===n.id);U(r,i)};(0,o.useEffect)(()=>{if(_.current){_.current.style.maxHeight="".concat(window.innerHeight-_.current.getBoundingClientRect().top,"px")}// eslint-disable-next-line react-hooks/exhaustive-deps
},[_.current,t]);if(!A.getValues("quiz_title")){return null}return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:f_.questionsLabel,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:(0,v.__)("Questions","tutor")}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:f_.questionActions,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:I!=="tutor_h5p_quiz",children:/*#__PURE__*/(0,a/* .jsx */.Y)(vu,{})}),/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{type:"button",size:"small","data-cy":"add-question",ref:w,"aria-label":(0,v.__)("Add question","tutor"),isIconOnly:true,icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"plus",width:20,height:20}),onClick:()=>{if(I==="tutor_h5p_quiz"){j({component:ej,props:{title:(0,v.__)("Select H5P Content","tutor"),onAddContent:e=>{J(e)},contentType:"tutor_h5p_quiz",addedContentIds:G.map(e=>e.question_description)}})}else{g(true)}}})]})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{ref:_,css:f_.questionList,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:G.length>0,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:f_.emptyQuestionText,children:(0,v.__)("No questions added yet.","tutor")}),children:/*#__PURE__*/(0,a/* .jsxs */.FD)(d/* .DndContext */.Mp,{sensors:V,collisionDetection:d/* .closestCenter */.fp,modifiers:[c/* .restrictToWindowEdges */.Q_],onDragStart:e=>{u(e.active.id)},onDragEnd:e=>en(e),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(p/* .SortableContext */.gB,{items:G.map(e=>(0,i._)((0,r._)({},e),{id:e.question_id})),strategy:p/* .verticalListSortingStrategy */._G,children:/*#__PURE__*/(0,a/* .jsx */.Y)(b/* ["default"] */.A,{each:G,children:(e,t)=>/*#__PURE__*/(0,a/* .jsx */.Y)(v_,{question:e,index:t,onDuplicateQuestion:e=>{ee(e,t)},onRemoveQuestion:()=>et(t,e)},e.question_id)})}),/*#__PURE__*/(0,l.createPortal)(/*#__PURE__*/(0,a/* .jsx */.Y)(d/* .DragOverlay */.Hd,{children:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:Q,children:e=>{var t=B.findIndex(t=>t.question_id===e.question_id);return/*#__PURE__*/(0,a/* .jsx */.Y)(v_,{question:e,index:t,onDuplicateQuestion:k/* .noop */.lQ,onRemoveQuestion:k/* .noop */.lQ,isOverlay:true},e.question_id)}})}),document.body)]})}),/*#__PURE__*/(0,a/* .jsx */.Y)(R/* ["default"] */.A,{gap:4,maxWidth:"340px",placement:O/* .CURRENT_VIEWPORT.isAboveTablet */.vN.isAboveTablet?K/* .POPOVER_PLACEMENTS.BOTTOM */.zA.BOTTOM:O/* .CURRENT_VIEWPORT.isAboveMobile */.vN.isAboveMobile?K/* .POPOVER_PLACEMENTS.LEFT */.zA.LEFT:K/* .POPOVER_PLACEMENTS.ABSOLUTE_CENTER */.zA.ABSOLUTE_CENTER,triggerRef:w,isOpen:h,closePopover:()=>g(false),animationType:N/* .AnimationType.slideUp */.J6.slideUp,border:true,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:f_.questionOptionsWrapper,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:f_.questionTypeColumns,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:f_.questionTypeColumn,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:f_.questionTypeColumnTitle,children:(0,v.__)("Interactive","tutor")}),n.interactive.map(e=>/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:e.isPro&&!ff,fallback:/*#__PURE__*/(0,a/* .jsxs */.FD)("button",{type:"button",css:f_.questionTypeOption,title:e.label,disabled:e.isLegacyDisabled,onClick:()=>{X(e.value)},children:[/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{"data-question-icon":true,name:e.icon,width:24,height:24}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:f_.questionTypeOptionLabelRow,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:f_.questionTypeOptionLabel,children:e.label}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:e.isLegacyDisabled,children:/*#__PURE__*/(0,a/* .jsx */.Y)(M/* ["default"] */.A,{content:(0,v.__)("Not available in legacy learning mode","tutor"),placement:"top",wrapperCss:Y/* .styleUtils.flexCenter */.x.flexCenter(),children:/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:f_.legacyInfoIcon,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"infoOctagon",width:12,height:12})})})})]})]}),children:/*#__PURE__*/(0,a/* .jsxs */.FD)("button",{type:"button",css:f_.questionTypeOption,title:e.label,disabled:true,onClick:k/* .noop */.lQ,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{"data-question-icon":true,name:e.icon,width:24,height:24}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:f_.questionTypeOptionLabelRow,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:f_.questionTypeOptionLabel,children:e.label}),/*#__PURE__*/(0,a/* .jsx */.Y)(T/* ["default"] */.A,{size:"small",content:(0,v.__)("Pro","tutor")})]})]})},e.value))]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:f_.questionTypeColumn,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:f_.questionTypeColumnTitle,children:(0,v.__)("Basic","tutor")}),n.basic.map(e=>/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:e.isPro&&!ff,fallback:/*#__PURE__*/(0,a/* .jsxs */.FD)("button",{type:"button",css:f_.questionTypeOption,title:e.label,disabled:e.isLegacyDisabled,onClick:()=>{X(e.value)},children:[/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{"data-question-icon":true,name:e.icon,width:24,height:24}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:f_.questionTypeOptionLabelRow,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:f_.questionTypeOptionLabel,children:e.label}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:e.isLegacyDisabled,children:/*#__PURE__*/(0,a/* .jsx */.Y)(M/* ["default"] */.A,{content:(0,v.__)("Not available in legacy learning mode","tutor"),placement:"top",wrapperCss:Y/* .styleUtils.flexCenter */.x.flexCenter(),children:/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:f_.legacyInfoIcon,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"info",width:16,height:16})})})})]})]}),children:/*#__PURE__*/(0,a/* .jsxs */.FD)("button",{type:"button",css:f_.questionTypeOption,title:e.label,disabled:true,onClick:k/* .noop */.lQ,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{"data-question-icon":true,name:e.icon,width:24,height:24}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:f_.questionTypeOptionLabelRow,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:f_.questionTypeOptionLabel,children:e.label}),/*#__PURE__*/(0,a/* .jsx */.Y)(T/* ["default"] */.A,{size:"small",content:(0,v.__)("Pro","tutor")})]})]})},e.value))]})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!ff,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:(0,k/* .isAddonEnabled */.GR)(O/* .Addons.CONTENT_BANK */.oW.CONTENT_BANK),children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:f_.addFormContentBankButton,children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"secondary",size:"small",onClick:()=>{j({component:fc,props:{title:(0,v.__)("Content Bank","tutor"),type:"question",onAddContent:e=>{Z(e)}}});g(false)},icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"contentBank",width:24,height:24}),"data-cy":"add-from-content-bank",children:(0,v.__)("Add from Content Bank","tutor")})})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:f_.addFormContentBankButton,children:/*#__PURE__*/(0,a/* .jsx */.Y)(T/* ["default"] */.A,{size:"small",children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{disabled:true,variant:"secondary",size:"small",onClick:k/* .noop */.lQ,icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"contentBank",width:24,height:24}),children:(0,v.__)("Add from Content Bank","tutor")})})})})]})})]})]})};/* export default */const fm=fg;var f_={questionsLabel:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;gap:",_/* .spacing["4"] */.YK["4"],";align-items:center;justify-content:space-between;border-bottom:1px solid ",_/* .colorTokens.stroke.divider */.I6.stroke.divider,";padding:",_/* .spacing["16"] */.YK["16"]," ",_/* .spacing["16"] */.YK["16"]," ",_/* .spacing["16"] */.YK["16"]," ",_/* .spacing["28"] */.YK["28"],";",F/* .typography.caption */.I.caption("medium"),";color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";",_/* .Breakpoint.smallMobile */.EA.smallMobile,"{padding:",_/* .spacing["16"] */.YK["16"],";}"),questionActions:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;align-items:center;gap:",_/* .spacing["4"] */.YK["4"],";[data-generate-quiz-button]{border:1px solid ",_/* .colorTokens.stroke.divider */.I6.stroke.divider,";}"),questionList:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.overflowYAuto */.x.overflowYAuto,";scrollbar-gutter:auto;padding:",_/* .spacing["8"] */.YK["8"]," 0 ",_/* .spacing["8"] */.YK["8"]," 0;"),questionTypeOptionsTitle:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.caption */.I.caption("medium"),";color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";padding:",_/* .spacing["8"] */.YK["8"]," ",_/* .spacing["16"] */.YK["16"]," ",_/* .spacing["8"] */.YK["8"]," ",_/* .spacing["20"] */.YK["20"],";border-bottom:1px solid ",_/* .colorTokens.stroke.divider */.I6.stroke.divider,";"),addFormContentBankButton:/*#__PURE__*/(0,h/* .css */.AH)("padding:",_/* .spacing["6"] */.YK["6"]," ",_/* .spacing["12"] */.YK["12"],";button{width:100%;}"),questionOptionsWrapper:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;flex-direction:column;padding-block:",_/* .spacing["6"] */.YK["6"],";"),questionTypeColumns:/*#__PURE__*/(0,h/* .css */.AH)("display:grid;grid-template-columns:1fr 1fr;padding-block:",_/* .spacing["6"] */.YK["6"],";"),questionTypeColumn:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;flex-direction:column;min-width:0;padding-inline:",_/* .spacing["8"] */.YK["8"],";"),questionTypeColumnTitle:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.small */.I.small("regular"),";color:",_/* .colorTokens.text.title */.I6.text.title,";padding-left:",_/* .spacing["4"] */.YK["4"],";margin-bottom:",_/* .spacing["12"] */.YK["12"],";"),questionTypeOption:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.resetButton */.x.resetButton,";color:",_/* .colorTokens.text.hints */.I6.text.hints,";width:100%;padding:",_/* .spacing["2"] */.YK["2"],";transition:background-color 0.3s ease-in-out;display:flex;align-items:center;gap:",_/* .spacing["8"] */.YK["8"],";border:2px solid transparent;border-radius:",_/* .borderRadius["6"] */.Vq["6"],";&:not(:last-of-type){margin-bottom:",_/* .spacing["4"] */.YK["4"],";}[data-question-icon]{flex-shrink:0;}&:enabled{&:focus,&:active,&:hover{background-color:",_/* .colorTokens.background.hover */.I6.background.hover,";color:",_/* .colorTokens.text.title */.I6.text.title,";}}:disabled{cursor:not-allowed;[data-question-icon]{filter:grayscale(100%);}}:focus:enabled,:active:enabled{border-color:",_/* .colorTokens.stroke.brand */.I6.stroke.brand,";}"),questionTypeOptionLabel:/*#__PURE__*/(0,h/* .css */.AH)("white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"),questionTypeOptionLabelRow:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;gap:",_/* .spacing["4"] */.YK["4"],";width:100%;min-width:0;> div{flex-shrink:0;}"),emptyQuestionText:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.small */.I.small(),";color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";padding:",_/* .spacing["8"] */.YK["8"]," ",_/* .spacing["16"] */.YK["16"]," ",_/* .spacing["8"] */.YK["8"]," ",_/* .spacing["28"] */.YK["28"],";"),legacyInfoIcon:/*#__PURE__*/(0,h/* .css */.AH)("display:inline-flex;align-items:center;flex-shrink:0;color:",_/* .colorTokens.icon.brand */.I6.icon.brand,";")};// EXTERNAL MODULE: ./assets/src/js/v3/shared/components/fields/FormInputWithPresets.tsx
var fb=n(15402);// CONCATENATED MODULE: ./assets/src/js/v3/public/images/quiz-fullpage.svg
var fy,fw,fx;function fA(){return fA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fA.apply(null,arguments)}var fY=function e(e){return /*#__PURE__*/o.createElement("svg",fA({xmlns:"http://www.w3.org/2000/svg",width:74,height:94,fill:"none"},e),fy||(fy=/*#__PURE__*/o.createElement("g",{clipPath:"url(#quiz-fullpage_svg__a)"},/*#__PURE__*/o.createElement("path",{fill:"#fff",d:"M1 7a6 6 0 0 1 6-6h60a6 6 0 0 1 6 6v80a6 6 0 0 1-6 6H7a6 6 0 0 1-6-6z"}),/*#__PURE__*/o.createElement("path",{fill:"currentColor",d:"M62 51.5v.5H12v-.5zm1.5-1.5v-5a1.5 1.5 0 0 0-1.5-1.5H12a1.5 1.5 0 0 0-1.5 1.5v5a1.5 1.5 0 0 0 1.5 1.5v.5l-.204-.01a2 2 0 0 1-1.785-1.786L10 50v-5a2 2 0 0 1 2-2h50a2 2 0 0 1 2 2v5a2 2 0 0 1-1.796 1.99L62 52v-.5a1.5 1.5 0 0 0 1.5-1.5M10 14.25c0-.69.56-1.25 1.25-1.25h42.875a1.25 1.25 0 1 1 0 2.5H11.25c-.69 0-1.25-.56-1.25-1.25m0 6.5c0-.69.56-1.25 1.25-1.25h22.042a1.25 1.25 0 0 1 0 2.5H11.25c-.69 0-1.25-.56-1.25-1.25m27.542 0c0-.69.56-1.25 1.25-1.25h22.041a1.25 1.25 0 1 1 0 2.5H38.792c-.69 0-1.25-.56-1.25-1.25M10 26.25c0-.69.56-1.25 1.25-1.25h22.042a1.25 1.25 0 0 1 0 2.5H11.25c-.69 0-1.25-.56-1.25-1.25m27.542 0c0-.69.56-1.25 1.25-1.25h22.041a1.25 1.25 0 1 1 0 2.5H38.792c-.69 0-1.25-.56-1.25-1.25M10 37.75c0-.69.56-1.25 1.25-1.25h34.5a1.25 1.25 0 1 1 0 2.5h-34.5c-.69 0-1.25-.56-1.25-1.25m0 24.5c0-.69.56-1.25 1.25-1.25h51.5a1.25 1.25 0 1 1 0 2.5h-51.5c-.69 0-1.25-.56-1.25-1.25M10 69a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0m4 0a1.5 1.5 0 0 1 1.5-1.5h12a1.5 1.5 0 0 1 0 3h-12A1.5 1.5 0 0 1 14 69m19 0a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0m4 0a1.5 1.5 0 0 1 1.5-1.5h12a1.5 1.5 0 0 1 0 3h-12A1.5 1.5 0 0 1 37 69M10 80.75c0-.69.56-1.25 1.25-1.25h51.5a1.25 1.25 0 1 1 0 2.5h-51.5c-.69 0-1.25-.56-1.25-1.25m0 5.45a1.2 1.2 0 0 1 1.2-1.2h23.6a1.2 1.2 0 0 1 1.2 1.2v18.6a1.2 1.2 0 0 1-1.2 1.2H11.2a1.2 1.2 0 0 1-1.2-1.2zm27.2 0a1.2 1.2 0 0 1 1.2-1.2H62a1.2 1.2 0 0 1 1.2 1.2v18.6A1.2 1.2 0 0 1 62 106H38.4a1.2 1.2 0 0 1-1.2-1.2z"}))),fw||(fw=/*#__PURE__*/o.createElement("path",{stroke:"transparent",d:"M67 .5A6.5 6.5 0 0 1 73.5 7v80a6.5 6.5 0 0 1-6.5 6.5H7A6.5 6.5 0 0 1 .5 87V7A6.5 6.5 0 0 1 7 .5z"})),fx||(fx=/*#__PURE__*/o.createElement("defs",null,/*#__PURE__*/o.createElement("clipPath",{id:"quiz-fullpage_svg__a"},/*#__PURE__*/o.createElement("path",{fill:"#fff",d:"M1 7a6 6 0 0 1 6-6h60a6 6 0 0 1 6 6v80a6 6 0 0 1-6 6H7a6 6 0 0 1-6-6z"})))))};/* export default */const fk=fY;// CONCATENATED MODULE: ./assets/src/js/v3/public/images/quiz-single-question.svg
var fI,fq,fC;function fD(){return fD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fD.apply(null,arguments)}var fE=function e(e){return /*#__PURE__*/o.createElement("svg",fD({xmlns:"http://www.w3.org/2000/svg",width:74,height:94,fill:"none"},e),fI||(fI=/*#__PURE__*/o.createElement("path",{fill:"#fff",d:"M67 .5A6.5 6.5 0 0 1 73.5 7v80a6.5 6.5 0 0 1-6.5 6.5H7A6.5 6.5 0 0 1 .5 87V7A6.5 6.5 0 0 1 7 .5z"})),fq||(fq=/*#__PURE__*/o.createElement("path",{stroke:"transparent",d:"M67 .5A6.5 6.5 0 0 1 73.5 7v80a6.5 6.5 0 0 1-6.5 6.5H7A6.5 6.5 0 0 1 .5 87V7A6.5 6.5 0 0 1 7 .5z"})),fC||(fC=/*#__PURE__*/o.createElement("path",{fill:"currentColor",d:"M10 29.979a1 1 0 0 1 1-1h52a1 1 0 1 1 0 2H11a1 1 0 0 1-1-1m0 5.2a1.2 1.2 0 0 1 1.2-1.2h10.2a1.2 1.2 0 0 1 1.2 1.2v9.6a1.2 1.2 0 0 1-1.2 1.2H11.2a1.2 1.2 0 0 1-1.2-1.2zm13.8 0a1.2 1.2 0 0 1 1.2-1.2h10.2a1.2 1.2 0 0 1 1.2 1.2v9.6a1.2 1.2 0 0 1-1.2 1.2H25a1.2 1.2 0 0 1-1.2-1.2zm13.8 0a1.2 1.2 0 0 1 1.2-1.2H49a1.2 1.2 0 0 1 1.2 1.2v9.6a1.2 1.2 0 0 1-1.2 1.2H38.8a1.2 1.2 0 0 1-1.2-1.2zm13.8 0a1.2 1.2 0 0 1 1.2-1.2h10.2a1.2 1.2 0 0 1 1.2 1.2v9.6a1.2 1.2 0 0 1-1.2 1.2H52.6a1.2 1.2 0 0 1-1.2-1.2zM33.834 72.511a.45.45 0 0 1 0 .635l-1.747 1.748 1.747 1.747a.449.449 0 1 1-.635.635l-2.067-2.067a.45.45 0 0 1 0-.635l2.067-2.067a.453.453 0 0 1 .635.004m6.332 0a.45.45 0 0 0 0 .635l1.747 1.748-1.747 1.747a.449.449 0 1 0 .635.635l2.067-2.067a.45.45 0 0 0 0-.635l-2.067-2.067a.453.453 0 0 0-.635.004"})))};/* export default */const fS=fE;// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/curriculum/FormQuizLayoutSelect.tsx
function fz(){var e=(0,I._)(["\n      opacity: 0.5;\n    "]);fz=function t(){return e};return e}var fT=e=>{var{field:t,label:n,description:r,options:i=[],disabled:s=false}=e;var l=(0,o.useRef)([]);var u=(0,o.useMemo)(()=>i.findIndex(e=>e.value===t.value),[t.value,i]);var d=u>=0?u:0;var c=(0,o.useCallback)((e,t)=>{if(!i.length){return-1}var n=e;for(var r=0;r<i.length;r++){var a;n=(n+t+i.length)%i.length;if(!((a=i[n])===null||a===void 0?void 0:a.disabled)){return n}}return-1},[i]);var p=(0,o.useCallback)(e=>{var n,r;if(e<0||((n=i[e])===null||n===void 0?void 0:n.disabled)){return}t.onChange(i[e].value);(r=l.current[e])===null||r===void 0?void 0:r.focus()},[t,i]);var h=(0,o.useCallback)((e,t)=>{if(s){return}if(e.key===" "||e.key==="Enter"){e.preventDefault();p(t);return}if(e.key==="ArrowRight"||e.key==="ArrowDown"){e.preventDefault();var n=c(t,1);p(n);return}if(e.key==="ArrowLeft"||e.key==="ArrowUp"){e.preventDefault();var r=c(t,-1);p(r);return}},[s,p,c]);return/*#__PURE__*/(0,a/* .jsxs */.FD)("section",{css:fH.wrapper(s),children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fH.content,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{"data-title":true,children:n}),r&&/*#__PURE__*/(0,a/* .jsx */.Y)("div",{"data-subtitle":true,children:r})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:fH.options,role:"radiogroup","aria-label":n,children:i.map((e,n)=>{var r=t.value===e.value;return/*#__PURE__*/(0,a/* .jsxs */.FD)("button",{type:"button",ref:e=>{l.current[n]=e},role:"radio","aria-checked":r,tabIndex:n===d?0:-1,css:fH.item(r),onClick:()=>t.onChange(e.value),onKeyDown:e=>h(e,n),disabled:s||e.disabled,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:fH.preview(r),"data-preview":true,children:e.image}),/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:e.label})]},String(e.value))})})]})};/* export default */const fM=fT;var fH={wrapper:e=>/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("row"),";justify-content:space-between;align-items:flex-start;gap:",_/* .spacing["16"] */.YK["16"],";width:100%;",e&&(0,h/* .css */.AH)(fz())," ",_/* .Breakpoint.smallMobile */.EA.smallMobile,"{flex-direction:column;align-items:stretch;}"),content:/*#__PURE__*/(0,h/* .css */.AH)("max-width:220px;[data-title]{",F/* .typography.caption */.I.caption("regular"),";color:",_/* .colorTokens.text.title */.I6.text.title,";margin:0;}[data-subtitle]{",F/* .typography.small */.I.small(),";color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";margin-top:",_/* .spacing["2"] */.YK["2"],";}"),options:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("row"),";gap:",_/* .spacing["12"] */.YK["12"],";",_/* .Breakpoint.smallMobile */.EA.smallMobile,"{width:100%;justify-content:space-between;}"),item:e=>/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.resetButton */.x.resetButton,";",Y/* .styleUtils.display.flex */.x.display.flex("column"),";align-items:center;gap:",_/* .spacing["8"] */.YK["8"],";cursor:pointer;color:",_/* .colorTokens.icon["default"] */.I6.icon["default"],";transition:color 0.2s ease;span{",F/* .typography.small */.I.small("regular"),";color:",e?_/* .colorTokens.text.title */.I6.text.title:_/* .colorTokens.text.subdued */.I6.text.subdued,";text-align:center;}&:focus-visible{[data-preview]{outline:2px solid ",_/* .colorTokens.stroke.brand */.I6.stroke.brand,";color:#dae3fa;}}&:hover [data-preview]{outline:2px solid ",e?_/* .colorTokens.stroke.brand */.I6.stroke.brand:"#DAE3FA",";color:#dae3fa;}"),preview:e=>/*#__PURE__*/(0,h/* .css */.AH)("width:72px;height:92px;border-radius:",_/* .borderRadius["8"] */.Vq["8"],";outline:2px solid ",e?_/* .colorTokens.stroke.brand */.I6.stroke.brand:"#DAE3FA",";color:",e?"#DAE3FA":_/* .colorTokens.stroke["default"] */.I6.stroke["default"],";background-color:",_/* .colorTokens.background.white */.I6.background.white,";overflow:hidden;")};// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/curriculum/QuizSettings.tsx
function fP(){var e=(0,I._)(["\n      min-height: ",";\n    "]);fP=function t(){return e};return e}function fO(){var e=(0,I._)(["\n      justify-content: flex-end;\n\n      [data-prefix] {\n        ",";\n        color: ",";\n      }\n    "]);fO=function t(){return e};return e}var fF=(0,eg/* .getCourseId */.p)();var fN=(e,t)=>{var n={seconds:1,minutes:60,hours:60*60,days:60*60*24,weeks:60*60*24*7};return e*n[t]};var fK=e=>{if(e<60){return(0,v.sprintf)((0,v.__)("%ss per question","tutor"),e)}if(e<60*60){return(0,v.sprintf)((0,v.__)("%sm per question","tutor"),Math.round(e/60*10)/10)}return(0,v.sprintf)((0,v.__)("%sh per question","tutor"),Math.round(e/(60*60)*10)/10)};var fW=e=>{switch(e){case"shape":return"quizShape";case"number":return"quizNumber";case"radio":return"quizRadio";default:return"quizShape"}};var fR=e=>{var{contentDripType:t}=e;var n;var{quizId:o,contentType:s}=cv();var l=(0,S/* .useFormContext */.xW)();var u=((n=P/* .tutorConfig.settings */.P.settings)===null||n===void 0?void 0:n.learning_mode)==="legacy";var d=l.watch("questions");var c=d.length;var p=d.some(e=>e.question_type==="open_ended");var h=d.some(e=>e.question_type==="short_answer");var f=l.watch("quiz_option.limit_attempts_allowed");var g=(0,k/* .isAddonEnabled */.GR)(O/* .Addons.CONTENT_DRIP */.oW.CONTENT_DRIP)&&t==="unlock_sequentially"&&f;var _=l.watch("quiz_option.limit_questions_to_answer");var b=l.watch("quiz_option.enable_time_limit");var w=l.watch("quiz_option.questions_order");var A=_?Math.min(Number(l.watch("quiz_option.max_questions_for_answer")),c)||c:c;var Y=A/c*100;var I=(()=>{if(w==="rand"){return d}if(w==="sorting"){return d}if(w==="asc"){return[...d].sort((e,t)=>Number(e.question_id)-Number(t.question_id))}if(w==="desc"){return[...d].sort((e,t)=>Number(t.question_id)-Number(e.question_id))}return d})();var q=_?I.slice(0,A):I;var C=q.length;var D=Number(l.watch("quiz_option.passing_grade"));var E=q.reduce((e,t)=>e+Number(t.question_settings.question_mark||0),0);var T=Math.ceil(D/100*E);var H=(()=>{if(w==="rand"){return"-"}if(T<=0){return 0}var e=0;for(var[t,n]of q.entries()){e+=Number(n.question_settings.question_mark||0);if(e>=T){return t+1}}return C})();var F=Number(l.watch("quiz_option.time_limit.time_value"));var N=l.watch("quiz_option.time_limit.time_type");var K=C>0?Math.floor(fN(F,N)/C):0;var W=(0,z/* .useQueryClient */.jE)();var R=W.getQueryData(["Topic",fF]);return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fU.settings,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fU.left,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fU.card,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("h5",{children:(0,v.__)("Quiz scope","tutor")}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fU.innerCard,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"quiz_option.passing_grade",control:l.control,rules:(0,i._)((0,r._)({},(0,ep/* .requiredRule */.WN)()),{validate:e=>{if(e>100){return(0,v.__)("Passing grade cannot be greater than 100","tutor")}if(e<0){return(0,v.__)("Passing grade cannot be less than 0","tutor")}return true}}),render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(Q/* ["default"] */.A,(0,i._)((0,r._)({},e),{isInlineLabel:true,size:"small",type:"number",label:(0,v.__)("Passing Grade","tutor"),helpText:(0,v.__)("Set the minimum score percentage required to pass this quiz","tutor"),wrapperCss:fU.maxWidth("67px"),content:"%",contentPosition:"right",showVerticalBar:false}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"quiz_option.questions_order",control:l.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(G/* ["default"] */.A,(0,i._)((0,r._)({},e),{isInlineLabel:true,size:"small",wrapperCss:fU.maxWidth("124px"),label:(0,v.__)("Question Order","tutor"),placeholder:(0,v.__)("Select an option","tutor"),options:[{label:(0,v.__)("Random","tutor"),value:"rand"},{label:(0,v.__)("Sorting","tutor"),value:"sorting"},{label:(0,v.__)("Ascending","tutor"),value:"asc"},{label:(0,v.__)("Descending","tutor"),value:"desc"}]}))}),/*#__PURE__*/(0,a/* .jsx */.Y)("hr",{}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fU.inlineForm({minHeight:"32px"}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"quiz_option.limit_attempts_allowed",control:l.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(h9/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,v.__)("Allow multiple attempts","tutor"),helpText:(0,v.__)("Set the number of attempts allowed for this quiz. 0 means unlimited.","tutor")}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:l.watch("quiz_option.limit_attempts_allowed"),children:/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"quiz_option.attempts_allowed",control:l.control,rules:(0,i._)((0,r._)({},(0,ep/* .requiredRule */.WN)()),{validate:e=>{if(e>=0){return true}return(0,v.__)("Allowed attempts must be greater than or equal to 0","tutor")}}),render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(V/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"number",size:"small",selectOnFocus:true,isInlineLabel:true,style:fU.maxWidth("99px"),formFieldWrapperCss:fU.width("auto"),inputContainerCss:fU.justifyContent("flex-end")}))})})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)(y/* ["default"] */.A,{when:s!=="tutor_h5p_quiz",children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fU.inlineForm({minHeight:"32px"}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"quiz_option.limit_questions_to_answer",control:l.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(h9/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,v.__)("Set maximum questions per quiz","tutor"),helpText:(0,v.__)("Set the number of quiz questions randomly from your question pool. If the set number exceeds available questions, all questions will be included","tutor")}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:_,children:/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"quiz_option.max_questions_for_answer",rules:(0,i._)((0,r._)({},(0,ep/* .requiredRule */.WN)()),{validate:e=>{if(e<=0){return(0,v.__)("Question limit must be greater than 0","tutor")}return true}}),control:l.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(V/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"number",size:"small",isInlineLabel:true,selectOnFocus:true,style:fU.maxWidth("99px"),formFieldWrapperCss:fU.width("auto"),inputContainerCss:fU.justifyContent("flex-end")}))})})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:g,children:/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:l.control,name:"quiz_option.pass_is_required",render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)($/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,v.__)("Pass is required","tutor")}))})})]})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("h5",{children:(0,v.__)("Timing","tutor")}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fU.innerCard,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)(y/* ["default"] */.A,{when:s!=="tutor_h5p_quiz",children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fU.inlineForm({minHeight:"32px"}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"quiz_option.enable_time_limit",control:l.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(h9/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,v.__)("Set time limit","tutor")}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:l.watch("quiz_option.enable_time_limit"),children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fU.timeLimit,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"quiz_option.time_limit.time_value",control:l.control,rules:(0,i._)((0,r._)({},(0,ep/* .requiredRule */.WN)()),{validate:e=>{if(e<=0){return(0,v.__)("Time limit must be greater than 0","tutor")}return true}}),render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(V/* ["default"] */.A,(0,i._)((0,r._)({},e),{size:"small",type:"number",selectOnFocus:true,dataAttribute:"data-time-limit"}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"quiz_option.time_limit.time_type",control:l.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(G/* ["default"] */.A,(0,i._)((0,r._)({},e),{dataAttribute:"data-time-limit-unit",size:"small",options:[{label:(0,v.__)("Sec","tutor"),value:"seconds"},{label:(0,v.__)("Min","tutor"),value:"minutes"},{label:(0,v.__)("Hour","tutor"),value:"hours"},{label:(0,v.__)("Days","tutor"),value:"days"},{label:(0,v.__)("Weeks","tutor"),value:"weeks"}]}))})]})})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:l.watch("quiz_option.enable_time_limit"),children:/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"quiz_option.hide_quiz_time_display",control:l.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)($/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,v.__)("Hide countdown timer","tutor")}))})}),/*#__PURE__*/(0,a/* .jsx */.Y)("hr",{})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fU.inlineForm({minHeight:"34px"}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"quiz_option.quiz_auto_start",control:l.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(h9/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,v.__)("Auto start quiz","tutor")}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:l.watch("quiz_option.quiz_auto_start"),children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fU.inlineForm({withPrefix:true}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{"data-prefix":true,children:(0,v.__)("After","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"quiz_option.auto_start_delay",control:l.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(fb/* ["default"] */.A,(0,i._)((0,r._)({},e),{size:"small",content:(0,v.__)("secs","tutor"),contentPosition:"right",wrapperCss:fU.maxWidth("80px"),contentCss:fU.minWidth("fit-content"),formFieldWrapperCss:fU.width("auto"),showVerticalBar:false,presetOptions:[{label:(0,v.__)("2","tutor"),value:"2"},{label:(0,v.__)("5","tutor"),value:"5"},{label:(0,v.__)("7","tutor"),value:"7"},{label:(0,v.__)("10","tutor"),value:"10"}]}))})]})})]})]})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:s!=="tutor_h5p_quiz",children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fU.card,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("h5",{children:(0,v.__)("Navigation & Display","tutor")}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fU.innerCard,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:l.control,name:"quiz_option.question_layout_view",render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(fM,(0,i._)((0,r._)({},e),{label:(0,v.__)("Layout","tutor"),description:(0,v.__)("Choose how students will answer the questions.","tutor"),options:[{label:(0,v.__)("Single Question","tutor"),value:"single_question",image:/*#__PURE__*/(0,a/* .jsx */.Y)(fS,{width:72,height:92})},{label:(0,v.__)("Full Page","tutor"),value:"question_below_each_other",image:/*#__PURE__*/(0,a/* .jsx */.Y)(fk,{width:72,height:92})}]}))}),/*#__PURE__*/(0,a/* .jsxs */.FD)(y/* ["default"] */.A,{when:l.watch("quiz_option.question_layout_view")==="single_question",children:[/*#__PURE__*/(0,a/* .jsx */.Y)("hr",{}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fU.inlineForm({minHeight:"34px"}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:l.control,name:"quiz_option.enable_pagination",render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(h9/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,v.__)("Show pagination","tutor"),helpText:u?(0,v.__)("Pagination style is unavailable while learning mode is set to Legacy.","tutor"):undefined}))}),/*#__PURE__*/(0,a/* .jsxs */.FD)(y/* ["default"] */.A,{when:l.watch("quiz_option.enable_pagination"),children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:fU.paginationIcons,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:fW(l.watch("quiz_option.pagination_type")),width:40,height:32})}),/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:l.control,name:"quiz_option.pagination_type",render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(G/* ["default"] */.A,(0,i._)((0,r._)({},e),{size:"small",isInlineLabel:true,disabled:u,options:[{label:(0,v.__)("Shapes","tutor"),value:"shape"},{label:(0,v.__)("Numbers","tutor"),value:"number"},{label:(0,v.__)("Radio","tutor"),value:"radio"}]}))})]})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fU.inlineForm,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:l.control,name:"quiz_option.enable_answer_reveal",render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(h9/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,v.__)("Reveal answers after submission","tutor")}))}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:l.watch("quiz_option.enable_answer_reveal"),children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fU.inlineForm({withPrefix:true}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{"data-prefix":true,children:(0,v.__)("For","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"quiz_option.answers_reveal_duration",control:l.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(fb/* ["default"] */.A,(0,i._)((0,r._)({},e),{size:"small",content:(0,v.__)("secs","tutor"),contentPosition:"right",wrapperCss:fU.maxWidth("80px"),contentCss:fU.minWidth("fit-content"),formFieldWrapperCss:fU.width("auto"),showVerticalBar:false,presetOptions:[{label:(0,v.__)("2","tutor"),value:"2"},{label:(0,v.__)("5","tutor"),value:"5"},{label:(0,v.__)("7","tutor"),value:"7"},{label:(0,v.__)("10","tutor"),value:"10"}]}))})]})})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("hr",{}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!l.watch("quiz_option.enable_pagination"),children:/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:l.control,name:"quiz_option.hide_previous_button",render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)($/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,v.__)('Hide "Previous" button',"tutor")}))})}),/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:l.control,name:"quiz_option.hide_question_number_overview",render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)($/* ["default"] */.A,(0,i._)((0,r._)({},e),{label:(0,v.__)("Hide question number","tutor")}))})]})]})]})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:(0,k/* .isAddonEnabled */.GR)(O/* .Addons.CONTENT_DRIP */.oW.CONTENT_DRIP)&&t||p||h,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fU.card,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)(y/* ["default"] */.A,{when:p||h,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("h5",{children:(0,v.__)("Character Limits","tutor")}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fU.innerCard,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:p,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:fU.inlineForm,children:/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"quiz_option.open_ended_answer_characters_limit",control:l.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(V/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"number",isInlineLabel:true,size:"small",style:fU.maxWidth("80px"),label:(0,v.__)("Open-Ended/Essay Answer","tutor"),helpText:(0,v.__)("Set the number of characters allowed for open-ended/essay answers. Leave empty to disable.","tutor"),selectOnFocus:true}))})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:h,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:fU.inlineForm,children:/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"quiz_option.short_answer_characters_limit",control:l.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(V/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"number",size:"small",style:fU.maxWidth("80px"),isInlineLabel:true,label:(0,v.__)("Short Answer","tutor"),helpText:(0,v.__)("Set the number of characters allowed for short answers. Leave empty to disable.","tutor"),selectOnFocus:true}))})})})]})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)(y/* ["default"] */.A,{when:(0,k/* .isAddonEnabled */.GR)(O/* .Addons.CONTENT_DRIP */.oW.CONTENT_DRIP)&&s!=="tutor_h5p_quiz",children:[/*#__PURE__*/(0,a/* .jsxs */.FD)(y/* ["default"] */.A,{when:t==="unlock_by_date",children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("h5",{css:fU.contentDripLabel,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"contentDrip",height:24,width:24}),(0,v.__)("Unlock Date","tutor"),/*#__PURE__*/(0,a/* .jsx */.Y)(M/* ["default"] */.A,{content:(0,v.__)("Set the date when the quiz will be available.","tutor"),children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"info",width:20,height:20})})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:fU.innerCard,children:/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"quiz_option.content_drip_settings.unlock_date",control:l.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(B/* ["default"] */.A,(0,i._)((0,r._)({},e),{placeholder:(0,v.__)("Select Unlock Date","tutor")}))})})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)(y/* ["default"] */.A,{when:t==="after_finishing_prerequisites",children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("h5",{css:fU.contentDripLabel,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"contentDrip",height:24,width:24}),(0,v.__)("Prerequisites","tutor"),/*#__PURE__*/(0,a/* .jsx */.Y)(M/* ["default"] */.A,{content:(0,v.__)("Select items that should be complete before this item","tutor"),children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"info",width:20,height:20})})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:fU.innerCard,children:/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"quiz_option.content_drip_settings.prerequisites",control:l.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(es,(0,i._)((0,r._)({},e),{placeholder:(0,v.__)("Select Prerequisite","tutor"),options:R.reduce((e,t)=>{e.push((0,i._)((0,r._)({},t),{contents:t.contents.filter(e=>String(e.ID)!==String(o))}));return e},[])||[],isSearchable:true}))})})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)(y/* ["default"] */.A,{when:t==="specific_days",children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("h5",{css:fU.contentDripLabel,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"contentDrip",height:24,width:24}),(0,v.__)("Available after days","tutor"),/*#__PURE__*/(0,a/* .jsx */.Y)(M/* ["default"] */.A,{content:(0,v.__)("This quiz will be available after the given number of days.","tutor"),children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"info",width:20,height:20})})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:fU.innerCard,children:/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{name:"quiz_option.content_drip_settings.after_xdays_of_enroll",control:l.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(V/* ["default"] */.A,(0,i._)((0,r._)({},e),{type:"number",placeholder:"0",selectOnFocus:true}))})})]})]})]})}),/*#__PURE__*/(0,a/* .jsx */.Y)(eh/* ["default"] */.A,{section:"Curriculum.Quiz.bottom_of_settings",form:l})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fU.overview,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fU.questionPool,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{"data-question-pool":true,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{"data-question-pool-label":true,children:(0,v.__)("Total questions in pool","tutor")}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{"data-question-count":true,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:d.length}),/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:(0,v.__)("Q","tutor")})]})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"arrowRight2",width:24,height:24}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{"data-question-pool":true,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{"data-question-pool-label":true,children:(0,v.__)("Available to answer","tutor")}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{"data-question-count":true,"data-available-count":true,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:A}),/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:(0,v.__)("Q","tutor")})]})]})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fU.questionPoolBar(Y+"%"),children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{"data-question-pool-bar":true}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{children:(0,v.sprintf)((0,v.__)("Students will have %1$s out of %2$s questions available to answer.","tutor"),A,c)})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fU.infoCardWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:b,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fU.infoCard,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{"data-title":true,children:[l.watch("quiz_option.time_limit.time_value")," ",l.watch("quiz_option.time_limit.time_type")]}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{"data-subtitle":true,children:(0,v.__)("Time limit","tutor")}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{"data-footer":true,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"stopwatch",width:12,height:12}),K>0?fK(K):(0,v.__)("N/A","tutor")]})]})}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:fU.infoCard,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{"data-title":true,children:[l.watch("quiz_option.passing_grade"),(0,v.__)("%","tutor")]}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{"data-subtitle":true,children:(0,v.__)("Passing grade","tutor")}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{"data-footer":true,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"starLine",width:12,height:12}),w==="rand"?"-":(0,v.sprintf)((0,v.__)("%1$s of %2$s correct","tutor"),H,C)]})]})]})]})})]})};/* export default */const fL=fR;var fU={maxWidth:e=>/*#__PURE__*/(0,h/* .css */.AH)("max-width:",e,";"),minWidth:e=>/*#__PURE__*/(0,h/* .css */.AH)("min-width:",e,";"),justifyContent:e=>/*#__PURE__*/(0,h/* .css */.AH)("justify-content:",e,";"),width:e=>/*#__PURE__*/(0,h/* .css */.AH)("width:",e,";"),settings:/*#__PURE__*/(0,h/* .css */.AH)("display:grid;grid-template-columns:1.5fr 1fr;gap:",_/* .spacing["12"] */.YK["12"],";",_/* .Breakpoint.smallMobile */.EA.smallMobile,"{grid-template-columns:1fr;}"),left:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["8"] */.YK["8"],";"),overview:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["8"] */.YK["8"],";position:sticky;top:0;align-self:start;border-radius:",_/* .borderRadius["12"] */.Vq["12"],";border:1px solid ",_/* .colorTokens.stroke.divider */.I6.stroke.divider,";padding:",_/* .spacing["16"] */.YK["16"],";background-color:",_/* .colorTokens.background.white */.I6.background.white,";",_/* .Breakpoint.smallMobile */.EA.smallMobile,"{position:static;}"),questionPool:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;justify-content:space-between;gap:",_/* .spacing["8"] */.YK["8"],";svg{margin-top:",_/* .spacing["20"] */.YK["20"],";color:",_/* .colorTokens.icon["default"] */.I6.icon["default"],";}[data-question-pool]{",Y/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["4"] */.YK["4"],";[data-question-pool-label]{",F/* .typography.tiny */.I.tiny(),";color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";}[data-question-count]{",F/* .typography.heading5 */.I.heading5("medium"),";color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";span:last-of-type{",F/* .typography.tiny */.I.tiny(),";margin-left:",_/* .spacing["2"] */.YK["2"],";color:",_/* .colorTokens.text.hints */.I6.text.hints,";}&[data-available-count]{color:",_/* .colorTokens.text.success */.I6.text.success,";}}}"),questionPoolBar:e=>/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";",F/* .typography.tiny */.I.tiny(),";color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";gap:",_/* .spacing["4"] */.YK["4"],";[data-question-pool-bar]{position:relative;width:100%;height:5px;background-color:",_/* .colorTokens.action.secondary.gray */.I6.action.secondary.gray,";border-radius:",_/* .borderRadius["50"] */.Vq["50"],";box-shadow:0px 0px 1.75px 0px #00000029 inset;&::before{content:'';position:absolute;top:0;left:0;width:",e,";height:100%;background-color:",_/* .colorTokens.action.primary["default"] */.I6.action.primary["default"],";border-radius:",_/* .borderRadius["50"] */.Vq["50"],";}}"),infoCardWrapper:/*#__PURE__*/(0,h/* .css */.AH)("display:grid;grid-template-columns:1fr 1fr;gap:",_/* .spacing["8"] */.YK["8"],";"),infoCard:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["4"] */.YK["4"],";padding:",_/* .spacing["8"] */.YK["8"],";border-radius:",_/* .borderRadius["12"] */.Vq["12"],";background-color:",_/* .colorTokens.surface.courseBuilder */.I6.surface.courseBuilder,";height:106px;[data-title]{",F/* .typography.caption */.I.caption("medium"),";color:",_/* .colorTokens.text.title */.I6.text.title,";}[data-subtitle]{",F/* .typography.tiny */.I.tiny(),";color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";}[data-footer]{",Y/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;",F/* .typography.tiny */.I.tiny(),";color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";margin-top:auto;svg{color:",_/* .colorTokens.icon["default"] */.I6.icon["default"],";margin-right:",_/* .spacing["4"] */.YK["4"],";}}"),card:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["8"] */.YK["8"],";border-radius:",_/* .borderRadius["12"] */.Vq["12"],";border:1px solid ",_/* .colorTokens.stroke.divider */.I6.stroke.divider,";padding:",_/* .spacing["12"] */.YK["12"],";background-color:",_/* .colorTokens.background.white */.I6.background.white,";h5{",F/* .typography.caption */.I.caption(),";color:",_/* .colorTokens.text.title */.I6.text.title,";}hr{width:100%;background-color:",_/* .colorTokens.stroke.divider */.I6.stroke.divider,";}"),innerCard:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["8"] */.YK["8"],";padding:",_/* .spacing["12"] */.YK["12"],";border-radius:",_/* .borderRadius["8"] */.Vq["8"],";background-color:",_/* .colorTokens.surface.courseBuilder */.I6.surface.courseBuilder,";"),inlineForm:function(){var{withPrefix:e,minHeight:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("row"),";width:100%;align-items:center;justify-content:space-between;gap:",_/* .spacing["8"] */.YK["8"],";",t&&(0,h/* .css */.AH)(fP(),t)," ",e&&(0,h/* .css */.AH)(fO(),F/* .typography.body */.I.body("regular"),_/* .colorTokens.text.hints */.I6.text.hints))},paginationIcons:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.flexCenter */.x.flexCenter(),";background-color:",_/* .colorTokens.bg.white */.I6.bg.white,";border:1px solid ",_/* .colorTokens.stroke.divider */.I6.stroke.divider,";border-radius:",_/* .borderRadius["4"] */.Vq["4"],";"),timeLimit:/*#__PURE__*/(0,h/* .css */.AH)("display:grid;align-items:start;grid-template-columns:48px 84px;& input{border:1px solid ",_/* .colorTokens.stroke["default"] */.I6.stroke["default"],";&[data-time-limit]{border-radius:",_/* .borderRadius["6"] */.Vq["6"]," 0 0 ",_/* .borderRadius["6"] */.Vq["6"],";border-right:none;&:focus{border-right:1px solid ",_/* .colorTokens.stroke["default"] */.I6.stroke["default"],";z-index:",_/* .zIndex.positive */.fE.positive,";}}&[data-time-limit-unit]{border-radius:0 ",_/* .borderRadius["6"] */.Vq["6"]," ",_/* .borderRadius["6"] */.Vq["6"]," 0;}}"),contentDripLabel:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;svg{margin-right:",_/* .spacing["4"] */.YK["4"],";color:",_/* .colorTokens.icon.success */.I6.icon.success,";}* > svg{",Y/* .styleUtils.flexCenter */.x.flexCenter(),";margin-left:",_/* .spacing["4"] */.YK["4"],";color:",_/* .colorTokens.color.black["30"] */.I6.color.black["30"],";}")};// EXTERNAL MODULE: ./node_modules/.pnpm/@tanstack+react-query@5.62.15_react@18.3.1/node_modules/@tanstack/react-query/build/modern/useMutation.js
var fB=n(32047);// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/services/quiz.ts
var fj=(e,t)=>{var n=e.quiz_option;var i,a,o,s,l,u,d,c,p,h,v,f;return(0,r._)({ID:e.ID,_data_status:D/* .QuizDataStatus.NO_CHANGE */.cW.NO_CHANGE,quiz_title:(i=e.post_title)!==null&&i!==void 0?i:"",quiz_description:(a=e.post_content)!==null&&a!==void 0?a:"",quiz_option:{enable_time_limit:Number(e.quiz_option.time_limit.time_value)>0,time_limit:{time_value:(o=e.quiz_option.time_limit.time_value)!==null&&o!==void 0?o:0,time_type:(s=e.quiz_option.time_limit.time_type)!==null&&s!==void 0?s:"minutes"},hide_quiz_time_display:e.quiz_option.hide_quiz_time_display==="1",limit_attempts_allowed:(0,D/* .isDefined */.O9)(e.quiz_option.limit_attempts_allowed)?e.quiz_option.limit_attempts_allowed==="1":n.feedback_mode==="retry",attempts_allowed:(l=e.quiz_option.attempts_allowed)!==null&&l!==void 0?l:O/* .DEFAULT_QUIZ_ATTEMPTS_ALLOWED */.I8,pass_is_required:e.quiz_option.pass_is_required==="1",passing_grade:(u=e.quiz_option.passing_grade)!==null&&u!==void 0?u:80,limit_questions_to_answer:!!Number(e.quiz_option.max_questions_for_answer),max_questions_for_answer:Number(e.quiz_option.max_questions_for_answer)>0?e.quiz_option.max_questions_for_answer:10,quiz_auto_start:e.quiz_option.quiz_auto_start==="1",auto_start_delay:String((d=e.quiz_option.auto_start_delay)!==null&&d!==void 0?d:5),question_layout_view:e.quiz_option.question_layout_view==="question_pagination"?"single_question":e.quiz_option.question_layout_view||"single_question",enable_pagination:(0,D/* .isDefined */.O9)(e.quiz_option.enable_pagination)?e.quiz_option.enable_pagination==="1":e.quiz_option.question_layout_view==="question_pagination"||false,enable_answer_reveal:(0,D/* .isDefined */.O9)(e.quiz_option.enable_answer_reveal)?e.quiz_option.enable_answer_reveal==="1":n.feedback_mode==="reveal"||false,answers_reveal_duration:String((c=e.quiz_option.answers_reveal_duration)!==null&&c!==void 0?c:5),hide_previous_button:e.quiz_option.hide_previous_button==="1",questions_order:(p=e.quiz_option.questions_order)!==null&&p!==void 0?p:"rand",pagination_type:(h=e.quiz_option.pagination_type)!==null&&h!==void 0?h:"shape",hide_question_number_overview:e.quiz_option.hide_question_number_overview==="1",short_answer_characters_limit:(v=e.quiz_option.short_answer_characters_limit)!==null&&v!==void 0?v:200,open_ended_answer_characters_limit:(f=e.quiz_option.open_ended_answer_characters_limit)!==null&&f!==void 0?f:500,content_drip_settings:e.quiz_option.content_drip_settings||{unlock_date:"",after_xdays_of_enroll:0,prerequisites:[]}},questions:(e.questions||[]).map(e=>tr(e)),deleted_question_ids:[],deleted_answer_ids:[],deleted_temp_mask_values:[]},Object.fromEntries(t.map(t=>[t,e[t]])))};var fV=(e,t,n,a,o,s)=>{var l,u;var{normalizedQuestions:d,deletedAnswerIds:c}=ti(e.questions,e.deleted_answer_ids);return(0,r._)({course_id:a,topic_id:t,payload:{ID:e.ID,_data_status:e._data_status,post_title:e.quiz_title,post_content:e.quiz_description,quiz_option:(0,r._)({limit_attempts_allowed:e.quiz_option.limit_attempts_allowed?"1":"0",attempts_allowed:e.quiz_option.attempts_allowed,hide_question_number_overview:e.quiz_option.hide_question_number_overview?"1":"0",hide_quiz_time_display:e.quiz_option.hide_quiz_time_display?"1":"0",max_questions_for_answer:(0,k/* .isAddonEnabled */.GR)(O/* .Addons.H5P_INTEGRATION */.oW.H5P_INTEGRATION)&&e.questions.every(e=>e.question_type==="h5p")?e.questions.length:e.quiz_option.limit_questions_to_answer?e.quiz_option.max_questions_for_answer:0,open_ended_answer_characters_limit:e.quiz_option.open_ended_answer_characters_limit,pass_is_required:e.quiz_option.pass_is_required?"1":"0",passing_grade:e.quiz_option.passing_grade,question_layout_view:e.quiz_option.question_layout_view,enable_pagination:e.quiz_option.enable_pagination?"1":"0",enable_answer_reveal:e.quiz_option.enable_answer_reveal?"1":"0",answers_reveal_duration:Number(e.quiz_option.answers_reveal_duration),hide_previous_button:e.quiz_option.hide_previous_button?"1":"0",pagination_type:e.quiz_option.pagination_type,questions_order:e.quiz_option.questions_order,quiz_auto_start:e.quiz_option.quiz_auto_start?"1":"0",auto_start_delay:Number(e.quiz_option.auto_start_delay),short_answer_characters_limit:e.quiz_option.short_answer_characters_limit,time_limit:{time_type:e.quiz_option.time_limit.time_type,time_value:e.quiz_option.enable_time_limit?e.quiz_option.time_limit.time_value:0}},(0,k/* .isAddonEnabled */.GR)(O/* .Addons.CONTENT_DRIP */.oW.CONTENT_DRIP)&&n==="unlock_sequentially"&&e.quiz_option.limit_attempts_allowed&&{pass_is_required:e.quiz_option.pass_is_required?"1":"0"},(0,k/* .isAddonEnabled */.GR)(O/* .Addons.CONTENT_DRIP */.oW.CONTENT_DRIP)&&{content_drip_settings:(0,r._)({},n==="unlock_by_date"&&{unlock_date:e.quiz_option.content_drip_settings.unlock_date},n==="specific_days"&&{after_xdays_of_enroll:e.quiz_option.content_drip_settings.after_xdays_of_enroll},n==="after_finishing_prerequisites"&&{prerequisites:((l=e.quiz_option.content_drip_settings.prerequisites)===null||l===void 0?void 0:l.length)?e.quiz_option.content_drip_settings.prerequisites:""})},(0,k/* .isAddonEnabled */.GR)(O/* .Addons.H5P_INTEGRATION */.oW.H5P_INTEGRATION)&&e.questions.every(e=>e.question_type==="h5p")&&{quiz_type:"tutor_h5p_quiz"}),questions:d.map(e=>{var t,n,a;return(0,r._)((0,i._)((0,r._)((0,i._)((0,r._)({_data_status:e._data_status,question_id:(()=>{if(e.is_cb_question){return String(e.question_id).split("-")[0]}return e.question_id})()},e.is_cb_question&&{is_cb_question:e.is_cb_question}),{question_title:e.question_title,question_description:e.question_description,question_mark:e.question_settings.question_mark}),!!P/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url&&{answer_explanation:e.answer_explanation}),{question_type:e.question_type,question_order:e.question_order,question_settings:(0,r._)({answer_required:e.question_settings.answer_required?"1":"0",question_mark:e.question_settings.question_mark,question_type:e.question_type,randomize_question:e.question_settings.randomize_question?"1":"0",show_question_mark:e.question_settings.show_question_mark?"1":"0"},e.question_type==="multiple_choice"&&{has_multiple_correct_answer:e.question_settings.has_multiple_correct_answer?"1":"0"},e.question_type==="matching"&&{is_image_matching:e.question_settings.is_image_matching?"1":"0"},e.question_type==="draw_image"&&{draw_image_threshold_percent:Number((t=e.question_settings.draw_image_threshold_percent)!==null&&t!==void 0?t:70)},e.question_type==="puzzle"&&{puzzle_grid_size:Number((n=e.question_settings.puzzle_grid_size)!==null&&n!==void 0?n:4)},e.question_type==="coordinates"&&{coordinates_axis_range:Number((a=e.question_settings.coordinates_axis_range)!==null&&a!==void 0?a:10)}),question_answers:e.question_answers.map(t=>({_data_status:t._data_status,answer_id:t.answer_id,belongs_question_id:e.question_id,belongs_question_type:e.question_type,answer_title:t.answer_title,is_correct:t.is_correct,image_id:e.question_type==="matching"&&!e.question_settings.is_image_matching?"":t.image_id,image_url:e.question_type==="matching"&&!e.question_settings.is_image_matching?"":t.image_url,answer_two_gap_match:t.answer_two_gap_match,answer_view_format:t.answer_view_format,answer_order:t.answer_order}))}),Object.fromEntries(o.map(t=>[t,e[t]])))})},deleted_question_ids:e.deleted_question_ids,deleted_answer_ids:c,deleted_temp_mask_values:e.deleted_temp_mask_values},(0,k/* .isAddonEnabled */.GR)(O/* .Addons.CONTENT_DRIP */.oW.CONTENT_DRIP)&&n==="unlock_by_date"&&{"content_drip_settings[unlock_date]":e.quiz_option.content_drip_settings.unlock_date},(0,k/* .isAddonEnabled */.GR)(O/* .Addons.CONTENT_DRIP */.oW.CONTENT_DRIP)&&n==="specific_days"&&{"content_drip_settings[after_xdays_of_enroll]":e.quiz_option.content_drip_settings.after_xdays_of_enroll},(0,k/* .isAddonEnabled */.GR)(O/* .Addons.CONTENT_DRIP */.oW.CONTENT_DRIP)&&n==="after_finishing_prerequisites"&&{"content_drip_settings[prerequisites]":((u=e.quiz_option.content_drip_settings.prerequisites)===null||u===void 0?void 0:u.length)?e.quiz_option.content_drip_settings.prerequisites:""},Object.fromEntries(s.map(t=>[t,e[t]])))};var fQ=e=>{return{question_id:e.question_id,question_title:e.question_title,question_description:e.question_description,question_type:e.question_type,question_mark:e.question_mark,answer_explanation:e.answer_explanation,"question_settings[question_type]":e.question_type,"question_settings[answer_required]":e.question_settings.answer_required?1:0,"question_settings[question_mark]":e.question_mark}};var fG=e=>{return eN/* .wpAjaxInstance.post */.b.post(eK/* ["default"].QUIZ_IMPORT_DATA */.A.QUIZ_IMPORT_DATA,e)};var f$=()=>{var e=(0,z/* .useQueryClient */.jE)();var{showToast:t}=(0,eJ/* .useToast */.d)();return(0,fB/* .useMutation */.n)({mutationFn:fG,onSuccess:n=>{if(n.success){e.invalidateQueries({queryKey:["Topic"]});t({message:(0,v.__)("Quiz imported successfully","tutor"),type:"success"})}else{t({message:n.data.message,type:"danger"})}},onError:e=>{t({message:(0,k/* .convertToErrorMessage */.EL)(e),type:"danger"})}})};var fX=e=>{return eN/* .wpAjaxInstance.post */.b.post(eK/* ["default"].QUIZ_EXPORT_DATA */.A.QUIZ_EXPORT_DATA,{quiz_id:e})};var fZ=()=>{var{showToast:e}=(0,eJ/* .useToast */.d)();return(0,fB/* .useMutation */.n)({mutationFn:fX,onSuccess:t=>{if(!t.success){e({message:(0,v.__)("Something went wrong.","tutor"),type:"danger"});return}var n="";for(var r of t.data.output_quiz_data){var i=r.join(",");n+="".concat(i,"\r\n")}var a=new Blob([n],{type:"text/csv"});var o=window.webkitURL.createObjectURL(a);var s=document.createElement("a");s.setAttribute("href",o);s.setAttribute("download","tutor-quiz-".concat(t.data.title,".csv"));document.body.appendChild(s);s.click()},onError:t=>{e({message:(0,k/* .convertToErrorMessage */.EL)(t),type:"danger"})}})};var fJ=e=>{return eN/* .wpAjaxInstance.post */.b.post(eK/* ["default"].SAVE_QUIZ */.A.SAVE_QUIZ,e)};var f0=()=>{var e=(0,z/* .useQueryClient */.jE)();var{showToast:t}=(0,eJ/* .useToast */.d)();return(0,fB/* .useMutation */.n)({mutationFn:fJ,onSuccess:n=>{if(n.data){e.setQueryData(["Quiz",n.data.ID],n.data);e.invalidateQueries({queryKey:["Topic"]});t({message:(0,v.__)(n.message,"tutor"),type:"success"})}},onError:e=>{t({message:(0,k/* .convertToErrorMessage */.EL)(e),type:"danger"})}})};var f1=e=>{return eN/* .wpAjaxInstance.get */.b.get(eK/* ["default"].GET_QUIZ_DETAILS */.A.GET_QUIZ_DETAILS,{params:{quiz_id:e}})};var f2=e=>{return(0,eF/* .useQuery */.I)({queryKey:["Quiz",e],queryFn:()=>f1(e).then(e=>e.data),enabled:!!e})};var f4=e=>{return wpAjaxInstance.post(endpoints.GET_H5P_QUIZ_CONTENT_BY_ID,{content_id:e}).then(e=>e.data)};var f6=(e,t)=>{return useQuery({queryKey:["H5PQuizContent",e],queryFn:()=>f4(e),enabled:!!e&&t==="tutor_h5p_quiz"})};var f5=e=>{return eN/* .wpAjaxInstance.post */.b.post(eK/* ["default"].DELETE_QUIZ */.A.DELETE_QUIZ,{quiz_id:e})};var f3=()=>{var e=(0,z/* .useQueryClient */.jE)();var{showToast:t}=(0,eJ/* .useToast */.d)();return(0,fB/* .useMutation */.n)({mutationFn:f5,onSuccess:n=>{if(n.status_code===200){t({message:(0,v.__)(n.message,"tutor"),type:"success"});e.invalidateQueries({queryKey:["Topic"]})}},onError:e=>{t({message:(0,k/* .convertToErrorMessage */.EL)(e),type:"danger"})}})};// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/modals/QuizModal.tsx
function f8(){var e=(0,I._)(["\n      padding-top: ",";\n      margin-inline: auto;\n\n      "," {\n        padding: "," "," "," ",";\n        margin: 0 auto;\n      }\n\n      "," {\n        padding-top: ",";\n      }\n    "]);f8=function t(){return e};return e}var f9=(0,eg/* .getCourseId */.p)();var f7=e=>{var{closeModal:t,icon:n,title:s,subtitle:l,quizId:u,topicId:d,contentDripType:c,contentType:p}=e;var{fields:h}=(0,ev/* .useCourseBuilderSlot */._)();var[_,b]=(0,o.useState)(false);var[w,A]=(0,o.useState)("details");var[Y,I]=(0,o.useState)(!(0,D/* .isDefined */.O9)(u));var q=(0,o.useRef)(null);var C=f0();var z=f2(u||"");var{showToast:T}=(0,eJ/* .useToast */.d)();var M=(0,ec/* .useFormWithGlobalError */.p)({defaultValues:{quiz_option:{time_limit:{time_value:0,time_type:"minutes"},hide_quiz_time_display:false,limit_attempts_allowed:false,limit_questions_to_answer:false,attempts_allowed:O/* .DEFAULT_QUIZ_ATTEMPTS_ALLOWED */.I8,passing_grade:80,max_questions_for_answer:p==="tutor_h5p_quiz"?0:10,quiz_auto_start:false,question_layout_view:p==="tutor_h5p_quiz"?"question_below_each_other":"single_question",questions_order:"rand",enable_pagination:false,pagination_type:"shape",enable_answer_reveal:false,answers_reveal_duration:"5",hide_previous_button:false,hide_question_number_overview:false,short_answer_characters_limit:200,open_ended_answer_characters_limit:500,content_drip_settings:{unlock_date:"",after_xdays_of_enroll:0,prerequisites:[]}},questions:[]},shouldFocusError:true});var H=M.formState.dirtyFields&&Object.keys(M.formState.dirtyFields).length>0;(0,o.useEffect)(()=>{var e=e=>{if(H){e.preventDefault();return}M.reset()};window.addEventListener("beforeunload",e);return()=>{window.removeEventListener("beforeunload",e)};// eslint-disable-next-line react-hooks/exhaustive-deps
},[H]);(0,o.useEffect)(()=>{if(!z.data){return}var e=fj(z.data,(0,k/* .findSlotFields */.DE)({fields:h.Curriculum.Quiz}));M.reset(e);// eslint-disable-next-line react-hooks/exhaustive-deps
},[z.data]);var P=(e,n,r)=>(0,E._)(function*(){if(!e.quiz_title){A("details");Promise.resolve().then(()=>{M.trigger("quiz_title",{shouldFocus:true})});return}if(e.questions.length===0){A("details");T({message:(0,v.__)("Please add a question","tutor"),type:"danger"});return}var i=e.questions[n];var a=tn(i);if(a!==true){r(a);A("details");return}I(false);var o=fV(e,d,c,f9,(0,k/* .findSlotFields */.DE)({fields:h.Curriculum.Quiz,slotKey:"after_question_description"},{fields:h.Curriculum.Quiz,slotKey:"bottom_of_question_sidebar"}),(0,k/* .findSlotFields */.DE)({fields:h.Curriculum.Quiz,slotKey:"bottom_of_settings"}));var s=yield C.mutateAsync(o);if(s.data){I(false);t({action:"CONFIRM"});M.reset()}})();(0,o.useEffect)(()=>{if(Y){M.setFocus("quiz_title")}// eslint-disable-next-line react-hooks/exhaustive-deps
},[Y]);return/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .FormProvider */.Op,(0,i._)((0,r._)({},M),{children:/*#__PURE__*/(0,a/* .jsx */.Y)(cf,{quizId:u||"",topicId:d,contentType:p||"tutor_quiz",children:e=>{var{activeQuestionIndex:o,activeQuestionId:d,setActiveQuestionId:h,setValidationError:k}=e;return/*#__PURE__*/(0,a/* .jsxs */.FD)(ed/* ["default"] */.A,{onClose:()=>t({action:"CLOSE"}),icon:H?/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"warning",width:24,height:24}):n,title:H?O/* .CURRENT_VIEWPORT.isAboveDesktop */.vN.isAboveDesktop?(0,v.__)("Unsaved Changes","tutor"):"":s,subtitle:O/* .CURRENT_VIEWPORT.isAboveSmallMobile */.vN.isAboveSmallMobile?l:"",fullScreen:true,headerChildren:/*#__PURE__*/(0,a/* .jsx */.Y)(te/* ["default"] */.A,{wrapperCss:gt.tabsWrapper,activeTab:w,tabList:[{label:O/* .CURRENT_VIEWPORT.isAboveMobile */.vN.isAboveMobile?(0,v.__)("Question Details","tutor"):"",value:"details",icon:!O/* .CURRENT_VIEWPORT.isAboveMobile */.vN.isAboveMobile?/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"text",width:24,height:24}):null},{label:O/* .CURRENT_VIEWPORT.isAboveMobile */.vN.isAboveMobile?(0,v.__)("Settings","tutor"):"",value:"settings",icon:!O/* .CURRENT_VIEWPORT.isAboveMobile */.vN.isAboveMobile?/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"settings",width:24,height:24}):null}],onChange:e=>A(e)}),actions:H&&/*#__PURE__*/(0,a/* .jsxs */.FD)(a/* .Fragment */.FK,{children:[/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",size:"small",onClick:()=>{if(H){b(true);return}t()},ref:q,children:u?O/* .CURRENT_VIEWPORT.isAboveSmallMobile */.vN.isAboveSmallMobile?(0,v.__)("Discard Changes","tutor"):(0,v.__)("Discard","tutor"):(0,v.__)("Cancel","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:w==="settings"||u,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{"data-cy":"quiz-next",variant:"primary",size:"small",onClick:()=>A("settings"),children:(0,v.__)("Next","tutor")}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{"data-cy":"save-quiz",loading:C.isPending,variant:"primary",size:"small",onClick:M.handleSubmit(e=>P(e,o,k)),children:(0,v.__)("Save","tutor")})})]}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:gt.wrapper({activeTab:w,isH5pQuiz:p==="tutor_h5p_quiz"}),children:/*#__PURE__*/(0,a/* .jsxs */.FD)(y/* ["default"] */.A,{when:!z.isLoading,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(g/* .LoadingOverlay */.p8,{}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:w==="details",children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:gt.left,children:/*#__PURE__*/(0,a/* .jsxs */.FD)(y/* ["default"] */.A,{when:w==="details",children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:gt.quizTitleWrapper,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:gt.quizForm,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:M.control,name:"quiz_title",rules:{required:(0,v.__)("Quiz title is required","tutor")},render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(e9,(0,i._)((0,r._)({},e),{placeholder:(0,v.__)("Add quiz title","tutor"),size:"small",isEdit:Y,onToggleEdit:e=>{I(e)},wrapperCss:gt.quizTitle}))}),/*#__PURE__*/(0,a/* .jsxs */.FD)(y/* ["default"] */.A,{when:Y,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:M.control,name:"quiz_description",render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(e0/* ["default"] */.A,(0,i._)((0,r._)({},e),{placeholder:(0,v.__)("Add a summary","tutor"),rows:3}))}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:gt.quizFormButtonWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",type:"button",onClick:()=>{if(!M.watch("quiz_title")){t()}I(false)},size:"small",children:(0,v.__)("Cancel","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{"data-cy":"save-quiz-title",loading:C.isPending,variant:"secondary",type:"submit",size:"small",onClick:()=>{if(!M.getValues("quiz_title")){M.trigger("quiz_title");return}I(false)},children:(0,v.__)("Ok","tutor")})]})]})]})}),/*#__PURE__*/(0,a/* .jsx */.Y)(fm,{isEditing:Y})]})})}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:gt.centerColumn,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:gt.content({activeTab:w}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:w==="settings",fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(h5,{}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(fL,{contentDripType:c})})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:w==="details"&&p!=="tutor_h5p_quiz",children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:gt.right,children:/*#__PURE__*/(0,a/* .jsx */.Y)(cb,{})})})]})}),/*#__PURE__*/(0,a/* .jsx */.Y)(W/* ["default"] */.A,{isOpen:_,triggerRef:q,closePopover:()=>b(false),maxWidth:"258px",title:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:gt.confirmationPopoverTitle,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"warning",width:20,height:20}),/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:(0,v.__)("Discard changes?","tutor")})]}),message:"",animationType:N/* .AnimationType.slideUp */.J6.slideUp,placement:O/* .CURRENT_VIEWPORT.isAboveMobile */.vN.isAboveMobile?K/* .POPOVER_PLACEMENTS.BOTTOM */.zA.BOTTOM:K/* .POPOVER_PLACEMENTS.ABSOLUTE_CENTER */.zA.ABSOLUTE_CENTER,positionModifier:{top:-55,left:u?34:2},confirmButton:{text:(0,v.__)("Keep Editing","tutor"),variant:"primary"},cancelButton:{text:(0,v.__)("Discard","tutor"),variant:"text"},onConfirmation:()=>{b(false)},onCancel:()=>{var e;M.reset();k(null);if(!((e=z.data)===null||e===void 0?void 0:e.questions.find(e=>e.question_id===d))){h("")}if(!u){t()}b(false)}})]})}})}))};/* export default */const ge=f7;var gt={wrapper:e=>{var{activeTab:t,isH5pQuiz:n}=e;return/*#__PURE__*/(0,h/* .css */.AH)("width:100%;display:grid;grid-template-columns:",t==="details"?n?"510px 1fr":"400px 1fr 340px":"1fr",";height:100%;overflow:hidden;",_/* .Breakpoint.smallTablet */.EA.smallTablet,"{width:100%;grid-template-columns:1fr;height:max-content;}")},tabsWrapper:/*#__PURE__*/(0,h/* .css */.AH)("height:",O/* .modal.HEADER_HEIGHT */.yl.HEADER_HEIGHT,"px;",_/* .Breakpoint.smallMobile */.EA.smallMobile,"{button{min-width:auto;}}"),confirmationPopoverTitle:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;gap:",_/* .spacing["8"] */.YK["8"],";margin-bottom:",_/* .spacing["8"] */.YK["8"],";svg{color:",_/* .colorTokens.icon["default"] */.I6.icon["default"],";}"),left:/*#__PURE__*/(0,h/* .css */.AH)("border-right:1px solid ",_/* .colorTokens.stroke.divider */.I6.stroke.divider,";",Y/* .styleUtils.overflowYAuto */.x.overflowYAuto,";scrollbar-gutter:auto;"),centerColumn:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.overflowYAuto */.x.overflowYAuto,";height:100%;width:100%;"),content:e=>{var{activeTab:t}=e;return/*#__PURE__*/(0,h/* .css */.AH)("padding:",_/* .spacing["32"] */.YK["32"]," 0 ",_/* .spacing["48"] */.YK["48"]," ",_/* .spacing["6"] */.YK["6"],";max-width:800px;width:100%;margin-inline:auto;",t==="settings"&&(0,h/* .css */.AH)(f8(),_/* .spacing["24"] */.YK["24"],_/* .Breakpoint.smallTablet */.EA.smallTablet,_/* .spacing["16"] */.YK["16"],_/* .spacing["8"] */.YK["8"],_/* .spacing["24"] */.YK["24"],_/* .spacing["8"] */.YK["8"],_/* .Breakpoint.smallMobile */.EA.smallMobile,_/* .spacing["8"] */.YK["8"]))},right:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.overflowYAuto */.x.overflowYAuto,";",Y/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["16"] */.YK["16"],";border-left:1px solid ",_/* .colorTokens.stroke.divider */.I6.stroke.divider,";"),quizTitleWrapper:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.caption */.I.caption(),";color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";padding:",_/* .spacing["16"] */.YK["16"]," ",_/* .spacing["16"] */.YK["16"]," ",_/* .spacing["16"] */.YK["16"]," ",_/* .spacing["28"] */.YK["28"],";border-bottom:1px solid ",_/* .colorTokens.stroke.divider */.I6.stroke.divider,";",_/* .Breakpoint.smallTablet */.EA.smallTablet,"{padding:",_/* .spacing["8"] */.YK["8"],";}"),quizNameWithButton:/*#__PURE__*/(0,h/* .css */.AH)("display:inline-flex;width:100%;transition:all 0.3s ease-in-out;button{display:none;}:hover,:focus-within{button{display:block;}}:focus-visible{outline:2px solid ",_/* .colorTokens.stroke.brand */.I6.stroke.brand,";border-radius:",_/* .borderRadius["6"] */.Vq["6"],";button{display:block;}}",_/* .Breakpoint.smallTablet */.EA.smallTablet,"{button{display:block;}}"),quizTitle:/*#__PURE__*/(0,h/* .css */.AH)("padding:0;[data-placeholder]{padding:0;}[data-question-title-edit-button]{background-color:",_/* .colorTokens.background.white */.I6.background.white,";}&:hover{background-color:transparent;}"),quizForm:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;flex-direction:column;gap:",_/* .spacing["12"] */.YK["12"],";"),quizFormButtonWrapper:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;justify-content:end;margin-top:",_/* .spacing["4"] */.YK["4"],";gap:",_/* .spacing["8"] */.YK["8"],";")};// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/curriculum/TopicContent.tsx
function gn(){var e=(0,I._)(["\n      background-color: ",";\n      opacity: 0.3;\n    "]);gn=function t(){return e};return e}function gr(){var e=(0,I._)(["\n      border-color: ",";\n      background-color: ",";\n      [data-content-icon] {\n        display: flex;\n      }\n      [data-bar-icon] {\n        display: none;\n      }\n      [data-actions] {\n        opacity: 1;\n      }\n    "]);gr=function t(){return e};return e}function gi(){var e=(0,I._)(["\n      [data-content-icon] {\n        display: none;\n      }\n      [data-bar-icon] {\n        display: block;\n      }\n      cursor: grabbing;\n    "]);gi=function t(){return e};return e}var ga={lesson:{name:"lesson",color:_/* .colorTokens.icon["default"] */.I6.icon["default"]},tutor_quiz:{name:"quiz",color:_/* .colorTokens.design.warning */.I6.design.warning},tutor_assignments:{name:"assignment",color:_/* .colorTokens.icon.processing */.I6.icon.processing},tutor_zoom_meeting:{name:"zoomColorize",color:""},"tutor-google-meet":{name:"googleMeetColorize",color:""},tutor_h5p_quiz:{name:"interactiveQuiz",color:"#C984FE"},"cb-lesson":{name:"lesson",color:_/* .colorTokens.icon["default"] */.I6.icon["default"]},"cb-assignment":{name:"assignment",color:_/* .colorTokens.icon.processing */.I6.icon.processing}};var go={tutor_assignments:(0,v.__)("Are you sure you want to delete this assignment? All existing assignment submissions will be permanently deleted.","tutor"),tutor_quiz:(0,v.__)("Are you sure you want to delete this quiz? All existing quiz attempts will be permanently deleted.","tutor"),tutor_h5p_quiz:(0,v.__)("Are you sure you want to delete this interactive quiz? All existing quiz attempts will be permanently deleted.","tutor")};var gs={lesson:eX,tutor_quiz:ge,tutor_assignments:ey,tutor_h5p_quiz:ge};var gl={lesson:(0,v.__)("Lesson","tutor"),tutor_quiz:(0,v.__)("Quiz","tutor"),tutor_assignments:(0,v.__)("Assignment","tutor"),tutor_h5p_quiz:(0,v.__)("Interactive Quiz","tutor")};var gu={lesson:"lesson",tutor_quiz:"quiz",tutor_assignments:"assignment",tutor_h5p_quiz:"interactiveQuiz"};var gd=["lesson","tutor_assignments","tutor_quiz","tutor_h5p_quiz","tutor_zoom_meeting","tutor-google-meet"];var gc=!!P/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var gp=(0,eg/* .getCourseId */.p)();var gh=e=>{var{type:t,topic:n,content:s,listeners:l,isDragging:u=false,onCopy:d,onDelete:c}=e;var p=(0,eg/* .getIdWithoutPrefix */.E)("topic-",n.id);var f=(0,eg/* .getIdWithoutPrefix */.E)("content-",s.id);var b=(0,z/* .useQueryClient */.jE)();var w=b.getQueryData(["CourseDetails",Number(gp)]);var A=(0,S/* .useFormContext */.xW)();var[I,q]=(0,o.useState)(null);var[C,D]=(0,o.useState)(false);var P=(0,o.useRef)(null);var F=(0,o.useRef)(null);var B=ga[t]||{name:"lesson",color:_/* .colorTokens.icon["default"] */.I6.icon["default"]};var{showModal:j}=(0,H/* .useModal */.h)();var V=(0,ef/* .useDuplicateContentMutation */.V_)();var Q=(0,ef/* .useDeleteContentMutation */.VT)();var G=f3();var $=(0,ef/* .useDeleteContentMutation */.VT)();var X=(0,ef/* .useDeleteContentMutation */.VT)();var Z=fZ();var J=(0,ef/* .useDeleteContentBankContentMutation */._u)();var ee=()=>{var e=t;if(gs[e]){j({component:gs[e],props:(0,r._)({contentDripType:A.watch("contentDripType"),topicId:p,lessonId:f,assignmentId:f,quizId:f,title:gl[e],/* translators: %s is the topic title */subtitle:(0,v.sprintf)((0,v.__)("Topic: %s","tutor"),n.title),icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:gu[e],height:24,width:24})},t==="tutor_h5p_quiz"&&{contentType:"tutor_h5p_quiz"}),closeOnEscape:!["tutor_quiz","tutor_h5p_quiz"].includes(t)})}if(t==="tutor_zoom_meeting"){q("tutor_zoom_meeting")}if(t==="tutor-google-meet"){q("tutor-google-meet")}};var et=()=>(0,E._)(function*(){if(["lesson","tutor_assignments"].includes(t)){yield Q.mutateAsync(f)}else if(["tutor_quiz","tutor_h5p_quiz"].includes(t)){yield G.mutateAsync(f)}else if(t==="tutor-google-meet"){yield $.mutateAsync(f)}else if(t==="tutor_zoom_meeting"){yield X.mutateAsync(f)}else if(["cb-lesson","cb-assignment"].includes(t)){yield J.mutateAsync({topicId:p,contentId:f})}D(false);c===null||c===void 0?void 0:c()})();var en=()=>{var e={lesson:"lesson",tutor_assignments:"assignment",tutor_quiz:"quiz",tutor_h5p_quiz:"quiz"};V.mutateAsync({course_id:gp,content_id:f,content_type:e[t]});d===null||d===void 0?void 0:d()};return/*#__PURE__*/(0,a/* .jsxs */.FD)(a/* .Fragment */.FK,{children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:gf.wrapper({isDragging:u,isActive:I===t||C||V.isPending}),children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",(0,i._)((0,r._)({css:gf.iconAndTitle({isDragging:u})},l),{children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{"data-content-icon":true,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:B.name,width:24,height:24,style:/*#__PURE__*/(0,h/* .css */.AH)("color:",B.color,";")})}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{"data-bar-icon":true,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"bars",width:24,height:24})}),/*#__PURE__*/(0,a/* .jsxs */.FD)("p",{css:gf.title,onClick:ee,onKeyDown:k/* .noop */.lQ,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("span",{dangerouslySetInnerHTML:{__html:s.title}}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:(t==="tutor_quiz"||t==="tutor_h5p_quiz")&&!!s.total_question,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("span",{"data-question-count":true,children:["(",/* translators: %s is the total number of questions */(0,v.sprintf)((0,v.__)("%s Questions","tutor"),s.total_question),")"]})})]})]})),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:gf.actions,"data-actions":true,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:t==="tutor_quiz",children:/*#__PURE__*/(0,a/* .jsx */.Y)(M/* ["default"] */.A,{content:(0,v.__)("Export Quiz","tutor"),delay:200,children:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!gc,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:(0,k/* .isAddonEnabled */.GR)(O/* .Addons.QUIZ_EXPORT_IMPORT */.oW.QUIZ_EXPORT_IMPORT),children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:Y/* .styleUtils.actionButton */.x.actionButton,onClick:()=>{Z.mutate(f)},children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"export",width:24,height:24})})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(T/* ["default"] */.A,{size:"tiny",children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:Y/* .styleUtils.actionButton */.x.actionButton,disabled:true,onClick:k/* .noop */.lQ,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"export",width:24,height:24})})})})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:gd.includes(t),children:/*#__PURE__*/(0,a/* .jsx */.Y)(M/* ["default"] */.A,{content:(0,v.__)("Edit","tutor"),delay:200,children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{"data-cy":"edit-".concat(t),ref:P,type:"button",css:Y/* .styleUtils.actionButton */.x.actionButton,onClick:ee,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"edit",width:24,height:24})})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!["tutor_zoom_meeting","tutor_zoom_meeting"].includes(t),children:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!V.isPending,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(g/* ["default"] */.Ay,{size:24}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(M/* ["default"] */.A,{content:(0,v.__)("Duplicate","tutor"),delay:200,children:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!gc,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{"data-cy":"duplicate-".concat(t),type:"button",css:Y/* .styleUtils.actionButton */.x.actionButton,onClick:en,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"copyPaste",width:24,height:24})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(T/* ["default"] */.A,{size:"tiny",children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{disabled:true,type:"button",css:Y/* .styleUtils.actionButton */.x.actionButton,onClick:k/* .noop */.lQ,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"copyPaste",width:24,height:24})})})})})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(M/* ["default"] */.A,{content:(0,v.__)("Delete","tutor"),delay:200,children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{"data-cy":"delete-".concat(t),ref:F,type:"button",css:Y/* .styleUtils.actionButton */.x.actionButton,onClick:()=>{D(true)},children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"delete",width:24,height:24})})})]})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)(R/* ["default"] */.A,{triggerRef:P,isOpen:I!==null,closePopover:k/* .noop */.lQ,maxWidth:"306px",closeOnEscape:false,placement:O/* .CURRENT_VIEWPORT.isAboveMobile */.vN.isAboveMobile?K/* .POPOVER_PLACEMENTS.BOTTOM */.zA.BOTTOM:K/* .POPOVER_PLACEMENTS.ABSOLUTE_CENTER */.zA.ABSOLUTE_CENTER,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:I==="tutor_zoom_meeting",children:/*#__PURE__*/(0,a/* .jsx */.Y)(U/* ["default"] */.A,{data:null,topicId:p,meetingHost:(w===null||w===void 0?void 0:w.zoom_users)||{},onCancel:()=>q(null),meetingId:f})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:I==="tutor-google-meet",children:/*#__PURE__*/(0,a/* .jsx */.Y)(L/* ["default"] */.A,{data:null,topicId:p,onCancel:()=>q(null),meetingId:f})})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(W/* ["default"] */.A,{isOpen:C,isLoading:Q.isPending||G.isPending||$.isPending||X.isPending||J.isPending,triggerRef:F,closePopover:k/* .noop */.lQ,maxWidth:"258px",title:(0,v.sprintf)((0,v.__)('Delete "%s"',"tutor"),s.title),message:go[t]||(0,v.__)("Are you sure you want to delete this content from your course? This cannot be undone.","tutor"),animationType:N/* .AnimationType.slideUp */.J6.slideUp,confirmButton:{text:(0,v.__)("Delete","tutor"),variant:"text",isDelete:true},cancelButton:{text:(0,v.__)("Cancel","tutor"),variant:"text"},onConfirmation:et,onCancel:()=>D(false)})]})};/* export default */const gv=/*#__PURE__*/(0,o.memo)(gh,(e,t)=>{return e.content.id===t.content.id&&e.content.title===t.content.title&&e.content.total_question===t.content.total_question&&e.isDragging===t.isDragging});var gf={wrapper:e=>{var{isDragging:t=false,isActive:n=false}=e;return/*#__PURE__*/(0,h/* .css */.AH)("width:100%;padding:",_/* .spacing["10"] */.YK["10"]," ",_/* .spacing["8"] */.YK["8"],";border:1px solid transparent;border-radius:",_/* .borderRadius["6"] */.Vq["6"],";display:flex;justify-content:space-between;align-items:center;opacity:1;",t&&(0,h/* .css */.AH)(gn(),_/* .colorTokens.stroke.hover */.I6.stroke.hover),"    [data-content-icon],[data-bar-icon]{display:flex;height:24px;}:hover,:focus-within{border-color:",_/* .colorTokens.stroke.border */.I6.stroke.border,";background-color:",_/* .colorTokens.background.white */.I6.background.white,";[data-content-icon]{display:none;}[data-bar-icon]{display:block;}[data-actions]{opacity:",t?0:1,";}}",n&&(0,h/* .css */.AH)(gr(),_/* .colorTokens.stroke.border */.I6.stroke.border,_/* .colorTokens.background.white */.I6.background.white)," ",_/* .Breakpoint.smallTablet */.EA.smallTablet,"{[data-actions]{opacity:1;}}")},title:/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.caption */.I.caption(),";color:",_/* .colorTokens.text.title */.I6.text.title,";display:flex;align-items:center;gap:",_/* .spacing["4"] */.YK["4"],";cursor:pointer;span{&:first-of-type{",Y/* .styleUtils.text.ellipsis */.x.text.ellipsis(2),"}}[data-question-count]{color:",_/* .colorTokens.text.hints */.I6.text.hints,";}"),iconAndTitle:e=>{var{isDragging:t=false}=e;return/*#__PURE__*/(0,h/* .css */.AH)("display:flex;align-items:center;gap:",_/* .spacing["8"] */.YK["8"],";cursor:grab;flex-grow:1;[data-bar-icon]{display:none;}",t&&(0,h/* .css */.AH)(gi()))},actions:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;opacity:0;align-items:start;gap:",_/* .spacing["8"] */.YK["8"],";justify-content:end;")};// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/curriculum/TopicContentWrapper.tsx
var gg=e=>(0,p/* .defaultAnimateLayoutChanges */.uU)((0,i._)((0,r._)({},e),{wasDragging:true}));var gm=e=>{var{topic:t,content:n}=e;var{attributes:o,listeners:s,setNodeRef:l,transform:u,transition:d,isDragging:c}=(0,p/* .useSortable */.gl)({id:n.ID,data:{type:"content"},animateLayoutChanges:gg});var h={transform:q/* .CSS.Transform.toString */.Ks.Transform.toString(u),transition:d};return/*#__PURE__*/(0,a/* .jsx */.Y)("div",(0,i._)((0,r._)({},o),{ref:l,style:h,children:/*#__PURE__*/(0,a/* .jsx */.Y)(gv,{type:n.post_type,topic:t,listeners:s,isDragging:c,content:{id:n.ID,title:n.post_title,total_question:n.total_question||0}})}))};/* export default */const g_=gm;// CONCATENATED MODULE: ./assets/src/js/v3/shared/molecules/FileUploader.tsx
var gb=e=>{var{acceptedTypes:t,onUpload:n,onError:r,maxFileSize:i=Number((P/* .tutorConfig */.P===null||P/* .tutorConfig */.P===void 0?void 0:P/* .tutorConfig.max_upload_size */.P.max_upload_size)||"")||O/* .MAX_FILE_SIZE */.w3}=e;var a=(0,o.useRef)(null);var s=e=>{var{files:a}=e.target;if(!a||a.length===0){r([(0,v.__)("No files selected","tutor")]);return}var o=[];var s=[];for(var l of[...a]){if(!t.includes((0,k/* .getFileExtensionFromName */.dS)(l.name))){o.push((0,v.__)("Invalid file type","tutor"))}else if(l.size>i){o.push((0,v.__)("Maximum upload size exceeded","tutor"))}else{s.push(l)}}if(s.length){n(s)}if(o.length){r(o)}e.target.value=""};return{fileInputRef:a,handleChange:s}};var gy=e=>{var{onUpload:t,onError:n,acceptedTypes:r,label:i,multiple:a=false,disabled:o=false,maxFileSize:s=formatReadAbleBytesToBytes((tutorConfig===null||tutorConfig===void 0?void 0:tutorConfig.max_upload_size)||"")||MAX_FILE_SIZE}=e;var{fileInputRef:l,handleChange:u}=gb({acceptedTypes:r,onUpload:t,onError:n,maxFileSize:s});return /*#__PURE__*/_jsxs("button",{type:"button",css:gw.uploadButton,onClick:()=>{var e;return(e=l.current)===null||e===void 0?void 0:e.click()},disabled:o,children:[/*#__PURE__*/_jsx("input",{ref:l,type:"file",css:gw.fileInput,accept:r.join(","),onChange:u,multiple:a,disabled:o}),/*#__PURE__*/_jsx(SVGIcon,{name:"storeImage",width:26,height:20}),/*#__PURE__*/_jsx("span",{css:gw.text,children:i})]})};var gw={uploadButton:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.resetButton */.x.resetButton,"    background:",_/* .colorTokens.background["default"] */.I6.background["default"],";border:1px dashed ",_/* .colorTokens.stroke.border */.I6.stroke.border,";border-radius:",_/* .borderRadius["8"] */.Vq["8"],";display:flex;flex-direction:column;justify-content:center;align-items:center;flex:1;gap:",_/* .spacing["12"] */.YK["12"],";"),fileInput:/*#__PURE__*/(0,h/* .css */.AH)("display:none;"),text:/*#__PURE__*/(0,h/* .css */.AH)("color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";",F/* .typography.body */.I.body())};var gx=e=>{var{onUpload:t,onError:n,acceptedTypes:r,multiple:i=false,disabled:a=false,children:o,maxFileSize:s=Number((tutorConfig===null||tutorConfig===void 0?void 0:tutorConfig.max_upload_size)||"")||MAX_FILE_SIZE}=e,l=_object_without_properties(e,["onUpload","onError","acceptedTypes","multiple","disabled","children","maxFileSize"]);var{fileInputRef:u,handleChange:d}=gb({acceptedTypes:r,onUpload:t,onError:n,maxFileSize:s});return /*#__PURE__*/_jsxs(Button,_object_spread_props(_object_spread({},l),{onClick:()=>{var e;return(e=u.current)===null||e===void 0?void 0:e.click()},disabled:a,children:[/*#__PURE__*/_jsx("input",{ref:u,type:"file",css:gw.fileInput,accept:r.join(","),onChange:d,multiple:i,disabled:a}),o]}))};/* export default */const gA=/* unused pure expression or super */null&&gy;// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/curriculum/TopicFooter.tsx
var gY=(0,eg/* .getCourseId */.p)();var gk=!!P/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var gI=(0,k/* .isAddonEnabled */.GR)(O/* .Addons.TUTOR_GOOGLE_MEET_INTEGRATION */.oW.TUTOR_GOOGLE_MEET_INTEGRATION)||(0,k/* .isAddonEnabled */.GR)(O/* .Addons.TUTOR_ZOOM_INTEGRATION */.oW.TUTOR_ZOOM_INTEGRATION);var gq=e=>{var{topic:t,nextContentOrder:n}=e;var r=(0,eg/* .getIdWithoutPrefix */.E)("topic-",t.id);var{showToast:i}=(0,eJ/* .useToast */.d)();var{showModal:s}=(0,H/* .useModal */.h)();var l=(0,S/* .useFormContext */.xW)();var[u,d]=(0,o.useState)(null);var[c,p]=(0,o.useState)(false);var h=(0,o.useRef)(null);var g=(0,o.useRef)(null);var _=f$();var b=(0,z/* .useQueryClient */.jE)();var w=b.getQueryData(["CourseDetails",Number(gY)]);var{fileInputRef:A,handleChange:Y}=gb({acceptedTypes:[".csv"],onUpload:e=>(0,E._)(function*(){yield _.mutateAsync({topic_id:r,csv_file:e[0]});p(false)})(),onError:e=>{for(var t of e){i({message:t,type:"danger"})}p(false)}});return/*#__PURE__*/(0,a/* .jsxs */.FD)(a/* .Fragment */.FK,{children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:gD.contentButtons,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:gD.leftButtons,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{"data-cy":"add-lesson",variant:"tertiary",isOutlined:true,size:"small",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"plus",width:24,height:24}),disabled:!t.isSaved,buttonCss:gD.contentButton,onClick:()=>{s({component:eX,props:{contentDripType:l.watch("contentDripType"),topicId:r,title:(0,v.__)("Lesson","tutor"),icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"lesson",width:24,height:24}),/* translators: %s is the topic title */subtitle:(0,v.sprintf)((0,v.__)("Topic: %s","tutor"),t.title)}})},children:(0,v.__)("Lesson","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{"data-cy":"add-quiz",variant:"tertiary",isOutlined:true,size:"small",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"plus",width:24,height:24}),disabled:!t.isSaved,buttonCss:gD.contentButton,onClick:()=>{s({component:ge,props:{topicId:r,contentDripType:l.watch("contentDripType"),title:(0,v.__)("Quiz","tutor"),icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"quiz",width:24,height:24}),/* translators: %s is the topic title */subtitle:(0,v.sprintf)((0,v.__)("Topic: %s","tutor"),t.title)},closeOnEscape:false})},children:(0,v.__)("Quiz","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!gk,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:(0,k/* .isAddonEnabled */.GR)(O/* .Addons.H5P_INTEGRATION */.oW.H5P_INTEGRATION),children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{"data-cy":"add-interactive-quiz",variant:"tertiary",isOutlined:true,size:"small",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"plus",width:24,height:24}),disabled:!t.isSaved,buttonCss:gD.contentButton,onClick:()=>{s({component:ge,props:{topicId:r,contentDripType:l.watch("contentDripType"),title:(0,v.__)("Interactive Quiz","tutor"),icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"interactiveQuiz",width:24,height:24}),/* translators: %s is the topic title */subtitle:(0,v.sprintf)((0,v.__)("Topic: %s","tutor"),t.title),contentType:"tutor_h5p_quiz"},closeOnEscape:false})},children:(0,v.__)("Interactive Quiz","tutor")})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(T/* ["default"] */.A,{children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"tertiary",isOutlined:true,size:"small",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"plus",width:24,height:24}),disabled:true,onClick:k/* .noop */.lQ,children:(0,v.__)("Interactive Quiz","tutor")})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!gk,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:(0,k/* .isAddonEnabled */.GR)(O/* .Addons.TUTOR_ASSIGNMENTS */.oW.TUTOR_ASSIGNMENTS),children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{"data-cy":"add-assignment",variant:"tertiary",isOutlined:true,size:"small",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"plus",width:24,height:24}),disabled:!t.isSaved,buttonCss:gD.contentButton,onClick:()=>{s({component:ey,props:{topicId:r,contentDripType:l.watch("contentDripType"),title:(0,v.__)("Assignment","tutor"),icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"assignment",width:24,height:24}),/* translators: %s is the topic title */subtitle:(0,v.sprintf)((0,v.__)("Topic: %s","tutor"),t.title)}})},children:(0,v.__)("Assignment","tutor")})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(T/* ["default"] */.A,{children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"tertiary",isOutlined:true,size:"small",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"plus",width:24,height:24}),disabled:true,onClick:k/* .noop */.lQ,children:(0,v.__)("Assignment","tutor")})})})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:gD.rightButtons,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!gk,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:(0,k/* .isAddonEnabled */.GR)(O/* .Addons.CONTENT_BANK */.oW.CONTENT_BANK),children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"tertiary",isOutlined:true,size:"small",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"contentBank",width:24,height:24}),disabled:!t.isSaved,buttonCss:gD.contentButton,"data-cy":"add-from-content-bank",onClick:()=>{s({id:"content-bank-collection-list",component:fc,props:{type:"lesson_assignment",topicId:r,nextContentOrder:n}})},children:(0,v.__)("Content Bank","tutor")})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(T/* ["default"] */.A,{children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"tertiary",isOutlined:true,size:"small",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"contentBank",width:24,height:24}),disabled:true,onClick:k/* .noop */.lQ,children:(0,v.__)("Content Bank","tutor")})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!gk||gI,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:gk,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(T/* ["default"] */.A,{children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"tertiary",isOutlined:true,size:"small",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"import",width:24,height:24}),disabled:true,onClick:k/* .noop */.lQ,children:(0,v.__)("Import Quiz","tutor")})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:(0,k/* .isAddonEnabled */.GR)(O/* .Addons.QUIZ_EXPORT_IMPORT */.oW.QUIZ_EXPORT_IMPORT),children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"tertiary",isOutlined:true,size:"small",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"import",width:24,height:24}),disabled:!t.isSaved,buttonCss:gD.contentButton,onClick:()=>{var e;A===null||A===void 0?void 0:(e=A.current)===null||e===void 0?void 0:e.click()},children:(0,v.__)("Import Quiz","tutor")})})}),children:/*#__PURE__*/(0,a/* .jsxs */.FD)(vc/* ["default"] */.A,{isOpen:c,onClick:()=>p(true),closePopover:()=>p(false),disabled:!t.isSaved,dotsOrientation:"vertical",maxWidth:gk?"220px":"250px",isInverse:true,closeOnEscape:false,size:O/* .CURRENT_VIEWPORT.isAboveMobile */.vN.isAboveMobile?"medium":"small",children:[/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!gk||(0,k/* .isAddonEnabled */.GR)(O/* .Addons.TUTOR_GOOGLE_MEET_INTEGRATION */.oW.TUTOR_GOOGLE_MEET_INTEGRATION),children:/*#__PURE__*/(0,a/* .jsx */.Y)(vc/* ["default"].Option */.A.Option,{text:/*#__PURE__*/(0,a/* .jsxs */.FD)("span",{ref:h,css:gD.threeDotButton,children:[(0,v.__)("Meet live lesson","tutor"),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!gk,children:/*#__PURE__*/(0,a/* .jsx */.Y)(T/* ["default"] */.A,{size:"small",content:(0,v.__)("Pro","tutor")})})]}),disabled:!gk,icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{width:24,height:24,name:"googleMeetColorize",isColorIcon:true}),onClick:()=>d("tutor-google-meet")})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!gk||(0,k/* .isAddonEnabled */.GR)(O/* .Addons.TUTOR_ZOOM_INTEGRATION */.oW.TUTOR_ZOOM_INTEGRATION),children:/*#__PURE__*/(0,a/* .jsx */.Y)(vc/* ["default"].Option */.A.Option,{text:/*#__PURE__*/(0,a/* .jsxs */.FD)("span",{ref:g,css:gD.threeDotButton,children:[(0,v.__)("Zoom live lesson","tutor"),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!gk,children:/*#__PURE__*/(0,a/* .jsx */.Y)(T/* ["default"] */.A,{size:"small",content:(0,v.__)("Pro","tutor")})})]}),disabled:!gk,icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{width:24,height:24,name:"zoomColorize",isColorIcon:true}),onClick:()=>d("tutor_zoom_meeting")})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!gk||(0,k/* .isAddonEnabled */.GR)(O/* .Addons.QUIZ_EXPORT_IMPORT */.oW.QUIZ_EXPORT_IMPORT),children:/*#__PURE__*/(0,a/* .jsx */.Y)(vc/* ["default"].Option */.A.Option,{text:/*#__PURE__*/(0,a/* .jsxs */.FD)("span",{css:gD.threeDotButton,children:[(0,v.__)("Import Quiz","tutor"),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!gk,children:/*#__PURE__*/(0,a/* .jsx */.Y)(T/* ["default"] */.A,{size:"small",content:(0,v.__)("Pro","tutor")})})]}),disabled:!gk,onClick:()=>{var e;A===null||A===void 0?void 0:(e=A.current)===null||e===void 0?void 0:e.click()},icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"importColorized",width:24,height:24,isColorIcon:true})})})]})})]})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("input",{css:gD.input,type:"file",ref:A,onChange:Y,multiple:false,accept:".csv"}),/*#__PURE__*/(0,a/* .jsx */.Y)(R/* ["default"] */.A,{triggerRef:h,isOpen:u==="tutor-google-meet",closePopover:k/* .noop */.lQ,maxWidth:"306px",closeOnEscape:false,placement:O/* .CURRENT_VIEWPORT.isAboveMobile */.vN.isAboveMobile?K/* .POPOVER_PLACEMENTS.BOTTOM */.zA.BOTTOM:K/* .POPOVER_PLACEMENTS.ABSOLUTE_CENTER */.zA.ABSOLUTE_CENTER,children:/*#__PURE__*/(0,a/* .jsx */.Y)(L/* ["default"] */.A,{topicId:r,data:null,onCancel:()=>{d(null);p(false)}})}),/*#__PURE__*/(0,a/* .jsx */.Y)(R/* ["default"] */.A,{triggerRef:g,isOpen:u==="tutor_zoom_meeting",closePopover:k/* .noop */.lQ,maxWidth:"306px",closeOnEscape:false,placement:O/* .CURRENT_VIEWPORT.isAboveMobile */.vN.isAboveMobile?K/* .POPOVER_PLACEMENTS.BOTTOM */.zA.BOTTOM:K/* .POPOVER_PLACEMENTS.ABSOLUTE_CENTER */.zA.ABSOLUTE_CENTER,children:/*#__PURE__*/(0,a/* .jsx */.Y)(U/* ["default"] */.A,{topicId:r,meetingHost:(w===null||w===void 0?void 0:w.zoom_users)||{},data:null,onCancel:()=>{d(null);p(false)}})})]})};/* export default */const gC=/*#__PURE__*/(0,o.memo)(gq,(e,t)=>{return e.topic.id===t.topic.id&&e.topic.isSaved===t.topic.isSaved&&e.nextContentOrder===t.nextContentOrder});var gD={contentButtons:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex(),";justify-content:space-between;"),leftButtons:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex(),";gap:",_/* .spacing["12"] */.YK["12"],";",_/* .Breakpoint.smallMobile */.EA.smallMobile,"{flex-wrap:wrap;}"),rightButtons:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;gap:",_/* .spacing["8"] */.YK["8"],";"),threeDotButton:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;gap:",_/* .spacing["4"] */.YK["4"],";"),contentButton:/*#__PURE__*/(0,h/* .css */.AH)(":hover:not(:disabled){background-color:",_/* .colorTokens.background.white */.I6.background.white,";color:",_/* .colorTokens.text.brand */.I6.text.brand,";outline:1px solid ",_/* .colorTokens.stroke.brand */.I6.stroke.brand,";}"),input:/*#__PURE__*/(0,h/* .css */.AH)("display:none !important;")};// CONCATENATED MODULE: ./assets/src/js/v3/shared/hooks/useCollapseExpandAnimation.tsx
var gE=e=>{var{ref:t,isOpen:n,heightCalculator:r="scroll"}=e;var i,a;var[s,l]=(0,o.useState)(r==="scroll"?(i=t.current)===null||i===void 0?void 0:i.scrollHeight:(a=t.current)===null||a===void 0?void 0:a.clientHeight);(0,o.useEffect)(()=>{if(t.current){var e=r==="scroll"?t.current.scrollHeight:t.current.clientHeight;l(e)}// eslint-disable-next-line react-hooks/exhaustive-deps
},[t.current,r]);var u=(0,C/* .useSpring */.zh)({height:n?s:0,opacity:n?1:0,overflow:"hidden",config:{duration:300,easing:e=>e*(2-e)}});return u};// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/curriculum/TopicHeader.tsx
function gS(){var e=(0,I._)(["\n        transform: rotate(180deg);\n      "]);gS=function t(){return e};return e}function gz(){var e=(0,I._)(["\n      border-bottom: 1px solid ",";\n    "]);gz=function t(){return e};return e}function gT(){var e=(0,I._)(["\n      [data-visually-hidden] {\n        opacity: 0;\n        transition: ",";\n      }\n\n      :hover,\n      :focus-within {\n        [data-visually-hidden] {\n          opacity: ",";\n        }\n      }\n    "]);gT=function t(){return e};return e}function gM(){var e=(0,I._)(["\n      ",";\n    "]);gM=function t(){return e};return e}function gH(){var e=(0,I._)(["\n      ",";\n    "]);gH=function t(){return e};return e}function gP(){var e=(0,I._)(["\n      padding-top: ",";\n      padding-right: 0;\n    "]);gP=function t(){return e};return e}var gO=(0,eg/* .getCourseId */.p)();var gF=!!P/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var gN=e=>{var{topic:t,isEdit:n,listeners:s,isDragging:l,onCollapse:u,onEdit:d,onCopy:c,onDelete:p,setIsEdit:h}=e;var _=(0,eg/* .getIdWithoutPrefix */.E)("topic-",t.id);var b=(0,ec/* .useFormWithGlobalError */.p)({defaultValues:{title:t.title,summary:t.summary},shouldFocusError:true});var[w,A]=(0,o.useState)(false);var I=(0,o.useRef)(null);var q=(0,o.useRef)(null);var D=(0,ef/* .useSaveTopicMutation */.V1)();var z=(0,ef/* .useDuplicateContentMutation */.V_)();var H=(0,ef/* .useDeleteTopicMutation */.$n)(gO);var P=gE({ref:I,isOpen:!t.isCollapsed,heightCalculator:"client"});var O=e=>(0,E._)(function*(){var n=yield D.mutateAsync((0,i._)((0,r._)({},t.isSaved&&{topic_id:_}),{course_id:gO,title:e.title,summary:e.summary}));if(n.data){h(false)}if(n.status_code===201){d===null||d===void 0?void 0:d("topic-".concat(n.data))}})();var F=()=>(0,E._)(function*(){var e=yield z.mutateAsync({course_id:gO,content_id:_,content_type:"topic"});if(e.data){c===null||c===void 0?void 0:c("topic-".concat(e.data))}})();(0,o.useEffect)(()=>{if(n){b.setFocus("title")}// eslint-disable-next-line react-hooks/exhaustive-deps
},[n]);var K;var R=(K=b.watch("summary"))!==null&&K!==void 0?K:"";var L=R.trim().length>0;return/*#__PURE__*/(0,a/* .jsxs */.FD)(a/* .Fragment */.FK,{children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:gW.header({isCollapsed:t.isCollapsed,isEdit:n,isDeletePopoverOpen:w,isDragging:l}),children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:gW.headerContent({isSaved:t.isSaved,isEdit:n,isCollapsed:t.isCollapsed,hasSummary:L}),children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:gW.grabberInput,onClick:()=>u(t.id),onKeyDown:e=>{if(e.key==="Enter"){u(t.id)}},children:[/*#__PURE__*/(0,a/* .jsx */.Y)("button",(0,i._)((0,r._)({},t.isSaved?s:{}),{css:gW.grabButton({isDragging:l}),type:"button",disabled:!t.isSaved,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"dragVertical",width:24,height:24})})),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:n,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:gW.title({isEdit:n}),onDoubleClick:()=>h(true),children:b.watch("title")}),children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:gW.title({isEdit:n}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:b.control,name:"title",rules:{required:(0,v.__)("Title is required","tutor")},render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(V/* ["default"] */.A,(0,i._)((0,r._)({},e),{placeholder:(0,v.__)("Add a title","tutor"),isSecondary:true}))})})})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:gW.actions,"data-visually-hidden":true,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!n,children:/*#__PURE__*/(0,a/* .jsx */.Y)(M/* ["default"] */.A,{content:(0,v.__)("Edit","tutor"),delay:200,children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{"data-cy":"edit-topic",type:"button",css:Y/* .styleUtils.actionButton */.x.actionButton,disabled:!t.isSaved,onClick:()=>{h(true);if(t.isCollapsed){u===null||u===void 0?void 0:u(t.id)}},children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"edit",width:24,height:24})})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:t.isSaved,children:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!z.isPending,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(g/* ["default"] */.Ay,{size:24}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(M/* ["default"] */.A,{content:(0,v.__)("Duplicate","tutor"),delay:200,children:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!gF,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{"data-cy":"duplicate-topic",type:"button",css:Y/* .styleUtils.actionButton */.x.actionButton,disabled:!t.isSaved,onClick:F,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"copyPaste",width:24,height:24})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(T/* ["default"] */.A,{size:"tiny",children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:Y/* .styleUtils.actionButton */.x.actionButton,disabled:true,onClick:k/* .noop */.lQ,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"copyPaste",width:24,height:24})})})})})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:t.isSaved,children:/*#__PURE__*/(0,a/* .jsx */.Y)(M/* ["default"] */.A,{content:(0,v.__)("Delete","tutor"),delay:200,children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{"data-cy":"delete-topic",type:"button",css:Y/* .styleUtils.actionButton */.x.actionButton,disabled:!t.isSaved,"data-visually-hidden":true,ref:q,onClick:()=>{A(true)},children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"delete",width:24,height:24})})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:t.isSaved,children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:Y/* .styleUtils.actionButton */.x.actionButton,disabled:!t.isSaved,onClick:()=>{u===null||u===void 0?void 0:u(t.id)},"data-toggle-collapse":true,children:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"chevronDown",width:24,height:24})})})]})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:n,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:L,children:/*#__PURE__*/(0,a/* .jsx */.Y)(C/* .animated.div */.CS.div,{style:(0,r._)({},P),children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:gW.description({isEdit:n}),ref:I,onDoubleClick:()=>h(true),children:R})})}),children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:gW.description({isEdit:n}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(S/* .Controller */.xI,{control:b.control,name:"summary",render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(e0/* ["default"] */.A,(0,i._)((0,r._)({},e),{placeholder:(0,v.__)("Add a summary","tutor"),isSecondary:true,rows:5,enableResize:true}))})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:n,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:gW.footer,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",size:"small",onClick:()=>{if(!b.formState.isValid&&!t.isSaved){p===null||p===void 0?void 0:p()}b.reset();h(false)},children:(0,v.__)("Cancel","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{"data-cy":"save-topic",loading:D.isPending,variant:"secondary",size:"small",onClick:b.handleSubmit(O),children:(0,v.__)("Ok","tutor")})]})})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(W/* ["default"] */.A,{isOpen:w,triggerRef:q,isLoading:H.isPending,closePopover:k/* .noop */.lQ,maxWidth:"258px",title:/* translators: %s is the topic title */(0,v.sprintf)((0,v.__)('Delete topic "%s"',"tutor"),t.title),message:(0,v.__)("Are you sure you want to delete this content from your course? This cannot be undone.","tutor"),animationType:N/* .AnimationType.slideUp */.J6.slideUp,confirmButton:{text:(0,v.__)("Delete","tutor"),variant:"text",isDelete:true},cancelButton:{text:(0,v.__)("Cancel","tutor"),variant:"text"},onConfirmation:()=>(0,E._)(function*(){yield H.mutateAsync(_);A(false);p===null||p===void 0?void 0:p()})(),onCancel:()=>A(false)})]})};/* export default */const gK=/*#__PURE__*/(0,o.memo)(gN,(e,t)=>{return e.topic.id===t.topic.id&&e.topic.isSaved===t.topic.isSaved&&e.topic.isCollapsed===t.topic.isCollapsed&&e.isEdit===t.isEdit});var gW={header:e=>{var{isCollapsed:t,isEdit:n,isDeletePopoverOpen:r,isDragging:i}=e;return/*#__PURE__*/(0,h/* .css */.AH)("padding:",_/* .spacing["12"] */.YK["12"]," ",_/* .spacing["16"] */.YK["16"],";",Y/* .styleUtils.display.flex */.x.display.flex("column"),";[data-toggle-collapse]{transition:transform 0.3s ease-in-out;",!t&&(0,h/* .css */.AH)(gS()),"}",!t&&(0,h/* .css */.AH)(gz(),_/* .colorTokens.stroke.divider */.I6.stroke.divider)," ",!n&&!r&&(0,h/* .css */.AH)(gT(),!i?"opacity 0.3s ease-in-out":"none",i?0:1)," ",_/* .Breakpoint.smallTablet */.EA.smallTablet,"{[data-visually-hidden]{opacity:1;}}")},headerContent:e=>{var{isSaved:t=true,isEdit:n=false,isCollapsed:r=false,hasSummary:i=false}=e;return/*#__PURE__*/(0,h/* .css */.AH)("display:grid;grid-template-columns:",t?"1fr auto":"1fr",";gap:",_/* .spacing["12"] */.YK["12"],";width:100%;padding-bottom:",!r&&!n&&i?_/* .spacing["12"] */.YK["12"]:"0px",";")},grabberInput:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;gap:",_/* .spacing["8"] */.YK["8"],";svg{color:",_/* .colorTokens.color.black["40"] */.I6.color.black["40"],";flex-shrink:0;}"),grabButton:e=>{var{isDragging:t=false}=e;return/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.resetButton */.x.resetButton,";",Y/* .styleUtils.flexCenter */.x.flexCenter(),";cursor:",t?"grabbing":"grab",";:disabled{cursor:not-allowed;}&:focus,&:active,&:hover{background:none;}&:focus-visible{outline:2px solid ",_/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:1px;border-radius:",_/* .borderRadius["2"] */.Vq["2"],";}")},title:e=>{var{isEdit:t}=e;return/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.body */.I.body(),";color:",_/* .colorTokens.text.hints */.I6.text.hints,";width:100%;",!t&&(0,h/* .css */.AH)(gM(),Y/* .styleUtils.text.ellipsis */.x.text.ellipsis(1)))},description:e=>{var{isEdit:t}=e;return/*#__PURE__*/(0,h/* .css */.AH)(F/* .typography.caption */.I.caption(),";color:",_/* .colorTokens.text.hints */.I6.text.hints,";padding-inline:",_/* .spacing["8"] */.YK["8"],";margin-left:",_/* .spacing["24"] */.YK["24"],";",!t&&(0,h/* .css */.AH)(gH(),Y/* .styleUtils.text.ellipsis */.x.text.ellipsis(2))," ",t&&(0,h/* .css */.AH)(gP(),_/* .spacing["12"] */.YK["12"]))},footer:/*#__PURE__*/(0,h/* .css */.AH)("width:100%;text-align:right;",Y/* .styleUtils.display.flex */.x.display.flex(),";gap:",_/* .spacing["8"] */.YK["8"],";justify-content:end;margin-top:",_/* .spacing["12"] */.YK["12"],";"),actions:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex(),";align-items:start;gap:",_/* .spacing["8"] */.YK["8"],";justify-content:end;")};// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/curriculum/Topic.tsx
function gR(){var e=(0,I._)(["\n      border-color: ",";\n      background-color: ",";\n    "]);gR=function t(){return e};return e}function gL(){var e=(0,I._)(["\n      box-shadow: ",";\n    "]);gL=function t(){return e};return e}var gU=e=>(0,p/* .defaultAnimateLayoutChanges */.uU)((0,i._)((0,r._)({},e),{wasDragging:true}));var gB=e=>{var{topic:t,onDelete:n,onCopy:s,onCollapse:l,onEdit:u,isOverlay:d=false}=e;var c,h;var[v,f]=(0,o.useState)(false);var[g,m]=(0,o.useState)(!t.isSaved);var w=(0,o.useRef)(null);var A=(0,o.useRef)(null);var[Y,I]=(0,C/* .useSpring */.zh)({height:!t.isCollapsed?(c=w.current)===null||c===void 0?void 0:c.scrollHeight:0,opacity:!t.isCollapsed?1:0,overflow:"hidden",config:{duration:300,easing:e=>e*(2-e)}},[t.contents.length]);(0,o.useEffect)(()=>{var e=e=>{if((0,D/* .isDefined */.O9)(A.current)&&!A.current.contains(e.target)){f(false)}};document.addEventListener("click",e);return()=>document.removeEventListener("click",e)},[g]);var{attributes:E,listeners:S,setNodeRef:z,transform:T,transition:M,isDragging:H}=(0,p/* .useSortable */.gl)({id:t.id,data:{type:"topic"},animateLayoutChanges:gU});var P=(0,o.useCallback)(e=>{if(e){z(e);// eslint-disable-next-line @typescript-eslint/no-explicit-any
A.current=e}},[z]);var O={transform:q/* .CSS.Transform.toString */.Ks.Transform.toString(T),transition:M,opacity:H?.3:undefined,background:H?_/* .colorTokens.stroke.hover */.I6.stroke.hover:undefined};(0,o.useEffect)(()=>{if((0,D/* .isDefined */.O9)(w.current)){I.start({height:!t.isCollapsed?w.current.scrollHeight:0,opacity:!t.isCollapsed?1:0})}// eslint-disable-next-line react-hooks/exhaustive-deps
},[t.isCollapsed,t.contents.length]);return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",(0,i._)((0,r._)({},t.isSaved?E:{}),{css:gV.wrapper({isActive:v||g,isOverlay:d}),onClick:()=>f(true),onKeyDown:k/* .noop */.lQ,tabIndex:-1,ref:P,style:O,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(gK,{isActive:v,isDragging:H,isEdit:g,listeners:S,onCollapse:e=>{l===null||l===void 0?void 0:l(e)},onDelete:n,onEdit:e=>{u===null||u===void 0?void 0:u(e)},onCopy:e=>{s===null||s===void 0?void 0:s(e)},topic:t,setIsEdit:m}),/*#__PURE__*/(0,a/* .jsx */.Y)(C/* .animated.div */.CS.div,{style:(0,r._)({},Y),children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:gV.content,ref:w,children:/*#__PURE__*/(0,a/* .jsxs */.FD)(y/* ["default"] */.A,{when:!t.isCollapsed,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:t.contents.length>0,children:/*#__PURE__*/(0,a/* .jsx */.Y)(p/* .SortableContext */.gB,{items:t.contents.map(e=>(0,i._)((0,r._)({},e),{id:e.ID})),strategy:p/* .verticalListSortingStrategy */._G,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{children:/*#__PURE__*/(0,a/* .jsx */.Y)(b/* ["default"] */.A,{each:t.contents,children:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(g_,{topic:t,content:e},e.ID)})})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(gC,{topic:t,nextContentOrder:(t===null||t===void 0?void 0:(h=t.contents)===null||h===void 0?void 0:h.length)+1||1})]})})})]}))};/* export default */const gj=gB;var gV={wrapper:e=>{var{isActive:t=false,isOverlay:n=false}=e;return/*#__PURE__*/(0,h/* .css */.AH)("border:1px solid ",_/* .colorTokens.stroke["default"] */.I6.stroke["default"],";border-radius:",_/* .borderRadius["8"] */.Vq["8"],";transition:background-color 0.3s ease-in-out,border-color 0.3s ease-in-out;background-color:",_/* .colorTokens.bg.white */.I6.bg.white,";width:100%;",t&&(0,h/* .css */.AH)(gR(),_/* .colorTokens.stroke.brand */.I6.stroke.brand,_/* .colorTokens.background.hover */.I6.background.hover),":hover{background-color:",_/* .colorTokens.background.hover */.I6.background.hover,";}",n&&(0,h/* .css */.AH)(gL(),_/* .shadow.drag */.r7.drag))},content:/*#__PURE__*/(0,h/* .css */.AH)("padding:",_/* .spacing["16"] */.YK["16"],";",Y/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["12"] */.YK["12"],";")};// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/components/curriculum/TopicDragOverlay.tsx
var gQ=e=>{var{title:t}=e;return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:g$.wrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"dragVertical",width:24,height:24}),/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:t})]})};/* export default */const gG=gQ;var g$={wrapper:/*#__PURE__*/(0,h/* .css */.AH)("display:flex;align-items:center;gap:",_/* .spacing["8"] */.YK["8"],";border:1px solid ",_/* .colorTokens.stroke["default"] */.I6.stroke["default"],";border-radius:",_/* .borderRadius["8"] */.Vq["8"],";background-color:",_/* .colorTokens.background.hover */.I6.background.hover,";padding:",_/* .spacing["12"] */.YK["12"]," ",_/* .spacing["16"] */.YK["16"],";box-shadow:",_/* .shadow.drag */.r7.drag,";",F/* .typography.body */.I.body(),";color:",_/* .colorTokens.text.hints */.I6.text.hints,";cursor:grabbing;svg{color:",_/* .colorTokens.color.black["40"] */.I6.color.black["40"],";flex-shrink:0;}")};// EXTERNAL MODULE: ./assets/src/js/v3/entries/course-builder/components/layouts/CanvasHead.tsx
var gX=n(6267);// EXTERNAL MODULE: ./assets/src/js/v3/entries/course-builder/components/layouts/Navigator.tsx
var gZ=n(45934);// EXTERNAL MODULE: ./assets/src/js/v3/entries/course-builder/config/route-configs.ts + 1 modules
var gJ=n(76168);// CONCATENATED MODULE: ./assets/src/js/v3/public/images/curriculum-empty-state.webp
const g0=n.p+"js/images/curriculum-empty-state-2ba0e1ef.webp";// CONCATENATED MODULE: ./assets/src/js/v3/public/images/curriculum-empty-state-2x.webp
const g1=n.p+"js/images/curriculum-empty-state-2x-a99700d1.webp";// CONCATENATED MODULE: ./assets/src/js/v3/entries/course-builder/pages/Curriculum.tsx
var g2=(0,eg/* .getCourseId */.p)();var g4=()=>{var e=(0,u/* .useNavigate */.Zp)();(0,o.useEffect)(()=>{if(!g2){e(gJ/* .CourseBuilderRouteConfigs.Home.buildLink */.P.Home.buildLink(),{replace:true})}},[e]);var[t,n]=(0,o.useState)(true);var[s,h]=(0,o.useState)(false);var[_,Y]=(0,o.useState)(null);var[I,q]=(0,o.useState)([]);var C=(0,o.useRef)([]);var D=(0,ef/* .useCourseTopicQuery */.me)(g2);var E=(0,ef/* .useUpdateCourseContentOrderMutation */.Id)();(0,o.useEffect)(()=>{if(I.length===0){return}h(true);var e=2;var n=0;var a=[];var o=()=>{q(o=>{var s=[...o];for(var l=0;l<e&&n<s.length;l++,n++){var u=s[n];if(u.isSaved&&u.isCollapsed!==t){s[n]=(0,i._)((0,r._)({},u),{isCollapsed:t});if(!t){a.push(u.id)}}}return s});if(n<I.length){setTimeout(o,0)}else{C.current=t?[]:a;h(false)}};o();// eslint-disable-next-line react-hooks/exhaustive-deps
},[t]);(0,o.useEffect)(()=>{var e;if(!((e=D.data)===null||e===void 0?void 0:e.length)){return}var t=e=>{return D.data.map((t,n)=>{var a="topic-".concat(t.id);var o=n===0;var s=C.current.includes(a);var l=e.length?!s:!o;if(o&&!e.length){C.current=[a]}return(0,i._)((0,r._)({},t),{id:a,isCollapsed:l,isSaved:true,contents:t.contents.map(e=>{return(0,i._)((0,r._)({},e),{ID:"content-".concat(e.ID)})})})})};q(t)},[D.data]);var S=(0,o.useMemo)(()=>{if(!_){return null}var e=_.toString().includes("topic")?"topic":"content";var t=I.flatMap(e=>e.contents);var n=e==="topic"?I.find(e=>e.id===_):t.find(e=>e.ID===_);return n},[_,I]);var z=(0,d/* .useSensors */.FR)((0,d/* .useSensor */.MS)(d/* .PointerSensor */.AN,{activationConstraint:{distance:10}}),(0,d/* .useSensor */.MS)(d/* .KeyboardSensor */.uN,{coordinateGetter:p/* .sortableKeyboardCoordinates */.JR}));if(!g2){return null}if(D.isLoading){return/*#__PURE__*/(0,a/* .jsx */.Y)(g/* .LoadingOverlay */.p8,{})}var T=(e,t)=>{if(t==="topic"){return I.find(t=>t.id===e)}if(t==="content"){return I.find(t=>t.contents.find(t=>t.ID===e))}};var M=e=>{var{active:t,over:n}=e;if(!n||!t){return}if(t.id.toString().includes("content")&&n.id.toString().includes("content")&&t.id!==n.id){var r=T(t.id,"content");var i=T(n.id,"content");if(!r||!i)return;var a=I.findIndex(e=>e.id===r.id);var o=I.findIndex(e=>e.id===i.id);if(i.isCollapsed||a===o){return}var s=r.contents.findIndex(e=>e.ID===t.id);var l=i.contents.findIndex(e=>e.ID===n.id);var u=[...I];var[d]=u[a].contents.splice(s,1);u[o].contents.splice(l,0,d);q(u)}if(t.id.toString().includes("content")&&(n===null||n===void 0?void 0:n.id.toString().includes("topic"))&&t.id!==n.id){var c=T(t.id,"content");var p=T(n.id,"topic");if(!c||!p||p.contents.length>0||p.isCollapsed){return}var h=I.findIndex(e=>e.id===c.id);var v=I.findIndex(e=>e.id===p.id);if(h===v){return}var f=c.contents.findIndex(e=>e.ID===t.id);var g=[...I];var[m]=g[h].contents.splice(f,1);g[v].contents.push(m);q(g)}};var H=e=>{var t,n;var{active:i,over:a}=e;if(!a){Y(null);return}var o=[...I];if(i.id.toString().includes("topic")&&(a===null||a===void 0?void 0:a.id.toString().includes("topic"))&&i&&i.id!==a.id){var s=I.findIndex(e=>e.id===i.id);var l=I.findIndex(e=>e.id===a.id);o=(0,k/* .moveTo */.tw)(o,s,l);q(o)}if(i.id.toString().includes("content")&&(a===null||a===void 0?void 0:a.id.toString().includes("content"))&&i&&i.id!==a.id){var u=T(i.id,"content");var d=T(a.id,"content");if(!u||!d||d.isCollapsed){return}var c=I.findIndex(e=>e.id===u.id);var p=I.findIndex(e=>e.id===d.id);var h=u.contents.findIndex(e=>e.ID===i.id);var v=d.contents.findIndex(e=>e.ID===a.id);if(c===p){o[c].contents=(0,k/* .moveTo */.tw)(o[c].contents,h,v);q(o)}else{var[f]=o[c].contents.splice(h,1);o[p].contents.splice(v,0,f);q(o)}}if(i.id.toString().includes("content")&&a.id.toString().includes("topic")&&i&&i.id!==a.id){var g=T(i.id,"content");var m=T(a.id,"topic");if(!g||!m||m.isCollapsed){return}var _=I.findIndex(e=>e.id===g.id);var b=I.findIndex(e=>e.id===m.id);var y=g.contents.findIndex(e=>e.ID===i.id);var[w]=o[_].contents.splice(y,1);o[b].contents.push(w);q(o)}var A=o.reduce((e,t,n)=>{var r=0;e[n]={topic_id:(0,eg/* .getIdWithoutPrefix */.E)("topic-",t.id),lesson_ids:t.contents.reduce((e,t)=>{e[r]=(0,eg/* .getIdWithoutPrefix */.E)("content-",t.ID);r++;return e},{})};return e},{});E.mutate((0,r._)({tutor_topics_lessons_sorting:A},i.id.toString().includes("content")&&{"content_parent[parent_topic_id]":(n=D.data)===null||n===void 0?void 0:(t=n.find(e=>e.contents.find(e=>String(e.ID)===(0,eg/* .getIdWithoutPrefix */.E)("content-",a.id))))===null||t===void 0?void 0:t.id,"content_parent[content_id]":(0,eg/* .getIdWithoutPrefix */.E)("content-",i.id)}));Y(null)};var P=(e,t)=>{q(t=>t.filter((t,n)=>n!==e));C.current=C.current.filter(e=>e!==t)};var O=e=>{q(t=>t.map(t=>{if(t.id===e){return(0,i._)((0,r._)({},t),{isCollapsed:!t.isCollapsed})}return t}));if(!C.current.includes(e)){C.current=[...C.current,e]}else{C.current=C.current.filter(t=>t!==e)}};return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:g5.container,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:g5.wrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(gX/* ["default"] */.A,{title:(0,v.__)("Curriculum","tutor"),backUrl:"/basics",rightButton:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:I.some(e=>e.isSaved),children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"text",size:"small",onClick:()=>n(e=>!e),disabled:s,children:t?(0,v.__)("Expand All","tutor"):(0,v.__)("Collapse All","tutor")})})}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:g5.content,children:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:!D.isLoading&&D.data&&(D.data.length>0||I.length>0),fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(w/* ["default"] */.A,{emptyStateImage:g0,emptyStateImage2x:g1,imageAltText:(0,v.__)("Empty State Illustration","tutor"),title:(0,v.__)("Start building your course!","tutor"),description:(0,v.__)("Add Topics, Lessons, and Quizzes to get started.","tutor"),actions:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{"data-cy":"add-topic",variant:"secondary",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"plusSquareBrand",width:24,height:25}),onClick:()=>{q(()=>{return[{id:(0,k/* .nanoid */.Ak)(),title:"",summary:"",contents:[],isCollapsed:false,isSaved:false}]})},children:(0,v.__)("Add Topic","tutor")})}),children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:g5.topicWrapper,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)(d/* .DndContext */.Mp,{sensors:z,collisionDetection:d/* .closestCorners */.y$,measuring:A/* .droppableMeasuringStrategy */.s,modifiers:[c/* .restrictToWindowEdges */.Q_],onDragStart:e=>{Y(e.active.id)},onDragOver:e=>M(e),onDragEnd:e=>H(e),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(p/* .SortableContext */.gB,{items:I.map(e=>(0,i._)((0,r._)({},e),{id:e.id})),strategy:p/* .verticalListSortingStrategy */._G,children:/*#__PURE__*/(0,a/* .jsx */.Y)(b/* ["default"] */.A,{each:I,children:(e,t)=>{return e.isSaved&&/*#__PURE__*/(0,a/* .jsx */.Y)(gj,{topic:(0,i._)((0,r._)({},e),{isCollapsed:(_===null||_===void 0?void 0:_.toString().includes("topic"))?true:e.isCollapsed}),onDelete:()=>P(t,e.id),onCollapse:e=>O(e),onCopy:e=>{C.current=[e]},onEdit:e=>{C.current=[e]}},e.id)}})}),/*#__PURE__*/(0,l.createPortal)(/*#__PURE__*/(0,a/* .jsx */.Y)(d/* .DragOverlay */.Hd,{children:/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:S,children:e=>{return/*#__PURE__*/(0,a/* .jsx */.Y)(gG,{title:(_===null||_===void 0?void 0:_.toString().includes("topic"))?e.title:e.post_title})}})}),document.body)]}),/*#__PURE__*/(0,a/* .jsx */.Y)(b/* ["default"] */.A,{each:I,children:(e,t)=>{return!e.isSaved&&/*#__PURE__*/(0,a/* .jsx */.Y)(gj,{topic:(0,i._)((0,r._)({},e),{isCollapsed:false}),onDelete:()=>P(t,e.id),onCollapse:e=>O(e),onCopy:e=>{C.current=[e]},onEdit:e=>{C.current=[e]}},e.id)}})]})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(y/* ["default"] */.A,{when:I.length>0,children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:g5.addButtonWrapper,children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{"data-cy":"add-topic",variant:"secondary",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{name:"plusSquareBrand",width:24,height:24}),onClick:()=>{q(e=>{return[...e.map(e=>(0,i._)((0,r._)({},e),{isCollapsed:true})),{id:(0,k/* .nanoid */.Ak)(),title:"",summary:"",contents:[],isCollapsed:false,isSaved:false}]});C.current=[]},children:(0,v.__)("Add Topic","tutor")})})})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(gZ/* ["default"] */.A,{styleModifier:g5.navigator})]})};/* export default */const g6=g4;var g5={container:/*#__PURE__*/(0,h/* .css */.AH)("margin-top:",_/* .spacing["32"] */.YK["32"],";width:100%;",_/* .Breakpoint.smallTablet */.EA.smallTablet,"{margin-top:",_/* .spacing["16"] */.YK["16"],";}"),wrapper:/*#__PURE__*/(0,h/* .css */.AH)("width:100%;",Y/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["16"] */.YK["16"],";margin:0 auto;"),content:/*#__PURE__*/(0,h/* .css */.AH)("margin-top:",_/* .spacing["16"] */.YK["16"],";",_/* .Breakpoint.smallMobile */.EA.smallMobile,"{margin-top:0;}"),topicWrapper:/*#__PURE__*/(0,h/* .css */.AH)(Y/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["16"] */.YK["16"],";align-items:center;"),addButtonWrapper:/*#__PURE__*/(0,h/* .css */.AH)("path{stroke:",_/* .colorTokens.icon.brand */.I6.icon.brand,";}"),navigator:/*#__PURE__*/(0,h/* .css */.AH)("margin:",_/* .spacing["40"] */.YK["40"]," auto;")}},24628:function(e,t,n){n.d(t,{$2:()=>H,$n:()=>A,Cx:()=>k,Id:()=>S,K3:()=>q,OJ:()=>W,R6:()=>f,SS:()=>L,V1:()=>y,VT:()=>D,V_:()=>O,_u:()=>B,gK:()=>N,me:()=>_,pR:()=>T,sC:()=>g});/* import */var r=n(41147);/* import */var i=n(14206);/* import */var a=n(37586);/* import */var o=n(92965);/* import */var s=n(32047);/* import */var l=n(12470);/* import */var u=/*#__PURE__*/n.n(l);/* import */var d=n(40925);/* import */var c=n(19393);/* import */var p=n(77239);/* import */var h=n(94812);/* import */var v=n(33231);var f=(e,t,n,a,o)=>{var s,l;var u;return(0,r._)((0,i._)((0,r._)((0,i._)((0,r._)((0,i._)((0,r._)({},t&&{lesson_id:t}),{topic_id:n,title:e.title,description:e.description,thumbnail_id:(u=(s=e.thumbnail)===null||s===void 0?void 0:s.id)!==null&&u!==void 0?u:null}),e.video?Object.fromEntries(Object.entries(e.video).map(t=>{var[n,r]=t;var i;return["video[".concat(n,"]"),n==="source"&&!r?"-1":n==="poster_url"&&!((i=e.video)===null||i===void 0?void 0:i.poster)?"":r]})):{}),{"video[runtime][hours]":e.duration.hour||0,"video[runtime][minutes]":e.duration.minute||0,"video[runtime][seconds]":e.duration.second||0}),(0,v/* .isAddonEnabled */.GR)(c/* .Addons.TUTOR_COURSE_PREVIEW */.oW.TUTOR_COURSE_PREVIEW)&&{_is_preview:e.lesson_preview?1:0}),{tutor_attachments:(e.tutor_attachments||[]).map(e=>e.id)}),(0,v/* .isAddonEnabled */.GR)(c/* .Addons.CONTENT_DRIP */.oW.CONTENT_DRIP)&&a==="unlock_by_date"&&{"content_drip_settings[unlock_date]":e.content_drip_settings.unlock_date||""},(0,v/* .isAddonEnabled */.GR)(c/* .Addons.CONTENT_DRIP */.oW.CONTENT_DRIP)&&a==="specific_days"&&{"content_drip_settings[after_xdays_of_enroll]":e.content_drip_settings.after_xdays_of_enroll||"0"},(0,v/* .isAddonEnabled */.GR)(c/* .Addons.CONTENT_DRIP */.oW.CONTENT_DRIP)&&a==="after_finishing_prerequisites"&&{"content_drip_settings[prerequisites]":((l=e.content_drip_settings.prerequisites)===null||l===void 0?void 0:l.length)?e.content_drip_settings.prerequisites:""},Object.fromEntries(o.map(t=>{return[t,e[t]||""]})))};var g=(e,t,n,a,o)=>{var s;return(0,r._)((0,i._)((0,r._)({},t&&{assignment_id:t}),{topic_id:n,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,"assignment_option[is_retry_allowed]":e.is_retry_allowed?"1":"0"}),e.is_retry_allowed&&{"assignment_option[attempts_allowed]":e.attempts_allowed},(0,v/* .isAddonEnabled */.GR)(c/* .Addons.CONTENT_DRIP */.oW.CONTENT_DRIP)&&a==="unlock_by_date"&&{"content_drip_settings[unlock_date]":e.content_drip_settings.unlock_date||""},(0,v/* .isAddonEnabled */.GR)(c/* .Addons.CONTENT_DRIP */.oW.CONTENT_DRIP)&&a==="specific_days"&&{"content_drip_settings[after_xdays_of_enroll]":e.content_drip_settings.after_xdays_of_enroll||"0"},(0,v/* .isAddonEnabled */.GR)(c/* .Addons.CONTENT_DRIP */.oW.CONTENT_DRIP)&&a==="after_finishing_prerequisites"&&{"content_drip_settings[prerequisites]":((s=e.content_drip_settings.prerequisites)===null||s===void 0?void 0:s.length)?e.content_drip_settings.prerequisites:""},Object.fromEntries(o.map(t=>{return[t,e[t]||""]})))};var m=e=>{return p/* .wpAjaxInstance.get */.b.get(h/* ["default"].GET_COURSE_CONTENTS */.A.GET_COURSE_CONTENTS,{params:{course_id:e}})};var _=e=>{return(0,a/* .useQuery */.I)({queryKey:["Topic",e],queryFn:()=>m(e).then(e=>{return e.data.map(e=>(0,i._)((0,r._)({},e),{contents:e.contents.map(e=>(0,i._)((0,r._)({},e),{post_type:e.quiz_type?"tutor_h5p_quiz":e.post_type}))}))}),enabled:!!e})};var b=e=>{return p/* .wpAjaxInstance.post */.b.post(h/* ["default"].SAVE_TOPIC */.A.SAVE_TOPIC,e)};var y=()=>{var e=(0,o/* .useQueryClient */.jE)();var{showToast:t}=(0,d/* .useToast */.d)();return(0,s/* .useMutation */.n)({mutationFn:b,onSuccess:n=>{if(n.data){t({message:(0,l.__)("Topic saved successfully","tutor"),type:"success"});e.invalidateQueries({queryKey:["Topic"]})}},onError:e=>{t({type:"danger",message:(0,v/* .convertToErrorMessage */.EL)(e)})}})};var w=e=>{return p/* .wpAjaxInstance.post */.b.post(h/* ["default"].DELETE_TOPIC */.A.DELETE_TOPIC,{topic_id:e})};var A=e=>{var t=(0,o/* .useQueryClient */.jE)();var{showToast:n}=(0,d/* .useToast */.d)();return(0,s/* .useMutation */.n)({mutationFn:w,onSuccess:(r,i)=>{if(r.status_code===200){n({message:(0,l.__)(r.message,"tutor"),type:"success"});t.setQueryData(["Topic",e],e=>{var t=JSON.parse(JSON.stringify(e));return t.filter(e=>String(e.id)!==String(i))})}},onError:e=>{n({type:"danger",message:(0,v/* .convertToErrorMessage */.EL)(e)});t.invalidateQueries({queryKey:["Topic"]})}})};var Y=(e,t)=>{return p/* .wpAjaxInstance.get */.b.get(h/* ["default"].GET_LESSON_DETAILS */.A.GET_LESSON_DETAILS,{params:{topic_id:t,lesson_id:e}})};var k=(e,t)=>{return(0,a/* .useQuery */.I)({queryKey:["Lesson",e,t],queryFn:()=>Y(e,t).then(e=>e.data),enabled:!!e&&!!t})};var I=e=>{return p/* .wpAjaxInstance.post */.b.post(h/* ["default"].SAVE_LESSON */.A.SAVE_LESSON,e)};var q=e=>{var t=(0,o/* .useQueryClient */.jE)();var{showToast:n}=(0,d/* .useToast */.d)();return(0,s/* .useMutation */.n)({mutationFn:e=>I(e),onSuccess:(r,i)=>{if(r.data){t.invalidateQueries({queryKey:["Topic",e]});t.invalidateQueries({queryKey:["Lesson",i.lesson_id,i.topic_id]});n({message:(0,l.__)("Lesson saved successfully","tutor"),type:"success"})}},onError:e=>{n({type:"danger",message:(0,v/* .convertToErrorMessage */.EL)(e)})}})};var C=e=>{return p/* .wpAjaxInstance.post */.b.post(h/* ["default"].DELETE_TOPIC_CONTENT */.A.DELETE_TOPIC_CONTENT,{lesson_id:e})};var D=()=>{var e=(0,o/* .useQueryClient */.jE)();var{showToast:t}=(0,d/* .useToast */.d)();return(0,s/* .useMutation */.n)({mutationFn:C,onSuccess:n=>{if(n.status_code===200){t({message:(0,l.__)(n.message,"tutor"),type:"success"});e.invalidateQueries({queryKey:["Topic"]})}},onError:e=>{t({type:"danger",message:(0,v/* .convertToErrorMessage */.EL)(e)})}})};var E=e=>{return p/* .wpAjaxInstance.post */.b.post(h/* ["default"].UPDATE_COURSE_CONTENT_ORDER */.A.UPDATE_COURSE_CONTENT_ORDER,e)};var S=()=>{var{showToast:e}=(0,d/* .useToast */.d)();return(0,s/* .useMutation */.n)({mutationFn:E,onError:t=>{e({type:"danger",message:(0,v/* .convertToErrorMessage */.EL)(t)})}})};var z=(e,t)=>{return p/* .wpAjaxInstance.get */.b.get(h/* ["default"].GET_ASSIGNMENT_DETAILS */.A.GET_ASSIGNMENT_DETAILS,{params:{topic_id:t,assignment_id:e}})};var T=(e,t)=>{return(0,a/* .useQuery */.I)({queryKey:["Assignment",e,t],queryFn:()=>z(e,t).then(e=>e.data),enabled:!!e&&!!t})};var M=e=>{return p/* .wpAjaxInstance.post */.b.post(h/* ["default"].SAVE_ASSIGNMENT */.A.SAVE_ASSIGNMENT,e)};var H=e=>{var t=(0,o/* .useQueryClient */.jE)();var{showToast:n}=(0,d/* .useToast */.d)();return(0,s/* .useMutation */.n)({mutationFn:e=>M(e),onSuccess:(r,i)=>{if(r.status_code===200||r.status_code===201){t.invalidateQueries({queryKey:["Topic",Number(e)]});t.invalidateQueries({queryKey:["Assignment",i.assignment_id,i.topic_id]});n({message:(0,l.__)(r.message,"tutor"),type:"success"})}},onError:e=>{n({type:"danger",message:(0,v/* .convertToErrorMessage */.EL)(e)})}})};var P=e=>{return p/* .wpAjaxInstance.post */.b.post(h/* ["default"].DUPLICATE_CONTENT */.A.DUPLICATE_CONTENT,e)};/**
 *
 * @param quizId pass when duplicating 'answer'
 * @returns useMutation
 */var O=e=>{var t=(0,o/* .useQueryClient */.jE)();var{showToast:n}=(0,d/* .useToast */.d)();return(0,s/* .useMutation */.n)({mutationFn:P,onSuccess:(r,i)=>{if(r.status_code===200||r.status_code===201){n({message:(0,l.__)(r.message,"tutor"),type:"success"});if(["lesson","assignment","quiz","topic"].includes(i.content_type)){t.invalidateQueries({queryKey:["Topic"]});return}if(["question"].includes(i.content_type)){t.invalidateQueries({queryKey:["Quiz",e]});return}}},onError:(r,i)=>{n({message:(0,v/* .convertToErrorMessage */.EL)(r),type:"danger"});if(["answer"].includes(i.content_type)){t.invalidateQueries({queryKey:["Quiz",e]})}}})};var F=(e,t)=>{return p/* .wpAjaxInstance.get */.b.get(h/* ["default"].GET_ZOOM_MEETING_DETAILS */.A.GET_ZOOM_MEETING_DETAILS,{params:{meeting_id:e,topic_id:t}})};var N=(e,t)=>{return(0,a/* .useQuery */.I)({queryKey:["ZoomMeeting",e],queryFn:()=>F(e,t).then(e=>e.data),enabled:!!e&&!!t})};var K=(e,t)=>{return p/* .wpAjaxInstance.get */.b.get(h/* ["default"].GET_GOOGLE_MEET_DETAILS */.A.GET_GOOGLE_MEET_DETAILS,{params:{meeting_id:e,topic_id:t}})};var W=(e,t)=>{return(0,a/* .useQuery */.I)({queryKey:["GoogleMeet",e],queryFn:()=>K(e,t).then(e=>e.data),enabled:!!e&&!!t})};var R=e=>{return p/* .wpAjaxInstance.post */.b.post(h/* ["default"].ADD_CONTENT_BANK_CONTENT_TO_COURSE */.A.ADD_CONTENT_BANK_CONTENT_TO_COURSE,e)};var L=()=>{var e=(0,o/* .useQueryClient */.jE)();var{showToast:t}=(0,d/* .useToast */.d)();return(0,s/* .useMutation */.n)({mutationFn:R,onSuccess:(n,r)=>{if(n.status_code===200){t({message:(0,l.__)(n.message,"tutor"),type:"success"});e.invalidateQueries({queryKey:["Topic",r.course_id]})}},onError:e=>{t({type:"danger",message:(0,v/* .convertToErrorMessage */.EL)(e)})}})};var U=e=>{var{topicId:t,contentId:n}=e;return p/* .wpAjaxInstance.post */.b.post(h/* ["default"].DELETE_CONTENT_BANK_CONTENT_FROM_COURSE */.A.DELETE_CONTENT_BANK_CONTENT_FROM_COURSE,{topic_id:t,content_id:n})};var B=()=>{var e=(0,o/* .useQueryClient */.jE)();var{showToast:t}=(0,d/* .useToast */.d)();return(0,s/* .useMutation */.n)({mutationFn:U,onSuccess:n=>{if(n.status_code===200){t({message:(0,l.__)(n.message,"tutor"),type:"success"});e.invalidateQueries({queryKey:["Topic"]})}},onError:e=>{t({type:"danger",message:(0,v/* .convertToErrorMessage */.EL)(e)})}})}},81253:function(e,t,n){n.d(t,{A:()=>w});/* import */var r=n(41147);/* import */var i=n(14206);/* import */var a=n(60599);/* import */var o=n(52639);/* import */var s=n(41594);/* import */var l=/*#__PURE__*/n.n(s);/* import */var u=n(42771);/* import */var d=n(13448);/* import */var c=n(81547);/* import */var p=n(33231);function h(){var e=(0,a._)(["\n      cursor: not-allowed;\n    "]);h=function t(){return e};return e}function v(){var e=(0,a._)(["\n      color: ",";\n    "]);v=function t(){return e};return e}function f(){var e=(0,a._)(["\n        margin-right: ",";\n      "]);f=function t(){return e};return e}function g(){var e=(0,a._)(["\n        background-color: ",";\n      "]);g=function t(){return e};return e}function m(){var e=(0,a._)(["\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    "]);m=function t(){return e};return e}function _(){var e=(0,a._)(["\n      & + span {\n        cursor: not-allowed;\n\n        &::before {\n          border-color: ",";\n        }\n      }\n    "]);_=function t(){return e};return e}var b=/*#__PURE__*/l().forwardRef((e,t)=>{var{id:n=(0,p/* .nanoid */.Ak)(),name:a,labelCss:s,inputCss:u,label:d="",checked:c,value:h,disabled:v=false,onChange:f,onBlur:g,isIndeterminate:m=false}=e;var _=e=>{f===null||f===void 0?void 0:f(!m?e.target.checked:true,e)};var b=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__*/l().isValidElement(e)){var t;var n=(t=e.props)===null||t===void 0?void 0:t.children;if(typeof n==="string"){return n}if(Array.isArray(n)){return n.map(e=>typeof e==="string"?e:"").filter(Boolean).join(" ")}}return""};return/*#__PURE__*/(0,o/* .jsxs */.FD)("label",{htmlFor:n,css:[y.container({disabled:v}),s],children:[/*#__PURE__*/(0,o/* .jsx */.Y)("input",(0,i._)((0,r._)({},e),{ref:t,id:n,name:a,type:"checkbox",value:h,checked:!!c,disabled:v,"aria-invalid":e["aria-invalid"],onChange:_,onBlur:g,css:[u,y.checkbox({label:!!d,isIndeterminate:m,disabled:v})]})),/*#__PURE__*/(0,o/* .jsx */.Y)("span",{}),/*#__PURE__*/(0,o/* .jsx */.Y)("span",{css:[y.label({isDisabled:v}),s],title:b(d),children:d})]})});var y={container:e=>{var{disabled:t=false}=e;return/*#__PURE__*/(0,u/* .css */.AH)("position:relative;display:flex;align-items:center;cursor:pointer;user-select:none;color:",d/* .colorTokens.text.title */.I6.text.title,";",t&&(0,u/* .css */.AH)(h()))},label:e=>{var{isDisabled:t=false}=e;return/*#__PURE__*/(0,u/* .css */.AH)(c/* .typography.caption */.I.caption(),";color:",d/* .colorTokens.text.title */.I6.text.title,";",t&&(0,u/* .css */.AH)(v(),d/* .colorTokens.text.disable */.I6.text.disable))},checkbox:e=>{var{label:t,isIndeterminate:n,disabled:r}=e;return/*#__PURE__*/(0,u/* .css */.AH)("position:absolute;display:none !important;opacity:0 !important;height:0;width:0;& + span{position:relative;cursor:pointer;display:inline-flex;align-items:center;",t&&(0,u/* .css */.AH)(f(),d/* .spacing["10"] */.YK["10"]),"}& + span::before{content:'';background-color:",d/* .colorTokens.background.white */.I6.background.white,";border:1px solid ",d/* .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:",d/* .colorTokens.icon.brand */.I6.icon.brand,";border-radius:",d/* .borderRadius["4"] */.Vq["4"],";",r&&(0,u/* .css */.AH)(g(),d/* .colorTokens.icon.disable["default"] */.I6.icon.disable["default"]),"}",n&&(0,u/* .css */.AH)(m(),d/* .colorTokens.brand.blue */.I6.brand.blue,d/* .colorTokens.stroke.white */.I6.stroke.white)," ",r&&(0,u/* .css */.AH)(_(),d/* .colorTokens.stroke.disable */.I6.stroke.disable),"    &:focus-visible{& + span{border-radius:",d/* .borderRadius["2"] */.Vq["2"],";outline:2px solid ",d/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:1px;}}")}};/* export default */const w=b},12427:function(e,t,n){n.d(t,{A:()=>y});/* import */var r=n(60599);/* import */var i=n(52639);/* import */var a=n(42771);/* import */var o=n(12470);/* import */var s=/*#__PURE__*/n.n(o);/* import */var l=n(18853);/* import */var u=/*#__PURE__*/n.n(l);/* import */var d=n(25074);/* import */var c=n(46225);/* import */var p=n(13448);/* import */var h=n(81547);/* import */var v=n(59189);/* import */var f=n(56705);function g(){var e=(0,r._)(["\n      width: 168px;\n    "]);g=function t(){return e};return e}function m(){var e=(0,r._)(["\n      width: 168px;\n    "]);m=function t(){return e};return e}var _={large:"regular",regular:"small",small:"small"};var b=e=>{var{buttonText:t=(0,o.__)("Upload Media","tutor"),infoText:n,size:r="regular",value:s,uploadHandler:l,clearHandler:u,emptyImageCss:h,previewImageCss:g,overlayCss:m,replaceButtonText:b,loading:y,disabled:A=false,isClearAble:Y=true}=e;return/*#__PURE__*/(0,i/* .jsx */.Y)(v/* ["default"] */.A,{when:!y,fallback:/*#__PURE__*/(0,i/* .jsx */.Y)("div",{css:w.emptyMedia({size:r,isDisabled:A}),children:/*#__PURE__*/(0,i/* .jsx */.Y)(f/* .LoadingOverlay */.p8,{})}),children:/*#__PURE__*/(0,i/* .jsx */.Y)(v/* ["default"] */.A,{when:s===null||s===void 0?void 0:s.url,fallback:/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{"aria-disabled":A,css:[w.emptyMedia({size:r,isDisabled:A}),h],onClick:e=>{e.stopPropagation();if(A){return}l()},onKeyDown:e=>{if(!A&&e.key==="Enter"){e.preventDefault();l()}},children:[/*#__PURE__*/(0,i/* .jsx */.Y)(c/* ["default"] */.A,{name:"addImage",width:32,height:32}),/*#__PURE__*/(0,i/* .jsx */.Y)(d/* ["default"] */.A,{disabled:A,size:_[r],variant:"secondary",buttonContentCss:w.buttonText,"data-cy":"upload-media",children:t}),/*#__PURE__*/(0,i/* .jsx */.Y)(v/* ["default"] */.A,{when:n,children:/*#__PURE__*/(0,i/* .jsx */.Y)("p",{css:w.infoTexts,children:n})})]}),children:e=>{return/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:[w.previewWrapper({size:r,isDisabled:A}),g],"data-cy":"media-preview",children:[/*#__PURE__*/(0,i/* .jsx */.Y)("img",{src:e,alt:s===null||s===void 0?void 0:s.title,css:w.imagePreview}),/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:[w.hoverPreview,m],"data-hover-buttons-wrapper":true,children:[/*#__PURE__*/(0,i/* .jsx */.Y)(d/* ["default"] */.A,{disabled:A,variant:"secondary",size:_[r],buttonCss:/*#__PURE__*/(0,a/* .css */.AH)("margin-top:",Y&&p/* .spacing["16"] */.YK["16"],";"),onClick:e=>{e.stopPropagation();l()},"data-cy":"replace-media",children:b||(0,o.__)("Replace Image","tutor")}),/*#__PURE__*/(0,i/* .jsx */.Y)(v/* ["default"] */.A,{when:Y,children:/*#__PURE__*/(0,i/* .jsx */.Y)(d/* ["default"] */.A,{disabled:A,variant:"text",size:_[r],onClick:e=>{e.stopPropagation();u()},"data-cy":"clear-media",children:(0,o.__)("Remove","tutor")})})]})]})}})})};/* export default */const y=b;var w={emptyMedia:e=>{var{size:t,isDisabled:n}=e;return/*#__PURE__*/(0,a/* .css */.AH)("width:100%;height:168px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:",p/* .spacing["8"] */.YK["8"],";border:1px dashed ",p/* .colorTokens.stroke.border */.I6.stroke.border,";border-radius:",p/* .borderRadius["8"] */.Vq["8"],";background-color:",p/* .colorTokens.bg.white */.I6.bg.white,";overflow:hidden;cursor:",n?"not-allowed":"pointer",";",t==="small"&&(0,a/* .css */.AH)(g()),"    svg{color:",p/* .colorTokens.icon["default"] */.I6.icon["default"],";}&:hover svg{color:",!n&&p/* .colorTokens.brand.blue */.I6.brand.blue,";}")},buttonText:/*#__PURE__*/(0,a/* .css */.AH)("color:",p/* .colorTokens.text.brand */.I6.text.brand,";"),infoTexts:/*#__PURE__*/(0,a/* .css */.AH)(h/* .typography.tiny */.I.tiny(),";color:",p/* .colorTokens.text.subdued */.I6.text.subdued,";text-align:center;"),previewWrapper:e=>{var{size:t,isDisabled:n}=e;return/*#__PURE__*/(0,a/* .css */.AH)("width:100%;height:168px;border:1px solid ",p/* .colorTokens.stroke["default"] */.I6.stroke["default"],";border-radius:",p/* .borderRadius["8"] */.Vq["8"],";overflow:hidden;position:relative;background-color:",p/* .colorTokens.bg.white */.I6.bg.white,";",t==="small"&&(0,a/* .css */.AH)(m()),"    &:hover{[data-hover-buttons-wrapper]{display:",n?"none":"flex",";opacity:",n?0:1,";}}")},imagePreview:/*#__PURE__*/(0,a/* .css */.AH)("height:100%;width:100%;object-fit:contain;"),hoverPreview:/*#__PURE__*/(0,a/* .css */.AH)("display:flex;flex-direction:column;justify-content:center;align-items:center;gap:",p/* .spacing["8"] */.YK["8"],";opacity:0;position:absolute;inset:0;background-color:",u()(p/* .colorTokens.color.black.main */.I6.color.black.main,.6),";button:first-of-type{box-shadow:",p/* .shadow.button */.r7.button,";}button:last-of-type:not(:only-of-type){color:",p/* .colorTokens.text.white */.I6.text.white,";box-shadow:none;}")}},84492:function(e,t,n){n.d(t,{A:()=>v});/* import */var r=n(60599);/* import */var i=n(52639);/* import */var a=n(42771);/* import */var o=n(13448);/* import */var s=n(59189);/* import */var l=n(49842);/* import */var u=n(46225);function d(){var e=(0,r._)(["\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    "]);d=function t(){return e};return e}function c(){var e=(0,r._)(["\n        padding: 0;\n        padding-inline: ",";\n        margin: 0;\n      "]);c=function t(){return e};return e}function p(){var e=(0,r._)(["\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    "]);p=function t(){return e};return e}var h=e=>{var{children:t,content:n,size:r="regular",textOnly:a}=e;return/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:g.wrapper({hasChildren:(0,l/* .isDefined */.O9)(t),size:r}),children:[t,/*#__PURE__*/(0,i/* .jsx */.Y)(s/* ["default"] */.A,{when:!(0,l/* .isDefined */.O9)(t)&&!a,children:/*#__PURE__*/(0,i/* .jsx */.Y)(u/* ["default"] */.A,{name:r==="tiny"?"crownRoundedSmall":"crownRounded",width:f[r].iconSize,height:f[r].iconSize})}),/*#__PURE__*/(0,i/* .jsx */.Y)("div",{css:g.content({hasChildren:(0,l/* .isDefined */.O9)(t),size:r,textOnly:a}),children:(0,l/* .isDefined */.O9)(t)?/*#__PURE__*/(0,i/* .jsx */.Y)(u/* ["default"] */.A,{name:r==="tiny"?"crownRoundedSmall":"crownRounded",width:r==="tiny"?f[r].iconSize:16}):n})]})};/* export default */const v=h;var f={tiny:{borderRadius:o/* .spacing["10"] */.YK["10"],height:o/* .spacing["10"] */.YK["10"],gap:o/* .spacing["2"] */.YK["2"],iconSize:10,fontSize:"0.5rem",lineHeight:"0.625rem"},small:{borderRadius:o/* .spacing["16"] */.YK["16"],height:o/* .spacing["16"] */.YK["16"],gap:o/* .spacing["4"] */.YK["4"],iconSize:16,fontSize:o/* .fontSize["10"] */.J["10"],lineHeight:o/* .lineHeight["16"] */.K_["16"]},regular:{borderRadius:"22px",height:"22px",gap:"5px",iconSize:22,fontSize:o/* .fontSize["14"] */.J["14"],lineHeight:o/* .lineHeight["18"] */.K_["18"]},large:{borderRadius:"26px",height:"26px",gap:o/* .spacing["6"] */.YK["6"],iconSize:26,fontSize:o/* .fontSize["16"] */.J["16"],lineHeight:o/* .lineHeight["26"] */.K_["26"]}};var g={wrapper:e=>{var{hasChildren:t,size:n="regular"}=e;return/*#__PURE__*/(0,a/* .css */.AH)("position:relative;svg{flex-shrink:0;}",!t&&(0,a/* .css */.AH)(d(),f[n].height,f[n].borderRadius,f[n].gap))},content:e=>{var{hasChildren:t,size:n="regular",textOnly:r}=e;return/*#__PURE__*/(0,a/* .css */.AH)("position:absolute;top:0;right:0;display:flex;flex-shrink:0;transform:translateX(50%) translateY(-50%);",!t&&(0,a/* .css */.AH)(p(),o/* .spacing["2"] */.YK["2"],o/* .colorTokens.icon.white */.I6.icon.white,f[n].gap,f[n].fontSize,f[n].lineHeight,r&&(0,a/* .css */.AH)(c(),o/* .spacing["6"] */.YK["6"])))}}},19897:function(e,t,n){n.d(t,{A:()=>g});/* import */var r=n(60599);/* import */var i=n(52639);/* import */var a=n(41594);/* import */var o=/*#__PURE__*/n.n(a);/* import */var s=n(42771);/* import */var l=n(13448);/* import */var u=n(81547);/* import */var d=n(52874);/* import */var c=n(33231);function p(){var e=(0,r._)(["\n      color: ",";\n    "]);p=function t(){return e};return e}function h(){var e=(0,r._)(["\n        margin-right: ",";\n      "]);h=function t(){return e};return e}var v=/*#__PURE__*/o().forwardRef((e,t)=>{var{name:n,checked:r,readOnly:a,disabled:o=false,labelCss:s,label:l,icon:u,value:d,onChange:p,onBlur:h,description:v}=e;var g=(0,c/* .nanoid */.Ak)();return/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:f.wrapper,children:[/*#__PURE__*/(0,i/* .jsxs */.FD)("label",{htmlFor:g,css:[f.container(o),s],children:[/*#__PURE__*/(0,i/* .jsx */.Y)("input",{ref:t,id:g,name:n,type:"radio",checked:r,readOnly:a,value:d,disabled:o,onChange:p,onBlur:h,css:[f.radio(l)]}),/*#__PURE__*/(0,i/* .jsx */.Y)("span",{}),u,l]}),v&&/*#__PURE__*/(0,i/* .jsx */.Y)("p",{css:f.description,children:v})]})});var f={wrapper:/*#__PURE__*/(0,s/* .css */.AH)(d/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",l/* .spacing["8"] */.YK["8"],";"),container:e=>/*#__PURE__*/(0,s/* .css */.AH)(u/* .typography.caption */.I.caption(),";display:flex;align-items:center;cursor:pointer;user-select:none;",e&&(0,s/* .css */.AH)(p(),l/* .colorTokens.text.disable */.I6.text.disable)),radio:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return/*#__PURE__*/(0,s/* .css */.AH)("position:absolute;opacity:0;height:0;width:0;cursor:pointer;& + span{position:relative;cursor:pointer;height:18px;width:18px;background-color:",l/* .colorTokens.background.white */.I6.background.white,";border:2px solid ",l/* .colorTokens.stroke["default"] */.I6.stroke["default"],";border-radius:100%;",e&&(0,s/* .css */.AH)(h(),l/* .spacing["10"] */.YK["10"]),"}& + span::before{content:'';position:absolute;left:3px;top:3px;background-color:",l/* .colorTokens.background.white */.I6.background.white,";width:8px;height:8px;border-radius:100%;}&:checked + span{border-color:",l/* .colorTokens.action.primary["default"] */.I6.action.primary["default"],";}&:checked + span::before{background-color:",l/* .colorTokens.action.primary["default"] */.I6.action.primary["default"],";}&:focus-visible{& + span{outline:2px solid ",l/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:1px;}}")},description:/*#__PURE__*/(0,s/* .css */.AH)(u/* .typography.small */.I.small(),";color:",l/* .colorTokens.text.hints */.I6.text.hints,";padding-left:30px;")};/* export default */const g=v},94361:function(e,t,n){n.d(t,{w:()=>u});/* import */var r=n(52639);/* import */var i=n(41594);/* import */var a=/*#__PURE__*/n.n(i);/* import */var o=n(42771);/* import */var s=n(13448);/* import */var l=n(78931);var u=/*#__PURE__*/a().forwardRef((e,t)=>{var{className:n,variant:i}=e;return/*#__PURE__*/(0,r/* .jsx */.Y)("div",{className:n,ref:t,css:c({variant:i})})});u.displayName="Separator";var d={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:",s/* .colorTokens.stroke.divider */.I6.stroke.divider,";")};var c=(0,l/* .createVariation */.s)({variants:{variant:{horizontal:d.horizontal,vertical:d.vertical}},defaultVariants:{variant:"horizontal"}},d.base)},54184:function(e,t,n){n.d(t,{A:()=>A});/* import */var r=n(41147);/* import */var i=n(14206);/* import */var a=n(60599);/* import */var o=n(52639);/* import */var s=n(41594);/* import */var l=/*#__PURE__*/n.n(s);/* import */var u=n(42771);/* import */var d=n(74412);/* import */var c=n(19393);/* import */var p=n(13448);/* import */var h=n(52874);/* import */var v=n(33231);function f(){var e=(0,a._)(["\n        ","\n      "]);f=function t(){return e};return e}function g(){var e=(0,a._)(["\n        border-top-right-radius: ",";\n      "]);g=function t(){return e};return e}function m(){var e=(0,a._)(["\n          ","\n        "]);m=function t(){return e};return e}function _(){var e=(0,a._)(["\n      .mce-tinymce.mce-container {\n        border: ",";\n        border-radius: ",";\n\n        ","\n      }\n    "]);_=function t(){return e};return e}var b=!!d/* .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 y(e,t,n,r,i,a,o,s,l,u,c,p,h){var v=p!==null&&p!==void 0?p:r?"bold italic underline | image | ".concat(b?"codesample":""):"formatselect bold italic underline | bullist numlist | blockquote | alignleft aligncenter alignright | link unlink | wp_more ".concat(b?" codesample":""," | wp_adv");var f=h!==null&&h!==void 0?h:"strikethrough hr | forecolor pastetext removeformat | charmap | outdent indent | undo redo | wp_help | fullscreen";v=c?v:v.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,wordpress,wpautoresize,wpeditimage,wpemoji,wpgallery,wplink,wpdialogs,wptextpattern,wpview".concat(b?",codesample":""),skin:"light",skin_url:"".concat(d/* .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:v,toolbar2:r?false:f,content_css:"".concat(d/* .tutorConfig.site_url */.P.site_url,"/wp-includes/css/dashicons.min.css,").concat(d/* .tutorConfig.site_url */.P.site_url,"/wp-includes/js/tinymce/skins/wordpress/wp-content.css,").concat(d/* .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:r=>{r.on("init",()=>{if(e&&!s){r.getBody().focus()}if(s){r.setMode("readonly");var t=r.contentDocument.querySelector(".mce-content-body");t.style.backgroundColor="transparent";setTimeout(()=>{var e=t.scrollHeight;if(e){r.iframeElement.style.height="".concat(e,"px")}},500)}});r.on("change keyup paste",()=>{t(r.getContent())});r.on("focus",()=>{n(true)});r.on("blur",()=>n(false));r.on("FullscreenStateChanged",e=>{var t=document.getElementById("tutor-course-builder");var n=document.getElementById("tutor-course-bundle-builder-root");var r=t||n;if(r){if(e.state){r.style.position="relative";r.style.zIndex="100000"}else{r.removeAttribute("style")}}o===null||o===void 0?void 0:o(e.state)})},wp_keep_scroll_position:false,wpeditimage_html5_captions:true},mediaButtons:!i&&!r&&!s,drag_drop_upload:true,quicktags:a||r||s?false:{buttons:["strong","em","block","del","ins","img","ul","ol","li","code","more","close"]}}}var w=e=>{var{value:t="",onChange:n,isMinimal:a,hideMediaButtons:l,hideQuickTags:u,autoFocus:d=false,onFullScreenChange:p,readonly:h=false,min_height:f,max_height:g,toolbar1:m,toolbar2:_}=e;var b=(0,s.useRef)(null);var{current:w}=(0,s.useRef)((0,v/* .nanoid */.Ak)());var[A,k]=(0,s.useState)(d);var I=e=>{var t=e.target;n(t.value)};var q=(0,s.useCallback)(e=>{var{tinymce:t}=window;if(!t||A){return}var n=window.tinymce.get(w);if(n){if(e!==n.getContent()){n.setContent(e)}}},[w,A]);(0,s.useEffect)(()=>{q(t);// eslint-disable-next-line react-hooks/exhaustive-deps
},[t]);(0,s.useEffect)(()=>{var e=b.current;if(typeof window.wp!=="undefined"&&window.wp.editor){var o=y(A,n,k,a,l,u,p,h,f,g,c/* .CURRENT_VIEWPORT.isAboveMobile */.vN.isAboveMobile,m,_);// When rendered inside an iframe (e.g., via createPortal),
// wp.editor.initialize() fails because it uses document.getElementById()
// which only searches the parent document. Additionally, standard TinyMCE
// mode creates a content iframe internally using parent document DOM APIs,
// causing editor.getBody() to return undefined in cross-document contexts.
// Using inline mode with the `target` option avoids both issues:
// TinyMCE renders directly into the target element without a content iframe.
var s=e&&e.ownerDocument!==document;if(s){var d,v;var Y=window.tinymce.get(w);if(Y){Y.remove()}// TinyMCE inline mode requires a block-level element (not textarea).
// Create a div in the iframe's document to serve as the inline editor target.
var q=e.ownerDocument;var C=q.createElement("div");C.id=w;C.innerHTML=t;// Hide textarea and transfer its id to the div (TinyMCE uses element id for registration)
e.removeAttribute("id");e.style.display="none";(d=e.parentNode)===null||d===void 0?void 0:d.insertBefore(C,e.nextSibling);// Filter out plugins that require TinyMCE's content iframe (unavailable in inline mode)
var D=["wpautoresize","fullscreen","tabfocus"];var E=(v=o.tinymce.plugins)===null||v===void 0?void 0:v.split(",").map(e=>e.trim()).filter(e=>!D.includes(e)).join(",");window.tinymce.init((0,i._)((0,r._)({},o.tinymce),{target:C,inline:true,plugins:E,// Simplified setup: inline mode has no iframeElement or contentDocument
// eslint-disable-next-line @typescript-eslint/no-explicit-any
setup:e=>{e.on("init",()=>{if(h){e.setMode("readonly")}var t=e.getBody();if(t){t.style.backgroundColor="transparent"}if(A&&!h){t===null||t===void 0?void 0:t.focus()}});e.on("change keyup paste",()=>{n(e.getContent())});e.on("focus",()=>k(true));e.on("blur",()=>k(false))}}));return()=>{var t=window.tinymce.get(w);if(t){t.remove()}C.remove();// Restore textarea
if(e){e.id=w;e.style.display=""}}}window.wp.editor.remove(w);window.wp.editor.initialize(w,o);e===null||e===void 0?void 0:e.addEventListener("change",I);e===null||e===void 0?void 0:e.addEventListener("input",I);return()=>{window.wp.editor.remove(w);e===null||e===void 0?void 0:e.removeEventListener("change",I);e===null||e===void 0?void 0:e.removeEventListener("input",I)}}// eslint-disable-next-line react-hooks/exhaustive-deps
},[h]);return/*#__PURE__*/(0,o/* .jsx */.Y)("div",{css:Y.wrapper({hideQuickTags:u,isMinimal:a,isFocused:A,isReadOnly:h}),children:/*#__PURE__*/(0,o/* .jsx */.Y)("textarea",{"data-cy":"tutor-tinymce",ref:b,id:w,defaultValue:t})})};/* export default */const A=w;var Y={wrapper:e=>{var{hideQuickTags:t,isMinimal:n,isFocused:r,isReadOnly:i}=e;return/*#__PURE__*/(0,u/* .css */.AH)("flex:1;.wp-editor-tools{z-index:auto;}.wp-editor-container{border-top-left-radius:",p/* .borderRadius["6"] */.Vq["6"],";border-bottom-left-radius:",p/* .borderRadius["6"] */.Vq["6"],";border-bottom-right-radius:",p/* .borderRadius["6"] */.Vq["6"],";",r&&!i&&(0,u/* .css */.AH)(f(),h/* .styleUtils.inputFocus */.x.inputFocus),":focus-within{",!i&&h/* .styleUtils.inputFocus */.x.inputFocus,"}}.wp-switch-editor{height:auto;border:1px solid #dcdcde;border-radius:0px;border-top-left-radius:",p/* .borderRadius["4"] */.Vq["4"],";border-top-right-radius:",p/* .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:",p/* .borderRadius["6"] */.Vq["6"],";",(t||n)&&(0,u/* .css */.AH)(g(),p/* .borderRadius["6"] */.Vq["6"]),"}.mce-top-part::before{display:none;}.mce-statusbar{border-bottom-left-radius:",p/* .borderRadius["6"] */.Vq["6"],";border-bottom-right-radius:",p/* .borderRadius["6"] */.Vq["6"],";}.mce-tinymce{box-shadow:none;background-color:transparent;}.mce-edit-area{background-color:unset;}",(t||n)&&(0,u/* .css */.AH)(_(),!i?"1px solid ".concat(p/* .colorTokens.stroke["default"] */.I6.stroke["default"]):"none",p/* .borderRadius["6"] */.Vq["6"],r&&!i&&(0,u/* .css */.AH)(m(),h/* .styleUtils.inputFocus */.x.inputFocus)),"    textarea{visibility:visible !important;width:100%;resize:none;border:none;outline:none;padding:",p/* .spacing["10"] */.YK["10"],";}")}}},95377:function(e,t,n){n.d(t,{A:()=>f});/* import */var r=n(41147);/* import */var i=n(14206);/* import */var a=n(17900);/* import */var o=n(52639);/* import */var s=n(42771);/* import */var l=n(81253);/* import */var u=n(46225);/* import */var d=n(90453);/* import */var c=n(13448);/* import */var p=n(81547);/* import */var h=n(42263);var v=e=>{var{field:t,fieldState:n,disabled:s,value:c,onChange:p,label:v,description:f,helpText:m,isHidden:_,labelCss:b}=e;return/*#__PURE__*/(0,o/* .jsx */.Y)(h/* ["default"] */.A,{field:t,fieldState:n,isHidden:_,children:e=>{var{css:n}=e,h=(0,a._)(e,["css"]);return/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{children:[/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{css:g.wrapper,children:[/*#__PURE__*/(0,o/* .jsx */.Y)(l/* ["default"] */.A,(0,i._)((0,r._)({},t,h),{inputCss:n,labelCss:b,value:c,disabled:s,checked:t.value,label:v,onChange:()=>{t.onChange(!t.value);if(p){p(!t.value)}}})),m&&/*#__PURE__*/(0,o/* .jsx */.Y)(d/* ["default"] */.A,{content:m,placement:"top",allowHTML:true,children:/*#__PURE__*/(0,o/* .jsx */.Y)(u/* ["default"] */.A,{name:"info",width:20,height:20})})]}),f&&/*#__PURE__*/(0,o/* .jsx */.Y)("p",{css:g.description,children:f})]})}})};/* export default */const f=v;var g={wrapper:/*#__PURE__*/(0,s/* .css */.AH)("display:flex;align-items:center;gap:",c/* .spacing["6"] */.YK["6"],";& > div{display:flex;color:",c/* .colorTokens.icon["default"] */.I6.icon["default"],";}"),description:/*#__PURE__*/(0,s/* .css */.AH)(p/* .typography.small */.I.small(),"    color:",c/* .colorTokens.text.hints */.I6.text.hints,";padding-left:30px;margin-top:",c/* .spacing["6"] */.YK["6"],";")}},26036:function(e,t,n){n.d(t,{A:()=>C});/* import */var r=n(41147);/* import */var i=n(14206);/* import */var a=n(17900);/* import */var o=n(52639);/* import */var s=n(41594);/* import */var l=/*#__PURE__*/n.n(s);/* import */var u=n(94906);/* import */var d=n(42771);/* import */var c=n(12470);/* import */var p=/*#__PURE__*/n.n(c);/* import */var h=n(76845);/* import */var v=n(1896);/* import */var f=n(25074);/* import */var g=n(46225);/* import */var m=n(19393);/* import */var _=n(13448);/* import */var b=n(81547);/* import */var y=n(84206);/* import */var w=n(52874);/* import */var A=n(42263);/* import */var Y=n(30779);// Create DayPicker formatters based on WordPress locale
var k=()=>{if(typeof window==="undefined"||!window.wp||!window.wp.date){return}var{format:e}=wp.date;return{formatMonthDropdown:t=>e("F",t),formatMonthCaption:t=>e("F",t),formatCaption:t=>e("F",t),formatWeekdayName:t=>e("D",t)}};var I=e=>{if(!e)return undefined;return(0,h/* .isValid */.f)(new Date(e))?new Date(e.length===10?e+"T00:00:00":e):undefined};var q=e=>{var{label:t,field:n,fieldState:l,disabled:d,disabledBefore:p,disabledAfter:h,loading:_,placeholder:b,helpText:Y,isClearable:q=true,onChange:C,dateFormat:E=m/* .DateFormats.monthDayYear */.UA.monthDayYear}=e;var S=(0,s.useRef)(null);var[z,T]=(0,s.useState)(false);var M=I(n.value);var H=typeof window!=="undefined"&&window.wp&&window.wp.date;var P=M?H?window.wp.date.format("F j, Y",M):(0,v/* .format */.GP)(M,E):"";var{triggerRef:O,position:F,popoverRef:N}=(0,y/* .usePortalPopover */.tP)({isOpen:z,placement:y/* .POPOVER_PLACEMENTS.BOTTOM_LEFT */.zA.BOTTOM_LEFT});var K=()=>{var e;T(false);(e=S.current)===null||e===void 0?void 0:e.focus()};var W=I(p);var R=I(h);return/*#__PURE__*/(0,o/* .jsx */.Y)(A/* ["default"] */.A,{label:t,field:n,fieldState:l,disabled:d,loading:_,placeholder:b,helpText:Y,children:e=>{var{css:t}=e,s=(0,a._)(e,["css"]);return/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{children:[/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{css:D.wrapper,ref:O,children:[/*#__PURE__*/(0,o/* .jsx */.Y)("input",(0,i._)((0,r._)({},s),{css:[t,D.input],title:P,ref:e=>{n.ref(e);// @ts-ignore
S.current=e},type:"text",value:P,onClick:e=>{e.stopPropagation();T(e=>!e)},onKeyDown:e=>{if(e.key==="Enter"){e.preventDefault();T(e=>!e)}},autoComplete:"off","data-input":true})),/*#__PURE__*/(0,o/* .jsx */.Y)(g/* ["default"] */.A,{name:"calendarLine",width:30,height:32,style:D.icon}),q&&n.value&&/*#__PURE__*/(0,o/* .jsx */.Y)(f/* ["default"] */.A,{isIconOnly:true,"aria-label":(0,c.__)("Clear","tutor"),size:"small",variant:"text",buttonCss:w/* .styleUtils.inputClearButton */.x.inputClearButton,onClick:()=>{n.onChange("")},icon:/*#__PURE__*/(0,o/* .jsx */.Y)(g/* ["default"] */.A,{name:"times",width:12,height:12})})]}),/*#__PURE__*/(0,o/* .jsx */.Y)(y/* .Portal */.ZL,{isOpen:z,onClickOutside:K,onEscape:K,children:/*#__PURE__*/(0,o/* .jsx */.Y)("div",{css:D.pickerWrapper,style:{left:F.left,top:F.top},ref:N,children:/*#__PURE__*/(0,o/* .jsx */.Y)(u/* .DayPicker */.h,{dir:m/* .isRTL */.V8?"rtl":"ltr",animate:true,mode:"single",formatters:k(),disabled:[!!W&&{before:W},!!R&&{after:R}],selected:M,onSelect:e=>{if(e){var t=(0,v/* .format */.GP)(e,m/* .DateFormats.yearMonthDay */.UA.yearMonthDay);n.onChange(t);K();if(C){C(t)}}},showOutsideDays:true,captionLayout:"dropdown",autoFocus:true,defaultMonth:M||new Date,startMonth:W||new Date(new Date().getFullYear()-10,0),endMonth:R||new Date(new Date().getFullYear()+10,11),weekStartsOn:H?window.wp.date.getSettings().l10n.startOfWeek:0})})})]})}})};/* export default */const C=q;var D={wrapper:/*#__PURE__*/(0,d/* .css */.AH)("position:relative;&:hover,&:focus-within{& > button{opacity:1;}}"),input:/*#__PURE__*/(0,d/* .css */.AH)("&[data-input]{padding-left:",_/* .spacing["40"] */.YK["40"],";}"),icon:/*#__PURE__*/(0,d/* .css */.AH)("position:absolute;top:50%;left:",_/* .spacing["8"] */.YK["8"],";transform:translateY(-50%);color:",_/* .colorTokens.icon["default"] */.I6.icon["default"],";"),pickerWrapper:/*#__PURE__*/(0,d/* .css */.AH)(b/* .typography.body */.I.body("regular"),";position:absolute;background-color:",_/* .colorTokens.background.white */.I6.background.white,";box-shadow:",_/* .shadow.popover */.r7.popover,";border-radius:",_/* .borderRadius["6"] */.Vq["6"],";.rdp-root{--rdp-day-height:40px;--rdp-day-width:40px;--rdp-day_button-height:40px;--rdp-day_button-width:40px;--rdp-nav-height:40px;--rdp-today-color:",_/* .colorTokens.text.title */.I6.text.title,";--rdp-caption-font-size:",_/* .fontSize["18"] */.J["18"],";--rdp-accent-color:",_/* .colorTokens.action.primary["default"] */.I6.action.primary["default"],";--rdp-background-color:",_/* .colorTokens.background.hover */.I6.background.hover,";--rdp-accent-color-dark:",_/* .colorTokens.action.primary.active */.I6.action.primary.active,";--rdp-background-color-dark:",_/* .colorTokens.action.primary.hover */.I6.action.primary.hover,";--rdp-selected-color:",_/* .colorTokens.text.white */.I6.text.white,";--rdp-day_button-border-radius:",_/* .borderRadius.circle */.Vq.circle,";--rdp-outside-opacity:0.5;--rdp-disabled-opacity:0.25;}.rdp-months{margin:",_/* .spacing["16"] */.YK["16"],";}.rdp-month_grid{margin:0px;}.rdp-day{padding:0px;}.rdp-nav{--rdp-accent-color:",_/* .colorTokens.text.primary */.I6.text.primary,";button{border-radius:",_/* .borderRadius.circle */.Vq.circle,";&:hover,&:focus,&:active{background-color:",_/* .colorTokens.background.hover */.I6.background.hover,";color:",_/* .colorTokens.text.primary */.I6.text.primary,";}&:focus-visible:not(:disabled){--rdp-accent-color:",_/* .colorTokens.text.white */.I6.text.white,";background-color:",_/* .colorTokens.background.brand */.I6.background.brand,";}}}.rdp-dropdown_root{.rdp-caption_label{padding:",_/* .spacing["8"] */.YK["8"],";}}.rdp-today{.rdp-day_button{font-weight:",_/* .fontWeight.bold */.Wy.bold,";}}.rdp-selected{color:var(--rdp-selected-color);background-color:var(--rdp-accent-color);border-radius:",_/* .borderRadius.circle */.Vq.circle,";font-weight:",_/* .fontWeight.regular */.Wy.regular,";.rdp-day_button{&:hover,&:focus,&:active{background-color:var(--rdp-accent-color);color:",_/* .colorTokens.text.primary */.I6.text.primary,";}&:focus-visible{outline:2px solid var(--rdp-accent-color);outline-offset:2px;}&:not(.rdp-outside){color:var(--rdp-selected-color);}}}.rdp-day_button{&:hover,&:focus,&:active{background-color:var(--rdp-background-color);color:",_/* .colorTokens.text.primary */.I6.text.primary,";}&:focus-visible:not([disabled]){color:var(--rdp-selected-color);opacity:1;background-color:var(--rdp-accent-color);}}")}},46062:function(e,t,n){n.d(t,{A:()=>Y});/* import */var r=n(60599);/* import */var i=n(52639);/* import */var a=n(42771);/* import */var o=n(12470);/* import */var s=/*#__PURE__*/n.n(o);/* import */var l=n(25074);/* import */var u=n(46225);/* import */var d=n(42263);/* import */var c=n(13448);/* import */var p=n(81547);/* import */var h=n(3013);/* import */var v=n(59189);/* import */var f=n(57587);/* import */var g=n(75532);/* import */var m=n(52874);function _(){var e=(0,r._)(["\n      background-color: ",";\n      padding: "," 0 "," ",";\n      border: 1px solid ",";\n      border-radius: ",";\n      gap: ",";\n    "]);_=function t(){return e};return e}function b(){var e=(0,r._)(["\n      margin-right: ",";\n    "]);b=function t(){return e};return e}var y={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 w=e=>{for(var[t,n]of Object.entries(y)){if(n.includes(e)){return t}}return"file"};var A=e=>{var{field:t,fieldState:n,label:r,helpText:a,buttonText:s=(0,o.__)("Upload Media","tutor"),selectMultiple:c=false,onChange:p,maxFileSize:f,maxFiles:_}=e;var b=t.value;var{openMediaLibrary:y,resetFiles:A}=(0,g/* ["default"] */.A)({options:{multiple:c,maxFiles:_,maxFileSize:f},onChange:e=>{t.onChange(e);if(p){p(e)}},initialFiles:b?Array.isArray(b)?b:[b]:[]});var Y=()=>{y()};var I=e=>{A();if(c){var n=(Array.isArray(b)?b:b?[b]:[]).filter(t=>t.id!==e);t.onChange(n.length>0?n:null);if(p){p(n.length>0?n:null)}}else{t.onChange(null);if(p){p(null)}}};return/*#__PURE__*/(0,i/* .jsx */.Y)(d/* ["default"] */.A,{label:r,field:t,fieldState:n,helpText:a,children:()=>{return/*#__PURE__*/(0,i/* .jsx */.Y)(v/* ["default"] */.A,{when:b,fallback:/*#__PURE__*/(0,i/* .jsx */.Y)(l/* ["default"] */.A,{buttonCss:k.uploadButton,icon:/*#__PURE__*/(0,i/* .jsx */.Y)(u/* ["default"] */.A,{name:"attach",height:24,width:24}),variant:"secondary",onClick:Y,children:s}),children:e=>/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:k.wrapper({hasFiles:Array.isArray(e)?e.length>0:e!==null}),children:[/*#__PURE__*/(0,i/* .jsx */.Y)("div",{css:k.attachmentsWrapper,children:/*#__PURE__*/(0,i/* .jsx */.Y)(h/* ["default"] */.A,{each:Array.isArray(e)?e:[e],children:e=>/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:k.attachmentCardWrapper,children:[/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:k.attachmentCard,children:[/*#__PURE__*/(0,i/* .jsx */.Y)(u/* ["default"] */.A,{style:k.fileIcon,name:w(e.ext||"file"),height:40,width:40}),/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:k.attachmentCardBody,children:[/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:k.attachmentCardTitle,children:[/*#__PURE__*/(0,i/* .jsx */.Y)("div",{title:e.title,css:m/* .styleUtils.text.ellipsis */.x.text.ellipsis(1),children:e.title}),/*#__PURE__*/(0,i/* .jsx */.Y)("div",{css:k.fileExtension,children:".".concat(e.ext)})]}),/*#__PURE__*/(0,i/* .jsx */.Y)("div",{css:k.attachmentCardSubtitle,children:/*#__PURE__*/(0,i/* .jsx */.Y)("span",{children:"".concat((0,o.__)("Size","tutor"),": ").concat(e.size)})})]})]}),/*#__PURE__*/(0,i/* .jsx */.Y)("button",{type:"button",css:k.removeButton,onClick:()=>{I(e.id)},children:/*#__PURE__*/(0,i/* .jsx */.Y)(u/* ["default"] */.A,{name:"cross",height:24,width:24})})]},e.id)})}),/*#__PURE__*/(0,i/* .jsx */.Y)("div",{css:k.uploadButtonWrapper({hasFiles:Array.isArray(e)?e.length>0:e!==null}),children:/*#__PURE__*/(0,i/* .jsx */.Y)(l/* ["default"] */.A,{buttonCss:k.uploadButton,icon:/*#__PURE__*/(0,i/* .jsx */.Y)(u/* ["default"] */.A,{name:"attach",height:24,width:24}),variant:"secondary",onClick:Y,"data-cy":"upload-media",children:s})})]})})}})};/* export default */const Y=(0,f/* .withVisibilityControl */.M)(A);var k={wrapper:e=>{var{hasFiles:t}=e;return/*#__PURE__*/(0,a/* .css */.AH)("display:flex;flex-direction:column;position:relative;",t&&(0,a/* .css */.AH)(_(),c/* .colorTokens.background.white */.I6.background.white,c/* .spacing["16"] */.YK["16"],c/* .spacing["16"] */.YK["16"],c/* .spacing["16"] */.YK["16"],c/* .colorTokens.stroke["default"] */.I6.stroke["default"],c/* .borderRadius.card */.Vq.card,c/* .spacing["8"] */.YK["8"]))},attachmentsWrapper:/*#__PURE__*/(0,a/* .css */.AH)("max-height:260px;padding-right:",c/* .spacing["16"] */.YK["16"],";",m/* .styleUtils.overflowYAuto */.x.overflowYAuto,";"),attachmentCardWrapper:/*#__PURE__*/(0,a/* .css */.AH)(m/* .styleUtils.display.flex */.x.display.flex(),";justify-content:space-between;align-items:center;gap:",c/* .spacing["20"] */.YK["20"],";padding:",c/* .spacing["4"] */.YK["4"]," ",c/* .spacing["12"] */.YK["12"]," ",c/* .spacing["4"] */.YK["4"]," 0;border-radius:",c/* .borderRadius["6"] */.Vq["6"],";button{opacity:0;}&:hover,&:focus-within{background:",c/* .colorTokens.background.hover */.I6.background.hover,";button{opacity:1;}}",c/* .Breakpoint.smallTablet */.EA.smallTablet,"{button{opacity:1;}}"),attachmentCard:/*#__PURE__*/(0,a/* .css */.AH)(m/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;gap:",c/* .spacing["8"] */.YK["8"],";overflow:hidden;"),attachmentCardBody:/*#__PURE__*/(0,a/* .css */.AH)(m/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",c/* .spacing["4"] */.YK["4"],";"),attachmentCardTitle:/*#__PURE__*/(0,a/* .css */.AH)(m/* .styleUtils.display.flex */.x.display.flex(),";",p/* .typography.caption */.I.caption("medium"),"    word-break:break-all;"),fileExtension:/*#__PURE__*/(0,a/* .css */.AH)("flex-shrink:0;"),attachmentCardSubtitle:/*#__PURE__*/(0,a/* .css */.AH)(p/* .typography.tiny */.I.tiny("regular")," ",m/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;gap:",c/* .spacing["8"] */.YK["8"],";color:",c/* .colorTokens.text.hints */.I6.text.hints,";svg{color:",c/* .colorTokens.icon["default"] */.I6.icon["default"],";}"),uploadButtonWrapper:e=>{var{hasFiles:t}=e;return/*#__PURE__*/(0,a/* .css */.AH)(t&&(0,a/* .css */.AH)(b(),c/* .spacing["16"] */.YK["16"]))},uploadButton:/*#__PURE__*/(0,a/* .css */.AH)("width:100%;"),fileIcon:/*#__PURE__*/(0,a/* .css */.AH)("flex-shrink:0;color:",c/* .colorTokens.icon["default"] */.I6.icon["default"],";"),removeButton:/*#__PURE__*/(0,a/* .css */.AH)(m/* .styleUtils.crossButton */.x.crossButton,";background:none;transition:none;flex-shrink:0;")}},75031:function(e,t,n){n.d(t,{A:()=>A});/* import */var r=n(52639);/* import */var i=n(12470);/* import */var a=/*#__PURE__*/n.n(i);/* import */var o=n(12427);/* import */var s=n(46225);/* import */var l=n(76023);/* import */var u=n(17944);/* import */var d=n(19448);/* import */var c=n(3311);/* import */var p=n(74412);/* import */var h=n(57587);/* import */var v=n(75532);/* import */var f=n(34837);/* import */var g=n(67290);/* import */var m=n(42263);var _;var b=!!p/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var y=(_=p/* .tutorConfig.settings */.P.settings)===null||_===void 0?void 0:_.chatgpt_key_exist;var w=e=>{var{field:t,fieldState:n,label:a,size:p,helpText:h,buttonText:_=(0,i.__)("Upload Media","tutor"),infoText:w,onChange:A,generateWithAi:Y=false,previewImageCss:k,loading:I,onClickAiButton:q}=e;var{showModal:C}=(0,u/* .useModal */.h)();var{openMediaLibrary:D,resetFiles:E}=(0,v/* ["default"] */.A)({options:{type:"image",multiple:false},onChange:e=>{if(e&&!Array.isArray(e)){var{id:n,url:r,title:i}=e;t.onChange({id:n,url:r,title:i});if(A){A({id:n,url:r,title:i})}}},initialFiles:t.value});var S;var z=(S=t.value)!==null&&S!==void 0?S:null;var T=()=>{D()};var M=()=>{E();t.onChange(null);if(A){A(null)}};var H=()=>{if(!b){C({component:d/* ["default"] */.A,props:{image:f,image2x:g}})}else if(!y){C({component:c/* ["default"] */.A,props:{image:f,image2x:g}})}else{C({component:l/* ["default"] */.A,isMagicAi:true,props:{title:(0,i.__)("AI Studio","tutor"),icon:/*#__PURE__*/(0,r/* .jsx */.Y)(s/* ["default"] */.A,{name:"magicAiColorize",width:24,height:24}),field:t,fieldState:n}});q===null||q===void 0?void 0:q()}};return/*#__PURE__*/(0,r/* .jsx */.Y)(m/* ["default"] */.A,{label:a,field:t,fieldState:n,helpText:h,onClickAiButton:H,generateWithAi:Y,children:()=>{return/*#__PURE__*/(0,r/* .jsx */.Y)("div",{children:/*#__PURE__*/(0,r/* .jsx */.Y)(o/* ["default"] */.A,{size:p,value:z,uploadHandler:T,clearHandler:M,buttonText:_,infoText:w,previewImageCss:k,loading:I})})}})};/* export default */const A=(0,h/* .withVisibilityControl */.M)(w)},89665:function(e,t,n){n.d(t,{A:()=>h});/* import */var r=n(60599);/* import */var i=n(52639);/* import */var a=n(42771);/* import */var o=n(13448);/* import */var s=n(81547);/* import */var l=n(52874);/* import */var u=n(42263);function d(){var e=(0,r._)(["\n        img {\n          border-color: ",";\n        }\n      "]);d=function t(){return e};return e}function c(){var e=(0,r._)(["\n        outline-color: ",";\n      "]);c=function t(){return e};return e}var p=e=>{var{field:t,fieldState:n,label:r,options:a=[],disabled:o}=e;return/*#__PURE__*/(0,i/* .jsx */.Y)(u/* ["default"] */.A,{field:t,fieldState:n,label:r,disabled:o,children:()=>{return/*#__PURE__*/(0,i/* .jsx */.Y)("div",{css:v.wrapper,children:a.map((e,n)=>/*#__PURE__*/(0,i/* .jsxs */.FD)("button",{type:"button",css:v.item(t.value===e.value),onClick:()=>{t.onChange(e.value)},disabled:o,children:[/*#__PURE__*/(0,i/* .jsx */.Y)("img",{src:e.image,alt:e.label,width:64,height:64}),/*#__PURE__*/(0,i/* .jsx */.Y)("p",{children:e.label})]},n))})}})};/* export default */const h=p;var v={wrapper:/*#__PURE__*/(0,a/* .css */.AH)("display:grid;grid-template-columns:repeat(4,minmax(64px,1fr));gap:",o/* .spacing["12"] */.YK["12"],";margin-top:",o/* .spacing["4"] */.YK["4"],";"),item:e=>/*#__PURE__*/(0,a/* .css */.AH)(l/* .styleUtils.resetButton */.x.resetButton,";display:flex;flex-direction:column;gap:",o/* .spacing["4"] */.YK["4"],";align-items:center;width:100%;cursor:pointer;input{appearance:none;}p{",s/* .typography.small */.I.small(),";width:100%;",l/* .styleUtils.textEllipsis */.x.textEllipsis,";color:",o/* .colorTokens.text.subdued */.I6.text.subdued,";text-align:center;}&:hover,&:focus-visible{",!e&&(0,a/* .css */.AH)(d(),o/* .colorTokens.stroke.hover */.I6.stroke.hover),"}img{border-radius:",o/* .borderRadius["6"] */.Vq["6"],";border:2px solid ",o/* .colorTokens.stroke.border */.I6.stroke.border,";outline:2px solid transparent;outline-offset:2px;transition:border-color 0.3s ease;",e&&(0,a/* .css */.AH)(c(),o/* .colorTokens.stroke.magicAi */.I6.stroke.magicAi),"}")}},6977:function(e,t,n){n.d(t,{A:()=>z});/* import */var r=n(41147);/* import */var i=n(14206);/* import */var a=n(17900);/* import */var o=n(60599);/* import */var s=n(52639);/* import */var l=n(41594);/* import */var u=/*#__PURE__*/n.n(l);/* import */var d=n(42771);/* import */var c=n(13448);/* import */var p=n(81547);/* import */var h=n(57587);/* import */var v=n(52874);/* import */var f=n(42263);function g(){var e=(0,o._)(["\n      border: 1px solid ",";\n      border-radius: ",";\n      box-shadow: ",";\n      background-color: ",";\n    "]);g=function t(){return e};return e}function m(){var e=(0,o._)(["\n      border-color: ",";\n      background-color: ",";\n    "]);m=function t(){return e};return e}function _(){var e=(0,o._)(["\n        border-color: ",";\n      "]);_=function t(){return e};return e}function b(){var e=(0,o._)(["\n          padding-",": ",";\n        "]);b=function t(){return e};return e}function y(){var e=(0,o._)(["\n            padding-",": ",";\n          "]);y=function t(){return e};return e}function w(){var e=(0,o._)(["\n          font-size: ",";\n          font-weight: ",";\n          height: 34px;\n          ",";\n        "]);w=function t(){return e};return e}function A(){var e=(0,o._)(["\n            padding-",": ",";\n          "]);A=function t(){return e};return e}function Y(){var e=(0,o._)(["\n          font-size: ",";\n          height: 32px;\n          ",";\n        "]);Y=function t(){return e};return e}function k(){var e=(0,o._)(["\n      ","\n    "]);k=function t(){return e};return e}function I(){var e=(0,o._)(["\n      min-width: 32px;\n      height: 32px;\n      padding-inline: ",";\n    "]);I=function t(){return e};return e}function q(){var e=(0,o._)(["\n      border-right: 1px solid ",";\n    "]);q=function t(){return e};return e}function C(){var e=(0,o._)(["\n      ","\n    "]);C=function t(){return e};return e}function D(){var e=(0,o._)(["\n      height: 32px;\n      min-width: 32px;\n      padding-inline: ",";\n    "]);D=function t(){return e};return e}function E(){var e=(0,o._)(["\n      border-left: 1px solid ",";\n    "]);E=function t(){return e};return e}var S=e=>{var{label:t,content:n,contentPosition:o="left",showVerticalBar:u=true,size:d="regular",type:c="text",field:p,fieldState:h,disabled:v,readOnly:g,loading:m,placeholder:_,helpText:b,onChange:y,onKeyDown:w,isHidden:A,wrapperCss:Y,contentCss:k,removeBorder:I=false,selectOnFocus:q=false,isInlineLabel:C=false}=e;var D=(0,l.useRef)(null);return/*#__PURE__*/(0,s/* .jsx */.Y)(f/* ["default"] */.A,{label:t,field:p,fieldState:h,disabled:v,readOnly:g,loading:m,placeholder:_,helpText:b,isHidden:A,removeBorder:I,isInlineLabel:C,children:e=>{var{css:t}=e,l=(0,a._)(e,["css"]);var v;return/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:[T.inputWrapper(!!h.error,I),Y],children:[o==="left"&&/*#__PURE__*/(0,s/* .jsx */.Y)("div",{css:[T.inputLeftContent(u,d),k],children:n}),/*#__PURE__*/(0,s/* .jsx */.Y)("input",(0,i._)((0,r._)({},p,l),{type:"text",value:(v=p.value)!==null&&v!==void 0?v:"",onChange:e=>{var t=c==="number"?e.target.value.replace(/[^0-9.]/g,"").replace(/(\..*)\./g,"$1"):e.target.value;p.onChange(t);if(y){y(t)}},onKeyDown:e=>w===null||w===void 0?void 0:w(e.key),css:[t,T.input(o,u,d)],autoComplete:"off",ref:e=>{p.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(!q||!D.current){return}D.current.select()},"data-input":true})),o==="right"&&/*#__PURE__*/(0,s/* .jsx */.Y)("div",{css:[T.inputRightContent(u,d),k],children:n})]})}})};/* export default */const z=(0,h/* .withVisibilityControl */.M)(S);var T={inputWrapper:(e,t)=>/*#__PURE__*/(0,d/* .css */.AH)("display:flex;align-items:center;",!t&&(0,d/* .css */.AH)(g(),c/* .colorTokens.stroke["default"] */.I6.stroke["default"],c/* .borderRadius["6"] */.Vq["6"],c/* .shadow.input */.r7.input,c/* .colorTokens.background.white */.I6.background.white)," ",e&&(0,d/* .css */.AH)(m(),c/* .colorTokens.stroke.danger */.I6.stroke.danger,c/* .colorTokens.background.status.errorFail */.I6.background.status.errorFail),";&:focus-within{",v/* .styleUtils.inputFocus */.x.inputFocus,";",e&&(0,d/* .css */.AH)(_(),c/* .colorTokens.stroke.danger */.I6.stroke.danger),"}"),input:(e,t,n)=>/*#__PURE__*/(0,d/* .css */.AH)("&.tutor-input-field:not(textarea){",p/* .typography.body */.I.body(),";border:none;box-shadow:none;background-color:transparent;padding-",e,":0;",t&&(0,d/* .css */.AH)(b(),e,c/* .spacing["10"] */.YK["10"]),";",n==="large"&&(0,d/* .css */.AH)(w(),c/* .fontSize["24"] */.J["24"],c/* .fontWeight.medium */.Wy.medium,t&&(0,d/* .css */.AH)(y(),e,c/* .spacing["12"] */.YK["12"]))," ",n==="small"&&(0,d/* .css */.AH)(Y(),c/* .fontSize["16"] */.J["16"],t&&(0,d/* .css */.AH)(A(),e,c/* .spacing["4"] */.YK["4"])),"  \n      &:focus{box-shadow:none;outline:none;}}"),inputLeftContent:(e,t)=>/*#__PURE__*/(0,d/* .css */.AH)(p/* .typography.small */.I.small()," ",v/* .styleUtils.flexCenter */.x.flexCenter(),"    height:40px;min-width:48px;color:",c/* .colorTokens.icon.subdued */.I6.icon.subdued,";padding-inline:",c/* .spacing["12"] */.YK["12"],";",t==="large"&&(0,d/* .css */.AH)(k(),p/* .typography.body */.I.body())," ",t==="small"&&(0,d/* .css */.AH)(I(),c/* .spacing["4"] */.YK["4"])," ",e&&(0,d/* .css */.AH)(q(),c/* .colorTokens.stroke["default"] */.I6.stroke["default"])),inputRightContent:(e,t)=>/*#__PURE__*/(0,d/* .css */.AH)(p/* .typography.small */.I.small()," ",v/* .styleUtils.flexCenter */.x.flexCenter(),"    height:40px;min-width:48px;color:",c/* .colorTokens.icon.subdued */.I6.icon.subdued,";padding-inline:",c/* .spacing["12"] */.YK["12"],";",t==="large"&&(0,d/* .css */.AH)(C(),p/* .typography.body */.I.body())," ",t==="small"&&(0,d/* .css */.AH)(D(),c/* .spacing["4"] */.YK["4"])," ",e&&(0,d/* .css */.AH)(E(),c/* .colorTokens.stroke["default"] */.I6.stroke["default"]))}},15402:function(e,t,n){n.d(t,{A:()=>O});/* import */var r=n(41147);/* import */var i=n(14206);/* import */var a=n(17900);/* import */var o=n(60599);/* import */var s=n(52639);/* import */var l=n(41594);/* import */var u=/*#__PURE__*/n.n(l);/* import */var d=n(42771);/* import */var c=n(46225);/* import */var p=n(13448);/* import */var h=n(81547);/* import */var v=n(59189);/* import */var f=n(31569);/* import */var g=n(21678);/* import */var m=n(52874);/* import */var _=n(42263);function b(){var e=(0,o._)(["\n      border: 1px solid ",";\n      border-radius: ",";\n      box-shadow: ",";\n      background-color: ",";\n    "]);b=function t(){return e};return e}function y(){var e=(0,o._)(["\n      border-color: ",";\n      background-color: ",";\n    "]);y=function t(){return e};return e}function w(){var e=(0,o._)(["\n        border-color: ",";\n      "]);w=function t(){return e};return e}function A(){var e=(0,o._)(["\n          padding-",": ",";\n        "]);A=function t(){return e};return e}function Y(){var e=(0,o._)(["\n              padding-",": ",";\n            "]);Y=function t(){return e};return e}function k(){var e=(0,o._)(["\n        font-size: ",";\n        font-weight: ",";\n        height: 34px;\n        ",";\n      "]);k=function t(){return e};return e}function I(){var e=(0,o._)(["\n          padding-",": ",";\n        "]);I=function t(){return e};return e}function q(){var e=(0,o._)(["\n        height: 32px;\n        ",";\n      "]);q=function t(){return e};return e}function C(){var e=(0,o._)(["\n      min-width: 200px;\n    "]);C=function t(){return e};return e}function D(){var e=(0,o._)(["\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    "]);D=function t(){return e};return e}function E(){var e=(0,o._)(["\n      ","\n    "]);E=function t(){return e};return e}function S(){var e=(0,o._)(["\n      min-width: 40px;\n      height: 32px;\n      padding-inline: ",";\n    "]);S=function t(){return e};return e}function z(){var e=(0,o._)(["\n      border-right: 1px solid ",";\n    "]);z=function t(){return e};return e}function T(){var e=(0,o._)(["\n      ","\n    "]);T=function t(){return e};return e}function M(){var e=(0,o._)(["\n      min-width: 40px;\n      height: 32px;\n      padding-inline: ",";\n    "]);M=function t(){return e};return e}function H(){var e=(0,o._)(["\n      border-left: 1px solid ",";\n    "]);H=function t(){return e};return e}var P=e=>{var{field:t,fieldState:n,content:o,contentPosition:u="left",showVerticalBar:d=true,type:p="text",size:h="regular",label:m,placeholder:b="",disabled:y,readOnly:w,loading:A,helpText:Y,removeOptionsMinWidth:k=true,onChange:I,presetOptions:q=[],selectOnFocus:C=false,wrapperCss:D,contentCss:E,formFieldWrapperCss:S,removeBorder:z=false}=e;var T;var M=(T=t.value)!==null&&T!==void 0?T:"";var H=(0,l.useRef)(null);var P=(0,l.useRef)(null);var[O,N]=(0,l.useState)(false);return/*#__PURE__*/(0,s/* .jsx */.Y)(_/* ["default"] */.A,{fieldState:n,field:t,label:m,disabled:y,readOnly:w,loading:A,helpText:Y,removeBorder:z,wrapperCss:S,placeholder:b,children:e=>{var{css:l}=e,m=(0,a._)(e,["css"]);return/*#__PURE__*/(0,s/* .jsxs */.FD)(s/* .Fragment */.FK,{children:[/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:[F.inputWrapper(!!n.error,z),D],ref:P,children:[o&&u==="left"&&/*#__PURE__*/(0,s/* .jsx */.Y)("div",{css:[F.inputLeftContent(d,h),E],children:o}),/*#__PURE__*/(0,s/* .jsx */.Y)("input",(0,i._)((0,r._)({},m),{css:[l,F.input(u,d,h)],onClick:()=>N(true),autoComplete:"off",readOnly:w,ref:e=>{t.ref(e);// @ts-ignore
H.current=e;// this is not ideal but it is the only way to set ref to the input element
},onFocus:()=>{if(!C||!H.current){return}H.current.select()},value:M,onChange:e=>{var n=p==="number"?e.target.value.replace(/[^0-9.]/g,"").replace(/(\..*)\./g,"$1"):e.target.value;t.onChange(n);if(I){I(n)}},"data-input":true})),o&&u==="right"&&/*#__PURE__*/(0,s/* .jsx */.Y)("div",{css:F.inputRightContent(d,h),children:o})]}),/*#__PURE__*/(0,s/* .jsx */.Y)(v/* ["default"] */.A,{when:q.length>0,children:/*#__PURE__*/(0,s/* .jsx */.Y)(g/* ["default"] */.A,{triggerRef:P,isOpen:O,closePopover:()=>N(false),animationType:f/* .AnimationType.slideDown */.J6.slideDown,children:/*#__PURE__*/(0,s/* .jsx */.Y)("ul",{css:[F.options(k)],children:q.map(e=>/*#__PURE__*/(0,s/* .jsx */.Y)("li",{css:F.optionItem({isSelected:e.value===t.value}),children:/*#__PURE__*/(0,s/* .jsxs */.FD)("button",{type:"button",css:F.label,onClick:()=>{t.onChange(e.value);I===null||I===void 0?void 0:I(e.value);N(false)},children:[/*#__PURE__*/(0,s/* .jsx */.Y)(v/* ["default"] */.A,{when:e.icon,children:/*#__PURE__*/(0,s/* .jsx */.Y)(c/* ["default"] */.A,{name:e.icon,width:32,height:32})}),/*#__PURE__*/(0,s/* .jsx */.Y)("span",{children:e.label})]})},String(e.value)))})})})]})}})};/* export default */const O=P;var F={mainWrapper:/*#__PURE__*/(0,d/* .css */.AH)("width:100%;"),inputWrapper:(e,t)=>/*#__PURE__*/(0,d/* .css */.AH)("display:flex;align-items:center;",!t&&(0,d/* .css */.AH)(b(),p/* .colorTokens.stroke["default"] */.I6.stroke["default"],p/* .borderRadius["6"] */.Vq["6"],p/* .shadow.input */.r7.input,p/* .colorTokens.background.white */.I6.background.white)," ",e&&(0,d/* .css */.AH)(y(),p/* .colorTokens.stroke.danger */.I6.stroke.danger,p/* .colorTokens.background.status.errorFail */.I6.background.status.errorFail),";&:focus-within{",m/* .styleUtils.inputFocus */.x.inputFocus,";",e&&(0,d/* .css */.AH)(w(),p/* .colorTokens.stroke.danger */.I6.stroke.danger),"}"),input:(e,t,n)=>/*#__PURE__*/(0,d/* .css */.AH)("&.tutor-input-field:not(textarea){",h/* .typography.body */.I.body(),";border:none;box-shadow:none;background-color:transparent;","padding-".concat(e),":0;",t&&(0,d/* .css */.AH)(A(),e,p/* .spacing["10"] */.YK["10"]),";",n==="large"&&(0,d/* .css */.AH)(k(),p/* .fontSize["24"] */.J["24"],p/* .fontWeight.medium */.Wy.medium,t&&(0,d/* .css */.AH)(Y(),e,p/* .spacing["12"] */.YK["12"]))," ",n==="small"&&(0,d/* .css */.AH)(q(),t&&(0,d/* .css */.AH)(I(),e,p/* .spacing["4"] */.YK["4"])),"      &:focus{box-shadow:none;outline:none;}}"),label:/*#__PURE__*/(0,d/* .css */.AH)(m/* .styleUtils.resetButton */.x.resetButton,";width:100%;height:100%;display:flex;align-items:center;gap:",p/* .spacing["8"] */.YK["8"],";margin:0 ",p/* .spacing["12"] */.YK["12"],";padding:",p/* .spacing["6"] */.YK["6"]," 0;text-align:left;line-height:",p/* .lineHeight["24"] */.K_["24"],";word-break:break-all;cursor:pointer;span{flex-shrink:0;}"),options:e=>/*#__PURE__*/(0,d/* .css */.AH)("z-index:",p/* .zIndex.dropdown */.fE.dropdown,";background-color:",p/* .colorTokens.background.white */.I6.background.white,";list-style-type:none;box-shadow:",p/* .shadow.popover */.r7.popover,";padding:",p/* .spacing["4"] */.YK["4"]," 0;margin:0;max-height:500px;border-radius:",p/* .borderRadius["6"] */.Vq["6"],";",m/* .styleUtils.overflowYAuto */.x.overflowYAuto,";",!e&&(0,d/* .css */.AH)(C())),optionItem:e=>{var{isSelected:t=false}=e;return/*#__PURE__*/(0,d/* .css */.AH)(h/* .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;&:hover{background-color:",p/* .colorTokens.background.hover */.I6.background.hover,";}",t&&(0,d/* .css */.AH)(D(),p/* .colorTokens.background.active */.I6.background.active,p/* .colorTokens.action.primary["default"] */.I6.action.primary["default"],p/* .borderRadius["6"] */.Vq["6"],p/* .borderRadius["6"] */.Vq["6"]))},inputLeftContent:(e,t)=>/*#__PURE__*/(0,d/* .css */.AH)(h/* .typography.small */.I.small()," ",m/* .styleUtils.flexCenter */.x.flexCenter(),"    height:40px;min-width:48px;color:",p/* .colorTokens.icon.subdued */.I6.icon.subdued,";padding-inline:",p/* .spacing["12"] */.YK["12"],";",t==="large"&&(0,d/* .css */.AH)(E(),h/* .typography.body */.I.body())," ",t==="small"&&(0,d/* .css */.AH)(S(),p/* .spacing["6"] */.YK["6"])," ",e&&(0,d/* .css */.AH)(z(),p/* .colorTokens.stroke["default"] */.I6.stroke["default"])),inputRightContent:(e,t)=>/*#__PURE__*/(0,d/* .css */.AH)(h/* .typography.small */.I.small()," ",m/* .styleUtils.flexCenter */.x.flexCenter(),"    height:40px;min-width:48px;color:",p/* .colorTokens.icon.subdued */.I6.icon.subdued,";padding-inline:",p/* .spacing["12"] */.YK["12"],";",t==="large"&&(0,d/* .css */.AH)(T(),h/* .typography.body */.I.body())," ",t==="small"&&(0,d/* .css */.AH)(M(),p/* .spacing["6"] */.YK["6"])," ",e&&(0,d/* .css */.AH)(H(),p/* .colorTokens.stroke["default"] */.I6.stroke["default"]))}},33552:function(e,t,n){n.d(t,{A:()=>h});/* import */var r=n(41147);/* import */var i=n(14206);/* import */var a=n(17900);/* import */var o=n(52639);/* import */var s=n(42771);/* import */var l=n(19897);/* import */var u=n(13448);/* import */var d=n(81547);/* import */var c=n(42263);var p=e=>{var{field:t,fieldState:n,label:s,options:u=[],disabled:d,wrapperCss:p,onSelect:h,onSelectRender:f}=e;return/*#__PURE__*/(0,o/* .jsx */.Y)(c/* ["default"] */.A,{field:t,fieldState:n,label:s,disabled:d,children:e=>{var{css:n}=e,s=(0,a._)(e,["css"]);return/*#__PURE__*/(0,o/* .jsx */.Y)("div",{css:p,children:u.map((e,a)=>/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{children:[/*#__PURE__*/(0,o/* .jsx */.Y)(l/* ["default"] */.A,(0,i._)((0,r._)({},s),{inputCss:n,value:e.value,label:e.label,disabled:e.disabled||d,labelCss:e.labelCss,checked:t.value===e.value,description:e.description,onChange:()=>{t.onChange(e.value);if(h){h(e)}}})),f&&t.value===e.value&&f(e),e.legend&&/*#__PURE__*/(0,o/* .jsx */.Y)("span",{css:v.radioLegend,children:e.legend})]},a))})}})};/* export default */const h=p;var v={radioLegend:/*#__PURE__*/(0,s/* .css */.AH)("margin-left:",u/* .spacing["28"] */.YK["28"],";",d/* .typography.body */.I.body(),";color:",u/* .colorTokens.text.subdued */.I6.text.subdued,";")}},15314:function(e,t,n){n.d(t,{A:()=>_});/* import */var r=n(60599);/* import */var i=n(52639);/* import */var a=n(41594);/* import */var o=/*#__PURE__*/n.n(a);/* import */var s=n(42771);/* import */var l=n(13448);/* import */var u=n(81547);/* import */var d=n(44486);/* import */var c=n(52874);/* import */var p=n(33231);/* import */var h=n(42263);function v(){var e=(0,r._)(["\n      border: 1px solid ",";\n      border-radius: ",";\n      padding: "," "," "," ",";\n    "]);v=function t(){return e};return e}function f(){var e=(0,r._)(["\n      background: ",";\n    "]);f=function t(){return e};return e}function g(e,t,n,r){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(n+l/100*(r-n));return u}var m=e=>{var{field:t,fieldState:n,label:r,min:o=0,max:s=100,isMagicAi:l=false,hasBorder:u=false}=e;var c=(0,a.useRef)(null);var v;var[f,m]=(0,a.useState)((v=t.value)!==null&&v!==void 0?v:0);var _=(0,a.useRef)(null);var y=(0,a.useRef)(null);var w=(0,d/* .useDebounce */.d)(f);(0,a.useEffect)(()=>{t.onChange(w);// eslint-disable-next-line react-hooks/exhaustive-deps
},[w,t.onChange]);(0,a.useEffect)(()=>{var e=false;var t=t=>{if(t.target!==y.current){return}e=true;document.body.style.userSelect="none"};var n=t=>{if(!e||!_.current){return}m(g(t.clientX,_,o,s))};var r=()=>{e=false;document.body.style.userSelect="auto"};window.addEventListener("mousedown",t);window.addEventListener("mousemove",n);window.addEventListener("mouseup",r);return()=>{window.removeEventListener("mousedown",t);window.removeEventListener("mousemove",n);window.removeEventListener("mouseup",r)}},[o,s]);var A=(0,a.useMemo)(()=>{return Math.floor((f-o)/(s-o)*100)},[f,o,s]);return/*#__PURE__*/(0,i/* .jsx */.Y)(h/* ["default"] */.A,{field:t,fieldState:n,label:r,isMagicAi:l,children:()=>/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:b.wrapper(u),children:[/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:b.track,ref:_,onKeyDown:p/* .noop */.lQ,onClick:e=>{m(g(e.clientX,_,o,s))},children:[/*#__PURE__*/(0,i/* .jsx */.Y)("div",{css:b.fill,style:{width:"".concat(A,"%")}}),/*#__PURE__*/(0,i/* .jsx */.Y)("div",{css:b.thumb(l),style:{left:"".concat(A,"%")},ref:y})]}),/*#__PURE__*/(0,i/* .jsx */.Y)("input",{type:"text",css:b.input,value:String(f),onChange:e=>{m(Number(e.target.value))},ref:c,onFocus:()=>{var e;(e=c.current)===null||e===void 0?void 0:e.select()}})]})})};/* export default */const _=m;var b={wrapper:e=>/*#__PURE__*/(0,s/* .css */.AH)("display:grid;grid-template-columns:1fr 45px;gap:",l/* .spacing["20"] */.YK["20"],";align-items:center;",e&&(0,s/* .css */.AH)(v(),l/* .colorTokens.stroke.disable */.I6.stroke.disable,l/* .borderRadius["6"] */.Vq["6"],l/* .spacing["12"] */.YK["12"],l/* .spacing["10"] */.YK["10"],l/* .spacing["12"] */.YK["12"],l/* .spacing["16"] */.YK["16"])),track:/*#__PURE__*/(0,s/* .css */.AH)("position:relative;height:4px;background-color:",l/* .colorTokens.bg.gray20 */.I6.bg.gray20,";border-radius:",l/* .borderRadius["50"] */.Vq["50"],";width:100%;flex-shrink:0;cursor:pointer;"),fill:/*#__PURE__*/(0,s/* .css */.AH)("position:absolute;left:0;top:0;height:100%;background:",l/* .colorTokens.ai.gradient_1 */.I6.ai.gradient_1,";width:50%;border-radius:",l/* .borderRadius["50"] */.Vq["50"],";"),thumb:e=>/*#__PURE__*/(0,s/* .css */.AH)("position:absolute;top:50%;transform:translate(-50%,-50%);width:20px;height:20px;border-radius:",l/* .borderRadius.circle */.Vq.circle,";&::before{content:'';position:absolute;top:50%;left:50%;width:8px;height:8px;transform:translate(-50%,-50%);border-radius:",l/* .borderRadius.circle */.Vq.circle,";background-color:",l/* .colorTokens.background.white */.I6.background.white,";cursor:pointer;}",e&&(0,s/* .css */.AH)(f(),l/* .colorTokens.ai.gradient_1 */.I6.ai.gradient_1)),input:/*#__PURE__*/(0,s/* .css */.AH)(u/* .typography.caption */.I.caption("medium"),";height:32px;border:1px solid ",l/* .colorTokens.stroke.border */.I6.stroke.border,";border-radius:",l/* .borderRadius["6"] */.Vq["6"],";text-align:center;color:",l/* .colorTokens.text.primary */.I6.text.primary,";&:focus-visible{",c/* .styleUtils.inputFocus */.x.inputFocus,";}")}},87797:function(e,t,n){n.d(t,{A:()=>C});/* import */var r=n(41147);/* import */var i=n(14206);/* import */var a=n(17900);/* import */var o=n(52639);/* import */var s=n(41594);/* import */var l=/*#__PURE__*/n.n(s);/* import */var u=n(42771);/* import */var d=n(12470);/* import */var c=/*#__PURE__*/n.n(d);/* import */var p=n(98898);/* import */var h=n(69580);/* import */var v=n(50178);/* import */var f=n(1896);/* import */var g=n(25074);/* import */var m=n(46225);/* import */var _=n(19393);/* import */var b=n(13448);/* import */var y=n(81547);/* import */var w=n(31569);/* import */var A=n(27630);/* import */var Y=n(21678);/* import */var k=n(52874);/* import */var I=n(42263);var q=e=>{var{label:t,field:n,fieldState:l,interval:u=30,disabled:c,loading:b,placeholder:y,helpText:q,isClearable:C=true}=e;var[E,S]=(0,s.useState)(false);var z=(0,s.useRef)(null);var T=(0,s.useRef)(null);var M=(0,s.useMemo)(()=>{var e=(0,p/* .setMinutes */.g)((0,h/* .setHours */.a)(new Date,0),0);var t=(0,p/* .setMinutes */.g)((0,h/* .setHours */.a)(new Date,23),59);var n=(0,v/* .eachMinuteOfInterval */.G)({start:e,end:t},{step:u});return n.map(e=>(0,f/* .format */.GP)(e,_/* .DateFormats.hoursMinutes */.UA.hoursMinutes))},[u]);var{activeIndex:H,setActiveIndex:P}=(0,A/* .useSelectKeyboardNavigation */.v)({options:M.map(e=>({label:e,value:e})),isOpen:E,selectedValue:n.value,onSelect:e=>{n.onChange(e.value);S(false)},onClose:()=>S(false)});(0,s.useEffect)(()=>{if(E&&H>=0&&T.current){T.current.scrollIntoView({block:"nearest",behavior:"smooth"})}},[E,H]);return/*#__PURE__*/(0,o/* .jsx */.Y)(I/* ["default"] */.A,{label:t,field:n,fieldState:l,disabled:c,loading:b,placeholder:y,helpText:q,children:e=>{var{css:t}=e,s=(0,a._)(e,["css"]);var l;return/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{children:[/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{css:D.wrapper,ref:z,children:[/*#__PURE__*/(0,o/* .jsx */.Y)("input",(0,i._)((0,r._)({},s),{ref:n.ref,css:[t,D.input],type:"text",onClick:e=>{e.stopPropagation();S(e=>!e)},onKeyDown:e=>{if(e.key==="Enter"){e.preventDefault();S(e=>!e)}if(e.key==="Tab"){S(false)}},value:(l=n.value)!==null&&l!==void 0?l:"",onChange:e=>{var{value:t}=e.target;n.onChange(t)},autoComplete:"off","data-input":true})),/*#__PURE__*/(0,o/* .jsx */.Y)(m/* ["default"] */.A,{name:"clock",width:32,height:32,style:D.icon}),C&&n.value&&/*#__PURE__*/(0,o/* .jsx */.Y)(g/* ["default"] */.A,{isIconOnly:true,"aria-label":(0,d.__)("Clear","tutor"),size:"small",variant:"text",buttonCss:k/* .styleUtils.inputClearButton */.x.inputClearButton,onClick:()=>n.onChange(""),icon:/*#__PURE__*/(0,o/* .jsx */.Y)(m/* ["default"] */.A,{name:"times",width:12,height:12})})]}),/*#__PURE__*/(0,o/* .jsx */.Y)(Y/* ["default"] */.A,{triggerRef:z,isOpen:E,closePopover:()=>S(false),animationType:w/* .AnimationType.slideDown */.J6.slideDown,children:/*#__PURE__*/(0,o/* .jsx */.Y)("ul",{css:D.list,children:M.map((e,t)=>{return/*#__PURE__*/(0,o/* .jsx */.Y)("li",{css:D.listItem,ref:H===t?T:null,"data-active":H===t,children:/*#__PURE__*/(0,o/* .jsx */.Y)("button",{type:"button",css:D.itemButton,onClick:()=>{n.onChange(e);S(false)},onMouseOver:()=>P(t),onMouseLeave:()=>t!==H&&P(-1),onFocus:()=>P(t),children:e})},t)})})})]})}})};/* export default */const C=q;var D={wrapper:/*#__PURE__*/(0,u/* .css */.AH)("position:relative;&:hover,&:focus-within{& > button{opacity:1;}}"),input:/*#__PURE__*/(0,u/* .css */.AH)("&[data-input]{padding-left:",b/* .spacing["40"] */.YK["40"],";}"),icon:/*#__PURE__*/(0,u/* .css */.AH)("position:absolute;top:50%;left:",b/* .spacing["8"] */.YK["8"],";transform:translateY(-50%);color:",b/* .colorTokens.icon["default"] */.I6.icon["default"],";"),list:/*#__PURE__*/(0,u/* .css */.AH)("height:380px;list-style:none;padding:0;margin:0;",k/* .styleUtils.overflowYAuto */.x.overflowYAuto,";"),listItem:/*#__PURE__*/(0,u/* .css */.AH)("width:100%;height:40px;cursor:pointer;display:flex;align-items:center;transition:background-color 0.3s ease-in-out;&[data-active='true']{background-color:",b/* .colorTokens.background.hover */.I6.background.hover,";}:hover{background-color:",b/* .colorTokens.background.hover */.I6.background.hover,";}"),itemButton:/*#__PURE__*/(0,u/* .css */.AH)(k/* .styleUtils.resetButton */.x.resetButton,";",y/* .typography.body */.I.body(),";margin:",b/* .spacing["4"] */.YK["4"]," ",b/* .spacing["12"] */.YK["12"],";width:100%;height:100%;&:focus,&:active,&:hover{background:none;color:",b/* .colorTokens.text.primary */.I6.text.primary,";}")}},94232:function(e,t,n){// EXPORTS
n.d(t,{A:()=>/* binding */et});// EXTERNAL MODULE: ./node_modules/.pnpm/@swc+helpers@0.5.17/node_modules/@swc/helpers/esm/_async_to_generator.js
var r=n(93640);// EXTERNAL MODULE: ./node_modules/.pnpm/@swc+helpers@0.5.17/node_modules/@swc/helpers/esm/_object_spread.js
var i=n(41147);// EXTERNAL MODULE: ./node_modules/.pnpm/@swc+helpers@0.5.17/node_modules/@swc/helpers/esm/_object_spread_props.js
var a=n(14206);// EXTERNAL MODULE: ./node_modules/.pnpm/@swc+helpers@0.5.17/node_modules/@swc/helpers/esm/_tagged_template_literal.js
var o=n(60599);// EXTERNAL MODULE: ./node_modules/.pnpm/@emotion+react@11.14.0_@types+react@18.3.1_react@18.3.1/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js
var s=n(52639);// EXTERNAL MODULE: external "React"
var l=n(41594);// EXTERNAL MODULE: ./node_modules/.pnpm/react-hook-form@7.67.0_react@18.3.1/node_modules/react-hook-form/dist/index.esm.mjs
var u=n(78346);// EXTERNAL MODULE: ./node_modules/.pnpm/@emotion+react@11.14.0_@types+react@18.3.1_react@18.3.1/node_modules/@emotion/react/dist/emotion-react.browser.esm.js
var d=n(42771);// EXTERNAL MODULE: external "wp.i18n"
var c=n(12470);// EXTERNAL MODULE: ./assets/src/js/v3/shared/atoms/Button.tsx
var p=n(25074);// EXTERNAL MODULE: ./assets/src/js/v3/shared/atoms/ImageInput.tsx
var h=n(12427);// EXTERNAL MODULE: ./assets/src/js/v3/shared/atoms/LoadingSpinner.tsx
var v=n(56705);// EXTERNAL MODULE: ./assets/src/js/v3/shared/atoms/SVGIcon.tsx
var f=n(46225);// EXTERNAL MODULE: ./assets/src/js/v3/shared/config/config.ts
var g=n(74412);// EXTERNAL MODULE: ./assets/src/js/v3/shared/config/constants.ts
var m=n(19393);// EXTERNAL MODULE: ./assets/src/js/v3/shared/config/styles.ts
var _=n(13448);// EXTERNAL MODULE: ./assets/src/js/v3/shared/config/typography.ts
var b=n(81547);// EXTERNAL MODULE: ./assets/src/js/v3/shared/controls/Show.tsx
var y=n(59189);// EXTERNAL MODULE: ./assets/src/js/v3/shared/hoc/withVisibilityControl.tsx
var w=n(57587);// EXTERNAL MODULE: ./assets/src/js/v3/shared/hooks/useAnimation.tsx
var A=n(31569);// EXTERNAL MODULE: ./assets/src/js/v3/shared/hooks/useFormWithGlobalError.ts
var Y=n(34092);// EXTERNAL MODULE: ./assets/src/js/v3/shared/hooks/usePortalPopover.tsx
var k=n(84206);// EXTERNAL MODULE: ./assets/src/js/v3/shared/hooks/useWpMedia.ts
var I=n(75532);// EXTERNAL MODULE: ./assets/src/js/v3/shared/molecules/Popover.tsx
var q=n(21678);// EXTERNAL MODULE: ./node_modules/.pnpm/@tanstack+react-query@5.62.15_react@18.3.1/node_modules/@tanstack/react-query/build/modern/useMutation.js
var C=n(32047);// EXTERNAL MODULE: ./assets/src/js/v3/shared/utils/api.ts
var D=n(77239);// EXTERNAL MODULE: ./assets/core/ts/utils/endpoints.ts
var E=n(94812);// CONCATENATED MODULE: ./assets/src/js/v3/shared/services/video.ts
var S=e=>{return D/* .wpAjaxInstance.post */.b.post(E/* ["default"].TUTOR_YOUTUBE_VIDEO_DURATION */.A.TUTOR_YOUTUBE_VIDEO_DURATION,{video_id:e})};var z=()=>{return(0,C/* .useMutation */.n)({mutationFn:S})};// EXTERNAL MODULE: ./assets/src/js/v3/shared/utils/style-utils.ts
var T=n(52874);// EXTERNAL MODULE: ./assets/src/js/v3/shared/utils/util.ts + 4 modules
var M=n(33231);// EXTERNAL MODULE: ./assets/src/js/v3/shared/utils/validation.ts
var H=n(18528);// CONCATENATED MODULE: ./assets/src/js/v3/shared/utils/video.ts
function P(e){return(0,r._)(function*(){var t=/^.*(vimeo\.com\/)((channels\/[A-z]+\/)|(groups\/[A-z]+\/videos\/))?([0-9]+)/;var n=e.match(t);var r=n?n[5]:null;var i="https://vimeo.com/api/v2/video/".concat(r,".xml");try{var a=yield fetch(i);if(!a.ok){throw new Error((0,c.__)("Failed to fetch the video data","tutor"))}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 d=Number.parseInt(u.textContent,10);return d;// in seconds
}catch(e){// eslint-disable-next-line no-console
console.error("Error fetching video duration:",e);return null}})()}var O=e=>(0,r._)(function*(){var t=document.createElement("video");t.src=e;t.preload="metadata";return new Promise(e=>{t.onloadedmetadata=()=>{e(t.duration)}})})();var F=e=>{var t=e.match(/PT(\d+H)?(\d+M)?(\d+S)?/);if(!t){return 0}var n=t[1]?Number(t[1].replace("H","")):0;var r=t[2]?Number(t[2].replace("M","")):0;var i=t[3]?Number(t[3].replace("S","")):0;return n*3600+r*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 N=(e,t)=>(0,r._)(function*(){if(e==="youtube"){var n=t.match(m/* .VideoRegex.YOUTUBE */.j8.YOUTUBE);var r=n&&n[7].length===11?n[7]:"";return"https://img.youtube.com/vi/".concat(r,"/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,n)=>{try{// Create video element
    var r=document.createElement("video");r.muted=true;r.style.cssText="position: fixed; left: 0; top: 0; width: 1px; height: 1px; object-fit: contain; z-index: -1;";r.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=()=>{r.src="";r.remove();i.remove();clearTimeout(p)};var d=()=>{if(a&&o&&s&&l){try{i.height=r.videoHeight;i.width=r.videoWidth;var t=i.getContext("2d");if(!t){throw new Error((0,c.__)("Failed to get canvas context","tutor"))}t.drawImage(r,0,0);var d=i.toDataURL("image/png");u();e(d)}catch(e){u();var p=e instanceof Error?e.message:(0,c.__)("Unknown error occurred","tutor");n(new Error("Thumbnail generation failed: ".concat(p)))}}};// Setup event listeners
    r.addEventListener("loadedmetadata",()=>{a=true;if(!r.currentTime||r.currentTime<2){r.currentTime=2;// Take snapshot at 2 seconds
    }});r.addEventListener("loadeddata",()=>{o=true;d()});r.addEventListener("suspend",()=>{s=true;d()});r.addEventListener("seeked",()=>{l=true;d()});r.addEventListener("error",e=>{u();n(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 p=setTimeout(()=>{u();n(new Error((0,c.__)("Thumbnail generation timed out","tutor")))},3e4);// Add elements to DOM
    document.body.appendChild(r);document.body.appendChild(i);// Start loading the video
    r.src=t}catch(e){var h=e instanceof Error?e.message:"Unknown error occurred";n(new Error("Thumbnail generation failed: ".concat(h)))}})}throw new Error((0,c.__)("Unsupported video source","tutor"))})();// EXTERNAL MODULE: ./assets/src/js/v3/shared/components/fields/FormFieldWrapper.tsx
var K=n(42263);// EXTERNAL MODULE: ./assets/src/js/v3/shared/components/fields/FormSelectInput.tsx
var W=n(99864);// EXTERNAL MODULE: ./assets/src/js/v3/shared/components/fields/FormTextareaInput.tsx
var R=n(74054);// CONCATENATED MODULE: ./assets/src/js/v3/shared/components/fields/FormVideoInput.tsx
function L(){var e=(0,o._)(["\n      background-color: ",";\n    "]);L=function t(){return e};return e}function U(){var e=(0,o._)(["\n      ",";\n    "]);U=function t(){return e};return e}var B=g/* .tutorConfig.supported_video_sources */.P.supported_video_sources||[];var j=B.filter(e=>e.value!=="html5");var V=B.map(e=>e.value);var Q=["vimeo","youtube","html5"];var G={youtube:(0,c.__)("Paste YouTube Video URL","tutor"),vimeo:(0,c.__)("Paste Vimeo Video URL","tutor"),external_url:(0,c.__)("Paste External Video URL","tutor"),shortcode:(0,c.__)("Paste Video Shortcode","tutor"),embedded:(0,c.__)("Paste Embedded Video Code","tutor")};var $={youtube:"youtube",vimeo:"vimeo",shortcode:"shortcode",embedded:"coding"};var X=(e,t)=>{var n={source:"",source_video_id:"",poster:"",poster_url:"",source_html5:"",source_external_url:"",source_shortcode:"",source_youtube:"",source_vimeo:"",source_embedded:""};return e?(0,i._)({},e,t):(0,i._)({},n,t)};var Z={youtube:e=>{var t=e.match(m/* .VideoRegex.YOUTUBE */.j8.YOUTUBE);return t&&t[7].length===11?t[7]:null},vimeo:e=>{var t=e.match(m/* .VideoRegex.VIMEO */.j8.VIMEO);return(t===null||t===void 0?void 0:t[5])||null},shortcode:e=>{return e.match(m/* .VideoRegex.SHORTCODE */.j8.SHORTCODE)?e:null},url:e=>{return e.match(m/* .VideoRegex.EXTERNAL_URL */.j8.EXTERNAL_URL)?e:null}};var J=e=>{var{source:t,url:n,getYouTubeVideoDurationMutation:i}=e;return(0,r._)(function*(){try{var e=0;switch(t){case"vimeo":var r;e=(r=yield P(n))!==null&&r!==void 0?r:0;break;case"html5":case"external_url":var a;e=(a=yield O(n))!==null&&a!==void 0?a:0;break;case"youtube":{var o=Z.youtube(n);if(o){var s=yield i.mutateAsync(o);e=F(s.data.duration)}break}}if(e){var l=(0,M/* .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 ee=e=>{var{field:t,fieldState:n,label:o,helpText:m,buttonText:_=(0,c.__)("Upload Media","tutor"),infoText:b,onChange:w,supportedFormats:C,loading:D,onGetDuration:E}=e;var S,L,U;var ee=(0,Y/* .useFormWithGlobalError */.p)({defaultValues:{videoSource:((S=j[0])===null||S===void 0?void 0:S.value)||"",videoUrl:""}});var et=z();var[er,ei]=(0,l.useState)(false);var[ea,eo]=(0,l.useState)({hours:0,minutes:0,seconds:0});var[es,el]=(0,l.useState)("");var[eu,ed]=(0,l.useState)(false);var ec=(0,l.useRef)(null);var ep=e=>(0,r._)(function*(){if(!e){return}var n=Array.isArray(e)?e[0]:e;var r={source:"html5",source_video_id:n.id.toString(),source_html5:n.url};var i;t.onChange(X((i=t.value)!==null&&i!==void 0?i:null,r));var a;w===null||w===void 0?void 0:w(X((a=t.value)!==null&&a!==void 0?a:null,r));try{ei(true);eg();var o=yield N("external_url",n.url);var s=yield O(n.url);if(!s){return}eo((0,M/* .covertSecondsToHMS */.uu)(Math.floor(s)));if(E){E((0,M/* .covertSecondsToHMS */.uu)(Math.floor(s)))}if(o){el(o)}}finally{ei(false)}})();var{openMediaLibrary:eh,resetFiles:ev}=(0,I/* ["default"] */.A)({options:{type:(C===null||C===void 0?void 0:C.length)?C.map(e=>"video/".concat(e)).join(","):"video"},onChange:ep});var{openMediaLibrary:ef,resetFiles:eg}=(0,I/* ["default"] */.A)({options:{type:"image"},onChange:e=>{if(!e){return}var n=Array.isArray(e)?e[0]:e;var r={poster:n.id.toString(),poster_url:n.url};var i;t.onChange(X((i=t.value)!==null&&i!==void 0?i:null,r));var a;w===null||w===void 0?void 0:w(X((a=t.value)!==null&&a!==void 0?a:null,r))},initialFiles:((L=t.value)===null||L===void 0?void 0:L.poster)?{id:Number(t.value.poster),url:t.value.poster_url,title:""}:null});var em=ee.watch("videoSource")||"";var e_=t.value;(0,l.useEffect)(()=>{var e;if(!e_){return}if(!e_.source){var n,r;ee.setValue("videoSource",(n=j[0])===null||n===void 0?void 0:n.value);ee.setValue("videoUrl",e_["source_".concat((r=j[0])===null||r===void 0?void 0:r.value)]||"");return}var i=V.includes(e_.source);if(!i){t.onChange(X(e_,{source:""}));return}ee.setValue("videoSource",e_.source);ee.setValue("videoUrl",e_["source_".concat(e_.source)]||"");if(!e_.poster_url&&Q.includes(e_.source)){var a=e_.source;ei(true);N(a,e_["source_".concat(a)]||"").then(e=>{ei(false);el(e)}).finally(()=>{ei(false)})}if(Object.values(ea).some(e=>e>0)){return}if(e_.source==="vimeo"){P(e_["source_vimeo"]||"").then(e=>{if(!e){return}eo((0,M/* .covertSecondsToHMS */.uu)(Math.floor(e)));if(E){E((0,M/* .covertSecondsToHMS */.uu)(Math.floor(e)))}})}if(["external_url","html5"].includes(e_.source)){O(e_["source_".concat(e_.source)]||"").then(e=>{if(!e){return}eo((0,M/* .covertSecondsToHMS */.uu)(Math.floor(e)));if(E){E((0,M/* .covertSecondsToHMS */.uu)(Math.floor(e)))}})}if(e_.source==="youtube"&&((e=g/* .tutorConfig.settings */.P.settings)===null||e===void 0?void 0:e.youtube_api_key_exist)){var o;var s=(o=Z.youtube(e_["source_youtube"]||""))!==null&&o!==void 0?o:"";et.mutateAsync(s).then(e=>{var t=e.data.duration;if(!t){return}var n=F(t);eo((0,M/* .covertSecondsToHMS */.uu)(Math.floor(n)));if(E){E((0,M/* .covertSecondsToHMS */.uu)(Math.floor(n)))}})}// eslint-disable-next-line react-hooks/exhaustive-deps
},[e_]);if(!V.length){return/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:en.emptyMediaWrapper,children:[/*#__PURE__*/(0,s/* .jsx */.Y)(y/* ["default"] */.A,{when:o,children:/*#__PURE__*/(0,s/* .jsx */.Y)("label",{children:o})}),/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:en.emptyMedia({hasVideoSource:false}),children:[/*#__PURE__*/(0,s/* .jsxs */.FD)("p",{css:en.warningText,children:[/*#__PURE__*/(0,s/* .jsx */.Y)(f/* ["default"] */.A,{name:"info",height:20,width:20}),(0,c.__)("No video source selected","tutor")]}),/*#__PURE__*/(0,s/* .jsx */.Y)(p/* ["default"] */.A,{buttonCss:en.selectFromSettingsButton,variant:"secondary",size:"small",icon:/*#__PURE__*/(0,s/* .jsx */.Y)(f/* ["default"] */.A,{name:"linkExternal",height:24,width:24}),onClick:()=>{window.open(g/* ["default"].VIDEO_SOURCES_SETTINGS_URL */.A.VIDEO_SOURCES_SETTINGS_URL,"_blank","noopener")},children:(0,c.__)("Select from settings","tutor")})]})]})}var eb=e=>{if(e==="video"){eh();return}ef()};var ey=e=>{var n=e==="video"?{source:"",source_video_id:"",poster:"",poster_url:""}:{poster:"",poster_url:""};var r=X(e_!==null&&e_!==void 0?e_:null,n);if(e==="video"){ev()}else{eg()}t.onChange(r);el("");eo({hours:0,minutes:0,seconds:0});if(w){w(r)}};var ew=()=>{if(!(e_===null||e_===void 0?void 0:e_.source)||!V.includes(e_.source)){return false}var e=e_===null||e_===void 0?void 0:e_.source;var t="source_".concat(e);return e_&&e_[t]!==""};var ex=e=>(0,r._)(function*(){ei(true);try{var{videoSource:n,videoUrl:r}=e;var i={source:n,["source_".concat(n)]:r};t.onChange(X(e_!==null&&e_!==void 0?e_:null,i));w===null||w===void 0?void 0:w(X(e_!==null&&e_!==void 0?e_:null,i));ed(false);var[a,o]=yield Promise.all([J({source:n,url:r,getYouTubeVideoDurationMutation:et}),Q.includes(n)?N(n,r):null]);if(a){eo(a);E===null||E===void 0?void 0:E(a)}if(o){el(o)}}finally{ei(false)}})();var eA=e=>{var t=e.trim();if(em==="embedded")return true;if(em==="shortcode"){return Z.shortcode(t)?true:(0,c.__)("Invalid Shortcode","tutor")}if(!Z.url(t)){return(0,c.__)("Invalid URL","tutor")}if(em==="youtube"&&!Z.youtube(t)){return(0,c.__)("Invalid YouTube URL","tutor")}if(em==="vimeo"&&!Z.vimeo(t)){return(0,c.__)("Invalid Vimeo URL","tutor")}return true};return/*#__PURE__*/(0,s/* .jsxs */.FD)(s/* .Fragment */.FK,{children:[/*#__PURE__*/(0,s/* .jsx */.Y)(K/* ["default"] */.A,{label:o,field:t,fieldState:n,helpText:m,children:()=>{return/*#__PURE__*/(0,s/* .jsx */.Y)("div",{ref:ec,children:/*#__PURE__*/(0,s/* .jsx */.Y)(y/* ["default"] */.A,{when:!D,fallback:/*#__PURE__*/(0,s/* .jsx */.Y)("div",{css:en.emptyMedia({hasVideoSource:true}),children:/*#__PURE__*/(0,s/* .jsx */.Y)(v/* .LoadingOverlay */.p8,{})}),children:/*#__PURE__*/(0,s/* .jsx */.Y)(y/* ["default"] */.A,{when:ew(),fallback:/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:en.emptyMedia({hasVideoSource:true}),children:[/*#__PURE__*/(0,s/* .jsx */.Y)(y/* ["default"] */.A,{when:V.includes("html5"),children:/*#__PURE__*/(0,s/* .jsx */.Y)(p/* ["default"] */.A,{"data-cy":"upload-media",size:"small",variant:"secondary",icon:/*#__PURE__*/(0,s/* .jsx */.Y)(f/* ["default"] */.A,{name:"monitorPlay",height:24,width:24}),onClick:()=>{eb("video")},children:_})}),/*#__PURE__*/(0,s/* .jsx */.Y)(y/* ["default"] */.A,{when:V.filter(e=>e!=="html5").length>0,children:/*#__PURE__*/(0,s/* .jsx */.Y)(y/* ["default"] */.A,{when:!V.includes("html5"),fallback:/*#__PURE__*/(0,s/* .jsx */.Y)("button",{"data-cy":"add-from-url",type:"button",css:en.urlButton,onClick:()=>{ed(e=>!e)},children:(0,c.__)("Add from URL","tutor")}),children:/*#__PURE__*/(0,s/* .jsx */.Y)(p/* ["default"] */.A,{"data-cy":"add-from-url",size:"small",variant:"secondary",icon:/*#__PURE__*/(0,s/* .jsx */.Y)(f/* ["default"] */.A,{name:"plusSquareBrand",height:24,width:24}),onClick:()=>{ed(e=>!e)},children:(0,c.__)("Add from URL","tutor")})})}),/*#__PURE__*/(0,s/* .jsx */.Y)(y/* ["default"] */.A,{when:V.includes("html5"),children:/*#__PURE__*/(0,s/* .jsx */.Y)("p",{css:en.infoTexts,children:b})})]}),children:()=>{var e;return/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:en.previewWrapper,"data-cy":"media-preview",children:[/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:en.videoInfoWrapper,children:[/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:en.videoInfoCard,children:[/*#__PURE__*/(0,s/* .jsx */.Y)(f/* ["default"] */.A,{name:$[e_===null||e_===void 0?void 0:e_.source]||"video",height:36,width:36}),/*#__PURE__*/(0,s/* .jsx */.Y)("div",{css:en.videoInfo,children:/*#__PURE__*/(0,s/* .jsx */.Y)("div",{css:en.videoInfoTitle,children:/*#__PURE__*/(0,s/* .jsx */.Y)("div",{css:T/* .styleUtils.text.ellipsis */.x.text.ellipsis(1),children:Q.includes((e_===null||e_===void 0?void 0:e_.source)||"")?e_===null||e_===void 0?void 0:e_["source_".concat(e_.source)]:(e=B.find(e=>e.value===(e_===null||e_===void 0?void 0:e_.source)))===null||e===void 0?void 0:e.label})})})]}),/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:en.actionButtons,children:[/*#__PURE__*/(0,s/* .jsx */.Y)(y/* ["default"] */.A,{when:em!=="html5",children:/*#__PURE__*/(0,s/* .jsx */.Y)("button",{type:"button",css:T/* .styleUtils.actionButton */.x.actionButton,onClick:()=>{ed(true)},children:/*#__PURE__*/(0,s/* .jsx */.Y)(f/* ["default"] */.A,{name:"edit",height:24,width:24})})}),/*#__PURE__*/(0,s/* .jsx */.Y)("button",{"data-cy":"remove-video",type:"button",css:T/* .styleUtils.actionButton */.x.actionButton,onClick:()=>{ey("video")},children:/*#__PURE__*/(0,s/* .jsx */.Y)(f/* ["default"] */.A,{name:"cross",height:24,width:24})})]})]}),/*#__PURE__*/(0,s/* .jsx */.Y)("div",{css:en.imagePreview({hasImageInput:Q.includes((e_===null||e_===void 0?void 0:e_.source)||"")}),children:/*#__PURE__*/(0,s/* .jsxs */.FD)(y/* ["default"] */.A,{when:Q.includes((e_===null||e_===void 0?void 0:e_.source)||""),fallback:/*#__PURE__*/(0,s/* .jsx */.Y)("div",{css:en.urlData,children:ee.watch("videoUrl")}),children:[/*#__PURE__*/(0,s/* .jsx */.Y)(h/* ["default"] */.A,{value:e_?{id:Number(e_.poster)||0,url:e_.poster_url||es,title:""}:null,loading:er,isClearAble:!!(e_===null||e_===void 0?void 0:e_.poster),disabled:["vimeo","youtube"].includes((e_===null||e_===void 0?void 0:e_.source)||""),uploadHandler:()=>eb("poster"),clearHandler:()=>ey("poster"),buttonText:(0,c.__)("Upload Thumbnail","tutor"),infoText:(0,c.__)("Upload a thumbnail image for your video","tutor"),emptyImageCss:en.thumbImage,previewImageCss:en.thumbImage,overlayCss:en.thumbImage,replaceButtonText:(0,c.__)("Replace Thumbnail","tutor")}),/*#__PURE__*/(0,s/* .jsx */.Y)(y/* ["default"] */.A,{when:ea.hours>0||ea.minutes>0||ea.seconds>0,children:/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:en.duration,children:[ea.hours>0&&"".concat(ea.hours,"h")," ",ea.minutes,"m ",ea.seconds,"s"]})})]})})]})}})})})}}),/*#__PURE__*/(0,s/* .jsx */.Y)(q/* ["default"] */.A,{triggerRef:ec,isOpen:eu,placement:k/* .POPOVER_PLACEMENTS.MIDDLE */.zA.MIDDLE,animationType:A/* .AnimationType.fadeIn */.J6.fadeIn,closePopover:()=>ed(false),positionModifier:{top:17,left:0},maxWidth:"".concat(((U=ec.current)===null||U===void 0?void 0:U.offsetWidth)||300,"px"),children:/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:en.popoverContent,children:[/*#__PURE__*/(0,s/* .jsx */.Y)(u/* .Controller */.xI,{control:ee.control,name:"videoSource",rules:(0,i._)({},(0,H/* .requiredRule */.WN)()),render:e=>{return/*#__PURE__*/(0,s/* .jsx */.Y)(W/* ["default"] */.A,(0,a._)((0,i._)({},e),{options:j,disabled:B.length<=1,placeholder:(0,c.__)("Select source","tutor"),hideCaret:B.length<=1}))}}),/*#__PURE__*/(0,s/* .jsx */.Y)(u/* .Controller */.xI,{control:ee.control,name:"videoUrl",rules:(0,a._)((0,i._)({},(0,H/* .requiredRule */.WN)()),{validate:eA}),render:e=>{return/*#__PURE__*/(0,s/* .jsx */.Y)(R/* ["default"] */.A,(0,a._)((0,i._)({},e),{inputCss:/*#__PURE__*/(0,d/* .css */.AH)("border-style:dashed;"),rows:2,placeholder:G[em]||(0,c.__)("Paste Here","tutor")}))}}),/*#__PURE__*/(0,s/* .jsxs */.FD)("div",{css:en.popoverButtonWrapper,children:[/*#__PURE__*/(0,s/* .jsx */.Y)(p/* ["default"] */.A,{variant:"text",size:"small",onClick:()=>{ed(false)},children:(0,c.__)("Cancel","tutor")}),/*#__PURE__*/(0,s/* .jsx */.Y)(p/* ["default"] */.A,{"data-cy":"submit-url",variant:"secondary",size:"small",onClick:ee.handleSubmit(ex),children:(0,c.__)("Ok","tutor")})]})]})})]})};/* export default */const et=(0,w/* .withVisibilityControl */.M)(ee);var en={emptyMediaWrapper:/*#__PURE__*/(0,d/* .css */.AH)(T/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["4"] */.YK["4"],";label{",b/* .typography.caption */.I.caption(),";color:",_/* .colorTokens.text.title */.I6.text.title,";}"),emptyMedia:e=>{var{hasVideoSource:t=false}=e;return/*#__PURE__*/(0,d/* .css */.AH)("width:100%;height:164px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:",_/* .spacing["8"] */.YK["8"],";border:1px dashed ",_/* .colorTokens.stroke.border */.I6.stroke.border,";border-radius:",_/* .borderRadius["8"] */.Vq["8"],";background-color:",_/* .colorTokens.background.status.warning */.I6.background.status.warning,";",t&&(0,d/* .css */.AH)(L(),_/* .colorTokens.bg.white */.I6.bg.white))},infoTexts:/*#__PURE__*/(0,d/* .css */.AH)(b/* .typography.tiny */.I.tiny(),";color:",_/* .colorTokens.text.subdued */.I6.text.subdued,";"),warningText:/*#__PURE__*/(0,d/* .css */.AH)(T/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;gap:",_/* .spacing["4"] */.YK["4"],";",b/* .typography.caption */.I.caption(),";color:",_/* .colorTokens.text.warning */.I6.text.warning,";"),selectFromSettingsButton:/*#__PURE__*/(0,d/* .css */.AH)("background:",_/* .colorTokens.bg.white */.I6.bg.white,";"),urlData:/*#__PURE__*/(0,d/* .css */.AH)(b/* .typography.caption */.I.caption(),";",T/* .styleUtils.display.flex */.x.display.flex("column"),";padding:",_/* .spacing["8"] */.YK["8"]," ",_/* .spacing["12"] */.YK["12"],";gap:",_/* .spacing["8"] */.YK["8"],";word-break:break-all;"),previewWrapper:/*#__PURE__*/(0,d/* .css */.AH)("width:100%;height:100%;border:1px solid ",_/* .colorTokens.stroke["default"] */.I6.stroke["default"],";border-radius:",_/* .borderRadius["8"] */.Vq["8"],";overflow:hidden;background-color:",_/* .colorTokens.bg.white */.I6.bg.white,";"),videoInfoWrapper:/*#__PURE__*/(0,d/* .css */.AH)(T/* .styleUtils.display.flex */.x.display.flex(),";justify-content:space-between;align-items:center;gap:",_/* .spacing["20"] */.YK["20"],";padding:",_/* .spacing["8"] */.YK["8"]," ",_/* .spacing["12"] */.YK["12"],";"),videoInfoCard:/*#__PURE__*/(0,d/* .css */.AH)(T/* .styleUtils.display.flex */.x.display.flex(),";align-items:center;gap:",_/* .spacing["8"] */.YK["8"],";svg{flex-shrink:0;color:",_/* .colorTokens.icon.hover */.I6.icon.hover,";}"),videoInfo:/*#__PURE__*/(0,d/* .css */.AH)(T/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["4"] */.YK["4"],";"),videoInfoTitle:/*#__PURE__*/(0,d/* .css */.AH)(T/* .styleUtils.display.flex */.x.display.flex(),";",b/* .typography.caption */.I.caption("medium"),"    word-break:break-all;"),imagePreview:e=>{var{hasImageInput:t}=e;return/*#__PURE__*/(0,d/* .css */.AH)("width:100%;max-height:168px;position:relative;overflow:hidden;background-color:",_/* .colorTokens.background["default"] */.I6.background["default"],";",!t&&(0,d/* .css */.AH)(U(),T/* .styleUtils.overflowYAuto */.x.overflowYAuto),";scrollbar-gutter:auto;&:hover{[data-hover-buttons-wrapper]{opacity:1;}}")},duration:/*#__PURE__*/(0,d/* .css */.AH)(b/* .typography.tiny */.I.tiny(),";position:absolute;bottom:",_/* .spacing["12"] */.YK["12"],";right:",_/* .spacing["12"] */.YK["12"],";background-color:rgba(0,0,0,0.5);color:",_/* .colorTokens.text.white */.I6.text.white,";padding:",_/* .spacing["4"] */.YK["4"]," ",_/* .spacing["8"] */.YK["8"],";border-radius:",_/* .borderRadius["6"] */.Vq["6"],";pointer-events:none;"),thumbImage:/*#__PURE__*/(0,d/* .css */.AH)("border-radius:0;border:none;"),urlButton:/*#__PURE__*/(0,d/* .css */.AH)(T/* .styleUtils.resetButton */.x.resetButton,";",b/* .typography.small */.I.small("medium"),";color:",_/* .colorTokens.text.brand */.I6.text.brand,";border-radius:",_/* .borderRadius["2"] */.Vq["2"],";padding:0 ",_/* .spacing["4"] */.YK["4"],";margin-bottom:",_/* .spacing["8"] */.YK["8"],";&:focus,&:active,&:hover{background:none;color:",_/* .colorTokens.text.brand */.I6.text.brand,";}&:focus-visible{outline:2px solid ",_/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:1px;}"),actionButtons:/*#__PURE__*/(0,d/* .css */.AH)(T/* .styleUtils.display.flex */.x.display.flex(),";gap:",_/* .spacing["4"] */.YK["4"],";"),popover:/*#__PURE__*/(0,d/* .css */.AH)("position:absolute;width:100%;z-index:",_/* .zIndex.dropdown */.fE.dropdown,";background-color:",_/* .colorTokens.bg.white */.I6.bg.white,";border-radius:",_/* .borderRadius.card */.Vq.card,";box-shadow:",_/* .shadow.popover */.r7.popover,";"),popoverContent:/*#__PURE__*/(0,d/* .css */.AH)(T/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",_/* .spacing["12"] */.YK["12"],";padding:",_/* .spacing["16"] */.YK["16"],";"),popoverButtonWrapper:/*#__PURE__*/(0,d/* .css */.AH)(T/* .styleUtils.display.flex */.x.display.flex(),";gap:",_/* .spacing["8"] */.YK["8"],";justify-content:flex-end;")}},15004:function(e,t,n){n.d(t,{A:()=>W});/* import */var r=n(93640);/* import */var i=n(60599);/* import */var a=n(52639);/* import */var o=n(41594);/* import */var s=/*#__PURE__*/n.n(o);/* import */var l=n(42771);/* import */var u=n(12470);/* import */var d=/*#__PURE__*/n.n(u);/* import */var c=n(18853);/* import */var p=/*#__PURE__*/n.n(c);/* import */var h=n(47918);/* import */var v=n(25074);/* import */var f=n(56705);/* import */var g=n(46225);/* import */var m=n(90453);/* import */var _=n(54184);/* import */var b=n(88325);/* import */var y=n(56949);/* import */var w=n(17944);/* import */var A=n(19448);/* import */var Y=n(3311);/* import */var k=n(74412);/* import */var I=n(19393);/* import */var q=n(13448);/* import */var C=n(3013);/* import */var D=n(59189);/* import */var E=n(52874);/* import */var S=n(55051);/* import */var z=n(17064);/* import */var T=n(42263);function M(){var e=(0,i._)(["\n      overflow: hidden;\n      border-radius: ",";\n    "]);M=function t(){return e};return e}var H;var P={droip:"droipColorized",elementor:"elementorColorized",gutenberg:"gutenbergColorized",divi:"diviColorized"};var O=!!k/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var F=(H=k/* .tutorConfig.settings */.P.settings)===null||H===void 0?void 0:H.chatgpt_key_exist;var N=e=>{var{editorUsed:t,onBackToWPEditorClick:n,onCustomEditorButtonClick:i}=e;var{showModal:s}=(0,w/* .useModal */.h)();var[l,d]=(0,o.useState)("");return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:R.editorOverlay,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(D/* ["default"] */.A,{when:t.name!=="gutenberg",children:/*#__PURE__*/(0,a/* .jsx */.Y)(v/* ["default"] */.A,{variant:"tertiary",size:"small",buttonCss:R.editWithButton,icon:/*#__PURE__*/(0,a/* .jsx */.Y)(g/* ["default"] */.A,{name:"arrowLeft",height:24,width:24}),loading:l==="back_to",onClick:()=>(0,r._)(function*(){var{action:e}=yield s({component:y/* ["default"] */.A,props:{title:(0,u.__)("Back to WordPress Editor","tutor"),description:/*#__PURE__*/(0,a/* .jsx */.Y)(h/* ["default"] */.A,{type:"warning",icon:"warning",children:(0,u.__)("Warning: Switching to the WordPress default editor may cause issues with your current layout, design, and content.","tutor")}),confirmButtonText:(0,u.__)("Confirm","tutor"),confirmButtonVariant:"primary"},depthIndex:q/* .zIndex.highest */.fE.highest});if(e==="CONFIRM"){try{d("back_to");yield n===null||n===void 0?void 0:n(t.name)}finally{d("")}}})(),children:(0,u.__)("Back to WordPress Editor","tutor")})}),/*#__PURE__*/(0,a/* .jsx */.Y)(v/* ["default"] */.A,{variant:"tertiary",size:"small",buttonCss:R.editWithButton,loading:l==="edit_with",icon:P[t.name]&&/*#__PURE__*/(0,a/* .jsx */.Y)(g/* ["default"] */.A,{name:P[t.name],height:24,width:24}),onClick:()=>(0,r._)(function*(){try{d("edit_with");yield i===null||i===void 0?void 0:i(t);window.location.href=t.link}finally{d("")}})(),children:/* translators: %s is the editor name */(0,u.sprintf)((0,u.__)("Edit with %s","tutor"),t===null||t===void 0?void 0:t.label)})]})};var K=e=>{var{label:t,field:n,fieldState:i,disabled:s,readOnly:l,loading:d,placeholder:c,helpText:p,onChange:h,generateWithAi:v=false,onClickAiButton:y,hasCustomEditorSupport:M=false,isMinimal:H=false,hideMediaButtons:K=false,hideQuickTags:W=false,editors:L=[],editorUsed:U={name:"classic",label:"Classic Editor",link:""},isMagicAi:B=false,autoFocus:j=false,onCustomEditorButtonClick:V,onBackToWPEditorClick:Q,onFullScreenChange:G,min_height:$,max_height:X,toolbar1:Z,toolbar2:J}=e;var ee,et,en,er,ei;var{showModal:ea}=(0,w/* .useModal */.h)();var eo=((ee=k/* .tutorConfig.settings */.P.settings)===null||ee===void 0?void 0:ee.hide_admin_bar_for_users)==="off";var es=(en=k/* .tutorConfig.current_user */.P.current_user)===null||en===void 0?void 0:(et=en.roles)===null||et===void 0?void 0:et.includes(I/* .TutorRoles.ADMINISTRATOR */.gt.ADMINISTRATOR);var el=(ei=k/* .tutorConfig.current_user */.P.current_user)===null||ei===void 0?void 0:(er=ei.roles)===null||er===void 0?void 0:er.includes(I/* .TutorRoles.TUTOR_INSTRUCTOR */.gt.TUTOR_INSTRUCTOR);var[eu,ed]=(0,o.useState)(null);var ec=L.filter(e=>es||el&&eo||e.name==="droip");var ep=M&&ec.length>0;var eh=ep&&U.name!=="classic";var ev=()=>{if(!O){ea({component:A/* ["default"] */.A,props:{image:S,image2x:z}})}else if(!F){ea({component:Y/* ["default"] */.A,props:{image:S,image2x:z}})}else{ea({component:b/* ["default"] */.A,isMagicAi:true,props:{title:(0,u.__)("AI Studio","tutor"),icon:/*#__PURE__*/(0,a/* .jsx */.Y)(g/* ["default"] */.A,{name:"magicAiColorize",width:24,height:24}),characters:1e3,field:n,fieldState:i,is_html:true}});y===null||y===void 0?void 0:y()}};var ef=/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:R.editorLabel,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("span",{css:R.labelWithAi,children:[t,/*#__PURE__*/(0,a/* .jsx */.Y)(D/* ["default"] */.A,{when:v,children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:R.aiButton,onClick:ev,children:/*#__PURE__*/(0,a/* .jsx */.Y)(g/* ["default"] */.A,{name:"magicAiColorize",width:32,height:32})})})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:R.editorsButtonWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:(0,u.__)("Edit with","tutor")}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:R.customEditorButtons,children:/*#__PURE__*/(0,a/* .jsx */.Y)(C/* ["default"] */.A,{each:ec,children:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{content:e.label,delay:200,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("button",{type:"button",css:R.customEditorButton,disabled:eu===e.name,onClick:()=>(0,r._)(function*(){try{ed(e.name);yield V===null||V===void 0?void 0:V(e);window.location.href=e.link}finally{ed(null)}})(),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(D/* ["default"] */.A,{when:eu===e.name,children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* .LoadingOverlay */.p8,{})}),/*#__PURE__*/(0,a/* .jsx */.Y)(g/* ["default"] */.A,{name:P[e.name],height:24,width:24})]})},e.name)})})]})]});return/*#__PURE__*/(0,a/* .jsx */.Y)(T/* ["default"] */.A,{label:ep?ef:t,field:n,fieldState:i,disabled:s,readOnly:l,placeholder:c,helpText:p,isMagicAi:B,generateWithAi:!ep&&v,onClickAiButton:ev,replaceEntireLabel:ep,children:()=>{if(d){return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:E/* .styleUtils.flexCenter */.x.flexCenter(),children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.Ay,{size:20,color:q/* .colorTokens.icon["default"] */.I6.icon["default"]})})}var e;return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:R.wrapper({isOverlayVisible:eh}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(D/* ["default"] */.A,{when:eh,children:/*#__PURE__*/(0,a/* .jsx */.Y)(N,{editorUsed:U,onBackToWPEditorClick:Q,onCustomEditorButtonClick:V})}),/*#__PURE__*/(0,a/* .jsx */.Y)(_/* ["default"] */.A,{value:(e=n.value)!==null&&e!==void 0?e:"",onChange:e=>{n.onChange(e);if(h){h(e)}},isMinimal:H,hideMediaButtons:K,hideQuickTags:W,autoFocus:j,onFullScreenChange:G,readonly:l,min_height:$,max_height:X,toolbar1:Z,toolbar2:J})]})}})};/* export default */const W=K;var R={wrapper:e=>{var{isOverlayVisible:t=false}=e;return/*#__PURE__*/(0,l/* .css */.AH)("position:relative;",t&&(0,l/* .css */.AH)(M(),q/* .borderRadius["6"] */.Vq["6"]))},editorLabel:/*#__PURE__*/(0,l/* .css */.AH)("display:flex;width:100%;align-items:center;justify-content:space-between;"),aiButton:/*#__PURE__*/(0,l/* .css */.AH)(E/* .styleUtils.resetButton */.x.resetButton,";",E/* .styleUtils.flexCenter */.x.flexCenter(),";width:32px;height:32px;border-radius:",q/* .borderRadius["4"] */.Vq["4"],";:disabled{cursor:not-allowed;}&:focus-visible{outline:2px solid ",q/* .colorTokens.stroke.brand */.I6.stroke.brand,";}"),labelWithAi:/*#__PURE__*/(0,l/* .css */.AH)("display:flex;align-items:center;gap:",q/* .spacing["4"] */.YK["4"],";"),editorsButtonWrapper:/*#__PURE__*/(0,l/* .css */.AH)("display:flex;align-items:center;gap:",q/* .spacing["8"] */.YK["8"],";color:",q/* .colorTokens.text.hints */.I6.text.hints,";"),customEditorButtons:/*#__PURE__*/(0,l/* .css */.AH)("display:flex;align-items:center;gap:",q/* .spacing["4"] */.YK["4"],";"),customEditorButton:/*#__PURE__*/(0,l/* .css */.AH)(E/* .styleUtils.resetButton */.x.resetButton,"    display:flex;align-items:center;justify-content:center;position:relative;border-radius:",q/* .borderRadius.circle */.Vq.circle,";&:focus-visible{outline:2px solid ",q/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:1px;}"),editorOverlay:/*#__PURE__*/(0,l/* .css */.AH)("position:absolute;height:100%;width:100%;",E/* .styleUtils.flexCenter */.x.flexCenter(),";gap:",q/* .spacing["8"] */.YK["8"],";background-color:",p()(q/* .colorTokens.background.modal */.I6.background.modal,.6),";border-radius:",q/* .borderRadius["6"] */.Vq["6"],";z-index:",q/* .zIndex.positive */.fE.positive,";backdrop-filter:blur(8px);"),editWithButton:/*#__PURE__*/(0,l/* .css */.AH)("background:",q/* .colorTokens.action.secondary["default"] */.I6.action.secondary["default"],";color:",q/* .colorTokens.text.primary */.I6.text.primary,";box-shadow:inset 0 -1px 0 0 ",p()("#1112133D",.24),",0 1px 0 0 ",p()("#1112133D",.8),";")}},21055:function(e,t,n){n.d(t,{f:()=>u});/* import */var r=n(52639);/* import */var i=n(41594);/* import */var a=/*#__PURE__*/n.n(i);/* import */var o=n(42771);/* import */var s=n(13448);/* import */var l=n(67035);var u=/*#__PURE__*/a().forwardRef((e,t)=>{var{src:n,width:a,height:o,brushSize:s,trackStack:u,pointer:c,setTrackStack:p,setPointer:h}=e;var[v,f]=(0,i.useState)(false);var[g,m]=(0,i.useState)({x:0,y:0});var _=(0,i.useRef)(null);var b=e=>{var{canvas:n,context:r}=(0,l/* .getCanvas */.dX)(t);if(!n||!r){return}var i=n.getBoundingClientRect();var a=(e.clientX-i.left)*(n.width/i.width);var o=(e.clientY-i.top)*(n.height/i.height);r.globalCompositeOperation="destination-out";r.beginPath();r.moveTo(a,o);f(true);m({x:a,y:o})};var y=e=>{var{canvas:n,context:r}=(0,l/* .getCanvas */.dX)(t);if(!n||!r||!_.current){return}var i=n.getBoundingClientRect();var a={x:(e.clientX-i.left)*(n.width/i.width),y:(e.clientY-i.top)*(n.height/i.height)};if(v){(0,l/* .drawPath */.kd)(r,a)}_.current.style.left="".concat(a.x,"px");_.current.style.top="".concat(a.y,"px")};var w=e=>{var{canvas:n,context:r}=(0,l/* .getCanvas */.dX)(t);if(!r||!n){return}f(false);r.closePath();var i=n.getBoundingClientRect();var a={x:(e.clientX-i.left)*(n.width/i.width),y:(e.clientY-i.top)*(n.height/i.height)};// Check if the mouse is just clicked but not drag for drawing a path, then draw a circle
if((0,l/* .calculateCartesianDistance */.KG)(g,a)===0){(0,l/* .drawPath */.kd)(r,{x:a.x+1,y:a.y+1})}p(e=>{var t=e.slice(0,c);return[...t,r.getImageData(0,0,1024,1024)]});h(e=>e+1)};var A=()=>{var{canvas:e,context:r}=(0,l/* .getCanvas */.dX)(t);if(!e||!r){return}var i=new Image;i.src=n;i.onload=()=>{r.clearRect(0,0,e.width,e.height);var t=i.width/i.height;var n=e.width/e.height;var a;var o;if(n>t){o=e.height;a=e.height*t}else{a=e.width;o=e.width/t}var s=(e.width-a)/2;var l=(e.height-o)/2;r.drawImage(i,s,l,a,o);if(u.length===0){p([r.getImageData(0,0,e.width,e.height)])}};r.lineJoin="round";r.lineCap="round"};var Y=()=>{if(!_.current){return}document.body.style.cursor="none";_.current.style.display="block"};var k=()=>{if(!_.current){return}document.body.style.cursor="auto";_.current.style.display="none"};(0,i.useEffect)(()=>{A();// eslint-disable-next-line react-hooks/exhaustive-deps
},[]);return/*#__PURE__*/(0,r/* .jsxs */.FD)("div",{css:d.wrapper,children:[/*#__PURE__*/(0,r/* .jsx */.Y)("canvas",{ref:t,width:a,height:o,onMouseDown:b,onMouseMove:y,onMouseUp:w,onMouseEnter:Y,onMouseLeave:k}),/*#__PURE__*/(0,r/* .jsx */.Y)("div",{ref:_,css:d.customCursor(s)})]})});var d={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:",s/* .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 ",s/* .colorTokens.stroke.white */.I6.stroke.white,";pointer-events:none;transform:translate(-50%,-50%);z-index:",s/* .zIndex.highest */.fE.highest,";display:none;")}},54449:function(e,t,n){n.d(t,{A6:()=>v,co:()=>f,i3:()=>p});/* import */var r=n(41147);/* import */var i=n(14206);/* import */var a=n(52639);/* import */var o=n(41594);/* import */var s=/*#__PURE__*/n.n(o);/* import */var l=n(78346);/* import */var u=n(12470);/* import */var d=/*#__PURE__*/n.n(u);/* import */var c=n(34092);var p=[(0,u.__)("A serene classroom setting with books and a chalkboard","tutor"),(0,u.__)("An abstract representation of innovation and creativity","tutor"),(0,u.__)("A vibrant workspace with a laptop and coffee cup","tutor"),(0,u.__)("A modern design with digital learning icons","tutor"),(0,u.__)("A futuristic cityscape with a glowing pathway","tutor"),(0,u.__)("A peaceful nature scene with soft colors","tutor"),(0,u.__)("A professional boardroom with sleek visuals","tutor"),(0,u.__)("A stack of books with warm, inviting lighting","tutor"),(0,u.__)("A dynamic collage of technology and education themes","tutor"),(0,u.__)("A bold and minimalistic design with striking colors","tutor")];// eslint-disable-next-line @typescript-eslint/no-explicit-any
var h=/*#__PURE__*/s().createContext(null);var v=()=>{var e=(0,o.useContext)(h);if(!e){throw new Error("useMagicImageGeneration must be used within MagicImageGenerationProvider.")}return e};var f=e=>{var{children:t,field:n,fieldState:s,onCloseModal:u}=e;var d=(0,c/* .useFormWithGlobalError */.p)({defaultValues:{prompt:"",style:"none"}});var[p,v]=(0,o.useState)("generation");var[f,g]=(0,o.useState)("");var[m,_]=(0,o.useState)([null,null,null,null]);var b=(0,o.useCallback)(e=>{v(e)},[]);return/*#__PURE__*/(0,a/* .jsx */.Y)(h.Provider,{value:{state:p,onDropdownMenuChange:b,images:m,setImages:_,currentImage:f,setCurrentImage:g,field:n,fieldState:s,onCloseModal:u},children:/*#__PURE__*/(0,a/* .jsx */.Y)(l/* .FormProvider */.Op,(0,i._)((0,r._)({},d),{children:t}))})}},15296:function(e,t,n){n.d(t,{u:()=>R});/* import */var r=n(93640);/* import */var i=n(41147);/* import */var a=n(14206);/* import */var o=n(52639);/* import */var s=n(41594);/* import */var l=/*#__PURE__*/n.n(s);/* import */var u=n(78346);/* import */var d=n(42771);/* import */var c=n(12470);/* import */var p=/*#__PURE__*/n.n(c);/* import */var h=n(78353);/* import */var v=n(46225);/* import */var f=n(40925);/* import */var g=n(89665);/* import */var m=n(74054);/* import */var _=n(13448);/* import */var b=n(81547);/* import */var y=n(3013);/* import */var w=n(59189);/* import */var A=n(97200);/* import */var Y=n(52874);/* import */var k=n(49842);/* import */var I=n(13190);/* import */var q=n(22286);/* import */var C=n(43623);/* import */var D=n(71801);/* import */var E=n(64613);/* import */var S=n(36265);/* import */var z=n(47035);/* import */var T=n(50861);/* import */var M=n(92895);/* import */var H=n(47719);/* import */var P=n(26371);/* import */var O=n(8031);/* import */var F=n(54449);/* import */var N=n(9815);/* import */var K=n(76657);var W=[{label:(0,c.__)("None","tutor"),value:"none",image:T},{label:(0,c.__)("Photo","tutor"),value:"photo",image:H},{label:(0,c.__)("Neon","tutor"),value:"neon",image:z},{label:(0,c.__)("3D","tutor"),value:"3d",image:I},{label:(0,c.__)("Painting","tutor"),value:"painting",image:M},{label:(0,c.__)("Sketch","tutor"),value:"sketch",image:O},{label:(0,c.__)("Concept","tutor"),value:"concept_art",image:C},{label:(0,c.__)("Illustration","tutor"),value:"illustration",image:S},{label:(0,c.__)("Dreamy","tutor"),value:"dreamy",image:D},{label:(0,c.__)("Filmic","tutor"),value:"filmic",image:E},{label:(0,c.__)("Retro","tutor"),value:"retrowave",image:P},{label:(0,c.__)("Black & White","tutor"),value:"black-and-white",image:q}];var R=()=>{var e=(0,u/* .useForm */.mN)({defaultValues:{style:"none",prompt:""}});var{images:t,setImages:n}=(0,F/* .useMagicImageGeneration */.A6)();var l=(0,A/* .useMagicImageGenerationMutation */.R8)();var{showToast:d}=(0,f/* .useToast */.d)();var[p,_]=(0,s.useState)(t.every(e=>e===null));var[b,Y]=(0,s.useState)([false,false,false,false]);var I=e.watch("style");var q=e.watch("prompt");var C=!I||!q;var D=t.some(k/* .isDefined */.O9);(0,s.useEffect)(()=>{if(l.isError){d({type:"danger",message:l.error.response.data.message})}// eslint-disable-next-line react-hooks/exhaustive-deps
},[l.isError]);(0,s.useEffect)(()=>{e.setFocus("prompt");// eslint-disable-next-line react-hooks/exhaustive-deps
},[]);return/*#__PURE__*/(0,o/* .jsxs */.FD)("form",{css:K/* .magicAIStyles.wrapper */.C.wrapper,onSubmit:e.handleSubmit(e=>(0,r._)(function*(){Y([true,true,true,true]);_(false);try{yield Promise.all(Array.from({length:4}).map((t,r)=>{return l.mutateAsync(e).then(e=>{n(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});Y(e=>{var t=[...e];t[r]=false;return t})}).catch(e=>{Y(e=>{var t=[...e];t[r]=false;return t});throw e})}))}catch(e){Y([false,false,false,false]);_(true)}})()),children:[/*#__PURE__*/(0,o/* .jsx */.Y)("div",{css:K/* .magicAIStyles.left */.C.left,children:/*#__PURE__*/(0,o/* .jsx */.Y)(w/* ["default"] */.A,{when:!p,fallback:/*#__PURE__*/(0,o/* .jsx */.Y)(v/* ["default"] */.A,{name:"magicAiPlaceholder",width:72,height:72}),children:/*#__PURE__*/(0,o/* .jsx */.Y)("div",{css:L.images,children:/*#__PURE__*/(0,o/* .jsx */.Y)(y/* ["default"] */.A,{each:t,children:(e,t)=>{return/*#__PURE__*/(0,o/* .jsx */.Y)(N/* .AiImageItem */.z,{src:e,loading:b[t],index:t},t)}})})})}),/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{css:K/* .magicAIStyles.right */.C.right,children:[/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{css:L.fields,children:[/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{css:L.promptWrapper,children:[/*#__PURE__*/(0,o/* .jsx */.Y)(u/* .Controller */.xI,{control:e.control,name:"prompt",render:e=>/*#__PURE__*/(0,o/* .jsx */.Y)(m/* ["default"] */.A,(0,a._)((0,i._)({},e),{label:(0,c.__)("Visualize Your Course","tutor"),placeholder:(0,c.__)("Describe the image you want for your course thumbnail","tutor"),rows:4,isMagicAi:true,disabled:l.isPending,enableResize:false}))}),/*#__PURE__*/(0,o/* .jsxs */.FD)("button",{type:"button",css:L.inspireButton,onClick:()=>{var t=F/* .inspirationPrompts.length */.i3.length;var n=Math.floor(Math.random()*t);e.reset((0,a._)((0,i._)({},e.getValues()),{prompt:F/* .inspirationPrompts */.i3[n]}))},disabled:l.isPending,children:[/*#__PURE__*/(0,o/* .jsx */.Y)(v/* ["default"] */.A,{name:"bulbLine"}),(0,c.__)("Inspire Me","tutor")]})]}),/*#__PURE__*/(0,o/* .jsx */.Y)(u/* .Controller */.xI,{control:e.control,name:"style",render:e=>/*#__PURE__*/(0,o/* .jsx */.Y)(g/* ["default"] */.A,(0,a._)((0,i._)({},e),{label:(0,c.__)("Styles","tutor"),options:W,disabled:l.isPending}))})]}),/*#__PURE__*/(0,o/* .jsx */.Y)("div",{css:K/* .magicAIStyles.rightFooter */.C.rightFooter,children:/*#__PURE__*/(0,o/* .jsxs */.FD)(h/* ["default"] */.A,{type:"submit",disabled:l.isPending||C,children:[/*#__PURE__*/(0,o/* .jsx */.Y)(v/* ["default"] */.A,{name:D?"reload":"magicAi",width:24,height:24}),D?(0,c.__)("Generate Again","tutor"):(0,c.__)("Generate Now","tutor")]})})]})]})};var L={images:/*#__PURE__*/(0,d/* .css */.AH)("display:grid;grid-template-columns:repeat(2,minmax(150px,1fr));grid-template-rows:repeat(2,minmax(150px,1fr));gap:",_/* .spacing["12"] */.YK["12"],";align-self:start;padding:",_/* .spacing["24"] */.YK["24"],";width:100%;height:100%;> div{aspect-ratio:1 / 1;}"),fields:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;flex-direction:column;gap:",_/* .spacing["12"] */.YK["12"],";"),promptWrapper:/*#__PURE__*/(0,d/* .css */.AH)("position:relative;textarea{padding-bottom:",_/* .spacing["40"] */.YK["40"]," !important;}"),inspireButton:/*#__PURE__*/(0,d/* .css */.AH)(Y/* .styleUtils.resetButton */.x.resetButton,";",b/* .typography.small */.I.small(),";position:absolute;height:28px;bottom:",_/* .spacing["12"] */.YK["12"],";left:",_/* .spacing["12"] */.YK["12"],";border:1px solid ",_/* .colorTokens.stroke.brand */.I6.stroke.brand,";border-radius:",_/* .borderRadius["4"] */.Vq["4"],";display:flex;align-items:center;gap:",_/* .spacing["4"] */.YK["4"],";color:",_/* .colorTokens.text.brand */.I6.text.brand,";padding-inline:",_/* .spacing["12"] */.YK["12"],";background-color:",_/* .colorTokens.background.white */.I6.background.white,";&:hover{background-color:",_/* .colorTokens.background.brand */.I6.background.brand,";color:",_/* .colorTokens.text.white */.I6.text.white,";}&:focus-visible{outline:2px solid ",_/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:1px;}&:disabled{background-color:",_/* .colorTokens.background.disable */.I6.background.disable,";color:",_/* .colorTokens.text.disable */.I6.text.disable,";}")}},9815:function(e,t,n){n.d(t,{z:()=>E});/* import */var r=n(93640);/* import */var i=n(60599);/* import */var a=n(52639);/* import */var o=n(41594);/* import */var s=/*#__PURE__*/n.n(o);/* import */var l=n(42771);/* import */var u=n(12470);/* import */var d=/*#__PURE__*/n.n(u);/* import */var c=n(78353);/* import */var p=n(46225);/* import */var h=n(13448);/* import */var v=n(81547);/* import */var f=n(3013);/* import */var g=n(31569);/* import */var m=n(21678);/* import */var _=n(97200);/* import */var b=n(67035);/* import */var y=n(52874);/* import */var w=n(33231);/* import */var A=n(54449);function Y(){var e=(0,i._)(["\n      background-position: top left;\n    "]);Y=function t(){return e};return e}function k(){var e=(0,i._)(["\n      background-position: top right;\n      animation-delay: 0.5s;\n    "]);k=function t(){return e};return e}function I(){var e=(0,i._)(["\n      background-position: bottom left;\n      animation-delay: 1.5s;\n    "]);I=function t(){return e};return e}function q(){var e=(0,i._)(["\n      background-position: bottom right;\n      animation-delay: 1s;\n    "]);q=function t(){return e};return e}function C(){var e=(0,i._)(["\n      outline-color: ",";\n\n      [data-actions] {\n        opacity: 1;\n      }\n    "]);C=function t(){return e};return e}var D=[{label:(0,u.__)("Magic Fill","tutor"),value:"magic-fill",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(p/* ["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,u.__)("Download","tutor"),value:"download",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(p/* ["default"] */.A,{name:"download",width:24,height:24})}];var E=e=>{var{src:t,loading:n,index:i}=e;var s=(0,o.useRef)(null);var[l,d]=(0,o.useState)(false);var{onDropdownMenuChange:h,setCurrentImage:v,onCloseModal:y,field:Y}=(0,A/* .useMagicImageGeneration */.A6)();var k=(0,_/* .useStoreAIGeneratedImageMutation */.ah)();if(n||!t){return/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:z.loader(i+1)})}return/*#__PURE__*/(0,a/* .jsxs */.FD)(a/* .Fragment */.FK,{children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:z.image({isActive:k.isPending}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)("img",{src:t,alt:(0,u.__)("Generated Image","tutor")}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{"data-actions":true,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:z.useButton,children:/*#__PURE__*/(0,a/* .jsxs */.FD)(c/* ["default"] */.A,{variant:"primary",disabled:k.isPending,onClick:()=>(0,r._)(function*(){if(!t){return}var e=yield k.mutateAsync({image:t});if(e.data){Y.onChange(e.data);y()}})(),loading:k.isPending,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(p/* ["default"] */.A,{name:"download",width:24,height:24}),(0,u.__)("Use This","tutor")]})}),/*#__PURE__*/(0,a/* .jsx */.Y)(c/* ["default"] */.A,{variant:"primary",size:"icon",css:z.threeDots,ref:s,onClick:()=>d(true),children:/*#__PURE__*/(0,a/* .jsx */.Y)(p/* ["default"] */.A,{name:"threeDotsVertical",width:24,height:24})})]})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{triggerRef:s,isOpen:l,arrow:true,closePopover:()=>{d(false)},animationType:g/* .AnimationType.slideDown */.J6.slideDown,maxWidth:"160px",children:/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:z.dropdownOptions,children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{each:D,children:(e,n)=>/*#__PURE__*/(0,a/* .jsxs */.FD)("button",{type:"button",css:z.dropdownItem,onClick:()=>{switch(e.value){case"magic-fill":{v(t);h(e.value);break}case"download":{var n="".concat((0,w/* .nanoid */.Ak)(),".png");(0,b/* .downloadBase64Image */.JD)(t,n);break}default:break}d(false)},children:[e.icon,e.label]},n)})})})]})};var S=/*#__PURE__*/(0,l/* .keyframes */.i7)("		0%{opacity:0.3;}25%{opacity:0.5;}50%{opacity:0.7;}75%{opacity:0.5;}100%{opacity:0.3;}");var z={loader:e=>/*#__PURE__*/(0,l/* .css */.AH)("border-radius:",h/* .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:",S," 2s linear infinite;",e===1&&(0,l/* .css */.AH)(Y())," ",e===2&&(0,l/* .css */.AH)(k()),"		",e===3&&(0,l/* .css */.AH)(I()),"		",e===4&&(0,l/* .css */.AH)(q())),image:e=>{var{isActive:t}=e;return/*#__PURE__*/(0,l/* .css */.AH)("width:100%;height:100%;overflow:hidden;border-radius:",h/* .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,l/* .css */.AH)(C(),h/* .colorTokens.stroke.brand */.I6.stroke.brand),"    &:hover,&:focus-within{outline-color:",h/* .colorTokens.stroke.brand */.I6.stroke.brand,";[data-actions]{opacity:1;}}")},threeDots:/*#__PURE__*/(0,l/* .css */.AH)("position:absolute;top:",h/* .spacing["8"] */.YK["8"],";right:",h/* .spacing["8"] */.YK["8"],";border-radius:",h/* .borderRadius["4"] */.Vq["4"],";"),useButton:/*#__PURE__*/(0,l/* .css */.AH)("position:absolute;left:50%;bottom:",h/* .spacing["12"] */.YK["12"],";transform:translateX(-50%);button{display:inline-flex;align-items:center;gap:",h/* .spacing["4"] */.YK["4"],";}"),dropdownOptions:/*#__PURE__*/(0,l/* .css */.AH)("display:flex;flex-direction:column;padding-block:",h/* .spacing["8"] */.YK["8"],";"),dropdownItem:/*#__PURE__*/(0,l/* .css */.AH)(v/* .typography.small */.I.small(),";",y/* .styleUtils.resetButton */.x.resetButton,";height:40px;display:flex;gap:",h/* .spacing["10"] */.YK["10"],";align-items:center;transition:background-color 0.3s ease;color:",h/* .colorTokens.text.title */.I6.text.title,";padding-inline:",h/* .spacing["8"] */.YK["8"],";cursor:pointer;svg{color:",h/* .colorTokens.icon["default"] */.I6.icon["default"],";}&:hover{background-color:",h/* .colorTokens.background.hover */.I6.background.hover,";}")}},72283:function(e,t,n){n.d(t,{A:()=>M});/* import */var r=n(93640);/* import */var i=n(41147);/* import */var a=n(14206);/* import */var o=n(52639);/* import */var s=n(41594);/* import */var l=/*#__PURE__*/n.n(s);/* import */var u=n(78346);/* import */var d=n(42771);/* import */var c=n(12470);/* import */var p=/*#__PURE__*/n.n(c);/* import */var h=n(78353);/* import */var v=n(94361);/* import */var f=n(46225);/* import */var g=n(15314);/* import */var m=n(74054);/* import */var _=n(13448);/* import */var b=n(81547);/* import */var y=n(59189);/* import */var w=n(44486);/* import */var A=n(34092);/* import */var Y=n(97200);/* import */var k=n(67035);/* import */var I=n(52874);/* import */var q=n(33231);/* import */var C=n(21055);/* import */var D=n(54449);/* import */var E=n(76657);var S=620;var z=620;var T=()=>{var e=(0,A/* .useFormWithGlobalError */.p)({defaultValues:{brush_size:40,prompt:""}});var t=(0,Y/* .useMagicFillImageMutation */.wt)();var n=(0,s.useRef)(null);var{onDropdownMenuChange:l,currentImage:p,field:_,onCloseModal:b}=(0,D/* .useMagicImageGeneration */.A6)();var I=(0,Y/* .useStoreAIGeneratedImageMutation */.ah)();var T=(0,w/* .useDebounce */.d)(e.watch("brush_size",40));var[M,H]=(0,s.useState)([]);var[O,F]=(0,s.useState)(1);var N=(0,s.useCallback)((e,t)=>{var r;var i=(r=n.current)===null||r===void 0?void 0:r.getContext("2d");if(!i){return}for(var a of t.slice(0,e)){i.putImageData(a,0,0)}},[]);(0,s.useEffect)(()=>{var e;var t=(e=n.current)===null||e===void 0?void 0:e.getContext("2d");if(!t){return}t.lineWidth=T},[T]);(0,s.useEffect)(()=>{var e=e=>{if(e.metaKey){if(e.shiftKey&&e.key.toUpperCase()==="Z"){N(O+1,M);F(e=>Math.min(e+1,M.length));return}if(e.key.toUpperCase()==="Z"){N(O-1,M);F(e=>Math.max(e-1,1));return}}};window.addEventListener("keydown",e);return()=>{window.removeEventListener("keydown",e)}},[O,M,N]);if(!p){return null}return/*#__PURE__*/(0,o/* .jsxs */.FD)("form",{css:E/* .magicAIStyles.wrapper */.C.wrapper,onSubmit:e.handleSubmit(e=>(0,r._)(function*(){var r=n.current;var i=r===null||r===void 0?void 0:r.getContext("2d");if(!r||!i){return}var a={prompt:e.prompt,image:(0,k/* .getImageData */.M5)(r)};var o=yield t.mutateAsync(a);if(o){var s=new Image;s.onload=()=>{r.width=S;r.height=z;i.drawImage(s,0,0,r.width,r.height);i.lineWidth=T;i.lineJoin="round";i.lineCap="round"};s.src=o}})()),children:[/*#__PURE__*/(0,o/* .jsx */.Y)("div",{css:E/* .magicAIStyles.left */.C.left,children:/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{css:P.leftWrapper,children:[/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{css:P.actionBar,children:[/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{css:P.backButtonWrapper,children:[/*#__PURE__*/(0,o/* .jsx */.Y)("button",{type:"button",css:P.backButton,onClick:()=>l("generation"),children:/*#__PURE__*/(0,o/* .jsx */.Y)(f/* ["default"] */.A,{name:"arrowLeft"})}),(0,c.__)("Magic Fill","tutor")]}),/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{css:P.actions,children:[/*#__PURE__*/(0,o/* .jsx */.Y)(h/* ["default"] */.A,{variant:"ghost",disabled:M.length===0,onClick:()=>{N(1,M);H(M.slice(0,1));F(1)},children:(0,c.__)("Revert to Original","tutor")}),/*#__PURE__*/(0,o/* .jsx */.Y)(v/* .Separator */.w,{variant:"vertical",css:/*#__PURE__*/(0,d/* .css */.AH)("min-height:16px;")}),/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{css:P.undoRedo,children:[/*#__PURE__*/(0,o/* .jsx */.Y)(h/* ["default"] */.A,{variant:"ghost",size:"icon",disabled:O<=1,onClick:()=>{N(O-1,M);F(e=>Math.max(e-1,1))},children:/*#__PURE__*/(0,o/* .jsx */.Y)(f/* ["default"] */.A,{name:"undo",width:20,height:20})}),/*#__PURE__*/(0,o/* .jsx */.Y)(h/* ["default"] */.A,{variant:"ghost",size:"icon",disabled:O===M.length,onClick:()=>{N(O+1,M);F(e=>Math.min(e+1,M.length))},children:/*#__PURE__*/(0,o/* .jsx */.Y)(f/* ["default"] */.A,{name:"redo",width:20,height:20})})]})]})]}),/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{css:P.canvasAndLoading,children:[/*#__PURE__*/(0,o/* .jsx */.Y)(C/* .DrawingCanvas */.f,{ref:n,width:S,height:z,src:p,brushSize:T,trackStack:M,pointer:O,setTrackStack:H,setPointer:F}),/*#__PURE__*/(0,o/* .jsx */.Y)(y/* ["default"] */.A,{when:t.isPending,children:/*#__PURE__*/(0,o/* .jsx */.Y)("div",{css:P.loading})})]}),/*#__PURE__*/(0,o/* .jsx */.Y)("div",{css:P.footerActions,children:/*#__PURE__*/(0,o/* .jsx */.Y)("div",{css:P.footerActionsLeft,children:/*#__PURE__*/(0,o/* .jsx */.Y)(h/* ["default"] */.A,{variant:"secondary",onClick:()=>{var e="".concat((0,q/* .nanoid */.Ak)(),".png");var{canvas:t}=(0,k/* .getCanvas */.dX)(n);if(!t)return;(0,k/* .downloadBase64Image */.JD)((0,k/* .getImageData */.M5)(t),e)},children:/*#__PURE__*/(0,o/* .jsx */.Y)(f/* ["default"] */.A,{name:"download",width:24,height:24})})})})]})}),/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{css:E/* .magicAIStyles.right */.C.right,children:[/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{css:P.fields,children:[/*#__PURE__*/(0,o/* .jsx */.Y)(u/* .Controller */.xI,{control:e.control,name:"brush_size",render:e=>/*#__PURE__*/(0,o/* .jsx */.Y)(g/* ["default"] */.A,(0,a._)((0,i._)({},e),{label:"Brush Size",min:1,max:100,isMagicAi:true,hasBorder:true}))}),/*#__PURE__*/(0,o/* .jsx */.Y)(u/* .Controller */.xI,{control:e.control,name:"prompt",render:e=>/*#__PURE__*/(0,o/* .jsx */.Y)(m/* ["default"] */.A,(0,a._)((0,i._)({},e),{label:(0,c.__)("Describe the Fill","tutor"),placeholder:(0,c.__)("Write 5 words to describe...","tutor"),rows:4,isMagicAi:true}))})]}),/*#__PURE__*/(0,o/* .jsx */.Y)("div",{css:[E/* .magicAIStyles.rightFooter */.C.rightFooter,/*#__PURE__*/(0,d/* .css */.AH)("margin-top:auto;")],children:/*#__PURE__*/(0,o/* .jsxs */.FD)("div",{css:P.footerButtons,children:[/*#__PURE__*/(0,o/* .jsxs */.FD)(h/* ["default"] */.A,{type:"submit",disabled:t.isPending||!e.watch("prompt"),children:[/*#__PURE__*/(0,o/* .jsx */.Y)(f/* ["default"] */.A,{name:"magicWand",width:24,height:24}),(0,c.__)("Generative Erase","tutor")]}),/*#__PURE__*/(0,o/* .jsx */.Y)(h/* ["default"] */.A,{variant:"primary_outline",disabled:t.isPending,loading:I.isPending,onClick:()=>(0,r._)(function*(){var{canvas:e}=(0,k/* .getCanvas */.dX)(n);if(!e)return;var t=yield I.mutateAsync({image:(0,k/* .getImageData */.M5)(e)});if(t.data){_.onChange(t.data);b()}})(),children:(0,c.__)("Use Image","tutor")})]})})]})]})};/* export default */const M=T;var H={loading:/*#__PURE__*/(0,d/* .keyframes */.i7)("0%{opacity:0;}50%{opacity:0.6;}100%{opacity:0;}"),walker:/*#__PURE__*/(0,d/* .keyframes */.i7)("0%{left:0%;}100%{left:100%;}")};var P={canvasAndLoading:/*#__PURE__*/(0,d/* .css */.AH)("position:relative;z-index:",_/* .zIndex.positive */.fE.positive,";"),loading:/*#__PURE__*/(0,d/* .css */.AH)("position:absolute;top:0;left:0;width:100%;height:100%;background:",_/* .colorTokens.ai.gradient_1 */.I6.ai.gradient_1,";opacity:0.6;transition:0.5s ease opacity;animation:",H.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:",H.walker," 1s linear infinite;}"),actionBar:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;align-items:center;justify-content:space-between;"),fields:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;flex-direction:column;gap:",_/* .spacing["12"] */.YK["12"],";"),leftWrapper:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;flex-direction:column;gap:",_/* .spacing["8"] */.YK["8"],";padding-block:",_/* .spacing["16"] */.YK["16"],";"),footerButtons:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;flex-direction:column;gap:",_/* .spacing["8"] */.YK["8"],";"),footerActions:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;justify-content:space-between;"),footerActionsLeft:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;align-items:center;gap:",_/* .spacing["12"] */.YK["12"],";"),actions:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;align-items:center;gap:",_/* .spacing["16"] */.YK["16"],";"),undoRedo:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;align-items:center;gap:",_/* .spacing["12"] */.YK["12"],";"),backButtonWrapper:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;align-items:center;gap:",_/* .spacing["8"] */.YK["8"],";",b/* .typography.body */.I.body("medium"),";color:",_/* .colorTokens.text.title */.I6.text.title,";"),backButton:/*#__PURE__*/(0,d/* .css */.AH)(I/* .styleUtils.resetButton */.x.resetButton,";width:24px;height:24px;border-radius:",_/* .borderRadius["4"] */.Vq["4"],";border:1px solid ",_/* .colorTokens.stroke["default"] */.I6.stroke["default"],";display:flex;align-items:center;justify-content:center;"),image:/*#__PURE__*/(0,d/* .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,d/* .css */.AH)("position:relative;"),customCursor:e=>/*#__PURE__*/(0,d/* .css */.AH)("position:absolute;width:",e,"px;height:",e,"px;border-radius:",_/* .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 ",_/* .colorTokens.stroke.white */.I6.stroke.white,";pointer-events:none;transform:translate(-50%,-50%);z-index:",_/* .zIndex.highest */.fE.highest,";display:none;")}},76657:function(e,t,n){n.d(t,{C:()=>a});/* import */var r=n(42771);/* import */var i=n(13448);var a={wrapper:/*#__PURE__*/(0,r/* .css */.AH)("min-width:1000px;display:grid;grid-template-columns:1fr 330px;",i/* .Breakpoint.tablet */.EA.tablet,"{min-width:auto;grid-template-columns:1fr;width:100%;}"),left:/*#__PURE__*/(0,r/* .css */.AH)("display:flex;justify-content:center;align-items:center;background-color:#f7f7f7;z-index:",i/* .zIndex.level */.fE.level,";"),right:/*#__PURE__*/(0,r/* .css */.AH)("padding:",i/* .spacing["20"] */.YK["20"],";display:flex;flex-direction:column;align-items:space-between;z-index:",i/* .zIndex.positive */.fE.positive,";"),rightFooter:/*#__PURE__*/(0,r/* .css */.AH)("display:flex;flex-direction:column;gap:",i/* .spacing["8"] */.YK["8"],";margin-top:auto;padding-top:80px;")}},76023:function(e,t,n){n.d(t,{A:()=>d});/* import */var r=n(52639);/* import */var i=n(54449);/* import */var a=n(15296);/* import */var o=n(72283);/* import */var s=n(4429);function l(){var{state:e}=(0,i/* .useMagicImageGeneration */.A6)();switch(e){case"generation":return/*#__PURE__*/(0,r/* .jsx */.Y)(a/* .ImageGeneration */.u,{});case"magic-fill":return/*#__PURE__*/(0,r/* .jsx */.Y)(o/* ["default"] */.A,{});default:return null}}var u=e=>{var{title:t,icon:n,closeModal:a,field:o,fieldState:u}=e;return/*#__PURE__*/(0,r/* .jsx */.Y)(s/* ["default"] */.A,{onClose:a,title:t,icon:n,maxWidth:1e3,children:/*#__PURE__*/(0,r/* .jsx */.Y)(i/* .MagicImageGenerationProvider */.co,{field:o,fieldState:u,onCloseModal:a,children:/*#__PURE__*/(0,r/* .jsx */.Y)(l,{})})})};/* export default */const d=u},37547:function(e,t,n){n.d(t,{A:()=>_});/* import */var r=n(60599);/* import */var i=n(52639);/* import */var a=n(42771);/* import */var o=n(46225);/* import */var s=n(27246);/* import */var l=n(75823);/* import */var u=n(19393);/* import */var d=n(13448);/* import */var c=n(81547);/* import */var p=n(59189);/* import */var h=n(5387);/* import */var v=n(52874);function f(){var e=(0,r._)(["\n      max-width: 100vw;\n      width: 100vw;\n      height: 100vh;\n      margin-top: ",";\n    "]);f=function t(){return e};return e}function g(){var e=(0,r._)(["\n      height: calc(100% - ","px);\n    "]);g=function t(){return e};return e}var m=e=>{var{children:t,onClose:n,title:r,subtitle:a,icon:u,headerChildren:d,entireHeader:c,actions:v,maxWidth:f=1218,blurTriggerElement:g=true,fullScreen:m=false}=e;(0,h/* .useScrollLock */.K$)();return/*#__PURE__*/(0,i/* .jsx */.Y)(l/* ["default"] */.A,{blurPrevious:g,children:/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:b.container({maxWidth:f,isFullScreen:m}),children:[/*#__PURE__*/(0,i/* .jsx */.Y)("div",{css:b.header({hasHeaderChildren:!!d}),children:/*#__PURE__*/(0,i/* .jsx */.Y)(p/* ["default"] */.A,{when:c,fallback:/*#__PURE__*/(0,i/* .jsxs */.FD)(i/* .Fragment */.FK,{children:[/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:b.headerContent,children:[/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:b.iconWithTitle,children:[/*#__PURE__*/(0,i/* .jsx */.Y)(p/* ["default"] */.A,{when:u,children:u}),/*#__PURE__*/(0,i/* .jsx */.Y)(p/* ["default"] */.A,{when:r,children:/*#__PURE__*/(0,i/* .jsx */.Y)("h6",{css:b.title,title:typeof r==="string"?r:"",children:r})})]}),/*#__PURE__*/(0,i/* .jsx */.Y)(p/* ["default"] */.A,{when:a,children:/*#__PURE__*/(0,i/* .jsx */.Y)("span",{css:b.subtitle,children:a})})]}),/*#__PURE__*/(0,i/* .jsx */.Y)("div",{css:b.headerChildren,children:/*#__PURE__*/(0,i/* .jsx */.Y)(p/* ["default"] */.A,{when:d,children:d})}),/*#__PURE__*/(0,i/* .jsx */.Y)("div",{css:b.actionsWrapper,children:/*#__PURE__*/(0,i/* .jsx */.Y)(p/* ["default"] */.A,{when:v,fallback:/*#__PURE__*/(0,i/* .jsx */.Y)("button",{type:"button",css:b.closeButton,onClick:n,children:/*#__PURE__*/(0,i/* .jsx */.Y)(o/* ["default"] */.A,{name:"times",width:14,height:14})}),children:v})})]}),children:c})}),/*#__PURE__*/(0,i/* .jsx */.Y)("div",{css:b.content({isFullScreen:m}),children:/*#__PURE__*/(0,i/* .jsx */.Y)(s/* ["default"] */.A,{children:t})})]})})};/* export default */const _=m;var b={container:e=>{var{maxWidth:t,isFullScreen:n}=e;return/*#__PURE__*/(0,a/* .css */.AH)("position:relative;background:",d/* .colorTokens.background.white */.I6.background.white,";margin:",u/* .modal.MARGIN_TOP */.yl.MARGIN_TOP,"px auto ",d/* .spacing["24"] */.YK["24"],";height:100%;max-width:",t,"px;box-shadow:",d/* .shadow.modal */.r7.modal,";border-radius:",d/* .borderRadius["10"] */.Vq["10"],";overflow:hidden;bottom:0;z-index:",d/* .zIndex.modal */.fE.modal,";width:100%;",n&&(0,a/* .css */.AH)(f(),u/* .WP_ADMIN_BAR_HEIGHT */.I4)," ",d/* .Breakpoint.smallTablet */.EA.smallTablet,"{width:90%;}")},header:e=>{var{hasHeaderChildren:t}=e;return/*#__PURE__*/(0,a/* .css */.AH)("display:grid;grid-template-columns:",t?"1fr auto 1fr":"1fr auto auto",";gap:",d/* .spacing["8"] */.YK["8"],";align-items:center;width:100%;height:",u/* .modal.HEADER_HEIGHT */.yl.HEADER_HEIGHT,"px;background:",d/* .colorTokens.background.white */.I6.background.white,";border-bottom:1px solid ",d/* .colorTokens.stroke.divider */.I6.stroke.divider,";position:sticky;")},headerContent:/*#__PURE__*/(0,a/* .css */.AH)("place-self:center start;display:inline-flex;align-items:center;gap:",d/* .spacing["12"] */.YK["12"],";padding-left:",d/* .spacing["24"] */.YK["24"],";",d/* .Breakpoint.smallMobile */.EA.smallMobile,"{padding-left:",d/* .spacing["16"] */.YK["16"],";}"),headerChildren:/*#__PURE__*/(0,a/* .css */.AH)("place-self:center center;"),iconWithTitle:/*#__PURE__*/(0,a/* .css */.AH)("display:inline-flex;align-items:center;gap:",d/* .spacing["4"] */.YK["4"],";flex-shrink:0;color:",d/* .colorTokens.icon["default"] */.I6.icon["default"],";"),title:/*#__PURE__*/(0,a/* .css */.AH)(c/* .typography.heading6 */.I.heading6("medium"),";color:",d/* .colorTokens.text.title */.I6.text.title,";text-transform:none;letter-spacing:normal;"),subtitle:/*#__PURE__*/(0,a/* .css */.AH)(v/* .styleUtils.text.ellipsis */.x.text.ellipsis(1)," ",c/* .typography.caption */.I.caption(),";color:",d/* .colorTokens.text.hints */.I6.text.hints,";padding-left:",d/* .spacing["12"] */.YK["12"],";border-left:1px solid ",d/* .colorTokens.icon.hints */.I6.icon.hints,";"),actionsWrapper:/*#__PURE__*/(0,a/* .css */.AH)("place-self:center end;display:inline-flex;gap:",d/* .spacing["16"] */.YK["16"],";padding-right:",d/* .spacing["24"] */.YK["24"],";",d/* .Breakpoint.smallMobile */.EA.smallMobile,"{padding-right:",d/* .spacing["16"] */.YK["16"],";}"),closeButton:/*#__PURE__*/(0,a/* .css */.AH)(v/* .styleUtils.resetButton */.x.resetButton,";display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:",d/* .borderRadius.circle */.Vq.circle,";background:",d/* .colorTokens.background.white */.I6.background.white,";&:focus,&:active,&:hover{background:",d/* .colorTokens.background.white */.I6.background.white,";}svg{color:",d/* .colorTokens.icon["default"] */.I6.icon["default"],";transition:color 0.3s ease-in-out;}:hover{svg{color:",d/* .colorTokens.icon.hover */.I6.icon.hover,";}}:focus{box-shadow:",d/* .shadow.focus */.r7.focus,";}"),content:e=>{var{isFullScreen:t}=e;return/*#__PURE__*/(0,a/* .css */.AH)("height:calc(100% - ",u/* .modal.HEADER_HEIGHT */.yl.HEADER_HEIGHT+u/* .modal.MARGIN_TOP */.yl.MARGIN_TOP,"px);background-color:",d/* .colorTokens.surface.courseBuilder */.I6.surface.courseBuilder,";overflow-x:hidden;",v/* .styleUtils.overflowYAuto */.x.overflowYAuto," ",t&&(0,a/* .css */.AH)(g(),u/* .modal.HEADER_HEIGHT */.yl.HEADER_HEIGHT))}}},44486:function(e,t,n){n.d(t,{d:()=>a});/* import */var r=n(41594);/* import */var i=/*#__PURE__*/n.n(r);var a=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:300;var[n,i]=(0,r.useState)(e);(0,r.useEffect)(()=>{var n=setTimeout(()=>{i(e)},t);return()=>{clearTimeout(n)}},[e,t]);return n}},43642:function(e,t,n){n.d(t,{$:()=>l});/* import */var r=n(41147);/* import */var i=n(41594);/* import */var a=/*#__PURE__*/n.n(i);/* import */var o=n(49842);var s={defaultValue:false};var l=e=>{var t=(0,i.useRef)(null);var n=(0,r._)({},s,e);var[a,l]=(0,i.useState)(n.defaultValue);(0,i.useEffect)(()=>{if(!(0,o/* .isDefined */.O9)(t.current)){return}if(t.current.scrollHeight<=t.current.clientHeight){l(false);return}var e=e=>{var t=e.target;if(t.scrollTop+t.clientHeight>=t.scrollHeight){l(false);return}l(t.scrollTop>=0)};t.current.addEventListener("scroll",e);return()=>{var n;(n=t.current)===null||n===void 0?void 0:n.removeEventListener("scroll",e)};// eslint-disable-next-line react-hooks/exhaustive-deps
},[t.current]);return{ref:t,isScrolling:a}}},75532:function(e,t,n){n.d(t,{A:()=>c});/* import */var r=n(41147);/* import */var i=n(14206);/* import */var a=n(41594);/* import */var o=/*#__PURE__*/n.n(a);/* import */var s=n(12470);/* import */var l=/*#__PURE__*/n.n(s);/* import */var u=n(40925);var d=e=>{var{options:t={},onChange:n,initialFiles:o}=e;var{showToast:l}=(0,u/* .useToast */.d)();var d=(0,a.useMemo)(()=>o?Array.isArray(o)?o:[o]:[],[o]);var c=(0,a.useMemo)(()=>(0,i._)((0,r._)({},t,t.type?{library:{type:t.type}}:{}),{multiple:t.multiple?t.multiple===true?"add":t.multiple:false}),[t]);var[p,h]=(0,a.useState)(d);(0,a.useEffect)(()=>{if(d&&!p.length){h(d)}},[p,d]);var v=(0,a.useCallback)(()=>{var e;if(!((e=window.wp)===null||e===void 0?void 0:e.media)){// eslint-disable-next-line no-console
console.error("WordPress media library is not available");return}var t=window.wp.media(c);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();p.forEach(t=>{var n=window.wp.media.attachment(t.id);if(n){n.fetch();e.add(n)}})});t.on("select",()=>{var e=t.state().get("selection").toJSON();var r=new Set(e.map(e=>e.id));var i=p.filter(e=>r.has(e.id));var a=e.reduce((e,t)=>{if(i.some(e=>e.id===t.id)){return e}if(c.maxFileSize&&t.filesizeInBytes>c.maxFileSize){l({// translators: %s is the file title
message:(0,s.sprintf)((0,s.__)("%s size exceeds the maximum allowed size","tutor"),t.title),type:"danger"});return e}var n={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(n);return e},[]);var o=c.multiple?[...i,...a]:a.slice(0,1);if(c.maxFiles&&o.length>c.maxFiles){l({// translators: %d is the maximum number of files allowed.
message:(0,s.sprintf)((0,s.__)("Cannot select more than %d files","tutor"),c.maxFiles),type:"warning"});return}h(o);n===null||n===void 0?void 0:n(c.multiple?o:o[0]||null);t.close()});t.open()},[c,n,p,l]);var f=(0,a.useCallback)(()=>{h([]);n===null||n===void 0?void 0:n(c.multiple?[]:null)},[c.multiple,n]);return{openMediaLibrary:v,existingFiles:p,resetFiles:f}};/* export default */const c=d},57503:function(e,t,n){n.d(t,{A:()=>g});/* import */var r=n(60599);/* import */var i=n(52639);/* import */var a=n(42771);/* import */var o=n(12470);/* import */var s=/*#__PURE__*/n.n(o);/* import */var l=n(25074);/* import */var u=n(13448);/* import */var d=n(81547);/* import */var c=n(31569);/* import */var p=n(52874);/* import */var h=n(21678);function v(){var e=(0,r._)(["\n      button:last-of-type {\n        color: ",";\n      }\n    "]);v=function t(){return e};return e}var f=e=>{var{placement:t,triggerRef:n,isOpen:r,title:a,message:s,onConfirmation:u,onCancel:d,isLoading:p=false,gap:v,maxWidth:f,closePopover:g,animationType:_=c/* .AnimationType.slideLeft */.J6.slideLeft,arrow:b=false,confirmButton:y,cancelButton:w,positionModifier:A}=e;var Y,k,I,q,C;return/*#__PURE__*/(0,i/* .jsx */.Y)(h/* ["default"] */.A,{triggerRef:n,isOpen:r,arrow:b,placement:t,closePopover:g,animationType:_,maxWidth:f,positionModifier:A,gap:v,children:/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:m.content,children:[/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:m.body,children:[/*#__PURE__*/(0,i/* .jsx */.Y)("div",{css:m.title,children:a}),/*#__PURE__*/(0,i/* .jsx */.Y)("p",{css:m.description,children:s})]}),/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:m.footer({isDelete:(Y=y===null||y===void 0?void 0:y.isDelete)!==null&&Y!==void 0?Y:false}),children:[/*#__PURE__*/(0,i/* .jsx */.Y)(l/* ["default"] */.A,{variant:(k=w===null||w===void 0?void 0:w.variant)!==null&&k!==void 0?k:"text",size:"small",onClick:d!==null&&d!==void 0?d:g,children:(I=w===null||w===void 0?void 0:w.text)!==null&&I!==void 0?I:(0,o.__)("Cancel","tutor")}),/*#__PURE__*/(0,i/* .jsx */.Y)(l/* ["default"] */.A,{"data-cy":"confirm-button",variant:(q=y===null||y===void 0?void 0:y.variant)!==null&&q!==void 0?q:"text",onClick:()=>{u();g()},loading:p,size:"small",children:(C=y===null||y===void 0?void 0:y.text)!==null&&C!==void 0?C:(0,o.__)("Ok","tutor")})]})]})})};/* export default */const g=f;var m={content:/*#__PURE__*/(0,a/* .css */.AH)("background-color:",u/* .colorTokens.surface.tutor */.I6.surface.tutor,";box-shadow:",u/* .shadow.popover */.r7.popover,";border-radius:",u/* .borderRadius["6"] */.Vq["6"],";::-webkit-scrollbar{background-color:",u/* .colorTokens.surface.tutor */.I6.surface.tutor,";width:10px;}::-webkit-scrollbar-thumb{background-color:",u/* .colorTokens.action.secondary["default"] */.I6.action.secondary["default"],";border-radius:",u/* .borderRadius["6"] */.Vq["6"],";}"),title:/*#__PURE__*/(0,a/* .css */.AH)(d/* .typography.small */.I.small("medium"),";color:",u/* .colorTokens.text.primary */.I6.text.primary,";"),description:/*#__PURE__*/(0,a/* .css */.AH)(d/* .typography.small */.I.small(),";color:",u/* .colorTokens.text.subdued */.I6.text.subdued,";"),body:/*#__PURE__*/(0,a/* .css */.AH)("padding:",u/* .spacing["16"] */.YK["16"]," ",u/* .spacing["20"] */.YK["20"]," ",u/* .spacing["12"] */.YK["12"],";",p/* .styleUtils.display.flex */.x.display.flex("column"),";gap:",u/* .spacing["8"] */.YK["8"],";"),footer:e=>{var{isDelete:t=false}=e;return/*#__PURE__*/(0,a/* .css */.AH)(p/* .styleUtils.display.flex */.x.display.flex(),";padding:",u/* .spacing["4"] */.YK["4"]," ",u/* .spacing["16"] */.YK["16"]," ",u/* .spacing["8"] */.YK["8"],";justify-content:end;gap:",u/* .spacing["10"] */.YK["10"],";",t&&(0,a/* .css */.AH)(v(),u/* .colorTokens.text.error */.I6.text.error))}}},92795:function(e,t,n){n.d(t,{A:()=>_});/* import */var r=n(60599);/* import */var i=n(52639);/* import */var a=n(42771);/* import */var o=n(13448);/* import */var s=n(81547);/* import */var l=n(59189);/* import */var u=n(49842);function d(){var e=(0,r._)(["\n      border: 1px solid ",";\n      border-radius: ",";\n      background-color: ",";\n    "]);d=function t(){return e};return e}function c(){var e=(0,r._)(["\n      gap: ",";\n      padding: ",";\n      padding-bottom: ",";\n    "]);c=function t(){return e};return e}function p(){var e=(0,r._)(["\n        max-width: 282px;\n      "]);p=function t(){return e};return e}function h(){var e=(0,r._)(["\n      gap: ",";\n    "]);h=function t(){return e};return e}function v(){var e=(0,r._)(["\n      ",";\n      color: ",";\n    "]);v=function t(){return e};return e}function f(){var e=(0,r._)(["\n      ",";\n      color: ",";\n    "]);f=function t(){return e};return e}function g(){var e=(0,r._)(["\n      gap: ",";\n      margin-top: ",";\n    "]);g=function t(){return e};return e}var m=e=>{var{emptyStateImage:t,emptyStateImage2x:n,imageAltText:r,title:a,size:o="medium",description:s,actions:d,removeBorder:c=true,wrapperCss:p}=e;return/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:[b.bannerWrapper(o,c,!!(0,u/* .isDefined */.O9)(t)),p],children:[/*#__PURE__*/(0,i/* .jsx */.Y)(l/* ["default"] */.A,{when:t,children:/*#__PURE__*/(0,i/* .jsx */.Y)("img",{src:t,alt:r,srcSet:n?"".concat(n," 2x"):""})}),/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:b.messageWrapper(o),children:[/*#__PURE__*/(0,i/* .jsx */.Y)("h5",{css:b.title(o),children:a}),/*#__PURE__*/(0,i/* .jsx */.Y)(l/* ["default"] */.A,{when:s,children:/*#__PURE__*/(0,i/* .jsx */.Y)("p",{css:b.description(o),children:s})}),/*#__PURE__*/(0,i/* .jsx */.Y)(l/* ["default"] */.A,{when:d,children:/*#__PURE__*/(0,i/* .jsx */.Y)("div",{"data-actions":true,css:b.actionWrapper(o),children:d})})]})]})};/* export default */const _=m;var b={bannerWrapper:(e,t,n)=>/*#__PURE__*/(0,a/* .css */.AH)("display:grid;place-items:center;justify-content:center;gap:",o/* .spacing["36"] */.YK["36"],";padding:",n?"".concat(o/* .spacing["16"] */.YK["16"]," ").concat(o/* .spacing["20"] */.YK["20"]):"".concat(o/* .spacing["20"] */.YK["20"]),";",!t&&(0,a/* .css */.AH)(d(),o/* .colorTokens.stroke.divider */.I6.stroke.divider,o/* .borderRadius.card */.Vq.card,o/* .colorTokens.background.white */.I6.background.white)," ",e==="small"&&(0,a/* .css */.AH)(c(),o/* .spacing["12"] */.YK["12"],n?o/* .spacing["12"] */.YK["12"]:o/* .spacing["16"] */.YK["16"],n?o/* .spacing["24"] */.YK["24"]:undefined),"    & img{max-width:640px;width:100%;height:auto;border-radius:",e==="small"?o/* .borderRadius["6"] */.Vq["6"]:o/* .borderRadius["10"] */.Vq["10"],";overflow:hidden;object-position:center;object-fit:cover;",e==="small"&&(0,a/* .css */.AH)(p()),"}"),messageWrapper:e=>/*#__PURE__*/(0,a/* .css */.AH)("display:flex;flex-direction:column;max-width:566px;width:100%;gap:",o/* .spacing["12"] */.YK["12"],";text-align:center;",e==="small"&&(0,a/* .css */.AH)(h(),o/* .spacing["8"] */.YK["8"])),title:e=>/*#__PURE__*/(0,a/* .css */.AH)(s/* .typography.heading5 */.I.heading5(),";color:",o/* .colorTokens.text.primary */.I6.text.primary,";",e==="small"&&(0,a/* .css */.AH)(v(),s/* .typography.caption */.I.caption("medium"),o/* .colorTokens.text.primary */.I6.text.primary)),description:e=>/*#__PURE__*/(0,a/* .css */.AH)(s/* .typography.body */.I.body(),";color:",o/* .colorTokens.text.hints */.I6.text.hints,";",e==="small"&&(0,a/* .css */.AH)(f(),s/* .typography.tiny */.I.tiny(),o/* .colorTokens.text.hints */.I6.text.hints)),actionWrapper:e=>/*#__PURE__*/(0,a/* .css */.AH)("margin-top:",o/* .spacing["20"] */.YK["20"],";display:flex;justify-content:center;align-items:center;gap:",o/* .spacing["12"] */.YK["12"],";",e==="small"&&(0,a/* .css */.AH)(g(),o/* .spacing["8"] */.YK["8"],o/* .spacing["8"] */.YK["8"]))}},88893:function(e,t,n){n.d(t,{A:()=>f});/* import */var r=n(60599);/* import */var i=n(52639);/* import */var a=n(41594);/* import */var o=/*#__PURE__*/n.n(a);/* import */var s=n(42771);/* import */var l=n(13448);/* import */var u=n(52874);function d(){var e=(0,r._)(["\n      flex-direction: column;\n      align-items: start;\n      box-shadow: none;\n    "]);d=function t(){return e};return e}function c(){var e=(0,r._)(["\n      width: 3px;\n      height: ","px;\n      top: ","px;\n      bottom: auto;\n      border-radius: 0 "," "," 0;\n    "]);c=function t(){return e};return e}function p(){var e=(0,r._)(["\n      width: 100%;\n      border-bottom: 1px solid ",";\n      justify-content: flex-start;\n\n      &:hover,\n      &:focus,\n      &:active {\n        border-bottom: 1px solid ",";\n      }\n    "]);p=function t(){return e};return e}function h(){var e=(0,r._)(["\n      &,\n      &:hover,\n      &:focus,\n      &:active {\n        background-color: ",";\n        color: ",";\n      }\n\n      & > span {\n        color: ",";\n      }\n\n      & > svg {\n        color: ",";\n      }\n    "]);h=function t(){return e};return e}var v=e=>{var{activeTab:t,onChange:n,tabList:r,orientation:o="horizontal",disabled:s=false,wrapperCss:l}=e;var u=(0,a.useRef)(r.map(()=>/*#__PURE__*/(0,a.createRef)()));var[d,c]=(0,a.useState)();(0,a.useEffect)(()=>{var e=r.reduce((e,t,n)=>{var r,i,a,o;var s=u.current[n];var l={width:((r=s.current)===null||r===void 0?void 0:r.offsetWidth)||0,height:((i=s.current)===null||i===void 0?void 0:i.offsetHeight)||0,left:((a=s.current)===null||a===void 0?void 0:a.offsetLeft)||0,top:((o=s.current)===null||o===void 0?void 0:o.offsetTop)||0};e[t.value]=l;return e},{});c(e)},[r]);return/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:g.container,children:[/*#__PURE__*/(0,i/* .jsx */.Y)("div",{css:[g.wrapper(o),l],role:"tablist",children:r.map((e,r)=>{return/*#__PURE__*/(0,i/* .jsxs */.FD)("button",{onClick:()=>{n(e.value)},css:g.tabButton({isActive:t===e.value,orientation:o}),disabled:s||e.disabled,type:"button",role:"tab","aria-selected":t===e.value?"true":"false",ref:u.current[r],children:[e.icon,e.label,e.count!==undefined&&/*#__PURE__*/(0,i/* .jsxs */.FD)("span",{children:[" (",e.count<10&&e.count>0?"0".concat(e.count):e.count,")"]}),e.activeBadge&&/*#__PURE__*/(0,i/* .jsx */.Y)("span",{css:g.activeBadge})]},r)})}),/*#__PURE__*/(0,i/* .jsx */.Y)("span",{css:g.indicator((d===null||d===void 0?void 0:d[t])||{width:0,height:0,left:0,top:0},o)})]})};/* export default */const f=v;var g={container:/*#__PURE__*/(0,s/* .css */.AH)("position:relative;width:100%;"),wrapper:e=>/*#__PURE__*/(0,s/* .css */.AH)("width:100%;display:flex;justify-items:left;align-items:center;flex-wrap:wrap;box-shadow:",l/* .shadow.tabs */.r7.tabs,";",e==="vertical"&&(0,s/* .css */.AH)(d())),indicator:(e,t)=>/*#__PURE__*/(0,s/* .css */.AH)("width:",e.width,"px;height:3px;position:absolute;left:",e.left,"px;bottom:0;background:",l/* .colorTokens.brand.blue */.I6.brand.blue,";border-radius:",l/* .borderRadius["4"] */.Vq["4"]," ",l/* .borderRadius["4"] */.Vq["4"]," 0 0;transition:all 0.3s cubic-bezier(0.4,0,0.2,1) 0ms;:dir(rtl){left:auto;right:",e.left,"px;}",t==="vertical"&&(0,s/* .css */.AH)(c(),e.height,e.top,l/* .borderRadius["4"] */.Vq["4"],l/* .borderRadius["4"] */.Vq["4"])),tabButton:e=>{var{isActive:t,orientation:n}=e;return/*#__PURE__*/(0,s/* .css */.AH)(u/* .styleUtils.resetButton */.x.resetButton,";font-size:",l/* .fontSize["15"] */.J["15"],";line-height:",l/* .lineHeight["20"] */.K_["20"],";display:flex;justify-content:center;align-items:center;gap:",l/* .spacing["6"] */.YK["6"],";padding:",l/* .spacing["12"] */.YK["12"]," ",l/* .spacing["20"] */.YK["20"],";color:",l/* .colorTokens.text.subdued */.I6.text.subdued,";min-width:130px;position:relative;transition:color 0.3s ease-in-out;border-radius:0px;&:hover,&:focus,&:active{background-color:transparent;color:",l/* .colorTokens.text.subdued */.I6.text.subdued,";box-shadow:none;}& > svg{color:",l/* .colorTokens.icon["default"] */.I6.icon["default"],";}",n==="vertical"&&(0,s/* .css */.AH)(p(),l/* .colorTokens.stroke.border */.I6.stroke.border,l/* .colorTokens.stroke.border */.I6.stroke.border)," ",t&&(0,s/* .css */.AH)(h(),l/* .colorTokens.background.white */.I6.background.white,l/* .colorTokens.text.primary */.I6.text.primary,l/* .colorTokens.text.subdued */.I6.text.subdued,l/* .colorTokens.icon.brand */.I6.icon.brand),"    &:disabled{color:",l/* .colorTokens.text.disable */.I6.text.disable,";&::before{background:",l/* .colorTokens.text.disable */.I6.text.disable,";}}&:focus-visible{outline:2px solid ",l/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:-2px;border-radius:",l/* .borderRadius["4"] */.Vq["4"],";}")},activeBadge:/*#__PURE__*/(0,s/* .css */.AH)("display:inline-block;height:8px;width:8px;border-radius:",l/* .borderRadius.circle */.Vq.circle,";background-color:",l/* .colorTokens.color.success["80"] */.I6.color.success["80"],";")}},98005:function(e,t,n){n.d(t,{A:()=>C});/* import */var r=n(41147);/* import */var i=n(14206);/* import */var a=n(17900);/* import */var o=n(60599);/* import */var s=n(52639);/* import */var l=n(41594);/* import */var u=/*#__PURE__*/n.n(l);/* import */var d=n(42771);/* import */var c=n(18853);/* import */var p=/*#__PURE__*/n.n(c);/* import */var h=n(46225);/* import */var v=n(13448);/* import */var f=n(81547);/* import */var g=n(31569);/* import */var m=n(84206);/* import */var _=n(52874);/* import */var b=n(21678);function y(){var e=(0,o._)(["\n      padding-block: ",";\n    "]);y=function t(){return e};return e}function w(){var e=(0,o._)(["\n      padding: "," ",";\n      ",";\n    "]);w=function t(){return e};return e}function A(){var e=(0,o._)(["\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    "]);A=function t(){return e};return e}function Y(){var e=(0,o._)(["\n      background-color: ",";\n      svg {\n        color: ",";\n      }\n    "]);Y=function t(){return e};return e}function k(){var e=(0,o._)(["\n      background-color: ",";\n      :hover {\n        background-color: ",";\n        svg {\n          color: ",";\n        }\n      }\n    "]);k=function t(){return e};return e}var I=e=>{var{text:t,icon:n,onClick:o,onClosePopover:l,isTrash:u=false,size:d="medium",buttonCss:c,disabled:p}=e,h=(0,a._)(e,["text","icon","onClick","onClosePopover","isTrash","size","buttonCss","disabled"]);return/*#__PURE__*/(0,s/* .jsxs */.FD)("button",(0,i._)((0,r._)({type:"button",css:[D.option({isTrash:u,size:d}),c],onClick:e=>{if(o){o(e)}if(l){l()}},disabled:p},h),{children:[n&&n,/*#__PURE__*/(0,s/* .jsx */.Y)("span",{children:t})]}))};var q=e=>{var{onClick:t,isOpen:n,disabled:o=false,closePopover:d,placement:c=m/* .POPOVER_PLACEMENTS.BOTTOM_RIGHT */.zA.BOTTOM_RIGHT,children:p,animationType:v=g/* .AnimationType.slideLeft */.J6.slideLeft,dotsOrientation:f="horizontal",maxWidth:_="148px",isInverse:y=false,arrow:w=false,size:A="medium",closeOnEscape:Y=true,wrapperCss:k}=e,I=(0,a._)(e,["onClick","isOpen","disabled","closePopover","placement","children","animationType","dotsOrientation","maxWidth","isInverse","arrow","size","closeOnEscape","wrapperCss"]);var q=(0,l.useRef)(null);return/*#__PURE__*/(0,s/* .jsxs */.FD)(s/* .Fragment */.FK,{children:[/*#__PURE__*/(0,s/* .jsx */.Y)("button",(0,i._)((0,r._)({type:"button",ref:q,onClick:t,css:[D.button({isOpen:n,isInverse:y,isDisabled:o}),k],disabled:o},I),{children:/*#__PURE__*/(0,s/* .jsx */.Y)(h/* ["default"] */.A,{name:f==="horizontal"?"threeDots":"threeDotsVertical",width:32,height:32})})),/*#__PURE__*/(0,s/* .jsx */.Y)(b/* ["default"] */.A,{gap:13,maxWidth:_,placement:c,triggerRef:q,isOpen:n,closePopover:d,animationType:v,arrow:w,closeOnEscape:Y,children:/*#__PURE__*/(0,s/* .jsx */.Y)("div",{css:D.wrapper({size:A}),children:u().Children.map(p,e=>{if(/*#__PURE__*/u().isValidElement(e)){var t={size:A};return /*#__PURE__*/u().cloneElement(e,t)}return e})})})]})};q.Option=I;/* export default */const C=q;var D={wrapper:e=>{var{size:t="medium"}=e;return/*#__PURE__*/(0,d/* .css */.AH)("padding-block:",v/* .spacing["8"] */.YK["8"],";position:relative;",t==="small"&&(0,d/* .css */.AH)(y(),v/* .spacing["4"] */.YK["4"]))},option:e=>{var{isTrash:t=false,size:n="medium"}=e;return/*#__PURE__*/(0,d/* .css */.AH)(_/* .styleUtils.resetButton */.x.resetButton,";",f/* .typography.body */.I.body(),";width:100%;padding:",v/* .spacing["10"] */.YK["10"]," ",v/* .spacing["20"] */.YK["20"],";transition:background-color 0.3s ease-in-out;cursor:pointer;display:flex;align-items:center;gap:",v/* .spacing["8"] */.YK["8"],";&:focus,&:active,&:hover{background:none;color:",v/* .colorTokens.text.primary */.I6.text.primary,";}svg{flex-shrink:0;color:",v/* .colorTokens.icon["default"] */.I6.icon["default"],";}",n==="small"&&(0,d/* .css */.AH)(w(),v/* .spacing["8"] */.YK["8"],v/* .spacing["16"] */.YK["16"],f/* .typography.small */.I.small("medium")),":hover:not(:disabled){background-color:",v/* .colorTokens.background.hover */.I6.background.hover,";color:",v/* .colorTokens.text.title */.I6.text.title,";svg{color:",v/* .colorTokens.icon.hover */.I6.icon.hover,";filter:grayscale(0%);}}:disabled{cursor:not-allowed;color:",v/* .colorTokens.text.disable */.I6.text.disable,";svg{color:",v/* .colorTokens.icon.disable.background */.I6.icon.disable.background,";}}",t&&(0,d/* .css */.AH)(A(),v/* .colorTokens.text.error */.I6.text.error,v/* .colorTokens.icon.error */.I6.icon.error,v/* .colorTokens.text.error */.I6.text.error,p()(v/* .colorTokens.bg.error */.I6.bg.error,.1),v/* .colorTokens.icon.error */.I6.icon.error,v/* .colorTokens.text.error */.I6.text.error,v/* .colorTokens.color.danger["40"] */.I6.color.danger["40"],v/* .colorTokens.icon.error */.I6.icon.error),":focus-visible{outline:2px solid ",v/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:-4px;border-radius:",v/* .borderRadius.input */.Vq.input,";}")},button:e=>{var{isOpen:t=false,isInverse:n=false,isDisabled:r=false}=e;return/*#__PURE__*/(0,d/* .css */.AH)(_/* .styleUtils.resetButton */.x.resetButton,";width:32px;height:32px;border-radius:",v/* .borderRadius.circle */.Vq.circle,";display:flex;justify-content:center;align-items:center;transition:background-color 0.3s ease-in-out;svg{color:",v/* .colorTokens.icon["default"] */.I6.icon["default"],";flex-shrink:0;}:hover{background-color:",v/* .colorTokens.background.hover */.I6.background.hover,";svg{color:",v/* .colorTokens.icon["default"] */.I6.icon["default"],";}}&:focus,&:active{background:none;}&:focus-visible{outline:2px solid ",v/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:1px;}",t&&(0,d/* .css */.AH)(Y(),v/* .colorTokens.background.hover */.I6.background.hover,v/* .colorTokens.icon.brand */.I6.icon.brand)," ",n&&(0,d/* .css */.AH)(k(),v/* .colorTokens.background.white */.I6.background.white,v/* .colorTokens.background.white */.I6.background.white,!r&&v/* .colorTokens.icon.brand */.I6.icon.brand),":disabled{cursor:not-allowed;}")}}},66317:function(e,t,n){n.d(t,{J:()=>s,s:()=>l});/* import */var r=n(41147);/* import */var i=n(14206);/* import */var a=n(7697);/* import */var o=n(905);var s=e=>(0,o/* .defaultAnimateLayoutChanges */.uU)((0,i._)((0,r._)({},e),{wasDragging:true}));var l={droppable:{strategy:a/* .MeasuringStrategy.Always */.Pf.Always}}},67035:function(e,t,n){n.d(t,{JD:()=>o,KG:()=>i,M5:()=>u,dX:()=>l,kd:()=>r});function r(e,t){e.lineTo(t.x,t.y);e.stroke()}function i(e,t){var n=t.x-e.x;var r=t.y-e.y;return Math.sqrt(n*n+r*r)}function a(e){var t=atob(e.split(",")[1]);var n=e.split(",")[0].split(":")[1].split(";")[0];var r=new ArrayBuffer(t.length);var i=new Uint8Array(r);for(var a=0;a<t.length;a++){i[a]=t.charCodeAt(a)}return new Blob([r],{type:n})}function o(e,t){var n=a(e);var r=document.createElement("a");r.href=URL.createObjectURL(n);r.download=t;document.body.appendChild(r);r.click();document.body.removeChild(r)}function s(e,t){var n=document.createElement("canvas");n.width=1024;n.height=1024;var r=n.getContext("2d");r===null||r===void 0?void 0:r.putImageData(e,0,0);r===null||r===void 0?void 0:r.drawImage(n,0,0,1024,1024);return new Promise(e=>{n.toBlob(n=>{if(!n){e(null);return}e(new File([n],t,{type:"image/png"}))})})}var l=e=>{if(e&&typeof e!=="function"&&e.current){var t=e.current;var n=t.getContext("2d");return{canvas:t,context:n}}return{canvas:null,context:null}};var u=e=>{return e.toDataURL("image/png")}},73454:function(){/**
 * The symbol to access the `TZDate`'s function to construct a new instance from
 * the provided value. It helps date-fns to inherit the time zone.
 */const e=Symbol.for("constructDateFrom")},30617:function(e,t,n){n.d(t,{B:()=>a});/* import */var r=n(87816);/* import */var i=n(78118);class a extends i/* .TZDateMini */.q{//#region static
static tz(e,...t){return t.length?new a(...t,e):new a(Date.now(),e)}//#endregion
//#region representation
toISOString(){const[e,t,n]=this.tzComponents();const r=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+r}toString(){// "Tue Aug 13 2024 07:50:19 GMT+0800 (Singapore Standard Time)";
return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){// toUTCString returns RFC 7231 ("Mon, 12 Aug 2024 23:36:08 GMT")
const[e,t,n,r]=this.internal.toUTCString().split(" ");// "Tue Aug 13 2024"
return`${e?.slice(0,-1)} ${n} ${t} ${r}`}toTimeString(){// toUTCString returns RFC 7231 ("Mon, 12 Aug 2024 23:36:08 GMT")
const e=this.internal.toUTCString().split(" ")[4];const[t,n,i]=this.tzComponents();// "07:42:23 GMT+0800 (Singapore Standard Time)"
return`${e} GMT${t}${n}${i} (${(0,r/* .tzName */.K)(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}//#endregion
//#region private
tzComponents(){const e=this.getTimezoneOffset();const t=e>0?"-":"+";const n=String(Math.floor(Math.abs(e)/60)).padStart(2,"0");const r=String(Math.abs(e)%60).padStart(2,"0");return[t,n,r]}//#endregion
withTimeZone(e){return new a(+this,e)}//#region date-fns integration
[Symbol.for("constructDateFrom")](e){return new a(+new Date(e),this.timeZone)}}},78118:function(e,t,n){n.d(t,{q:()=>i});/* import */var r=n(33008);class i extends Date{//#region static
constructor(...e){super();if(e.length>1&&typeof e[e.length-1]==="string"){this.timeZone=e.pop()}this.internal=new Date;if(isNaN((0,r/* .tzOffset */.Y)(this.timeZone,this))){this.setTime(NaN)}else{if(!e.length){this.setTime(Date.now())}else if(typeof e[0]==="number"&&(e.length===1||e.length===2&&typeof e[1]!=="number")){this.setTime(e[0])}else if(typeof e[0]==="string"){this.setTime(+new Date(e[0]))}else if(e[0]instanceof Date){this.setTime(+e[0])}else{this.setTime(+new Date(...e));l(this,NaN);o(this)}}}static tz(e,...t){return t.length?new i(...t,e):new i(Date.now(),e)}//#endregion
//#region time zone
withTimeZone(e){return new i(+this,e)}getTimezoneOffset(){const e=-(0,r/* .tzOffset */.Y)(this.timeZone,this);// Remove the seconds offset
// use Math.floor for negative GMT timezones and Math.ceil for positive GMT timezones.
return e>0?Math.floor(e):Math.ceil(e)}//#endregion
//#region time
setTime(e){Date.prototype.setTime.apply(this,arguments);o(this);return+this}//#endregion
//#region date-fns integration
[Symbol.for("constructDateFrom")](e){return new i(+new Date(e),this.timeZone)}}// Assign getters and setters
const a=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!a.test(e))return;const t=e.replace(a,"$1UTC");// Filter out methods without UTC counterparts
if(!i.prototype[t])return;if(e.startsWith("get")){// Delegate to internal date's UTC method
i.prototype[e]=function(){return this.internal[t]()}}else{// Assign regular setter
i.prototype[e]=function(){Date.prototype[t].apply(this.internal,arguments);s(this);return+this};// Assign UTC setter
i.prototype[t]=function(){Date.prototype[t].apply(this,arguments);o(this);return+this}}});/**
 * Function syncs time to internal date, applying the time zone offset.
 *
 * @param {Date} date - Date to sync
 */function o(e){e.internal.setTime(+e);e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-(0,r/* .tzOffset */.Y)(e.timeZone,e)*60))}/**
 * Function syncs the internal date UTC values to the date. It allows to get
 * accurate timestamp value.
 *
 * @param {Date} date - The date to sync
 */function s(e){// First we transpose the internal values
Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate());Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds());// Now we have to adjust the date to the system time zone
l(e)}/**
 * Function adjusts the date to the system time zone. It uses the time zone
 * differences to calculate the offset and adjust the date.
 *
 * @param {Date} date - Date to adjust
 */function l(e){// Save the time zone offset before all the adjustments
const t=(0,r/* .tzOffset */.Y)(e.timeZone,e);// Remove the seconds offset
// use Math.floor for negative GMT timezones and Math.ceil for positive GMT timezones.
const n=t>0?Math.floor(t):Math.ceil(t);//#region System DST adjustment
// The biggest problem with using the system time zone is that when we create
// a date from internal values stored in UTC, the system time zone might end
// up on the DST hour:
//
//   $ TZ=America/New_York node
//   > new Date(2020, 2, 8, 1).toString()
//   'Sun Mar 08 2020 01:00:00 GMT-0500 (Eastern Standard Time)'
//   > new Date(2020, 2, 8, 2).toString()
//   'Sun Mar 08 2020 03:00:00 GMT-0400 (Eastern Daylight Time)'
//   > new Date(2020, 2, 8, 3).toString()
//   'Sun Mar 08 2020 03:00:00 GMT-0400 (Eastern Daylight Time)'
//   > new Date(2020, 2, 8, 4).toString()
//   'Sun Mar 08 2020 04:00:00 GMT-0400 (Eastern Daylight Time)'
//
// Here we get the same hour for both 2 and 3, because the system time zone
// has DST beginning at 8 March 2020, 2 a.m. and jumps to 3 a.m. So we have
// to adjust the internal date to reflect that.
//
// However we want to adjust only if that's the DST hour the change happenes,
// not the hour where DST moves to.
// We calculate the previous hour to see if the time zone offset has changed
// and we have landed on the DST hour.
const i=new Date(+e);// We use UTC methods here as we don't want to land on the same hour again
// in case of DST.
i.setUTCHours(i.getUTCHours()-1);// Calculate if we are on the system DST hour.
const a=-new Date(+e).getTimezoneOffset();const o=-new Date(+i).getTimezoneOffset();const s=a-o;// Detect the DST shift. System DST change will occur both on
const l=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();// Move the internal date when we are on the system DST hour.
if(s&&l)e.internal.setUTCMinutes(e.internal.getUTCMinutes()+s);//#endregion
//#region System diff adjustment
// Now we need to adjust the date, since we just applied internal values.
// We need to calculate the difference between the system and date time zones
// and apply it to the date.
const u=a-n;if(u)Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+u);//#endregion
//#region Seconds System diff adjustment
const d=new Date(+e);// Set the UTC seconds to 0 to isolate the timezone offset in seconds.
d.setUTCSeconds(0);// For negative systemOffset, invert the seconds.
const c=a>0?d.getSeconds():(d.getSeconds()-60)%60;// Calculate the seconds offset based on the timezone offset.
const p=Math.round(-((0,r/* .tzOffset */.Y)(e.timeZone,e)*60))%60;if(p||c){e.internal.setUTCSeconds(e.internal.getUTCSeconds()+p);Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+p+c)}//#endregion
//#region Post-adjustment DST fix
const h=(0,r/* .tzOffset */.Y)(e.timeZone,e);// Remove the seconds offset
// use Math.floor for negative GMT timezones and Math.ceil for positive GMT timezones.
const v=h>0?Math.floor(h):Math.ceil(h);const f=-new Date(+e).getTimezoneOffset();const g=f-v;const m=v!==n;const _=g-u;if(m&&_){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+_);// Now we need to check if got offset change during the post-adjustment.
// If so, we also need both dates to reflect that.
const t=(0,r/* .tzOffset */.Y)(e.timeZone,e);// Remove the seconds offset
// use Math.floor for negative GMT timezones and Math.ceil for positive GMT timezones.
const n=t>0?Math.floor(t):Math.ceil(t);const i=v-n;if(i){e.internal.setUTCMinutes(e.internal.getUTCMinutes()+i);Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+i)}}//#endregion
}},2832:function(e,t,n){n.d(t,{BB:()=>/* reexport safe */i.B});/* import */var r=n(73454);/* import */var i=n(30617);/* import */var a=n(78118);/* import */var o=n(88351)},88351:function(e,t,n){/* import */var r=n(30617);/**
 * The function creates accepts a time zone and returns a function that creates
 * a new `TZDate` instance in the time zone from the provided value. Use it to
 * provide the context for the date-fns functions, via the `in` option.
 *
 * @param timeZone - Time zone name (IANA or UTC offset)
 *
 * @returns Function that creates a new `TZDate` instance in the time zone
 */const i=e=>t=>TZDate.tz(e,+new Date(t))},87816:function(e,t,n){n.d(t,{K:()=>r});/**
 * Time zone name format.
 *//**
 * The function returns the time zone name for the given date in the specified
 * time zone.
 *
 * It uses the `Intl.DateTimeFormat` API and by default outputs the time zone
 * name in a long format, e.g. "Pacific Standard Time" or
 * "Singapore Standard Time".
 *
 * It is possible to specify the format as the third argument using one of the following options
 *
 * - "short": e.g. "EDT" or "GMT+8".
 * - "long": e.g. "Eastern Daylight Time".
 * - "shortGeneric": e.g. "ET" or "Singapore Time".
 * - "longGeneric": e.g. "Eastern Time" or "Singapore Standard Time".
 *
 * These options correspond to TR35 tokens `z..zzz`, `zzzz`, `v`, and `vvvv` respectively: https://www.unicode.org/reports/tr35/tr35-dates.html#dfst-zone
 *
 * @param timeZone - Time zone name (IANA or UTC offset)
 * @param date - Date object to get the time zone name for
 * @param format - Optional format of the time zone name. Defaults to "long". Can be "short", "long", "shortGeneric", or "longGeneric".
 *
 * @returns Time zone name (e.g. "Singapore Standard Time")
 */function r(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{// Enforces engine to render the time. Without the option JavaScriptCore omits it.
hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g)// Format.JS uses non-breaking spaces
.slice(2)// Skip the hour and AM/PM parts
.join(" ")}},33008:function(e,t,n){n.d(t,{Y:()=>a});const r={};const i={};/**
 * The function extracts UTC offset in minutes from the given date in specified
 * time zone.
 *
 * Unlike `Date.prototype.getTimezoneOffset`, this function returns the value
 * mirrored to the sign of the offset in the time zone. For Asia/Singapore
 * (UTC+8), `tzOffset` returns 480, while `getTimezoneOffset` returns -480.
 *
 * @param timeZone - Time zone name (IANA or UTC offset)
 * @param date - Date to check the offset for
 *
 * @returns UTC offset in minutes
 */function a(e,t){try{const n=r[e]||=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format;const a=n(t).split("GMT")[1];if(a in i)return i[a];return s(a,a.split(":"))}catch{// Fallback to manual parsing if the runtime doesn't support ±HH:MM/±HHMM/±HH
// See: https://github.com/nodejs/node/issues/53419
if(e in i)return i[e];const t=e?.match(o);if(t)return s(e,t.slice(1));return NaN}}const o=/([+-]\d\d):?(\d\d)?/;function s(e,t){const n=+(t[0]||0);const r=+(t[1]||0);// Convert seconds to minutes by dividing by 60 to keep the function return in minutes.
const a=+(t[2]||0)/60;return i[e]=n*60+r>0?n*60+r+a:n*60-r-a}},50114:function(e,t,n){n.d(t,{P:()=>i});/* import */var r=n(75518);function i(e,t){const[n,i]=(0,r/* .normalizeDates */.x)(e,t.start,t.end);return{start:n,end:i}}},56187:function(e,t,n){n.d(t,{f:()=>a});/* import */var r=n(5054);/* import */var i=n(84350);/**
 * The {@link addDays} function options.
 *//**
 * @name addDays
 * @category Day Helpers
 * @summary Add the specified number of days to the given date.
 *
 * @description
 * Add the specified number of days to the given date.
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
 *
 * @param date - The date to be changed
 * @param amount - The amount of days to be added.
 * @param options - An object with options
 *
 * @returns The new date with the days added
 *
 * @example
 * // Add 10 days to 1 September 2014:
 * const result = addDays(new Date(2014, 8, 1), 10)
 * //=> Thu Sep 11 2014 00:00:00
 */function a(e,t,n){const a=(0,i/* .toDate */.a)(e,n?.in);if(isNaN(t))return(0,r/* .constructFrom */.w)(n?.in||e,NaN);// If 0 days, no-op to avoid changing times in the hour before end of DST
if(!t)return a;a.setDate(a.getDate()+t);return a}// Fallback for modularized imports:
/* unused export default */var o=/* unused pure expression or super */null&&a},59099:function(e,t,n){n.d(t,{P:()=>a});/* import */var r=n(5054);/* import */var i=n(84350);/**
 * The {@link addMonths} function options.
 *//**
 * @name addMonths
 * @category Month Helpers
 * @summary Add the specified number of months to the given date.
 *
 * @description
 * Add the specified number of months to the given date.
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
 *
 * @param date - The date to be changed
 * @param amount - The amount of months to be added.
 * @param options - The options object
 *
 * @returns The new date with the months added
 *
 * @example
 * // Add 5 months to 1 September 2014:
 * const result = addMonths(new Date(2014, 8, 1), 5)
 * //=> Sun Feb 01 2015 00:00:00
 *
 * // Add one month to 30 January 2023:
 * const result = addMonths(new Date(2023, 0, 30), 1)
 * //=> Tue Feb 28 2023 00:00:00
 */function a(e,t,n){const a=(0,i/* .toDate */.a)(e,n?.in);if(isNaN(t))return(0,r/* .constructFrom */.w)(n?.in||e,NaN);if(!t){// If 0 months, no-op to avoid changing times in the hour before end of DST
return a}const o=a.getDate();// The JS Date object supports date math by accepting out-of-bounds values for
// month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and
// new Date(2020, 13, 1) returns 1 Feb 2021.  This is *almost* the behavior we
// want except that dates will wrap around the end of a month, meaning that
// new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So
// we'll default to the end of the desired month by adding 1 to the desired
// month and using a date of 0 to back up one day to the end of the desired
// month.
const s=(0,r/* .constructFrom */.w)(n?.in||e,a.getTime());s.setMonth(a.getMonth()+t+1,0);const l=s.getDate();if(o>=l){// If we're already at the end of the month, then this is the correct date
// and we're done.
return s}else{// Otherwise, we now know that setting the original day-of-month value won't
// cause an overflow, so set the desired day-of-month. Note that we can't
// just set the date of `endOfDesiredMonth` because that object may have had
// its time changed in the unusual case where where a DST transition was on
// the last day of the month and its local time was in the hour skipped or
// repeated next to a DST transition.  So we use `date` instead which is
// guaranteed to still have the original time.
a.setFullYear(s.getFullYear(),s.getMonth(),o);return a}}// Fallback for modularized imports:
/* unused export default */var o=/* unused pure expression or super */null&&a},46199:function(e,t,n){n.d(t,{J:()=>i});/* import */var r=n(56187);/**
 * The {@link addWeeks} function options.
 *//**
 * @name addWeeks
 * @category Week Helpers
 * @summary Add the specified number of weeks to the given date.
 *
 * @description
 * Add the specified number of weeks to the given date.
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
 *
 * @param date - The date to be changed
 * @param amount - The amount of weeks to be added.
 * @param options - An object with options
 *
 * @returns The new date with the weeks added
 *
 * @example
 * // Add 4 weeks to 1 September 2014:
 * const result = addWeeks(new Date(2014, 8, 1), 4)
 * //=> Mon Sep 29 2014 00:00:00
 */function i(e,t,n){return(0,r/* .addDays */.f)(e,t*7,n)}// Fallback for modularized imports:
/* unused export default */var a=/* unused pure expression or super */null&&i},19636:function(e,t,n){n.d(t,{e:()=>i});/* import */var r=n(59099);/**
 * The {@link addYears} function options.
 *//**
 * @name addYears
 * @category Year Helpers
 * @summary Add the specified number of years to the given date.
 *
 * @description
 * Add the specified number of years to the given date.
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
 * @typeParam ResultDate - The result `Date` type.
 *
 * @param date - The date to be changed
 * @param amount - The amount of years to be added.
 * @param options - The options
 *
 * @returns The new date with the years added
 *
 * @example
 * // Add 5 years to 1 September 2014:
 * const result = addYears(new Date(2014, 8, 1), 5)
 * //=> Sun Sep 01 2019 00:00:00
 */function i(e,t,n){return(0,r/* .addMonths */.P)(e,t*12,n)}// Fallback for modularized imports:
/* unused export default */var a=/* unused pure expression or super */null&&i},9970:function(e,t,n){n.d(t,{U:()=>i});/* import */var r=n(75518);/**
 * The {@link differenceInCalendarMonths} function options.
 *//**
 * @name differenceInCalendarMonths
 * @category Month Helpers
 * @summary Get the number of calendar months between the given dates.
 *
 * @description
 * Get the number of calendar months between the given dates.
 *
 * @param laterDate - The later date
 * @param earlierDate - The earlier date
 * @param options - An object with options
 *
 * @returns The number of calendar months
 *
 * @example
 * // How many calendar months are between 31 January 2014 and 1 September 2014?
 * const result = differenceInCalendarMonths(
 *   new Date(2014, 8, 1),
 *   new Date(2014, 0, 31)
 * )
 * //=> 8
 */function i(e,t,n){const[i,a]=(0,r/* .normalizeDates */.x)(n?.in,e,t);const o=i.getFullYear()-a.getFullYear();const s=i.getMonth()-a.getMonth();return o*12+s}// Fallback for modularized imports:
/* unused export default */var a=/* unused pure expression or super */null&&i},50178:function(e,t,n){n.d(t,{G:()=>o});/* import */var r=n(50114);/* import */var i=n(52575);/* import */var a=n(5054);/**
 * The {@link eachMinuteOfInterval} function options.
 *//**
 * The {@link eachMinuteOfInterval} function result type. It resolves the proper data type.
 * It uses the first argument date object type, starting from the date argument,
 * then the start interval date, and finally the end interval date. If
 * a context function is passed, it uses the context function return type.
 *//**
 * @name eachMinuteOfInterval
 * @category Interval Helpers
 * @summary Return the array of minutes within the specified time interval.
 *
 * @description
 * Returns the array of minutes within the specified time interval.
 *
 * @typeParam IntervalType - Interval type.
 * @typeParam Options - Options type.
 *
 * @param interval - The interval.
 * @param options - An object with options.
 *
 * @returns The array with starts of minutes from the minute of the interval start to the minute of the interval end
 *
 * @example
 * // Each minute between 14 October 2020, 13:00 and 14 October 2020, 13:03
 * const result = eachMinuteOfInterval({
 *   start: new Date(2014, 9, 14, 13),
 *   end: new Date(2014, 9, 14, 13, 3)
 * })
 * //=> [
 * //   Wed Oct 14 2014 13:00:00,
 * //   Wed Oct 14 2014 13:01:00,
 * //   Wed Oct 14 2014 13:02:00,
 * //   Wed Oct 14 2014 13:03:00
 * // ]
 */function o(e,t){const{start:n,end:o}=(0,r/* .normalizeInterval */.P)(t?.in,e);// Set to the start of the minute
n.setSeconds(0,0);let s=+n>+o;const l=s?+n:+o;let u=s?o:n;let d=t?.step??1;if(!d)return[];if(d<0){d=-d;s=!s}const c=[];while(+u<=l){c.push((0,a/* .constructFrom */.w)(n,u));u=(0,i/* .addMinutes */.z)(u,d)}return s?c.reverse():c}// Fallback for modularized imports:
/* unused export default */var s=/* unused pure expression or super */null&&o},56190:function(e,t,n){n.d(t,{i:()=>a});/* import */var r=n(50114);/* import */var i=n(5054);/**
 * The {@link eachMonthOfInterval} function options.
 *//**
 * The {@link eachMonthOfInterval} function result type. It resolves the proper data type.
 *//**
 * @name eachMonthOfInterval
 * @category Interval Helpers
 * @summary Return the array of months within the specified time interval.
 *
 * @description
 * Return the array of months within the specified time interval.
 *
 * @typeParam IntervalType - Interval type.
 * @typeParam Options - Options type.
 *
 * @param interval - The interval.
 * @param options - An object with options.
 *
 * @returns The array with starts of months from the month of the interval start to the month of the interval end
 *
 * @example
 * // Each month between 6 February 2014 and 10 August 2014:
 * const result = eachMonthOfInterval({
 *   start: new Date(2014, 1, 6),
 *   end: new Date(2014, 7, 10)
 * })
 * //=> [
 * //   Sat Feb 01 2014 00:00:00,
 * //   Sat Mar 01 2014 00:00:00,
 * //   Tue Apr 01 2014 00:00:00,
 * //   Thu May 01 2014 00:00:00,
 * //   Sun Jun 01 2014 00:00:00,
 * //   Tue Jul 01 2014 00:00:00,
 * //   Fri Aug 01 2014 00:00:00
 * // ]
 */function a(e,t){const{start:n,end:a}=(0,r/* .normalizeInterval */.P)(t?.in,e);let o=+n>+a;const s=o?+n:+a;const l=o?a:n;l.setHours(0,0,0,0);l.setDate(1);let u=t?.step??1;if(!u)return[];if(u<0){u=-u;o=!o}const d=[];while(+l<=s){d.push((0,i/* .constructFrom */.w)(n,l));l.setMonth(l.getMonth()+u)}return o?d.reverse():d}// Fallback for modularized imports:
/* unused export default */var o=/* unused pure expression or super */null&&a},78307:function(e,t,n){n.d(t,{z:()=>a});/* import */var r=n(50114);/* import */var i=n(5054);/**
 * The {@link eachYearOfInterval} function options.
 *//**
 * The {@link eachYearOfInterval} function result type. It resolves the proper data type.
 * It uses the first argument date object type, starting from the date argument,
 * then the start interval date, and finally the end interval date. If
 * a context function is passed, it uses the context function return type.
 *//**
 * @name eachYearOfInterval
 * @category Interval Helpers
 * @summary Return the array of yearly timestamps within the specified time interval.
 *
 * @description
 * Return the array of yearly timestamps within the specified time interval.
 *
 * @typeParam IntervalType - Interval type.
 * @typeParam Options - Options type.
 *
 * @param interval - The interval.
 * @param options - An object with options.
 *
 * @returns The array with starts of yearly timestamps from the month of the interval start to the month of the interval end
 *
 * @example
 * // Each year between 6 February 2014 and 10 August 2017:
 * const result = eachYearOfInterval({
 *   start: new Date(2014, 1, 6),
 *   end: new Date(2017, 7, 10)
 * })
 * //=> [
 * //   Wed Jan 01 2014 00:00:00,
 * //   Thu Jan 01 2015 00:00:00,
 * //   Fri Jan 01 2016 00:00:00,
 * //   Sun Jan 01 2017 00:00:00
 * // ]
 */function a(e,t){const{start:n,end:a}=(0,r/* .normalizeInterval */.P)(t?.in,e);let o=+n>+a;const s=o?+n:+a;const l=o?a:n;l.setHours(0,0,0,0);l.setMonth(0,1);let u=t?.step??1;if(!u)return[];if(u<0){u=-u;o=!o}const d=[];while(+l<=s){d.push((0,i/* .constructFrom */.w)(n,l));l.setFullYear(l.getFullYear()+u)}return o?d.reverse():d}// Fallback for modularized imports:
/* unused export default */var o=/* unused pure expression or super */null&&a},48606:function(e,t,n){n.d(t,{g:()=>i});/* import */var r=n(547);/**
 * The {@link endOfISOWeek} function options.
 *//**
 * @name endOfISOWeek
 * @category ISO Week Helpers
 * @summary Return the end of an ISO week for the given date.
 *
 * @description
 * Return the end of an ISO week for the given date.
 * The result will be in the local timezone.
 *
 * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
 *
 * @param date - The original date
 * @param options - An object with options
 *
 * @returns The end of an ISO week
 *
 * @example
 * // The end of an ISO week for 2 September 2014 11:55:00:
 * const result = endOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))
 * //=> Sun Sep 07 2014 23:59:59.999
 */function i(e,t){return(0,r/* .endOfWeek */.$)(e,{...t,weekStartsOn:1})}// Fallback for modularized imports:
/* unused export default */var a=/* unused pure expression or super */null&&i},17193:function(e,t,n){n.d(t,{p:()=>i});/* import */var r=n(84350);/**
 * The {@link endOfMonth} function options.
 *//**
 * @name endOfMonth
 * @category Month Helpers
 * @summary Return the end of a month for the given date.
 *
 * @description
 * Return the end of a month for the given date.
 * The result will be in the local timezone.
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
 *
 * @param date - The original date
 * @param options - An object with options
 *
 * @returns The end of a month
 *
 * @example
 * // The end of a month for 2 September 2014 11:55:00:
 * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))
 * //=> Tue Sep 30 2014 23:59:59.999
 */function i(e,t){const n=(0,r/* .toDate */.a)(e,t?.in);const i=n.getMonth();n.setFullYear(n.getFullYear(),i+1,0);n.setHours(23,59,59,999);return n}// Fallback for modularized imports:
/* unused export default */var a=/* unused pure expression or super */null&&i},547:function(e,t,n){n.d(t,{$:()=>a});/* import */var r=n(87411);/* import */var i=n(84350);/**
 * The {@link endOfWeek} function options.
 *//**
 * @name endOfWeek
 * @category Week Helpers
 * @summary Return the end of a week for the given date.
 *
 * @description
 * Return the end of a week for the given date.
 * The result will be in the local timezone.
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
 *
 * @param date - The original date
 * @param options - An object with options
 *
 * @returns The end of a week
 *
 * @example
 * // The end of a week for 2 September 2014 11:55:00:
 * const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0))
 * //=> Sat Sep 06 2014 23:59:59.999
 *
 * @example
 * // If the week starts on Monday, the end of the week for 2 September 2014 11:55:00:
 * const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
 * //=> Sun Sep 07 2014 23:59:59.999
 */function a(e,t){const n=(0,r/* .getDefaultOptions */.q)();const a=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0;const o=(0,i/* .toDate */.a)(e,t?.in);const s=o.getDay();const l=(s<a?-7:0)+6-(s-a);o.setDate(o.getDate()+l);o.setHours(23,59,59,999);return o}// Fallback for modularized imports:
/* unused export default */var o=/* unused pure expression or super */null&&a},66146:function(e,t,n){n.d(t,{Q:()=>i});/* import */var r=n(84350);/**
 * The {@link endOfYear} function options.
 *//**
 * @name endOfYear
 * @category Year Helpers
 * @summary Return the end of a year for the given date.
 *
 * @description
 * Return the end of a year for the given date.
 * The result will be in the local timezone.
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
 *
 * @param date - The original date
 * @param options - The options
 *
 * @returns The end of a year
 *
 * @example
 * // The end of a year for 2 September 2014 11:55:00:
 * const result = endOfYear(new Date(2014, 8, 2, 11, 55, 0))
 * //=> Wed Dec 31 2014 23:59:59.999
 */function i(e,t){const n=(0,r/* .toDate */.a)(e,t?.in);const i=n.getFullYear();n.setFullYear(i+1,0,0);n.setHours(23,59,59,999);return n}// Fallback for modularized imports:
/* unused export default */var a=/* unused pure expression or super */null&&i},92245:function(e,t,n){n.d(t,{P:()=>a});/* import */var r=n(5054);/* import */var i=n(84350);/**
 * The {@link getDaysInMonth} function options.
 *//**
 * @name getDaysInMonth
 * @category Month Helpers
 * @summary Get the number of days in a month of the given date.
 *
 * @description
 * Get the number of days in a month of the given date, considering the context if provided.
 *
 * @param date - The given date
 * @param options - An object with options
 *
 * @returns The number of days in a month
 *
 * @example
 * // How many days are in February 2000?
 * const result = getDaysInMonth(new Date(2000, 1))
 * //=> 29
 */function a(e,t){const n=(0,i/* .toDate */.a)(e,t?.in);const a=n.getFullYear();const o=n.getMonth();const s=(0,r/* .constructFrom */.w)(n,0);s.setFullYear(a,o+1,0);s.setHours(0,0,0,0);return s.getDate()}// Fallback for modularized imports:
/* unused export default */var o=/* unused pure expression or super */null&&a},1261:function(e,t,n){n.d(t,{t:()=>i});/* import */var r=n(84350);/**
 * The {@link getMonth} function options.
 *//**
 * @name getMonth
 * @category Month Helpers
 * @summary Get the month of the given date.
 *
 * @description
 * Get the month of the given date.
 *
 * @param date - The given date
 * @param options - An object with options
 *
 * @returns The month index (0-11)
 *
 * @example
 * // Which month is 29 February 2012?
 * const result = getMonth(new Date(2012, 1, 29))
 * //=> 1
 */function i(e,t){return(0,r/* .toDate */.a)(e,t?.in).getMonth()}// Fallback for modularized imports:
/* unused export default */var a=/* unused pure expression or super */null&&i},14646:function(e,t,n){n.d(t,{C:()=>i});/* import */var r=n(84350);/**
 * The {@link getYear} function options.
 *//**
 * @name getYear
 * @category Year Helpers
 * @summary Get the year of the given date.
 *
 * @description
 * Get the year of the given date.
 *
 * @param date - The given date
 * @param options - An object with options
 *
 * @returns The year
 *
 * @example
 * // Which year is 2 July 2014?
 * const result = getYear(new Date(2014, 6, 2))
 * //=> 2014
 */function i(e,t){return(0,r/* .toDate */.a)(e,t?.in).getFullYear()}// Fallback for modularized imports:
/* unused export default */var a=/* unused pure expression or super */null&&i},74085:function(e,t,n){n.d(t,{d:()=>i});/* import */var r=n(84350);/**
 * @name isAfter
 * @category Common Helpers
 * @summary Is the first date after the second one?
 *
 * @description
 * Is the first date after the second one?
 *
 * @param date - The date that should be after the other one to return true
 * @param dateToCompare - The date to compare with
 *
 * @returns The first date is after the second date
 *
 * @example
 * // Is 10 July 1989 after 11 February 1987?
 * const result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))
 * //=> true
 */function i(e,t){return+(0,r/* .toDate */.a)(e)>+(0,r/* .toDate */.a)(t)}// Fallback for modularized imports:
/* unused export default */var a=/* unused pure expression or super */null&&i},13851:function(e,t,n){n.d(t,{r:()=>a});/* import */var r=n(75518);/* import */var i=n(5758);/**
 * The {@link isSameDay} function options.
 *//**
 * @name isSameDay
 * @category Day Helpers
 * @summary Are the given dates in the same day (and year and month)?
 *
 * @description
 * Are the given dates in the same day (and year and month)?
 *
 * @param laterDate - The first date to check
 * @param earlierDate - The second date to check
 * @param options - An object with options
 *
 * @returns The dates are in the same day (and year and month)
 *
 * @example
 * // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day?
 * const result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0))
 * //=> true
 *
 * @example
 * // Are 4 September and 4 October in the same day?
 * const result = isSameDay(new Date(2014, 8, 4), new Date(2014, 9, 4))
 * //=> false
 *
 * @example
 * // Are 4 September, 2014 and 4 September, 2015 in the same day?
 * const result = isSameDay(new Date(2014, 8, 4), new Date(2015, 8, 4))
 * //=> false
 */function a(e,t,n){const[a,o]=(0,r/* .normalizeDates */.x)(n?.in,e,t);return+(0,i/* .startOfDay */.o)(a)===+(0,i/* .startOfDay */.o)(o)}// Fallback for modularized imports:
/* unused export default */var o=/* unused pure expression or super */null&&a},6903:function(e,t,n){n.d(t,{t:()=>i});/* import */var r=n(75518);/**
 * The {@link isSameMonth} function options.
 *//**
 * @name isSameMonth
 * @category Month Helpers
 * @summary Are the given dates in the same month (and year)?
 *
 * @description
 * Are the given dates in the same month (and year)?
 *
 * @param laterDate - The first date to check
 * @param earlierDate - The second date to check
 * @param options - An object with options
 *
 * @returns The dates are in the same month (and year)
 *
 * @example
 * // Are 2 September 2014 and 25 September 2014 in the same month?
 * const result = isSameMonth(new Date(2014, 8, 2), new Date(2014, 8, 25))
 * //=> true
 *
 * @example
 * // Are 2 September 2014 and 25 September 2015 in the same month?
 * const result = isSameMonth(new Date(2014, 8, 2), new Date(2015, 8, 25))
 * //=> false
 */function i(e,t,n){const[i,a]=(0,r/* .normalizeDates */.x)(n?.in,e,t);return i.getFullYear()===a.getFullYear()&&i.getMonth()===a.getMonth()}// Fallback for modularized imports:
/* unused export default */var a=/* unused pure expression or super */null&&i},39896:function(e,t,n){n.d(t,{s:()=>i});/* import */var r=n(75518);/**
 * The {@link isSameYear} function options.
 *//**
 * @name isSameYear
 * @category Year Helpers
 * @summary Are the given dates in the same year?
 *
 * @description
 * Are the given dates in the same year?
 *
 * @param laterDate - The first date to check
 * @param earlierDate - The second date to check
 * @param options - An object with options
 *
 * @returns The dates are in the same year
 *
 * @example
 * // Are 2 September 2014 and 25 September 2014 in the same year?
 * const result = isSameYear(new Date(2014, 8, 2), new Date(2014, 8, 25))
 * //=> true
 */function i(e,t,n){const[i,a]=(0,r/* .normalizeDates */.x)(n?.in,e,t);return i.getFullYear()===a.getFullYear()}// Fallback for modularized imports:
/* unused export default */var a=/* unused pure expression or super */null&&i},8153:function(e,t,n){n.d(t,{T:()=>a});/* import */var r=n(5054);/* import */var i=n(84350);/**
 * The {@link max} function options.
 *//**
 * @name max
 * @category Common Helpers
 * @summary Return the latest of the given dates.
 *
 * @description
 * Return the latest of the given dates.
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
 *
 * @param dates - The dates to compare
 *
 * @returns The latest of the dates
 *
 * @example
 * // Which of these dates is the latest?
 * const result = max([
 *   new Date(1989, 6, 10),
 *   new Date(1987, 1, 11),
 *   new Date(1995, 6, 2),
 *   new Date(1990, 0, 1)
 * ])
 * //=> Sun Jul 02 1995 00:00:00
 */function a(e,t){let n;let a=t?.in;e.forEach(e=>{// Use the first date object as the context function
if(!a&&typeof e==="object")a=r/* .constructFrom.bind */.w.bind(null,e);const t=(0,i/* .toDate */.a)(e,a);if(!n||n<t||isNaN(+t))n=t});return(0,r/* .constructFrom */.w)(a,n||NaN)}// Fallback for modularized imports:
/* unused export default */var o=/* unused pure expression or super */null&&a},98843:function(e,t,n){n.d(t,{j:()=>a});/* import */var r=n(5054);/* import */var i=n(84350);/**
 * The {@link min} function options.
 *//**
 * @name min
 * @category Common Helpers
 * @summary Returns the earliest of the given dates.
 *
 * @description
 * Returns the earliest of the given dates.
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
 *
 * @param dates - The dates to compare
 *
 * @returns The earliest of the dates
 *
 * @example
 * // Which of these dates is the earliest?
 * const result = min([
 *   new Date(1989, 6, 10),
 *   new Date(1987, 1, 11),
 *   new Date(1995, 6, 2),
 *   new Date(1990, 0, 1)
 * ])
 * //=> Wed Feb 11 1987 00:00:00
 */function a(e,t){let n;let a=t?.in;e.forEach(e=>{// Use the first date object as the context function
if(!a&&typeof e==="object")a=r/* .constructFrom.bind */.w.bind(null,e);const t=(0,i/* .toDate */.a)(e,a);if(!n||n>t||isNaN(+t))n=t});return(0,r/* .constructFrom */.w)(a,n||NaN)}// Fallback for modularized imports:
/* unused export default */var o=/* unused pure expression or super */null&&a},69580:function(e,t,n){n.d(t,{a:()=>i});/* import */var r=n(84350);/**
 * The {@link setHours} function options.
 *//**
 * @name setHours
 * @category Hour Helpers
 * @summary Set the hours to the given date.
 *
 * @description
 * Set the hours to the given date.
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
 *
 * @param date - The date to be changed
 * @param hours - The hours of the new date
 * @param options - An object with options
 *
 * @returns The new date with the hours set
 *
 * @example
 * // Set 4 hours to 1 September 2014 11:30:00:
 * const result = setHours(new Date(2014, 8, 1, 11, 30), 4)
 * //=> Mon Sep 01 2014 04:30:00
 */function i(e,t,n){const i=(0,r/* .toDate */.a)(e,n?.in);i.setHours(t);return i}// Fallback for modularized imports:
/* unused export default */var a=/* unused pure expression or super */null&&i},98898:function(e,t,n){n.d(t,{g:()=>i});/* import */var r=n(84350);/**
 * The {@link setMinutes} function options.
 *//**
 * @name setMinutes
 * @category Minute Helpers
 * @summary Set the minutes to the given date.
 *
 * @description
 * Set the minutes to the given date.
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows using extensions like [`UTCDate`](https://github.com/date-fns/utc).
 * @typeParam ResultDate - The result `Date` type, returned from the context function, or inferred from the arguments.
 *
 * @param date - The date to be changed
 * @param minutes - The minutes of the new date
 * @param options - An object with options
 *
 * @returns The new date with the minutes set
 *
 * @example
 * // Set 45 minutes to 1 September 2014 11:30:40:
 * const result = setMinutes(new Date(2014, 8, 1, 11, 30, 40), 45)
 * //=> Mon Sep 01 2014 11:45:40
 */function i(e,t,n){const i=(0,r/* .toDate */.a)(e,n?.in);i.setMinutes(t);return i}// Fallback for modularized imports:
/* unused export default */var a=/* unused pure expression or super */null&&i},47593:function(e,t,n){n.d(t,{Z:()=>o});/* import */var r=n(5054);/* import */var i=n(92245);/* import */var a=n(84350);/**
 * The {@link setMonth} function options.
 *//**
 * @name setMonth
 * @category Month Helpers
 * @summary Set the month to the given date.
 *
 * @description
 * Set the month to the given date.
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
 *
 * @param date - The date to be changed
 * @param month - The month index to set (0-11)
 * @param options - The options
 *
 * @returns The new date with the month set
 *
 * @example
 * // Set February to 1 September 2014:
 * const result = setMonth(new Date(2014, 8, 1), 1)
 * //=> Sat Feb 01 2014 00:00:00
 */function o(e,t,n){const o=(0,a/* .toDate */.a)(e,n?.in);const s=o.getFullYear();const l=o.getDate();const u=(0,r/* .constructFrom */.w)(n?.in||e,0);u.setFullYear(s,t,15);u.setHours(0,0,0,0);const d=(0,i/* .getDaysInMonth */.P)(u);// Set the earlier date, allows to wrap Jan 31 to Feb 28
o.setMonth(t,Math.min(l,d));return o}// Fallback for modularized imports:
/* unused export default */var s=/* unused pure expression or super */null&&o},58050:function(e,t,n){n.d(t,{i:()=>a});/* import */var r=n(5054);/* import */var i=n(84350);/**
 * The {@link setYear} function options.
 *//**
 * @name setYear
 * @category Year Helpers
 * @summary Set the year to the given date.
 *
 * @description
 * Set the year to the given date.
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
 *
 * @param date - The date to be changed
 * @param year - The year of the new date
 * @param options - An object with options.
 *
 * @returns The new date with the year set
 *
 * @example
 * // Set year 2013 to 1 September 2014:
 * const result = setYear(new Date(2014, 8, 1), 2013)
 * //=> Sun Sep 01 2013 00:00:00
 */function a(e,t,n){const a=(0,i/* .toDate */.a)(e,n?.in);// Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date
if(isNaN(+a))return(0,r/* .constructFrom */.w)(n?.in||e,NaN);a.setFullYear(t);return a}// Fallback for modularized imports:
/* unused export default */var o=/* unused pure expression or super */null&&a},910:function(e,t,n){n.d(t,{w:()=>i});/* import */var r=n(84350);/**
 * The {@link startOfMonth} function options.
 *//**
 * @name startOfMonth
 * @category Month Helpers
 * @summary Return the start of a month for the given date.
 *
 * @description
 * Return the start of a month for the given date. The result will be in the local timezone.
 *
 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments.
 * Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed,
 * or inferred from the arguments.
 *
 * @param date - The original date
 * @param options - An object with options
 *
 * @returns The start of a month
 *
 * @example
 * // The start of a month for 2 September 2014 11:55:00:
 * const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))
 * //=> Mon Sep 01 2014 00:00:00
 */function i(e,t){const n=(0,r/* .toDate */.a)(e,t?.in);n.setDate(1);n.setHours(0,0,0,0);return n}// Fallback for modularized imports:
/* unused export default */var a=/* unused pure expression or super */null&&i},94906:function(e,t,n){n.d(t,{h:()=>C});/* import */var r=n(41594);/* import */var i=n(14308);/* import */var a=n(30922);/* import */var o=n(36612);/* import */var s=n(76447);/* import */var l=n(47088);/* import */var u=n(52813);/* import */var d=n(143);/* import */var c=n(3591);/* import */var p=n(36004);/* import */var h=n(66220);/* import */var v=n(55223);/* import */var f=n(69811);/* import */var g=n(7332);/* import */var m=n(10782);/* import */var _=n(8755);/* import */var b=n(57391);/* import */var y=n(79209);/* import */var w=n(83237);/* import */var A=n(35055);/* import */var Y=n(13854);/* import */var k=n(79796);/* import */var I=n(14916);/* import */var q=n(45636);/**
 * Renders the DayPicker calendar component.
 *
 * @param initialProps - The props for the DayPicker component.
 * @returns The rendered DayPicker component.
 * @group DayPicker
 * @see https://daypicker.dev
 */function C(e){let t=e;const n=t.timeZone;if(n){t={...e,timeZone:n};if(t.today){t.today=(0,I/* .toTimeZone */.v)(t.today,n)}if(t.month){t.month=(0,I/* .toTimeZone */.v)(t.month,n)}if(t.defaultMonth){t.defaultMonth=(0,I/* .toTimeZone */.v)(t.defaultMonth,n)}if(t.startMonth){t.startMonth=(0,I/* .toTimeZone */.v)(t.startMonth,n)}if(t.endMonth){t.endMonth=(0,I/* .toTimeZone */.v)(t.endMonth,n)}if(t.mode==="single"&&t.selected){t.selected=(0,I/* .toTimeZone */.v)(t.selected,n)}else if(t.mode==="multiple"&&t.selected){t.selected=t.selected?.map(e=>(0,I/* .toTimeZone */.v)(e,n))}else if(t.mode==="range"&&t.selected){t.selected={from:t.selected.from?(0,I/* .toTimeZone */.v)(t.selected.from,n):t.selected.from,to:t.selected.to?(0,I/* .toTimeZone */.v)(t.selected.to,n):t.selected.to}}if(t.disabled!==undefined){t.disabled=(0,Y/* .convertMatchersToTimeZone */.t)(t.disabled,n)}if(t.hidden!==undefined){t.hidden=(0,Y/* .convertMatchersToTimeZone */.t)(t.hidden,n)}if(t.modifiers){const e={};Object.keys(t.modifiers).forEach(r=>{e[r]=(0,Y/* .convertMatchersToTimeZone */.t)(t.modifiers?.[r],n)});t.modifiers=e}}const{components:C,formatters:D,labels:E,dateLib:S,locale:z,classNames:T}=(0,r.useMemo)(()=>{const e={...i/* .enUS */.c,...t.locale};const n=new a/* .DateLib */.i0({locale:e,weekStartsOn:t.broadcastCalendar?1:t.weekStartsOn,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},t.dateLib);return{dateLib:n,components:(0,l/* .getComponents */.P)(t.components),formatters:(0,c/* .getFormatters */.G)(t.formatters),labels:{...g,...t.labels},locale:e,classNames:{...(0,d/* .getDefaultClassNames */.a)(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.components,t.formatters,t.labels,t.classNames]);if(!t.today){t={...t,today:S.today()}}const{captionLayout:M,mode:H,navLayout:P,numberOfMonths:O=1,onDayBlur:F,onDayClick:N,onDayFocus:K,onDayKeyDown:W,onDayMouseEnter:R,onDayMouseLeave:L,onNextClick:U,onPrevClick:B,showWeekNumber:j,styles:V}=t;const{formatCaption:Q,formatDay:G,formatMonthDropdown:$,formatWeekNumber:X,formatWeekNumberHeader:Z,formatWeekdayName:J,formatYearDropdown:ee}=D;const et=(0,b/* .useCalendar */._)(t,S);const{days:en,months:er,navStart:ei,navEnd:ea,previousMonth:eo,nextMonth:es,goToMonth:el}=et;const eu=(0,o/* .createGetModifiers */.x)(en,t,ei,ea,S);const{isSelected:ed,select:ec,selected:ep}=(0,A/* .useSelection */.C)(t,S)??{};const{blur:eh,focused:ev,isFocusTarget:ef,moveFocus:eg,setFocused:em}=(0,w/* .useFocus */.i)(t,et,eu,ed??(()=>false),S);const{labelDayButton:e_,labelGridcell:eb,labelGrid:ey,labelMonthDropdown:ew,labelNav:ex,labelPrevious:eA,labelNext:eY,labelWeekday:ek,labelWeekNumber:eI,labelWeekNumberHeader:eq,labelYearDropdown:eC}=E;const eD=(0,r.useMemo)(()=>(0,v/* .getWeekdays */.c)(S,t.ISOWeek,t.broadcastCalendar,t.today),[S,t.ISOWeek,t.broadcastCalendar,t.today]);const eE=H!==undefined||N!==undefined;const eS=(0,r.useCallback)(()=>{if(!eo)return;el(eo);B?.(eo)},[eo,el,B]);const ez=(0,r.useCallback)(()=>{if(!es)return;el(es);U?.(es)},[el,es,U]);const eT=(0,r.useCallback)((e,t)=>n=>{n.preventDefault();n.stopPropagation();em(e);if(t.disabled){return}ec?.(e.date,t,n);N?.(e.date,t,n)},[ec,N,em]);const eM=(0,r.useCallback)((e,t)=>n=>{em(e);K?.(e.date,t,n)},[K,em]);const eH=(0,r.useCallback)((e,t)=>n=>{eh();F?.(e.date,t,n)},[eh,F]);const eP=(0,r.useCallback)((e,n)=>r=>{const i={ArrowLeft:[r.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[r.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[r.shiftKey?"year":"week","after"],ArrowUp:[r.shiftKey?"year":"week","before"],PageUp:[r.shiftKey?"year":"month","before"],PageDown:[r.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(i[r.key]){r.preventDefault();r.stopPropagation();const[e,t]=i[r.key];eg(e,t)}W?.(e.date,n,r)},[eg,W,t.dir]);const eO=(0,r.useCallback)((e,t)=>n=>{R?.(e.date,t,n)},[R]);const eF=(0,r.useCallback)((e,t)=>n=>{L?.(e.date,t,n)},[L]);const eN=(0,r.useCallback)(e=>t=>{const n=Number(t.target.value);const r=S.setMonth(S.startOfMonth(e),n);el(r)},[S,el]);const eK=(0,r.useCallback)(e=>t=>{const n=Number(t.target.value);const r=S.setYear(S.startOfMonth(e),n);el(r)},[S,el]);const{className:eW,style:eR}=(0,r.useMemo)(()=>({className:[T[m.UI.Root],t.className].filter(Boolean).join(" "),style:{...V?.[m.UI.Root],...t.style}}),[T,t.className,t.style,V]);const eL=(0,u/* .getDataAttributes */.C)(t);const eU=(0,r.useRef)(null);(0,_/* .useAnimation */.s)(eU,Boolean(t.animate),{classNames:T,months:er,focused:ev,dateLib:S});const eB={dayPickerProps:t,selected:ep,select:ec,isSelected:ed,months:er,nextMonth:es,previousMonth:eo,goToMonth:el,getModifiers:eu,components:C,classNames:T,styles:V,labels:E,formatters:D};return r.createElement(y/* .dayPickerContext.Provider */.S.Provider,{value:eB},r.createElement(C.Root,{rootRef:t.animate?eU:undefined,className:eW,style:eR,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...eL},r.createElement(C.Months,{className:T[m.UI.Months],style:V?.[m.UI.Months]},!t.hideNavigation&&!P&&r.createElement(C.Nav,{"data-animated-nav":t.animate?"true":undefined,className:T[m.UI.Nav],style:V?.[m.UI.Nav],"aria-label":ex(),onPreviousClick:eS,onNextClick:ez,previousMonth:eo,nextMonth:es}),er.map((e,n)=>{return r.createElement(C.Month,{"data-animated-month":t.animate?"true":undefined,className:T[m.UI.Month],style:V?.[m.UI.Month],// biome-ignore lint/suspicious/noArrayIndexKey: breaks animation
key:n,displayIndex:n,calendarMonth:e},P==="around"&&!t.hideNavigation&&n===0&&r.createElement(C.PreviousMonthButton,{type:"button",className:T[m.UI.PreviousMonthButton],tabIndex:eo?undefined:-1,"aria-disabled":eo?undefined:true,"aria-label":eA(eo),onClick:eS,"data-animated-button":t.animate?"true":undefined},r.createElement(C.Chevron,{disabled:eo?undefined:true,className:T[m.UI.Chevron],orientation:t.dir==="rtl"?"right":"left"})),r.createElement(C.MonthCaption,{"data-animated-caption":t.animate?"true":undefined,className:T[m.UI.MonthCaption],style:V?.[m.UI.MonthCaption],calendarMonth:e,displayIndex:n},M?.startsWith("dropdown")?r.createElement(C.DropdownNav,{className:T[m.UI.Dropdowns],style:V?.[m.UI.Dropdowns]},(()=>{const n=M==="dropdown"||M==="dropdown-months"?r.createElement(C.MonthsDropdown,{key:"month",className:T[m.UI.MonthsDropdown],"aria-label":ew(),classNames:T,components:C,disabled:Boolean(t.disableNavigation),onChange:eN(e.date),options:(0,p/* .getMonthOptions */.L)(e.date,ei,ea,D,S),style:V?.[m.UI.Dropdown],value:S.getMonth(e.date)}):r.createElement("span",{key:"month"},$(e.date,S));const i=M==="dropdown"||M==="dropdown-years"?r.createElement(C.YearsDropdown,{key:"year",className:T[m.UI.YearsDropdown],"aria-label":eC(S.options),classNames:T,components:C,disabled:Boolean(t.disableNavigation),onChange:eK(e.date),options:(0,f/* .getYearOptions */.g)(ei,ea,D,S,Boolean(t.reverseYears)),style:V?.[m.UI.Dropdown],value:S.getYear(e.date)}):r.createElement("span",{key:"year"},ee(e.date,S));const a=S.getMonthYearOrder()==="year-first"?[i,n]:[n,i];return a})(),r.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},Q(e.date,S.options,S))):r.createElement(C.CaptionLabel,{className:T[m.UI.CaptionLabel],role:"status","aria-live":"polite"},Q(e.date,S.options,S))),P==="around"&&!t.hideNavigation&&n===O-1&&r.createElement(C.NextMonthButton,{type:"button",className:T[m.UI.NextMonthButton],tabIndex:es?undefined:-1,"aria-disabled":es?undefined:true,"aria-label":eY(es),onClick:ez,"data-animated-button":t.animate?"true":undefined},r.createElement(C.Chevron,{disabled:es?undefined:true,className:T[m.UI.Chevron],orientation:t.dir==="rtl"?"left":"right"})),n===O-1&&P==="after"&&!t.hideNavigation&&r.createElement(C.Nav,{"data-animated-nav":t.animate?"true":undefined,className:T[m.UI.Nav],style:V?.[m.UI.Nav],"aria-label":ex(),onPreviousClick:eS,onNextClick:ez,previousMonth:eo,nextMonth:es}),r.createElement(C.MonthGrid,{role:"grid","aria-multiselectable":H==="multiple"||H==="range","aria-label":ey(e.date,S.options,S)||undefined,className:T[m.UI.MonthGrid],style:V?.[m.UI.MonthGrid]},!t.hideWeekdays&&r.createElement(C.Weekdays,{"data-animated-weekdays":t.animate?"true":undefined,className:T[m.UI.Weekdays],style:V?.[m.UI.Weekdays]},j&&r.createElement(C.WeekNumberHeader,{"aria-label":eq(S.options),className:T[m.UI.WeekNumberHeader],style:V?.[m.UI.WeekNumberHeader],scope:"col"},Z()),eD.map(e=>r.createElement(C.Weekday,{"aria-label":ek(e,S.options,S),className:T[m.UI.Weekday],key:String(e),style:V?.[m.UI.Weekday],scope:"col"},J(e,S.options,S)))),r.createElement(C.Weeks,{"data-animated-weeks":t.animate?"true":undefined,className:T[m.UI.Weeks],style:V?.[m.UI.Weeks]},e.weeks.map(e=>{return r.createElement(C.Week,{className:T[m.UI.Week],key:e.weekNumber,style:V?.[m.UI.Week],week:e},j&&r.createElement(C.WeekNumber,{week:e,style:V?.[m.UI.WeekNumber],"aria-label":eI(e.weekNumber,{locale:z}),className:T[m.UI.WeekNumber],scope:"row",role:"rowheader"},X(e.weekNumber,S)),e.days.map(e=>{const{date:n}=e;const i=eu(e);i[m/* .DayFlag.focused */.pL.focused]=!i.hidden&&Boolean(ev?.isEqualTo(e));i[m/* .SelectionState.selected */.wc.selected]=ed?.(n)||i.selected;if((0,q/* .isDateRange */.oM)(ep)){// add range modifiers
const{from:e,to:t}=ep;i[m/* .SelectionState.range_start */.wc.range_start]=Boolean(e&&t&&S.isSameDay(n,e));i[m/* .SelectionState.range_end */.wc.range_end]=Boolean(e&&t&&S.isSameDay(n,t));i[m/* .SelectionState.range_middle */.wc.range_middle]=(0,k/* .rangeIncludesDate */.R)(ep,n,true,S)}const a=(0,h/* .getStyleForModifiers */.J)(i,V,t.modifiersStyles);const o=(0,s/* .getClassNamesForModifiers */.k)(i,T,t.modifiersClassNames);const l=!eE&&!i.hidden?eb(n,i,S.options,S):undefined;return r.createElement(C.Day,{key:`${e.isoDate}_${e.displayMonthId}`,day:e,modifiers:i,className:o.join(" "),style:a,role:"gridcell","aria-selected":i.selected||undefined,"aria-label":l,"data-day":e.isoDate,"data-month":e.outside?e.dateMonthId:undefined,"data-selected":i.selected||undefined,"data-disabled":i.disabled||undefined,"data-hidden":i.hidden||undefined,"data-outside":e.outside||undefined,"data-focused":i.focused||undefined,"data-today":i.today||undefined},!i.hidden&&eE?r.createElement(C.DayButton,{className:T[m.UI.DayButton],style:V?.[m.UI.DayButton],type:"button",day:e,modifiers:i,disabled:!i.focused&&i.disabled||undefined,"aria-disabled":i.focused&&i.disabled||undefined,tabIndex:ef(e)?0:-1,"aria-label":e_(n,i,S.options,S),onClick:eT(e,i),onBlur:eH(e,i),onFocus:eM(e,i),onKeyDown:eP(e,i),onMouseEnter:eO(e,i),onMouseLeave:eF(e,i)},G(n,S.options,S)):!i.hidden&&G(e.date,S.options,S))}))}))))})),t.footer&&r.createElement(C.Footer,{className:T[m.UI.Footer],style:V?.[m.UI.Footer],role:"status","aria-live":"polite"},t.footer)))}},10782:function(e,t,n){n.d(t,{UI:()=>r,X5:()=>o,pL:()=>i,wc:()=>a});/**
 * Enum representing the UI elements composing DayPicker. These elements are
 * mapped to {@link CustomComponents}, {@link ClassNames}, and {@link Styles}.
 *
 * Some elements are extended by flags and modifiers.
 */var r;(function(e){/** The root component displaying the months and the navigation bar. */e["Root"]="root";/** The Chevron SVG element used by navigation buttons and dropdowns. */e["Chevron"]="chevron";/**
     * The grid cell with the day's date. Extended by {@link DayFlag} and
     * {@link SelectionState}.
     */e["Day"]="day";/** The button containing the formatted day's date, inside the grid cell. */e["DayButton"]="day_button";/** The caption label of the month (when not showing the dropdown navigation). */e["CaptionLabel"]="caption_label";/** The container of the dropdown navigation (when enabled). */e["Dropdowns"]="dropdowns";/** The dropdown element to select for years and months. */e["Dropdown"]="dropdown";/** The container element of the dropdown. */e["DropdownRoot"]="dropdown_root";/** The root element of the footer. */e["Footer"]="footer";/** The month grid. */e["MonthGrid"]="month_grid";/** Contains the dropdown navigation or the caption label. */e["MonthCaption"]="month_caption";/** The dropdown with the months. */e["MonthsDropdown"]="months_dropdown";/** Wrapper of the month grid. */e["Month"]="month";/** The container of the displayed months. */e["Months"]="months";/** The navigation bar with the previous and next buttons. */e["Nav"]="nav";/**
     * The next month button in the navigation. *
     *
     * @since 9.1.0
     */e["NextMonthButton"]="button_next";/**
     * The previous month button in the navigation.
     *
     * @since 9.1.0
     */e["PreviousMonthButton"]="button_previous";/** The row containing the week. */e["Week"]="week";/** The group of row weeks in a month (`tbody`). */e["Weeks"]="weeks";/** The column header with the weekday. */e["Weekday"]="weekday";/** The row grouping the weekdays in the column headers. */e["Weekdays"]="weekdays";/** The cell containing the week number. */e["WeekNumber"]="week_number";/** The cell header of the week numbers column. */e["WeekNumberHeader"]="week_number_header";/** The dropdown with the years. */e["YearsDropdown"]="years_dropdown"})(r||(r={}));/** Enum representing flags for the {@link UI.Day} element. */var i;(function(e){/** The day is disabled. */e["disabled"]="disabled";/** The day is hidden. */e["hidden"]="hidden";/** The day is outside the current month. */e["outside"]="outside";/** The day is focused. */e["focused"]="focused";/** The day is today. */e["today"]="today"})(i||(i={}));/**
 * Enum representing selection states that can be applied to the {@link UI.Day}
 * element in selection mode.
 */var a;(function(e){/** The day is at the end of a selected range. */e["range_end"]="range_end";/** The day is at the middle of a selected range. */e["range_middle"]="range_middle";/** The day is at the start of a selected range. */e["range_start"]="range_start";/** The day is selected. */e["selected"]="selected"})(a||(a={}));/**
 * Enum representing different animation states for transitioning between
 * months.
 */var o;(function(e){/** The entering weeks when they appear before the exiting month. */e["weeks_before_enter"]="weeks_before_enter";/** The exiting weeks when they disappear before the entering month. */e["weeks_before_exit"]="weeks_before_exit";/** The entering weeks when they appear after the exiting month. */e["weeks_after_enter"]="weeks_after_enter";/** The exiting weeks when they disappear after the entering month. */e["weeks_after_exit"]="weeks_after_exit";/** The entering caption when it appears after the exiting month. */e["caption_after_enter"]="caption_after_enter";/** The exiting caption when it disappears after the entering month. */e["caption_after_exit"]="caption_after_exit";/** The entering caption when it appears before the exiting month. */e["caption_before_enter"]="caption_before_enter";/** The exiting caption when it disappears before the entering month. */e["caption_before_exit"]="caption_before_exit"})(o||(o={}))},69133:function(e,t,n){n.d(t,{P:()=>i});/* import */var r=n(30922);/**
 * Represents a day displayed in the calendar.
 *
 * In DayPicker, a `CalendarDay` is a wrapper around a `Date` object that
 * provides additional information about the day, such as whether it belongs to
 * the displayed month.
 */class i{constructor(e,t,n=r/* .defaultDateLib */.VA){this.date=e;this.displayMonth=t;this.outside=Boolean(t&&!n.isSameMonth(e,t));this.dateLib=n;this.isoDate=n.format(e,"yyyy-MM-dd");this.displayMonthId=n.format(t,"yyyy-MM");this.dateMonthId=n.format(e,"yyyy-MM")}/**
     * Checks if this day is equal to another `CalendarDay`, considering both the
     * date and the displayed month.
     *
     * @param day The `CalendarDay` to compare with.
     * @returns `true` if the days are equal, otherwise `false`.
     */isEqualTo(e){return this.dateLib.isSameDay(e.date,this.date)&&this.dateLib.isSameMonth(e.displayMonth,this.displayMonth)}}},76465:function(e,t,n){n.d(t,{j:()=>r});/**
 * Represents a month in a calendar year.
 *
 * A `CalendarMonth` contains the weeks within the month and the date of the
 * month.
 */class r{constructor(e,t){this.date=e;this.weeks=t}}},24971:function(e,t,n){n.d(t,{j:()=>r});/**
 * Represents a week in a calendar month.
 *
 * A `CalendarWeek` contains the days within the week and the week number.
 */class r{constructor(e,t){this.days=t;this.weekNumber=e}}},30922:function(e,t,n){n.d(t,{VA:()=>W,i0:()=>K});/* import */var r=n(2832);/* import */var i=n(56187);/* import */var a=n(59099);/* import */var o=n(46199);/* import */var s=n(19636);/* import */var l=n(42878);/* import */var u=n(9970);/* import */var d=n(56190);/* import */var c=n(78307);/* import */var p=n(48606);/* import */var h=n(17193);/* import */var v=n(547);/* import */var f=n(66146);/* import */var g=n(1896);/* import */var m=n(72642);/* import */var _=n(1261);/* import */var b=n(14646);/* import */var y=n(62311);/* import */var w=n(74085);/* import */var A=n(61736);/* import */var Y=n(20443);/* import */var k=n(13851);/* import */var I=n(6903);/* import */var q=n(39896);/* import */var C=n(8153);/* import */var D=n(98843);/* import */var E=n(47593);/* import */var S=n(58050);/* import */var z=n(5758);/* import */var T=n(16925);/* import */var M=n(910);/* import */var H=n(36662);/* import */var P=n(48011);/* import */var O=n(14308);/* import */var F=n(26969);/* import */var N=n(83566);/**
 * A wrapper class around [date-fns](http://date-fns.org) that provides utility
 * methods for date manipulation and formatting.
 *
 * @since 9.2.0
 * @example
 *   const dateLib = new DateLib({ locale: es });
 *   const newDate = dateLib.addDays(new Date(), 5);
 */class K{/**
     * Creates an instance of `DateLib`.
     *
     * @param options Configuration options for the date library.
     * @param overrides Custom overrides for the date library functions.
     */constructor(e,t){/**
         * Reference to the built-in Date constructor.
         *
         * @deprecated Use `newDate()` or `today()`.
         */this.Date=Date;/**
         * Creates a new `Date` object representing today's date.
         *
         * @since 9.5.0
         * @returns A `Date` object for today's date.
         */this.today=()=>{if(this.overrides?.today){return this.overrides.today()}if(this.options.timeZone){return r/* .TZDate.tz */.BB.tz(this.options.timeZone)}return new this.Date};/**
         * Creates a new `Date` object with the specified year, month, and day.
         *
         * @since 9.5.0
         * @param year The year.
         * @param monthIndex The month (0-11).
         * @param date The day of the month.
         * @returns A new `Date` object.
         */this.newDate=(e,t,n)=>{if(this.overrides?.newDate){return this.overrides.newDate(e,t,n)}if(this.options.timeZone){return new r/* .TZDate */.BB(e,t,n,this.options.timeZone)}return new Date(e,t,n)};/**
         * Adds the specified number of days to the given date.
         *
         * @param date The date to add days to.
         * @param amount The number of days to add.
         * @returns The new date with the days added.
         */this.addDays=(e,t)=>{return this.overrides?.addDays?this.overrides.addDays(e,t):(0,i/* .addDays */.f)(e,t)};/**
         * Adds the specified number of months to the given date.
         *
         * @param date The date to add months to.
         * @param amount The number of months to add.
         * @returns The new date with the months added.
         */this.addMonths=(e,t)=>{return this.overrides?.addMonths?this.overrides.addMonths(e,t):(0,a/* .addMonths */.P)(e,t)};/**
         * Adds the specified number of weeks to the given date.
         *
         * @param date The date to add weeks to.
         * @param amount The number of weeks to add.
         * @returns The new date with the weeks added.
         */this.addWeeks=(e,t)=>{return this.overrides?.addWeeks?this.overrides.addWeeks(e,t):(0,o/* .addWeeks */.J)(e,t)};/**
         * Adds the specified number of years to the given date.
         *
         * @param date The date to add years to.
         * @param amount The number of years to add.
         * @returns The new date with the years added.
         */this.addYears=(e,t)=>{return this.overrides?.addYears?this.overrides.addYears(e,t):(0,s/* .addYears */.e)(e,t)};/**
         * Returns the number of calendar days between the given dates.
         *
         * @param dateLeft The later date.
         * @param dateRight The earlier date.
         * @returns The number of calendar days between the dates.
         */this.differenceInCalendarDays=(e,t)=>{return this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(e,t):(0,l/* .differenceInCalendarDays */.m)(e,t)};/**
         * Returns the number of calendar months between the given dates.
         *
         * @param dateLeft The later date.
         * @param dateRight The earlier date.
         * @returns The number of calendar months between the dates.
         */this.differenceInCalendarMonths=(e,t)=>{return this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(e,t):(0,u/* .differenceInCalendarMonths */.U)(e,t)};/**
         * Returns the months between the given dates.
         *
         * @param interval The interval to get the months for.
         */this.eachMonthOfInterval=e=>{return this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(e):(0,d/* .eachMonthOfInterval */.i)(e)};/**
         * Returns the years between the given dates.
         *
         * @since 9.11.1
         * @param interval The interval to get the years for.
         * @returns The array of years in the interval.
         */this.eachYearOfInterval=e=>{const t=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(e):(0,c/* .eachYearOfInterval */.z)(e);// Remove duplicates that may happen across DST transitions (e.g., "America/Sao_Paulo")
// See https://github.com/date-fns/tz/issues/72
const n=new Set(t.map(e=>this.getYear(e)));if(n.size===t.length){// No duplicates, return as is
return t}// Rebuild the array to ensure one date per year
const r=[];n.forEach(e=>{r.push(new Date(e,0,1))});return r};/**
         * Returns the end of the broadcast week for the given date.
         *
         * @param date The original date.
         * @returns The end of the broadcast week.
         */this.endOfBroadcastWeek=e=>{return this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(e):(0,F/* .endOfBroadcastWeek */.O)(e,this)};/**
         * Returns the end of the ISO week for the given date.
         *
         * @param date The original date.
         * @returns The end of the ISO week.
         */this.endOfISOWeek=e=>{return this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(e):(0,p/* .endOfISOWeek */.g)(e)};/**
         * Returns the end of the month for the given date.
         *
         * @param date The original date.
         * @returns The end of the month.
         */this.endOfMonth=e=>{return this.overrides?.endOfMonth?this.overrides.endOfMonth(e):(0,h/* .endOfMonth */.p)(e)};/**
         * Returns the end of the week for the given date.
         *
         * @param date The original date.
         * @returns The end of the week.
         */this.endOfWeek=(e,t)=>{return this.overrides?.endOfWeek?this.overrides.endOfWeek(e,t):(0,v/* .endOfWeek */.$)(e,this.options)};/**
         * Returns the end of the year for the given date.
         *
         * @param date The original date.
         * @returns The end of the year.
         */this.endOfYear=e=>{return this.overrides?.endOfYear?this.overrides.endOfYear(e):(0,f/* .endOfYear */.Q)(e)};/**
         * Formats the given date using the specified format string.
         *
         * @param date The date to format.
         * @param formatStr The format string.
         * @returns The formatted date string.
         */this.format=(e,t,n)=>{const r=this.overrides?.format?this.overrides.format(e,t,this.options):(0,g/* .format */.GP)(e,t,this.options);if(this.options.numerals&&this.options.numerals!=="latn"){return this.replaceDigits(r)}return r};/**
         * Returns the ISO week number for the given date.
         *
         * @param date The date to get the ISO week number for.
         * @returns The ISO week number.
         */this.getISOWeek=e=>{return this.overrides?.getISOWeek?this.overrides.getISOWeek(e):(0,m/* .getISOWeek */.s)(e)};/**
         * Returns the month of the given date.
         *
         * @param date The date to get the month for.
         * @returns The month.
         */this.getMonth=(e,t)=>{return this.overrides?.getMonth?this.overrides.getMonth(e,this.options):(0,_/* .getMonth */.t)(e,this.options)};/**
         * Returns the year of the given date.
         *
         * @param date The date to get the year for.
         * @returns The year.
         */this.getYear=(e,t)=>{return this.overrides?.getYear?this.overrides.getYear(e,this.options):(0,b/* .getYear */.C)(e,this.options)};/**
         * Returns the local week number for the given date.
         *
         * @param date The date to get the week number for.
         * @returns The week number.
         */this.getWeek=(e,t)=>{return this.overrides?.getWeek?this.overrides.getWeek(e,this.options):(0,y/* .getWeek */.N)(e,this.options)};/**
         * Checks if the first date is after the second date.
         *
         * @param date The date to compare.
         * @param dateToCompare The date to compare with.
         * @returns True if the first date is after the second date.
         */this.isAfter=(e,t)=>{return this.overrides?.isAfter?this.overrides.isAfter(e,t):(0,w/* .isAfter */.d)(e,t)};/**
         * Checks if the first date is before the second date.
         *
         * @param date The date to compare.
         * @param dateToCompare The date to compare with.
         * @returns True if the first date is before the second date.
         */this.isBefore=(e,t)=>{return this.overrides?.isBefore?this.overrides.isBefore(e,t):(0,A/* .isBefore */.Y)(e,t)};/**
         * Checks if the given value is a Date object.
         *
         * @param value The value to check.
         * @returns True if the value is a Date object.
         */this.isDate=e=>{return this.overrides?.isDate?this.overrides.isDate(e):(0,Y/* .isDate */.$)(e)};/**
         * Checks if the given dates are on the same day.
         *
         * @param dateLeft The first date to compare.
         * @param dateRight The second date to compare.
         * @returns True if the dates are on the same day.
         */this.isSameDay=(e,t)=>{return this.overrides?.isSameDay?this.overrides.isSameDay(e,t):(0,k/* .isSameDay */.r)(e,t)};/**
         * Checks if the given dates are in the same month.
         *
         * @param dateLeft The first date to compare.
         * @param dateRight The second date to compare.
         * @returns True if the dates are in the same month.
         */this.isSameMonth=(e,t)=>{return this.overrides?.isSameMonth?this.overrides.isSameMonth(e,t):(0,I/* .isSameMonth */.t)(e,t)};/**
         * Checks if the given dates are in the same year.
         *
         * @param dateLeft The first date to compare.
         * @param dateRight The second date to compare.
         * @returns True if the dates are in the same year.
         */this.isSameYear=(e,t)=>{return this.overrides?.isSameYear?this.overrides.isSameYear(e,t):(0,q/* .isSameYear */.s)(e,t)};/**
         * Returns the latest date in the given array of dates.
         *
         * @param dates The array of dates to compare.
         * @returns The latest date.
         */this.max=e=>{return this.overrides?.max?this.overrides.max(e):(0,C/* .max */.T)(e)};/**
         * Returns the earliest date in the given array of dates.
         *
         * @param dates The array of dates to compare.
         * @returns The earliest date.
         */this.min=e=>{return this.overrides?.min?this.overrides.min(e):(0,D/* .min */.j)(e)};/**
         * Sets the month of the given date.
         *
         * @param date The date to set the month on.
         * @param month The month to set (0-11).
         * @returns The new date with the month set.
         */this.setMonth=(e,t)=>{return this.overrides?.setMonth?this.overrides.setMonth(e,t):(0,E/* .setMonth */.Z)(e,t)};/**
         * Sets the year of the given date.
         *
         * @param date The date to set the year on.
         * @param year The year to set.
         * @returns The new date with the year set.
         */this.setYear=(e,t)=>{return this.overrides?.setYear?this.overrides.setYear(e,t):(0,S/* .setYear */.i)(e,t)};/**
         * Returns the start of the broadcast week for the given date.
         *
         * @param date The original date.
         * @returns The start of the broadcast week.
         */this.startOfBroadcastWeek=(e,t)=>{return this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(e,this):(0,N/* .startOfBroadcastWeek */.l)(e,this)};/**
         * Returns the start of the day for the given date.
         *
         * @param date The original date.
         * @returns The start of the day.
         */this.startOfDay=e=>{return this.overrides?.startOfDay?this.overrides.startOfDay(e):(0,z/* .startOfDay */.o)(e)};/**
         * Returns the start of the ISO week for the given date.
         *
         * @param date The original date.
         * @returns The start of the ISO week.
         */this.startOfISOWeek=e=>{return this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(e):(0,T/* .startOfISOWeek */.b)(e)};/**
         * Returns the start of the month for the given date.
         *
         * @param date The original date.
         * @returns The start of the month.
         */this.startOfMonth=e=>{return this.overrides?.startOfMonth?this.overrides.startOfMonth(e):(0,M/* .startOfMonth */.w)(e)};/**
         * Returns the start of the week for the given date.
         *
         * @param date The original date.
         * @returns The start of the week.
         */this.startOfWeek=(e,t)=>{return this.overrides?.startOfWeek?this.overrides.startOfWeek(e,this.options):(0,H/* .startOfWeek */.k)(e,this.options)};/**
         * Returns the start of the year for the given date.
         *
         * @param date The original date.
         * @returns The start of the year.
         */this.startOfYear=e=>{return this.overrides?.startOfYear?this.overrides.startOfYear(e):(0,P/* .startOfYear */.D)(e)};this.options={locale:O/* .enUS */.c,...e};this.overrides=t}/**
     * Generates a mapping of Arabic digits (0-9) to the target numbering system
     * digits.
     *
     * @since 9.5.0
     * @returns A record mapping Arabic digits to the target numerals.
     */getDigitMap(){const{numerals:e="latn"}=this.options;// Use Intl.NumberFormat to create a formatter with the specified numbering system
const t=new Intl.NumberFormat("en-US",{numberingSystem:e});// Map Arabic digits (0-9) to the target numerals
const n={};for(let e=0;e<10;e++){n[e.toString()]=t.format(e)}return n}/**
     * Replaces Arabic digits in a string with the target numbering system digits.
     *
     * @since 9.5.0
     * @param input The string containing Arabic digits.
     * @returns The string with digits replaced.
     */replaceDigits(e){const t=this.getDigitMap();return e.replace(/\d/g,e=>t[e]||e)}/**
     * Formats a number using the configured numbering system.
     *
     * @since 9.5.0
     * @param value The number to format.
     * @returns The formatted number as a string.
     */formatNumber(e){return this.replaceDigits(e.toString())}/**
     * Returns the preferred ordering for month and year labels for the current
     * locale.
     */getMonthYearOrder(){const e=this.options.locale?.code;if(!e){return"month-first"}return K.yearFirstLocales.has(e)?"year-first":"month-first"}/**
     * Formats the month/year pair respecting locale conventions.
     *
     * @since 9.11.0
     */formatMonthYear(e){const{locale:t,timeZone:n,numerals:r}=this.options;const i=t?.code;if(i&&K.yearFirstLocales.has(i)){try{const t=new Intl.DateTimeFormat(i,{month:"long",year:"numeric",timeZone:n,numberingSystem:r});const a=t.format(e);return a}catch{// Fallback to date-fns formatting below.
}}const a=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(e,a)}}K.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);/** The default locale (English). *//**
 * The default date library with English locale.
 *
 * @since 9.2.0
 */const W=new K;/**
 * @ignore
 * @deprecated Use `defaultDateLib`.
 */const R=/* unused pure expression or super */null&&W},3191:function(e,t,n){n.d(t,{$:()=>i});/* import */var r=n(41594);/**
 * Render the button elements in the calendar.
 *
 * @private
 * @deprecated Use `PreviousMonthButton` or `@link NextMonthButton` instead.
 */function i(e){return r.createElement("button",{...e})}},66403:function(e,t,n){n.d(t,{$:()=>i});/* import */var r=n(41594);/**
 * Render the label in the month caption.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){return r.createElement("span",{...e})}},49412:function(e,t,n){n.d(t,{c:()=>i});/* import */var r=n(41594);/**
 * Render the chevron icon used in the navigation buttons and dropdowns.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){const{size:t=24,orientation:n="left",className:i}=e;return(// biome-ignore lint/a11y/noSvgWithoutTitle: handled by the parent component
r.createElement("svg",{className:i,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&r.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&r.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&r.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&r.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"})))}},92521:function(e,t,n){n.d(t,{L:()=>i});/* import */var r=n(41594);/**
 * Render a grid cell for a specific day in the calendar.
 *
 * Handles interaction and focus for the day. If you only need to change the
 * content of the day cell, consider swapping the `DayButton` component
 * instead.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){const{day:t,modifiers:n,...i}=e;return r.createElement("td",{...i})}},64561:function(e,t,n){n.d(t,{x:()=>i});/* import */var r=n(41594);/**
 * Render a button for a specific day in the calendar.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){const{day:t,modifiers:n,...i}=e;const a=r.useRef(null);r.useEffect(()=>{if(n.focused)a.current?.focus()},[n.focused]);return r.createElement("button",{ref:a,...i})}},62266:function(e,t,n){n.d(t,{m:()=>a});/* import */var r=n(41594);/* import */var i=n(10782);/**
 * Render a dropdown component for navigation in the calendar.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function a(e){const{options:t,className:n,components:a,classNames:o,...s}=e;const l=[o[i.UI.Dropdown],n].join(" ");const u=t?.find(({value:e})=>e===s.value);return r.createElement("span",{"data-disabled":s.disabled,className:o[i.UI.DropdownRoot]},r.createElement(a.Select,{className:l,...s},t?.map(({value:e,label:t,disabled:n})=>r.createElement(a.Option,{key:e,value:e,disabled:n},t))),r.createElement("span",{className:o[i.UI.CaptionLabel],"aria-hidden":true},u?.label,r.createElement(a.Chevron,{orientation:"down",size:18,className:o[i.UI.Chevron]})))}},70089:function(e,t,n){n.d(t,{z:()=>i});/* import */var r=n(41594);/**
 * Render the navigation dropdowns for the calendar.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){return r.createElement("div",{...e})}},7012:function(e,t,n){n.d(t,{w:()=>i});/* import */var r=n(41594);/**
 * Render the footer of the calendar.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){return r.createElement("div",{...e})}},92469:function(e,t,n){n.d(t,{f:()=>i});/* import */var r=n(41594);/**
 * Render the grid with the weekday header row and the weeks for a specific
 * month.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){const{calendarMonth:t,displayIndex:n,...i}=e;return r.createElement("div",{...i},e.children)}},68819:function(e,t,n){n.d(t,{P:()=>i});/* import */var r=n(41594);/**
 * Render the caption for a month in the calendar.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){const{calendarMonth:t,displayIndex:n,...i}=e;return r.createElement("div",{...i})}},55037:function(e,t,n){n.d(t,{D:()=>i});/* import */var r=n(41594);/**
 * Render the grid of days for a specific month.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){return r.createElement("table",{...e})}},43584:function(e,t,n){n.d(t,{i:()=>i});/* import */var r=n(41594);/**
 * Render a container wrapping the month grids.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){return r.createElement("div",{...e})}},95597:function(e,t,n){n.d(t,{l:()=>a});/* import */var r=n(41594);/* import */var i=n(79209);/**
 * Render a dropdown to navigate between months in the calendar.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function a(e){const{components:t}=(0,i/* .useDayPicker */.w)();return r.createElement(t.Dropdown,{...e})}},53026:function(e,t,n){n.d(t,{s:()=>o});/* import */var r=n(41594);/* import */var i=n(10782);/* import */var a=n(79209);/**
 * Render the navigation toolbar with buttons to navigate between months.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function o(e){const{onPreviousClick:t,onNextClick:n,previousMonth:o,nextMonth:s,...l}=e;const{components:u,classNames:d,labels:{labelPrevious:c,labelNext:p}}=(0,a/* .useDayPicker */.w)();const h=(0,r.useCallback)(e=>{if(s){n?.(e)}},[s,n]);const v=(0,r.useCallback)(e=>{if(o){t?.(e)}},[o,t]);return r.createElement("nav",{...l},r.createElement(u.PreviousMonthButton,{type:"button",className:d[i.UI.PreviousMonthButton],tabIndex:o?undefined:-1,"aria-disabled":o?undefined:true,"aria-label":c(o),onClick:v},r.createElement(u.Chevron,{disabled:o?undefined:true,className:d[i.UI.Chevron],orientation:"left"})),r.createElement(u.NextMonthButton,{type:"button",className:d[i.UI.NextMonthButton],tabIndex:s?undefined:-1,"aria-disabled":s?undefined:true,"aria-label":p(s),onClick:h},r.createElement(u.Chevron,{disabled:s?undefined:true,orientation:"right",className:d[i.UI.Chevron]})))}},36170:function(e,t,n){n.d(t,{i:()=>a});/* import */var r=n(41594);/* import */var i=n(79209);/**
 * Render the button to navigate to the next month in the calendar.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function a(e){const{components:t}=(0,i/* .useDayPicker */.w)();return r.createElement(t.Button,{...e})}},92142:function(e,t,n){n.d(t,{c:()=>i});/* import */var r=n(41594);/**
 * Render an `option` element.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){return r.createElement("option",{...e})}},83673:function(e,t,n){n.d(t,{u:()=>a});/* import */var r=n(41594);/* import */var i=n(79209);/**
 * Render the button to navigate to the previous month in the calendar.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function a(e){const{components:t}=(0,i/* .useDayPicker */.w)();return r.createElement(t.Button,{...e})}},96291:function(e,t,n){n.d(t,{b:()=>i});/* import */var r=n(41594);/**
 * Render the root element of the calendar.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){const{rootRef:t,...n}=e;return r.createElement("div",{...n,ref:t})}},53267:function(e,t,n){n.d(t,{l:()=>i});/* import */var r=n(41594);/**
 * Render a `select` element.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){return r.createElement("select",{...e})}},36207:function(e,t,n){n.d(t,{j:()=>i});/* import */var r=n(41594);/**
 * Render a table row representing a week in the calendar.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){const{week:t,...n}=e;return r.createElement("tr",{...n})}},66234:function(e,t,n){n.d(t,{u:()=>i});/* import */var r=n(41594);/**
 * Render a table cell displaying the number of the week.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){const{week:t,...n}=e;return r.createElement("th",{...n})}},1139:function(e,t,n){n.d(t,{t:()=>i});/* import */var r=n(41594);/**
 * Render the header cell for the week numbers column.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){return r.createElement("th",{...e})}},5133:function(e,t,n){n.d(t,{B:()=>i});/* import */var r=n(41594);/**
 * Render a table header cell with the name of a weekday (e.g., "Mo", "Tu").
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){return r.createElement("th",{...e})}},17096:function(e,t,n){n.d(t,{S:()=>i});/* import */var r=n(41594);/**
 * Render the table row containing the weekday names.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){return r.createElement("thead",{"aria-hidden":true},r.createElement("tr",{...e}))}},12266:function(e,t,n){n.d(t,{m:()=>i});/* import */var r=n(41594);/**
 * Render the container for the weeks in the month grid.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function i(e){return r.createElement("tbody",{...e})}},95528:function(e,t,n){n.d(t,{w:()=>a});/* import */var r=n(41594);/* import */var i=n(79209);/**
 * Render a dropdown to navigate between years in the calendar.
 *
 * @group Components
 * @see https://daypicker.dev/guides/custom-components
 */function a(e){const{components:t}=(0,i/* .useDayPicker */.w)();return r.createElement(t.Dropdown,{...e})}},63869:function(e,t,n){n.r(t);n.d(t,{Button:()=>/* reexport safe */r.$,CaptionLabel:()=>/* reexport safe */i.$,Chevron:()=>/* reexport safe */a.c,Day:()=>/* reexport safe */o.L,DayButton:()=>/* reexport safe */s.x,Dropdown:()=>/* reexport safe */l.m,DropdownNav:()=>/* reexport safe */u.z,Footer:()=>/* reexport safe */d.w,Month:()=>/* reexport safe */c.f,MonthCaption:()=>/* reexport safe */p.P,MonthGrid:()=>/* reexport safe */h.D,Months:()=>/* reexport safe */v.i,MonthsDropdown:()=>/* reexport safe */f.l,Nav:()=>/* reexport safe */g.s,NextMonthButton:()=>/* reexport safe */m.i,Option:()=>/* reexport safe */_.c,PreviousMonthButton:()=>/* reexport safe */b.u,Root:()=>/* reexport safe */y.b,Select:()=>/* reexport safe */w.l,Week:()=>/* reexport safe */A.j,WeekNumber:()=>/* reexport safe */I.u,WeekNumberHeader:()=>/* reexport safe */q.t,Weekday:()=>/* reexport safe */Y.B,Weekdays:()=>/* reexport safe */k.S,Weeks:()=>/* reexport safe */C.m,YearsDropdown:()=>/* reexport safe */D.w});/* import */var r=n(3191);/* import */var i=n(66403);/* import */var a=n(49412);/* import */var o=n(92521);/* import */var s=n(64561);/* import */var l=n(62266);/* import */var u=n(70089);/* import */var d=n(7012);/* import */var c=n(92469);/* import */var p=n(68819);/* import */var h=n(55037);/* import */var v=n(43584);/* import */var f=n(95597);/* import */var g=n(53026);/* import */var m=n(36170);/* import */var _=n(92142);/* import */var b=n(83673);/* import */var y=n(96291);/* import */var w=n(53267);/* import */var A=n(36207);/* import */var Y=n(5133);/* import */var k=n(17096);/* import */var I=n(66234);/* import */var q=n(1139);/* import */var C=n(12266);/* import */var D=n(95528)},50075:function(e,t,n){n.d(t,{G:()=>a,w:()=>i});/* import */var r=n(30922);/**
 * Formats the caption of the month.
 *
 * @defaultValue Locale-specific month/year order (e.g., "November 2022").
 * @param month The date representing the month.
 * @param options Configuration options for the date library.
 * @param dateLib The date library to use for formatting. If not provided, a new
 *   instance is created.
 * @returns The formatted caption as a string.
 * @group Formatters
 * @see https://daypicker.dev/docs/translation#custom-formatters
 */function i(e,t,n){const i=n??new r/* .DateLib */.i0(t);return i.formatMonthYear(e)}/**
 * @private
 * @deprecated Use {@link formatCaption} instead.
 * @group Formatters
 */const a=i},15143:function(e,t,n){n.d(t,{i:()=>i});/* import */var r=n(30922);/**
 * Formats the day date shown in the day cell.
 *
 * @defaultValue `d` (e.g., "1").
 * @param date The date to format.
 * @param options Configuration options for the date library.
 * @param dateLib The date library to use for formatting. If not provided, a new
 *   instance is created.
 * @returns The formatted day as a string.
 * @group Formatters
 * @see https://daypicker.dev/docs/translation#custom-formatters
 */function i(e,t,n){return(n??new r/* .DateLib */.i0(t)).format(e,"d")}},90970:function(e,t,n){n.d(t,{Z:()=>i});/* import */var r=n(30922);/**
 * Formats the month for the dropdown option label.
 *
 * @defaultValue The localized full month name.
 * @param month The date representing the month.
 * @param dateLib The date library to use for formatting. Defaults to
 *   `defaultDateLib`.
 * @returns The formatted month name as a string.
 * @group Formatters
 * @see https://daypicker.dev/docs/translation#custom-formatters
 */function i(e,t=r/* .defaultDateLib */.VA){return t.format(e,"LLLL")}},93712:function(e,t,n){n.d(t,{n:()=>i});/* import */var r=n(30922);/**
 * Formats the week number.
 *
 * @defaultValue The week number as a string, with a leading zero for single-digit numbers.
 * @param weekNumber The week number to format.
 * @param dateLib The date library to use for formatting. Defaults to
 *   `defaultDateLib`.
 * @returns The formatted week number as a string.
 * @group Formatters
 * @see https://daypicker.dev/docs/translation#custom-formatters
 */function i(e,t=r/* .defaultDateLib */.VA){if(e<10){return t.formatNumber(`0${e.toLocaleString()}`)}return t.formatNumber(`${e.toLocaleString()}`)}},61189:function(e,t,n){n.d(t,{U:()=>r});/**
 * Formats the header for the week number column.
 *
 * @defaultValue An empty string `""`.
 * @returns The formatted week number header as a string.
 * @group Formatters
 * @see https://daypicker.dev/docs/translation#custom-formatters
 */function r(){return``}},40812:function(e,t,n){n.d(t,{Z:()=>i});/* import */var r=n(30922);/**
 * Formats the name of a weekday to be displayed in the weekdays header.
 *
 * @defaultValue `cccccc` (e.g., "Mo" for Monday).
 * @param weekday The date representing the weekday.
 * @param options Configuration options for the date library.
 * @param dateLib The date library to use for formatting. If not provided, a new
 *   instance is created.
 * @returns The formatted weekday name as a string.
 * @group Formatters
 * @see https://daypicker.dev/docs/translation#custom-formatters
 */function i(e,t,n){return(n??new r/* .DateLib */.i0(t)).format(e,"cccccc")}},93369:function(e,t,n){n.d(t,{D:()=>a,e:()=>i});/* import */var r=n(30922);/**
 * Formats the year for the dropdown option label.
 *
 * @param year The year to format.
 * @param dateLib The date library to use for formatting. Defaults to
 *   `defaultDateLib`.
 * @returns The formatted year as a string.
 * @group Formatters
 * @see https://daypicker.dev/docs/translation#custom-formatters
 */function i(e,t=r/* .defaultDateLib */.VA){return t.format(e,"yyyy")}/**
 * @private
 * @deprecated Use `formatYearDropdown` instead.
 * @group Formatters
 */const a=i},61032:function(e,t,n){n.r(t);n.d(t,{formatCaption:()=>/* reexport safe */r.w,formatDay:()=>/* reexport safe */i.i,formatMonthCaption:()=>/* reexport safe */r.G,formatMonthDropdown:()=>/* reexport safe */a.Z,formatWeekNumber:()=>/* reexport safe */s.n,formatWeekNumberHeader:()=>/* reexport safe */l.U,formatWeekdayName:()=>/* reexport safe */o.Z,formatYearCaption:()=>/* reexport safe */u.D,formatYearDropdown:()=>/* reexport safe */u.e});/* import */var r=n(50075);/* import */var i=n(15143);/* import */var a=n(90970);/* import */var o=n(40812);/* import */var s=n(93712);/* import */var l=n(61189);/* import */var u=n(93369)},83803:function(e,t,n){n.d(t,{A:()=>o});/* import */var r=n(10782);var i;(function(e){e[e["Today"]=0]="Today";e[e["Selected"]=1]="Selected";e[e["LastFocused"]=2]="LastFocused";e[e["FocusedModifier"]=3]="FocusedModifier"})(i||(i={}));/**
 * Determines if a day is focusable based on its modifiers.
 *
 * A day is considered focusable if it is not disabled, hidden, or outside the
 * displayed month.
 *
 * @param modifiers The modifiers applied to the day.
 * @returns `true` if the day is focusable, otherwise `false`.
 */function a(e){return!e[r/* .DayFlag.disabled */.pL.disabled]&&!e[r/* .DayFlag.hidden */.pL.hidden]&&!e[r/* .DayFlag.outside */.pL.outside]}/**
 * Calculates the focus target day based on priority.
 *
 * This function determines the day that should receive focus in the calendar,
 * prioritizing days with specific modifiers (e.g., "focused", "today") or
 * selection states.
 *
 * @param days The array of `CalendarDay` objects to evaluate.
 * @param getModifiers A function to retrieve the modifiers for a given day.
 * @param isSelected A function to determine if a day is selected.
 * @param lastFocused The last focused day, if any.
 * @returns The `CalendarDay` that should receive focus, or `undefined` if no
 *   focusable day is found.
 */function o(e,t,n,o){let s;let l=-1;for(const u of e){const e=t(u);if(a(e)){if(e[r/* .DayFlag.focused */.pL.focused]&&l<i.FocusedModifier){s=u;l=i.FocusedModifier}else if(o?.isEqualTo(u)&&l<i.LastFocused){s=u;l=i.LastFocused}else if(n(u.date)&&l<i.Selected){s=u;l=i.Selected}else if(e[r/* .DayFlag.today */.pL.today]&&l<i.Today){s=u;l=i.Today}}}if(!s){// Return the first day that is focusable
s=e.find(e=>a(t(e)))}return s}},36612:function(e,t,n){n.d(t,{x:()=>a});/* import */var r=n(10782);/* import */var i=n(9723);/**
 * Creates a function to retrieve the modifiers for a given day.
 *
 * This function calculates both internal and custom modifiers for each day
 * based on the provided calendar days and DayPicker props.
 *
 * @private
 * @param days The array of `CalendarDay` objects to process.
 * @param props The DayPicker props, including modifiers and configuration
 *   options.
 * @param dateLib The date library to use for date manipulation.
 * @returns A function that retrieves the modifiers for a given `CalendarDay`.
 */function a(e,t,n,a,o){const{disabled:s,hidden:l,modifiers:u,showOutsideDays:d,broadcastCalendar:c,today:p=o.today()}=t;const{isSameDay:h,isSameMonth:v,startOfMonth:f,isBefore:g,endOfMonth:m,isAfter:_}=o;const b=n&&f(n);const y=a&&m(a);const w={[r/* .DayFlag.focused */.pL.focused]:[],[r/* .DayFlag.outside */.pL.outside]:[],[r/* .DayFlag.disabled */.pL.disabled]:[],[r/* .DayFlag.hidden */.pL.hidden]:[],[r/* .DayFlag.today */.pL.today]:[]};const A={};for(const t of e){const{date:e,displayMonth:n}=t;const r=Boolean(n&&!v(e,n));const a=Boolean(b&&g(e,b));const f=Boolean(y&&_(e,y));const m=Boolean(s&&(0,i/* .dateMatchModifiers */.k)(e,s,o));const Y=Boolean(l&&(0,i/* .dateMatchModifiers */.k)(e,l,o))||a||f||// Broadcast calendar will show outside days as default
!c&&!d&&r||c&&d===false&&r;const k=h(e,p);if(r)w.outside.push(t);if(m)w.disabled.push(t);if(Y)w.hidden.push(t);if(k)w.today.push(t);// Add custom modifiers
if(u){Object.keys(u).forEach(n=>{const r=u?.[n];const a=r?(0,i/* .dateMatchModifiers */.k)(e,r,o):false;if(!a)return;if(A[n]){A[n].push(t)}else{A[n]=[t]}})}}return e=>{// Initialize all the modifiers to false
const t={[r/* .DayFlag.focused */.pL.focused]:false,[r/* .DayFlag.disabled */.pL.disabled]:false,[r/* .DayFlag.hidden */.pL.hidden]:false,[r/* .DayFlag.outside */.pL.outside]:false,[r/* .DayFlag.today */.pL.today]:false};const n={};// Find the modifiers for the given day
for(const n in w){const r=w[n];t[n]=r.some(t=>t===e)}for(const t in A){n[t]=A[t].some(t=>t===e)}return{...t,// custom modifiers should override all the previous ones
...n}}}},26969:function(e,t,n){n.d(t,{O:()=>a});/* import */var r=n(1425);/* import */var i=n(83566);/**
 * Returns the end date of the week in the broadcast calendar.
 *
 * The broadcast week ends on the last day of the last broadcast week for the
 * given date.
 *
 * @since 9.4.0
 * @param date The date for which to calculate the end of the broadcast week.
 * @param dateLib The date library to use for date manipulation.
 * @returns The end date of the broadcast week.
 */function a(e,t){const n=(0,i/* .startOfBroadcastWeek */.l)(e,t);const a=(0,r/* .getBroadcastWeeksInMonth */.I)(e,t);const o=t.addDays(n,a*7-1);return o}},1425:function(e,t,n){n.d(t,{I:()=>a});const r=5;const i=4;/**
 * Returns the number of weeks to display in the broadcast calendar for a given
 * month.
 *
 * The broadcast calendar may have either 4 or 5 weeks in a month, depending on
 * the start and end dates of the broadcast weeks.
 *
 * @since 9.4.0
 * @param month The month for which to calculate the number of weeks.
 * @param dateLib The date library to use for date manipulation.
 * @returns The number of weeks in the broadcast calendar (4 or 5).
 */function a(e,t){// Get the first day of the month
const n=t.startOfMonth(e);// Get the day of the week for the first day of the month (1-7, where 1 is Monday)
const a=n.getDay()>0?n.getDay():7;const o=t.addDays(e,-a+1);const s=t.addDays(o,r*7-1);const l=t.getMonth(e)===t.getMonth(s)?r:i;return l}},76447:function(e,t,n){n.d(t,{k:()=>i});/* import */var r=n(10782);/**
 * Returns the class names for a day based on its modifiers.
 *
 * This function combines the base class name for the day with any class names
 * associated with active modifiers.
 *
 * @param modifiers The modifiers applied to the day.
 * @param classNames The base class names for the calendar elements.
 * @param modifiersClassNames The class names associated with specific
 *   modifiers.
 * @returns An array of class names for the day.
 */function i(e,t,n={}){const a=Object.entries(e).filter(([,e])=>e===true).reduce((e,[i])=>{if(n[i]){e.push(n[i])}else if(t[r/* .DayFlag */.pL[i]]){e.push(t[r/* .DayFlag */.pL[i]])}else if(t[r/* .SelectionState */.wc[i]]){e.push(t[r/* .SelectionState */.wc[i]])}return e},[t[r.UI.Day]]);return a}},47088:function(e,t,n){n.d(t,{P:()=>i});/* import */var r=n(63869);/**
 * Merges custom components from the props with the default components.
 *
 * This function ensures that any custom components provided in the props
 * override the default components.
 *
 * @param customComponents The custom components provided in the DayPicker
 *   props.
 * @returns An object containing the merged components.
 */function i(e){return{...r,...e}}},52813:function(e,t,n){n.d(t,{C:()=>r});/**
 * Extracts `data-` attributes from the DayPicker props.
 *
 * This function collects all `data-` attributes from the props and adds
 * additional attributes based on the DayPicker configuration.
 *
 * @param props The DayPicker props.
 * @returns An object containing the `data-` attributes.
 */function r(e){const t={"data-mode":e.mode??undefined,"data-required":"required"in e?e.required:undefined,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||undefined,"data-week-numbers":e.showWeekNumber||undefined,"data-broadcast-calendar":e.broadcastCalendar||undefined,"data-nav-layout":e.navLayout||undefined};Object.entries(e).forEach(([e,n])=>{if(e.startsWith("data-")){t[e]=n}});return t}},4047:function(e,t,n){n.d(t,{Y:()=>r});/**
 * Returns all the dates to display in the calendar.
 *
 * This function calculates the range of dates to display based on the provided
 * display months, constraints, and calendar configuration.
 *
 * @param displayMonths The months to display in the calendar.
 * @param maxDate The maximum date to include in the range.
 * @param props The DayPicker props, including calendar configuration options.
 * @param dateLib The date library to use for date manipulation.
 * @returns An array of dates to display in the calendar.
 */function r(e,t,n,r){const i=e[0];const a=e[e.length-1];const{ISOWeek:o,fixedWeeks:s,broadcastCalendar:l}=n??{};const{addDays:u,differenceInCalendarDays:d,differenceInCalendarMonths:c,endOfBroadcastWeek:p,endOfISOWeek:h,endOfMonth:v,endOfWeek:f,isAfter:g,startOfBroadcastWeek:m,startOfISOWeek:_,startOfWeek:b}=r;const y=l?m(i,r):o?_(i):b(i);const w=l?p(a):o?h(v(a)):f(v(a));// If maxDate is set, clamp the grid to the end of that week.
const A=t&&(l?p(t):o?h(t):f(t));// Pick the earliest week end between the displayed months and the constraint.
const Y=A&&g(w,A)?A:w;const k=d(Y,y);const I=c(a,i)+1;const q=[];for(let e=0;e<=k;e++){const t=u(y,e);q.push(t)}// If fixed weeks is enabled, add the extra dates to the array
const C=l?35:42;const D=C*I;if(s&&q.length<D){const e=D-q.length;for(let t=0;t<e;t++){const e=u(q[q.length-1],1);q.push(e)}}return q}},73495:function(e,t,n){n.d(t,{_:()=>r});/**
 * Returns all the days belonging to the calendar by merging the days in the
 * weeks for each month.
 *
 * @param calendarMonths The array of calendar months.
 * @returns An array of `CalendarDay` objects representing all the days in the
 *   calendar.
 */function r(e){const t=[];return e.reduce((e,n)=>{const r=n.weeks.reduce((e,t)=>{return e.concat(t.days.slice())},t.slice());return e.concat(r.slice())},t.slice())}},143:function(e,t,n){n.d(t,{a:()=>i});/* import */var r=n(10782);/**
 * Returns the default class names for the UI elements.
 *
 * This function generates a mapping of default class names for various UI
 * elements, day flags, selection states, and animations.
 *
 * @returns An object containing the default class names.
 * @group Utilities
 */function i(){const e={};for(const t in r.UI){e[r.UI[t]]=`rdp-${r.UI[t]}`}for(const t in r/* .DayFlag */.pL){e[r/* .DayFlag */.pL[t]]=`rdp-${r/* .DayFlag */.pL[t]}`}for(const t in r/* .SelectionState */.wc){e[r/* .SelectionState */.wc[t]]=`rdp-${r/* .SelectionState */.wc[t]}`}for(const t in r/* .Animation */.X5){e[r/* .Animation */.X5[t]]=`rdp-${r/* .Animation */.X5[t]}`}return e}},26511:function(e,t,n){n.d(t,{o:()=>r});/**
 * Returns the months to display in the calendar.
 *
 * @param firstDisplayedMonth The first month currently displayed in the
 *   calendar.
 * @param calendarEndMonth The latest month the user can navigate to.
 * @param props The DayPicker props, including `numberOfMonths`.
 * @param dateLib The date library to use for date manipulation.
 * @returns An array of dates representing the months to display.
 */function r(e,t,n,r){const{numberOfMonths:i=1}=n;const a=[];for(let n=0;n<i;n++){const i=r.addMonths(e,n);if(t&&i>t){break}a.push(i)}return a}},81790:function(e,t,n){n.d(t,{l:()=>r});/**
 * Calculates the next date that should be focused in the calendar.
 *
 * This function determines the next focusable date based on the movement
 * direction, constraints, and calendar configuration.
 *
 * @param moveBy The unit of movement (e.g., "day", "week").
 * @param moveDir The direction of movement ("before" or "after").
 * @param refDate The reference date from which to calculate the next focusable
 *   date.
 * @param navStart The earliest date the user can navigate to.
 * @param navEnd The latest date the user can navigate to.
 * @param props The DayPicker props, including calendar configuration options.
 * @param dateLib The date library to use for date manipulation.
 * @returns The next focusable date.
 */function r(e,t,n,r,i,a,o){const{ISOWeek:s,broadcastCalendar:l}=a;const{addDays:u,addMonths:d,addWeeks:c,addYears:p,endOfBroadcastWeek:h,endOfISOWeek:v,endOfWeek:f,max:g,min:m,startOfBroadcastWeek:_,startOfISOWeek:b,startOfWeek:y}=o;const w={day:u,week:c,month:d,year:p,startOfWeek:e=>l?_(e,o):s?b(e):y(e),endOfWeek:e=>l?h(e):s?v(e):f(e)};let A=w[e](n,t==="after"?1:-1);if(t==="before"&&r){A=g([r,A])}else if(t==="after"&&i){A=m([i,A])}return A}},3591:function(e,t,n){n.d(t,{G:()=>i});/* import */var r=n(61032);/**
 * Merges custom formatters from the props with the default formatters.
 *
 * @param customFormatters The custom formatters provided in the DayPicker
 *   props.
 * @returns The merged formatters object.
 */function i(e){if(e?.formatMonthCaption&&!e.formatCaption){e.formatCaption=e.formatMonthCaption}if(e?.formatYearCaption&&!e.formatYearDropdown){e.formatYearDropdown=e.formatYearCaption}return{...r,...e}}},1102:function(e,t,n){n.d(t,{Z:()=>r});/**
 * Determines the initial month to display in the calendar based on the provided
 * props.
 *
 * This function calculates the starting month, considering constraints such as
 * `startMonth`, `endMonth`, and the number of months to display.
 *
 * @param props The DayPicker props, including navigation and date constraints.
 * @param dateLib The date library to use for date manipulation.
 * @returns The initial month to display.
 */function r(e,t,n,r){const{month:i,defaultMonth:a,today:o=r.today(),numberOfMonths:s=1}=e;let l=i||a||o;const{differenceInCalendarMonths:u,addMonths:d,startOfMonth:c}=r;if(n&&u(n,l)<s-1){const e=-1*(s-1);l=d(n,e)}if(t&&u(l,t)<0){l=t}return c(l)}},36004:function(e,t,n){n.d(t,{L:()=>r});/**
 * Returns the months to show in the dropdown.
 *
 * This function generates a list of months for the current year, formatted
 * using the provided formatter, and determines whether each month should be
 * disabled based on the navigation range.
 *
 * @param displayMonth The currently displayed month.
 * @param navStart The start date for navigation.
 * @param navEnd The end date for navigation.
 * @param formatters The formatters to use for formatting the month labels.
 * @param dateLib The date library to use for date manipulation.
 * @returns An array of dropdown options representing the months, or `undefined`
 *   if no months are available.
 */function r(e,t,n,r,i){const{startOfMonth:a,startOfYear:o,endOfYear:s,eachMonthOfInterval:l,getMonth:u}=i;const d=l({start:o(e),end:s(e)});const c=d.map(e=>{const o=r.formatMonthDropdown(e,i);const s=u(e);const l=t&&e<a(t)||n&&e>a(n)||false;return{value:s,label:o,disabled:l}});return c}},59807:function(e,t,n){n.d(t,{S:()=>o});/* import */var r=n(69133);/* import */var i=n(24971);/* import */var a=n(76465);/**
 * Returns the months to display in the calendar.
 *
 * This function generates `CalendarMonth` objects for each month to be
 * displayed, including their weeks and days, based on the provided display
 * months and dates.
 *
 * @param displayMonths The months (as dates) to display in the calendar.
 * @param dates The dates to display in the calendar.
 * @param props Options from the DayPicker props context.
 * @param dateLib The date library to use for date manipulation.
 * @returns An array of `CalendarMonth` objects representing the months to
 *   display.
 */function o(e,t,n,o){const{addDays:s,endOfBroadcastWeek:l,endOfISOWeek:u,endOfMonth:d,endOfWeek:c,getISOWeek:p,getWeek:h,startOfBroadcastWeek:v,startOfISOWeek:f,startOfWeek:g}=o;const m=e.reduce((e,m)=>{const _=n.broadcastCalendar?v(m,o):n.ISOWeek?f(m):g(m);const b=n.broadcastCalendar?l(m):n.ISOWeek?u(d(m)):c(d(m));/** The dates to display in the month. */const y=t.filter(e=>{return e>=_&&e<=b});const w=n.broadcastCalendar?35:42;if(n.fixedWeeks&&y.length<w){const e=t.filter(e=>{const t=w-y.length;return e>b&&e<=s(b,t)});y.push(...e)}const A=y.reduce((e,t)=>{const a=n.ISOWeek?p(t):h(t);const s=e.find(e=>e.weekNumber===a);const l=new r/* .CalendarDay */.P(t,m,o);if(!s){e.push(new i/* .CalendarWeek */.j(a,[l]))}else{s.days.push(l)}return e},[]);const Y=new a/* .CalendarMonth */.j(m,A);e.push(Y);return e},[]);if(!n.reverseMonths){return m}else{return m.reverse()}}},61921:function(e,t,n){n.d(t,{J:()=>r});/**
 * Returns the start and end months for calendar navigation.
 *
 * @param props The DayPicker props, including navigation and layout options.
 * @param dateLib The date library to use for date manipulation.
 * @returns A tuple containing the start and end months for navigation.
 */function r(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:i,startOfDay:a,startOfMonth:o,endOfMonth:s,addYears:l,endOfYear:u,newDate:d,today:c}=t;// Handle deprecated code
const{fromYear:p,toYear:h,fromMonth:v,toMonth:f}=e;if(!n&&v){n=v}if(!n&&p){n=t.newDate(p,0,1)}if(!r&&f){r=f}if(!r&&h){r=d(h,11,31)}const g=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";if(n){n=o(n)}else if(p){n=d(p,0,1)}else if(!n&&g){n=i(l(e.today??c(),-100))}if(r){r=s(r)}else if(h){r=d(h,11,31)}else if(!r&&g){r=u(e.today??c())}return[n?a(n):n,r?a(r):r]}},44917:function(e,t,n){n.d(t,{O:()=>o});/* import */var r=n(69133);/* import */var i=n(9723);/* import */var a=n(81790);/**
 * Determines the next focusable day in the calendar.
 *
 * This function recursively calculates the next focusable day based on the
 * movement direction and modifiers applied to the days.
 *
 * @param moveBy The unit of movement (e.g., "day", "week").
 * @param moveDir The direction of movement ("before" or "after").
 * @param refDay The currently focused day.
 * @param calendarStartMonth The earliest month the user can navigate to.
 * @param calendarEndMonth The latest month the user can navigate to.
 * @param props The DayPicker props, including modifiers and configuration
 *   options.
 * @param dateLib The date library to use for date manipulation.
 * @param attempt The current recursion attempt (used to limit recursion depth).
 * @returns The next focusable day, or `undefined` if no focusable day is found.
 */function o(e,t,n,s,l,u,d,c=0){if(c>365){// Limit the recursion to 365 attempts
return undefined}const p=(0,a/* .getFocusableDate */.l)(e,t,n.date,s,l,u,d);const h=Boolean(u.disabled&&(0,i/* .dateMatchModifiers */.k)(p,u.disabled,d));const v=Boolean(u.hidden&&(0,i/* .dateMatchModifiers */.k)(p,u.hidden,d));const f=p;const g=new r/* .CalendarDay */.P(p,f,d);if(!h&&!v){return g}// Recursively attempt to find the next focusable date
return o(e,t,g,s,l,u,d,c+1)}},66847:function(e,t,n){n.d(t,{Q:()=>r});/**
 * Returns the next month the user can navigate to, based on the given options.
 *
 * The next month is not always the next calendar month:
 *
 * - If it is after the `calendarEndMonth`, it returns `undefined`.
 * - If paged navigation is enabled, it skips forward by the number of displayed
 *   months.
 *
 * @param firstDisplayedMonth The first month currently displayed in the
 *   calendar.
 * @param calendarEndMonth The latest month the user can navigate to.
 * @param options Navigation options, including `numberOfMonths` and
 *   `pagedNavigation`.
 * @param dateLib The date library to use for date manipulation.
 * @returns The next month, or `undefined` if navigation is not possible.
 */function r(e,t,n,r){if(n.disableNavigation){return undefined}const{pagedNavigation:i,numberOfMonths:a=1}=n;const{startOfMonth:o,addMonths:s,differenceInCalendarMonths:l}=r;const u=i?a:1;const d=o(e);if(!t){return s(d,u)}const c=l(t,e);if(c<a){return undefined}return s(d,u)}},70267:function(e,t,n){n.d(t,{E:()=>r});/**
 * Returns the previous month the user can navigate to, based on the given
 * options.
 *
 * The previous month is not always the previous calendar month:
 *
 * - If it is before the `calendarStartMonth`, it returns `undefined`.
 * - If paged navigation is enabled, it skips back by the number of displayed
 *   months.
 *
 * @param firstDisplayedMonth The first month currently displayed in the
 *   calendar.
 * @param calendarStartMonth The earliest month the user can navigate to.
 * @param options Navigation options, including `numberOfMonths` and
 *   `pagedNavigation`.
 * @param dateLib The date library to use for date manipulation.
 * @returns The previous month, or `undefined` if navigation is not possible.
 */function r(e,t,n,r){if(n.disableNavigation){return undefined}const{pagedNavigation:i,numberOfMonths:a}=n;const{startOfMonth:o,addMonths:s,differenceInCalendarMonths:l}=r;const u=i?a??1:1;const d=o(e);if(!t){return s(d,-u)}const c=l(d,t);if(c<=0){return undefined}return s(d,-u)}},66220:function(e,t,n){n.d(t,{J:()=>i});/* import */var r=n(10782);/**
 * Returns the computed style for a day based on its modifiers.
 *
 * This function merges the base styles for the day with any styles associated
 * with active modifiers.
 *
 * @param dayModifiers The modifiers applied to the day.
 * @param styles The base styles for the calendar elements.
 * @param modifiersStyles The styles associated with specific modifiers.
 * @returns The computed style for the day.
 */function i(e,t={},n={}){let a={...t?.[r.UI.Day]};Object.entries(e).filter(([,e])=>e===true).forEach(([e])=>{a={...a,...n?.[e]}});return a}},55223:function(e,t,n){n.d(t,{c:()=>r});/**
 * Generates a series of 7 days, starting from the beginning of the week, to use
 * for formatting weekday names (e.g., Monday, Tuesday, etc.).
 *
 * @param dateLib The date library to use for date manipulation.
 * @param ISOWeek Whether to use ISO week numbering (weeks start on Monday).
 * @param broadcastCalendar Whether to use the broadcast calendar (weeks start
 *   on Monday, but may include adjustments for broadcast-specific rules).
 * @returns An array of 7 dates representing the weekdays.
 */function r(e,t,n,r){const i=r??e.today();const a=n?e.startOfBroadcastWeek(i,e):t?e.startOfISOWeek(i):e.startOfWeek(i);const o=[];for(let t=0;t<7;t++){const n=e.addDays(a,t);o.push(n)}return o}},32923:function(e,t,n){n.d(t,{C:()=>r});/**
 * Returns an array of calendar weeks from an array of calendar months.
 *
 * @param months The array of calendar months.
 * @returns An array of calendar weeks.
 */function r(e){const t=[];return e.reduce((e,t)=>{return e.concat(t.weeks.slice())},t.slice())}},69811:function(e,t,n){n.d(t,{g:()=>r});/**
 * Returns the years to display in the dropdown.
 *
 * This function generates a list of years between the navigation start and end
 * dates, formatted using the provided formatter.
 *
 * @param navStart The start date for navigation.
 * @param navEnd The end date for navigation.
 * @param formatters The formatters to use for formatting the year labels.
 * @param dateLib The date library to use for date manipulation.
 * @param reverse If true, reverses the order of the years (descending).
 * @returns An array of dropdown options representing the years, or `undefined`
 *   if `navStart` or `navEnd` is not provided.
 */function r(e,t,n,i,a=false){if(!e)return undefined;if(!t)return undefined;const{startOfYear:o,endOfYear:s,eachYearOfInterval:l,getYear:u}=i;const d=o(e);const c=s(t);const p=l({start:d,end:c});if(a)p.reverse();return p.map(e=>{const t=n.formatYearDropdown(e,i);return{value:u(e),label:t,disabled:false}})}},83566:function(e,t,n){n.d(t,{l:()=>r});/**
 * Returns the start date of the week in the broadcast calendar.
 *
 * The broadcast week starts on Monday. If the first day of the month is not a
 * Monday, this function calculates the previous Monday as the start of the
 * broadcast week.
 *
 * @since 9.4.0
 * @param date The date for which to calculate the start of the broadcast week.
 * @param dateLib The date library to use for date manipulation.
 * @returns The start date of the broadcast week.
 */function r(e,t){const n=t.startOfMonth(e);const r=n.getDay();if(r===1){return n}else if(r===0){return t.addDays(n,-1*6)}else{return t.addDays(n,-1*(r-1))}}},15148:function(e,t,n){n.d(t,{j:()=>i});/* import */var r=n(41594);/**
 * A custom hook for managing both controlled and uncontrolled component states.
 *
 * This hook allows a component to support both controlled and uncontrolled
 * states by determining whether the `controlledValue` is provided. If it is
 * undefined, the hook falls back to using the internal state.
 *
 * @example
 *   // Uncontrolled usage
 *   const [value, setValue] = useControlledValue(0, undefined);
 *
 *   // Controlled usage
 *   const [value, setValue] = useControlledValue(0, props.value);
 *
 * @template T - The type of the value.
 * @param defaultValue The initial value for the uncontrolled state.
 * @param controlledValue The value for the controlled state. If undefined, the
 *   component will use the uncontrolled state.
 * @returns A tuple where the first element is the current value (either
 *   controlled or uncontrolled) and the second element is a setter function to
 *   update the value.
 */function i(e,t){const[n,i]=(0,r.useState)(e);const a=t===undefined?n:t;return[a,i]}},7332:function(e,t,n){n.r(t);n.d(t,{labelCaption:()=>/* reexport safe */i.t,labelDay:()=>/* reexport safe */r.Z,labelDayButton:()=>/* reexport safe */r.n,labelGrid:()=>/* reexport safe */i.b,labelGridcell:()=>/* reexport safe */a.P,labelMonthDropdown:()=>/* reexport safe */o.a,labelNav:()=>/* reexport safe */s.y,labelNext:()=>/* reexport safe */l.s,labelPrevious:()=>/* reexport safe */u.o,labelWeekNumber:()=>/* reexport safe */c.k,labelWeekNumberHeader:()=>/* reexport safe */p.N,labelWeekday:()=>/* reexport safe */d.n,labelYearDropdown:()=>/* reexport safe */h.n});/* import */var r=n(94926);/* import */var i=n(43350);/* import */var a=n(43950);/* import */var o=n(91859);/* import */var s=n(22913);/* import */var l=n(98531);/* import */var u=n(67683);/* import */var d=n(18146);/* import */var c=n(17587);/* import */var p=n(71722);/* import */var h=n(62574)},94926:function(e,t,n){n.d(t,{Z:()=>a,n:()=>i});/* import */var r=n(30922);/**
 * Generates the ARIA label for a day button.
 *
 * Use the `modifiers` argument to provide additional context for the label,
 * such as indicating if the day is "today" or "selected."
 *
 * @defaultValue The formatted date.
 * @param date - The date to format.
 * @param modifiers - The modifiers providing context for the day.
 * @param options - Optional configuration for the date formatting library.
 * @param dateLib - An optional instance of the date formatting library.
 * @returns The ARIA label for the day button.
 * @group Labels
 * @see https://daypicker.dev/docs/translation#aria-labels
 */function i(e,t,n,i){let a=(i??new r/* .DateLib */.i0(n)).format(e,"PPPP");if(t.today)a=`Today, ${a}`;if(t.selected)a=`${a}, selected`;return a}/**
 * @ignore
 * @deprecated Use `labelDayButton` instead.
 */const a=i},43350:function(e,t,n){n.d(t,{b:()=>i,t:()=>a});/* import */var r=n(30922);/**
 * Generates the ARIA label for the month grid, which is announced when entering
 * the grid.
 *
 * @defaultValue Locale-specific month/year order (e.g., "November 2022").
 * @param date - The date representing the month.
 * @param options - Optional configuration for the date formatting library.
 * @param dateLib - An optional instance of the date formatting library.
 * @returns The ARIA label for the month grid.
 * @group Labels
 * @see https://daypicker.dev/docs/translation#aria-labels
 */function i(e,t,n){const i=n??new r/* .DateLib */.i0(t);return i.formatMonthYear(e)}/**
 * @ignore
 * @deprecated Use {@link labelGrid} instead.
 */const a=i},43950:function(e,t,n){n.d(t,{P:()=>i});/* import */var r=n(30922);/**
 * Generates the label for a day grid cell when the calendar is not interactive.
 *
 * @param date - The date to format.
 * @param modifiers - Optional modifiers providing context for the day.
 * @param options - Optional configuration for the date formatting library.
 * @param dateLib - An optional instance of the date formatting library.
 * @returns The label for the day grid cell.
 * @group Labels
 * @see https://daypicker.dev/docs/translation#aria-labels
 */function i(e,t,n,i){let a=(i??new r/* .DateLib */.i0(n)).format(e,"PPPP");if(t?.today){a=`Today, ${a}`}return a}},91859:function(e,t,n){n.d(t,{a:()=>r});/**
 * Generates the ARIA label for the months dropdown.
 *
 * @defaultValue `"Choose the Month"`
 * @param options - Optional configuration for the date formatting library.
 * @returns The ARIA label for the months dropdown.
 * @group Labels
 * @see https://daypicker.dev/docs/translation#aria-labels
 */function r(e){return"Choose the Month"}},22913:function(e,t,n){n.d(t,{y:()=>r});/**
 * Generates the ARIA label for the navigation toolbar.
 *
 * @defaultValue `""`
 * @returns The ARIA label for the navigation toolbar.
 * @group Labels
 * @see https://daypicker.dev/docs/translation#aria-labels
 */function r(){return""}},98531:function(e,t,n){n.d(t,{s:()=>r});/**
 * Generates the ARIA label for the "next month" button.
 *
 * @defaultValue `"Go to the Next Month"`
 * @param month - The date representing the next month, or `undefined` if there
 *   is no next month.
 * @returns The ARIA label for the "next month" button.
 * @group Labels
 * @see https://daypicker.dev/docs/translation#aria-labels
 */function r(e){return"Go to the Next Month"}},67683:function(e,t,n){n.d(t,{o:()=>r});/**
 * Generates the ARIA label for the "previous month" button.
 *
 * @defaultValue `"Go to the Previous Month"`
 * @param month - The date representing the previous month, or `undefined` if
 *   there is no previous month.
 * @returns The ARIA label for the "previous month" button.
 * @group Labels
 * @see https://daypicker.dev/docs/translation#aria-labels
 */function r(e){return"Go to the Previous Month"}},17587:function(e,t,n){n.d(t,{k:()=>r});/**
 * Generates the ARIA label for the week number cell (the first cell in a row).
 *
 * @defaultValue `Week ${weekNumber}`
 * @param weekNumber - The number of the week.
 * @param options - Optional configuration for the date formatting library.
 * @returns The ARIA label for the week number cell.
 * @group Labels
 * @see https://daypicker.dev/docs/translation#aria-labels
 */function r(e,t){return`Week ${e}`}},71722:function(e,t,n){n.d(t,{N:()=>r});/**
 * Generates the ARIA label for the week number header element.
 *
 * @defaultValue `"Week Number"`
 * @param options - Optional configuration for the date formatting library.
 * @returns The ARIA label for the week number header.
 * @group Labels
 * @see https://daypicker.dev/docs/translation#aria-labels
 */function r(e){return"Week Number"}},18146:function(e,t,n){n.d(t,{n:()=>i});/* import */var r=n(30922);/**
 * Generates the ARIA label for a weekday column header.
 *
 * @defaultValue `"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"`
 * @param date - The date representing the weekday.
 * @param options - Optional configuration for the date formatting library.
 * @param dateLib - An optional instance of the date formatting library.
 * @returns The ARIA label for the weekday column header.
 * @group Labels
 * @see https://daypicker.dev/docs/translation#aria-labels
 */function i(e,t,n){return(n??new r/* .DateLib */.i0(t)).format(e,"cccc")}},62574:function(e,t,n){n.d(t,{n:()=>r});/**
 * Generates the ARIA label for the years dropdown.
 *
 * @defaultValue `"Choose the Year"`
 * @param options - Optional configuration for the date formatting library.
 * @returns The ARIA label for the years dropdown.
 * @group Labels
 * @see https://daypicker.dev/docs/translation#aria-labels
 */function r(e){return"Choose the Year"}},79479:function(e,t,n){n.d(t,{N:()=>i});/* import */var r=n(15148);/**
 * Hook to manage multiple-date selection in the DayPicker component.
 *
 * @template T - The type of DayPicker props.
 * @param props - The DayPicker props.
 * @param dateLib - The date utility library instance.
 * @returns An object containing the selected dates, a function to select dates,
 *   and a function to check if a date is selected.
 */function i(e,t){const{selected:n,required:i,onSelect:a}=e;const[o,s]=(0,r/* .useControlledValue */.j)(n,a?n:undefined);const l=!a?o:n;const{isSameDay:u}=t;const d=e=>{return l?.some(t=>u(t,e))??false};const{min:c,max:p}=e;const h=(e,t,n)=>{let r=[...l??[]];if(d(e)){if(l?.length===c){// Min value reached, do nothing
return}if(i&&l?.length===1){// Required value already selected do nothing
return}r=l?.filter(t=>!u(t,e))}else{if(l?.length===p){// Max value reached, reset the selection to date
r=[e]}else{// Add the date to the selection
r=[...r,e]}}if(!a){s(r)}a?.(r,e,t,n);return r};return{selected:l,select:h,isSelected:d}}},95379:function(e,t,n){n.d(t,{f:()=>s});/* import */var r=n(15148);/* import */var i=n(75749);/* import */var a=n(85052);/* import */var o=n(79796);/**
 * Hook to manage range selection in the DayPicker component.
 *
 * @template T - The type of DayPicker props.
 * @param props - The DayPicker props.
 * @param dateLib - The date utility library instance.
 * @returns An object containing the selected range, a function to select a
 *   range, and a function to check if a date is within the range.
 */function s(e,t){const{disabled:n,excludeDisabled:s,selected:l,required:u,onSelect:d}=e;const[c,p]=(0,r/* .useControlledValue */.j)(l,d?l:undefined);const h=!d?c:l;const v=e=>h&&(0,o/* .rangeIncludesDate */.R)(h,e,false,t);const f=(r,o,l)=>{const{min:c,max:v}=e;const f=r?(0,i/* .addToRange */.M)(r,h,c,v,u,t):undefined;if(s&&n&&f?.from&&f.to){if((0,a/* .rangeContainsModifiers */.P)({from:f.from,to:f.to},n,t)){// if a disabled days is found, the range is reset
f.from=r;f.to=undefined}}if(!d){p(f)}d?.(f,r,o,l);return f};return{selected:h,select:f,isSelected:v}}},12764:function(e,t,n){n.d(t,{G:()=>i});/* import */var r=n(15148);/**
 * Hook to manage single-date selection in the DayPicker component.
 *
 * @template T - The type of DayPicker props.
 * @param props - The DayPicker props.
 * @param dateLib - The date utility library instance.
 * @returns An object containing the selected date, a function to select a date,
 *   and a function to check if a date is selected.
 */function i(e,t){const{selected:n,required:i,onSelect:a}=e;const[o,s]=(0,r/* .useControlledValue */.j)(n,a?n:undefined);const l=!a?o:n;const{isSameDay:u}=t;const d=e=>{return l?u(l,e):false};const c=(e,t,n)=>{let r=e;if(!i&&l&&l&&u(e,l)){// If the date is the same, clear the selection.
r=undefined}if(!a){s(r)}if(i){a?.(r,e,t,n)}else{a?.(r,e,t,n)}return r};return{selected:l,select:c,isSelected:d}}},8755:function(e,t,n){n.d(t,{s:()=>p});/* import */var r=n(41594);/* import */var i=n(10782);const a=e=>{if(e instanceof HTMLElement)return e;return null};const o=e=>[...e.querySelectorAll("[data-animated-month]")??[]];const s=e=>a(e.querySelector("[data-animated-month]"));const l=e=>a(e.querySelector("[data-animated-caption]"));const u=e=>a(e.querySelector("[data-animated-weeks]"));const d=e=>a(e.querySelector("[data-animated-nav]"));const c=e=>a(e.querySelector("[data-animated-weekdays]"));/**
 * Handles animations for transitioning between months in the DayPicker
 * component.
 *
 * @private
 * @param rootElRef - A reference to the root element of the DayPicker
 *   component.
 * @param enabled - Whether animations are enabled.
 * @param options - Configuration options for the animation, including class
 *   names, months, focused day, and the date utility library.
 */function p(e,t,{classNames:n,months:a,focused:p,dateLib:h}){const v=(0,r.useRef)(null);const f=(0,r.useRef)(a);const g=(0,r.useRef)(false);(0,r.useLayoutEffect)(()=>{// get previous months before updating the previous months ref
const r=f.current;// update previous months ref for next effect trigger
f.current=a;if(!t||!e.current||// safety check because the ref can be set to anything by consumers
!(e.current instanceof HTMLElement)||// validation required for the animation to work as expected
a.length===0||r.length===0||a.length!==r.length){return}const m=h.isSameMonth(a[0].date,r[0].date);const _=h.isAfter(a[0].date,r[0].date);const b=_?n[i/* .Animation.caption_after_enter */.X5.caption_after_enter]:n[i/* .Animation.caption_before_enter */.X5.caption_before_enter];const y=_?n[i/* .Animation.weeks_after_enter */.X5.weeks_after_enter]:n[i/* .Animation.weeks_before_enter */.X5.weeks_before_enter];// get previous root element snapshot before updating the snapshot ref
const w=v.current;// update snapshot for next effect trigger
const A=e.current.cloneNode(true);if(A instanceof HTMLElement){// if this effect is triggered while animating, we need to clean up the new root snapshot
// to put it in the same state as when not animating, to correctly animate the next month change
const e=o(A);e.forEach(e=>{if(!(e instanceof HTMLElement))return;// remove the old month snapshots from the new root snapshot
const t=s(e);if(t&&e.contains(t)){e.removeChild(t)}// remove animation classes from the new month snapshots
const n=l(e);if(n){n.classList.remove(b)}const r=u(e);if(r){r.classList.remove(y)}});v.current=A}else{v.current=null}if(g.current||m||// skip animation if a day is focused because it can cause issues to the animation and is better for a11y
p){return}const Y=w instanceof HTMLElement?o(w):[];const k=o(e.current);if(k?.every(e=>e instanceof HTMLElement)&&Y&&Y.every(e=>e instanceof HTMLElement)){g.current=true;const t=[];// set isolation to isolate to isolate the stacking context during animation
e.current.style.isolation="isolate";// set z-index to 1 to ensure the nav is clickable over the other elements being animated
const r=d(e.current);if(r){r.style.zIndex="1"}k.forEach((a,o)=>{const s=Y[o];if(!s){return}// animate new displayed month
a.style.position="relative";a.style.overflow="hidden";const d=l(a);if(d){d.classList.add(b)}const p=u(a);if(p){p.classList.add(y)}// animate new displayed month end
const h=()=>{g.current=false;if(e.current){e.current.style.isolation=""}if(r){r.style.zIndex=""}if(d){d.classList.remove(b)}if(p){p.classList.remove(y)}a.style.position="";a.style.overflow="";if(a.contains(s)){a.removeChild(s)}};t.push(h);// animate old displayed month
s.style.pointerEvents="none";s.style.position="absolute";s.style.overflow="hidden";s.setAttribute("aria-hidden","true");// hide the weekdays container of the old month and only the new one
const v=c(s);if(v){v.style.opacity="0"}const f=l(s);if(f){f.classList.add(_?n[i/* .Animation.caption_before_exit */.X5.caption_before_exit]:n[i/* .Animation.caption_after_exit */.X5.caption_after_exit]);f.addEventListener("animationend",h)}const m=u(s);if(m){m.classList.add(_?n[i/* .Animation.weeks_before_exit */.X5.weeks_before_exit]:n[i/* .Animation.weeks_after_exit */.X5.weeks_after_exit])}a.insertBefore(s,a.firstChild)})}})}},57391:function(e,t,n){n.d(t,{_:()=>v});/* import */var r=n(41594);/* import */var i=n(4047);/* import */var a=n(73495);/* import */var o=n(26511);/* import */var s=n(1102);/* import */var l=n(59807);/* import */var u=n(61921);/* import */var d=n(66847);/* import */var c=n(70267);/* import */var p=n(32923);/* import */var h=n(15148);/**
 * Provides the calendar object to work with the calendar in custom components.
 *
 * @private
 * @param props - The DayPicker props related to calendar configuration.
 * @param dateLib - The date utility library instance.
 * @returns The calendar object containing displayed days, weeks, months, and
 *   navigation methods.
 */function v(e,t){const[n,v]=(0,u/* .getNavMonths */.J)(e,t);const{startOfMonth:f,endOfMonth:g}=t;const m=(0,s/* .getInitialMonth */.Z)(e,n,v,t);const[_,b]=(0,h/* .useControlledValue */.j)(m,// initialMonth is always computed from props.month if provided
e.month?m:undefined);// biome-ignore lint/correctness/useExhaustiveDependencies: change the initial month when the time zone changes.
(0,r.useEffect)(()=>{const r=(0,s/* .getInitialMonth */.Z)(e,n,v,t);b(r)},[e.timeZone]);/** The months displayed in the calendar. */// biome-ignore lint/correctness/useExhaustiveDependencies: We want to recompute only when specific props change.
const{months:y,weeks:w,days:A,previousMonth:Y,nextMonth:k}=(0,r.useMemo)(()=>{const r=(0,o/* .getDisplayMonths */.o)(_,v,{numberOfMonths:e.numberOfMonths},t);const s=(0,i/* .getDates */.Y)(r,e.endMonth?g(e.endMonth):undefined,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t);const u=(0,l/* .getMonths */.S)(r,s,{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t);const h=(0,p/* .getWeeks */.C)(u);const f=(0,a/* .getDays */._)(u);const m=(0,c/* .getPreviousMonth */.E)(_,n,e,t);const b=(0,d/* .getNextMonth */.Q)(_,v,e,t);return{months:u,weeks:h,days:f,previousMonth:m,nextMonth:b}},[t,_.getTime(),v?.getTime(),n?.getTime(),e.disableNavigation,e.broadcastCalendar,e.endMonth?.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]);const{disableNavigation:I,onMonthChange:q}=e;const C=e=>w.some(t=>t.days.some(t=>t.isEqualTo(e)));const D=e=>{if(I){return}let t=f(e);// if month is before start, use the first month instead
if(n&&t<f(n)){t=f(n)}// if month is after endMonth, use the last month instead
if(v&&t>f(v)){t=f(v)}b(t);q?.(t)};const E=e=>{// is this check necessary?
if(C(e)){return}D(e.date)};const S={months:y,weeks:w,days:A,navStart:n,navEnd:v,previousMonth:Y,nextMonth:k,goToMonth:D,goToDay:E};return S}},79209:function(e,t,n){n.d(t,{S:()=>i,w:()=>a});/* import */var r=n(41594);/** @ignore */const i=(0,r.createContext)(undefined);/**
 * Provides access to the DayPicker context, which includes properties and
 * methods to interact with the DayPicker component. This hook must be used
 * within a custom component.
 *
 * @template T - Use this type to refine the returned context type with a
 *   specific selection mode.
 * @returns The context to work with DayPicker.
 * @throws {Error} If the hook is used outside of a DayPicker provider.
 * @group Hooks
 * @see https://daypicker.dev/guides/custom-components
 */function a(){const e=(0,r.useContext)(i);if(e===undefined){throw new Error("useDayPicker() must be used within a custom component.")}return e}},83237:function(e,t,n){n.d(t,{i:()=>o});/* import */var r=n(41594);/* import */var i=n(83803);/* import */var a=n(44917);/**
 * Manages focus behavior for the DayPicker component, including setting,
 * moving, and blurring focus on calendar days.
 *
 * @template T - The type of DayPicker props.
 * @param props - The DayPicker props.
 * @param calendar - The calendar object containing the displayed days and
 *   months.
 * @param getModifiers - A function to retrieve modifiers for a given day.
 * @param isSelected - A function to check if a date is selected.
 * @param dateLib - The date utility library instance.
 * @returns An object containing focus-related methods and the currently focused
 *   day.
 */function o(e,t,n,o,s){const{autoFocus:l}=e;const[u,d]=(0,r.useState)();const c=(0,i/* .calculateFocusTarget */.A)(t.days,n,o||(()=>false),u);const[p,h]=(0,r.useState)(l?c:undefined);const v=()=>{d(p);h(undefined)};const f=(n,r)=>{if(!p)return;const i=(0,a/* .getNextFocus */.O)(n,r,p,t.navStart,t.navEnd,e,s);if(!i)return;if(e.disableNavigation){const e=t.days.some(e=>e.isEqualTo(i));if(!e){return}}t.goToDay(i);h(i)};const g=e=>{return Boolean(c?.isEqualTo(e))};const m={isFocusTarget:g,setFocused:h,focused:p,blur:v,moveFocus:f};return m}},35055:function(e,t,n){n.d(t,{C:()=>o});/* import */var r=n(79479);/* import */var i=n(95379);/* import */var a=n(12764);/**
 * Determines the appropriate selection hook to use based on the selection mode
 * and returns the corresponding selection object.
 *
 * @template T - The type of DayPicker props.
 * @param props - The DayPicker props.
 * @param dateLib - The date utility library instance.
 * @returns The selection object for the specified mode, or `undefined` if no
 *   mode is set.
 */function o(e,t){const n=(0,a/* .useSingle */.G)(e,t);const o=(0,r/* .useMulti */.N)(e,t);const s=(0,i/* .useRange */.f)(e,t);switch(e.mode){case"single":return n;case"multiple":return o;case"range":return s;default:return undefined}}},75749:function(e,t,n){n.d(t,{M:()=>i});/* import */var r=n(30922);/**
 * Adds a date to an existing range, considering constraints like minimum and
 * maximum range size.
 *
 * @param date - The date to add to the range.
 * @param initialRange - The initial range to which the date will be added.
 * @param min - The minimum number of days in the range.
 * @param max - The maximum number of days in the range.
 * @param required - Whether the range must always include at least one date.
 * @param dateLib - The date utility library instance.
 * @returns The updated date range, or `undefined` if the range is cleared.
 * @group Utilities
 */function i(e,t,n=0,a=0,o=false,s=r/* .defaultDateLib */.VA){const{from:l,to:u}=t||{};const{isSameDay:d,isAfter:c,isBefore:p}=s;let h;if(!l&&!u){// the range is empty, add the date
h={from:e,to:n>0?undefined:e}}else if(l&&!u){// adding date to an incomplete range
if(d(l,e)){// adding a date equal to the start of the range
if(n===0){h={from:l,to:e}}else if(o){h={from:l,to:undefined}}else{h=undefined}}else if(p(e,l)){// adding a date before the start of the range
h={from:e,to:l}}else{// adding a date after the start of the range
h={from:l,to:e}}}else if(l&&u){// adding date to a complete range
if(d(l,e)&&d(u,e)){// adding a date that is equal to both start and end of the range
if(o){h={from:l,to:u}}else{h=undefined}}else if(d(l,e)){// adding a date equal to the the start of the range
h={from:l,to:n>0?undefined:e}}else if(d(u,e)){// adding a dare equal to the end of the range
h={from:e,to:n>0?undefined:e}}else if(p(e,l)){// adding a date before the start of the range
h={from:e,to:u}}else if(c(e,l)){// adding a date after the start of the range
h={from:l,to:e}}else if(c(e,u)){// adding a date after the end of the range
h={from:l,to:e}}else{throw new Error("Invalid range")}}// check for min / max
if(h?.from&&h?.to){const t=s.differenceInCalendarDays(h.to,h.from);if(a>0&&t>a){h={from:e,to:undefined}}else if(n>1&&t<n){h={from:e,to:undefined}}}return h}},13854:function(e,t,n){n.d(t,{t:()=>o});/* import */var r=n(14916);/* import */var i=n(45636);function a(e,t){if(typeof e==="boolean"||typeof e==="function"){return e}if(e instanceof Date){return(0,r/* .toTimeZone */.v)(e,t)}if(Array.isArray(e)){return e.map(e=>e instanceof Date?(0,r/* .toTimeZone */.v)(e,t):e)}if((0,i/* .isDateRange */.oM)(e)){return{...e,from:e.from?(0,r/* .toTimeZone */.v)(e.from,t):e.from,to:e.to?(0,r/* .toTimeZone */.v)(e.to,t):e.to}}if((0,i/* .isDateInterval */.m4)(e)){return{before:(0,r/* .toTimeZone */.v)(e.before,t),after:(0,r/* .toTimeZone */.v)(e.after,t)}}if((0,i/* .isDateAfterType */.RE)(e)){return{after:(0,r/* .toTimeZone */.v)(e.after,t)}}if((0,i/* .isDateBeforeType */.Ue)(e)){return{before:(0,r/* .toTimeZone */.v)(e.before,t)}}return e}/**
 * Convert any {@link Matcher} or array of matchers to the specified time zone.
 *
 * @param matchers - The matcher or matchers to convert.
 * @param timeZone - The target IANA time zone.
 * @returns The converted matcher(s).
 * @group Utilities
 */function o(e,t){if(!e){return e}if(Array.isArray(e)){return e.map(e=>a(e,t))}return a(e,t)}},9723:function(e,t,n){n.d(t,{k:()=>o});/* import */var r=n(30922);/* import */var i=n(79796);/* import */var a=n(45636);/**
 * Checks if a given date matches at least one of the specified {@link Matcher}.
 *
 * @param date - The date to check.
 * @param matchers - The matchers to check against.
 * @param dateLib - The date utility library instance.
 * @returns `true` if the date matches any of the matchers, otherwise `false`.
 * @group Utilities
 */function o(e,t,n=r/* .defaultDateLib */.VA){const s=!Array.isArray(t)?[t]:t;const{isSameDay:l,differenceInCalendarDays:u,isAfter:d}=n;return s.some(t=>{if(typeof t==="boolean"){return t}if(n.isDate(t)){return l(e,t)}if((0,a/* .isDatesArray */.Hg)(t,n)){return t.includes(e)}if((0,a/* .isDateRange */.oM)(t)){return(0,i/* .rangeIncludesDate */.R)(t,e,false,n)}if((0,a/* .isDayOfWeekType */.OE)(t)){if(!Array.isArray(t.dayOfWeek)){return t.dayOfWeek===e.getDay()}return t.dayOfWeek.includes(e.getDay())}if((0,a/* .isDateInterval */.m4)(t)){const n=u(t.before,e);const r=u(t.after,e);const i=n>0;const a=r<0;const o=d(t.before,t.after);if(o){return a&&i}else{return i||a}}if((0,a/* .isDateAfterType */.RE)(t)){return u(e,t.after)>0}if((0,a/* .isDateBeforeType */.Ue)(t)){return u(t.before,e)>0}if(typeof t==="function"){return t(e)}return false})}/**
 * @private
 * @deprecated Use {@link dateMatchModifiers} instead.
 */const s=/* unused pure expression or super */null&&o},46413:function(e,t,n){n.d(t,{g:()=>i});/* import */var r=n(30922);/**
 * Checks if a date range contains one or more specified days of the week.
 *
 * @since 9.2.2
 * @param range - The date range to check.
 * @param dayOfWeek - The day(s) of the week to check for (`0-6`, where `0` is
 *   Sunday).
 * @param dateLib - The date utility library instance.
 * @returns `true` if the range contains the specified day(s) of the week,
 *   otherwise `false`.
 * @group Utilities
 */function i(e,t,n=r/* .defaultDateLib */.VA){const a=!Array.isArray(t)?[t]:t;let o=e.from;const s=n.differenceInCalendarDays(e.to,e.from);// iterate at maximum one week or the total days if the range is shorter than one week
const l=Math.min(s,6);for(let e=0;e<=l;e++){if(a.includes(o.getDay())){return true}o=n.addDays(o,1)}return false}},85052:function(e,t,n){n.d(t,{P:()=>u});/* import */var r=n(30922);/* import */var i=n(9723);/* import */var a=n(46413);/* import */var o=n(79796);/* import */var s=n(39965);/* import */var l=n(45636);/**
 * Checks if a date range contains dates that match the given modifiers.
 *
 * @since 9.2.2
 * @param range - The date range to check.
 * @param modifiers - The modifiers to match against.
 * @param dateLib - The date utility library instance.
 * @returns `true` if the range contains matching dates, otherwise `false`.
 * @group Utilities
 */function u(e,t,n=r/* .defaultDateLib */.VA){const d=Array.isArray(t)?t:[t];// Defer function matchers evaluation as they are the least performant.
const c=d.filter(e=>typeof e!=="function");const p=c.some(t=>{if(typeof t==="boolean")return t;if(n.isDate(t)){return(0,o/* .rangeIncludesDate */.R)(e,t,false,n)}if((0,l/* .isDatesArray */.Hg)(t,n)){return t.some(t=>(0,o/* .rangeIncludesDate */.R)(e,t,false,n))}if((0,l/* .isDateRange */.oM)(t)){if(t.from&&t.to){return(0,s/* .rangeOverlaps */.G)(e,{from:t.from,to:t.to},n)}return false}if((0,l/* .isDayOfWeekType */.OE)(t)){return(0,a/* .rangeContainsDayOfWeek */.g)(e,t.dayOfWeek,n)}if((0,l/* .isDateInterval */.m4)(t)){const r=n.isAfter(t.before,t.after);if(r){return(0,s/* .rangeOverlaps */.G)(e,{from:n.addDays(t.after,1),to:n.addDays(t.before,-1)},n)}return(0,i/* .dateMatchModifiers */.k)(e.from,t,n)||(0,i/* .dateMatchModifiers */.k)(e.to,t,n)}if((0,l/* .isDateAfterType */.RE)(t)||(0,l/* .isDateBeforeType */.Ue)(t)){return(0,i/* .dateMatchModifiers */.k)(e.from,t,n)||(0,i/* .dateMatchModifiers */.k)(e.to,t,n)}return false});if(p){return true}const h=d.filter(e=>typeof e==="function");if(h.length){let t=e.from;const r=n.differenceInCalendarDays(e.to,e.from);for(let e=0;e<=r;e++){if(h.some(e=>e(t))){return true}t=n.addDays(t,1)}}return false}},79796:function(e,t,n){n.d(t,{R:()=>i});/* import */var r=n(30922);/**
 * Checks if a given date is within a specified date range.
 *
 * @since 9.0.0
 * @param range - The date range to check against.
 * @param date - The date to check.
 * @param excludeEnds - If `true`, the range's start and end dates are excluded.
 * @param dateLib - The date utility library instance.
 * @returns `true` if the date is within the range, otherwise `false`.
 * @group Utilities
 */function i(e,t,n=false,a=r/* .defaultDateLib */.VA){let{from:o,to:s}=e;const{differenceInCalendarDays:l,isSameDay:u}=a;if(o&&s){const e=l(s,o)<0;if(e){[o,s]=[s,o]}const r=l(t,o)>=(n?1:0)&&l(s,t)>=(n?1:0);return r}if(!n&&s){return u(s,t)}if(!n&&o){return u(o,t)}return false}/**
 * @private
 * @deprecated Use {@link rangeIncludesDate} instead.
 */const a=(e,t)=>i(e,t,false,defaultDateLib)},39965:function(e,t,n){n.d(t,{G:()=>a});/* import */var r=n(30922);/* import */var i=n(79796);/**
 * Determines if two date ranges overlap.
 *
 * @since 9.2.2
 * @param rangeLeft - The first date range.
 * @param rangeRight - The second date range.
 * @param dateLib - The date utility library instance.
 * @returns `true` if the ranges overlap, otherwise `false`.
 * @group Utilities
 */function a(e,t,n=r/* .defaultDateLib */.VA){return(0,i/* .rangeIncludesDate */.R)(e,t.from,false,n)||(0,i/* .rangeIncludesDate */.R)(e,t.to,false,n)||(0,i/* .rangeIncludesDate */.R)(t,e.from,false,n)||(0,i/* .rangeIncludesDate */.R)(t,e.to,false,n)}},14916:function(e,t,n){n.d(t,{v:()=>i});/* import */var r=n(2832);/**
 * Convert a {@link Date} or {@link TZDate} instance to the given time zone.
 * Reuses the same instance when it is already a {@link TZDate} using the target
 * time zone to avoid extra allocations.
 */function i(e,t){if(e instanceof r/* .TZDate */.BB&&e.timeZone===t){return e}return new r/* .TZDate */.BB(e,t)}},45636:function(e,t,n){n.d(t,{Hg:()=>l,OE:()=>s,RE:()=>a,Ue:()=>o,m4:()=>r,oM:()=>i});/**
 * Checks if the given value is of type {@link DateInterval}.
 *
 * @param matcher - The value to check.
 * @returns `true` if the value is a {@link DateInterval}, otherwise `false`.
 * @group Utilities
 */function r(e){return Boolean(e&&typeof e==="object"&&"before"in e&&"after"in e)}/**
 * Checks if the given value is of type {@link DateRange}.
 *
 * @param value - The value to check.
 * @returns `true` if the value is a {@link DateRange}, otherwise `false`.
 * @group Utilities
 */function i(e){return Boolean(e&&typeof e==="object"&&"from"in e)}/**
 * Checks if the given value is of type {@link DateAfter}.
 *
 * @param value - The value to check.
 * @returns `true` if the value is a {@link DateAfter}, otherwise `false`.
 * @group Utilities
 */function a(e){return Boolean(e&&typeof e==="object"&&"after"in e)}/**
 * Checks if the given value is of type {@link DateBefore}.
 *
 * @param value - The value to check.
 * @returns `true` if the value is a {@link DateBefore}, otherwise `false`.
 * @group Utilities
 */function o(e){return Boolean(e&&typeof e==="object"&&"before"in e)}/**
 * Checks if the given value is of type {@link DayOfWeek}.
 *
 * @param value - The value to check.
 * @returns `true` if the value is a {@link DayOfWeek}, otherwise `false`.
 * @group Utilities
 */function s(e){return Boolean(e&&typeof e==="object"&&"dayOfWeek"in e)}/**
 * Checks if the given value is an array of valid dates.
 *
 * @private
 * @param value - The value to check.
 * @param dateLib - The date utility library instance.
 * @returns `true` if the value is an array of valid dates, otherwise `false`.
 */function l(e,t){return Array.isArray(e)&&e.every(t.isDate)}}}]);