1(globalThis["webpackChunkcanvas_lms"]=globalThis["webpackChunkcanvas_lms"]||[]).push([[15372],{77464:(e,t,s)=>{"use strict" 2s.d(t,{V:()=>x}) 3var o=s(67294) 4var i=s(74265) 5var r=s(60474) 6var n=s(96580) 7var a=s(80958) 8var l=s(50641) 9var d=s(11493) 10var c=s(70917) 11const h=(e,t)=>{const s=t.size,o=t.href,i=t.onClick,r=t.disabled,n=t.hero,a=t.heading 12const l=o||i 13const d={small:{billboard:{padding:e.paddingSmall},hero:{fontSize:"3rem"},message:{fontSize:e.messageFontSizeSmall},heading:{...n&&{margin:`${e.mediumMargin} 0 0`}}},medium:{billboard:{padding:e.paddingMedium},hero:{fontSize:"5rem"},message:{fontSize:e.messageFontSizeMedium},heading:{}},large:{billboard:{padding:e.paddingLarge},hero:{fontSize:"10rem"},message:{fontSize:e.messageFontSizeLarge},heading:{}}} 14const c=l?{appearance:"none",boxSizing:"border-box",cursor:"pointer",userSelect:"none",touchAction:"manipulation",width:"100%",margin:"0",border:`${e.buttonBorderWidth} ${e.buttonBorderStyle} transparent`,borderRadius:e.buttonBorderRadius,background:e.backgroundColor,textDecoration:"none","&:hover":{borderStyle:e.buttonHoverBorderStyle},"&:hover, &:focus":{textDecoration:"none",outline:"none",borderColor:e.iconHoverColor,"& [class$=-billboard__hero]":{color:e.iconHoverColor}},"&:active":{background:e.clickableActiveBg,borderColor:e.iconHoverColor,"& [class$=-billboard__hero], & [class$=-billboard__message]":{color:e.clickableActiveText}}}:{backgroundColor:e.backgroundColor} 15return{billboard:{label:"billboard",boxSizing:"border-box",position:"relative",fontFamily:e.fontFamily,marginLeft:"auto",marginRight:"auto",textAlign:"center",display:"block",...d[s].billboard,...c,...r&&{cursor:"not-allowed",pointerEvents:"none",opacity:.5}},content:{label:"billboard__content",display:"block"},hero:{label:"billboard__hero",display:"block",color:e.iconColor,...d[s].hero,"& > img, & > svg":{maxWidth:"100%",display:"block",margin:"0 auto"},"& > img":{height:"auto"}},heading:{label:"billboard__heading",display:"block",...n&&{margin:`${e.largeMargin} 0 0`},...d[s].heading},message:{label:"billboard__message",display:"block",color:l?e.messageColorClickable:e.messageColor,...(n||a)&&{margin:`${e.mediumMargin} 0 0`},...d[s].message}}} 16const p=h 17const u=e=>{const t=e.borders,s=e.colors,o=e.spacing,i=e.typography,r=e.key 18const n={canvas:{iconHoverColor:e["ic-link-color"],messageColorClickable:e["ic-link-color"],clickableActiveBg:e["ic-brand-primary"]}} 19const a={fontFamily:null===i||void 0===i?void 0:i.fontFamily,paddingSmall:null===o||void 0===o?void 0:o.small,paddingMedium:null===o||void 0===o?void 0:o.medium,paddingLarge:null===o||void 0===o?void 0:o.medium,iconColor:null===s||void 0===s?void 0:s.textDark,mediumMargin:null===o||void 0===o?void 0:o.small,largeMargin:null===o||void 0===o?void 0:o.medium,iconHoverColor:null===s||void 0===s?void 0:s.textLink,backgroundColor:null===s||void 0===s?void 0:s.backgroundLightest,iconHoverColorInverse:null===s||void 0===s?void 0:s.textLightest,buttonBorderWidth:null===t||void 0===t?void 0:t.widthMedium,buttonBorderRadius:null===t||void 0===t?void 0:t.radiusLarge,messageColor:null===s||void 0===s?void 0:s.textDark,messageColorClickable:null===s||void 0===s?void 0:s.textLink,messageColorInverse:null===s||void 0===s?void 0:s.textLight,messageFontSizeSmall:null===i||void 0===i?void 0:i.fontSizeSmall,messageFontSizeMedium:null===i||void 0===i?void 0:i.fontSizeMedium,messageFontSizeLarge:null===i||void 0===i?void 0:i.fontSizeLarge,clickableActiveBg:null===s||void 0===s?void 0:s.backgroundBrand,clickableActiveText:null===s||void 0===s?void 0:s.textLightest,buttonBorderStyle:null===t||void 0===t?void 0:t.style,buttonHoverBorderStyle:"dashed"} 20return{...a,...n[r]}} 21const m=u 22var g=s(45697) 23var f=s.n(g) 24var v=s(85454) 25const y={hero:f().oneOfType([f().element,f().func]),size:f().oneOf(["small","medium","large"]),as:f().elementType,elementRef:f().func,heading:f().string,headingAs:f().oneOf(["h1","h2","h3","span"]),headingLevel:f().oneOf(["h1","h2","h3","h4"]),message:f().oneOfType([f().node,f().func]),onClick:f().func,href:f().string,disabled:f().bool,readOnly:f().bool,margin:v.j7.spacing} 26const b=["hero","size","as","elementRef","heading","headingAs","headingLevel","message","onClick","href","disabled","readOnly","margin"] 27var _,F,C 28let x=(_=(0,d.w)(p,m),_(F=(C=class e extends o.Component{constructor(...e){super(...e) 29this.ref=null 30this.handleRef=e=>{const t=this.props.elementRef 31this.ref=e 32"function"===typeof t&&t(e)} 33this.handleClick=e=>{const t=this.props,s=t.readOnly,o=t.onClick 34if(s){e.preventDefault() 35e.stopPropagation()}else"function"===typeof o&&o(e)}}componentDidMount(){var e,t 36null===(e=(t=this.props).makeStyles)||void 0===e||e.call(t)}componentDidUpdate(){var e,t 37null===(e=(t=this.props).makeStyles)||void 0===e||e.call(t)}renderHeading(){const e=this.props,t=e.headingLevel,s=e.headingAs,o=e.heading,r=e.styles 38return(0,c.tZ)("span",{css:null===r||void 0===r?void 0:r.heading},(0,c.tZ)(i.X,{level:t,as:s,color:"primary"},o))}get SVGIconSize(){const e=this.props.size 39return"small"===e?"medium":"large"===e?"x-large":"large"}renderHero(){return"function"===typeof this.props.hero?this.props.hero(this.SVGIconSize):this.props.hero}renderContent(){const e=this.props,t=e.heading,s=e.message,o=e.hero,i=e.styles 40return(0,c.tZ)("span",{css:null===i||void 0===i?void 0:i.content},o&&(0,c.tZ)("span",{css:null===i||void 0===i?void 0:i.hero},this.renderHero()),t&&this.renderHeading(),s&&(0,c.tZ)("span",{css:null===i||void 0===i?void 0:i.message}
40,(0,n.A)(s)))}render(){const t=this.props,s=t.href,o=t.disabled,i=t.readOnly,n=t.margin,d=t.styles 41const h=(0,a.B)(e,this.props) 42return(0,c.tZ)(r.G,{as:"div",margin:n},(0,c.tZ)(r.G,Object.assign({},(0,l.c)(this.props,[...e.allowedProps,...r.G.allowedProps]),{type:"button"===h?"button":void 0,as:h,elementRef:this.handleRef,css:null===d||void 0===d?void 0:d.billboard,href:s,onClick:this.handleClick,disabled:o,"aria-disabled":o||i?"true":void 0}),this.renderContent()))}},C.displayName="Billboard",C.componentId="Billboard",C.propTypes=y,C.allowedProps=b,C.defaultProps={disabled:false,readOnly:false,size:"medium",headingAs:"span",headingLevel:"h1",as:"span",elementRef:()=>{}},C))||F)},9:(e,t,s)=>{"use strict" 43s.d(t,{V:()=>n}) 44var o=s(67294) 45var i=s(23875) 46var r 47class n extends o.Component{constructor(...e){super(...e) 48this.ref=null 49this.handleRef=e=>{const t=this.props.elementRef 50this.ref=e 51"function"===typeof t&&t(e)}}render(){return o.createElement(i.q,Object.assign({},this.props,{name:"IconUpload",viewBox:"0 0 1920 1920",elementRef:this.handleRef}),r||(r=o.createElement("path",{d:"m1838.86 1451.576 81.14 81.37-361.566 361.566H361.566L0 1532.946l81.255-81.37 327.891 328.007h1101.708l328.006-328.007ZM962.333 25l500.285 500.285-81.14 81.37-361.795-361.681v1187.559H904.869V244.973L543.188 606.655l-81.14-81.37L962.333 25Z",fillRule:"evenodd"})))}}n.glyphName="upload" 52n.variant="Line" 53n.displayName="IconUploadLine" 54n.propTypes={...i.q.propTypes} 55n.allowedProps=[...i.q.allowedProps]},27670:(e,t,s)=>{"use strict" 56s.r(t) 57var o=s(63056) 58var i=s(67294) 59var r=s(73935) 60var n=s(55161) 61var a=s.n(n) 62var l=s(80129) 63var d=s.n(l) 64var c=s(14250) 65var h=s(6507) 66var p=s.n(h) 67var u=s(72555) 68var m=s.n(u) 69var g=s(25683) 70var f=s.n(g) 71const v={getInitialState:()=>({selectedItems:[]}),componentDidMount(){p()(window).on("keydown",this.handleCtrlPlusA)},componentWillUnmount(){p()(window).off("keydown",this.handleCtrlPlusA)},multiselectIgnoredElements:":input:not(.multiselectable-toggler), a",handleCtrlPlusA(e){let t 72if(t=e.target.nodeName.toLowerCase(),["input","textarea"].includes(t))return 73if(65===e.which&&(e.ctrlKey||e.metaKey)){e.preventDefault() 74return this.toggleAllSelected(!e.shiftKey)}},toggleAllSelected(e){e?this.setState({selectedItems:this.selectables()}):this.setState({selectedItems:[]})},areAllItemsSelected(){return this.state.selectedItems.length&&this.state.selectedItems.length===this.selectables().length},selectRange(e){const t=this.selectables() 75const s=t.indexOf(e) 76const o=t.indexOf(f().last(this.state.selectedItems)) 77const i=t.slice(Math.min(s,o),Math.max(s,o)+1) 78s>o&&i.reverse() 79this.setState({selectedItems:i})},clearSelectedItems(e){this.setState({selectedItems:[]},(()=>"function"===typeof e?e():void 0))},toggleItemSelected(e,t,s){let o 80if(t&&p()(t.target).closest(this.multiselectIgnoredElements).length)return 81if(null!=t?t.shiftKey:void 0)return this.selectRange(e) 82const i=this.state.selectedItems.includes(e) 83const r=t&&t.metaKey||t&&t.ctrlKey||"checkbox"===(t&&t.target.type) 84if(r&&i)o=f().without(this.state.selectedItems,e) 85else if(r){o=this.state.selectedItems.slice() 86o.push(e)}else o=i?[]:[e] 87return this.setState({selectedItems:o},(()=>"function"===typeof s?s():void 0))}} 88var y=s(70730) 89var b=s(879) 90const _=10 91function F(e){return(0,o.Z)("div",{className:"DragFeedback",style:{WebkitTransform:`translate3d(${e.pageX+6}px, ${e.pageY+6}px, 0)`,transform:`translate3d(${e.pageX+6}px, ${e.pageY+6}px, 0)`}},void 0,e.itemsToDrag.slice(0,_).map(((e,t)=>(0,o.Z)(y.Z,{model:e,style:{left:10+5*t-t,top:10+5*t-t}},e.id))),(0,o.Z)("span",{className:"badge badge-important"},void 0,e.itemsToDrag.length))}var C=s(61323) 92var x=s(85581) 93const Z=(0,C.useScope)("react_files") 94function w(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{} 95const o=p().Deferred() 96e.moveTo(t,s).then((e=>o.resolve(e)),((s,n,a)=>{if(409!==s.status)return o.reject() 97r.render(i.createFactory(x.Z)({onClose(){},closeWithX:()=>o.reject(),closeOnResolve:true,fileOptions:{name:e.attributes.display_name},onNameConflictResolved:s=>w(e,t,s).then((e=>o.resolve(e)),(()=>o.reject()))}),p()("<div>").appendTo("body")[0])})) 98return o}function S(e,t){const s=e.map((e=>w(e,t))) 99return p().when(...s).then((()=>{p().flashMessage(Z.t("move_success",{one:"%{item} moved to %{destinationFolder}",other:"%{count} items moved to %{destinationFolder}"},{count:e.length,item:e[0]&&e[0].displayName(),destinationFolder:t.displayName()}))}))}const N={itemsToDrag(){return this.state.selectedItems},renderDragFeedback(e){let{pageX:t,pageY:s}=e 100this.dragHolder||(this.dragHolder=p()("<div>").appendTo(document.body)) 101r.render((0,o.Z)(F,{pageX:t,pageY:s,itemsToDrag:this.itemsToDrag()}),this.dragHolder[0])},removeDragFeedback(){p()(document).off(".MultiDraggableMixin") 102this.dragHolder&&r.unmountComponentAtNode(this.dragHolder[0]) 103this.dragHolder=null},onItemDragStart(e){try{const t=this.itemsToDrag()
104t.length&&f().isArray(t)&&e.dataTransfer.setData("text/uri-list",t.map((e=>e.get("url"))).join("\n")) 105const s=new Image 106s.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" 107e.dataTransfer.setDragImage(s,150,150)}catch(e){}this.renderDragFeedback(e) 108e.dataTransfer.effectAllowed="move" 109e.dataTransfer.setData("Text","in_a_dndMixin_drag") 110return p()(document).on({"dragover.MultiDraggableMixin":e=>this.renderDragFeedback(e.originalEvent),"dragend.MultiDraggableMixin":this.removeDragFeedback})},onItemDragEnterOrOver(e,t){const s=e.dataTransfer.types||[] 111if(!s.includes("Text")&&!s.includes("text/plain"))return 112e.preventDefault() 113if(t)return t(e)},onItemDragLeaveOrEnd(e,t){const s=e.dataTransfer.types||[] 114if(!s.includes("Text")&&!s.includes("text/plain"))return 115if(t)return t(e)},onItemDrop(e,t,s){if("in_a_dndMixin_drag"!==(e.dataTransfer.getData("Text")||e.dataTransfer.getData("text/plain")))return 116e.preventDefault() 117return S(this.itemsToDrag(),t).then((()=>{if(s)return s({success:true,event:e})}),(()=>{if(s)return s({success:false,event:e})})).done(this.clearSelectedItems)}} 118const T={displayName:"FilesApp",onResolvePath(e){let{currentFolder:t,rootTillCurrentFolder:s,showingSearchResults:o,searchResultCollection:i}=e 119const{updatedModels:r}=this.state 120t&&!o&&r.forEach(((e,s,o)=>{let i 121if(t.id.toString()!==e.get("folder_id")&&(i=t.files.findWhere({id:e.get("id")}))){t.files.remove(i) 122o.splice(s,1)}})) 123return this.setState({currentFolder:t,rootTillCurrentFolder:s,showingSearchResults:o,selectedItems:[],searchResultCollection:i,updatedModels:r})},getInitialState:()=>({updatedModels:[],currentFolder:null,rootTillCurrentFolder:null,showingSearchResults:false,showingModal:false,modalContents:null}),mixins:[v,N],selectables(){return this.state.showingSearchResults?this.state.searchResultCollection.models:this.state.currentFolder.children(this.props.query)},onMove(e){const t=f().uniq(this.state.updatedModels.concat(e),"id") 124this.setState({updatedModels:t})},getPreviewQuery(){const e={preview:this.state.selectedItems[0]&&this.state.selectedItems[0].id||true} 125this.state.selectedItems.length>1&&(e.only_preview=this.state.selectedItems.map((e=>e.id)).join(",")) 126this.props.query&&this.props.query.search_term&&(e.search_term=this.props.query.search_term) 127this.props.query&&this.props.query.sort&&(e.sort=this.props.query.sort) 128this.props.query&&this.props.query.order&&(e.order=this.props.query.order) 129return e},openModal(e,t){this.setState({modalContents:e,showingModal:true,afterModalClose:t})},closeModal(){this.setState({showingModal:false},(()=>this.state.afterModalClose()))}} 130var I=s(45697) 131var k=s.n(I) 132const R=500 133const M=80 134const D={displayName:"Breadcrumbs",propTypes:{rootTillCurrentFolder:k().arrayOf(b.Z.folder),contextAssetString:k().string.isRequired},getInitialState:()=>({maxCrumbWidth:R,availableWidth:2e5}),UNSAFE_componentWillMount(){this.fixOldCrumbs()},componentDidMount(){p()(window).on("resize",this.handleResize) 135this.handleResize()},componentWillUnmount(){p()(window).off("resize",this.handleResize)},fixOldCrumbs(){const e=p()("#breadcrumbs") 136const t=1.5*e.find("li:visible:first").height() 137const s=e.find(".home").text() 138const o=e.find("li").eq(1).find("a") 139const i=o.attr("href") 140const r=o.text() 141p()(".ic-app-nav-toggle-and-crumbs").remove() 142this.setState({homeName:s,contextUrl:i,contextName:r,heightOfOneBreadcrumb:t})},handleResize(){this.startRecalculating(window.innerWidth)},startRecalculating(e){this.setState({availableWidth:e,maxCrumbWidth:R},this.checkIfCrumbsFit)},UNSAFE_componentWillReceiveProps(){setTimeout(this.startRecalculating)},checkIfCrumbsFit(){if(!this.state.heightOfOneBreadcrumb)return 143const e=p()(r.findDOMNode(this.refs.breadcrumbs)).height() 144if(e>this.state.heightOfOneBreadcrumb&&this.state.maxCrumbWidth>M){const e=Math.max(M,this.state.maxCrumbWidth-20)
145this.setState({maxCrumbWidth:e},this.checkIfCrumbsFit)}}} 146var E=s(94184) 147var A=s.n(E) 148var O,L,q 149class U extends i.Component{constructor(){super(...arguments) 150this.state={open:false} 151this.open=()=>{window.clearTimeout(this.timeout) 152this.setState({open:true})} 153this.close=()=>{this.timeout=window.setTimeout((()=>{this.setState({open:false})}),100)}}render(){const e=A()({open:this.state.open,closed:!this.state.open,popover:true,bottom:true,"ef-breadcrumb-popover":true}) 154return(0,o.Z)("li",{href:"#",onMouseEnter:this.open,onMouseLeave:this.close,onFocus:this.open,onBlur:this.close,style:{position:"relative"}},void 0,O||(O=(0,o.Z)("a",{href:"#"},void 0,"â¦")),(0,o.Z)("div",{className:e},void 0,L||(L=(0,o.Z)("div",{className:"arrow"})),(0,o.Z)("div",{className:"popover-content"},void 0,(0,o.Z)("ul",{},void 0,this.props.foldersToContain.map((e=>(0,o.Z)("li",{},e.cid,(0,o.Z)("a",{href:e.urlPath()?`${c.Z.baseUrl}/folder/${e.urlPath()}`:c.Z.baseUrl,activeClassName:"active",className:"ellipsis"},void 0,q||(q=(0,o.Z)("i",{className:"ef-big-icon icon-folder"})),(0,o.Z)("span",{},void 0,e.get("name"))))))))))}}U.displayName="BreadcrumbCollapsedContainer" 155const B=U 156var P=s(93852) 157const $=(0,C.useScope)("react_files") 158const W=80 159D.renderSingleCrumb=function(e,t,s){const[i,r]=(0,P.Z)(this.props.contextAssetString,false) 160const n=!e||!!(e&&(e.get("context_type")||"").toLowerCase()===i&&(e.get("context_id")||-1).toString()===r) 161const a=s&&n?$.t("files","Files"):e&&(e.get("custom_name")||e.get("name")) 162return(0,o.Z)("li",{},a,(0,o.Z)("a",{href:s&&n?c.Z.baseUrl:`${c.Z.baseUrl}/folder/${e?e.urlPath():null}`,title:this.state.maxCrumbWidth<500?a:null},void 0,(0,o.Z)("span",{className:"ellipsis",style:{maxWidth:t?null:this.state.maxCrumbWidth}},void 0,a)))} 163D.renderDynamicCrumbs=function(){if(this.props.showingSearchResults)return[this.renderSingleCrumb(null,false,true),(0,o.Z)("li",{},"searchLink",(0,o.Z)("a",{href:"/search"},void 0,(0,o.Z)("span",{className:"ellipsis"},void 0,this.props.query.search_term&&$.t("search_results_for",'search results for "%{search_term}"',{search_term:this.props.query.search_term}))))] 164{if(!this.props.rootTillCurrentFolder||!this.props.rootTillCurrentFolder.length)return[] 165const e=this.props.rootTillCurrentFolder.slice(0,this.props.rootTillCurrentFolder.length-1) 166const t=this.props.rootTillCurrentFolder[this.props.rootTillCurrentFolder.length-1] 167return this.state.maxCrumbWidth>W?this.props.rootTillCurrentFolder.map(((e,s)=>this.renderSingleCrumb(e,e===t,0===s))):[(0,o.Z)(B,{foldersToContain:e}),this.renderSingleCrumb(t,true)]}} 168D.render=function(){return i.createElement("nav",{"aria-label":"breadcrumbs",role:"navigation",id:"breadcrumbs",ref:"breadcrumbs"},(0,o.Z)("ul",{},void 0,(0,o.Z)("li",{className:"home"},void 0,(0,o.Z)("a",{href:"/"},void 0,(0,o.Z)("i",{className:"icon-home standalone-icon",title:this.state.homeName},void 0,(0,o.Z)("span",{className:"screenreader-only"},void 0,this.state.homeName)))),(0,o.Z)("li",{},void 0,(0,o.Z)("a",{href:this.state.contextUrl},void 0,(0,o.Z)("span",{className:"ellipsible"},void 0,this.state.contextName))),this.renderDynamicCrumbs()))} 169const z=m()(D) 170var V=s(8639) 171class H{static create(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{} 172t.render||(t.render=false) 173const s=new V.Z(e) 174const o={view:s,viewOptions:e,renderOptions:t} 175const i=this.views.push(o) 176const r=i-1 177this.set(r,{index:r}) 178if(t.render){null==t.element&&console.error("`element` option missing error: An element to attach the TreeBrowserView to must be specified when setting the render option to 'true' for BBTreeBrowserView") 179t.element&&this.render(r,t.element,t.callback)}return this.get(r)}static set(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{} 180let s 181if(s=this.get(e)){const e=p().extend(s,t) 182return e}}static get(e){return this.views[e]||null}static getView(e){return this.get(e)&&this.get(e).view||null}static remove(e){this.views.splice(e,1) 183return this.refresh()}static getViews(){return this.views}static render(e,t,s){setTimeout((()=>{const s=this.getView(e) 184if(s){const e=s.render() 185e&&e.$el&&e.$el.appendTo(t)}}),0) 186if("function"===typeof s)return s()}static refresh(){return this.views.map((e=>{const{index:t}=e 187const s=this.get(t) 188this.remove(t) 189e.view.destroyView() 190const o=this.create(s.viewOptions,s.renderOptions) 191s.renderOptions.render||this.render(o.index,o.renderOptions.element,o.renderOptions.callback) 192return o}
192))}}H.views=[] 193var j=s(86840) 194const Y=(0,C.useScope)("rootFoldersFinder") 195function K(e){this.rootFoldersToShow=e.rootFoldersToShow 196this.contentTypes=e.contentTypes 197this.useVerifiers=e.useVerifiers}K.prototype.find=function(){if(this.rootFoldersToShow)return this.rootFoldersToShow 198return K.rootFolders||(K.rootFolders=(e=this,function(){let t=null 199const s=(0,P.Z)(ENV.context_asset_string||"") 200if(s&&2===s.length&&("courses"===s[0]||"groups"===s[0])){t=new j.Z({contentTypes:e.contentTypes}) 201t.set("custom_name","courses"===s[0]?Y.t("course_files","Course files"):Y.t("group_files","Group files")) 202t.url="/api/v1/"+s[0]+"/"+s[1]+"/folders/root" 203t.fetch()}const o=new j.Z({contentTypes:e.contentTypes,useVerifiers:e.useVerifiers}) 204o.set("custom_name",Y.t("my_files","My files")) 205o.url="/api/v1/users/self/folders/root" 206o.fetch() 207const i=[] 208t&&i.push(t) 209i.push(o) 210return i})()) 211var e} 212const X=K 213s(42449) 214const J=(0,C.useScope)("folder_tree") 215const G={displayName:"FolderTree",propTypes:{rootFoldersToShow:k().arrayOf(b.Z.folder).isRequired,rootTillCurrentFolder:k().arrayOf(b.Z.folder)},componentDidMount(){const e=new X({rootFoldersToShow:this.props.rootFoldersToShow}) 216this.treeBrowserId=H.create({onlyShowSubtrees:true,rootModelsFinder:e,onClick:this.onClick,dndOptions:this.props.dndOptions,href:this.hrefFor,focusStyleClass:this.focusStyleClass,selectedStyleClass:this.selectedStyleClass,autoFetch:true,fetchItAll:"to heck"},{render:true,element:r.findDOMNode(this.refs.FolderTreeHolder)}).index 217this.expandTillCurrentFolder(this.props)},componentWillUnmount(){H.remove(this.treeBrowserViewId)},UNSAFE_componentWillReceiveProps(e){this.expandTillCurrentFolder(e)},onClick(e,t){e.preventDefault() 218p()(r.findDOMNode(this.refs.FolderTreeHolder)).find(`.${this.focusStyleClass}`).each(((e,t)=>p()(t).removeClass(this.focusStyleClass))) 219p()(r.findDOMNode(this.refs.FolderTreeHolder)).find(`.${this.selectedStyleClass}`).each(((e,t)=>p()(t).removeClass(this.selectedStyleClass))) 220if(t.get("locked_for_user")){const e=J.t("This folder is currently locked and unavailable to view.") 221p().flashError(e) 222p().screenReaderFlashMessage(e)}else{p().screenReaderFlashMessageExclusive(J.t("File list updated")) 223a()(`${c.Z.baseUrl}/folder/${t.urlPath()}`)}},hrefFor(e){},focusStyleClass:"FolderTree__folderItem--focused",selectedStyleClass:"FolderTree__folderItem--selected",expandTillCurrentFolder(e){function t(s){const o=e.rootTillCurrentFolder&&e.rootTillCurrentFolder[s] 224if(!o)return 225return o.expand(false,{onlyShowSubtrees:true}).then((()=>t(s+1)))}return t(0)}} 226G.render=function(){return i.createElement("div",{className:"ef-folder-list",ref:"FolderTreeHolder"})} 227const Q=m()(G) 228const ee={displayName:"FilesUsage",url(){return`/api/v1/${this.props.contextType}/${this.props.contextId}/files/quota`},propTypes:{contextType:b.Z.contextType.isRequired,contextId:b.Z.contextId.isRequired},update(){return p().get(this.url(),(e=>{this.setState(e)}))},componentDidMount(){this.update() 229this.interval=setInterval(this.update,3e5)},componentWillUnmount(){clearInterval(this.interval)}} 230var te=s(45208) 231var se 232const oe=(0,C.useScope)("react_files") 233ee.render=function(){if(this.state){const e=Math.round(this.state.quota_used/this.state.quota*100) 234const t=oe.t("%{percentUsed} of %{bytesAvailable} used",{percentUsed:oe.n(e,{percentage:true}),bytesAvailable:(0,te.Z)(this.state.quota)}) 235const s=oe.t("Files Quota: %{percentUsed} of %{bytesAvailable} used",{percentUsed:oe.n(e,{percentage:true}),bytesAvailable:(0,te.Z)(this.state.quota)}) 236return(0,o.Z)("div",{className:"grid-row ef-quota-usage"},void 0,(0,o.Z)("div",{className:"col-xs-3"},void 0,i.createElement("div",{ref:"container",className:"progress-bar__bar-container","aria-hidden":true},i.createElement("div",{ref:"bar",className:"progress-bar__bar",style:{width:Math.min(e,100)+"%"}}))),(0,o.Z)("div",{className:"col-xs-9",style:{paddingLeft:"0px"},"aria-hidden":true},void 0,t),(0,o.Z)("div",{className:"screenreader-only"},void 0,s))}return se||(se=(0,o.Z)("div",{}))} 237const ie=m()(ee) 238const re={_itemToFocus:null,setItemToFocus(e){return this._itemToFocus=e},getItemToFocus(){return this._itemToFocus},setFocusToItem(){if(this._itemToFocus)return this._itemToFocus.focus() 239throw new Error("FocusStore has not been set.")}} 240const ne=(0,C.useScope)("react_files") 241const ae={displayName:"MoveDialog",propTypes:{rootFoldersToShow:k().arrayOf(b.Z.folder).isRequired,thingsToMove:k().arrayOf(b.Z.filesystemObject).isRequired,onClose:k().func.isRequired,onMove:k().func.isRequired},getInitialState:()=>({destinationFolder:null,isOpen:true}),contextsAreEqual(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{} 242let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[] 243const s=t.filter((t=>{const s=t.get("context_asset_string") 244const[o,i]=s?(0,P.Z)(s,false):[t.collection&&t.collection.parentFolder&&t.collection.parentFolder.get("context_type")||t.get("context_type"),t.collection&&t.collection.parentFolder&&t.collection.parentFolder.get("context_id")&&t.collection.parentFolder.get("context_id").toString()||t.get("context_id").toString()]
245return o.toLowerCase()===e.get("context_type").toLowerCase()&&i===(e.get("context_id")&&e.get("context_id").toString())})) 246return!!s.length},onSelectFolder(e,t){e.preventDefault() 247t.get("for_submissions")?this.setState({destinationFolder:null}):this.setState({destinationFolder:t,isCopyingFile:!this.contextsAreEqual(t,this.props.thingsToMove)})},submit(){const e=this.props.thingsToMove 248const t=S(e,this.state.destinationFolder) 249return t.then((()=>{this.props.onMove(e) 250this.closeDialog()}))},closeDialog(){this.setState({isOpen:false},(function(){this.props.onClose()}))},getTitle(){return ne.t("move_question",{one:"Where would you like to move %{item}?",other:"Where would you like to move these %{count} items?"},{count:this.props.thingsToMove.length,item:this.props.thingsToMove[0]&&this.props.thingsToMove[0].displayName()})}} 251var le=s(31914) 252var de=s(55139) 253var ce=s(46276) 254const he=(0,C.useScope)("react_files") 255class pe extends i.Component{componentDidMount(){const e=new X({rootFoldersToShow:this.props.rootFoldersToShow}) 256this.treeBrowserViewId=H.create({onlyShowSubtrees:true,rootModelsFinder:e,rootFoldersToShow:this.props.rootFoldersToShow,onClick:this.props.onSelectFolder,focusStyleClass:"MoveDialog__folderItem--focused",selectedStyleClass:"MoveDialog__folderItem--selected"},{element:r.findDOMNode(this.refs.FolderTreeHolder)}).index 257window.setTimeout((()=>{H.getView(this.treeBrowserViewId).render().$el.appendTo(r.findDOMNode(this.refs.FolderTreeHolder)).find(":tabbable:first").focus()}),0)}componentWillUnmount(){H.remove(this.treeBrowserViewId)}render(){return(0,o.Z)("aside",{role:"region","aria-label":he.t("folder_browsing_tree","Folder Browsing Tree")},void 0,i.createElement("div",{ref:"FolderTreeHolder"}))}}pe.displayName="BBTreeBrowser" 258const ue=pe 259const me=(0,C.useScope)("react_files") 260ae.renderMoveButton=function(){const e=A()({disabled:!this.state.destinationFolder,btn:true,"btn-primary":true}) 261return this.state.isCopyingFile?(0,o.Z)("button",{type:"submit","aria-disabled":!this.state.destinationFolder,className:e,"data-text-while-loading":me.t("Copying...")},void 0,me.t("Copy to Folder")):(0,o.Z)("button",{type:"submit","aria-disabled":!this.state.destinationFolder,className:e,"data-text-while-loading":me.t("Moving...")},void 0,me.t("Move"))} 262ae.render=function(){return i.createElement(le.Z,{className:"ReactModal__Content--canvas ReactModal__Content--mini-modal",overlayClassName:"ReactModal__Overlay--canvas",ref:"canvasModal",isOpen:this.state.isOpen,title:this.getTitle(),onRequestClose:this.closeDialog,onSubmit:this.submit},(0,o.Z)(de.Z,{},void 0,(0,o.Z)(ue,{rootFoldersToShow:this.props.rootFoldersToShow,onSelectFolder:this.onSelectFolder})),(0,o.Z)(ce.Z,{},void 0,(0,o.Z)("button",{type:"button",className:"btn",onClick:this.closeDialog},void 0,me.t("Cancel")),this.renderMoveButton()))} 263const ge=m()(ae) 264function fe(e,t){let{contextType:s,contextId:i,returnFocusTo:n,clearSelectedItems:a,onMove:l}=t 265const d=f().find(c.Z.rootFolders,(e=>`${e.get("context_type").toLowerCase()}s`===s&&String(e.get("context_id"))===String(i))) 266const h=p()("<div>").appendTo(document.body) 267const u=()=>{r.unmountComponentAtNode(h[0]) 268h.remove() 269p()(n).focus()} 270const m=e=>{l(e)&&a()} 271r.render((0,o.Z)(ge,{thingsToMove:e,rootFoldersToShow:c.Z.showingAllContexts?c.Z.rootFolders:[d],onClose:u,onMove:m}),h[0])}const ve=fe 272const ye=(0,C.useScope)("react_files") 273function be(e,t){const s=e.some((e=>e.get("folders_count")||e.get("files_count"))) 274const o=s?ye.t("confirm_delete_with_contents",{one:"Are you sure you want to delete %{name}? It is not empty, anything inside it will be deleted too.",other:"Are you sure you want to delete these %{count} items and everything inside them?"},{count:e.length,name:e[0]&&e[0].displayName()}):ye.t({one:"Are you sure you want to delete %{name}?",other:"Are you sure you want to delete these %{count} items?"},{count:e.length,name:e[0]&&e[0].displayName()}) 275if(!window.confirm(o))return 276const i=e.map((e=>e.destroy({emulateHTTP:true,emulateJSON:true,data:{force:"true"},wait:true,error(t,s,o){const i=(()=>{try{const e=p().parseJSON(s.responseText) 277return e&&e.message}catch(e){}})() 278return p().flashError(ye.t("Error deleting %{name}: %{reason}",{name:e.displayName(),reason:i}))}}))) 279return p().when(...Array.from(i||[])).then((()=>{p().flashMessage(ye.t({one:"%{name} deleted successfully.",other:"%{count} items deleted successfully."},{count:e.length,name:e[0]&&e[0].displayName()})) 280t&&t.returnFocusTo&&t.returnFocusTo.focus()}))}var _e=s(2750) 281var Fe=s(75181) 282var Ce 283const xe=(0,C.useScope)("upload_button") 284const Ze=function(e){const t=(0,i.useRef)(null) 285const[s,r]=(0,i.useState)(Fe.Z.pendingUploads()) 286const n=(0,i.useCallback)((e=>{r(!!e.pendingUploads())}),[]);(0,i.useEffect)((()=>{Fe.Z.addChangeListener(n) 287return()=>Fe.Z.removeChangeListener(n)}),[]) 288function a(){var e 289null===(e=t.current)||void 0===e||e.addFiles()}const l=e=>xe.t('A file named "%{name}" already exists in this folder. Do you want to replace the existing file?',{name:e}) 290const d=e=>xe.t('A locked file named "%{name}" already exists in this folder. Please enter a new name.',{name:e}) 291return i.createElement(i.Fragment,null,i.createElement(_e.Z,{allowSkip:true,ref:t,currentFolder:e.currentFolder,contextId:e.contextId,contextType:e.contextType,onRenameFileMessage:l,onLockFileMessage:d}),(0,o.Z)("button",{type:"button",className:"btn btn-primary btn-upload",onClick:a,disabled:s},void 0,Ce||(Ce=(0,o.Z)("i",{className:"icon-upload","aria-hidden":true})),"Â ",(0,o.Z)("span",{className:A()({"hidden-phone":e.showingButtons})},void 0,xe.t("Upload"))))} 292Ze.defaultProps={showingButtons:false} 293const we=Ze 294var Se=s(83624) 295var Ne=s(2790) 296var Te=s(82608) 297const Ie=(0,C.useScope)("react_files")
298function ke(e,t){let{contextType:s,contextId:o}=t 299let i 300const r=[] 301const n=[] 302e.forEach((e=>{e instanceof j.Z?n.push(e.id):r.push(e.id)})) 303const a=`/api/v1/${s}/${o}/content_exports` 304const l=2500 305const d=f().throttle(p().screenReaderFlashMessageExclusive,l,{leading:false}) 306const c=p()('<div style="position: fixed; top: 4px; left: 50%; margin-left: -120px; width: 240px; z-index: 11; text-align: center; box-sizing: border-box; padding: 8px;" class="alert alert-info">') 307function h(e){const t=Ie.t("progress_message","Preparing download: %{percent}% complete",{percent:e.completion}) 308c.appendTo("body").text(t) 309return d(t)}const u={export_type:"zip",select:{files:r,folders:n}} 310p()(window).on("beforeunload",i=()=>Ie.t("If you leave, the zip file download currently being prepared will be canceled.")) 311return p().post(a,u).pipe((e=>new Te.Z({url:e.progress_url}).poll().progress(h))).pipe((e=>{const t=e.context_id 312return p().getJSON(`${a}/${t}`)})).pipe((e=>{p()(window).off("beforeunload",i) 313"exported"===e.workflow_state?window.location=e.attachment.url:p().flashError(Ie.t("An error occurred trying to prepare download, please try again."))})).fail((()=>p().flashError(Ie.t("An error occurred trying to prepare download, please try again.")))).always((()=>{p()(window).off("beforeunload",i) 314c.remove()}))}var Re=s(98573) 315var Me=s(67343) 316var De=s(45503) 317var Ee,Ae,Oe,Le,qe,Ue,Be,Pe,$e,We,ze 318const Ve=(0,C.useScope)("react_files") 319class He extends i.Component{constructor(){super(...arguments) 320this.renderTrayToolsMenu=()=>{var e 321if((null===(e=this.props.indexExternalToolsForContext)||void 0===e?void 0:e.length)>0)return(0,o.Z)("div",{className:"inline-block"},void 0,(0,o.Z)("a",{className:"al-trigger btn",id:"file_menu_link",role:"button",tabIndex:"0",title:Ve.t("Files Menu"),"aria-label":Ve.t("Files Menu")},void 0,Ee||(Ee=(0,o.Z)("i",{className:"icon-more","aria-hidden":"true"})),(0,o.Z)("span",{className:"screenreader-only"},void 0,Ve.t("Files Menu"))),(0,o.Z)("ul",{className:"al-options",role:"menu"},void 0,this.props.indexExternalToolsForContext.map((e=>(0,o.Z)("li",{role:"menuitem"},e.id,(0,o.Z)("a",{"aria-label":e.title,href:"#",onClick:this.onLaunchTrayTool(e)},void 0,this.iconForTrayTool(e),e.title))))),Ae||(Ae=(0,o.Z)("div",{id:"external-tool-mount-point"})))} 322this.onLaunchTrayTool=e=>t=>{null!=t&&t.preventDefault() 323this.setExternalToolTray(e,document.getElementById("file_menu_link"))}}UNSAFE_componentWillMount(){this.downloadTitle=Ve.t("Download as Zip") 324this.tabIndex=null}addFolder(){return this.props.currentFolder.folders.add({})}getItemsToDownload(){return this.props.selectedItems.filter((e=>!e.get("locked_for_user")))}downloadSelectedAsZip(){if(!this.getItemsToDownload().length)return 325return ke(this.getItemsToDownload(),{contextType:this.props.contextType,contextId:this.props.contextId})}UNSAFE_componentWillUpdate(e){this.showingButtons=e.selectedItems.length}openRestrictedDialog(){const e=p()("<div>").dialog({title:Ve.t({one:"Edit permissions for: %{itemName}",other:"Edit permissions for %{count} items"},{count:this.props.selectedItems.length,itemName:this.props.selectedItems[0].displayName()}),width:800,minHeight:400,close(){r.unmountComponentAtNode(this) 326p()(this).remove()}}) 327r.render((0,o.Z)(Re["default"],{models:this.props.selectedItems,usageRightsRequiredForContext:this.props.usageRightsRequiredForContext,closeDialog:()=>e.dialog("close")}),e[0])}openUsageRightsDialog(){const e=(0,o.Z)(Ne.Z,{isOpen:true,closeModal:this.props.modalOptions.closeModal,itemsToManage:this.props.selectedItems,userCanRestrictFilesForContext:this.props.userCanRestrictFilesForContext}) 328return this.props.modalOptions.openModal(e,(()=>this.refs.usageRightsBtn.focus()))}openPreview(){re.setItemToFocus(this.refs.previewLink) 329const e=p().param(this.props.getPreviewQuery()) 330a()(`${this.props.getPreviewRoute()}?${e}`)}onSubmitSearch(){const e=this.refs.searchTerm.value 331a()(`/search?search_term=${e}`)}iconForTrayTool(e){if(e.canvas_icon_class)return(0,o.Z)("i",{className:e.canvas_icon_class}) 332if(e.icon_url)return(0,o.Z)("img",{className:"icon",alt:"",src:e.icon_url})}setExternalToolTray(e,t){const s=()=>{var e 333this.setExternalToolTray(null) 334t.focus() 335null!==De.h2&&void 0!==De.h2&&null!==(e=De.h2.tray)&&void 0!==e&&e.refreshOnClose&&window.location.reload()} 336r.render((0,o.Z)(Me.Z,{tool:e,placement:"file_index_menu",acceptedResourceTypes:["audio","document","image","video"],targetResourceType:"document",allowItemSelection:false,selectableItems:[],onDismiss:s,open:null!==e}),document.getElementById("external-tool-mount-point"))}renderUploadAddFolderButtons(e){if(this.props.showingSearchResults)return null 337const t=A()({"hidden-phone":this.showingButtons}) 338if(e)return(0,o.Z)("div",{className:"ef-actions"},void 0,(0,o.Z)("button",{type:"button",onClick:()=>this.addFolder(),className:"btn btn-add-folder","aria-label":Ve.t("Add Folder")},void 0,Oe||(Oe=(0,o.Z)("i",{className:"icon-plus"})),"Â ",(0,o.Z)("span",{className:t},void 0,Ve.t("Folder"))),(0,o.Z)(we,{currentFolder:this.props.currentFolder,showingButtons:!!this.showingButtons,contextId:this.props.contextId,contextType:this.props.contextType}),this.renderTrayToolsMenu())}renderDeleteButton(e){if(e)return(0,o.Z)("button",{type:"button",disabled:!this.showingButtons,className:"ui-button btn-delete",onClick:()=>{this.props.clearSelectedItems() 339be(this.props.selectedItems)},title:Ve.t("Delete"),"aria-label":Ve.t("Delete"),"data-tooltip":""},void 0,Le||(Le=(0,o.Z)("i",{className:"icon-trash"})))}renderManageUsageRightsButton(e){if(e)return i.createElement("button",{ref:"usageRightsBtn",type:"button",disabled:!this.showingButtons,className:"Toolbar__ManageUsageRights ui-button btn-rights",onClick:()=>this.openUsageRightsDialog(),title:Ve.t("Manage Usage Rights"),"aria-label":Ve.t("Manage Usage Rights"),"data-tooltip":""},qe||(qe=(0,o.Z)("i",{className:"icon-files-copyright"})))}renderCopyCourseButton(e){if(e)return(0,o.Z)("button",{type:"button",disabled:!this.showingButtons,className:"ui-button btn-move",onClick:e=>{ve(this.props.selectedItems,{contextType:this.props.contextType,contextId:this.props.contextId,returnFocusTo:e.target,clearSelectedItems:this.props.clearSelectedItems,onMove:this.props.onMove})},title:Ve.t("Move"),"aria-label":Ve.t("Move"),"data-tooltip":""},void 0,Ue||(Ue=(0,o.Z)("i",{className:"icon-updown"}
339)))}renderDownloadButton(){if(this.getItemsToDownload().length)return 1===this.props.selectedItems.length&&this.props.selectedItems[0].get("url")?(0,o.Z)("a",{className:"ui-button btn-download",href:this.props.selectedItems[0].get("url"),download:true,title:this.downloadTitle,"aria-label":this.downloadTitle,"data-tooltip":""},void 0,Be||(Be=(0,o.Z)("i",{className:"icon-download"}))):(0,o.Z)("button",{type:"button",disabled:!this.showingButtons,className:"ui-button btn-download",onClick:()=>this.downloadSelectedAsZip(),title:this.downloadTitle,"aria-label":this.downloadTitle,"data-tooltip":""},void 0,Pe||(Pe=(0,o.Z)("i",{className:"icon-download"})))}componentDidUpdate(e){e.selectedItems.length!==this.props.selectedItems.length&&p().screenReaderFlashMessageExclusive(Ve.t({one:"%{count} item selected",other:"%{count} items selected"},{count:this.props.selectedItems.length}))}renderManageAccessPermissionsButton(e){if(e)return(0,o.Z)("button",{type:"button",disabled:!this.showingButtons,className:"ui-button btn-restrict",onClick:()=>this.openRestrictedDialog(),title:Ve.t("Manage Access"),"aria-label":Ve.t("Manage Access"),"data-tooltip":""},void 0,$e||($e=(0,o.Z)("i",{className:"icon-cloud-lock"})))}render(){const e=this.props.selectedItems.every((e=>e instanceof j.Z)) 340let t=this.props.currentFolder&&this.props.currentFolder.get("for_submissions") 341t=t||this.props.selectedItems.some((e=>e.get("for_submissions"))) 342const s=this.props.selectedItems.some((e=>e.get("restricted_by_master_course")&&e.get("is_master_course_child_content"))) 343const{userCanRestrictFilesForContext:r,userCanAddFilesForContext:n,userCanEditFilesForContext:a,userCanDeleteFilesForContext:l}=this.props 344const d=e=>e&&!t&&!s 345this.showingButtons=this.props.selectedItems.length 3461===this.showingButtons&&(this.downloadTitle=Ve.t("Download")) 347const c=A()({"ic-Input-group":true,"ef-search-form":true,"ef-search-form--showing-buttons":this.showingButtons}) 348const h=A()({"ui-buttonset":true,"screenreader-only":!this.showingButtons}) 349const p=A()({"ui-button":true,"btn-view":true,"Toolbar__ViewBtn--onlyfolders":e}) 350const u=e?Ve.t("Viewing folders is not available"):Ve.t("View") 351return(0,o.Z)("header",{className:"ef-header",role:"region","aria-label":Ve.t("Files Toolbar")},void 0,(0,o.Z)("form",{className:c,onSubmit:(0,Se.Z)((()=>this.onSubmitSearch()))},void 0,i.createElement("input",{placeholder:Ve.t("Search for files"),"aria-label":Ve.t("Search for files"),type:"search",ref:"searchTerm",className:"ic-Input",defaultValue:this.props.query.search_term}),(0,o.Z)("button",{className:"Button",type:"submit"},void 0,We||(We=(0,o.Z)("i",{className:"icon-search"})),(0,o.Z)("span",{className:"screenreader-only"},void 0,Ve.t("Search for files")))),(0,o.Z)("div",{className:"ef-header__secondary"},void 0,(0,o.Z)("div",{className:h},void 0,i.createElement("a",{ref:"previewLink",href:"#",onClick:e?()=>{}:(0,Se.Z)((()=>this.openPreview())),className:p,title:u,role:"button","aria-label":u,"data-tooltip":"",disabled:!this.showingButtons||e,tabIndex:e?-1:0},ze||(ze=(0,o.Z)("i",{className:"icon-eye"}))),this.renderManageAccessPermissionsButton(d(r)),this.renderDownloadButton(),this.renderCopyCourseButton(d(a)),this.renderManageUsageRightsButton(d(a&&this.props.usageRightsRequiredForContext)),this.renderDeleteButton(d(l))),(0,o.Z)("span",{className:"ef-selected-count hidden-tablet hidden-phone"},void 0,Ve.t({one:"%{count} item selected",other:"%{count} items selected"},{count:this.props.selectedItems.length})),this.renderUploadAddFolderButtons(d(n))))}}var je,Ye 352const Ke=(0,C.useScope)("react_files") 353T.previewItem=function(e){this.clearSelectedItems((()=>{this.toggleItemSelected(e,null,(()=>{const e=p().param(this.getPreviewQuery()) 354a()(`${this.getPreviewRoute()}?${e}`)}))}))} 355T.getPreviewRoute=function(){return this.props.query&&this.props.query.search_term?"/search":this.props.splat?`/folder/${this.props.splat}`:""} 356T.render=function(){let e 357let t 358if(this.state.currentFolder){e=`${this.state.currentFolder.get("context_type").toLowerCase()}s` 359t=this.state.currentFolder.get("context_id")}else{e=c.Z.contextType 360t=c.Z.contextId}const s=s=>c.Z.userHasPermission({contextType:e,contextId:t},s) 361const r=s("manage_files_add") 362const n=s("manage_files_edit") 363const a=s("manage_files_delete") 364const l=r||n||a 365const d=n&&"groups"!==e 366const h=!!c.Z.contextsDictionary[`${e}_${t}`]&&c.Z.contextsDictionary[`${e}_${t}`].usage_rights_required 367const p=c.Z.contextFor({contextType:e,contextId:t})?c.Z.contextFor({contextType:e,contextId:t}).file_menu_tools:[] 368const u=c.Z.contextFor({contextType:e,contextId:t})?c.Z.contextFor({contextType:e,contextId:t}).file_index_menu_tools:[] 369return(0,o.Z)("div",{},void 0,(0,o.Z)("header",{},void 0,(0,o.Z)("h1",{className:"screenreader-only"},void 0,Ke.t("Files"))),!window.ENV.K5_SUBJECT_COURSE&&(0,o.Z)("div",{className:"ic-app-nav-toggle-and-crumbs ic-app-nav-toggle-and-crumbs--files no-print"},void 0,(0,o.Z)("button",{className:"Button Button--link ic-app-course-nav-toggle",type:"button",id:"courseMenuToggle","aria-label":Ke.t("Show and hide courses menu"),"aria-hidden":true},void 0,je||(je=(0,o.Z)("i",{className:"icon-hamburger","aria-hidden":"true"}))),(0,o.Z)("div",{className:"ic-app-crumbs"},void 0,(0,o.Z)(z,{rootTillCurrentFolder:this.state.rootTillCurrentFolder,showingSearchResults:this.state.showingSearchResults,query:this.props.query,c
369ontextAssetString:this.props.contextAssetString})),Ye||(Ye=(0,o.Z)("div",{className:"TutorialToggleHolder"}))),(0,o.Z)(He,{currentFolder:this.state.currentFolder,query:this.props.query,selectedItems:this.state.selectedItems,clearSelectedItems:this.clearSelectedItems,onMove:this.onMove,contextType:e,contextId:t,userCanAddFilesForContext:r,userCanEditFilesForContext:n,userCanDeleteFilesForContext:a,usageRightsRequiredForContext:h,userCanRestrictFilesForContext:d,indexExternalToolsForContext:u,getPreviewQuery:this.getPreviewQuery,getPreviewRoute:this.getPreviewRoute,modalOptions:{isOpen:this.state.showingModal,openModal:this.openModal,closeModal:this.closeModal},showingSearchResults:this.state.showingSearchResults}),(0,o.Z)("div",{className:"ef-main"},void 0,(0,o.Z)("aside",{className:"visible-desktop ef-folder-content",role:"region","aria-label":Ke.t("Folder Browsing Tree")},void 0,(0,o.Z)(Q,{rootTillCurrentFolder:this.state.rootTillCurrentFolder,rootFoldersToShow:c.Z.rootFolders,dndOptions:{onItemDragEnterOrOver:this.onItemDragEnterOrOver,onItemDragLeaveOrEnd:this.onItemDragLeaveOrEnd,onItemDrop:this.onItemDrop}})),i.createElement("div",{className:"ef-directory",role:"region","aria-label":Ke.t("File List"),ref:e=>this.filesDirectory=e},i.cloneElement(this.props.children,{key:this.state.key,pathname:this.props.pathname,splat:this.props.splat,query:this.props.query,params:this.props.params,onResolvePath:this.onResolvePath,currentFolder:this.state.currentFolder,contextType:e,contextId:t,selectedItems:this.state.selectedItems,toggleItemSelected:this.toggleItemSelected,toggleAllSelected:this.toggleAllSelected,areAllItemsSelected:this.areAllItemsSelected,userCanAddFilesForContext:r,userCanEditFilesForContext:n,userCanDeleteFilesForContext:a,userCanRestrictFilesForContext:d,usageRightsRequiredForContext:h,externalToolsForContext:p,previewItem:this.previewItem,onMove:this.onMove,modalOptions:{isOpen:this.state.showingModal,openModal:this.openModal,closeModal:this.closeModal},dndOptions:{onItemDragStart:this.onItemDragStart,onItemDragEnterOrOver:this.onItemDragEnterOrOver,onItemDragLeaveOrEnd:this.onItemDragLeaveOrEnd,onItemDrop:this.onItemDrop},clearSelectedItems:this.clearSelectedItems,filesDirectoryRef:this.filesDirectory}))),(0,o.Z)("div",{className:"ef-footer grid-row"},void 0,l&&(0,o.Z)("div",{className:"col-xs-6"},void 0,(0,o.Z)(ie,{className:"col-xs-4",contextType:e,contextId:t})),!c.Z.showingAllContexts&&(0,o.Z)("div",{className:"col-xs-6"},void 0,(0,o.Z)("div",{},void 0,(0,o.Z)("a",{className:"pull-right",href:"/files"},void 0,Ke.t("All My Files"))))),this.state.showingModal&&this.state.modalContents)} 370const Xe=m()(T) 371function Je(e,t){if(e.loadedAll)return 372const s=e.fetch({page:"next"}) 373s.then(t) 374return s.pipe((()=>Je(e,t)))}var Ge=s(98463) 375function Qe(e,t){const s={include:["user","usage_rights","enhanced_preview_url","context_asset_string"],per_page:20,sort:t.sort||"",order:t.order||""} 376const o=e.url 377const[i,r]=o.split("?") 378const n=f().extend((0,Ge.Z)(r),s) 379const a=`${i}?${(0,h.param)(n)}` 380e.url=a 381if(a!==o&&!e.loadedAll)return e.reset()}const et=(0,C.useScope)("react_files") 382const tt=/^\/[^\/]*/ 383const st={displayName:"ShowFolder",debouncedForceUpdate:f().debounce((function(){this.isMounted()&&this.forceUpdate()}),0),previousIdentifier:"",registerListeners(e){if(!e.currentFolder)return 384e.currentFolder.folders.on("all",this.debouncedForceUpdate,this) 385e.currentFolder.files.on("all",this.debouncedForceUpdate,this)},unregisterListeners(){this.props.currentFolder&&this.props.currentFolder.off(null,null,this)},getCurrentFolder(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{} 386let t,s 387let o=`/${e.splat||""}` 388if(c.Z.showingAllContexts){const e=o.split("/")[1] 389const i=c.Z.contextsDictionary[e]||c.Z.contexts[0];({contextType:s,contextId:t}=i) 390o=o.replace(tt,"")}else({contextType:s,contextId:t}=c.Z) 391return j.Z.resolvePath(s,t,o).then((e=>{const t=e[e.length-1] 392this.props.onResolvePath({currentFolder:t,rootTillCurrentFolder:e,showingSearchResults:false}) 393return[t.folders,t.files].forEach((e=>{Qe(e,this.props.query) 394return Je(e,this.debouncedForceUpdate)}))}),(e=>{let t 395try{t=p().parseJSON(e.responseText)}catch(e){}if(t){this.setState({errorMessages:t.errors}) 396if(null!=this.props.query.preview)return this.redirectToCourseFiles()}}))},UNSAFE_componentWillMount(){this.registerListeners(this.props) 397this.getCurrentFolder(this.props)},componentWillUnmount(){this.unregisterListeners()},componentDidUpdate(){if(null==this.props.currentFolder||this.props.currentFolder&&this.props.currentFolder.get("locked_for_user"))return this.redirectToCourseFiles()},UNSAFE_componentWillReceiveProps(e){this.unregisterListeners() 398if(!e.currentFolder)return 399this.props.pathname!==e.pathname&&this.getCurrentFolder(e) 400this.registerListeners(e);
400[e.currentFolder.folders,e.currentFolder.files].forEach((e=>{Qe(e,this.props.query)}))},redirectToCourseFiles(){const e=null!=this.props.currentFolder&&null!=this.previousIdentifier!==this.props.currentFolder.get("id").toString() 401const t=window.location.pathname!==c.Z.baseUrl&&null!=this.props.query.preview&&this.previousIdentifier!==this.props.query.preview 402if(e||t){this.previousIdentifier=this.props.currentFolder&&this.props.currentFolder.get("id").toString()||this.props.query.preview.toString() 403if(!t){const e=et.t("This folder is currently locked and unavailable to view.") 404p().flashError(e) 405p().screenReaderFlashMessage(e)}return setTimeout((()=>a()(`${c.Z.baseUrl}?${p().param(this.props.query)}`)),0)}}} 406var ot=s(23954) 407var it=s(36561) 408var rt=s(42650) 409var nt=s(29337) 410var at=s(1687) 411const lt=(0,C.useScope)("react_files") 412const dt={displayName:"FolderChild",mixins:[(0,at.Z)("model")],getInitialState(){return{editing:this.props.model.isNew(),hideKeyboardCheck:true,isSelected:this.props.isSelected}},componentDidMount(){this.state.editing&&this.focusNameInput()},startEditingName(){this.setState({editing:true},this.focusNameInput)},focusPreviousElement(){null!=this.previouslyFocusedElement&&this.previouslyFocusedElement.focus() 413if(document.activeElement===this.previouslyFocusedElement)return 414this.focusNameLink()},focusNameInput(){this.previouslyFocusedElement="BODY"===document.activeElement.nodeName?r.findDOMNode(this.refs.nameLink):document.activeElement 415setTimeout((()=>{const e=this.refs.newName 416if(e){const t=e.value.lastIndexOf(".") 417e.setSelectionRange(0,t<0?e.value.length:t) 418e.focus()}}),0)},focusNameLink(){setTimeout((()=>{const e=r.findDOMNode(this.refs.nameLink) 419e&&e.focus()}),100)},saveNameEdit(){this.setState({editing:false},this.focusNameLink) 420const e=r.findDOMNode(this.refs.newName).value 421return this.props.model.save({name:e},{success:()=>{this.focusNameLink()},error:(t,s)=>{409===s.status&&p().flashError(lt.t("A file named %{itemName} already exists in this folder.",{itemName:e}))}})},cancelEditingName(){this.props.model.isNew()&&this.props.model.collection.remove(this.props.model) 422this.setState({editing:false},this.focusPreviousElement)},getAttributesForRootNode(){const e=A()({"ef-item-row":true,"ef-item-selected":this.props.isSelected,activeDragTarget:this.state.isActiveDragTarget}) 423const t={onClick:this.props.toggleSelected,className:e,role:"row","aria-selected":this.props.isSelected,draggable:!this.state.editing,ref:"FolderChild",onDragStart:e=>{this.props.isSelected||this.props.toggleSelected() 424return this.props.dndOptions.onItemDragStart(e)}} 425if(this.props.model instanceof j.Z&&!this.props.model.get("for_submissions")){const e=e=>{this.state.isActiveDragTarget!==e&&this.setState({isActiveDragTarget:e})} 426t.onDragEnter=t.onDragOver=t=>this.props.dndOptions.onItemDragEnterOrOver(t,e(true)) 427t.onDragLeave=t.onDragEnd=t=>this.props.dndOptions.onItemDragLeaveOrEnd(t,e(false)) 428t.onDrop=t=>this.props.dndOptions.onItemDrop(t,this.props.model,(t=>{let{success:s}=t 429e(false) 430s&&r.unmountComponentAtNode(r.findDOMNode(this.refs.FolderChild).parentNode)}))}return t},checkForAccess(e){if(this.props.model.get("locked_for_user")){e.preventDefault() 431const t=lt.t("This folder is currently locked and unavailable to view.") 432p().flashError(t) 433p().screenReaderFlashMessage(t) 434return false}},handleFileLinkClick(){re.setItemToFocus(r.findDOMNode(this.refs.nameLink)) 435return this.props.previewItem()}} 436var ct 437const ht=(0,C.useScope)("react_files") 438class pt extends i.Component{constructor(e){super(e) 439this.isMasterCourseRestricted=()=>this.props.model.get("is_master_course_child_content")&&this.props.model.get("restricted_by_master_course") 440this.downloadFile=(e,t)=>{var s 441window.location=e[0].get("url") 442null===(s=t.returnFocusTo)||void 0===s||s.focus()} 443this.downloadZip=(e,t)=>{var s 444ke(e,t) 445null===(s=t.returnFocusTo)||void 0===s||s.focus()} 446this.deleteItem=(e,t)=>{const s=p()(".al-trigger").toArray() 447const o=s.length-1>0 448let i=document.querySelector(".ef-name-col a") 449if(o){const e=s.indexOf(t.returnFocusTo)-1 450e>=0&&(i=s[e])}t.returnFocusTo=i 451be(e,t)} 452this.openUsageRightsDialog=e=>{const t=(0,o.Z)(Ne.Z,{isOpen:true,closeModal:this.props.modalOptions.closeModal,itemsToManage:[this.props.model],userCanRestrictFilesForContext:this.props.userCanRestrictFilesForContext}) 453this.props.modalOptions.openModal(t,(()=>{r.findDOMNode(this.settingsCogBtnRef.current).focus()}))} 454this.settingsCogBtnRef=i.createRef()}render(){var e=this 455let t 456t=this.props.model instanceof ot.Z?this.props.externalToolsForContext.map((e=>this.props.model.externalToolEnabled(e)?(0,o.Z)("li",{role:"presentation"},e.title,(0,o.Z)("a",{href:`${e.base_url}&files[]=${this.props.model.id}`,role:"menuitem",tabIndex:"-1"},void 0,e.title)):(0,o.Z)("li",{role:"presentation"},e.title,(0,o.Z)("a",{href:"#",className:"disabled",role:"menuitem",tabIndex:"-1","aria-disabled":"true"},void 0,e.title)))):[] 457const s=function(t){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{} 458return(0,Se.Z)((o=>{const i=e.props.model.collection&&e.props.model.collection.parentFolder?e.props.model.collection.parentFolder.get("context_type").toLowerCase():null 459const n=i?`${i}s`:null 460const a=n||c.Z.contextType 461const l=e.props.model.collection&&e.props.model.collection.parentFolder?e.props.model.collection.parentFolder.get("context_id"):c.Z.contextId 462let d={contextType:a,contextId:l,returnFocusTo:r.findDOMNode(e.settingsCogBtnRef.current)} 463d=p().extend(d,s) 464return t([e.props.model],d)}))} 465const n=[] 466if(this.props.model instanceof j.Z)n.push((0,o.Z)("li",{role:"presentation"},"folderDownload",(0,o.Z)("a",{href:"#",onClick:s(this.downloadZip),"data-testid":"download",role:"menuitem",tabIndex:"-1"},void 0,ht.t("Download")))) 467else{n.push((0,o.Z)("li",{role:"presentation"},"download",(0,o.Z)("a",{onClick:s(this.downloadFile),href:this.props.model.get("url"),"data-testid":"download",role:"menuitem",tabIndex:"-1"},void 0,ht.t("Download")))) 468if(this.props.userCanEditFilesForContext){var a 469null!==(a=ENV.context_asset_string)&&void 0!==a&&a.startsWith("course_")&&n.push((0,o.Z)("li",{role:"presentation"},"send-to",(0,o.Z)("a",{href:"#",onClick:()=>{this.props.onSendToClick(this.props.model)},role:"menuitem",tabIndex:"-1"},void 0,ht.t("Send To..."))),(0,o.Z)("li",{role:"presentation"},"copy-to",(0,o.Z)("a",{href:"#",onClick:()=>{this.props.onCopyToClick(this.props.model)},role:"menuitem",tabIndex:"-1"},void 0,ht.t("Copy To..."))))}}
469if(!this.isMasterCourseRestricted()){if(this.props.userCanEditFilesForContext){n.push((0,o.Z)("li",{role:"presentation"},"rename",(0,o.Z)("a",{href:"#",onClick:(0,Se.Z)(this.props.startEditingName),"data-testid":"editName",role:"menuitem",tabIndex:"-1"},void 0,ht.t("Rename")))) 470n.push((0,o.Z)("li",{role:"presentation"},"move-to",(0,o.Z)("a",{href:"#",onClick:s(ve,{clearSelectedItems:this.props.clearSelectedItems,onMove:this.props.onMove}),"data-testid":"move",role:"menuitem",tabIndex:"-1"},void 0,ht.t("Move To...")))) 471this.props.usageRightsRequiredForContext&&n.push((0,o.Z)("li",{className:"ItemCog__OpenUsageRights",role:"presentation"},"manageUsageRights",(0,o.Z)("a",{href:"#",onClick:(0,Se.Z)(this.openUsageRightsDialog),"data-testid":"usageRights",role:"menuitem",tabIndex:"-1"},void 0,ht.t("Manage Usage Rights"))))}this.props.userCanDeleteFilesForContext&&n.push((0,o.Z)("li",{role:"presentation"},"delete",(0,o.Z)("a",{href:"#",onClick:s(this.deleteItem),"data-testid":"deleteLink",role:"menuitem",tabIndex:"-1"},void 0,ht.t("Delete"))))}return(0,o.Z)("div",{className:"al-dropdown__container",style:{minWidth:"45px",display:"inline-block"},onClick:e=>e.stopPropagation()},void 0,i.createElement("button",{type:"button",ref:this.settingsCogBtnRef,"data-testid":"settingsCogBtn",className:"al-trigger al-trigger-gray btn btn-link","aria-label":ht.t("Actions"),"data-popup-within":"#application","data-append-to-body":true},ct||(ct=(0,o.Z)("i",{className:"icon-more"}))),(0,o.Z)("ul",{className:"al-options",role:"menu","aria-hidden":"true","aria-expanded":"false",tabIndex:"0"},void 0,n.concat(t)))}}pt.displayName="ItemCog" 472const ut=pt 473var mt=s(70628) 474var gt=s(89714) 475s(34443) 476var ft=s(50324) 477const vt=(0,C.useScope)("MasterCourseLock") 478class yt extends i.Component{constructor(e){super(e) 479this.toggleLockedState=()=>{const e=this.props.model&&this.props.model.displayName()||vt.t("this file") 480gt.Z.put(`/api/v1/courses/${ENV.COURSE_ID}/blueprint_templates/default/restrict_item`,{content_type:"attachment",content_id:this.props.model.id,restricted:!this.isLocked()}).then((()=>{this.setLocked(!this.isLocked())})).catch((0,ft.IM)(vt.t('An error occurred changing the lock state for "%{fileName}"',{fileName:e})))} 481this.state=this.extractStateFromModel(e.model)}UNSAFE_componentWillMount(){const e=e=>this.setState(this.extractStateFromModel(e)) 482this.props.model.on("change",e,this)}componentWillUnmount(){this.props.model.off(null,null,this)}setLocked(e){this.props.model&&this.props.model.set("restricted_by_master_course",e)}isLocked(){return!!(this.props.model&&this.props.model.get("restricted_by_master_course"))}canLockUnlock(){return this.props.canManage&&this.props.model.get("is_master_course_master_content")}extractStateFromModel(e){return{locked:!!e.get("restricted_by_master_course")}}render(){const e=this.isLocked() 483const t=this.props.model&&this.props.model.displayName()||vt.t("This file") 484const s=A()("lock-icon",{disabled:!this.canLockUnlock(),"lock-icon-locked":this.isLocked()}) 485const i="btn-link "+(e?"locked-status locked":"unlocked-status unlocked") 486const r=e?"icon-blueprint-lock":"icon-blueprint" 487const n=e?vt.t("Locked"):vt.t("Unlocked") 488const a=e?vt.t("%{fileName} is Locked - Click to modify",{fileName:t}):vt.t("%{fileName} is Unlocked - Click to modify",{fileName:t}) 489return(0,o.Z)("span",{className:s},void 0,this.canLockUnlock()?(0,o.Z)("button",{type:"button","data-tooltip":"left",onClick:this.toggleLockedState,className:i,title:n,"aria-label":a},void 0,(0,o.Z)("i",{className:r})):(0,o.Z)("i",{className:r,"data-tooltip":"left",title:n},void 0,(0,o.Z)("span",{className:"lock-text screenreader-only"},void 0,n)))}}const bt=yt 490var _t=s(57714) 491var Ft=s(57314) 492var Ct,xt 493const Zt=(0,C.useScope)("react_files") 494dt.isFolder=function(){return this.props.model instanceof j.Z} 495dt.renderItemCog=function(e){if(!this.props.model.isNew()||this.props.model.get("locked_for_user"))return(0,o.Z)(ut,{model:this.props.model,startEditingName:this.startEditingName,userCanEditFilesForContext:e&&this.props.userCanEditFilesForContext,userCanDeleteFilesForContext:e&&this.props.userCanDeleteFilesForContext,userCanRestrictFilesForContext:this.props.userCanRestrictFilesForContext,usageRightsRequiredFor
495Context:this.props.usageRightsRequiredForContext,externalToolsForContext:this.props.externalToolsForContext,modalOptions:this.props.modalOptions,clearSelectedItems:this.props.clearSelectedItems,onMove:this.props.onMove,onCopyToClick:this.props.onCopyToClick,onSendToClick:this.props.onSendToClick})} 496dt.renderPublishCloud=function(e){if(!this.props.model.isNew())return i.createElement(mt.Z,{model:this.props.model,ref:"publishButton",userCanEditFilesForContext:e&&this.props.userCanRestrictFilesForContext,usageRightsRequiredForContext:this.props.usageRightsRequiredForContext})} 497dt.renderMasterCourseIcon=function(e){if(!(this.props.model.get("is_master_course_master_content")||this.props.model.get("is_master_course_child_content")))return null 498if(this.isFolder()&&(this.props.model.get("is_master_course_master_content")||!this.props.model.get("restricted_by_master_course")))return null 499return(0,o.Z)(bt,{model:this.props.model,canManage:e&&this.props.userCanEditFilesForContext})} 500dt.renderEditingState=function(){return this.state.editing?(0,o.Z)("form",{className:"ef-edit-name-form",onSubmit:(0,Se.Z)(this.saveNameEdit)},void 0,(0,o.Z)("div",{className:"ic-Input-group"},void 0,i.createElement("input",{type:"text",ref:"newName",className:"ic-Input ef-edit-name-form__input",placeholder:Zt.t("name","Name"),"aria-label":this.isFolder()?Zt.t("folder_name","Folder Name"):Zt.t("File Name"),defaultValue:this.props.model.displayName(),maxLength:"255",onKeyUp:e=>{27===e.keyCode&&this.cancelEditingName()}}),(0,o.Z)("button",{type:"button",className:"Button ef-edit-name-form__button ef-edit-name-accept",onClick:this.saveNameEdit},void 0,Ct||(Ct=(0,o.Z)("i",{className:"icon-check","aria-hidden":true})),(0,o.Z)("span",{className:"screenreader-only"},void 0,Zt.t("accept","Accept"))),(0,o.Z)("button",{type:"button",className:"Button ef-edit-name-form__button ef-edit-name-cancel",onClick:this.cancelEditingName},void 0,xt||(xt=(0,o.Z)("i",{className:"icon-x","aria-hidden":true})),(0,o.Z)("span",{className:"screenreader-only"},void 0,Zt.t("cancel","Cancel"))))):this.isFolder()?i.createElement("a",{ref:"nameLink",href:`${c.Z.baseUrl}/folder/${this.props.model.urlPath()}`,className:"ef-name-col__link",params:{splat:this.props.model.urlPath()},role:"button"},i.createElement("span",{className:"ef-name-col__click-wrapper",ref:e=>{e&&e.addEventListener("click",this.checkForAccess)}},(0,o.Z)("span",{className:"ef-big-icon-container"},void 0,(0,o.Z)(y.Z,{model:this.props.model})),(0,o.Z)("span",{className:"ef-name-col__text"},void 0,this.props.model.displayName()))):i.createElement("a",{href:this.props.model.get("url"),onClick:(0,Se.Z)(this.handleFileLinkClick),className:"ef-name-col__link",ref:"nameLink",role:"button"},(0,o.Z)("span",{className:"ef-big-icon-container"},void 0,(0,o.Z)(y.Z,{model:this.props.model})),(0,o.Z)("span",{className:"ef-name-col__text"},void 0,this.props.model.displayName()))} 501dt.renderUsageRightsIndicator=function(){if(this.props.usageRightsRequiredForContext)return(0,o.Z)("div",{className:"ef-usage-rights-col",role:"gridcell"},void 0,(0,o.Z)(_t.Z,{model:this.props.model,userCanEditFilesForContext:this.props.userCanEditFilesForContext,userCanRestrictFilesForContext:this.props.userCanRestrictFilesForContext,usageRightsRequiredForContext:this.props.usageRightsRequiredForContext,modalOptions:this.props.modalOptions}))} 502dt.render=function(){const e=this.props.model.get("user")||{} 503const t=Zt.t("Select %{itemName}",{itemName:this.props.model.displayName()}) 504const s=A()({"screenreader-only":this.state.hideKeyboardCheck,"multiselectable-toggler":true}) 505const r=A()({"screenreader-only":!this.state.hideKeyboardCheck}) 506const n=this.props.model.collection&&this.props.model.collection.parentFolder 507const a=(!n||!n.get("for_submissions"))&&!this.props.model.get("for_submissions") 508return i.createElement("div",this.getAttributesForRootNode(),(0,o.Z)("div",{className:"ef-select-col",role:"gridcell"},void 0,(0,o.Z)("label",{className:s},void 0,(0,o.Z)("input",{type:"checkbox",onFocus:()=>{this.setState({hideKeyboardCheck:false})},onBlur:()=>{this.setState({hideKeyboardCheck:true})},className:s,checked:this.props.isSelected,onChange:()=>{}}),(0,o.Z)("span",{className:r},void 0,t))),(0,o.Z)("div",{className:"ef-name-col",role:"rowheader"},void 0,this.renderEditingState()),(0,o.Z)("div",{className:"ef-date-created-col",role:"gridcell"},void 0,(0,o.Z)(Ft.Z,{dateTime:this.props.model.get("created_at")})),(0,o.Z)("div",{className:"ef-date-modified-col",role:"gridcell"},void 0,!this.isFolder()&&(0,o.Z)(Ft.Z,{dateTime:this.props.model.get("modified_at")})),(0,o.Z)("div",{className:"ef-modified-by-col ellipsis",role:"gridcell"},void 0,(0,o.Z)("a",{href:e.html_url,className:"ef-plain-link"},void 0,e.display_name)),(0,o.Z)("div",{className:"ef-size-col",role:"gridcell"},void 0,(0,te.Z)(this.props.model.get("size"))),this.renderUsageRightsIndicator(),(0,o.Z)("div",{className:"ef-links-col",role:"gridcell"},void 0,this.renderMasterCourseIcon(a),this.renderPublishCloud(a),this.renderItemCog(a)))} 509const wt=m()(dt) 510var St=s(77464) 511var Nt=s(34163) 512var Tt=s(65902) 513var It=s(9) 514var kt=s(19165) 515var Rt=s(58145) 516const Mt=(0,C.useScope)("upload_drop_zone") 517class Dt extends i.Component{constructor(){super(...arguments) 518this.state={isUploading:false,isDragging:false} 519this.killWindowDrop=e=>{e.preventDefault()} 520this.getSurroundingBox=()=>this.props.filesDirectoryRef 521this.handleDragEnter=e=>{if(this.shouldAcceptDrop(e.dataTransfer)){e.dataTransfer.dropEffect="copy" 522e.preventDefault() 523this.state.isDragging||this.state.isUploading||this.setState({isDragging:true}) 524return false}return true} 525this.handleDragLeave=e=>{const t=this.getSurroundingBox().getBoundingClientRect();
525(e.clientY<t.top||e.clientY>=t.bottom||e.clientX<t.left||e.clientX>=t.right)&&this.setState({isDragging:false})} 526this.handleParentDrop=e=>{e.preventDefault() 527e.stopPropagation() 528this.handleDrop(e.dataTransfer.files)} 529this.handleDrop=e=>{this.setState({isDragging:false}) 530kt.Z.setFolder(this.props.currentFolder) 531kt.Z.setOptionsFromFiles(e,true)} 532this.shouldAcceptDrop=e=>{if(e)return e.types.includes("Files")} 533this.renderDropZone=()=>{const{isDragging:e}=this.state 534const t=this.props.currentFolder.isEmpty() 535return(0,o.Z)(Tt.b,{shouldAllowMultiple:true,onDrop:this.handleDrop,renderLabel:(0,o.Z)(St.V,{size:"small",hero:(0,o.Z)(It.V,{color:e?"brand":"primary"}),as:"div",headingAs:"span",headingLevel:"h2",heading:Mt.t("Drop files here to upload"),message:t&&(0,o.Z)(Nt.x,{color:"brand"},void 0,Mt.t("or choose files"))})})} 536this.handleUploadChange=e=>{this.setState({isUploading:e>0})}}componentDidMount(){this.getSurroundingBox().addEventListener("dragenter",this.handleDragEnter) 537document.addEventListener("dragleave",this.handleDragLeave) 538document.addEventListener("dragenter",this.killWindowDrop) 539document.addEventListener("dragover",this.killWindowDrop) 540document.addEventListener("drop",this.killWindowDrop)}componentWillUnmount(){this.getSurroundingBox().removeEventListener("dragenter",this.handleDragEnter) 541document.removeEventListener("dragleave",this.handleDragLeave) 542document.removeEventListener("dragenter",this.killWindowDrop) 543document.removeEventListener("dragover",this.killWindowDrop) 544document.removeEventListener("drop",this.killWindowDrop)}render(){const{isDragging:e,isUploading:t}=this.state 545const s=this.props.currentFolder.isEmpty() 546const r=A()({FileUpload:true,FileUpload__full:s&&!e,FileUpload__dragging:e}) 547return i.createElement(i.Fragment,null,t||(0,o.Z)("div",{className:r,onDrop:this.handleParentDrop},void 0,this.renderDropZone()),(0,o.Z)(Rt.Z,{onUploadChange:this.handleUploadChange}))}}Dt.displayName="FileUpload" 548const Et=Dt 549const At=(0,C.useScope)("react_files") 550const Ot=[{displayName:At.t("name","Name"),property:"name",className:"ef-name-col"},{displayNameShort:At.t("created_at_short","Created"),displayName:At.t("created_at","Date Created"),property:"created_at",className:"ef-date-created-col"},{displayNameShort:At.t("updated_at_short","Modified"),displayName:At.t("updated_at","Date Modified"),property:"modified_at",className:"ef-date-modified-col"},{displayName:At.t("modified_by","Modified By"),className:"ef-modified-by-col",property:"user"},{displayName:At.t("size","Size"),property:"size",className:"ef-size-col"},{displayName:At.t("Usage Rights"),property:"usage_rights",className:"ef-usage-rights-col"}] 551const Lt={displayName:"ColumnHeaders",columns:Ot,propTypes:{query:k().object.isRequired,areAllItemsSelected:k().func.isRequired},getInitialState:()=>({hideToggleAll:true}),lastScreenreaderMessage:i.createRef(),queryParamsFor(e,t){const s=(e.sort||"name")===t&&"desc"===e.order?"asc":"desc" 552return f().defaults({sort:t,order:s},e)}} 553const qt=(0,C.useScope)("react_files") 554Lt.renderColumns=function(e,t){return this.columns.map((s=>{if("usage_rights"===s.property&&!this.props.usageRightsRequiredForContext)return 555const r=e===s.property 556if(this.props.query.sort&&r&&t){const e="asc"===t?"ascending":"descending" 557const o=qt.t("Sorted %{direction} by %{columnName}",{direction:e,columnName:s.displayName}) 558if(o!==this.lastScreenreaderMessage.current){p().screenReaderFlashMessage(o) 559this.lastScreenreaderMessage.current=o}}const n={"current-filter":r} 560n[s.className]=true 561const a=A()(n) 562const l=A()({"visible-desktop":s.displayNameShort,"ef-usage-rights-col-offset":"usage_rights"===s.property}) 563const d=this.props.pathname.split("/").map((e=>window.encodeURIComponent(e))).join("/") 564const c=`${d}?${p().param(this.queryParamsFor(this.props.query,s.property))}` 565const h={className:"ef-plain-link",href:c} 566let u 567u="select"===s.property?(0,o.Z)("span",{className:"screenreader-only"},void 0,s.displayName):"usage_rights"===s.property?(0,o.Z)("i",{className:"icon-files-copyright"},void 0,(0,o.Z)("span",{className:"screenreader-only"},void 0,s.displayName)):s.displayName 568return(0,o.Z)("div",{className:a,role:"columnheader","aria-sort":{asc:"ascending",desc:"descending"}[r&&t]||"none"},s.property,i.createElement("a",h,(0,o.Z)("span",{className:l},void 0,u),s.displayNameShort&&(0,o.Z)("span",{className:"hidden-desktop"},void 0,s.displayNameShort),r&&"asc"===t&&(0,o.Z)("i",{className:"icon-mini-arrow-up"},void 0,(0,o.Z)("span",{className:"screenreader-only"},void 0,qt.t("sorted_ascending","Sorted Ascending"))),r&&"desc"===t&&(0,o.Z)("i",{className:"icon-mini-arrow-down"},void 0,(0,o.Z)("span",{className:"screenreader-only"},void 0,qt.t("sorted_desending","Sorted Descending")))))}))} 569Lt.render=function(){const e=this.props.query.sort||"name" 570const t=this.props.query.order||"asc" 571return(0,o.Z)("header",{className:"ef-directory-header",role:"row"},void 0,(0,o.Z)("div",{className:"ef-select-col",role:"columnheader"},void 0,(0,o.Z)("span",{className:"screenreader-only"},void 0,qt.t("Select"))),this.renderColumns(e,t),(0,o.Z)("div",{className:"ef-links-col",role:"columnheader"},void 0,(0,o.Z)("span",{className:"screenreader-only"},void 0,qt.t("Actions"))))} 572const Ut=m()(Lt) 573const Bt=(0,C.useScope)("react_files") 574function Pt(e){const t={display:e.isLoading?"":"none"} 575return(0,o.Z)("div",{style:t,className:"paginatedView-loading",role:"status","aria-live":"polite"},void 0,Bt.t("Loading more results..."))}const $t=(0,C.useScope)("react_files") 576st.getInitialState=function(){return{hideToggleAll:true}} 577st.closeFilePreview=function(e){a()(e) 578re.setFocusToItem()} 579st.renderFilePreview=function(){if(null!=this.props.query.preview)return(0,o.Z)(it.Z,{isOpen:true,usageRightsRequiredFor
579Context:this.props.usageRightsRequiredForContext,currentFolder:this.props.currentFolder,params:this.props.params,query:this.props.query,pathname:this.props.pathname,splat:this.props.splat,closePreview:this.closeFilePreview})} 580st.renderFolderChildOrEmptyContainer=function(){return this.props.currentFolder.isEmpty()?i.createElement("div",{ref:"folderEmpty",className:"muted"},$t.t("this_folder_is_empty","This folder is empty")):this.props.currentFolder.children(this.props.query).map((e=>(0,o.Z)(wt,{model:e,isSelected:f().indexOf(this.props.selectedItems,e)>=0,toggleSelected:this.props.toggleItemSelected.bind(null,e),userCanEditFilesForContext:this.props.userCanEditFilesForContext,userCanDeleteFilesForContext:this.props.userCanDeleteFilesForContext,userCanRestrictFilesForContext:this.props.userCanRestrictFilesForContext,usageRightsRequiredForContext:this.props.usageRightsRequiredForContext,externalToolsForContext:this.props.externalToolsForContext,previewItem:this.props.previewItem.bind(null,e),dndOptions:this.props.dndOptions,modalOptions:this.props.modalOptions,clearSelectedItems:this.props.clearSelectedItems,onMove:this.props.onMove,onCopyToClick:e=>{e instanceof ot.Z&&this.setState({copyFileId:e.id})},onSendToClick:e=>{e instanceof ot.Z&&this.setState({sendFileId:e.id})}},e.cid)))} 581st.render=function(){const e=this.state||{} 582if(e.errorMessages)return(0,o.Z)("div",{},void 0,e.errorMessages.map((e=>(0,o.Z)("div",{className:"muted"},void 0,e.message)))) 583if(!this.props.currentFolder)return i.createElement("div",{ref:"emptyDiv"}) 584const t=this.props.currentFolder.folders.fetchingNextPage||this.props.currentFolder.files.fetchingNextPage 585const s=A()({"screenreader-only":this.state.hideToggleAll}) 586const r=!!(this.props.currentFolder.folders.loadedAll&&this.props.currentFolder.files.loadedAll) 587return(0,o.Z)("div",{},void 0,(0,o.Z)("input",{id:"selectAllCheckbox",className:s,type:"checkbox",onFocus:e=>this.setState({hideToggleAll:false}),onBlur:e=>this.setState({hideToggleAll:true}),checked:this.props.areAllItemsSelected(),onChange:e=>this.props.toggleAllSelected(e.target.checked)}),(0,o.Z)("label",{htmlFor:"selectAllCheckbox",className:s},void 0,$t.t("select_all","Select All")),(0,o.Z)("div",{role:"grid",style:{flex:"1 1 auto"}},void 0,this.props.userCanEditFilesForContext&&i.createElement("div",{ref:"accessibilityMessage",className:"ShowFolder__accessbilityMessage col-xs",tabIndex:0},$t.t("Warning: For improved accessibility in moving files, please use the Move To Dialog option found in the menu.")),r&&i.createElement(i.Fragment,null,this.props.userCanAddFilesForContext&&(0,o.Z)(Et,{currentFolder:this.props.currentFolder,filesDirectoryRef:this.props.filesDirectoryRef}),i.createElement(Ut,{ref:"columnHeaders",query:this.props.query,pathname:this.props.pathname,areAllItemsSelected:this.props.areAllItemsSelected,usageRightsRequiredForContext:this.props.usageRightsRequiredForContext}),this.renderFolderChildOrEmptyContainer()),(0,o.Z)(Pt,{isLoading:t}),this.renderFilePreview()),this.state.sendFileId&&(0,o.Z)(nt.Z,{contentShare:{content_id:this.state.sendFileId,content_type:"attachment"},courseId:ENV.COURSE_ID,onDismiss:()=>{this.setState({sendFileId:null})},open:!!this.state.sendFileId}),this.state.copyFileId&&(0,o.Z)(rt.Z,{contentSelection:{attachments:[this.state.copyFileId]},onDismiss:()=>{this.setState({copyFileId:null})},open:!!this.state.copyFileId,sourceCourseId:ENV.COURSE_ID}))} 588const Wt=m()(st) 589var zt=s(96034) 590s(83292) 591const Vt=(0,C.useScope)("react_files") 592const Ht={displayName:"SearchResults",propTypes:{contextType:b.Z.contextType,contextId:b.Z.contextId},name:"search",getInitialState:()=>({collection:new zt.Z,errors:null}),onFetchError(e,t,s){let o 593const i=Vt.t("An unknown server error occurred. Please try again.") 594try{o=JSON.parse(t.responseText)}catch(e){o={errors:[{message:i}]}}const r=f().isArray(o.errors)?this.translateErrors(o.errors):o.errors&&o.errors.base?[{message:`${o.errors.base}, ${o.status}`}]:[{message:i}] 595this.setState({errors:r}) 596p().screenReaderFlashMessageExclusive(f().map(r,(e=>e.message)).join(" "))},translateErrors:e=>f().map(e,(e=>"3 or more characters is required"===e.message?{message:Vt.t("Please enter a search term with three or more characters")}:e)),updateResults(e){const t=this.state.collection.url 597this.state.collection.url=`${window.location.origin}/api/v1/${this.props.contextType}/${this.props.contextId}/files` 598Qe(this.state.collection,this.props.query) 599if(this.state.collection.url===t&&this.state.collection.models.length>0)return 600this.setState({collection:this.state.collection}) 601if(!this.state.collection.loadedAll||!f().isEqual(this.props.query.search_term,e.query&&e.query.search_term)){const t=()=>{if(this.isMounted()){this.setState({errors:null}) 602this.forceUpdate()}p().screenReaderFlashMessageExclusive(Vt.t("results_count","Showing %{num_results} search results",{num_results:this.state.collection.length}))} 603return this.state.collection.fetch({data:e.query,error:this.onFetchError}).then(t).then(Je.bind(null,this.state.collection,t))}},UNSAFE_componentWillReceiveProps(e){return this.updateResults(e)},componentDidMount(){this.updateResults(this.props) 604setTimeout((()=>{this.props.onResolvePath({currentFolder:null,rootTillCurrentFolder:null,showingSearchResults:true,searchResultCollection:this.state.collection})}))}} 605const jt=(0,C.useScope)("react_files") 606function Yt(e){let{search_term:t}=e 607return(0,o.Z)("div",{},void 0,(0,o.Z)("p",{},void 0,jt.t("errors.no_match.your_search",'Your search - "%{search_term}" - did not match any files.',{search_term:t})),(0,o.Z)("p",{},void 0,jt.t("errors.no_match.suggestions","Suggestions:")),(0,o.Z)("ul",{},void 0,(0,o.Z)("li",{},void 0,jt.t("errors.no_match.spelled","Make sure all words are spelled correctly.")),(0,o.Z)("li",{},void 0,jt.t("errors.no_match.keywords","Try different keywords.")),(0,o.Z)("li",{},void 0,jt.t("errors.no_match.three_chars","Enter at least 3 letters in the search box."))))}const Kt=(0,C.useScope)("react_files") 608Ht.displayErrors=function(e){let t=null 609null!=e&&(t=e.map((e=>(0,o.Z)("li",{},void 0,e.message)))) 610return(0,o.Z)("div",{},void 0,(0,o.Z)("p",{},void 0,Kt.t({one:"Your search encountered the following error:",other:"Your search encountered the following errors:"},{count:e.length})),(0,o.Z)("ul",{},void 0,t))} 611Ht.closeFilePreview=function(e){a()(e) 612re.setFocusToItem()} 613Ht.renderFilePreview=function(){if(null!=this.props.query.preview&&this.state.collection.length)return(0,o.Z)(it.Z,{isOpen:true,params:this.props.params,query:this.props.query,c
613ollection:this.state.collection,usageRightsRequiredForContext:this.props.usageRightsRequiredForContext,splat:this.props.splat,closePreview:this.closeFilePreview})} 614Ht.render=function(){return this.state.errors?this.displayErrors(this.state.errors):this.state.collection.loadedAll&&0===this.state.collection.length?(0,o.Z)(Yt,{search_term:this.props.query.search_term}):i.createElement(i.Fragment,null,(0,o.Z)("div",{role:"grid"},void 0,this.props.userCanEditFilesForContext&&i.createElement("div",{ref:"accessibilityMessage",className:"SearchResults__accessbilityMessage col-xs",tabIndex:"0"},Kt.t("Warning: For improved accessibility in moving files, please use the Move To Dialog option found in the menu.")),(0,o.Z)(Ut,{to:"search",query:this.props.query,params:this.props.params,pathname:this.props.pathname,toggleAllSelected:this.props.toggleAllSelected,areAllItemsSelected:this.props.areAllItemsSelected,usageRightsRequiredForContext:this.props.usageRightsRequiredForContext}),this.state.collection.models.sort(j.Z.prototype.childrenSorter.bind(this.state.collection,this.props.query.sort,this.props.query.order)).map((e=>(0,o.Z)(wt,{model:e,isSelected:f().indexOf(this.props.selectedItems,e)>=0,toggleSelected:this.props.toggleItemSelected.bind(null,e),userCanEditFilesForContext:this.props.userCanEditFilesForContext,userCanDeleteFilesForContext:this.props.userCanDeleteFilesForContext,userCanRestrictFilesForContext:this.props.userCanRestrictFilesForContext,usageRightsRequiredForContext:this.props.usageRightsRequiredForContext,externalToolsForContext:this.props.externalToolsForContext,previewItem:this.props.previewItem.bind(null,e),dndOptions:this.props.dndOptions,modalOptions:this.props.modalOptions,clearSelectedItems:this.props.clearSelectedItems,onMove:this.props.onMove,onCopyToClick:e=>{e instanceof ot.Z&&this.setState({copyFileId:e.id})},onSendToClick:e=>{e instanceof ot.Z&&this.setState({sendFileId:e.id})}},e.cid))),(0,o.Z)(Pt,{isLoading:!this.state.collection.loadedAll}),this.renderFilePreview()),this.state.sendFileId&&(0,o.Z)(nt.Z,{contentShare:{content_id:this.state.sendFileId,content_type:"attachment"},courseId:ENV.COURSE_ID,onDismiss:()=>{this.setState({sendFileId:null})},open:!!this.state.sendFileId}),this.state.copyFileId&&(0,o.Z)(rt.Z,{contentSelection:{attachments:[this.state.copyFileId]},onDismiss:()=>{this.setState({copyFileId:null})},open:!!this.state.copyFileId,sourceCourseId:ENV.COURSE_ID}))} 615const Xt=m()(Ht) 616var Jt,Gt 617function Qt(e){r.render((0,o.Z)(Xe,{query:e.query,params:e.params,splat:e.splat,pathname:e.pathname,contextAssetString:window.ENV.context_asset_string},void 0,Jt||(Jt=(0,o.Z)(Wt,{}))),document.getElementById("content"))}function es(e){r.render((0,o.Z)(Xe,{query:e.query,params:e.params,splat:e.splat,pathname:e.pathname,contextAssetString:window.ENV.context_asset_string},void 0,Gt||(Gt=(0,o.Z)(Xt,{}))),document.getElementById("content"))}function ts(e,t){e.query=d().parse(e.querystring) 618t()}function ss(e,t){const s="/folder/" 619const o=e.pathname.indexOf(s)+s.length 620const i=e.pathname.slice(o) 621e.splat=i.split("/").map((e=>window.encodeURIComponent(e))).join("/") 622t()}function os(e,t){e.splat="" 623t()}a().base(c.Z.baseUrl) 624a()("*",os) 625a()("*",ts) 626a()("/",Qt) 627a()("/search",es) 628a()("/folder","/") 629a()("/folder/*",ss,Qt) 630const is={start(){a().start({click:false})},getFolderSplat:ss} 631var rs=s(75869) 632var ns=s.n(rs) 633ns()((()=>{is.start();(0,De.xI)()}))},75758:(e,t,s)=>{"use strict" 634s.d(t,{Z:()=>l}) 635var o=s(51927) 636var i=s(41143) 637var r=s.n(i) 638const n={} 639const a={getCssVariant(){const e=window.ENV.use_high_contrast?"high_contrast":"normal_contrast" 640const t=(0,o.dZ)()?"_rtl":"" 641return`new_styles_${e}${t}`},getHandlebarsIndex:()=>window.BRANDABLE_CSS_HANDLEBARS_INDEX||[[],{}],urlFor(e,t){let{combinedChecksum:s,includesNoVariables:o}=t 642const i=o?"no_variables":a.getCssVariant() 643return[window.ENV.ASSET_HOST||"","dist","brandable_css",i,`${e}-${s}.css`].join("/")},loadStylesheet(e,t){if(e in n)return 644const s=document.createElement("link") 645s.rel="stylesheet" 646s.href=a.urlFor(e,t) 647s.setAttribute("data-loaded-by-brandableCss",true) 648document.head.appendChild(s)},loadStylesheetForJST(e){let{bundle:t,id:s}=e 649const[o,i]=a.getHandlebarsIndex() 650r()(i.hasOwnProperty(s),`requested to load stylesheet for template "${t}" (${s}) but no mapping is available for it!`) 651if(1===i[s].length)return a.loadStylesheet(t,{combinedChecksum:i[s][0],includesNoVariables:true}) 652{let e=i[s][o.indexOf(a.getCssVariant())] 653"number"===typeof e&&(e=i[s][e]) 654return a.loadStylesheet(t,{combinedChecksum:e,includesNoVariables:false})}}} 655const l=a},71598:(e,t,s)=>{"use strict" 656s.d(t,{Z:()=>i}) 657var o=s(34443) 658class i extends o.Z{constructor(e){super(e) 659this.module_item_id=e.module_item_id}initialize(e,t){return super.initialize(...arguments)}url(){return"/api/v1/files/"+this.id}}},70628:(e,t,s)=>{"use strict" 660s.d(t,{Z:()=>C}) 661var o=s(63056) 662var i=s(67294) 663var r=s(72555) 664var n=s.n(r) 665var a=s(73935) 666var l=s(6507) 667var d=s.n(l) 668var c=s(61323) 669var h=s(45697) 670var p=s.n(h) 671var u=s(879) 672s(42449) 673s(88439) 674const m=(0,c.useScope)("broccoli_cloud") 675const g={displayName:"PublishCloud",propTypes:{togglePublishClassOn:p().object,model:u.Z.filesystemObject,userCanEditFilesForContext:p().bool.isRequired,fileName:p().string},getInitialState(){return this.extractStateFromModel(this.props.model)},componentDidMount(){this.props.togglePublishClassOn&&this.updatePublishClassElements()},componentDidUpdate(){this.props.togglePublishClassOn&&this.updatePublishClassElements()},UNSAFE_componentWillMount(){const e=e=>this.setState(this.extractStateFromModel(e)) 676this.props.model.on("change",e,this)},componentWillUnmount(){this.props.model.off(null,null,this)},updatePublishClassElements(){return this.props.togglePublishClassOn.classList[this.state.published?"add":"remove"]("ig-published")},getRestrictedText(){if(this.props.model.get("unlock_at")&&this.props.model.get("lock_at"))return m.t("Available after %{unlock_at} until %{lock_at}",{unlock_at:d().datetimeString(this.props.model.get("unlock_at")),lock_at:d().datetimeString(this.props.model.get("lock_at"))}) 677if(this.props.model.get("unlock_at")&&!this.props.model.get("lock_at"))return m.t("Available after %{unlock_at}",{unlock_at:d().datetimeString(this.props.model.get("unlock_at"))}) 678if(!this.props.model.get("unlock_at")&&this.props.model.get("lock_at"))return m.t("Available until %{lock_at}",{lock_at:d().datetimeString(this.props.model.get("lock_at"))})},extractStateFromModel:e=>({published:!e.get("locked"),restricted:!!e.get("lock_at")||!!e.get("unlock_at"),hidden:!!e.get("hidden")}),togglePublishedState(){this.setState({published:!this.state.published,restricted:false,hidden:false})}} 679s(60314) 680var f,v,y,b,_ 681const F=(0,c.useScope)("publish_cloud") 682g.openRestrictedDialog=function(){const e=d()("<div>").dialog({title:F.t("Editing permissions for: %{name}",{name:this.props.model.displayName()}),width:800,minHeight:300,close(){a.unmountComponentAtNode(this) 683d()(this).remove()}}) 684s.e(98573).then(s.bind(s,98573)).then((t=>{let{default:s}=t
685a.render((0,o.Z)(s,{usageRightsRequiredForContext:this.props.usageRightsRequiredForContext,models:[this.props.model],closeDialog:()=>{e.dialog("close")}}),e[0])}))} 686g.render=function(){const e=this.props.model&&this.props.model.displayName()||F.t("This file") 687return this.props.userCanEditFilesForContext?this.state.published&&this.state.restricted?i.createElement("button",{type:"button","data-tooltip":"left",onClick:this.openRestrictedDialog,ref:"publishCloud",className:"btn-link published-status restricted",title:this.getRestrictedText(),"aria-label":F.t("%{fileName} is %{restricted} - Click to modify",{fileName:e,restricted:this.getRestrictedText()}),disabled:this.props.disabled},f||(f=(0,o.Z)("i",{className:"icon-calendar-month icon-line"}))):this.state.published&&this.state.hidden?i.createElement("button",{type:"button","data-tooltip":"left",onClick:this.openRestrictedDialog,ref:"publishCloud",className:"btn-link published-status hiddenState",title:F.t("Only available to students with link"),"aria-label":F.t("%{fileName} is only available to students with the link - Click to modify",{fileName:e}),disabled:this.props.disabled},v||(v=(0,o.Z)("i",{className:"icon-off icon-line"}))):this.state.published?i.createElement("button",{type:"button","data-tooltip":"left",onClick:this.openRestrictedDialog,ref:"publishCloud",className:"btn-link published-status published",title:F.t("Published"),"aria-label":F.t("%{fileName} is Published - Click to modify",{fileName:e}),disabled:this.props.disabled},y||(y=(0,o.Z)("i",{className:"icon-publish icon-Solid"}))):i.createElement("button",{type:"button","data-tooltip":"left",onClick:this.openRestrictedDialog,ref:"publishCloud",className:"btn-link published-status unpublished",title:F.t("Unpublished"),"aria-label":F.t("%{fileName} is Unpublished - Click to modify",{fileName:e}),disabled:this.props.disabled},b||(b=(0,o.Z)("i",{className:"icon-unpublish"}))):this.state.published&&this.state.restricted?i.createElement("div",{style:{marginRight:"12px"},"data-tooltip":"left",ref:"publishCloud",className:"published-status restricted",title:this.getRestrictedText(),"aria-label":F.t("%{fileName} is %{restricted}",{fileName:e,restricted:this.getRestrictedText()}),disabled:this.props.disabled},_||(_=(0,o.Z)("i",{className:"icon-calendar-day"}))):(0,o.Z)("div",{style:{width:28,height:36}})} 688const C=n()(g)},2790:(e,t,s)=>{"use strict" 689s.d(t,{Z:()=>M}) 690var o=s(63056) 691var i=s(67294) 692var r=s(72555) 693var n=s.n(r) 694var a=s(6507) 695var l=s.n(a) 696var d=s(45697) 697var c=s.n(d) 698var h=s(61323) 699var p=s(879) 700var u=s(14250) 701var m=s(50111) 702var g=s(59227) 703s(42449) 704s(38798) 705const f=(0,h.useScope)("usage_rights_modal") 706const v={displayName:"ManageUsageRightsModal",propTypes:{isOpen:c().bool,closeModal:c().func,itemsToManage:c().arrayOf(p.Z.filesystemObject).isRequired},UNSAFE_componentWillMount(){this.copyright=this.defaultCopyright() 707this.use_justification=this.defaultSelectedRight() 708return this.cc_value=this.defaultCCValue()},apiUrl:`/api/v1/${u.Z.contextType}/${u.Z.contextId}/usage_rights`,copyright:null,use_justification:null,submit(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null 709const t=this.usageSelection.getValues() 710if("choose"===t.use_justification){l()(this.usageSelection.usageRightSelection).errorBox(f.t("You must specify a usage right."),null,"fixed") 711return false}const s={use_justification:t.use_justification,legal_copyright:t.copyright,license:t.cc_license} 712if(e){e(s) 713return this.props.closeModal()}const o=(e,t)=>{if(e){(0,g.Z)(t,this.props.itemsToManage) 714l().flashMessage(f.t("Usage rights have been set.")) 715this.setRestrictedAccess(this.restrictedSelection.extractFormValues())}else l().flashError(f.t("There was an error setting usage rights.")) 716return this.props.closeModal()} 717return(0,m.Z)(this.props.itemsToManage,s,o)},setRestrictedAccess(e){return this.props.itemsToManage.every((t=>t.save({},{attrs:e})))},defaultSelectedRight(){const e=this.props.itemsToManage[0].get("usage_rights")&&this.props.itemsToManage[0].get("usage_rights").use_justification 718return this.props.itemsToManage.every((t=>(t.get("usage_rights")&&t.get("usage_rights").use_justification)===e))?e:"choose"},defaultCopyright(){const e=this.props.itemsToManage[0].get("usage_rights")&&this.props.itemsToManage[0].get("usage_rights").legal_copyright||"" 719return this.props.itemsToManage.every((t=>(t.get("usage_rights")&&t.get("usage_rights").legal_copyright)===e||(t.get("usage_rights")&&t.get("usage_rights").license)===e))?e:null},defaultCCValue(){return"creative_commons"===this.use_justification?this.props.itemsToManage[0].get("usage_rights")&&this.props.itemsToManage[0].get("usage_rights").license:null}} 720var y=s(67474) 721var b=s(14490) 722var _=s(33828) 723var F=s(86840) 724var C=s(1160) 725var x=s(9524) 726var Z=s(85394) 727var w=s(74265) 728var S=s(16916) 729var N,T,I 730const k=(0,h.useScope)("usage_rights_modal") 731const R=2 732v.renderFileName=function(){const e=this.props.itemsToManage.length>1?k.t("%{items} items selected",{items:this.props.itemsToManage.length}):this.props.itemsToManage[0].displayName() 733return i.createElement("span",{ref:e=>this.fileName=e,className:"UsageRightsDialog__fileName"},e)} 734v.renderFolderList=function(e){if(e.length){const t=e.slice(0,R) 735return(0,o.Z)("div",{},void 0,(0,o.Z)("span",{},void 0,k.t("Usage rights will be set for all of the files contained in:")),i.createElement("ul",{ref:e=>this.folderBulletList=e,className:"UsageRightsDialog__folderBulletList"},t.map((e=>(0,o.Z)("li",{},e.cid,e.displayName())))))}return null} 736v.renderFolderTooltip=function(e){const t=e.slice(R) 737if(t.length){const e=t.map((e=>({cid:e.cid,displayName:(0,S.ZP)(e.displayName()).toString()}))) 738const s=e.map((e=>e.displayName)).join("<br />") 739return i.createElement("span",{className:"UsageRightsDialog__andMore",tabIndex:"0",ref:e=>this.folderTooltip=e,"data-html-tooltip-title":s,"data-tooltip":"right","data-tooltip-class":"UsageRightsDialog__tooltip"},k.t("and %{count} moreâ¦",{count:t.length}),(0,o.Z)("span",{className:"screenreader-only"},void 0,(0,o.Z)("ul",{},void 0,e.map(((e,t)=>i.createElement("li",{key:e.cid,ref:e=>this[`displayNameTooltip${t}-screenreader`]=e}," ",e.displayName))))))}return null} 740v.renderFolderMessage=function(){const e=this.props.itemsToManage.filter((e=>e instanceof F.Z)) 741return(0,o.Z)("div",{},void 0,this.renderFolderList(e),this.renderFolderTooltip(e),N||(N=(0,o.Z)("hr",{"aria-hidden":"true"})))} 742v.renderDifferentRightsMessage=function(){if((null==this.copyright||"choose"===this.use_justification)&&this.props.itemsToManage.length>1)return i.createElement("span",{ref:e=>this.differentRightsMessage=e,className:"UsageRightsDialog__differentRightsMessage alert"},T||(T=(0,o.Z)("i",{className:"icon-warning UsageRightsDialog__warning"})),k.t("Items selected have different usage rights."))} 743v.renderAccessManagement=function(){if(this.props.userCanRestrictFilesForContext)return(0,o.Z)("div",{},void 0,I||(I=(0,o.Z)("hr",{"aria-hidden":"true"})),(0,o.Z)("div",{className:"form-horizontal"},void 0,(0,o.Z)("p",{className:"manage-access"},void 0,k.t("You can also manage access at this time:")),i.createElement(b.Z,{ref:e=>this.restrictedSelection=e,models:this.props.itemsToManage})))} 744v.render=function(){return i.createElement(C.u_,{ref:e=>this.usageRightsDialog=e,open:this.props.isOpen,onDismiss:this.props.closeModal,label:k.t("Manage Usage Rights"),shouldCloseOnDocumentClick:false},(0,o.Z)(C.u_.Header,{},void 0,(0,o.Z)(x.P,{elementRef:e=>this.cancelXButton=e,className:"Button Button--icon-action",placement:"end",offset:"medium",onClick:this.props.closeModal,screenReaderLabel:k.t("Close")}
744),(0,o.Z)(w.X,{level:"h4"},void 0,k.t("Manage Usage Rights"))),(0,o.Z)(C.u_.Body,{},void 0,i.createElement("div",{ref:e=>this.form=e,className:"UsageRightsDialog__Content"},(0,o.Z)("div",{},void 0,(0,o.Z)("div",{className:"UsageRightsDialog__paddingFix grid-row"},void 0,!this.props.hidePreview&&(0,o.Z)("div",{className:"UsageRightsDialog__previewColumn col-xs-3"},void 0,(0,o.Z)(_.Z,{itemsToShow:this.props.itemsToManage})),(0,o.Z)("div",{className:"UsageRightsDialog__contentColumn off-xs-1 col-xs-8"},void 0,this.renderDifferentRightsMessage(),this.renderFileName(),this.renderFolderMessage(),i.createElement(y.Z,{ref:e=>this.usageSelection=e,use_justification:this.use_justification,copyright:this.copyright||"",cc_value:this.cc_value,contextType:this.props.contextType,contextId:this.props.contextId}),this.renderAccessManagement()))))),(0,o.Z)(C.u_.Footer,{},void 0,(0,o.Z)("span",{className:"UsageRightsDialog__Footer-Actions"},void 0,(0,o.Z)(Z.z,{elementRef:e=>this.cancelButton=e,onClick:this.props.closeModal},void 0,k.t("Cancel")),"Â ",(0,o.Z)(Z.z,{elementRef:e=>this.saveButton=e,color:"primary",type:"submit",onClick:()=>this.submit(this.props.deferSave)},void 0,k.t("Save")))))} 745const M=n()(v)},57714:(e,t,s)=>{"use strict" 746s.d(t,{Z:()=>h}) 747var o=s(63056) 748var i=s(61323) 749var r=s(67294) 750var n=s(73935) 751s(879) 752var a=s(86840) 753var l=s(2790) 754var d 755const c=(0,i.useScope)("react_files") 756class h extends r.Component{constructor(){super(...arguments) 757this.warningMessage=c.t("Before publishing this file, you must specify usage rights.") 758this.handleClick=e=>{e.preventDefault() 759const t=(0,o.Z)(l.Z,{isOpen:true,closeModal:this.props.modalOptions.closeModal,itemsToManage:[this.props.model],userCanRestrictFilesForContext:this.props.userCanRestrictFilesForContext,contextType:this.props.contextType,contextId:this.props.contextId,hidePreview:this.props.hidePreview,deferSave:this.props.deferSave}) 760this.props.modalOptions.openModal(t,(()=>{n.findDOMNode(this).focus()}))} 761this.getIconData=e=>{switch(e){case"own_copyright":return{iconClass:"icon-files-copyright",text:c.t("Own Copyright")} 762case"public_domain":return{iconClass:"icon-files-public-domain",text:c.t("Public Domain")} 763case"used_by_permission":return{iconClass:"icon-files-obtained-permission",text:c.t("Used by Permission")} 764case"fair_use":return{iconClass:"icon-files-fair-use",text:c.t("Fair Use")} 765case"creative_commons":return{iconClass:"icon-files-creative-commons",text:c.t("Creative Commons")}}}}render(){if(this.props.model instanceof a.Z||!this.props.usageRightsRequiredForContext&&!this.props.model.get("usage_rights"))return null 766if(this.props.usageRightsRequiredForContext&&!this.props.model.get("usage_rights"))return this.props.userCanEditFilesForContext?(0,o.Z)("button",{type:"submit",className:"UsageRightsIndicator__openModal btn-link",onClick:this.handleClick,title:this.props.suppressWarning?c.t("Manage usage rights"):this.warningMessage,"data-tooltip":"top","aria-label":c.t("Set usage rights")},void 0,!this.props.suppressWarning&&(0,o.Z)("span",{className:"screenreader-only"},void 0,this.warningMessage),d||(d=(0,o.Z)("i",{className:"UsageRightsIndicator__warning icon-warning"}))):null 767{const e=this.props.model.get("usage_rights").use_justification 768const t=this.getIconData(e) 769return(0,o.Z)("button",{type:"submit",className:"UsageRightsIndicator__openModal btn-link",onClick:this.handleClick,disabled:!this.props.userCanEditFilesForContext,title:this.props.model.get("usage_rights").license_name,"data-tooltip":"top","aria-label":c.t("Set usage rights")},void 0,r.createElement("span",{ref:"screenreaderText",className:"screenreader-only"},t.text),(0,o.Z)("span",{className:"screenreader-only"},void 0,this.props.model.get("usage_rights").license_name),r.createElement("i",{ref:"icon",className:t.iconClass}))}}}},92866:(e,t,s)=>{"use strict" 770var o=s(61323) 771var i=s(6507) 772var r=s.n(i) 773var n=s(16916) 774var a=s(78674) 775s(38593) 776s(60314) 777s(1560) 778s(88636) 779const l=(0,o.useScope)("instructure_misc_plugins") 780r().fn.setOptions=function(e,t){let s=e?"<option value=''>"+(0,n.ZP)(e)+"</option>":"" 781null==t&&(t=[]) 782t.forEach((e=>{const t=(0,n.ZP)(e) 783s+='<option value="'+t+'">'+t+"</option>"})) 784return this.html(r().raw(s))} 785r().fn.ifExists=function(e){this.length&&e.call(this,this) 786return this} 787r().fn.scrollbarWidth=function(){const e=r()('<div style="width:50px;height:50px;overflow:hidden;position:absolute;top:-200px;left:-200px;"><div style="height:100px;"></div>').appendTo(this),t=e.find("div") 788const s=t.innerWidth() 789e.css("overflow-y","scroll") 790const o=t.innerWidth() 791e.remove() 792return s-o} 793r().fn.dim=function(e){return this.animate({opacity:.4},e)} 794r().fn.undim=function(e){return this.animate({opacity:1},e)} 795r().fn.confirmDelete=function(e){e=r().extend({},r().fn.confirmDelete.defaults,e) 796const t=this 797let s=null 798let o=true 799e.noMessage=e.noMessage||e.no_message 800const i=function(){if(!o){e.cancelled&&r().isFunction(e.cancelled)&&e.cancelled.call(t) 801return}e.confirmed||(e.confirmed=function(){t.dim()}) 802e.confirmed.call(t) 803if(e.url){e.success||(e.success=function(e){t.fadeOut("slow",(()=>{t.remove()}))}) 804const o=e.prepareData?e.prepareData.call(t,s):{} 805o.authenticity_token=(0,a.Z)() 806r().ajaxJSON(e.url,"DELETE",o,(s=>{e.success.call(t,s)}),((s,o,i,n)=>{e.error&&r().isFunction(e.error)?e.error.call(t,s,o,i,n):r().ajaxJSON.unhandledXHRs.push(o)}))}else{e.success||(e.success=function(){t.fadeOut("slow",(()=>{t.remove()}))}) 807e.success.call(t)}} 808if(e.message&&!e.noMessage&&!r().skipConfirmations){if(e.dialog){o=false 809const t="object"===typeof e.dialog?e.dialog:{} 810const n=e.url.includes("assignments")?"btn-danger":"btn-primary" 811s=r()(e.message).dialog(r().extend({},{modal:true,close:i,buttons:[{text:l.t("#buttons.cancel","Cancel"),click(){r()(this).dialog("close")}},{text:l.t("#buttons.delete","Delete"),class:n,click(){o=true 812r()(this).dialog("close")}}]},t)) 813return}o=window.confirm(e.message)}i()} 814r().fn.confirmDelete.defaults={get message(){return l.t("confirms.default_delete_thing","Are you sure you want to delete this?")}} 815r().fn.fragmentChange=function(e){if(e&&true!==e){const t=(window.location.search||"").replace(/^\?/,"").split("&") 816let s=null 817for(let e=0;e<t.length;e++){const o=t[e] 818o&&0===o.indexOf("hash=")&&(s="#"+o.substring(5))}this.bind("document_fragment_change",e) 819const o=this 820let i=false 821for(let e=0;e<r()._checkFragments.fragmentList.length;e++){const t=r()._checkFragments.fragmentList[e] 822t.doc[0]===o[0]&&(i=true)}i||r()._checkFragments.fragmentList.push({doc:o,fragment:""}) 823r()(window).bind("hashchange",r()._checkFragments) 824setTimeout((()=>{s&&s.length>0?o.triggerHandler("document_fragment_change",s):o&&o[0]&&o[0].location&&o[0].location.hash.length>0&&o.triggerHandler("document_fragment_change",o[0].location.hash)}),500)}else this.triggerHandler("document_fragment_change",this[0].location.hash) 825return this} 826r()._checkFragments=function(){const e=r()._checkFragments.fragmentList 827for(let t=0;t<e.length;t++){const s=e[t] 828const o=s.doc 829if(o[0].location.hash!==s.fragment){o.triggerHandler("document_fragment_change",o[0].location.hash) 830s.fragment=o[0].location.hash 831r()._checkFragments.fragmentList[t]=s}}} 832r()._checkFragments.fragmentList=[] 833r().fn.clickLink=function(){const e=this.eq(0) 834e.hasClass("disabled_link")||e.click()} 835r().fn.showIf=function(e){if(r().isFunction(e))return this.each((function(t){r()(this).showIf(e.call(this))})) 836e?this.show():this.hide() 837return this} 838r().fn.disableIf=function(e){r().isFunction(e)&&(e=e.call(this)) 839this.prop("disabled",!!e) 840return this} 841r().fn.indicate=function(e){e=e||{} 842let t 843if("remove"===e){t=this.data("indicator") 844t&&t.remove() 845return}r()(".indicator_box").remove() 846let s=this.offset() 847e&&e.offset&&(s=e.offset) 848const o=this.width() 849const i=this.height() 850const n=(e.container||this).zIndex() 851t=r()(document.createElement("div")) 852t.css({width:o+6,height:i+6,top:s.top-3,left:s.left-3,zIndex:n+1,position:"absolute",display:"block","-moz-border-radius":5,opacity:.8,border:"2px s
852olid #870",backgroundColor:"#fd0"}) 853t.addClass("indicator_box") 854t.mouseover((function(){r()(this).stop().fadeOut("fast",(function(){r()(this).remove()}))})) 855this.data("indicator")&&this.indicate("remove") 856this.data("indicator",t) 857r()("body").append(t) 858e&&e.singleFlash?t.hide().fadeIn().animate({opacity:.8},500).fadeOut("slow",(function(){r()(this).remove()})):t.hide().fadeIn().animate({opacity:.8},500).fadeOut("slow").fadeIn("slow").animate({opacity:.8},2500).fadeOut("slow",(function(){r()(this).remove()})) 859e&&e.scroll&&r()("html,body").scrollToVisible(t)} 860r().fn.hasScrollbar=function(){return this.length&&this[0].clientHeight<this[0].scrollHeight} 861r().fn.log=function(e){console.log("%s: %o",e,this) 862return this} 863r().fn.fillWindowWithMe=function(e){const t=r().extend({minHeight:400},e),s=r()(this),o=r()("#wrapper"),i=r()("#main"),n=r()("#not_right_side"),a=r()(window),l=r()(this).add(t.alsoResize) 864function d(){l.height(0) 865const e=a.height()-(o.offset().top+o.outerHeight())+(i.height()-n.height()),d=Math.max(400,e) 866l.height(d) 867r().isFunction(t.onResize)&&t.onResize.call(s,d)}d() 868a.unbind("resize.fillWindowWithMe").bind("resize.fillWindowWithMe",d) 869return this} 870r().fn.autoGrowInput=function(e){e=r().extend({maxWidth:1e3,minWidth:0,comfortZone:70},e) 871this.filter("input:text").each((function(){let t="" 872const s=e.minWidth||r()(this).width() 873const o=r()(this) 874const i=r()("<tester/>").css({position:"absolute",top:-9999,left:-9999,width:"auto",fontSize:o.css("fontSize"),fontFamily:o.css("fontFamily"),fontWeight:o.css("fontWeight"),letterSpacing:o.css("letterSpacing"),whiteSpace:"nowrap"}) 875const n=function(){setTimeout((()=>{if(t===(t=o.val()))return 876i.text(t) 877const r=i.width(),n=r+e.comfortZone>=s?r+e.comfortZone:s,a=o.width(),l=n<a&&n>=s||n>s&&n<e.maxWidth 878l&&o.width(n)}))} 879i.insertAfter(o) 880r()(this).bind("keyup keydown blur update change",n)})) 881return this}},98349:(e,t,s)=>{"use strict" 882s.d(t,{Z:()=>h}) 883var o=s(6507) 884var i=s.n(o) 885var r=s(25683) 886var n=s.n(r) 887var a=s(16916) 888var l=s(61323) 889const d=(0,l.useScope)("user_content") 890const c={translateMathmlForScreenreaders(e){var t,s 891if(!(null!==(t=ENV)&&void 0!==t&&null!==(s=t.FEATURES)&&void 0!==s&&s.new_math_equation_handling)){const t=i()("<div/>").html(e.attr("x-canvaslms-safe-mathml")).html() 892const s=i()('<span class="hidden-readable"></span>') 893s.html(t) 894return s}},toMediaCommentLink(e){const t=i()(`<a\n id='media_comment_${(0,a.ZP)(i()(e).data("media_comment_id"))}'\n data-media_comment_type='${(0,a.ZP)(i()(e).data("media_comment_type"))}'\n class='instructure_inline_media_comment ${(0,a.ZP)(e.nodeName.toLowerCase())}_comment'\n data-alt='${(0,a.ZP)(i()(e).attr("data-alt"))}'\n />`) 895t.html(i()(e).html()) 896return t},convert(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{} 897const s=i()("<div />").html(e) 898s.find("video.instructure_inline_media_comment,audio.instructure_inline_media_comment").replaceWith((function(){return c.toMediaCommentLink(this)})) 899s.find("object.instructure_user_content:not(#kaltura_player) embed").remove() 900if(!t.forEditing){s.find("object.instructure_user_content,embed.instructure_user_content").replaceWith((function(){const e=i()(this) 901if(!e.data("uc_snippet")||!e.data("uc_sig"))return this 902const t=n().uniqueId("uc_") 903let s="/object_snippet" 904ENV.files_domain&&(s=`//${ENV.files_domain}${s}`) 905const o=i()(`<form\n action='${(0,a.ZP)(s)}'\n method='post'\n class='user_content_post_form'\n target='${(0,a.ZP)(t)}'\n id='form-${(0,a.ZP)(t)}'\n />`) 906o.append(i()("<input type='hidden'/>").attr({name:"object_data",value:e.data("uc_snippet")})) 907o.append(i()("<input type='hidden'/>").attr({name:"s",value:e.data("uc_sig")})) 908i()("body").append(o) 909setTimeout((()=>o.submit()),0) 910return i()(`<iframe\n class='user_content_iframe'\n name='${(0,a.ZP)(t)}'\n style='width: ${(0,a.ZP)(e.data("uc_width"))}; height: ${(0,a.ZP)(e.data("uc_height"))};'\n frameborder='0'\n title='${(0,a.ZP)(d.t("User Content"))}'\n />`)})) 911s.find("img.equation_image").each(((e,t)=>{const s=i()(t) 912const o=c.translateMathmlForScreenreaders(s) 913s.removeAttr("x-canvaslms-safe-mathml") 914s.after(o)}))}return s.html()}} 915const h=c},41354:(e,t,s)=>{"use strict" 916s.d(t,{l:()=>i,u:()=>r}) 917const o={}.hasOwnProperty 918function i(e,t){for(const s in t)o.call(t,s)&&(e[s]=t[s]) 919function s(){this.constructor=e}s.prototype=t.prototype 920e.prototype=new s 921e.__super__=t.prototype 922return e}function r(e,t){Object.keys(t).forEach((s=>Object.defineProperty(e,s,{get:t[s],enumerable:true,configurable:true}))) 923return e}},83292:function(){(function(){"use strict" 924var e,t 925e=window.location 926if(e.origin)return 927t=e.protocol+"//"+e.hostname+(e.port?":"+e.port:"") 928try{Object.defineProperty(e,"origin",{value:t,enumerable:true})}catch(s){e.origin=t}}).call(this)},1560:(e,t,s)=>{"use strict" 929var o=s(6507) 930var i=s.n(o) 931s(88636) 932i().fn.scrollToVisible=function(e){const t={} 933const s=i()(e) 934if(0===s.length)return 935let o=s.offset(),r=s.outerWidth(),n=s.outerHeight(),a=o.top,l=a+n,d=o.left,c=d+r,h="html,body"==this.selector?window.scrollY:this.scrollTop(),p=this.scrollLeft(),u=this.outerHeight(),m=this.outerWidth() 936if("html,body"!=this.selector){let e=i()("body").offset() 937this.each((function(){try{e=i()(this).offset() 938return false}catch(e){}})) 939a-=e.top 940l-=e.top 941d-=e.left 942c-=e.left}if("HTML"==this[0].tagName||"BODY"==this[0].tagName){u=i()(window).height() 943i()("#wizard_box:visible").length>0&&(u-=i()("#wizard_box:visible").height()) 944m=i()(window).width() 945a-=h 946d-=p 947l-=h 948c-=p}a<0||u<n&&l>u?t.scrollTop=a+h:l>u&&(t.scrollTop=l+h-u+20) 949d<0?t.scrollLeft=d+p:c>m&&(t.scrollLeft=c+p-m+20) 9501==t.scrollTop&&(t.scrollTop=0) 9511==t.scrollLeft&&(t.scrollLeft=0) 952this.scrollTop(t.scrollTop) 953this.scrollLeft(t.scrollLeft) 954return this}}}]) 955 956//# sourceMappingURL=files-c-123eb32115.js.map
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.