PageSourceSearch

https://maang.in/_next/static/chunks/pages/admin/cohorts/[name]/_c…/CohortExtensionTab-d2bd3ef57594e9b4.js

js maang.in collected 2026-10-10 02:27:38 UTC 28,159 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[83048],{72269:function(e,n,t){"use strict";t.d(n,{Z:function(){return P}});var r=t(79090),i=t(94184),a=t.n(i),o=t(87462),s=t(4942),l=t(97685),c=t(45987),d=t(67294),u=t(21770),m=t(15105),h=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],g=d.forwardRef(function(e,n){var t,r=e.prefixCls,i=void 0===r?"rc-switch":r,g=e.className,p=e.checked,f=e.defaultChecked,x=e.disabled,b=e.loadingIcon,w=e.checkedChildren,y=e.unCheckedChildren,v=e.onClick,C=e.onChange,S=e.onKeyDown,k=(0,c.Z)(e,h),j=(0,u.Z)(!1,{value:p,defaultValue:f}),I=(0,l.Z)(j,2),$=I[0],N=I[1];function E(e,n){var t=$;return x||(N(t=e),null==C||C(t,n)),t}var M=a()(i,g,(t={},(0,s.Z)(t,"".concat(i,"-checked"),$),(0,s.Z)(t,"".concat(i,"-disabled"),x),t));return d.createElement("button",(0,o.Z)({},k,{type:"button",role:"switch","aria-checked":$,disabled:x,className:M,ref:n,onKeyDown:function(e){e.which===m.Z.LEFT?E(!1,e):e.which===m.Z.RIGHT&&E(!0,e),null==S||S(e)},onClick:function(e){var n=E(!$,e);null==v||v(n,e)}}),b,d.createElement("span",{className:"".concat(i,"-inner")},d.createElement("span",{className:"".concat(i,"-inner-checked")},w),d.createElement("span",{className:"".concat(i,"-inner-unchecked")},y)))});g.displayName="Switch";var p=t(45353),f=t(53124),x=t(98866),b=t(98675),w=t(10274),y=t(14747),v=t(67968),C=t(45503);let S=e=>{let{componentCls:n}=e,t=`${n}-inner`;return{[n]:{[`&${n}-small`]:{minWidth:e.switchMinWidthSM,height:e.switchHeightSM,lineHeight:`${e.switchHeightSM}px`,[`${n}-inner`]:{paddingInlineStart:e.switchInnerMarginMaxSM,paddingInlineEnd:e.switchInnerMarginMinSM,[`${t}-checked`]:{marginInlineStart:`calc(-100% + ${e.switchPinSizeSM+2*e.switchPadding}px - ${2*e.switchInnerMarginMaxSM}px)`,marginInlineEnd:`calc(100% - ${e.switchPinSizeSM+2*e.switchPadding}px + ${2*e.switchInnerMarginMaxSM}px)`},[`${t}-unchecked`]:{marginTop:-e.switchHeightSM,marginInlineStart:0,marginInlineEnd:0}},[`${n}-handle`]:{width:e.switchPinSizeSM,height:e.switchPinSizeSM},[`${n}-loading-icon`]:{top:(e.switchPinSizeSM-e.switchLoadingIconSize)/2,fontSize:e.switchLoadingIconSize},[`&${n}-checked`]:{[`${n}-inner`]:{paddingInlineStart:e.switchInnerMarginMinSM,paddingInlineEnd:e.switchInnerMarginMaxSM,[`${t}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${t}-unchecked`]:{marginInlineStart:`calc(100% - ${e.switchPinSizeSM+2*e.switchPadding}px + ${2*e.switchInnerMarginMaxSM}px)`,marginInlineEnd:`calc(-100% + ${e.switchPinSizeSM+2*e.switchPadding}px - ${2*e.switchInnerMarginMaxSM}px)`}},[`${n}-handle`]:{insetInlineStart:`calc(100% - ${e.switchPinSizeSM+e.switchPadding}px)`}},[`&:not(${n}-disabled):active`]:{[`&:not(${n}-checked) ${t}`]:{[`${t}-unchecked`]:{marginInlineStart:e.marginXXS/2,marginInlineEnd:-e.marginXXS/2}},[`&${n}-checked ${t}`]:{[`${t}-checked`]:{marginInlineStart:-e.marginXXS/2,marginInlineEnd:e.marginXXS/2}}}}}}},k=e=>{let{componentCls:n}=e;return{[n]:{[`${n}-loading-icon${e.iconCls}`]:{position:"relative",top:(e.switchPinSize-e.fontSize)/2,color:e.switchLoadingIconColor,verticalAlign:"top"},[`&${n}-checked ${n}-loading-icon`]:{color:e.switchColor}}}},j=e=>{let{componentCls:n,motion:t}=e,r=`${n}-handle`;return{[n]:{[r]:{position:"absolute",top:e.switchPadding,insetInlineStart:e.switchPadding,width:e.switchPinSize,height:e.switchPinSize,transition:`all ${e.switchDuration} ease-in-out`,"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:e.colorWhite,borderRadius:e.switchPinSize/2,boxShadow:e.switchHandleShadow,transition:`all ${e.switchDuration} ease-in-out`,content:'""'}},[`&${n}-checked ${r}`]:{insetInlineStart:`calc(100% - ${e.switchPinSize+e.switchPadding}px)`},[`&:not(${n}-disabled):active`]:t?{[`${r}::before`]:{insetInlineEnd:e.switchHandleActiveInset,insetInlineStart:0},[`&${n}-checked ${r}::before`]:{insetInlineEnd:0,insetInlineStart:e.switchHandleActiveInset}}:{}}}},I=e=>{let{componentCls:n}=e,t=`${n}-inner`;return{[n]:{[t]:{display:"block",overflow:"hidden",borderRadius:100,height:"100%",paddingInlineStart:e.switchInnerMarginMax,paddingInlineEnd:e.switchInnerMarginMin,transition:`padding-inline-start ${e.switchDuration} ease-in-out, padding-inline-end ${e.switchDuration} ease-in-out`,[`${t}-checked, ${t}-unchecked`]:{display:"block",color:e.colorTextLightSolid,fontSize:e.fontSizeSM,transition:`margin-inline-start ${e.switchDuration} ease-in-out, margin-inline-end ${e.switchDuration} ease-in-out`,pointerEvents:"none"},[`${t}-checked`]:{marginInlineStart:`calc(-100% + ${e.switchPinSize+2*e.switchPadding}px - ${2*e.switchInnerMarginMax}px)`,marginInlineEnd:`calc(100% - ${e.switchPinSize+2*e.switchPadding}px + ${2*e.switchInnerMarginMax}px)`},[`${t}-unchecked`]:{marginTop:-e.switchHeight,marginInlineStart:0,marginInlineEnd:0}},[`&${n}-checked ${t}`]:{paddingInlineStart:e.switchInnerMarginMin,paddingInlineEnd:e.switchInnerMarginMax,[`${t}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${t}-unchecked`]:{marginInlineStart:`calc(100% - ${e.switchPinSize+2*e.switchPadding}px + ${2*e.switchInnerMarginMax}px)`,marginInlineEnd:`calc(-100% + ${e.switchPinSize+2*e.switchPadding}px - ${2*e.switchInnerMarginMax}px)`}},[`&:not(${n}-disabled):active`]:{[`&:not(${n}-checked) ${t}`]:{[`${t}-unchecked`]:{marginInlineStart:2*e.switchPadding,marginInlineEnd:-(2*e.switchPadding)}},[`&${n}-checked ${t}`]:{[`${t}-checked`]:{marginInlineStart:-(2*e.switchPadding),marginInlineEnd:2*e.switchPadding}}}}}},$=e=>{let{componentCls:n}=e;return{[n]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,y.Wf)(e)),{position:"relative",display:"inline-block",boxSizing:"border-box",minWidth:e.switchMinWidth,height:e.switchHeight,lineHeight:`${e.switchHeight}px`,verticalAlign:"middle",background:e.colorTextQuaternary,border:"0",borderRadius:100,cursor:"pointer",transition:`all ${e.motionDurationMid}`,userSelect:"none",[`&:hover:not(${n}-disabled)`]:{background:e.colorTextTertiary}}),(0,y.Qy)(e)),{[`&${n}-checked`]:{background:e.switchColor,[`&:hover:not(${n}-disabled)`]:{background:e.colorPrimaryHover}},[`&${n}-loading, &${n}-disabled`]:{cursor:"not-allowed",opacity:e.switchDisabledOpacity,"*":{boxShadow:"none",cursor:"not-allowed"}},[`&${n}-rtl`]:{direction:"rtl"}})}};var N=(0,v.Z)("Switch",e=>{let n=e.fontSize*e.lineHeight,t=e.controlHeight/2,r=n-4,i=t-4,a=(0,C.TS)(e,{switchMinWidth:2*r+8,switchHeight:n,switchDuration:e.motionDurationMid,switchColor:e.colorPrimary,switchDisabledOpacity:e.opacityLoading,switchInnerMarginMin:r/2,switchInnerMarginMax:r+2+4,switchPadding:2,switchPinSize:r,switchBg:e.colorBg
1Container,switchMinWidthSM:2*i+4,switchHeightSM:t,switchInnerMarginMinSM:i/2,switchInnerMarginMaxSM:i+2+4,switchPinSizeSM:i,switchHandleShadow:`0 2px 4px 0 ${new w.C("#00230b").setAlpha(.2).toRgbString()}`,switchLoadingIconSize:.75*e.fontSizeIcon,switchLoadingIconColor:`rgba(0, 0, 0, ${e.opacityLoading})`,switchHandleActiveInset:"-30%"});return[$(a),I(a),j(a),k(a),S(a)]}),E=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>n.indexOf(r)&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>n.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(t[r[i]]=e[r[i]]);return t};let M=d.forwardRef((e,n)=>{let{prefixCls:t,size:i,disabled:o,loading:s,className:l,rootClassName:c,style:u}=e,m=E(e,["prefixCls","size","disabled","loading","className","rootClassName","style"]),{getPrefixCls:h,direction:w,switch:y}=d.useContext(f.E_),v=d.useContext(x.Z),C=(null!=o?o:v)||s,S=h("switch",t),k=d.createElement("div",{className:`${S}-handle`},s&&d.createElement(r.Z,{className:`${S}-loading-icon`})),[j,I]=N(S),$=(0,b.Z)(i),M=a()(null==y?void 0:y.className,{[`${S}-small`]:"small"===$,[`${S}-loading`]:s,[`${S}-rtl`]:"rtl"===w},l,c,I),P=Object.assign(Object.assign({},null==y?void 0:y.style),u);return j(d.createElement(p.Z,{component:"Switch"},d.createElement(g,Object.assign({},m,{prefixCls:S,className:M,style:P,disabled:C,ref:n,loadingIcon:k}))))});M.__ANT_SWITCH=!0;var P=M},60335:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/cohorts/[name]/_components/CohortExtensionTab/CohortExtensionTab",function(){return t(99849)}])},41755:function(e,n,t){"use strict";t.d(n,{Z:function(){return s}});var r=t(85893),i=t(67294),a=t(51474);let o=(e,n)=>{if((null==e?void 0:e.id)!==void 0&&(null==e?void 0:e.id)!==null)return"id-".concat(e.id);if((null==e?void 0:e.resource_id)!==void 0&&(null==e?void 0:e.resource_id)!==null&&(null==e?void 0:e.resource_type))return"resource-".concat(e.resource_type,"-").concat(e.resource_id);if((null==e?void 0:e.type)&&(null==e?void 0:e.data)){var t,r,i,a,o,s,l,c,d,u,m;if(Array.isArray(e.data)){let n=e.data[0],a=null!==(i=null!==(r=null!==(t=null==n?void 0:n.id)&&void 0!==t?t:null==n?void 0:n.resource_id)&&void 0!==r?r:null==n?void 0:n.mcq_id)&&void 0!==i?i:null==n?void 0:n.video_id;if(null!=a)return"widget-".concat(e.type,"-").concat(a)}else if("object"==typeof e.data){let n=null!==(m=null!==(u=null!==(d=null!==(c=null===(a=e.data)||void 0===a?void 0:a.id)&&void 0!==c?c:null===(o=e.data)||void 0===o?void 0:o.resource_id)&&void 0!==d?d:null===(s=e.data)||void 0===s?void 0:s.mcq_id)&&void 0!==u?u:null===(l=e.data)||void 0===l?void 0:l.video_id)&&void 0!==m?m:Object.values(e.data||{})[0];if(null!=n)return"widget-".concat(e.type,"-").concat(n)}}return"index-".concat(n)};function s(e){var n;let{array:t,children:s,className:l,...c}=e,d=(0,i.useRef)(null),u=(0,i.useRef)(new WeakMap),m=(0,i.useRef)(1),h=e=>{if(!e||"object"!=typeof e)return null;let n=u.current.get(e);if(n)return n;let t="obj-".concat(m.current++);return u.current.set(e,t),t};return(0,i.useEffect)(()=>{if(d.current){let e=new a.ZP(d.current,{group:{name:"nested",pull:"clone",put:!1},animation:150,onEnd:e=>{let{newIndex:n,oldIndex:r}=e,i=t[r];t.splice(r,1),t.splice(n,0,i)}});return()=>{e.destroy()}}},[t]),(0,r.jsx)("div",{ref:d,className:l,children:t.map((e,t)=>(0,r.jsx)(i.Fragment,{children:i.cloneElement(s,{...c,element:e})},"".concat(o(e,t),"-").concat(null!==(n=h(e))&&void 0!==n?n:"idx-".concat(t))))})}},18470:function(e,n,t){"use strict";t.d(n,{w:function(){return d}});var r=t(85893),i=t(20631),a=t(67294);let o={primary:"border border-border-blue-darker bg-button-primary-default !text-fg-grey-white-light shadow-none hover:bg-button-primary-hover active:bg-button-primary-active",danger:"border border-error-border-default bg-error-surface-default !text-fg-grey-white-light shadow-none hover:bg-error-surface-darker active:bg-error-surface-default",secondary:"border border-border-grey-minimal bg-button-white-default text-fg-blue-primary shadow-none hover:bg-button-white-hover active:bg-button-white-active",ghost:"border border-transparent bg-transparent text-fg-grey-secondary shadow-none hover:bg-surface-grey-primary hover:text-fg-grey-primary active:bg-surface-grey-secondary"},s={sm:"h-9 px-3.5 text-xs gap-1.5",md:"h-10 px-5 text-sm gap-2",lg:"h-11 px-6 text-sm gap-2.5"},l=/(^|:)!?(bg|text|border)-(?:slate|gray|grey|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose|white|black|fg-|surface-|button-|border-|error-|success-|warning-)/;function c(e){let{size:n=16}=e;return(0,r.jsx)("span",{style:{width:n,height:n},className:"inline-flex items-center justify-center",children:(0,r.jsx)("span",{className:"h-full w-full rounded-full border-2 border-current border-t-transparent animate-spin"})})}function d(e){var n,t;let{children:d,variant:u="primary",size:m="md",loading:h=!1,disabled:g=!1,autoLoading:p=!1,leftIcon:f,rightIcon:x,className:b,type:w="button",rounded:y=!0,onClick:v,...C}=e,[S,k]=(0,a.useState)(!1),j=h||S,I=function(e,n){if("string"!=typeof e)return e;
1let t=e.split(/\s+/).filter(Boolean);return t.filter(e=>!/(^|:)!?rounded(?:-[^\s]+)?$/.test(e)).filter(e=>"ghost"===n||!l.test(e)).join(" ")}(b,u),$=async e=>{if(v){if(!p){v(e);return}try{let n=v(e);n&&"function"==typeof n.then&&(k(!0),await n)}finally{k(!1)}}};return(0,r.jsxs)("button",{type:w,disabled:g||j,"aria-busy":j||void 0,className:(0,i.cn)("inline-flex items-center justify-center whitespace-nowrap select-none font-semibold leading-none tracking-tight","transition-[background-color,color,border-color,box-shadow,transform] duration-150 ease-out","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-cyan-lighter-p","disabled:opacity-50 disabled:cursor-not-allowed",null!==(n=o[u])&&void 0!==n?n:o.primary,null!==(t=s[m])&&void 0!==t?t:s.md,I,"!rounded-md"),onClick:$,...C,children:[j?(0,r.jsx)(c,{size:"sm"===m?12:14}):f?(0,r.jsx)("span",{className:"shrink-0",children:f}):null,(0,r.jsx)("span",{className:"truncate",children:d}),!j&&x?(0,r.jsx)("span",{className:"shrink-0",children:x}):null]})}},88838:function(e,n,t){"use strict";t.d(n,{z:function(){return o}});var r=t(85893),i=t(18470),a=t(23647);function o(e){let{open:n,onClose:t,title:o,description:s,children:l,onConfirm:c,confirmLabel:d="Save",cancelLabel:u="Cancel",confirmVariant:m="primary",confirmLoading:h=!1,maxWidth:g="max-w-lg",compact:p=!0,hideFooter:f=!1,footer:x,panelClassName:b,headerClassName:w,bodyClassName:y,footerClassName:v}=e;return(0,r.jsx)(a.J,{open:n,onClose:t,title:o,description:s,maxWidth:g,roundedButtons:!1,panelClassName:b,headerClassName:w,bodyClassName:y,footerClassName:v,...p?{headerClassName:"px-5 pt-4 pb-3",bodyClassName:"px-5 py-4",footerClassName:"px-5 py-3"}:{},footer:f?null:null!=x?x:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.w,{variant:"secondary",onClick:t,size:"md",children:u}),c&&(0,r.jsx)(i.w,{variant:m,onClick:c,loading:h,size:"md",children:d})]}),children:l})}},66998:function(e,n,t){"use strict";t.d(n,{v:function(){return a}});var r=t(85893),i=t(20631);function a(e){let{label:n,error:t,leftIcon:a,rightIcon:o,leftIconClassName:s,rightIconClassName:l,className:c,inputClassName:d,id:u,required:m,...h}=e,g=u||(null==n?void 0:n.toLowerCase().replace(/\s+/g,"-"));return(0,r.jsxs)("div",{className:(0,i.cn)("flex flex-col gap-1.5",c),children:[n&&(0,r.jsxs)("label",{htmlFor:g,className:"text-xs font-bold uppercase tracking-wider text-fg-grey-secondary select-none pb-0.5",children:[n,m&&(0,r.jsx)("span",{className:"text-fg-error-default ml-1 font-sans",children:"*"})]}),(0,r.jsxs)("div",{className:"relative flex items-center group",children:[a&&(0,r.jsx)("span",{className:(0,i.cn)("absolute left-4 text-fg-grey-tertiary pointer-events-none transition-colors group-focus-within:text-fg-cyan-default",s),children:a}),(0,r.jsx)("input",{id:g,className:(0,i.cn)("w-full h-11 rounded-md border border-border-grey-minimal bg-surface-surface-default px-4 text-sm text-fg-grey-primary placeholder:text-fg-grey-tertiary shadow-sm","focus:outline-none focus:ring-2 focus:ring-border-cyan-lighter-p focus:border-border-cyan-default","disabled:bg-surface-grey-secondary disabled:text-fg-grey-light-4 disabled:cursor-not-allowed","transition-all duration-200",a&&"pl-12",o&&"pr-12",t&&"border-error-border-default focus:ring-error-border-subtle focus:border-error-border-default",d),...h}),o&&(0,r.jsx)("span",{className:(0,i.cn)("absolute right-4 text-fg-grey-tertiary pointer-events-none transition-colors group-focus-within:text-fg-cyan-default",l),children:o})]}),t&&(0,r.jsx)("p",{className:"text-xs font-medium text-fg-error-default mt-1",children:t})]})}},23647:function(e,n,t){"use strict";t.d(n,{J:function(){return h}});var r=t(85893),i=t(20631),a=t(51526),o=t(92520),s=t(67294),l=t(73935),c=t(53854),d=t(18470);let u={hidden:{opacity:0},visible:{opacity:1,transition:{duration:.18}},exit:{opacity:0,transition:{duration:.15}}},m={hidden:{opacity:0,scale:.98,y:8},visible:{opacity:1,scale:1,y:0,transition:{type:"spring",stiffness:380,damping:30}},exit:{opacity:0,scale:.99,y:4,transition:{duration:.12}}};
1function h(e){let{open:n,onClose:t,title:h,description:g,footer:p,onSubmit:f,submitLabel:x="Submit",submitLoading:b=!1,submitVariant:w="primary",maxWidth:y="max-w-lg",roundedButtons:v=!1,panelClassName:C,headerClassName:S,bodyClassName:k,footerClassName:j,showCloseButton:I=!0,children:$}=e;(0,s.useEffect)(()=>(n?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[n]);let N=(0,s.useCallback)(e=>{"Escape"===e.key&&(null==t||t())},[t]);(0,s.useEffect)(()=>(n&&document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)),[n,N]);let[E,M]=s.useState(!1);return(s.useEffect(()=>M(!0),[]),E)?(0,l.createPortal)((0,r.jsx)(a.M,{children:n&&(0,r.jsxs)(o.E.div,{className:"fixed inset-0 z-[9999] flex items-center justify-center p-4","aria-modal":"true",role:"dialog",children:[(0,r.jsx)(o.E.div,{variants:u,initial:"hidden",animate:"visible",exit:"exit",className:"absolute inset-0 bg-[color-mix(in_oklch,var(--color-grey-1000),transparent_56%)] backdrop-blur-sm",onClick:t},"backdrop"),(0,r.jsxs)(o.E.div,{variants:m,initial:"hidden",animate:"visible",exit:"exit",className:(0,i.cn)("relative z-10 w-full bg-surface-surface-default rounded-md border border-border-grey-white shadow-xl flex flex-col",y,C),children:[(0,r.jsxs)("div",{className:(0,i.cn)("flex items-start justify-between gap-3 px-6 pt-6 pb-4 border-b border-border-grey-white",S),children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"heading-l text-fg-grey-primary",children:h}),g&&(0,r.jsx)("p",{className:"mt-0.5 text-sm text-fg-grey-secondary",children:g})]}),I&&(0,r.jsx)("button",{onClick:t,className:"shrink-0 rounded-md p-1 text-fg-grey-tertiary hover:text-fg-grey-primary hover:bg-surface-grey-primary transition-colors","aria-label":"Close modal",children:(0,r.jsx)(c.fMW,{size:18})})]}),(0,r.jsx)("div",{className:(0,i.cn)("px-6 py-3 overflow-y-auto custom-scrollbar max-h-[70vh]",k),children:$}),(0,r.jsx)("div",{className:(0,i.cn)("px-6 py-4 border-t border-border-grey-white flex justify-end gap-2",j),children:null!=p?p:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.w,{variant:"secondary",onClick:t,size:"md",rounded:v,children:"Cancel"}),f&&(0,r.jsx)(d.w,{variant:w,onClick:f,loading:b,size:"md",rounded:v,children:x})]})})]},"panel")]})}),document.body):null}},54183:function(e,n,t){"use strict";t.r(n);var r=t(85893),i=t(18470),a=t(88838),o=t(10584),s=t(30124),l=t(72269),c=t(67294);let d="!h-10 !rounded-lg !border-slate-200";n.default=e=>{let{element:n,onDelete:t,onSave:u}=e,[m,h]=(0,c.useState)(!1),[g]=o.Z.useForm();return(0,c.useEffect)(()=>{g.setFieldsValue(n)},[n,g]),n?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"mb-2 rounded-xl border border-slate-200 bg-white/95 px-3 py-2.5 shadow-sm last:mb-0",children:(0,r.jsx)(o.Z,{layout:"vertical",form:g,className:"[&_.ant-form-item-label>label]:!text-xs [&_.ant-form-item-label>label]:!font-semibold [&_.ant-form-item-label>label]:!text-slate-600",children:(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-x-2.5 gap-y-1.5 xl:grid-cols-[1.5fr_1fr_1fr_170px_1fr_auto]",children:[(0,r.jsx)(o.Z.Item,{label:"Extension Plan Name",name:"name",className:"!mb-1",rules:[{required:!0,message:"Extension plan name is required"}],children:(0,r.jsx)(s.default,{placeholder:"Enter extension plan name",className:d})}),(0,r.jsx)(o.Z.Item,{label:"Original Amount",name:"original_amount",className:"!mb-1",rules:[{required:!0,message:"Original amount is required"}],children:(0,r.jsx)(s.default,{type:"number",placeholder:"Enter original amount",className:d})}),(0,r.jsx)(o.Z.Item,{label:"Amount",name:"amount",className:"!mb-1",rules:[{required:!0,message:"Amount is required"}],children:(0,r.jsx)(s.default,{type:"number",placeholder:"Enter amount",className:d})}),(0,r.jsx)(o.Z.Item,{label:"Is Dynamic",name:"is_dynamic",valuePropName:"checked",className:"!mb-1 [&_.ant-form-item-control-input]:!h-10 [&_.ant-form-item-control-input-content]:flex [&_.ant-form-item-control-input-content]:h-full [&_.ant-form-item-control-input-content]:items-center [&_.ant-form-item-control-input-content]:rounded-lg [&_.ant-form-item-control-input-content]:border [&_.ant-form-item-control-input-content]:border-slate-200 [&_.ant-form-item-control-input-content]:bg-slate-50 [&_.ant-form-item-control-input-content]:px-3",children:(0,r.jsx)(l.Z,{})}),(0,r.jsx)(o.Z.Item,{label:"Number Of Days",name:"number_of_days",className:"!mb-1",rules:[{required:!0,message:"Number of days is required"}],children:(0,r.jsx)(s.default,{type:"number",placeholder:"Enter number of days",className:d})}),(0,r.jsxs)("div",{className:"flex items-end justify-end gap-1.5 pb-1",children:[(0,r.jsx)(i.w,{variant:"secondary",size:"sm",rounded:!1,className:"!rounded-lg !px-3 !py-1.5",onClick:()=>{g.validateFields().then(e=>{u(null==n?void 0:n.id,e)})},children:"Save"}),(0,r.jsx)(i.w,{variant:"danger",size:"sm",rounded:!1,className:"!rounded-lg !px-3 !py-1.5",onClick:()=>h(!0),children:"Delete"})]})]})})}),(0,r.jsx)(a.z,{open:m,onClose:()=>h(!1),title:"Delete Extension Plan",description:"This will remove this extension plan permanently.",onConfirm:()=>{t(n.id),h(!1)},confirmLabel:"Delete",confirmVariant:"danger",maxWidth:"max-w-md"})]}):null}},99849:function(e,n,t){"use strict";t.r(n);var r=t(85893),i=t(41755),a=t(18470),o=t(88838),s=t(66998),l=t(18973),c=t(11315),d=t(10584),u=t(72269),m=t(67294),h=t(54183);n.default=e=>{let{cohort_id:n}=e,[t,g]=(0,m.useState)([]),[p,f]=(0,m.useState)(!1),[x]=d.Z.useForm(),b=(0,m.useCallback)(()=>{c.Z.GetCohortExtensionPlans(n).then(e=>{g(e.data.data||[])})},[n]);return(0,m.useEffect)(()=>{b()},[n,b]),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"rounded-3xl border border-slate-200 bg-white shadow-sm",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-2 border-b border-slate-100 px-5 py-4 md:flex-row md:items-center md:justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"mb-0 text-lg font-semibold text-slate-900",children:"Extension Plans"}),(0,r.jsx)("p",{className:"mb-0 mt-1 text-sm text-slate-500",children:"Configure renewal options and ordering for cohort extensions."})]}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsx)(a.w,{variant:"primary",size:"sm",rounded:!1,className:"!rounded-xl !bg-cyan-600 hover:!bg-cyan-700 active:!bg-cyan-800",onClick:()=>f(!0),children:"Add Extension Plan"}),(0,r.jsx)(a.w,{variant:"secondary",size:"sm",rounded:!1,className:"!rounded-xl",onClick:()=>{c.Z.ReorderCohortExtensionPlans(n,t).then(e=>{l.Z.ShowSuccess(e.data.details),b()})},children:"Save Order"})]})]}),(0,r.jsx)("div",{className:"px-4 py-3 md:px-5",children:(0,r.jsx)("div",{className:"rounded-2xl border border-slate-200 bg-slate-50/30 p-2",children:(0,r.jsx)(i.Z,{array:t,onDelete:e=>{c.Z.DeleteCohortExtensionPlans(n,e).then(e=>{l.Z.ShowSuccess(e.data.details),b()})},onSave:(e,t)=>
1{c.Z.UpdateCohortExtensionPlans(n,e,t).then(e=>{l.Z.ShowSuccess(e.data.details),b()})},children:(0,r.jsx)(h.default,{})})})})]}),(0,r.jsx)(o.z,{open:p,onClose:()=>f(!1),title:"Create Cohort Extension Plan",description:"Add pricing and duration for extension purchase.",onConfirm:()=>{x.validateFields().then(e=>{c.Z.CreateCohortExtensionPlans(n,{...e,is_dynamic:!!e.is_dynamic}).then(()=>{f(!1),b(),x.resetFields()})})},confirmLabel:"Create",maxWidth:"max-w-md",children:(0,r.jsxs)(d.Z,{layout:"vertical",form:x,children:[(0,r.jsx)(d.Z.Item,{label:"Name",name:"name",rules:[{required:!0,message:"Plan Name is required"}],children:(0,r.jsx)(s.v,{placeholder:"Enter plan name"})}),(0,r.jsx)(d.Z.Item,{label:"Original Amount",name:"original_amount",rules:[{required:!0,message:"Original Amount is required"}],children:(0,r.jsx)(s.v,{type:"number",placeholder:"Enter original amount"})}),(0,r.jsx)(d.Z.Item,{label:"Amount",name:"amount",rules:[{required:!0,message:"Amount is required"}],children:(0,r.jsx)(s.v,{type:"number",placeholder:"Enter amount"})}),(0,r.jsx)(d.Z.Item,{label:"Is Dynamic",name:"is_dynamic",valuePropName:"checked",children:(0,r.jsx)(u.Z,{})}),(0,r.jsx)(d.Z.Item,{label:"Number Of Days",name:"number_of_days",rules:[{required:!0,message:"Number of days is required"}],children:(0,r.jsx)(s.v,{type:"number",placeholder:"Enter number of days"})})]})})]})}},11315:function(e,n,t){"use strict";var r=t(460);let i=r.Z.jsonClient,a=r.Z.formDataClient;n.Z={GetCohorts:()=>i.get("/enrolments/admin/cohorts"),GetCohort:e=>i.get("/enrolments/admin/cohorts/".concat(e)),AddPlan:(e,n)=>i.post("/enrolments/admin/cohorts/".concat(e,"/plans"),n),GetPlans:e=>i.get("/enrolments/admin/cohorts/".concat(e,"/plans")),UpdatePlans:(e,n)=>i.put("/enrolments/admin/cohorts/".concat(e,"/plans"),n),SyncAccess:e=>i.post("/enrolments/admin/cohorts/".concat(e,"/sync-access")),ExtendAccess:(e,n)=>i.put("/enrolments/admin/cohorts/".concat(e,"/extend-access"),n),DeletePlan:(e,n)=>i.delete("/enrolments/admin/cohorts/".concat(e,"/plans/").concat(n)),GetCohortUsers:e=>i.get("/enrolments/admin/cohorts/".concat(e,"/users")),GetCohortUser:(e,n)=>i.get("/enrolments/admin/cohorts/".concat(e,"/users/").concat(n)),ShiftCohortUser:(e,n,t)=>i.post("/enrolments/admin/cohorts/".concat(e,"/users/").concat(n,"/shift?new_cohort_id=").concat(t)),UpdateCohortUser:(e,n,t)=>i.put("/enrolments/admin/cohorts/".concat(e,"/users/").concat(n),t),UpdateCohort:(e,n)=>i.put("/enrolments/admin/cohorts/".concat(e),n),DeleteCohort:e=>i.delete("/enrolments/admin/cohorts/".concat(e)),CreateCohortAnnouncement:(e,n)=>i.post("/enrolments/admin/cohorts/".concat(e,"/announcements"),n),UpdateCohortAnnouncement:(e,n,t)=>i.put("/enrolments/admin/cohorts/".concat(e,"/announcements/").concat(n),t),DeleteCohortAnnouncement:(e,n)=>i.delete("/enrolments/admin/cohorts/".concat(e,"/announcements/").concat(n)),GetAllCohortAnnouncements:e=>i.get("/enrolments/admin/cohorts/".concat(e,"/announcements")),GetCohortAnnouncementById:(e,n)=>i.get("/enrolments/admin/cohorts/".concat(e,"/announcements/").concat(n)),GetCohortExtensionPlans:e=>i.get("/enrolments/admin/cohorts/".concat(e,"/extensionplans")),CreateCohortExtensionPlans:(e,n)=>i.post("/enrolments/admin/cohorts/".concat(e,"/extensionplans"),n),UpdateCohortExtensionPlans:(e,n,t)=>i.put("/enrolments/admin/cohorts/".concat(e,"/extensionplans/").concat(n),t),DeleteCohortExtensionPlans:(e,n)=>i.delete("/enrolments/admin/cohorts/".concat(e,"/extensionplans/").concat(n)),ReorderCohortExtensionPlans:(e,n)=>i.post("/enrolments/admin/cohorts/".concat(e,"/extensionplans/reorder"),n),ManualCohortEnrolments:(e,n)=>a.post("/enrolments/admin/cohorts/".concat(e,"/manual-enrolment"),n),CohortNotify:e=>i.post("/enrolments/admin/cohorts/notify",e),GetCohortTasks:e=>i.get("/enrolments/admin/cohorts/".concat(e,"/tasks")),CreateCohortTask:(e,n)=>i.post("/enrolments/admin/cohorts/".concat(e,"/tasks"),n),ReorderCohortTasks:(e,n)=>i.post("/enrolments/admin/cohorts/".concat(e,"/tasks/reorder"),n),UpdateCohortTask:(e,n,t)=>i.put("/enrolments/admin/cohorts/".concat(e,"/tasks/").concat(n),t),DeleteCohortTask:(e,n)=>i.delete("/enrolments/admin/cohorts/".concat(e,"/tasks/").concat(n)),GetCohortTaskGroups:e=>i.get("/enrolments/admin/cohorts/".concat(e,"/task-groups")),CreateCohortTaskGroup:(e,n)=>i.post("/enrolments/admin/cohorts/".concat(e,"/task-groups"),n),UpdateCohortTaskGroup:(e,n,t)=>i.put("/enrolments/admin/cohorts/".concat(e,"/task-groups/").concat(n),t),DeleteCohortTaskGroup:(e,n)=>i.delete("/enrolments/admin/cohorts/".concat(e,"/task-groups/").concat(n)),ReorderCohortTaskGroups:(e,n)=>i.post("/enrolments/admin/cohorts/".concat(e,"/task-groups/reorder"),n),ReorderCohortTaskGroupTasks:(e,n,t)=>i.post("/enrolments/admin/cohorts/".concat(e,"/task-groups/").concat(n,"/tasks/reorder"),t),GetAllCohortPlansForCourse:function(e){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return i.get("/enrolments/admin/cohorts/plans/all?course_id=".concat(e,"&show_premium_only=").concat(n))},UpdateCohortPlansForCourse:e=>i.post("/enrolments/admin/cohorts/plans/all",e),CreateCohortRefunds:(e,n)=>i.post("/payments/admin/cohorts/".concat(e,"/refunds"),n)}}},function(e){e.O(0,[10584,51474,49774,92888,40179],function(){return e(e.s=60335)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.