PageSourceSearch

https://mindthegraph.com/_next/static/chunks/pages/admin/upload-svg-b97f864ac83d6fa8.js

js mindthegraph.com collected 2026-10-02 02:50:04 UTC 16,174 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3964],{97892:function(t,e,n){"use strict";n.d(e,{Z:function(){return c}});n(67294);var r=n(93365),i=n(34631),a=n(85893);function c(t){var e=t.children,n=t.variant,c=t.type,s=t.marginTop,u=t.marginRight,o=t.marginBottom,l=t.onClick,f=t.isInline,p=t.isLoading,d=t.minWidth,h=t.disabled,g="default"===n?i.gU:"#fff";return(0,a.jsx)(r.W,{onClick:l,variant:n,type:c,marginTop:s,marginRight:u,marginBottom:o,isInline:f,disabled:h||p,disableElevation:!0,minWidth:d,children:p?(0,a.jsx)(r.a,{fillColor:g,size:20,thickness:5}):e})}c.defaultProps={variant:"default",type:"button",onClick:function(){},isInline:!1,isLoading:!1}},93365:function(t,e,n){"use strict";n.d(e,{W:function(){return h},a:function(){return g}});var r=n(59499),i=n(6767),a=n.n(i),c=n(58793),s=n(11057),u=n(98456),o=n(64616),l=n(34631),f=n(85893);function p(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var d={default:{color:l.gU,background:l.Yf,border:"1px solid ".concat(l.PM)},defaultOutline:{color:l.Yf,border:"2px solid rgba(255, 255, 255, 0.8)"},primary:(0,r.Z)({background:l.n6,color:l.Yf},"&:hover",{background:l.iD}),secondary:(0,r.Z)({background:l.C5,color:l.Yf},"&:hover",{background:a()(l.C5).darken(.1).hex()}),facebook:(0,r.Z)({background:l._x,color:l.Yf},"&:hover",{background:a()(l._x).darken(.1).hex()}),link:{color:l.n6},danger:(0,r.Z)({background:l.yg,color:l.Yf,minWidth:150,width:"auto"},"&:hover",{background:a()(l.yg).darken(.1).hex()})},h=(0,c.Z)((function(t){var e=t.children,n=t.className,r=t.type,i=t.disabled,a=t.disableElevation,c=t.onClick;return(0,f.jsx)(s.Z,{children:e,className:n,type:r,disabled:i,disableElevation:a,onClick:c})}))((function(t){var e;return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?p(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({fontFamily:o.u,fontWeight:"bold",width:t.isInline?"initial":"100%",fontSize:16,textTransform:"none",display:t.isInline?"inline-block":"block",lineHeight:0,borderRadius:35,boxShadow:"none",height:40,paddingLeft:30,paddingRight:30,marginTop:t.marginTop,marginRight:t.marginRight,marginBottom:null!==(e=t.marginBottom)&&void 0!==e?e:10,minWidth:t.minWidth},d[t.variant])})),g=(0,c.Z)((function(t){var e=t.className,n=t.size,r=t.thickness;return(0,f.jsx)(u.Z,{className:e,size:n,thickness:r})}))((function(t){return(0,r.Z)({},"& .MuiCircularProgress-svg circle",{stroke:t.fillColor})}))},95159:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return u}});var r=n(41664),i=n.n(r),a=n(34631),c=n(85893),s={position:"absolute",top:180,left:0,padding:"1rem",color:"white",backgroundColor:a.n6,textDecoration:"none",borderRadius:"0 1px 10px 0",zIndex:"1000"};function u(){return(0,c.jsx)(i(),{href:"/admin",children:(0,c.jsx)("a",{style:s,children:"Back"})})}},69697:function(t,e,n){"use strict";n.r(e);var r=n(27812),i=n(50029),a=n(59499),c=n(87794),s=n.n(c),u=n(67294),o=n(77715),l=n(14354),f=n(31521),p=n(27831),d=n(97892),h=n(62425),g=n(95159),v=n(25675),m=n.n(v),x=n(86886),b=n(94253),y=n(66242),k=n(78445),Z=n(83060),w=n(50480),j=n(69368),O=n(98456),P=n(41664),_=n.n(P),S=n(42403),C=n(85893);function D(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function E(t){return(0,C.jsx)(f.Z,function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?D(Object(n),!0).forEach((function(e){(0,a.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({elevation:6,variant:"filled"},t))}e.default=(0,S.r)((function(){var t=(0,u.useRef)(),e=(0,u.useState)(),n=e[0],a=e[1],c=(0,u.useState)(!1),f=c[0],v=c[1],P=(0,u.useState)(!1),S=P[0],D=P[1],N=(0,u.useState)([{}]),T=N[0],I=N[1],A=(0,u.useState)([]),R=A[0],L=A[1],W=(0,u.useCallback)((function(t){t.preventDefault();var e=Array.from(t.dataTransfer.files).filter((function(t){return"image/svg+xml"===t.type}));U(e)}),[]),B=(0,u.useCallback)((function(){t.current.click()}),[]),U=function(){var t=(0,i.Z)(s().mark((function t(e){var n;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Promise.all(e.map(function(){var t=(0,i.Z)(s().mark((function t(e){return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,h.sT)(e);case 2:return t.t0=t.sent,t.t1=e.name,t.abrupt("return",{content:t.t0,name:t.t1});case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 2:n=t.sent,L(n);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Y=function(){var t=(0,i.Z)(s().mark((function t(e){var n;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=Array.from(e.target.files),U(n);case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();function z(){return z=(0,i.Z)(s().mark((function t(){return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(D(!1),a(null),R.length){t.next=5;break}return a("Select a file."),t.abrupt("return");case 5:return D(!0),I([]),t.next=9,R.forEach(function(){var t=(0,i.Z)(s().mark((function t(e){var n,i,c,u;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n={isShape:f,svg:e.content.content,fileName:e.name},t.next=3,o.Z.checkExists(n);case 3:if(t.t0=t.sent.data,!t.t0){t.next=6;break}t.t0=!window.confirm("This file already exists. Do you want to replace it? ".concat(e.name));case 6:if(!t.t0){t.next=8;break}return t.abrupt("return",D(!1));
1case 8:return t.prev=8,t.next=11,o.Z.create(n);case 11:i=t.sent,I((function(t){return[].concat((0,r.Z)(t),[i.data])})),L([]),i.status>201&&a(null!==(c=i.data)&&void 0!==c?c:"Something went wrong."),t.next=21;break;case 17:t.prev=17,t.t1=t.catch(8),a(null!==(u=t.t1.message)&&void 0!==u?u:"Something went wrong."),D(!1);case 21:D(!1);case 22:case"end":return t.stop()}}),t,null,[[8,17]])})));return function(e){return t.apply(this,arguments)}}());case 9:v(!1);case 10:case"end":return t.stop()}}),t)}))),z.apply(this,arguments)}return(0,C.jsxs)(p.default,{hasPadding:!0,children:[(0,C.jsx)(g.default,{}),(0,C.jsx)("h1",{children:"Upload SVG"}),(0,C.jsxs)(x.ZP,{container:!0,spacing:2,alignItems:"center",children:[(0,C.jsxs)(x.ZP,{item:!0,xs:12,children:["Submit the illustration to the user email in the"," ",(0,C.jsx)(_(),{href:"/admin/edit-svg",children:"Edit SVG"})," page."]}),(0,C.jsxs)(x.ZP,{item:!0,xs:12,children:[(0,C.jsxs)(b.Z,{my:2,children:[(0,C.jsx)("div",{onClick:B,onDrop:W,onDragOver:function(t){return t.preventDefault()},style:{border:"2px dashed #ccc",padding:"20px",textAlign:"center",cursor:"pointer"},children:"Drag and drop SVG files here or click to select"}),(0,C.jsx)("input",{ref:t,type:"file",accept:"image/svg+xml",onChange:Y,multiple:!0,style:{display:"none"}})]}),(0,C.jsx)(x.ZP,{item:!0,lg:12,children:(0,C.jsx)(x.ZP,{container:!0,spacing:2,alignItems:"center",justifyContent:"center",children:R.map((function(t){return(0,C.jsx)(x.ZP,{item:!0,xs:6,lg:3,children:(0,C.jsxs)(y.Z,{children:[(0,C.jsx)(k.Z,{title:t.name}),(0,C.jsx)(Z.Z,{title:t.name,children:(0,C.jsx)(b.Z,{p:1,children:(0,C.jsx)(m(),{src:t.content.url,alt:"svg",layout:"responsive",width:100,height:100})})})]},t.name)},t.name)}))})})]}),(0,C.jsx)(x.ZP,{item:!0,xs:6,children:(0,C.jsx)(w.Z,{disabled:S,control:(0,C.jsx)(j.Z,{checked:f,onChange:function(t){return v(t.target.checked)},name:"isShape"}),label:"Shape"})}),(0,C.jsx)(x.ZP,{item:!0,xs:6,children:(0,C.jsx)(d.Z,{type:"submit",color:"primary",onClick:function(){return function(){return z.apply(this,arguments)}()},disabled:S,children:"Send"})}),(0,C.jsx)(x.ZP,{item:!0,xs:6,sm:6,md:4,lg:1,children:S&&(0,C.jsx)(O.Z,{})})]}),(0,C.jsx)(b.Z,{my:2,children:(0,C.jsx)(x.ZP,{container:!0,spacing:2,alignItems:"center",children:Object.values(T).map((function(t){return t.length&&t.map((function(t){return(0,C.jsx)(x.ZP,{item:!0,xs:12,sm:6,md:4,lg:4,children:(0,C.jsxs)(y.Z,{children:[(0,C.jsx)(k.Z,{title:(e=t,e.includes("-04")?"Original":e.includes("-01")?"Flat":e.includes("-02")?"Stroke":e.includes("-03")?"Black and white":e.includes("-05")?"No stroke":e.includes("-06")?"Black and stroke":void 0)}),(0,C.jsx)(Z.Z,{title:t.name,children:(0,C.jsx)(m(),{src:t,alt:"svg",layout:"responsive",width:100,height:100})})]})},t.id);var e}))}))})}),(0,C.jsx)(l.Z,{open:!!n,autoHideDuration:6e3,anchorOrigin:{vertical:"bottom",horizontal:"center"},children:(0,C.jsx)(E,{severity:"error",children:n})})]})}))},77715:function(t,e,n){"use strict";n.d(e,{Z:function(){return v}});var r=n(50029),i=(n(59499),n(92777)),a=n(82262),c=n(87794),s=n.n(c),u=n(9669),o=n.n(u),l=n(62425),f=n(17563),p=(n(58226),n(92773)),d=n(24128),h=n(78428),g=n.n(h);o().create({baseURL:(0,l.dU)("MTG_URL_SEARCH"),httpsAgent:new(g().Agent)({rejectUnauthorized:!0})});var v=function(){function t(){(0,i.Z)(this,t)}return(0,a.Z)(t,null,[{key:"search",value:function(t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.start=e.start||0,e.limit=e.limit||10,this.findAll({search:t.replace(/\ /g,"---"),page:Math.floor(e.start/e.limit)+1,perPage:e.limit,use_new_elastic_search:!0})}},{key:"create",value:function(){var t=(0,r.Z)(s().mark((function t(e){return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,d.Z.post("illustrations/submit-new-svg",e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},{key:"checkExists",value:function(){var t=(0,r.Z)(s().mark((function t(e){return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,d.Z.post("illustrations/check",e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},{key:"fetchOne",value:function(t,e){return d.Z.get("illustrations/match?search=".concat(t,"&field=file_name&lang=en"))}},{key:"fetchRelated",value:function(t,e){return d.Z.get("illustrations/mlt?image_id=".concat(t,"&limit=32&start=0&lang=en&hide_tags=true"))}},{key:"findAll",value:function(){var t=(0,r.Z)(s().mark((function t(){var e,n,r=arguments;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},n=r.length>1&&void 0!==r[1]?r[1]:{},t.next=4,d.Z.get("illustrations?".concat(f.stringify(e)),n);case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()},{key:"getAllWithVersions",value:function(){var t=(0,r.Z)(s().mark((function t(){var e,n,r=arguments;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},n=r.length>1&&void 0!==r[1]?r[1]:{},t.next=4,d.Z.get("illustrations/all?".concat(f.stringify(e)),n);case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()},{key:"getAllWithTags",value:function(){var t=(0,r.Z)(s().mark((function t(){return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,d.Z.get("illustrations/all-with-tags");case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()},{key:"findVersions",value:function(){var t=(0,r.Z)(s().mark((function t(e){return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,d.Z.get("illustrations/".concat(e,"/version"));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},{key:"findOneByName",value:function(){var t=(0,r.Z)(s().mark((function t(e){return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,d.Z.get("illustrations/".concat(e));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},{key:"findByStudyField",value:function(){var t=(0,r.Z)(s().mark((function t(){var e,n,r=arguments;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},r.length>1?r[1]:void 0,e.use_new_elastic_search=!0,t.prev=3,t.next=6,d.Z.get("illustrations/study-field?".concat(f.stringify(e),"&lang=en"));case 6:return n=t.sent,t.abrupt("return",n.data.map((function(t){return{name:t.name,illustrations:t.illustrations.map(p.Z)}})));case 10:return t.prev=10,t.t0=t.catch(3),console.error(t.t0),t.abrupt("return",[]);case 14:case"end":return t.stop()}}),t,null,[[3,10]])})));return function(){return t.apply(this,arguments)}}()},{key:"deleteImageVersion",value:function(){var t=(0,r.Z)(s().mark((function t(e,n){return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,d.Z.delete("illustrations/".concat(e,"/version/").concat(n));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()},{key:"setActiveStatus",value:function(){var t=(0,r.Z)(s().mark((function t(e,n){return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,d.Z.post("illustrations/".concat(e,"/set-active-status"),{active:n});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()},{key:"sendIllustrationToEmail",value:function(){var t=(0,r.Z)(s().mark((function t(e,n){return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,d.Z.post("illustrations/send-illustration-to-email",{email:e,illustrationId:n});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()},{key:"generateData",value:function(){var t=(0,r.Z)(s().mark((function t(e){return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,d.Z.get("illustrations/generate-data/".concat(e));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}]),t}()},93641:function(t,e,n){"use strict";n.d(e,{CK:function(){return i},Yo:function(){return r},ZP:function(){return a}});var r={SMALL:"200x172",LARGE:"900x772"},i={FIRST_OPTION:"03",SECOND_OPTION:"04",THIRD_OPTION:"05"};function a(t,e,n,r){var i=r?"w-":"";return"".concat("https://svg.mindthegraph.com/","realistic/").concat(t,"/").concat(e,"/").concat(i).c
1oncat(t,"-").concat(n,".png")}},58226:function(t,e,n){"use strict";function r(t){return Object.keys(t).map((function(e){return"".concat(e,"=").concat(t[e])})).join("&")}n.d(e,{Z:function(){return r}})},24056:function(t,e,n){"use strict";function r(t){return t.charAt(0).toUpperCase()+t.substr(1)}n.d(e,{Z:function(){return r}})},92773:function(t,e,n){"use strict";n.d(e,{Z:function(){return a}});var r=n(93641),i=n(24056);function a(t){var e,n,a=t.file_name,c=t.image_name,s=t.tags;return{name:c.replace(/_/g," "),fileName:a,href:"/illustrations/".concat((e=a,n?e.split("-").join("_"):e.split("_").join("-"))),src:(0,r.ZP)(a,r.Yo.SMALL,r.CK.SECOND_OPTION,!0),alt:(0,i.Z)(c.replace(/_/g," ")),title:(0,i.Z)(c.replace(/_/g," ")),option:r.CK.SECOND_OPTION,tags:s}}},35247:function(t,e,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/upload-svg",function(){return n(69697)}])}},function(t){t.O(0,[4789,9043,5464,5675,5522,6269,5928,6886,6502,4354,3862,1130,6621,3905,9249,8299,9774,2888,179],(function(){return e=35247,t(t.s=e);var e}));var e=t.O();_N_E=e}]);
2//# sourceMappingURL=upload-svg-b97f864ac83d6fa8.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.