PageSourceSearch

https://spinepassbook.com/static/js/6810.f122eb7c.chunk.js

js spinepassbook.com collected 2026-10-02 01:45:35 UTC 30,848 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkspline_react=self.webpackChunkspline_react||[]).push([[6810],{56810:function(e,n,t){t.d(n,{Z:function(){return V}});var i=t(15861),a=t(29439),r=t(64687),s=t.n(r),l=t(47313),o=t(93433),c=t(86314),d=t(21366),u=t(82320),m=t(63849),f=t(31616),p=t(41965),h=t(22102),g=t(93298),v=t(16044),x=t(94443),y=t(65832),j=t(46417),b=function(){return(0,j.jsxs)(y.Z,{children:[(0,j.jsx)("div",{className:"placeholder-glow",children:(0,j.jsx)("div",{className:"placeholder col-12 rounded",style:{height:"150px"}})}),(0,j.jsx)(y.Z.Body,{className:"p-2",children:(0,j.jsxs)("div",{className:"placeholder-glow",children:[(0,j.jsx)("div",{className:"placeholder col-12 mb-1 rounded ",style:{height:"24px"}}),(0,j.jsx)("div",{className:"placeholder col-8 rounded",style:{height:"22px"}})]})})]})},N=t(12279),Z=t.n(N),w=(t(94991),function(e){var n=e.videos,t=e.isLoading,i=void 0!==t&&t,r=e.hideButton,s=void 0!==r&&r,y=e.hideChrome,N=void 0!==y&&y,w=e.pickerLayout,k=void 0!==w&&w,C=e.singleSelect,_=void 0!==C&&C,S=(e.onVideoClick,e.onAddNewClick),U=e.onSearch,L=e.setSelectedVideo,I=e.selectedVideo,P=(0,l.useState)(""),R=(0,a.Z)(P,2),E=R[0],F=R[1],T=(0,l.useState)([]),V=(0,a.Z)(T,2),z=V[0],M=V[1],A=(0,l.useState)(!1),B=(0,a.Z)(A,2),W=B[0],D=B[1],O=(0,l.useState)(null),H=(0,a.Z)(O,2),G=H[0],K=H[1],q=(0,l.useState)(!1),J=(0,a.Z)(q,2),Q=J[0],Y=J[1],$=(0,l.useCallback)(Z()((function(e,n){if(U){if(""===e)return;U({searchTerm:e,filters:n})}}),1e3),[U]);(0,l.useEffect)((function(){return""!==E&&E.length>2&&$(E,z),function(){$.cancel()}}),[E,z,$]);var X=function(e,n,t){L((function(i){return i.some((function(e){return e.associatedVideoId===t}))?i.filter((function(e){return e.associatedVideoId!==t})):_?[{id:e,displayName:n,associatedVideoId:t}]:[].concat((0,o.Z)(i),[{id:e,displayName:n,associatedVideoId:t}])}))},ee=(0,j.jsxs)("div",{className:"media-gallery-list__search",children:[(0,j.jsx)(d.Z.Control,{type:"text",placeholder:"Search videos...",value:E,onChange:function(e){return F(e.target.value)}}),E&&(0,j.jsx)(v.aHS,{className:"media-gallery-list__clear",onClick:function(){F(""),U&&U({searchTerm:"",filters:z})},"aria-label":"Clear search"}),(0,j.jsxs)(u.Z,{show:W,onToggle:function(e){return D(e)},children:[(0,j.jsx)(u.Z.Toggle,{variant:"outline-secondary",id:"filter-dropdown",children:z.length>0?(0,j.jsx)(x.EGO,{}):(0,j.jsx)(x.O$5,{})}),(0,j.jsx)(u.Z.Menu,{align:"end",children:[{label:"Booklet",value:"booklet"},{label:"Caresteps",value:"carestep"},{label:"Diagnosis",value:"diagnosis"},{label:"Media Gallery",value:"media-gallery"},{label:"All",value:"others"}].map((function(e){return(0,j.jsxs)(u.Z.Item,{onClick:function(){return n=e.value,void M((function(e){var t="others"===n?e.includes("others")?[]:["others"]:e.includes(n)?e.filter((function(e){return e!==n})):[].concat((0,o.Z)(e.filter((function(e){return"others"!==e}))),[n]);return U&&U({searchTerm:E,filters:t}),t}));var n},active:z.includes(e.value),style:{backgroundColor:z.includes(e.value)?"#e9ecef":"transparent",color:z.includes(e.value)?"#000":"inherit",fontWeight:z.includes(e.value)?"600":"normal",display:"flex",alignItems:"center",gap:"8px"},children:[e.label,z.includes(e.value)&&(0,j.jsx)("span",{style:{marginLeft:"auto",color:"#ff5a3c"},children:"\u2713"})]},e.value)}))})]})]}),ne=(0,j.jsx)(m.Z,{xs:k?3:1,sm:k?3:1,md:k?3:2,lg:3,className:"g-3 media-gallery-list__grid".concat(k?" is-picker":""),children:i?Array.from({length:9}).map((function(e,n){return(0,j.jsx)(f.Z,{children:(0,j.jsx)(b,{})},n)})):n.map((function(e){var n=I.some((function(n){return n.associatedVideoId===e.associatedVideoId}));return(0,j.jsx)(f.Z,{className:s?"py-1 px-1":"",children:(0,j.jsxs)("div",{className:"select-media-card".concat(s?" is-pickable":"").concat(n?" is-selected":""),onClick:s?function(){return X(e._id,e.displayFileName,e.associatedVideoId)}:function(){return function(e){e.associatedVideoId?(K(e),Y(!0)):alert("No video associated with this file")}(e)},role:s?"button":void 0,tabIndex:s?0:void 0,"aria-pressed":s?n:void 0,onKeyDown:s?function(n){"Enter"!==n.key&&" "!==n.key||(n.preventDefault(),X(e._id,e.displayFileName,e.associatedVideoId))}:void 0,children:[s&&(0,j.jsx)("span",{className:"select-media-card__badge","aria-hidden":!0,
1children:n?(0,j.jsx)("i",{className:"mdi mdi-check"}):null}),(0,j.jsx)(c.b,{fileId:e._id,isVideo:!1,title:e.displayFileName,height:k?"200px":s?"148px":void 0})]})},e._id)}))}),te=!i&&0===n.length&&(0,j.jsxs)("div",{className:k?"select-media-modal__empty":"mgmt-tab__empty",children:[(0,j.jsx)("i",{className:"mdi mdi-image-off-outline","aria-hidden":!0}),(0,j.jsx)("p",{children:"No videos found"}),(0,j.jsx)("span",{children:"Try a different search or clear filters."})]}),ie=(0,j.jsxs)(p.Z,{show:Q,onHide:function(){K(null),Y(!1)},size:"lg",centered:!0,className:"media-gallery-modal",children:[(0,j.jsx)(p.Z.Header,{closeButton:!0,className:"border-bottom-0 pb-0",children:(0,j.jsx)(p.Z.Title,{className:"fw-bold text-primary",children:null===G||void 0===G?void 0:G.displayFileName})}),(0,j.jsx)(p.Z.Body,{className:"pt-0",children:G&&(0,j.jsx)("div",{className:"video-container",children:(0,j.jsx)(c.b,{fileId:G.associatedVideoId,isVideo:!0,autoPlay:!0,showPreviewPlayer:!0,height:"400px"})})})]});return k?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)("div",{className:"select-media-modal__toolbar",children:ee}),0!==n.length||i?(0,j.jsx)("div",{className:"select-media-modal__grid-scroll",children:ne}):te,ie]}):N?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)("div",{className:"mgmt-tab__toolbar",children:(0,j.jsx)("div",{className:"mgmt-tab__search",style:{marginBottom:0,width:"min(100%, 320px)"},children:ee})}),0!==n.length||i?(0,j.jsx)("div",{className:"media-gallery-page__grid-scroll",children:ne}):te,ie]}):(0,j.jsxs)(h.Z,{className:"py-3",children:[(0,j.jsxs)("div",{className:"d-flex justify-content-between align-items-center mb-3",children:[(0,j.jsx)("h4",{children:"Media Gallery"}),!s&&(0,j.jsxs)(g.Z,{variant:"outline-primary",onClick:S,children:[(0,j.jsx)(v.wEH,{className:"me-1"})," Add New"]})]}),(0,j.jsx)(m.Z,{className:"mb-3",children:(0,j.jsx)(f.Z,{md:4,className:"mb-3 mb-md-0",children:ee})}),ne,!i&&0===n.length&&(0,j.jsx)("div",{className:"text-center py-5",children:(0,j.jsx)("p",{className:"text-muted fs-5",children:"No videos found matching your search."})}),ie]})}),k=t(88922),C=t(29792),_=t(1413),S=t(13772),U=t(31387),L=t(40186),I=t(31881),P=t.n(I),R=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.75;return new Promise((function(i,a){var r=document.createElement("video");r.preload="metadata",r.src=URL.createObjectURL(e),r.crossOrigin="anonymous",r.onloadedmetadata=function(){r.duration<n?a(new Error("Video too short for thumbnail")):setTimeout((function(){r.currentTime=n}),200)},r.onseeked=function(){var e=document.createElement("canvas");e.width=r.videoWidth,e.height=r.videoHeight;var n=e.getContext("2d");n?(n.drawImage(r,0,0,e.width,e.height),e.toBlob((function(e){e?i(e):a(new Error("Could not create thumbnail blob"))}),"image/jpeg",t)):a(new Error("Canvas is not supported"))},r.onerror=function(){a(new Error("Invalid video format"))}}))},E=function(){var e=(0,l.useState)(null),n=(0,a.Z)(e,2),t=n[0],r=n[1],o=(0,l.useState)(!1),c=(0,a.Z)(o,2),d=c[0],u=c[1],m=function(){var e=(0,i.Z)(s().mark((function e(n){var t,i;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,null!==n&&void 0!==n&&n.name){e.next=3;break}throw new Error("Please select a valid video file.");case 3:return u(!0),e.next=6,R(n,2);case 6:t=e.sent,i={fileName:n.name,originalFile:n,thumbFile:t},r(i),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(0),U.Am.error("Thumbnail generation error: ".concat(e.t0.message)),console.error(e.t0);case 15:return e.prev=15,u(!1),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[0,11,15,18]])})));return function(n){return e.apply(this,arguments)}}();return[m,t,d]};var F=function(){var e=(0,i.Z)(s().mark((function e(n,t,i,a){var r,l,o,c,d,u,m,f;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r=n||t.name,l=t.type,o=t.size,c=l.startsWith("video/"),d=c&&"video/mp4"!==l,u=i,m=c?".m3u8":"image/jpeg",e.next=10,(0,L.QW)({fileName:r,fileType:l,size:o,isVideo:c,needConversion:d,fileExtension:m,folderPrefix:u,associatedVideoId:a});case 10:return f=e.sent,e.abrupt("return",f.data.payload);case 14:e.prev=14,e.t0=e.catch(0),console.error("Error while getting presignedurl:",e.t0);case 17:case"end":return e.stop()}}),e,null,[[0,14]])}
1)));return function(n,t,i,a){return e.apply(this,arguments)}}(),T=function(e){var n=e.showModal,t=e.handleCloseModel,r=E(),o=(0,a.Z)(r,3),c=o[0],u=o[1],m=o[2],f=(0,l.useState)({id:"",type:"file",value:null,isVideo:!0,presignedURL:"",fileId:""}),h=(0,a.Z)(f,2),v=h[0],x=h[1],y=(0,l.useState)(""),b=(0,a.Z)(y,2),N=b[0],Z=b[1],w=(0,l.useState)(null),C=(0,a.Z)(w,2),L=C[0],I=C[1],R=(0,l.useState)(void 0),T=(0,a.Z)(R,2),V=T[0],z=T[1],M=(0,l.useRef)(null),A=(0,l.useState)(null),B=(0,a.Z)(A,2),W=B[0],D=B[1],O=function(){V&&URL.revokeObjectURL(V),z(void 0)};(0,l.useEffect)((function(){return L&&L.type.startsWith("video/")&&(O(),M.current=L,c(L)),function(){O()}}),[L]),(0,l.useEffect)((function(){var e=function(){var e=(0,i.Z)(s().mark((function e(){var n,t,i,a;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===u||void 0===u||!u.thumbFile||L!==M.current){e.next=15;break}return n=u.thumbFile,t=URL.createObjectURL(n),z(t),e.prev=4,e.next=7,G(n);case 7:i=e.sent,a={fileName:"thumbnail.jpg",fileType:n.type,fileSize:n.size,url:t,base64:i,lastModified:Date.now()},D(a),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(4),console.error("Error generating base64 from thumbnail:",e.t0);case 15:case"end":return e.stop()}}),e,null,[[4,12]])})));return function(){return e.apply(this,arguments)}}();e()}),[null===u||void 0===u?void 0:u.thumbFile,L]);var H,G=function(e){return new Promise((function(n,t){var i=new FileReader;i.onloadend=function(){n(i.result)},i.onerror=function(e){t(e)},i.readAsDataURL(e)}))},K=function(){var e=(0,i.Z)(s().mark((function e(n,t,i){var a,r,l,o,c,d,u,m,f,p;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(N){e.next=3;break}return U.Am.error("Please enter a title for the media."),e.abrupt("return");case 3:return I(n),a=U.Am.loading("Uploading media file...",{autoClose:!1}),e.prev=5,t(!0),e.next=9,F(N,n,"media-gallery");case 9:if(r=e.sent,l=r.presignedURL,o=r.fileId,l){e.next=15;break}return U.Am.error("Failed to get presigned URL."),e.abrupt("return");case 15:return e.next=17,P().put(l,n,{headers:{"Content-Type":n.type},onUploadProgress:function(e){var n=e.loaded/e.total;U.Am.update(a,{render:"Uploading media... ".concat(Math.round(100*n),"%"),progress:n})}});case 17:if(!(W&&W.base64&&o)){e.next=35;break}return c=U.Am.loading("Uploading thumbnail...",{autoClose:!1}),e.next=21,fetch(W.base64).then((function(e){return e.blob()}));case 21:return d=e.sent,u=new File([d],"thumbnail.jpg",{type:"image/jpeg"}),e.next=25,F(N,u,"media-gallery",o);case 25:if(m=e.sent,f=m.presignedURL,p=m.fileId,!f){e.next=35;break}return e.next=31,P().put(f,u,{headers:{"Content-Type":"image/jpeg"},onUploadProgress:function(e){var n=e.loaded/e.total;U.Am.update(c,{render:"Uploading thumbnail... ".concat(Math.round(100*n),"%"),progress:n})}});case 31:return D((function(e){return(0,_.Z)((0,_.Z)({},e),{},{fileId:p})})),U.Am.update(c,{render:"Thumbnail upload complete!",type:"success",isLoading:!1,autoClose:5e3,progress:1}),e.next=35,(0,k.rc)(p,"Uploaded");case 35:return U.Am.update(a,{render:"Media upload complete!",type:"success",isLoading:!1,autoClose:5e3,progress:1}),x((function(e){return(0,_.Z)((0,_.Z)({},e),{},{presignedURL:l,fileId:o})})),i(!0),e.next=40,(0,k.rc)(o,"Uploaded");case 40:e.next=47;break;case 42:e.prev=42,e.t0=e.catch(5),U.Am.update(a,{render:"Upload failed!",type:"error",isLoading:!1,autoClose:5e3}),console.error("Error uploading file:",e.t0),i(!1);case 47:return e.prev=47,t(!1),e.finish(47);case 50:case"end":return e.stop()}}),e,null,[[5,42,47,50]])})));return function(n,t,i){return e.apply(this,arguments)}}(),q=function(){t(),I(null),M.current=null,x({id:"",type:"file",value:null,isVideo:!0,presignedURL:"",fileId:""}),Z(""),O()},J=N.trim().length>0,Q=Boolean(v.fileId);return(0,j.jsxs)(p.Z,{show:n,onHide:q,centered:!0,className:"media-gallery-form",dialogClassName:"media-gallery-form__dialog",children:[(0,j.jsx)(p.Z.Header,{closeButton:!0,children:(0,j.jsxs)("div",{className:"media-gallery-form__head",children:[(0,j.jsx)("span",{className:"media-gallery-form__icon","aria-hidden":!0,children:(0,j.jsx)("i",{className:"mdi mdi-video-plus-outline"})}),(0,j.jsxs)("div",{children:[(0,j.jsx)(p.Z.Title,{as:"h5",children:"Upload video"}
1),(0,j.jsx)("p",{children:"Title, then choose an MP4. Thumbnail is generated automatically."})]})]})}),(0,j.jsxs)(p.Z.Body,{children:[(0,j.jsxs)("section",{className:"media-gallery-form__section",children:[(0,j.jsxs)(d.Z.Label,{className:"media-gallery-form__label",htmlFor:"media-gallery-title",children:[(0,j.jsxs)("span",{children:["Title ",(0,j.jsx)("span",{className:"media-gallery-form__required",children:"*"})]}),(0,j.jsxs)("span",{className:"media-gallery-form__count",children:[N.length,"/80"]})]}),(0,j.jsx)(d.Z.Control,{id:"media-gallery-title",type:"text",maxLength:80,placeholder:"e.g. Knee mobility demo",value:N||"",autoFocus:!0,onChange:function(e){var n=e.target.value,t=n.charAt(0).toUpperCase()+n.slice(1);Z(t)}})]}),(0,j.jsxs)("div",{className:"media-gallery-form__layout",children:[(0,j.jsxs)("section",{className:"media-gallery-form__section",children:[(0,j.jsx)(d.Z.Label,{className:"media-gallery-form__label",children:"Video"}),(0,j.jsxs)("div",{className:"media-gallery-form__dropzone".concat(J?"":" is-disabled").concat(L?" has-file":""),children:[(0,j.jsx)(S.Z,{isVideo:!0,presignedURL:null===v||void 0===v?void 0:v.presignedURL,fileId:null===v||void 0===v?void 0:v.fileId,onUpload:function(e,n,t){return K(e,n,t)},alt:"Upload video",onFileChange:function(e){e&&I(e)}}),L&&(0,j.jsxs)("div",{className:"media-gallery-form__file",children:[(0,j.jsx)("i",{className:"mdi mdi-file-video-outline","aria-hidden":!0}),(0,j.jsxs)("div",{children:[(0,j.jsx)("strong",{children:L.name}),(0,j.jsxs)("span",{children:[(H=L.size,H||0===H?H<1024?"".concat(H," B"):H<1048576?"".concat((H/1024).toFixed(1)," KB"):"".concat((H/1048576).toFixed(1)," MB"):""),L.type?" \xb7 ".concat(L.type):""]})]})]})]}),!J&&(0,j.jsx)("p",{className:"media-gallery-form__hint media-gallery-form__hint--warn",children:"Enter a title first so the file can be uploaded."})]}),(0,j.jsxs)("section",{className:"media-gallery-form__section",children:[(0,j.jsx)(d.Z.Label,{className:"media-gallery-form__label",children:"Thumbnail"}),(0,j.jsx)("div",{className:"media-gallery-form__thumb",children:V?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)("img",{src:V,alt:"Generated video thumbnail"}),(0,j.jsx)("span",{className:"media-gallery-form__thumb-badge",children:"Auto-generated"})]}):(0,j.jsx)("div",{className:"media-gallery-form__skeleton",children:m?"Generating preview\u2026":"Pick a video to generate a thumbnail"})})]})]})]}),(0,j.jsxs)(p.Z.Footer,{children:[(0,j.jsx)("span",{className:"media-gallery-form__status",children:Q?"Ready to use in the gallery":L?"Click Upload under the preview to finish":"MP4 recommended \xb7 max practical size depends on your connection"}),(0,j.jsx)(g.Z,{variant:"secondary",onClick:q,children:Q?"Close":"Cancel"}),Q&&(0,j.jsx)(g.Z,{variant:"primary",onClick:q,children:"Done"})]})]})},V=function(e){var n=e.selectedVideo,t=e.setSelectedVideo,r=e.hideButton,o=e.pageLayout,c=void 0!==o&&o,d=e.pickerLayout,u=void 0!==d&&d,m=e.singleSelect,f=void 0!==m&&m,p=e.openCreateSignal,h=void 0===p?0:p,g=e.initialPageSize,v=void 0===g?9:g,x=(0,l.useState)([]),y=(0,a.Z)(x,2),b=y[0],N=y[1],Z=(0,l.useState)(!0),_=(0,a.Z)(Z,2),S=_[0],U=_[1],L=(0,l.useState)(!1),I=(0,a.Z)(L,2),P=I[0],R=I[1],E=(0,l.useState)(""),F=(0,a.Z)(E,2),V=F[0],z=F[1],M=(0,l.useState)([]),A=(0,a.Z)(M,2),B=A[0],W=A[1],D=(0,l.useState)(v),O=(0,a.Z)(D,2),H=O[0],G=O[1],K=(0,l.useState)(1),q=(0,a.Z)(K,2),J=q[0],Q=q[1],Y=(0,l.useState)(1),$=(0,a.Z)(Y,2),X=$[0],ee=$[1];(0,l.useEffect)((function(){h>0&&R(!0)}),[h]);var ne=function(){var e=(0,i.Z)(s().mark((function e(){var n,t,i,a,r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return U(!0),e.prev=1,e.next=4,(0,k.ww)({page:X,size:H,search:V,filters:JSON.stringify(B)});case 4:201===(n=e.sent).status&&(N(null===n||void 0===n||null===(t=n.data)||void 0===t||null===(i=t.payload)||void 0===i?void 0:i.docs),Q(null===n||void 0===n||null===(a=n.data)||void 0===a||null===(r=a.payload)||void 0===r?void 0:r.totalDocs)),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),console.error("Error fetching videos:",e.t0);case 11:return e.prev=11,U(!1),e.finish(11);case 14:case"end":return e.stop()}}),e,null,[[1,8,11,14]])}
1)));return function(){return e.apply(this,arguments)}}();(0,l.useEffect)((function(){ne()}),[X,H,V,B]);var te=function(){R(!1),ne()},ie=u?[{text:String(v),value:v}]:[{text:"9",value:9},{text:"45",value:45},{text:"90",value:90}],ae=(0,j.jsx)(C.Z,{onPageChange:ee,totalCount:J,siblingCount:1,currentPage:X,TBLData:b||[],sizePerPageList:ie,setPageSize:G,pageSize:H}),re=(0,j.jsx)(w,{setSelectedVideo:t,selectedVideo:n,videos:b,hideButton:r,hideChrome:c,pickerLayout:u,singleSelect:f,isLoading:S,onVideoClick:function(e){console.log("Video clicked:",e)},onAddNewClick:function(){R(!0)},onSearch:function(e){z(e.searchTerm),W(e.filters)}});return u?(0,j.jsxs)("div",{className:"select-media-modal__gallery".concat(6===v?" is-six":""),children:[re,(0,j.jsx)("div",{className:"select-media-modal__pagination",children:ae})]}):c?(0,j.jsxs)("div",{className:"mgmt-tab media-gallery-page",children:[re,(0,j.jsx)("div",{className:"mgmt-tab__footer",children:ae}),(0,j.jsx)(T,{showModal:P,handleCloseModel:te})]}):(0,j.jsxs)("div",{className:"bg-light min-vh-100",children:[re,(0,j.jsx)("div",{className:"p-2",children:ae}),(0,j.jsx)(T,{showModal:P,handleCloseModel:te})]})}},86314:function(e,n,t){t.d(n,{b:function(){return f}});var i=t(1413),a=t(15861),r=t(29439),s=t(64687),l=t.n(s),o=t(47313),c=t(16044),d=t(24275),u=t(40186),m=t(46417),f=function(e){var n=e.fileId,t=e.isVideo,s=void 0===t||t,f=e.height,p=void 0===f?"230px":f,h=e.title,g=e.showPreviewPlayer,v=void 0!==g&&g,x=e.thumbnailUrl,y=e.autoPlay,j=void 0!==y&&y,b=(0,o.useState)(),N=(0,r.Z)(b,2),Z=N[0],w=N[1],k=(0,o.useState)(!1),C=(0,r.Z)(k,2),_=C[0],S=C[1],U=(0,o.useState)(!1),L=(0,r.Z)(U,2),I=L[0],P=L[1],R=(0,o.useRef)(null),E=function(){var e=(0,a.Z)(l().mark((function e(n,t,i,a){var r,s,o;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,u.d)(n,t?"_1080p":"");case 3:o=e.sent,null!==(r=o.data)&&void 0!==r&&r.payload.presignedUrl?(w(o.data.payload.presignedUrl),S(!1)):null!==(s=o.data)&&void 0!==s&&s.payload.polling&&a<8?(i(a+1),setTimeout((function(){return E(n,t,i,a+1)}),7e3)):(S(!1),P(!0)),e.next=12;break;case 7:e.prev=7,e.t0=e.catch(0),console.error("Error while getting presigned URL:",e.t0),S(!1),P(!0);case 12:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(n,t,i,a){return e.apply(this,arguments)}}();(0,o.useEffect)((function(){if(n){S(!0);var e=0;E(n,s,(function(n){return e=n}),e)}}),[n]);var F=function(e){return!!e&&e.includes(".m3u8")};(0,o.useEffect)((function(){if(Z&&F(Z)&&v)if(d.ZP.isSupported()){var e=new d.ZP;e.loadSource(Z),R.current&&e.attachMedia(R.current)}else R.current&&R.current.canPlayType("application/vnd.apple.mpegurl")&&(R.current.src=Z)}),[Z]);var T={width:"100%",height:p,borderRadius:"10px 10px 0 0",overflow:"hidden"},V={width:"100%",height:"100%",objectFit:"contain",backgroundColor:"#000"};return(0,m.jsx)("div",{className:"",children:(0,m.jsxs)("div",{style:{width:"100%",borderRadius:"10px",overflow:"hidden",boxShadow:"0 4px 8px rgba(0, 0, 0, 0.1)",border:"1px solid #e0e0e0",backgroundColor:"#f8f8f8"},children:[_?(0,m.jsx)("div",{style:T,children:(0,m.jsxs)("div",{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"#f8f8f8"},children:[(0,m.jsx)("div",{className:"spinner",style:{width:"50px",height:"50px",border:"5px solid rgba(0, 0, 0, 0.1)",borderRadius:"50%",borderTop:"5px solid #3498db",animation:"spin 1s linear infinite"}}),(0,m.jsx)("style",{children:"\n                  @keyframes spin {\n                    0% { transform: rotate(0deg); }\n                    100% { transform: rotate(360deg); }\n                  }\n                "})]})}):!v&&x?(0,m.jsxs)("div",{style:{position:"relative",display:"inline-block"},children:[(0,m.jsx)("img",{src:x,alt:"Thumbnail",style:V}),(0,m.jsx)("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",backgroundColor:"rgba(0, 0, 0, 0.6)",borderRadius:"50%",padding:"12px",pointerEvents:"none"},children:(0,m.jsx)(c.gmG,{color:"white",size:20})})]}):Z?(0,m.jsx)("div",{style:T,children:F(Z)&&v?(0,m.jsx)("video",{ref:R,controls:!0,autoPlay:j,style:V}):s?(0,m.jsx)("video",{controls:!0,src:Z,style:V}):(0,m.jsx)("img",{src:Z,alt:"Preview",style:V})}):I?(0,m.jsx)("div",{style:(0,i.Z)((0,i.Z)({},T),{},{display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#fff"}),children:(0,m.jsxs)("div",{style:{display:"flex",alignItems:"center",padding:"20px",textAlign:"center"},children:[(0,m.jsx)("span",{style:{color:"red",fontWeight:"medium",fontSize:"16px"},children:"Failed to get file."}),(0,m.jsx)(c.WLu,{style:{marginLeft:"10px",cursor:"pointer",fontSize:"16px"},onClick:function(){if(n){S(!0),P(!1);var e=0;E(n,s,(function(n){return e=n}),e)}}})]})}):(0,m.jsx)("div",{style:T,children:(0,m.jsx)("div",{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"#f8f8f8",color:"#666"},children:"No preview available"})}),h&&(0,m.jsx)("div",{style:{padding:"10px",fontSize:"16px",fontWeight:"500",color:"#333",wordBreak:"break-word",backgroundColor:"#fff",borderTop:"1px solid #e0e0e0"},className:"text-truncate",children:h})]})})}},29792:function(e,n,t){t.d(n,{Z:function(){return m}});
1var i=t(29439),a=t(47313),r=t(2135),s=t(81258),l=t.n(s),o=t(93433),c="...",d=function(e,n){var t=n-e+1;return Array.from({length:t},(function(n,t){return t+e}))},u=t(46417),m=function(e){var n=e.onPageChange,t=e.totalCount,s=e.siblingCount,m=void 0===s?1:s,f=e.currentPage,p=e.pageSize,h=e.setPageSize,g=(e.TBLData,e.sizePerPageList),v=(0,a.useState)(f),x=(0,i.Z)(v,2),y=x[0],j=x[1],b=function(e){var n=e.totalCount,t=e.pageSize,i=e.siblingCount,r=void 0===i?1:i,s=e.currentPage;return(0,a.useMemo)((function(){var e=Math.ceil(n/t);if(r+5>=e)return d(1,e);var i=Math.max(s-r,1),a=Math.min(s+r,e),l=i>2,u=a<e-2,m=1,f=e;if(!l&&u){var p=d(1,3+2*r);return[].concat((0,o.Z)(p),[c,e])}if(l&&!u){var h=d(e-(3+2*r)+1,e);return[m,c].concat((0,o.Z)(h))}if(l&&u){var g=d(i,a);return[m,c].concat((0,o.Z)(g),[c,f])}}),[n,t,r,s])}({currentPage:f,totalCount:t,siblingCount:m,pageSize:p}),N=Math.ceil(t/p);(0,a.useEffect)((function(){j(f)}),[f]);var Z=function(e){e!==y&&n(e)},w=y;return t<=0||void 0===t?null:(0,u.jsx)(u.Fragment,{children:(0,u.jsxs)("div",{className:"mgmt-pagination d-flex align-items-center justify-content-end flex-wrap gap-2 pb-1",children:[g.length>0&&(0,u.jsxs)("div",{className:"d-inline-flex align-items-center",children:[(0,u.jsx)("label",{className:"me-1 mb-0",children:"Display :"}),(0,u.jsx)("select",{value:p,onChange:function(e){h(Number(e.currentTarget.value)),n(1)},className:"form-select d-inline-block w-auto",children:(g||[]).map((function(e,n){return(0,u.jsx)("option",{value:e.value,children:e.text},n.toString())}))})]}),(0,u.jsxs)("ul",{className:"pagination pagination-rounded d-inline-flex align-items-center mb-0",children:[(0,u.jsx)("li",{className:l()("page-item","paginate_button","previous",{disabled:1===w}),onClick:function(){1!==w&&Z(w-1)},children:(0,u.jsx)(r.rU,{to:"#",className:"page-link",children:(0,u.jsx)("i",{className:"mdi mdi-chevron-left"})})},"prevpage"),(b||[]).map((function(e,n,t){return t[n-1]+1<e?(0,u.jsxs)(a.Fragment,{children:[(0,u.jsx)("li",{className:"page-item disabled",children:(0,u.jsx)(r.rU,{to:"#",className:"page-link",children:"..."})}),(0,u.jsx)("li",{className:l()("page-item",{active:w===e}),onClick:function(n){return Z(e)},children:(0,u.jsx)(r.rU,{to:"#",className:"page-link",children:e})})]},e):(0,u.jsx)("li",{className:l()("page-item",{active:w===e}),onClick:function(n){return Z(e)},children:(0,u.jsx)(r.rU,{to:"#",className:"page-link",children:e})},e)})),(0,u.jsx)("li",{className:l()("page-item","paginate_button","next",{disabled:w===N}),onClick:function(){w!==N&&Z(w+1)},children:(0,u.jsx)(r.rU,{to:"#",className:"page-link",children:(0,u.jsx)("i",{className:"mdi mdi-chevron-right"})})},"nextpage")]})]})})}},13772:function(e,n,t){var i=t(15861),a=t(29439),r=t(64687),s=t.n(r),l=t(47313),o=t(21366),c=t(93298),d=t(16044),u=t(24275),m=t(40186),f=t(46417);n.Z=function(e){var n=e.presignedURL,t=e.fileId,r=e.onUpload,p=e.alt,h=void 0===p?"Upload Media":p,g=e.isVideo,v=void 0!==g&&g,x=e.defaultImage,y=e.isIcon,j=e.onFileChange,b=(0,l.useState)(n),N=(0,a.Z)(b,2),Z=N[0],w=N[1],k=(0,l.useState)(null),C=(0,a.Z)(k,2),_=C[0],S=C[1],U=(0,l.useState)(!!t&&!!n),L=(0,a.Z)(U,2),I=L[0],P=L[1],R=(0,l.useState)(!1),E=(0,a.Z)(R,2),F=E[0],T=E[1],V=(0,l.useState)(!1),z=(0,a.Z)(V,2),M=z[0],A=z[1],B=(0,l.useState)(!1),W=(0,a.Z)(B,2),D=W[0],O=W[1],H=(0,l.useState)(null),G=(0,a.Z)(H,2),K=G[0],q=G[1],J=(0,l.useRef)(null);(0,l.useEffect)((function(){!n&&x&&(w(x),fetch(x).then((function(e){return e.blob()})).then((function(e){var n=new File([e],"default-image.png",{type:e.type});S(n)})).catch((function(e){return console.error("Error fetching default image:",e)})))}),[n,x]);var Q=function(){var e=(0,i.Z)(s().mark((function e(n,t,i,a){var r,l,o;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,m.d)(n,t?"_1080p":"");case 3:o=e.sent,null!==(r=o.data)&&void 0!==r&&r.payload.presignedUrl?(w(o.data.payload.presignedUrl),T(!1)):null!==(l=o.data)&&void 0!==l&&l.payload.polling&&a<5?(i(a+1),setTimeout((function(){return Q(n,t,i,a+1)}),7e3)):(T(!1),O(!0)),e.next=12;break;case 7:e.prev=7,e.t0=e.catch(0),console.error("Error while getting presigned URL:",e.t0),T(!1),O(!0);case 12:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(n,t,i,a){return e.apply(this,arguments)}}();(0,l.useEffect)((function(){if(t&&!n){T(!0);var e=0;Q(t,v,(function(n){return e=n}),e)}}),[t,n]);var Y=function(e){return!!e&&e.includes(".m3u8")};(0,l.useEffect)((function(){if(Z&&Y(Z))if(u.ZP.isSupported()){var e=new u.ZP;e.loadSource(Z),J.current&&e.attachMedia(J.current)}else J.current&&J.current.canPlayType("application/vnd.apple.mpegurl")&&(J.current.src=Z)}),[Z]),(0,l.useEffect)((function(){return function(){K&&URL.revokeObjectURL(K)}}),[K]);var $=function(){var e=(0,i.Z)(s().mark((function e(){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!_){e.next=13;break}return A(!0),e.prev=2,e.next=5,r(_,A,P,y);case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(2),console.error("Error uploading file:",e.t0);case 10:return e.prev=10,A(!1),e.finish(10);case 13:case"end":return e.stop()}}
1),e,null,[[2,7,10,13]])})));return function(){return e.apply(this,arguments)}}();return(0,f.jsxs)("div",{children:[(0,f.jsx)(o.Z.Control,{type:"file",accept:v?"video/*":"image/*",onChange:function(e){var n,t=null===(n=e.target.files)||void 0===n?void 0:n[0];if(t)if(K&&(URL.revokeObjectURL(K),q(null)),S(t),j&&j(t),P(!1),t.name.toLowerCase().endsWith(".m3u8"))w("");else if(t.type.startsWith("video/")){var i=URL.createObjectURL(t);q(i),w(i)}else{var a=new FileReader;a.onload=function(){return w(a.result)},a.readAsDataURL(t)}}}),F?(0,f.jsxs)("div",{className:"mt-3 mb-2",style:{position:"relative"},children:[(0,f.jsx)("div",{style:{width:"100%",height:"200px",background:"linear-gradient(90deg, #f6f7f8 25%, #edeef1 50%, #f6f7f8 75%)",backgroundSize:"200% 100%",display:"flex",justifyContent:"center",alignItems:"center",zIndex:1,animation:"shimmer 1.5s infinite linear",borderRadius:"10px"},children:(0,f.jsx)("span",{style:{fontWeight:"bold"},children:"Preparing your media... Almost there!"})}),(0,f.jsx)("style",{children:"\
1n             @keyframes shimmer {\n               0% {\n                 background-position: 200% 0;\n               }\n               100% {\n                 background-position: -200% 0;\n               }\n             }\n           "})]}):Z&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"mt-3 mb-2",style:{position:"relative"},children:[M&&(0,f.jsx)("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(255, 255, 255, 0.8)",display:"flex",justifyContent:"center",alignItems:"center",zIndex:1,backdropFilter:"blur(5px)"},children:(0,f.jsx)("span",{children:"Your media is uploading..."})}),Y(Z)?(0,f.jsx)("video",{ref:J,controls:!0,style:{maxWidth:"100%"}}):v&&(Z.startsWith("data:video")||Z.startsWith("blob:"))?(0,f.jsx)("video",{controls:!0,src:Z,style:{maxWidth:"100%"}}):(0,f.jsx)("img",{src:Z,alt:h,className:"media-container",style:{maxWidth:"100%"}})]}),I?(0,f.jsxs)("div",{className:"d-flex align-items-center mt-2",children:[(0,f.jsx)(d.l_A,{style:{color:"green",fontSize:"1.5rem"}}),(0,f.jsx)("span",{className:"ms-2",children:"Uploaded"})]}):_&&(0,f.jsxs)(c.Z,{variant:"outline-primary",className:"mt-2",onClick:$,style:{minWidth:"100px"},children:[(0,f.jsx)("i",{className:"mdi mdi-upload"})," Upload"]})]}),D&&!F?(0,f.jsxs)("div",{className:"mt-3 mb-2",style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[(0,f.jsx)("span",{style:{color:"red"},children:"Failed to get file."}),(0,f.jsx)(d.WLu,{style:{marginLeft:"10px",cursor:"pointer"},onClick:function(){if(t){T(!0),O(!1);var e=0;Q(t,v,(function(n){return e=n}),e)}}})]}):null]})}},88922:function(e,n,t){t.d(n,{ww:function(){return l},rc:function(){return c}});var i=t(15861),a=t(64687),r=t.n(a),s=new(t(56434).u);function l(e){return o.apply(this,arguments)}function o(){return(o=(0,i.Z)(r().mark((function e(n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.create("/files/search",n);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function c(e,n){return d.apply(this,arguments)}function d(){return(d=(0,i.Z)(r().mark((function e(n,t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.update("/files/".concat(n,"/status"),{status:t});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},94991:function(){}}]);

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.