"use strict";(self["webpackChunktutor_pro"]=self["webpackChunktutor_pro"]||[]).push([["626"],{8906:function(e,r,t){t.d(r,{A:()=>m});/* ESM import */var n=t(7584);/* ESM import */var i=t(408);/* ESM import */var a=t(3747);/* ESM import */var o=t(9185);/* ESM import */var c=t(1573);/* ESM import */var l=t(3494);/* ESM import */var s=t(6277);/* ESM import */var d=t(5781);/* ESM import */var u=t(4532);/* ESM import */var v=t(1817);/* ESM import */var p=t(6783);/* ESM import */var h=t(1699);/* ESM import */var f=t(2470);/* ESM import */var g=/*#__PURE__*/t.n(f);/* ESM import */var b=t(3937);/* ESM import */var A=t(7767);var x=e=>{var{styleModifier:r}=e;var{steps:t,setSteps:g}=(0,c/* .useBundleNavigator */.h)();var x=(0,A/* .useNavigate */.Zp)();var m=(0,p/* .useCurrentPath */.G)(o/* ["default"] */.A);var w=(0,b/* .useFormContext */.xW)();var Y=t.findIndex(e=>e.path===m);var I=Math.max(-1,Y-1);var k=Math.min(t.length,Y+1);var _=t[I];var M=t[k];var D=w.watch("post_title");var C=()=>{g(e=>{return e.map((e,r)=>{if(r===Y){return(0,i._)((0,n._)({},e),{isActive:false})}if(r===I){return(0,i._)((0,n._)({},e),{isActive:true})}return e})});x(_.path)};var H=()=>{g(e=>{return e.map((e,r)=>{if(r===Y){return(0,i._)((0,n._)({},e),{isActive:false})}if(r===k){return(0,i._)((0,n._)({},e),{isActive:true})}return e})});x(M.path)};return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:[y.wrapper,r],children:[/*#__PURE__*/(0,a/* .jsx */.Y)(v/* ["default"] */.A,{when:Y>0,children:/*#__PURE__*/(0,a/* .jsx */.Y)(l/* ["default"] */.A,{variant:"tertiary",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(s/* ["default"] */.A,{name:!d/* .isRTL */.V8?"chevronLeft":"chevronRight",height:24,width:24}),iconPosition:"left",size:"small",onClick:C,buttonCss:/*#__PURE__*/(0,h/* .css */.AH)("padding:",u/* .spacing["4"] */.YK["4"]," ",u/* .spacing["12"] */.YK["12"]," ",u/* .spacing["4"] */.YK["4"]," ",u/* .spacing["4"] */.YK["4"],";svg{color:",u/* .colorTokens.icon["default"] */.I6.icon["default"],";}"),disabled:I<0,children:(0,f.__)("Back","tutor-pro")})}),/*#__PURE__*/(0,a/* .jsx */.Y)(v/* ["default"] */.A,{when:Y<t.length-1&&D,children:/*#__PURE__*/(0,a/* .jsx */.Y)(l/* ["default"] */.A,{variant:"tertiary",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(s/* ["default"] */.A,{name:!d/* .isRTL */.V8?"chevronRight":"chevronLeft",height:24,width:24}),iconPosition:"right",size:"small",onClick:H,buttonCss:/*#__PURE__*/(0,h/* .css */.AH)("padding:",u/* .spacing["4"] */.YK["4"]," ",u/* .spacing["4"] */.YK["4"]," ",u/* .spacing["4"] */.YK["4"]," ",u/* .spacing["12"] */.YK["12"],";svg{color:",u/* .colorTokens.icon["default"] */.I6.icon["default"],";}"),disabled:!D||k>=t.length,children:(0,f.__)("Next","tutor-pro")})})]})};/* ESM default export */const m=x;var y={wrapper:/*#__PURE__*/(0,h/* .css */.AH)("width:100%;display:flex;justify-content:end;height:32px;align-items:center;gap:",u/* .spacing["16"] */.YK["16"],";")}},8872:function(e,r,t){// ESM COMPAT FLAG
t.r(r);// EXPORTS
t.d(r,{"default":()=>/* binding */ep});// EXTERNAL MODULE: ./node_modules/@swc/helpers/esm/_object_spread.js + 1 modules
var n=t(7584);// EXTERNAL MODULE: ./node_modules/@swc/helpers/esm/_object_spread_props.js
var i=t(408);// EXTERNAL MODULE: ./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.esm.js
var a=t(3747);// EXTERNAL MODULE: ./node_modules/@emotion/react/dist/emotion-react.esm.js
var o=t(1699);// EXTERNAL MODULE: ./node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.js
var c=t(241);// EXTERNAL MODULE: ./node_modules/@tanstack/react-query/build/legacy/useIsFetching.js
var l=t(9272);// EXTERNAL MODULE: external "wp.i18n"
var s=t(2470);// EXTERNAL MODULE: ./node_modules/react-hook-form/dist/index.esm.mjs
var d=t(3937);// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/atoms/Box.tsx
var u=t(6847);// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/atoms/LoadingSpinner.tsx
var v=t(8589);// EXTERNAL MODULE: ./node_modules/@swc/helpers/esm/_tagged_template_literal.js
var p=t(9785);// EXTERNAL MODULE: ./node_modules/react-router/dist/index.js
var h=t(7767);// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/atoms/Button.tsx
var f=t(3494);// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/atoms/SVGIcon.tsx
var g=t(6277);// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/config/constants.ts
var b=t(5781);// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/config/styles.ts
var A=t(4532);// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/config/typography.ts
var x=t(6439);// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/controls/Show.tsx
var m=t(1817);// CONCATENATED MODULE: ./addons/course-bundle/assets/react/bundle-builder/components/layouts/CanvasHead.tsx
function y(){var e=(0,p._)(["\n      transform: rotate(180deg);\n    "]);y=function r(){return e};return e}var w=e=>{var{title:r,backUrl:t,rightButton:n,isExternalUrl:i}=e;var o=(0,h/* .useNavigate */.Zp)();var c=()=>{if(t){if(i){window.location.href=t;return}o(t)}else{o(-1)}};return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:I.wrapper,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:I.left,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{when:t,children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{isIconOnly:true,size:"small",variant:"text","aria-label":(0,s.__)("Back","tutor-pro"),buttonCss:I.button({isRTL:b/* .isRTL */.V8}),onClick:c,icon:/*#__PURE__*/(0,a/* .jsx */.Y)(g/* ["default"] */.A,{name:"back",width:32,height:32})})}),/*#__PURE__*/(0,a/* .jsx */.Y)("h6",{css:I.title,children:r})]}),n]})};/* ESM default export */const Y=w;var I={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:",A/* .spacing["16"] */.YK["16"],";"),button:e=>{var{isRTL:r}=e;return/*#__PURE__*/(0,o/* .css */.AH)("padding:0;border-radius:",A/* .borderRadius["2"] */.Vq["2"],";",r&&(0,o/* .css */.AH)(y()))},title:/*#__PURE__*/(0,o/* .css */.AH)(x/* .typography.heading6 */.I.heading6("medium"),";")};// EXTERNAL MODULE: ./addons/course-bundle/assets/react/bundle-builder/components/layouts/Navigator.tsx
var k=t(8906);// EXTERNAL MODULE: ./addons/course-bundle/assets/react/bundle-builder/utils/utils.ts
var _=t(2621);// EXTERNAL MODULE: ../tutor/node_modules/@swc/helpers/esm/_tagged_template_literal.js
var M=t(6154);// EXTERNAL MODULE: external "React"
var D=t(1594);// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/atoms/Tooltip.tsx + 56 modules
var C=t(9773);// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/utils/style-utils.ts
var H=t(6014);// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/molecules/Tabs.tsx
function N(){var e=(0,M._)(["\n      flex-direction: column;\n      align-items: start;\n      box-shadow: none;\n    "]);N=function r(){return e};return e}function j(){var e=(0,M._)(["\n      width: 3px;\n      height: ","px;\n      top: ","px;\n      bottom: auto;\n      border-radius: 0 "," "," 0;\n    "]);j=function r(){return e};return e}function T(){var e=(0,M._)(["\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    "]);T=function r(){return e};return e}function z(){var e=(0,M._)(["\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    "]);z=function r(){return e};return e}var E=e=>{var{activeTab:r,onChange:t,tabList:n,orientation:i="horizontal",disabled:o=false,wrapperCss:c}=e;var l=(0,D.useRef)(n.map(()=>/*#__PURE__*/(0,D.createRef)()));var[s,d]=(0,D.useState)();(0,D.useEffect)(()=>{var e=n.reduce((e,r,t)=>{var n,i,a,o;var c=l.current[t];var s={width:((n=c.current)===null||n===void 0?void 0:n.offsetWidth)||0,height:((i=c.current)===null||i===void 0?void 0:i.offsetHeight)||0,left:((a=c.current)===null||a===void 0?void 0:a.offsetLeft)||0,top:((o=c.current)===null||o===void 0?void 0:o.offsetTop)||0};e[r.value]=s;return e},{});d(e)},[n]);return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:O.container,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:[O.wrapper(i),c],role:"tablist",children:n.map((e,n)=>{return/*#__PURE__*/(0,a/* .jsxs */.FD)("button",{onClick:()=>{t(e.value)},css:O.tabButton({isActive:r===e.value,orientation:i}),disabled:o||e.disabled,type:"button",role:"tab","aria-selected":r===e.value?"true":"false",ref:l.current[n],children:[e.icon,e.label,e.count!==undefined&&/*#__PURE__*/(0,a/* .jsxs */.FD)("span",{children:[" (",e.count<10&&e.count>0?"0".concat(e.count):e.count,")"]}),e.activeBadge&&/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:O.activeBadge})]},n)})}),/*#__PURE__*/(0,a/* .jsx */.Y)("span",{css:O.indicator((s===null||s===void 0?void 0:s[r])||{width:0,height:0,left:0,top:0},i)})]})};/* ESM default export */const K=E;var O={container:/*#__PURE__*/(0,o/* .css */.AH)("position:relative;width:100%;"),wrapper:e=>/*#__PURE__*/(0,o/* .css */.AH)("width:100%;display:flex;justify-items:left;align-items:center;flex-wrap:wrap;box-shadow:",A/* .shadow.tabs */.r7.tabs,";",e==="vertical"&&(0,o/* .css */.AH)(N())),indicator:(e,r)=>/*#__PURE__*/(0,o/* .css */.AH)("width:",e.width,"px;height:3px;position:absolute;left:",e.left,"px;bottom:0;background:",A/* .colorTokens.brand.blue */.I6.brand.blue,";border-radius:",A/* .borderRadius["4"] */.Vq["4"]," ",A/* .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;}",r==="vertical"&&(0,o/* .css */.AH)(j(),e.height,e.top,A/* .borderRadius["4"] */.Vq["4"],A/* .borderRadius["4"] */.Vq["4"])),tabButton:e=>{var{isActive:r,orientation:t}=e;return/*#__PURE__*/(0,o/* .css */.AH)(H/* .styleUtils.resetButton */.x.resetButton,";font-size:",A/* .fontSize["15"] */.J["15"],";line-height:",A/* .lineHeight["20"] */.K_["20"],";display:flex;justify-content:center;align-items:center;gap:",A/* .spacing["6"] */.YK["6"],";padding:",A/* .spacing["12"] */.YK["12"]," ",A/* .spacing["20"] */.YK["20"],";color:",A/* .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:",A/* .colorTokens.text.subdued */.I6.text.subdued,";box-shadow:none;}& > svg{color:",A/* .colorTokens.icon["default"] */.I6.icon["default"],";}",t==="vertical"&&(0,o/* .css */.AH)(T(),A/* .colorTokens.stroke.border */.I6.stroke.border,A/* .colorTokens.stroke.border */.I6.stroke.border)," ",r&&(0,o/* .css */.AH)(z(),A/* .colorTokens.background.white */.I6.background.white,A/* .colorTokens.text.primary */.I6.text.primary,A/* .colorTokens.text.subdued */.I6.text.subdued,A/* .colorTokens.icon.brand */.I6.icon.brand),"    &:disabled{color:",A/* .colorTokens.text.disable */.I6.text.disable,";&::before{background:",A/* .colorTokens.text.disable */.I6.text.disable,";}}&:focus-visible{outline:2px solid ",A/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:-2px;border-radius:",A/* .borderRadius["4"] */.Vq["4"],";}")},activeBadge:/*#__PURE__*/(0,o/* .css */.AH)("display:inline-block;height:8px;width:8px;border-radius:",A/* .borderRadius.circle */.Vq.circle,";background-color:",A/* .colorTokens.color.success["80"] */.I6.color.success["80"],";")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/modals/CertificatePreviewModal.tsx
var L=e=>{var{certificates:r,selectedCertificate:t,currentCertificate:n,onSelectCertificate:i,closeModal:o}=e;var[c,l]=(0,D.useState)(t);var[d,u]=(0,D.useState)(n);var v=(0,D.useRef)(null);var p=r.findIndex(e=>e.key===d.key);var h=Math.max(-1,p-1);var A=Math.min(r.length,p+1);(0,D.useEffect)(()=>{var e=e=>{if(e.key==="ArrowLeft"){y("previous")}else if(e.key==="ArrowRight"){y("next")}else if(e.key==="Enter"){x(d)}else if(e.key==="Escape"){o({action:"CLOSE"})}};window.addEventListener("keydown",e);return()=>{window.removeEventListener("keydown",e)};// eslint-disable-next-line react-hooks/exhaustive-deps
},[p,r]);(0,D.useEffect)(()=>{if(v.current){v.current.focus()}},[]);var x=e=>{if(e.key===c){return}i(e);l(e.key)};var y=e=>{if(e==="previous"&&p>0){u(r[h])}else if(e==="next"&&p<r.length-1){u(r[A])}};return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:S.container,children:[d&&/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:S.content,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:S.certificateAndActions,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("img",{css:S.certificate,src:d.preview_src,alt:d.name}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:S.actionsWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(C/* ["default"] */.A,{placement:"right",content:(0,s.__)("Close","tutor-pro"),children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{ref:v,type:"button",css:[S.actionButton,S.closeButton],onClick:()=>{o({action:"CLOSE"})},children:/*#__PURE__*/(0,a/* .jsx */.Y)(g/* ["default"] */.A,{name:"cross",width:40,height:40})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{when:d.edit_url,children:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(C/* ["default"] */.A,{placement:"right",content:(0,s.__)("Edit in Certificate Builder","tutor-pro"),children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:[S.actionButton,S.editButton],onClick:()=>{window.open(e,"_blank","noopener")},children:/*#__PURE__*/(0,a/* .jsx */.Y)(g/* ["default"] */.A,{name:"edit",width:40,height:40})})})})]})]})}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:S.navigatorWrapper,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:S.navigator,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:[S.actionButton,S.navigatorButton],onClick:()=>y("previous"),disabled:h<0,children:/*#__PURE__*/(0,a/* .jsx */.Y)(g/* ["default"] */.A,{name:!b/* .isRTL */.V8?"chevronLeft":"chevronRight",width:40,height:40})}),/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"primary",onClick:()=>{x(d);o({action:"CONFIRM"})},disabled:c===d.key,children:c===d.key?(0,s.__)("Selected","tutor-pro"):(0,s.__)("Select","tutor-pro")}),/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:[S.actionButton,S.navigatorButton],onClick:()=>y("next"),disabled:A>r.length-1,children:/*#__PURE__*/(0,a/* .jsx */.Y)(g/* ["default"] */.A,{name:!b/* .isRTL */.V8?"chevronRight":"chevronLeft",width:40,height:40})})]})})]})};/* ESM default export */const F=L;var S={container:/*#__PURE__*/(0,o/* .css */.AH)("width:100%;height:100%;",H/* .styleUtils.display.flex */.x.display.flex("column"),";justify-content:center;align-items:center;gap:",A/* .spacing["16"] */.YK["16"],";position:relative;"),content:/*#__PURE__*/(0,o/* .css */.AH)(H/* .styleUtils.display.flex */.x.display.flex("column"),";justify-content:center;align-items:center;object-fit:contain;max-width:80vw;max-height:calc(100vh - 200px);width:100%;height:100%;"),certificateAndActions:/*#__PURE__*/(0,o/* .css */.AH)("position:relative;",H/* .styleUtils.display.flex */.x.display.flex(),";justify-content:center;align-items:center;gap:",A/* .spacing["20"] */.YK["20"],";height:100%;"),certificate:/*#__PURE__*/(0,o/* .css */.AH)("width:100%;height:100%;object-fit:contain;"),actionsWrapper:/*#__PURE__*/(0,o/* .css */.AH)("position:absolute;top:0;right:-",A/* .spacing["56"] */.YK["56"],";bottom:0;",H/* .styleUtils.display.flex */.x.display.flex("column"),";justify-content:space-between;",A/* .Breakpoint.smallMobile */.EA.smallMobile,"{right:-",A/* .spacing["32"] */.YK["32"],";}"),actionButton:/*#__PURE__*/(0,o/* .css */.AH)("place-self:center start;",H/* .styleUtils.resetButton */.x.resetButton,";display:inline-flex;align-items:center;justify-content:center;&:focus,&:active,&:hover{background:none;}svg{color:",A/* .colorTokens.action.secondary["default"] */.I6.action.secondary["default"],";transition:color 0.3s ease-in-out;}"),closeButton:/*#__PURE__*/(0,o/* .css */.AH)("place-self:center start;"),editButton:/*#__PURE__*/(0,o/* .css */.AH)("place-self:center end;"),navigatorWrapper:/*#__PURE__*/(0,o/* .css */.AH)(),navigator:/*#__PURE__*/(0,o/* .css */.AH)(H/* .styleUtils.display.flex */.x.display.flex(),";gap:",A/* .spacing["16"] */.YK["16"],";justify-content:center;background:",A/* .colorTokens.background.white */.I6.background.white,";padding:",A/* .spacing["12"] */.YK["12"],";border-radius:",A/* .borderRadius["8"] */.Vq["8"],";"),navigatorButton:/*#__PURE__*/(0,o/* .css */.AH)("svg{color:",A/* .colorTokens.icon["default"] */.I6.icon["default"],";}:disabled{cursor:not-allowed;svg{color:",A/* .colorTokens.icon.hints */.I6.icon.hints,";}}")};// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/components/modals/Modal.tsx
var Q=t(7316);// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/config/config.ts
var B=t(9568);// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/controls/For.tsx
var U=t(3313);// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/utils/util.ts + 4 modules
var R=t(6208);// CONCATENATED MODULE: ../tutor/assets/react/v3/public/images/not-found-2x.webp
const V=t.p+"images/not-found-2x-5f9812df.webp";// CONCATENATED MODULE: ../tutor/assets/react/v3/public/images/not-found.webp
const W=t.p+"images/not-found-4fa6c9c0.webp";// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/certificate/CertificateCard.tsx
function q(){var e=(0,M._)(["\n      [data-overlay] {\n        background: ",";\n        opacity: 0.1;\n      }\n    "]);q=function r(){return e};return e}var P=e=>{var{selectedCertificate:r="",data:t,orientation:n,onSelectCertificate:i,onPreviewCertificate:o}=e;return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:Z.wrapper({isSelected:r===t.key,isLandScape:n==="landscape"}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{"data-overlay":true,onClick:()=>i(t.key),onKeyDown:e=>{if(e.key==="Enter"||e.key===" "){i(t.key)}}}),/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{when:t.preview_src,fallback:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:Z.emptyCard,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(g/* ["default"] */.A,{name:"outlineNone",width:49,height:49}),/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:(0,s.__)("None","tutor-pro")})]}),children:e=>{return/*#__PURE__*/(0,a/* .jsx */.Y)("img",{css:Z.certificateImage,src:e,alt:t.name})}}),/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{when:t.preview_src||t.key!==r,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{"data-footer-actions":true,css:Z.footerWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{when:t.preview_src,children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"secondary",isOutlined:true,size:"small",onClick:()=>o(t),children:(0,s.__)("Preview","tutor-pro")})}),/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{when:t.key!==r,children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{variant:"primary",size:"small",onClick:()=>i(t.key),children:(0,s.__)("Select","tutor-pro")})})]})}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:Z.checkIcon({isSelected:r===t.key}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(g/* ["default"] */.A,{name:"checkFilledWhite",width:32,height:32})})]})};/* ESM default export */const G=P;var Z={wrapper:e=>{var{isSelected:r=false,isLandScape:t=false}=e;return/*#__PURE__*/(0,o/* .css */.AH)(H/* .styleUtils.centeredFlex */.x.centeredFlex,";background-color:",A/* .colorTokens.surface.courseBuilder */.I6.surface.courseBuilder,";max-height:",t?"154px":"217px",";min-height:",t?"154px":"217px",";height:100%;position:relative;outline:",r?"2px":"1px"," solid ",r?A/* .colorTokens.stroke.brand */.I6.stroke.brand:A/* .colorTokens.stroke["default"] */.I6.stroke["default"],";border-radius:",A/* .borderRadius.card */.Vq.card,";transition:all 0.15s ease-in-out;[data-overlay]{position:absolute;top:0;left:0;right:0;bottom:0;border-radius:",A/* .borderRadius.card */.Vq.card,";}",r&&(0,o/* .css */.AH)(q(),A/* .colorTokens.brand.blue */.I6.brand.blue),"    &:hover,&:focus-within{border-color:",A/* .colorTokens.stroke.brand */.I6.stroke.brand,";[data-footer-actions]{opacity:1;}[data-overlay]{background:",A/* .colorTokens.brand.blue */.I6.brand.blue,";opacity:0.1;}}")},emptyCard:/*#__PURE__*/(0,o/* .css */.AH)(H/* .styleUtils.flexCenter */.x.flexCenter(),";flex-direction:column;height:100%;width:100%;gap:",A/* .spacing["8"] */.YK["8"],";",x/* .typography.caption */.I.caption("medium"),";svg{color:",A/* .colorTokens.color.black["20"] */.I6.color.black["20"],";}"),certificateImage:/*#__PURE__*/(0,o/* .css */.AH)("width:100%;height:100%;object-fit:contain;border-radius:",A/* .borderRadius.card */.Vq.card,";"),footerWrapper:/*#__PURE__*/(0,o/* .css */.AH)("opacity:0;position:absolute;left:0px;right:0px;bottom:0px;",H/* .styleUtils.flexCenter */.x.flexCenter(),";align-items:center;gap:",A/* .spacing["4"] */.YK["4"],";padding-block:",A/* .spacing["8"] */.YK["8"],";background:",A/* .colorTokens.bg.white */.I6.bg.white,";border-bottom-left-radius:",A/* .borderRadius.card */.Vq.card,";border-bottom-right-radius:",A/* .borderRadius.card */.Vq.card,";"),checkIcon:e=>{var{isSelected:r=false}=e;return/*#__PURE__*/(0,o/* .css */.AH)("opacity:",r?1:0,";position:absolute;top:-14px;right:-14px;border-bottom-left-radius:",A/* .borderRadius.card */.Vq.card,";svg{color:",A/* .colorTokens.icon.brand */.I6.icon.brand,";}")}};// CONCATENATED MODULE: ../tutor/assets/react/v3/public/images/pro-placeholders/certificates-2x.webp
const J=t.p+"images/certificates-2x-22b8cc4e.webp";// CONCATENATED MODULE: ../tutor/assets/react/v3/public/images/pro-placeholders/certificates.webp
const X=t.p+"images/certificates-4d7368cf.webp";// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/certificate/CertificateEmptyState.tsx
var $=!!B/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var ee=()=>{if($){return null}return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:et.emptyState,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("img",{css:et.placeholderImage,src:X,srcSet:"".concat(X," 1x, ").concat(J," 2x"),alt:(0,s.__)("Pro Placeholder","tutor-pro")}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:et.featureAndActionWrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("h5",{css:et.title,children:(0,s.__)("Award Students with Custom Certificates","tutor-pro")}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:et.featuresWithTitle,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{children:(0,s.__)("Celebrate success with personalized certificates. Recognize student achievements with unique designs that inspire and motivate students.","tutor-pro")}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:et.features,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:et.feature,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(g/* ["default"] */.A,{name:"materialCheck",width:20,height:20,style:et.checkIcon}),/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:(0,s.__)("Design personalized certificates that highlight their accomplishments and boost their confidence.","tutor-pro")})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:et.feature,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(g/* ["default"] */.A,{name:"materialCheck",width:20,height:20,style:et.checkIcon}),/*#__PURE__*/(0,a/* .jsx */.Y)("span",{children:(0,s.__)("Inspire them with a touch of credibility and recognition tailored just for them.","tutor-pro")})]})]})]})]}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:et.actionsButton,children:/*#__PURE__*/(0,a/* .jsx */.Y)(f/* ["default"] */.A,{as:"a",variant:"primary",icon:/*#__PURE__*/(0,a/* .jsx */.Y)(g/* ["default"] */.A,{name:"crown",width:24,height:24}),href:B/* ["default"].TUTOR_PRICING_PAGE */.A.TUTOR_PRICING_PAGE,target:"_blank",rel:"noreferrer",children:(0,s.__)("Get Tutor LMS Pro","tutor-pro")})})]})};/* ESM default export */const er=ee;var et={emptyState:/*#__PURE__*/(0,o/* .css */.AH)("padding-bottom:",A/* .spacing["12"] */.YK["12"],";",H/* .styleUtils.display.flex */.x.display.flex("column"),"    gap:",A/* .spacing["20"] */.YK["20"],";"),placeholderImage:e=>{var{notFound:r}=e;return/*#__PURE__*/(0,o/* .css */.AH)("max-width:100%;width:100%;height:",r?"189px":"312px;",";object-fit:cover;object-position:center;border-radius:",A/* .borderRadius["6"] */.Vq["6"],";")},featureAndActionWrapper:/*#__PURE__*/(0,o/* .css */.AH)(H/* .styleUtils.display.flex */.x.display.flex("column"),"    align-items:center;gap:",A/* .spacing["12"] */.YK["12"],";"),title:/*#__PURE__*/(0,o/* .css */.AH)(x/* .typography.heading5 */.I.heading5("medium"),"    color:",A/* .colorTokens.text.primary */.I6.text.primary,";"),featuresWithTitle:/*#__PURE__*/(0,o/* .css */.AH)(H/* .styleUtils.display.flex */.x.display.flex("column"),"    max-width:500px;width:100%;gap:",A/* .spacing["8"] */.YK["8"],";",x/* .typography.body */.I.body("regular"),";"),features:/*#__PURE__*/(0,o/* .css */.AH)(H/* .styleUtils.display.flex */.x.display.flex("column"),"    gap:",A/* .spacing["8"] */.YK["8"],";"),feature:/*#__PURE__*/(0,o/* .css */.AH)(H/* .styleUtils.display.flex */.x.display.flex(),"    gap:",A/* .spacing["12"] */.YK["12"],";color:",A/* .colorTokens.text.title */.I6.text.title,";text-wrap:pretty;"),checkIcon:/*#__PURE__*/(0,o/* .css */.AH)("flex-shrink:0;color:",A/* .colorTokens.text.success */.I6.text.success,";"),actionsButton:/*#__PURE__*/(0,o/* .css */.AH)(H/* .styleUtils.flexCenter */.x.flexCenter(),"    margin-top:",A/* .spacing["4"] */.YK["4"],";")};// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/components/certificate/Certificate.tsx
function en(){var e=(0,M._)(["\n      grid-template-columns: 1fr;\n      place-items: center;\n    "]);en=function r(){return e};return e}var ei=!!B/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var ea=(0,R/* .isAddonEnabled */.GR)(b/* .Addons.TUTOR_CERTIFICATE */.oW.TUTOR_CERTIFICATE);var eo=e=>{var{isSidebarVisible:r=true,currentCertificateKey:t,onSelect:n,certificateTemplates:i}=e;var c=i!==null&&i!==void 0?i:[];var l=c.filter(e=>e.is_default);var[d,u]=(0,D.useState)("templates");var[v,p]=(0,D.useState)("landscape");var[h,f]=(0,D.useState)(t);var{showModal:y}=(0,Q/* .useModal */.h)();var w=c.some(e=>e.orientation==="landscape"&&(d==="templates"?e.is_default:!e.is_default));var Y=c.some(e=>e.orientation==="portrait"&&(d==="templates"?e.is_default:!e.is_default));(0,D.useEffect)(()=>{if(c.length){if(l.length===0){u("custom_certificates")}var e=c.some(e=>e.orientation==="landscape");if(!e&&v==="landscape"){p("portrait")}}if(t==="none"){f(t);return}var r=c.find(e=>e.key===t);if(r){if(v!==r.orientation){p(r.orientation)}u(r.is_default?"templates":"custom_certificates");f(r.key)}// eslint-disable-next-line react-hooks/exhaustive-deps
},[t,c]);var I=c.filter(e=>e.orientation===v&&(d==="templates"?e===null||e===void 0?void 0:e.is_default:!(e===null||e===void 0?void 0:e.is_default)));var k=e=>{u(e);var r=c.some(r=>r.orientation==="landscape"&&(e==="templates"?r.is_default:!r.is_default));var t=c.some(r=>r.orientation==="portrait"&&(e==="templates"?r.is_default:!r.is_default));p(e=>{if(r&&t||!r&&!t){return e}return r?"landscape":"portrait"})};var _=e=>{p(e)};var M=e=>{n(e);f(e)};var N=e=>{y({component:F,props:{certificates:c,selectedCertificate:t,currentCertificate:e,onSelectCertificate:e=>{M(e.key)}}})};var j=[...l.length?[{label:(0,s.__)("Templates","tutor-pro"),value:"templates"}]:[],{label:b/* .CURRENT_VIEWPORT.isAboveSmallMobile */.vN.isAboveSmallMobile?(0,s.__)("Custom Certificates","tutor-pro"):(0,s.__)("Certificates","tutor-pro"),value:"custom_certificates"}];return/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{when:ei&&ea,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(er,{}),children:/*#__PURE__*/(0,a/* .jsxs */.FD)(m/* ["default"] */.A,{when:ea,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:el.tabs,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(K,{wrapperCss:el.tabsWrapper,tabList:j,activeTab:d,onChange:k}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:el.orientation,children:/*#__PURE__*/(0,a/* .jsxs */.FD)(m/* ["default"] */.A,{when:w&&Y,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(C/* ["default"] */.A,{delay:200,content:(0,s.__)("Landscape","tutor-pro"),children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:[H/* .styleUtils.resetButton */.x.resetButton,el.orientationButton({isActive:v==="landscape"})],onClick:()=>_("landscape"),children:/*#__PURE__*/(0,a/* .jsx */.Y)(g/* ["default"] */.A,{name:v==="landscape"?"landscapeFilled":"landscape",width:32,height:32})})}),/*#__PURE__*/(0,a/* .jsx */.Y)(C/* ["default"] */.A,{delay:200,content:(0,s.__)("Portrait","tutor-pro"),children:/*#__PURE__*/(0,a/* .jsx */.Y)("button",{type:"button",css:[H/* .styleUtils.resetButton */.x.resetButton,el.orientationButton({isActive:v==="portrait"})],onClick:()=>_("portrait"),children:/*#__PURE__*/(0,a/* .jsx */.Y)(g/* ["default"] */.A,{name:v==="portrait"?"portraitFilled":"portrait",width:32,height:32})})})]})})]}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:el.certificateWrapper({hasCertificates:I.length>0,isSidebarVisible:r}),children:[/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{when:c.length&&(l.length===0||d==="templates"),children:/*#__PURE__*/(0,a/* .jsx */.Y)(G,{selectedCertificate:h,onSelectCertificate:M,onPreviewCertificate:e=>N(e),data:{key:"none",name:(0,s.__)("None","tutor-pro"),preview_src:"",background_src:"",orientation:"landscape",url:""},orientation:v})}),/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{when:I.length>0,fallback:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:el.emptyState,children:[/*#__PURE__*/(0,a/* .jsx */.Y)("img",{css:el.placeholderImage({notFound:true}),src:W,srcSet:"".concat(W," 1x, ").concat(V," 2x"),alt:(0,s.__)("Not Found","tutor-pro")}),/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:el.featureAndActionWrapper,children:/*#__PURE__*/(0,a/* .jsx */.Y)("p",{css:/*#__PURE__*/(0,o/* .css */.AH)(x/* .typography.body */.I.body("medium"),"                      color:",A/* .colorTokens.text.subdued */.I6.text.subdued,";"),children:(0,s.__)("You didn’t create any certificate yet!","tutor-pro")})})]}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(U/* ["default"] */.A,{each:I,children:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(G,{selectedCertificate:h,onSelectCertificate:M,data:e,orientation:v,onPreviewCertificate:N},e.key)})})]})]})})};/* ESM default export */const ec=eo;var el={tabs:/*#__PURE__*/(0,o/* .css */.AH)("position:relative;"),tabsWrapper:/*#__PURE__*/(0,o/* .css */.AH)("button{min-width:auto;}"),certificateWrapper:e=>{var{hasCertificates:r,isSidebarVisible:t}=e;return/*#__PURE__*/(0,o/* .css */.AH)("display:grid;grid-template-columns:repeat(",t?3:4,",1fr);gap:",A/* .spacing["16"] */.YK["16"],";padding-top:",A/* .spacing["12"] */.YK["12"],";",!r&&(0,o/* .css */.AH)(en())," ",A/* .Breakpoint.smallMobile */.EA.smallMobile,"{grid-template-columns:1fr 1fr;}")},orientation:/*#__PURE__*/(0,o/* .css */.AH)(H/* .styleUtils.display.flex */.x.display.flex(),"    gap:",A/* .spacing["8"] */.YK["8"],";position:absolute;height:32px;right:0;bottom:",A/* .spacing["4"] */.YK["4"],";"),orientationButton:e=>{var{isActive:r}=e;return/*#__PURE__*/(0,o/* .css */.AH)("display:inline-flex;color:",r?A/* .colorTokens.icon.brand */.I6.icon.brand:A/* .colorTokens.icon["default"] */.I6.icon["default"],";border-radius:",A/* .borderRadius["4"] */.Vq["4"],";&:focus,&:active,&:hover{background:none;color:",r?A/* .colorTokens.icon.brand */.I6.icon.brand:A/* .colorTokens.icon["default"] */.I6.icon["default"],";}&:focus-visible{outline:2px solid ",A/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:1px;}")},emptyState:/*#__PURE__*/(0,o/* .css */.AH)("padding-block:",A/* .spacing["16"] */.YK["16"]," ",A/* .spacing["12"] */.YK["12"],";",H/* .styleUtils.display.flex */.x.display.flex("column"),"    gap:",A/* .spacing["20"] */.YK["20"],";"),placeholderImage:e=>{var{notFound:r}=e;return/*#__PURE__*/(0,o/* .css */.AH)("max-width:100%;width:100%;height:",r?"189px":"312px;",";object-fit:cover;object-position:center;border-radius:",A/* .borderRadius["6"] */.Vq["6"],";")},featureAndActionWrapper:/*#__PURE__*/(0,o/* .css */.AH)(H/* .styleUtils.display.flex */.x.display.flex("column"),"    align-items:center;gap:",A/* .spacing["12"] */.YK["12"],";"),actionsButton:/*#__PURE__*/(0,o/* .css */.AH)(H/* .styleUtils.flexCenter */.x.flexCenter(),"    margin-top:",A/* .spacing["4"] */.YK["4"],";")};// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/components/fields/FormCheckbox.tsx
var es=t(9789);// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/components/fields/FormTextareaInput.tsx
var ed=t(8466);// CONCATENATED MODULE: ./addons/course-bundle/assets/react/bundle-builder/pages/Additional.tsx
var eu=(0,_/* .getBundleId */.w)();var ev=()=>{var e=(0,d/* .useFormContext */.xW)();var r=(0,c/* .useQueryClient */.jE)();var t=r.getQueryData(["CourseBundle",eu]);var o=(0,l/* .useIsFetching */.C)({queryKey:["CourseBundle",eu]});var p=!!B/* .tutorConfig.tutor_pro_url */.P.tutor_pro_url;var h=(0,R/* .isAddonEnabled */.GR)(b/* .Addons.TUTOR_CERTIFICATE */.oW.TUTOR_CERTIFICATE);var f=e.watch("tutor_course_certificate_template");var g;var A=(g=t===null||t===void 0?void 0:t.course_certificates_templates)!==null&&g!==void 0?g:[];var x=r=>{e.setValue("tutor_course_certificate_template",r)};return/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:eh.wrapper,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(Y,{title:(0,s.__)("Additional","tutor-pro"),backUrl:"/"}),/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:H/* .styleUtils.fieldGroups */.x.fieldGroups(24),children:[/*#__PURE__*/(0,a/* .jsx */.Y)("div",{css:eh.additionalFields,children:/*#__PURE__*/(0,a/* .jsx */.Y)(d/* .Controller */.xI,{name:"course_benefits",control:e.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(ed/* ["default"] */.A,(0,i._)((0,n._)({},e),{label:(0,s.__)("What Will I Learn?","tutor-pro"),placeholder:(0,s.__)("Define the key takeaways from this course (list one benefit per line)","tutor-pro"),rows:3,enableResize:true}))})}),/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{when:h,children:/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:H/* .styleUtils.fieldGroups */.x.fieldGroups(12),children:[/*#__PURE__*/(0,a/* .jsxs */.FD)(u/* .Box */.az,{bordered:true,children:[/*#__PURE__*/(0,a/* .jsxs */.FD)("div",{css:eh.titleAndSub,children:[/*#__PURE__*/(0,a/* .jsx */.Y)(u/* .BoxTitle */.IF,{children:(0,s.__)("Certificate","tutor-pro")}),/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{when:p&&(0,R/* .isAddonEnabled */.GR)(b/* .Addons.TUTOR_CERTIFICATE */.oW.TUTOR_CERTIFICATE),children:/*#__PURE__*/(0,a/* .jsx */.Y)(u/* .BoxSubtitle */.M6,{children:(0,s.__)("Select a certificate to award your learners.","tutor-pro")})})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(m/* ["default"] */.A,{when:!o,fallback:/*#__PURE__*/(0,a/* .jsx */.Y)(v/* .LoadingSection */.YE,{}),children:/*#__PURE__*/(0,a/* .jsx */.Y)(ec,{currentCertificateKey:f,onSelect:x,certificateTemplates:A})})]}),/*#__PURE__*/(0,a/* .jsx */.Y)(d/* .Controller */.xI,{name:"certificate_for_individual_courses",control:e.control,render:e=>/*#__PURE__*/(0,a/* .jsx */.Y)(es/* ["default"] */.A,(0,i._)((0,n._)({},e),{label:(0,s.__)("Provide certificates for individual courses.","tutor-pro")}))})]})}),/*#__PURE__*/(0,a/* .jsx */.Y)(k/* ["default"] */.A,{})]})]})};/* ESM default export */const ep=ev;var eh={wrapper:/*#__PURE__*/(0,o/* .css */.AH)(H/* .styleUtils.fieldGroups */.x.fieldGroups(32),";width:100%;max-width:750px;margin:",A/* .spacing["32"] */.YK["32"]," auto;"),additionalFields:/*#__PURE__*/(0,o/* .css */.AH)("padding:",A/* .spacing["12"] */.YK["12"]," ",A/* .spacing["20"] */.YK["20"]," ",A/* .spacing["20"] */.YK["20"],";background-color:",A/* .colorTokens.background.white */.I6.background.white,";border:1px solid ",A/* .colorTokens.stroke.divider */.I6.stroke.divider,";border-radius:",A/* .borderRadius.card */.Vq.card,";"),titleAndSub:/*#__PURE__*/(0,o/* .css */.AH)(H/* .styleUtils.display.flex */.x.display.flex("column"),"    gap:",A/* .spacing["4"] */.YK["4"],";margin-bottom:",A/* .spacing["20"] */.YK["20"],";")}},6847:function(e,r,t){t.d(r,{IF:()=>g,M6:()=>b,az:()=>f});/* ESM import */var n=t(6154);/* ESM import */var i=t(3747);/* ESM import */var a=t(4532);/* ESM import */var o=t(6439);/* ESM import */var c=t(1817);/* ESM import */var l=t(1699);/* ESM import */var s=t(1594);/* ESM import */var d=/*#__PURE__*/t.n(s);/* ESM import */var u=t(6277);/* ESM import */var v=t(9773);function p(){var e=(0,n._)(["\n      border: 1px solid ",";\n    "]);p=function r(){return e};return e}function h(){var e=(0,n._)(["\n      border-bottom: 1px solid ",";\n      padding: "," ",";\n    "]);h=function r(){return e};return e}var f=/*#__PURE__*/d().forwardRef((e,r)=>{var{children:t,className:n,bordered:a=false,wrapperCss:o}=e;return/*#__PURE__*/(0,i/* .jsx */.Y)("div",{ref:r,className:n,css:[A.wrapper(a),o],children:t})});f.displayName="Box";var g=/*#__PURE__*/d().forwardRef((e,r)=>{var{children:t,className:n,separator:a=false,tooltip:o}=e;return/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{ref:r,className:n,css:A.title(a),children:[/*#__PURE__*/(0,i/* .jsx */.Y)("span",{children:t}),/*#__PURE__*/(0,i/* .jsx */.Y)(c/* ["default"] */.A,{when:o,children:/*#__PURE__*/(0,i/* .jsx */.Y)(v/* ["default"] */.A,{content:o,children:/*#__PURE__*/(0,i/* .jsx */.Y)(u/* ["default"] */.A,{name:"info",width:20,height:20})})})]})});g.displayName="BoxTitle";var b=/*#__PURE__*/d().forwardRef((e,r)=>{var{children:t,className:n}=e;return/*#__PURE__*/(0,i/* .jsx */.Y)("div",{ref:r,className:n,css:A.subtitle,children:/*#__PURE__*/(0,i/* .jsx */.Y)("span",{children:t})})});b.displayName="BoxSubtitle";var A={wrapper:e=>/*#__PURE__*/(0,l/* .css */.AH)("background-color:",a/* .colorTokens.background.white */.I6.background.white,";border-radius:",a/* .borderRadius["8"] */.Vq["8"],";padding:",a/* .spacing["12"] */.YK["12"]," ",a/* .spacing["20"] */.YK["20"]," ",a/* .spacing["20"] */.YK["20"],";",e&&(0,l/* .css */.AH)(p(),a/* .colorTokens.stroke.divider */.I6.stroke.divider)),title:e=>/*#__PURE__*/(0,l/* .css */.AH)(o/* .typography.body */.I.body("medium"),";color:",a/* .colorTokens.text.title */.I6.text.title,";display:flex;gap:",a/* .spacing["4"] */.YK["4"],";align-items:center;",e&&(0,l/* .css */.AH)(h(),a/* .colorTokens.stroke.divider */.I6.stroke.divider,a/* .spacing["12"] */.YK["12"],a/* .spacing["20"] */.YK["20"]),"    & > div{height:20px;svg{color:",a/* .colorTokens.icon.hints */.I6.icon.hints,";}}& > span{display:inline-block;}"),subtitle:/*#__PURE__*/(0,l/* .css */.AH)(o/* .typography.caption */.I.caption(),";color:",a/* .colorTokens.text.hints */.I6.text.hints,";")}},3953:function(e,r,t){t.d(r,{A:()=>y});/* ESM import */var n=t(7317);/* ESM import */var i=t(8015);/* ESM import */var a=t(6154);/* ESM import */var o=t(3747);/* ESM import */var c=t(4532);/* ESM import */var l=t(6439);/* ESM import */var s=t(6208);/* ESM import */var d=t(1699);/* ESM import */var u=t(1594);/* ESM import */var v=/*#__PURE__*/t.n(u);function p(){var e=(0,a._)(["\n      cursor: not-allowed;\n    "]);p=function r(){return e};return e}function h(){var e=(0,a._)(["\n      color: ",";\n    "]);h=function r(){return e};return e}function f(){var e=(0,a._)(["\n        margin-right: ",";\n      "]);f=function r(){return e};return e}function g(){var e=(0,a._)(["\n        background-color: ",";\n      "]);g=function r(){return e};return e}function b(){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    "]);b=function r(){return e};return e}function A(){var e=(0,a._)(["\n      & + span {\n        cursor: not-allowed;\n\n        &::before {\n          border-color: ",";\n        }\n      }\n    "]);A=function r(){return e};return e}var x=/*#__PURE__*/v().forwardRef((e,r)=>{var{id:t=(0,s/* .nanoid */.Ak)(),name:a,labelCss:c,inputCss:l,label:d="",checked:u,value:p,disabled:h=false,onChange:f,onBlur:g,isIndeterminate:b=false}=e;var A=e=>{f===null||f===void 0?void 0:f(!b?e.target.checked:true,e)};var x=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__*/v().isValidElement(e)){var r;var t=(r=e.props)===null||r===void 0?void 0:r.children;if(typeof t==="string"){return t}if(Array.isArray(t)){return t.map(e=>typeof e==="string"?e:"").filter(Boolean).join(" ")}}return""};return/*#__PURE__*/(0,o/* .jsxs */.FD)("label",{htmlFor:t,css:[m.container({disabled:h}),c],children:[/*#__PURE__*/(0,o/* .jsx */.Y)("input",(0,i._)((0,n._)({},e),{ref:r,id:t,name:a,type:"checkbox",value:p,checked:!!u,disabled:h,"aria-invalid":e["aria-invalid"],onChange:A,onBlur:g,css:[l,m.checkbox({label:!!d,isIndeterminate:b,disabled:h})]})),/*#__PURE__*/(0,o/* .jsx */.Y)("span",{}),/*#__PURE__*/(0,o/* .jsx */.Y)("span",{css:[m.label({isDisabled:h}),c],title:x(d),children:d})]})});var m={container:e=>{var{disabled:r=false}=e;return/*#__PURE__*/(0,d/* .css */.AH)("position:relative;display:flex;align-items:center;cursor:pointer;user-select:none;color:",c/* .colorTokens.text.title */.I6.text.title,";",r&&(0,d/* .css */.AH)(p()))},label:e=>{var{isDisabled:r=false}=e;return/*#__PURE__*/(0,d/* .css */.AH)(l/* .typography.caption */.I.caption(),";color:",c/* .colorTokens.text.title */.I6.text.title,";",r&&(0,d/* .css */.AH)(h(),c/* .colorTokens.text.disable */.I6.text.disable))},checkbox:e=>{var{label:r,isIndeterminate:t,disabled:n}=e;return/*#__PURE__*/(0,d/* .css */.AH)("position:absolute;opacity:0 !important;height:0;width:0;& + span{position:relative;cursor:pointer;display:inline-flex;align-items:center;",r&&(0,d/* .css */.AH)(f(),c/* .spacing["10"] */.YK["10"]),"}& + span::before{content:'';background-color:",c/* .colorTokens.background.white */.I6.background.white,";border:1px solid ",c/* .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:",c/* .colorTokens.icon.brand */.I6.icon.brand,";border-radius:",c/* .borderRadius["4"] */.Vq["4"],";",n&&(0,d/* .css */.AH)(g(),c/* .colorTokens.icon.disable["default"] */.I6.icon.disable["default"]),"}",t&&(0,d/* .css */.AH)(b(),c/* .colorTokens.brand.blue */.I6.brand.blue,c/* .colorTokens.stroke.white */.I6.stroke.white)," ",n&&(0,d/* .css */.AH)(A(),c/* .colorTokens.stroke.disable */.I6.stroke.disable),"    &:focus-visible{& + span{border-radius:",c/* .borderRadius["2"] */.Vq["2"],";outline:2px solid ",c/* .colorTokens.stroke.brand */.I6.stroke.brand,";outline-offset:1px;}}")}};/* ESM default export */const y=x},9789:function(e,r,t){t.d(r,{A:()=>f});/* ESM import */var n=t(7317);/* ESM import */var i=t(8015);/* ESM import */var a=t(9414);/* ESM import */var o=t(3747);/* ESM import */var c=t(3953);/* ESM import */var l=t(4532);/* ESM import */var s=t(6439);/* ESM import */var d=t(1699);/* ESM import */var u=t(6277);/* ESM import */var v=t(9773);/* ESM import */var p=t(3347);var h=e=>{var{field:r,fieldState:t,disabled:l,value:s,onChange:d,label:h,description:f,helpText:b,isHidden:A,labelCss:x}=e;return/*#__PURE__*/(0,o/* .jsx */.Y)(p/* ["default"] */.A,{field:r,fieldState:t,isHidden:A,children:e=>{var{css:t}=e,p=(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)(c/* ["default"] */.A,(0,i._)((0,n._)({},r,p),{inputCss:t,labelCss:x,value:s,disabled:l,checked:r.value,label:h,onChange:()=>{r.onChange(!r.value);if(d){d(!r.value)}}})),b&&/*#__PURE__*/(0,o/* .jsx */.Y)(v/* ["default"] */.A,{content:b,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})]})}})};/* ESM default export */const f=h;var g={wrapper:/*#__PURE__*/(0,d/* .css */.AH)("display:flex;align-items:center;gap:",l/* .spacing["6"] */.YK["6"],";& > div{display:flex;color:",l/* .colorTokens.icon["default"] */.I6.icon["default"],";}"),description:/*#__PURE__*/(0,d/* .css */.AH)(s/* .typography.small */.I.small(),"    color:",l/* .colorTokens.text.hints */.I6.text.hints,";padding-left:30px;margin-top:",l/* .spacing["6"] */.YK["6"],";")}},3347:function(e,r,t){t.d(r,{A:()=>j});/* ESM import */var n=t(6154);/* ESM import */var i=t(3747);/* ESM import */var a=t(1699);/* ESM import */var o=t(2470);/* ESM import */var c=/*#__PURE__*/t.n(o);/* ESM import */var l=t(8589);/* ESM import */var s=t(6277);/* ESM import */var d=t(9773);/* ESM import */var u=t(4532);/* ESM import */var v=t(6439);/* ESM import */var p=t(1817);/* ESM import */var h=t(6014);/* ESM import */var f=t(7150);/* ESM import */var g=t(6208);function b(){var e=(0,n._)(["\n      opacity: 0.5;\n    "]);b=function r(){return e};return e}function A(){var e=(0,n._)(["\n      display: none;\n    "]);A=function r(){return e};return e}function x(){var e=(0,n._)(["\n      flex-direction: row;\n      align-items: center;\n      justify-content: space-between;\n      gap: ",";\n    "]);x=function r(){return e};return e}function m(){var e=(0,n._)(["\n        padding: 0 "," 0 ",";\n      "]);m=function r(){return e};return e}function y(){var e=(0,n._)(["\n        border-radius: 0;\n        border: none;\n        box-shadow: none;\n      "]);y=function r(){return e};return e}function w(){var e=(0,n._)(["\n        border-color: transparent;\n      "]);w=function r(){return e};return e}function Y(){var e=(0,n._)(["\n          outline-color: ",";\n          background-color: ",";\n        "]);Y=function r(){return e};return e}function I(){var e=(0,n._)(["\n          border-color: ",";\n        "]);I=function r(){return e};return e}function k(){var e=(0,n._)(["\n          color: ",";\n        "]);k=function r(){return e};return e}function _(){var e=(0,n._)(["\n        border-color: ",";\n        background-color: ",";\n      "]);_=function r(){return e};return e}function M(){var e=(0,n._)(["\n        border-color: ",";\n        background-color: ",";\n      "]);M=function r(){return e};return e}function D(){var e=(0,n._)(["\n      justify-content: end;\n    "]);D=function r(){return e};return e}function C(){var e=(0,n._)(["\n      color: ",";\n    "]);C=function r(){return e};return e}function H(){var e=(0,n._)(["\n      ",";\n    "]);H=function r(){return e};return e}var N=e=>{var{field:r,fieldState:t,children:n,disabled:a=false,readOnly:c=false,label:v,isInlineLabel:h=false,variant:b,loading:A,placeholder:x,helpText:m,isHidden:y=false,removeBorder:w=false,characterCount:Y,isSecondary:I=false,inputStyle:k,onClickAiButton:_,isMagicAi:M=false,generateWithAi:D=false,replaceEntireLabel:C=false}=e;var H;var N=(0,g/* .nanoid */.Ak)();var j=[T.input({variant:b,hasFieldError:!!t.error,removeBorder:w,readOnly:c,hasHelpText:!!m,isSecondary:I,isMagicAi:M})];if((0,f/* .isDefined */.O9)(k)){j.push(k)}var z=/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:T.inputWrapper,children:[n({id:N,name:r.name,css:j,"aria-invalid":t.error?"true":"false",disabled:a,readOnly:c,placeholder:x,className:"tutor-input-field"}),A&&/*#__PURE__*/(0,i/* .jsx */.Y)("div",{css:T.loader,children:/*#__PURE__*/(0,i/* .jsx */.Y)(l/* ["default"] */.Ay,{size:20,color:u/* .colorTokens.icon["default"] */.I6.icon["default"]})})]});return/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:T.container({disabled:a,isHidden:y}),"data-cy":"form-field-wrapper",children:[/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:T.inputContainer(h),children:[(v||m)&&/*#__PURE__*/(0,i/* .jsxs */.FD)("div",{css:T.labelContainer,children:[v&&/*#__PURE__*/(0,i/* .jsxs */.FD)("label",{htmlFor:N,css:T.label(h,C),children:[v,/*#__PURE__*/(0,i/* .jsx */.Y)(p/* ["default"] */.A,{when:D,children:/*#__PURE__*/(0,i/* .jsx */.Y)("button",{type:"button",onClick:()=>{_===null||_===void 0?void 0:_()},css:T.aiButton,children:/*#__PURE__*/(0,i/* .jsx */.Y)(s/* ["default"] */.A,{name:"magicAiColorize",width:32,height:32})})})]}),m&&!C&&/*#__PURE__*/(0,i/* .jsx */.Y)(d/* ["default"] */.A,{content:m,placement:"top",allowHTML:true,children:/*#__PURE__*/(0,i/* .jsx */.Y)(s/* ["default"] */.A,{name:"info",width:20,height:20})})]}),Y?/*#__PURE__*/(0,i/* .jsx */.Y)(d/* ["default"] */.A,{placement:"right",hideOnClick:false,content:Y.maxLimit-Y.inputCharacter>=0?Y.maxLimit-Y.inputCharacter:(0,o.__)("Limit exceeded","tutor-pro"),children:z}):z]}),((H=t.error)===null||H===void 0?void 0:H.message)&&/*#__PURE__*/(0,i/* .jsxs */.FD)("p",{css:T.errorLabel(!!t.error,h),children:[/*#__PURE__*/(0,i/* .jsx */.Y)(s/* ["default"] */.A,{style:T.alertIcon,name:"info",width:20,height:20})," ",t.error.message]})]})};/* ESM default export */const j=N;var T={container:e=>{var{disabled:r,isHidden:t}=e;return/*#__PURE__*/(0,a/* .css */.AH)("display:flex;flex-direction:column;position:relative;background:inherit;width:100%;",r&&(0,a/* .css */.AH)(b())," ",t&&(0,a/* .css */.AH)(A()))},inputContainer:e=>/*#__PURE__*/(0,a/* .css */.AH)("display:flex;flex-direction:column;gap:",u/* .spacing["4"] */.YK["4"],";width:100%;",e&&(0,a/* .css */.AH)(x(),u/* .spacing["12"] */.YK["12"])),input:e=>/*#__PURE__*/(0,a/* .css */.AH)("&.tutor-input-field{",v/* .typography.body */.I.body("regular"),";width:100%;border-radius:",u/* .borderRadius["6"] */.Vq["6"],";border:1px solid ",u/* .colorTokens.stroke["default"] */.I6.stroke["default"],";padding:",u/* .spacing["8"] */.YK["8"]," ",u/* .spacing["16"] */.YK["16"],";color:",u/* .colorTokens.text.title */.I6.text.title,";appearance:textfield;&:not(textarea){height:40px;}",e.hasHelpText&&(0,a/* .css */.AH)(m(),u/* .spacing["32"] */.YK["32"],u/* .spacing["12"] */.YK["12"])," ",e.removeBorder&&(0,a/* .css */.AH)(y())," ",e.isSecondary&&(0,a/* .css */.AH)(w()),":focus{",h/* .styleUtils.inputFocus */.x.inputFocus,";",e.isMagicAi&&(0,a/* .css */.AH)(Y(),u/* .colorTokens.stroke.magicAi */.I6.stroke.magicAi,u/* .colorTokens.background.magicAi["8"] */.I6.background.magicAi["8"])," ",e.hasFieldError&&(0,a/* .css */.AH)(I(),u/* .colorTokens.stroke.danger */.I6.stroke.danger),"}::-webkit-outer-spin-button,::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}::placeholder{",v/* .typography.caption */.I.caption("regular"),";color:",u/* .colorTokens.text.hints */.I6.text.hints,";",e.isSecondary&&(0,a/* .css */.AH)(k(),u/* .colorTokens.text.hints */.I6.text.hints),"}",e.hasFieldError&&(0,a/* .css */.AH)(_(),u/* .colorTokens.stroke.danger */.I6.stroke.danger,u/* .colorTokens.background.status.errorFail */.I6.background.status.errorFail)," ",e.readOnly&&(0,a/* .css */.AH)(M(),u/* .colorTokens.background.disable */.I6.background.disable,u/* .colorTokens.background.disable */.I6.background.disable),"}"),errorLabel:(e,r)=>/*#__PURE__*/(0,a/* .css */.AH)(v/* .typography.small */.I.small(),";line-height:",u/* .lineHeight["20"] */.K_["20"],";display:flex;align-items:start;margin-top:",u/* .spacing["4"] */.YK["4"],";",r&&(0,a/* .css */.AH)(D())," ",e&&(0,a/* .css */.AH)(C(),u/* .colorTokens.text.status.onHold */.I6.text.status.onHold),"    & svg{margin-right:",u/* .spacing["2"] */.YK["2"],";transform:rotate(180deg);}"),labelContainer:/*#__PURE__*/(0,a/* .css */.AH)("display:flex;align-items:center;gap:",u/* .spacing["4"] */.YK["4"],";> div{display:flex;color:",u/* .colorTokens.color.black["30"] */.I6.color.black["30"],";}"),label:(e,r)=>/*#__PURE__*/(0,a/* .css */.AH)(v/* .typography.caption */.I.caption(),";margin:0px;width:",r?"100%":"auto",";color:",u/* .colorTokens.text.title */.I6.text.title,";display:flex;align-items:center;gap:",u/* .spacing["4"] */.YK["4"],";",e&&(0,a/* .css */.AH)(H(),v/* .typography.caption */.I.caption())),aiButton:/*#__PURE__*/(0,a/* .css */.AH)(h/* .styleUtils.resetButton */.x.resetButton,";width:32px;height:32px;border-radius:",u/* .borderRadius["4"] */.Vq["4"],";display:flex;align-items:center;justify-content:center;:disabled{cursor:not-allowed;}&:focus,&:active,&:hover{background:none;}&:focus-visible{outline:2px solid ",u/* .colorTokens.stroke.brand */.I6.stroke.brand,";}"),inputWrapper:/*#__PURE__*/(0,a/* .css */.AH)("position:relative;"),loader:/*#__PURE__*/(0,a/* .css */.AH)("position:absolute;top:50%;right:",u/* .spacing["12"] */.YK["12"],";transform:translateY(-50%);display:flex;"),alertIcon:/*#__PURE__*/(0,a/* .css */.AH)("flex-shrink:0;")}},8466:function(e,r,t){t.d(r,{A:()=>A});/* ESM import */var n=t(7317);/* ESM import */var i=t(8015);/* ESM import */var a=t(6154);/* ESM import */var o=t(3747);/* ESM import */var c=t(1699);/* ESM import */var l=t(1594);/* ESM import */var s=/*#__PURE__*/t.n(l);/* ESM import */var d=t(4532);/* ESM import */var u=t(6439);/* ESM import */var v=t(9338);/* ESM import */var p=t(6014);/* ESM import */var h=t(3347);function f(){var e=(0,a._)(["\n        resize: vertical;\n      "]);f=function r(){return e};return e}var g=6;var b=e=>{var{label:r,rows:t=g,columns:a,maxLimit:c,field:s,fieldState:d,disabled:u,readOnly:v,loading:p,placeholder:f,helpText:b,onChange:A,onKeyDown:m,isHidden:y,enableResize:w=true,isSecondary:Y=false,isMagicAi:I=false,inputCss:k,maxHeight:_,autoResize:M=false}=e;var D;var C=(D=s.value)!==null&&D!==void 0?D:"";var H=(0,l.useRef)(null);var N=undefined;if(c){N={maxLimit:c,inputCharacter:C.toString().length}}var j=()=>{if(H.current){if(_){H.current.style.maxHeight="".concat(_,"px")}H.current.style.height="auto";H.current.style.height="".concat(H.current.scrollHeight,"px")}};(0,l.useLayoutEffect)(()=>{if(M){j()}// eslint-disable-next-line react-hooks/exhaustive-deps
},[]);return/*#__PURE__*/(0,o/* .jsx */.Y)(h/* ["default"] */.A,{label:r,field:s,fieldState:d,disabled:u,readOnly:v,loading:p,placeholder:f,helpText:b,isHidden:y,characterCount:N,isSecondary:Y,isMagicAi:I,children:e=>{return/*#__PURE__*/(0,o/* .jsx */.Y)(o/* .Fragment */.FK,{children:/*#__PURE__*/(0,o/* .jsx */.Y)("div",{css:x.container(w,k),children:/*#__PURE__*/(0,o/* .jsx */.Y)("textarea",(0,i._)((0,n._)({},s,e),{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
},style:{maxHeight:_?"".concat(_,"px"):"none"},className:"tutor-input-field",value:C,onChange:e=>{var{value:r}=e.target;if(c&&r.trim().length>c){return}s.onChange(r);if(A){A(r)}if(M){j()}},onKeyDown:e=>{m===null||m===void 0?void 0:m(e.key)},autoComplete:"off",rows:t,cols:a}))})})}})};/* ESM default export */const A=(0,v/* .withVisibilityControl */.M)(b);var x={container:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:false,r=arguments.length>1?arguments[1]:void 0;return/*#__PURE__*/(0,c/* .css */.AH)("position:relative;display:flex;textarea{",u/* .typography.body */.I.body(),";height:auto;padding:",d/* .spacing["8"] */.YK["8"]," ",d/* .spacing["12"] */.YK["12"],";resize:none;",p/* .styleUtils.overflowYAuto */.x.overflowYAuto,";&.tutor-input-field{",r,";}",e&&(0,c/* .css */.AH)(f()),"}")}}},9338:function(e,r,t){// EXPORTS
t.d(r,{M:()=>/* binding */u});// EXTERNAL MODULE: ../tutor/node_modules/@swc/helpers/esm/_object_spread.js + 1 modules
var n=t(7317);// EXTERNAL MODULE: ../tutor/node_modules/@swc/helpers/esm/_object_without_properties.js + 1 modules
var i=t(9414);// EXTERNAL MODULE: ./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.esm.js
var a=t(3747);// EXTERNAL MODULE: external "React"
var o=t(1594);// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/config/config.ts
var c=t(9568);// EXTERNAL MODULE: ../tutor/assets/react/v3/shared/utils/types.ts
var l=t(7150);// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/hooks/useVisibilityControl.tsx
/**
 * Custom hook to control the visibility of fields based on the provided visibility key and context.
 *
 * @param {string} visibilityKey - The key used to determine the visibility of the field.
 * @returns {boolean} - Returns true if the field should be visible, false otherwise.
 */var s=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return(0,o.useMemo)(()=>{var r;// If no visibility key provided, always show the field
if(!(0,l/* .isDefined */.O9)(e)){return true}var[t,n]=(e===null||e===void 0?void 0:e.split("."))||[];if(!(0,l/* .isDefined */.O9)(t)||!(0,l/* .isDefined */.O9)(n)){return true}var i=c/* .tutorConfig */.P===null||c/* .tutorConfig */.P===void 0?void 0:(r=c/* .tutorConfig.visibility_control */.P.visibility_control)===null||r===void 0?void 0:r[t];if(!i){return true}var a=c/* .tutorConfig.current_user.roles */.P.current_user.roles;var o=a.includes("administrator")?"admin":"instructor";var s="".concat(n,"_").concat(o);if(!Object.keys(i).includes(s)){return true}return i[s]==="on"},[e])};/* ESM default export */const d=s;// CONCATENATED MODULE: ../tutor/assets/react/v3/shared/hoc/withVisibilityControl.tsx
var u=e=>{return r=>{var{visibilityKey:t}=r,o=(0,i._)(r,["visibilityKey"]);var c=d(t);if(!c){return null}// @ts-ignore
return/*#__PURE__*/(0,a/* .jsx */.Y)(e,(0,n._)({},o))}}},9272:function(e,r,t){t.d(r,{C:()=>o});/* ESM import */var n=t(1594);/* ESM import */var i=t(1629);/* ESM import */var a=t(241);"use client";// src/useIsFetching.ts
function o(e,r){const t=(0,a/* .useQueryClient */.jE)(r);const o=t.getQueryCache();return n.useSyncExternalStore(n.useCallback(e=>o.subscribe(i/* .notifyManager.batchCalls */.jG.batchCalls(e)),[o]),()=>t.isFetching(e),()=>t.isFetching(e))}//# sourceMappingURL=useIsFetching.js.map
}}]);