1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3939],{76373:function(e,n,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/prog_tmp_list_upd_2563",function(){return i(73469)}])},73469:function(e,n,i){"use strict";i.r(n),i.d(n,{default:function(){return H}});var t=i(11527),a=i(50959),l=i(74864),r=i(45804),c=i(82187),o=i.n(c),d=i(24965),s=i(70840),u=i(37927),h=i(97019),g=i(72846),m=i(83297),b=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],p=a.forwardRef(function(e,n){var i,t=e.prefixCls,l=void 0===t?"rc-switch":t,r=e.className,c=e.checked,p=e.defaultChecked,$=e.disabled,k=e.loadingIcon,f=e.checkedChildren,w=e.unCheckedChildren,I=e.onClick,S=e.onChange,y=e.onKeyDown,v=(0,h.Z)(e,b),C=(0,g.Z)(!1,{value:c,defaultValue:p}),E=(0,u.Z)(C,2),x=E[0],_=E[1];function N(e,n){var i=x;return $||(_(i=e),null==S||S(i,n)),i}var j=o()(l,r,(i={},(0,s.Z)(i,"".concat(l,"-checked"),x),(0,s.Z)(i,"".concat(l,"-disabled"),$),i));return a.createElement("button",(0,d.Z)({},v,{type:"button",role:"switch","aria-checked":x,disabled:$,className:j,ref:n,onKeyDown:function(e){e.which===m.Z.LEFT?N(!1,e):e.which===m.Z.RIGHT&&N(!0,e),null==y||y(e)},onClick:function(e){var n=N(!x,e);null==I||I(n,e)}}),k,a.createElement("span",{className:"".concat(l,"-inner")},a.createElement("span",{className:"".concat(l,"-inner-checked")},f),a.createElement("span",{className:"".concat(l,"-inner-unchecked")},w)))});p.displayName="Switch";var $=i(50769),k=i(42268),f=i(35609),w=i(61906),I=i(8267),S=i(84432),y=i(31413),v=i(38037),C=i(1925);let E=e=>{let{componentCls:n,trackHeightSM:i,trackPadding:t,trackMinWidthSM:a,innerMinMarginSM:l,innerMaxMarginSM:r,handleSizeSM:c,calc:o}=e,d=`${n}-inner`,s=(0,I.bf)(o(c).add(o(t).mul(2)).equal()),u=(0,I.bf)(o(r).mul(2).equal());return{[n]:{[`&${n}-small`]:{minWidth:a,height:i,lineHeight:(0,I.bf)(i),[`${n}-inner`]:{paddingInlineStart:r,paddingInlineEnd:l,[`${d}-checked, ${d}-unchecked`]:{minHeight:i},[`${d}-checked`]:{marginInlineStart:`calc(-100% + ${s} - ${u})`,marginInlineEnd:`calc(100% - ${s} + ${u})`},[`${d}-unchecked`]:{marginTop:o(i).mul(-1).equal(),marginInlineStart:0,marginInlineEnd:0}},[`${n}-handle`]:{width:c,height:c},[`${n}-loading-icon`]:{top:o(o(c).sub(e.switchLoadingIconSize)).div(2).equal(),fontSize:e.switchLoadingIconSize},[`&${n}-checked`]:{[`${n}-inner`]:{paddingInlineStart:l,paddingInlineEnd:r,[`${d}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${d}-unchecked`]:{marginInlineStart:`calc(100% - ${s} + ${u})`,marginInlineEnd:`calc(-100% + ${s} - ${u})`}},[`${n}-handle`]:{insetInlineStart:`calc(100% - ${(0,I.bf)(o(c).add(t).equal())})`}},[`&:not(${n}-disabled):active`]:{[`&:not(${n}-checked) ${d}`]:{[`${d}-unchecked`]:{marginInlineStart:o(e.marginXXS).div(2).equal(),marginInlineEnd:o(e.marginXXS).mul(-1).div(2).equal()}},[`&${n}-checked ${d}`]:{[`${d}-checked`]:{marginInlineStart:o(e.marginXXS).mul(-1).div(2).equal(),marginInlineEnd:o(e.marginXXS).div(2).equal()}}}}}}},x=e=>{let{componentCls:n,handleSize:i,calc:t}=e;return{[n]:{[`${n}-loading-icon${e.iconCls}`]:{position:"relative",top:t(t(i).sub(e.fontSize)).div(2).equal(),color:e.switchLoadingIconColor,verticalAlign:"top"},[`&${n}-checked ${n}-loading-icon`]:{color:e.switchColor}}}},_=e=>{let{componentCls:n,trackPadding:i,handleBg:t,handleShadow:a,handleSize:l,calc:r}=e,c=`${n}-handle`;return{[n]:{[c]:{position:"absolute",top:i,insetInlineStart:i,width:l,height:l,transition:`all ${e.switchDuration} ease-in-out`,"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:t,borderRadius:r(l).div(2).equal(),boxShadow:a,transition:`all ${e.switchDuration} ease-in-out`,content:'""'}},[`&${n}-checked ${c}`]:{insetInlineStart:`calc(100% - ${(0,I.bf)(r(l).add(i).equal())})`},[`&:not(${n}-disabled):active`]:{[`${c}::before`]:{insetInlineEnd:e.switchHandleActiveInset,insetInlineStart:0},[`&${n}-checked ${c}::before`]:{insetInlineEnd:0,insetInlineStart:e.switchHandleActiveInset}}}}},N=e=>{let{componentCls:n,trackHeight:i,trackPadding:t,innerMinMargin:a,innerMaxMargin:l,handleSize:r,calc:c}=e,o=`${n}-inner`,d=(0,I.bf)(c(r).add(c(t).mul(2)).equal()),s=(0,I.bf)(c(l).mul(2).equal());return{[n]:{[o]:{display:"block",overflow:"hidden",borderRadius:100,height:"100%",paddingInlineStart:l,paddingInlineEnd:a,transition:`padding-inline-start ${e.switchDuration} ease-in-out, padding-inline-end ${e.switchDuration} ease-in-out`,[`${o}-checked, ${o}-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",minHeight:i},[`${o}-checked`]:{marginInlineStart:`calc(-100% + ${d} - ${s})`,marginInlineEnd:`calc(100% - ${d} + ${s})`},[`${o}-unchecked`]:{marginTop:c(i).mul(-1).equal(),marginInlineStart:0,marginInlineEnd:0}},[`&${n}-checked ${o}`]:{paddingInlineStart:a,paddingInlineEnd:l,[`${o}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${o}-unchecked`]:{marginInlineStart:`calc(100% - ${d} + ${s})`,marginInlineEnd:`calc(-100% + ${d} - ${s})`}},[`&:not(${n}-disabled):active`]:{[`&:not(${n}-checked) ${o}`]:{[`${o}-unchecked`]:{marginInlineStart:c(t).mul(2).equal(),marginInlineEnd:c(t).mul(-1).mul(2).equal()}},[`&${n}-checked ${o}`]:{[`${o}-checked`]:{marginInlineStart:c(t).mul(-1).mul(2).equal(),marginInlineEnd:c(t).mul(2).equal()}}}}}},j=e=>{let{componentCls:n,trackHeight:i,trackMinWidth:t}=e;return{[n]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,y.Wf)(e)),{position:"relative",display:"inline-block",boxSizing:"border-box",minWidth:t,height:i,lineHeight:(0,I.bf)(i),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"}})}},q=e=>{let{fontSize:n,lineHeight:i,controlHeight:t,colorWhite:a}=e,l=n*i,r=t/2,c=l-4,o=r-4;return{trackHeight:l,trackHeightSM:r,trackMinWidth:2*c+8,trackMinWidthSM:2*o+4,trackPadding:2,handleBg:a,handleSize:c,handleSizeSM:o,handleShadow:`0 2px 4px 0 ${new S.t("#00230b").setA(.2).toRgbString()}`,innerMinMargin:c/2,innerMaxMargin:c+2+4,innerMinMarginSM:o/2,innerMaxMarginSM:o+2+4}};var O=(0,v.I$)("Switch",e=>{let n=(0,C.IX)(e,{switchDuration:e.motionDurationMid,switchColor:e.colorPrimary,switchDisabledOpacity:e.opacityLoading,switchLoadingIconSize:e.calc(e.fontSizeIcon).mul(.75).equal(),switchLoadingIconColor:`rgba(0, 0, 0, ${e.opacityLoading})`,switchHandleActiveInset:"-30%"});return[j(n),N(n),_(n),x(n),E(n)]},q),M=function(e,n){var i={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&0>n.indexOf(t)&&(i[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,t=Object.getOwnPropertySymbols(e);a<t.length;a++)0>n.indexOf(t[a])&&Object.prototype.propertyIsEnumerable.call(e,t[a])&&(i[t[a]]=e[t[a]]);return i};
1let Z=a.forwardRef((e,n)=>{let{prefixCls:i,size:t,disabled:l,loading:c,className:d,rootClassName:s,style:u,checked:h,value:m,defaultChecked:b,defaultValue:I,onChange:S}=e,y=M(e,["prefixCls","size","disabled","loading","className","rootClassName","style","checked","value","defaultChecked","defaultValue","onChange"]),[v,C]=(0,g.Z)(!1,{value:null!=h?h:m,defaultValue:null!=b?b:I}),{getPrefixCls:E,direction:x,switch:_}=a.useContext(k.E_),N=a.useContext(f.Z),j=E("switch",i),q=a.createElement("div",{className:`${j}-handle`},c&&a.createElement(r.Z,{className:`${j}-loading-icon`})),[Z,D,T]=O(j),z=(0,w.Z)(t),H=o()(null==_?void 0:_.className,{[`${j}-small`]:"small"===z,[`${j}-loading`]:c,[`${j}-rtl`]:"rtl"===x},d,s,D,T),X=Object.assign(Object.assign({},null==_?void 0:_.style),u),P=(...e)=>{C(e[0]),null==S||S.apply(void 0,e)};return Z(a.createElement($.Z,{component:"Switch"},a.createElement(p,Object.assign({},y,{checked:v,onChange:P,prefixCls:j,className:H,style:X,disabled:(null!=l?l:N)||c,ref:n,loadingIcon:q}))))}),D=Z;D.__ANT_SWITCH=!0;var T=i(35498),z=i(8894);function H(){let[e,n]=(0,a.useState)([]),[i,r]=(0,a.useState)(!0);(0,a.useEffect)(()=>{l.Z.get("".concat("https://crm.inspire.edu.lb/api/","prog_list_tmp87544")).then(e=>{n(e.data),r(!1)}).catch(e=>{console.error("Error fetching courses:",e),r(!1)})},[]);let c=(e,i)=>{n(n=>n.map(n=>n.id===e?{...n,show_web:i}:n))},o=async()=>{try{await l.Z.post("".concat("https://crm.inspire.edu.lb/api/","prog_update_tmp87544"),{courses:e}),alert("Courses updated successfully!")}catch(e){console.error("Update failed:",e),alert("Failed to update courses.")}},d=[{title:"ID",dataIndex:"id",key:"id",sorter:(e,n)=>e.id-n.id},{title:"Title",dataIndex:"title",key:"title",sorter:(e,n)=>e.title.localeCompare(n.title)},{title:"Show on Web",key:"show_web",render:(e,n)=>(0,t.jsx)(D,{checked:n.show_web,onChange:e=>c(n.id,e),className:"".concat(n.show_web?"bg-blue-500":"bg-gray-400 border-gray-400")})}],s=()=>(0,t.jsx)(T.ZP,{type:"primary",onClick:o,className:"bg-blue-600 hover:bg-blue-400 mt-4",children:"Save Changes"});return(0,t.jsxs)("div",{className:"p-8 w-6/12 mx-auto",children:[(0,t.jsxs)("div",{className:"sticky top-0 bg-white z-20 border-b border-gray-200 flex justify-between items-center py-4 px-2",children:[(0,t.jsx)("h1",{className:"text-2xl font-semibold",children:"Publish Courses"}),(0,t.jsx)(s,{})]}),(0,t.jsx)(z.Z,{dataSource:e,columns:d,rowKey:"id",loading:i,pagination:!1,bordered:!0}),(0,t.jsx)(s,{})]})}}},function(e){e.O(0,[1339,1063,8601,3107,8894,9774,2888,179],function(){return e(e.s=76373)}),_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.