PageSourceSearch

https://sharvarok.com/_next/static/chunks/6850.ec657ae146137cd1.js

js sharvarok.com collected 2026-10-02 00:57:03 UTC 10,262 bytes, 1 lines download raw bytes

1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},l=(new e.Error).stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="65a00bdf-fbe0-4b88-8e13-ac84b6137916",e._sentryDebugIdIdentifier="sentry-dbid-65a00bdf-fbe0-4b88-8e13-ac84b6137916")}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6850],{66850:function(e,l,a){a.r(l);var i=a(57437),s=a(2265),o=a(42586),t=a(77598),r=a(83464),n=a(8946),d=a.n(n);let c={flex:1,display:"flex",flexDirection:"column",alignItems:"center",padding:"20px",borderWidth:2,borderRadius:2,borderColor:"#eeeeee",borderStyle:"dashed",backgroundColor:"#fafafa",color:"#2196f3",outline:"none",transition:"border .24s ease-in-out"},h={borderColor:"#2196f3"},m={borderColor:"#00e676"},u={borderColor:"#ff1744"},p={opacity:"0.5"},f={display:"flex",flexDirection:"row",flexWrap:"wrap",marginTop:16},g={display:"inline-flex",borderRadius:2,border:"1px solid #eaeaea",marginBottom:8,marginRight:8,width:100,height:100,boxSizing:"border-box",justifyContent:"center",alignItems:"center",overflow:"hidden",position:"relative",cursor:"pointer"},v={display:"flex",minWidth:0,overflow:"hidden",justifyContent:"center",alignItems:"center"},x={position:"absolute",top:"-4px",right:"0px",color:"#ff0000"},b={width:"100px",height:"100px",objectFit:"cover",filter:"blur(2px)"},j=new Set(["image/heic","image/heif","image/heic-sequence","image/heif-sequence"]),y=e=>{let l=(e.type||"").toLowerCase(),a=(e.name||"").toLowerCase();return j.has(l)||a.endsWith(".heic")||a.endsWith(".heif")};l.default=e=>{let{post:l,isEditor:a=!1,maxPhotos:n=10}=e,j=(0,o.useTranslations)("PostForm.upload"),w=null==l?void 0:l.id,[N,C]=(0,s.useState)([]),[k,D]=(0,s.useState)([]),[S,E]=(0,s.useState)([]),[I,L]=(0,s.useState)(!1),[M,R]=(0,s.useState)("0%"),[T,F]=(0,s.useState)(0),[U,_]=(0,s.useState)(0),[O,P]=(0,s.useState)(!1),[q,W]=(0,s.useState)(null),[Z,z]=(0,s.useState)(!1),H=async()=>{let{status:e,data:a}=await r.Z.get("/api/post/".concat(l.id,"/photos"));200===e?(console.log(">>> response",a),(null==a?void 0:a.success)&&C(((null==a?void 0:a.photos)||[]).sort((e,l)=>(e.order||0)-(l.order||0)))):console.log(">>> error loading photos",typeof e,e)},A=e=>{C(e)},B=e=>{console.log(">>> showDeleteConfirmation",e),_(e)},G=()=>{_(0)},J=async e=>{z(!0);try{var a,i;let s=e.map((e,l)=>({id:e.id,order:l})),o=await r.Z.request({method:"PATCH",url:"/api/post/".concat(l.id,"/photos/order"),data:{photoOrder:s}});console.log(">>> order saved",o.data),(null==o?void 0:null===(a=o.data)||void 0===a?void 0:a.success)&&C((null==o?void 0:null===(i=o.data)||void 0===i?void 0:i.photos)||e)}catch(e){console.error(">>> problem saving order",e)}finally{z(!1)}},K=(e,l)=>{W(l),e.dataTransfer.effectAllowed="move"},Q=e=>{e.preventDefault(),e.dataTransfer.dropEffect="move"},V=(e,l)=>{if(e.preventDefault(),null===q||q===l)return;let a=[...N],i=a[q];a.splice(q,1),a.splice(l,0,i),C(a),W(null),J(a)},X=()=>{W(null)},Y=e=>{let l=[...S];l.splice(l.indexOf(e),1),E(l)},$=async e=>{if(console.log(">>> files",e),!e[0])return!1;let l=e.map(e=>Object.assign(e,{preview:URL.createObjectURL(e)}));E(d().unionBy(S,l,"name").slice(0,10)),D([])},ee=n-((null==N?void 0:N.length)||0)-((null==S?void 0:S.length)||0),{getRootProps:el,getInputProps:ea,isDragActive:ei,isFocused:es,isDragAccept:eo,isDragReject:et,acceptedFiles:er}=(0,t.uI)({onDrop:$,accept:{"image/png":[".png"],"image/jpeg":[".jpeg",".jpg"],"image/heic":[".heic"],"image/heif":[".heif"]},multiple:!0,disabled:I||0===ee||(null==S?void 0:S.length)>=10,maxFiles:ee-(null==S?void 0:S.length)}),en=(0,s.useMemo)(()=>({...c,...es?h:{},...eo?m:{},...et?u:{},...I?p:{}}),[es,eo,et,I]),ed=async e=>{if(null==e||e.preventDefault(),console.log(">>> files",S),!(null==S?void 0:S.length))return!1;D([]),L(!0),F(0),R("0%");let a=S.length,i=async(e,i)=>{let s=new FormData;s.append("file",e);try{var o;let e=await r.Z.request({method:"POST",url:"/api/post/".concat(l.id,"/photos"),data:s,onUploadProgress:e=>{let l=Math.ceil(e.loaded/e.total*100),s=Math.ceil((i+l/100)/a*100);F(s),R(100===s?"Finishing...":"".concat(s,"%"))}});console.log(">>> upload complete for file ".concat(i+1),e.data),A(null==e?void 0:null===(o=e.data)||void 0===o?void 0:o.photos),D(l=>{var a;return[...l,...null==e?void 0:null===(a=e.data)||void 0===a?void 0:a.errorFiles]})}catch(l){console.error(">>> problem on server with file ".concat(i+1),l),D(l=>[...l,e])}};for(let e=0;e<S.length;e++)await i(S[e],e);L(!1),F(100),R("Done"),setTimeout(()=>{E([]),F(0)},2e3)},ec=S.map(e=>(0,i.jsxs)("div",{style:g,onClick:()=>Y(e),children:[(0,i.jsx)("div",{style:v,children:y(e)?(0,i.jsxs)("div",{style:{width:"100px",height:"100px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:"#f0f0f0",fontSize:"11px",color:"#666",gap:"4px"},children:[(0,i.jsx)("i",{className:"fi fi-image fs-4"}),(0,i.jsx)("span",{children:"HEIC"})]}):(0,i.jsx)("img",{src:e.preview,style:b,className:"img-fluid",onLoad:()=>{URL.revokeObjectURL(e.preview)}})}),(0,i.jsx)("div",{style:x,children:(0,i.jsx)("i",{className:"fi mdi-close fs-4"})})]},e.name));return(0,s.useEffect)(()=>()=>
1S.forEach(e=>URL.revokeObjectURL(e.preview)),[]),(0,s.useEffect)(()=>{w>0&&H()},[w]),(0,i.jsxs)(i.Fragment,{children:[(null==l?void 0:l.isPaid)&&!a?null:(0,i.jsx)("div",{className:"card mt-5",children:(0,i.jsxs)("form",{action:"#",onSubmit:ed,children:[(0,i.jsx)("div",{className:"card-header fs-5 fw-medium",children:j.rich("title",{max:n,left:ee,small:e=>(0,i.jsx)("small",{children:e})})}),(0,i.jsxs)("div",{className:"card-body",children:[l&&(null==l?void 0:l.id)?(0,i.jsx)("div",{className:"row",children:(0,i.jsxs)("div",{className:"col-12",children:[(0,i.jsxs)("div",{children:[(0,i.jsxs)("div",{...el({style:en}),children:[(0,i.jsx)("input",{...ea()}),I?(0,i.jsx)("div",{children:j("wait")}):(0,i.jsx)(i.Fragment,{children:ei?(0,i.jsx)("div",{children:j("drophere")}):(0,i.jsx)("div",{children:j("draghere")})})]}),(0,i.jsx)("div",{className:"progress mt-2 ".concat(I?"d-block":"d-none"),role:"progressbar","aria-label":"Uploading file","aria-valuenow":T,"aria-valuemin":0,"aria-valuemax":100,children:(0,i.jsx)("div",{className:"progress-bar progress-bar-striped progress-bar-animated ".concat("Error"===M?"bg-danger":"Done"===M?"bg-success":"bg-primary"),style:{width:"".concat(T,"%")},children:M})}),(0,i.jsx)("div",{style:f,children:ec})]}),(null==k?void 0:k.length)>0?(0,i.jsx)("div",{className:"alert alert-danger",children:j.rich("errorfiles",{list:e=>k.map((e,l)=>(0,i.jsxs)("span",{className:"fw-medium",children:["string"==typeof e?e:null==e?void 0:e.name,l<k.length-1?", ":""]},l))})}):null]})}):(0,i.jsx)("div",{children:j("needsave")}),(0,i.jsx)("div",{className:"small text-muted",children:j("canorderafterupload")})]}),l&&(null==l?void 0:l.id)&&(null==S?void 0:S.length)!==0?(0,i.jsx)("div",{className:"card-footer text-align-end",children:(0,i.jsxs)("button",{type:"submit",className:"btn btn-primary btn-sm flex-none position-relative",disabled:(null==S?void 0:S.length)===0||I,children:[(0,i.jsx)("i",{className:"fi fi-cloud-upload"}),(0,i.jsx)("span",{children:j("upload")}),(0,i.jsx)("span",{className:"position-absolute top-0 start-100 translate-middle p-2 bg-danger border border-light rounded-circle animate-pulse-danger",children:(0,i.jsx)("span",{className:"visually-hidden",children:"New alerts"})})]})}):null]})}),(null==N?void 0:N.length)>0?(0,i.jsxs)("div",{className:"card mt-5",children:[(0,i.jsx)("div",{className:"card-header fs-4 fw-medium",children:j("title2")}),(0,i.jsxs)("div",{className:"card-body",children:[(0,i.jsx)("div",{className:"row",children:N.map((e,l)=>{let a=Math.min(800/e.imageMeta.width,600/e.imageMeta.height),s=e.imageMeta.width*a,o=e.imageMeta.height*a;return(0,i.jsx)("div",{className:"col-12 col-md-4",children:(0,i.jsxs)("figure",{className:"rounded caption-1 position-relative figure-gallery transition-hover-zoom-img shadow",draggable:!0,onDragStart:e=>K(e,l),onDragOver:Q,onDrop:e=>V(e,l),onDragEnd:X,onClick:()=>B(e.id),style:{opacity:q===l?.5:1,cursor:"move",backgroundColor:q===l?"#f0f0f0":"transparent",transition:"all 0.2s ease"},children:[(0,i.jsx)("img",{src:e.imageURL,width:s,height:o,alt:"",className:"img-fluid",style:{objectFit:"cover",maxHeight:"150px"},draggable:!1}),(0,i.jsx)("div",{className:"overlay",children:(0,i.jsx)("i",{className:"fi fi-thrash fs"})})]})},l)})}),(0,i.jsx)("div",{className:"small text-muted",children:j("toreorder")})]})]}):null,(0,i.jsx)("div",{className:"modal fade show",tabIndex:-1,role:"dialog",style:{display:U>0?"block":"none"},children:(0,i.jsx)("div",{className:"modal-dialog",role:"document",children:(0,i.jsxs)("div",{className:"modal-content",children:[(0,i.jsxs)("div",{className:"modal-header",children:[(0,i.jsx)("h5",{className:"modal-title",id:"exampleModalLabelMd",children:j("confirmation.title")}),(0,i.jsx)("button",{type:"button",className:"btn-close","aria-label":"Close",onClick:G})]}),(0,i.jsx)("div",{className:"modal-body",children:O?(0,i.jsx)("div",{className:"progress",children:(0,i.jsx)("div",{className:"progress-bar progress-bar-striped bg-danger",role:"progressbar",style:{width:"100%"},"aria-valuenow":100,"aria-valuemin":0,"aria-valuemax":100})}):(0,i.jsx)("div",{children:j("confirmation.body")})}),(0,i.jsxs)("div",{className:"modal-footer",children:[(0,i.jsxs)("button",{type:"button",className:"btn btn-secondary py-2",onClick:G,disabled:O,children:[(0,i.jsx)("i",{className:"fi fi-close"}),j("confirmation.cancel")]}),(0,i.jsxs)("button",{type:"button",className:"btn btn-danger py-2",onClick:()=>{console.log(">>> deletePhoto",U),P(!0),r.Z.request({method:"DELETE",url:"/api/post/".concat(l.id,"/photos/").concat(U)}).then(e=>{var l,a;console.log(">>> delete complete",e.data),(null==e?void 0:null===(l=e.data)||void 0===l?void 0:l.success)&&C(null==e?void 0:null===(a=e.data)||void 0===a?void 0:a.photos),_(0),P(!1)}).catch(e=>{console.error(">>> problem on server",e),_(0),P(!1)})},disabled:O,children:[(0,i.jsx)("i",{className:"fi fi-check"}),j("confirmation.confirm")]})]})]})})}),(0,i.jsx)("div",{className:"modal-backdrop fade ".concat(U>0?"show":"hide")})]})}}}]);

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.