$("head").append('');const SVGLoadingHTML='
${h.is_ready?h.is_public?"Deployed ":"Pending":"Private"}
${h.is_public?`[View Page]`:""}- To update asset files, upload your files
- Changes on asset's images are uploaded imediately.
\n- If your asset is
a, img, video, source, h1-6, p, strong, link, br, b, i, em, mark, small, del, ins, sub, sup, table, tr, th, td, ol, ul, li, dl, dt, dd, pre
\n ")})),$("#submit-details").click((()=>{let e=!1;if(["text_description","category_1","category_2","category_3","tags_input","text_description"].forEach((t=>{let n=$("#"+t).val();null!=n&&""!=n||(e=!0)})),e)return ShowPopupModal("Not all input fields are set.");t();let n=new XMLHttpRequest;n.open("POST",$("#edit-form").attr("action")),n.onload=function(e){let t=JSON.parse(n.responseText);if("fail"==t.result)return ShowPopupModal("Error: "+t.error);t.new_id!=o?(window.onbeforeunload=null,ShowPopupModal("Refreshing page..."),window.location.replace("https://isotopic.io/asset-page-edit/?asset="+t.new_id+"&message=saved")):ShowPopupModal("Details saved successfully!")};let a=new FormData(document.getElementById("edit-form"));n.send(a)})),$("#save-asset-details-button").click((()=>{let e=!1;if(["html_details_textarea"].forEach((t=>{let n=$("#"+t).val();null!=n&&""!=n||(e=!0)})),e)return ShowPopupModal("Not all input fields are set.");t();let n=new XMLHttpRequest;n.open("POST",$("#edit-description-form").attr("action")),n.onload=function(e){ShowPopupModal("Details Saved!")};let a=new FormData(document.getElementById("edit-description-form"));n.send(a)})),$(".edit-page-build-file-input").on("change",(function(){let e=$(this)[0].files[0],t=$(this).attr("platform");a(!1),ShowNotification("Initiating Upload...","upload-init",void 0,5e3);let n=!1,s=(e,t)=>{0==n?(ShowNotification(`${Math.floor(100*e)}% - ${i(t)} left.
`,"upload-progress",void 0,-1,!0),n=!0):SetNotification("upload-progress",`${Math.floor(100*e)}% | ${i(t)} left.
`)},r=Date.now();m(o,e.size,t).then((async n=>{let{result:i,upload_id:l,total_chunks:d,chunk_size:p}=n;if(r=Date.now(),"fail"===i)return RemoveNotification("upload-progress"),a(!0),ShowPopupModal("An error occured.");let c=0,m=!1;for(let n=0;nCheck your Internet Connection!
","upload-network-issue",void 0,5e3,!0),f>20))return e(t);await y().then((t=>{e(t)}))}else e(t)})).catch((async t=>{if(f++,f>3)return e(chunkRes);await y().then((t=>{e(t)}))}))}));await y().then((e=>"fail"===e.result?(m=!0,RemoveNotification("upload-progress"),a(!0),ShowPopupModal("A fatal error occured. Please try again.")):"done"===e.status?(RemoveNotification("upload-progress"),a(!0),ShowPopupModal(`Upload complete for platform ${t}!`,(()=>{}))):(c=n/d,void s(c,0==c?0:(1/c-1)*(Date.now()-r)))))}}))}))})()}));