@emailmaker/emailmaker 1.0.109-alpha.2 → 1.0.109-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +2 -1
  2. package/asset-manifest.json +38 -36
  3. package/emailmaker-esm.js +1 -1
  4. package/emailmaker.d.ts +44 -1
  5. package/emailmaker.js +1 -1
  6. package/iframe/429.js +1 -1
  7. package/iframe/766.js +1 -1
  8. package/iframe/iframe-eblock.5f136dbd88b4aff20a4e.html +1 -0
  9. package/iframe/iframe.5f136dbd88b4aff20a4e.html +1 -0
  10. package/iframe/index.html +1 -1
  11. package/iframe/js/174.01401b47.js +1 -0
  12. package/iframe/js/525.e3d8308f.js +1 -0
  13. package/iframe/js/882.86c95d1e.js +1 -0
  14. package/iframe/sandbox-eblock.js +1 -1
  15. package/package.json +1 -1
  16. package/static/css/5102.cbdb59ca.chunk.css +2 -0
  17. package/static/css/{7282.739c0d6e.chunk.css → 7282.d5d7c046.chunk.css} +2 -2
  18. package/static/css/{main.3086b5d9.css → main.6b7ac1ef.css} +2 -2
  19. package/static/js/{1902.96d10b03.js → 1902.84af6230.js} +2 -2
  20. package/static/js/{9162.27f21a26.js → 2076.fa333dc2.js} +3 -3
  21. package/static/js/3628.25c1fb89.js +3 -0
  22. package/static/js/4298.df6cac3c.js +3 -0
  23. package/static/js/5102.eac304ab.js +2 -0
  24. package/static/js/5279.8904b618.js +2 -0
  25. package/static/js/{7282.0e0350e2.js → 7282.cf67c3fd.js} +3 -3
  26. package/static/js/8559.652fb850.js +2 -0
  27. package/static/js/8778.f3616411.js +2 -0
  28. package/static/js/{emailmaker_core.23ddf597.js → emailmaker_core.c2b562af.js} +3 -3
  29. package/iframe/iframe-eblock.fecd609b7217947f3d0a.html +0 -1
  30. package/iframe/iframe.fecd609b7217947f3d0a.html +0 -1
  31. package/iframe/js/174.d4af3f31.js +0 -1
  32. package/iframe/js/525.7b9b34e7.js +0 -1
  33. package/iframe/js/882.cbc0a3a7.js +0 -1
  34. package/static/css/5102.6eeeac5b.chunk.css +0 -2
  35. package/static/js/3628.e132c341.js +0 -3
  36. package/static/js/5102.af181f78.js +0 -2
  37. package/static/js/7126.139f5415.js +0 -3
  38. package/static/js/8017.2b02b271.js +0 -2
  39. package/static/js/8559.c810e5fe.js +0 -2
  40. package/static/js/8778.52a5c71c.js +0 -2
  41. /package/iframe/js/{174.d4af3f31.js.LICENSE.txt → 174.01401b47.js.LICENSE.txt} +0 -0
  42. /package/iframe/js/{525.7b9b34e7.js.LICENSE.txt → 525.e3d8308f.js.LICENSE.txt} +0 -0
  43. /package/iframe/js/{882.cbc0a3a7.js.LICENSE.txt → 882.86c95d1e.js.LICENSE.txt} +0 -0
  44. /package/static/js/{9162.27f21a26.js.LICENSE.txt → 2076.fa333dc2.js.LICENSE.txt} +0 -0
  45. /package/static/js/{3628.e132c341.js.LICENSE.txt → 3628.25c1fb89.js.LICENSE.txt} +0 -0
  46. /package/static/js/{7126.139f5415.js.LICENSE.txt → 4298.df6cac3c.js.LICENSE.txt} +0 -0
  47. /package/static/js/{7282.0e0350e2.js.LICENSE.txt → 7282.cf67c3fd.js.LICENSE.txt} +0 -0
  48. /package/static/js/{emailmaker_core.23ddf597.js.LICENSE.txt → emailmaker_core.c2b562af.js.LICENSE.txt} +0 -0
@@ -0,0 +1,2 @@
1
+ "use strict";(globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[8778],{78778:(e,t,a)=>{a.r(t),a.d(t,{default:()=>ye});var l=a(1936),i=a(71715),n=a(97803),r=a(32101),s=a(6143),o=a(84226),c=a(51114),m=a(6691),u=a(22809),d=a(6403),g=a(93927),p=a(86331),h=a(47706),f=a(84075),A=a(50028),E=a(44004),v=a(60034),y=a(98173),k=a(78443),w=a(22817),I=a(93506);function b(e,t){return{[e]:{Filter:t("Filter"),filter:t("filter"),Resize:t("Resize"),resize:t("resize"),Crop:t("Crop"),Width:t("Width"),width:t("width"),Height:t("Height"),height:t("height"),"Background color":t("Background color"),Cancel:t("Cancel"),Create:t("Create"),Objects:t("Objects"),Quality:t("Quality"),Save:t("Save"),"Loading Canvas":t("Loading Canvas"),"Loading Image":t("Loading Image"),"Loading State":t("Loading State"),"Processing Image":t("Processing Image"),Close:t("Close"),Apply:t("Apply"),Font:t("Font"),Color:t("Color"),Background:t("Background"),Image:t("Image"),Opacity:t("Opacity"),Outline:t("Outline"),Shadow:t("Shadow"),Gradient:t("Gradient"),Texture:t("Texture"),"Replace Image":t("Replace Image"),"Outline Color":t("Outline Color"),"Shadow Color":t("Shadow Color"),"Font Size":t("Font Size"),Radius:t("Radius"),"Brush Color":t("Brush Color"),"Brush Type":t("Brush Type"),"Brush Size":t("Brush Size"),History:t("History"),"Maintain aspect ratio":t("Maintain aspect ratio"),"New Text":t("New Text"),Size:t("Size"),Draw:t("Draw"),Text:t("Text"),Stickers:t("Stickers"),Frame:t("Frame"),Shapes:t("Shapes"),Corners:t("Corners"),corners:t("corners"),Done:t("Done"),"Applied Filters":t("Applied Filters"),"Resized Image":t("Resized Image"),"Cropped Image":t("Cropped Image"),"Added Drawing":t("Added Drawing"),"Added Text":t("Added Text"),"Added Shape":t("Added Shape"),"Added Sticker":t("Added Sticker"),"Added Frame":t("Added Frame"),"Merged Objects":t("Merged Objects"),"Rounded Corner":t("Rounded Corner"),"Replaced Background Image":t("Replaced Background Image"),"Added Image":t("Added Image"),Initial:t("Initial"),"Loaded State":t("Loaded State"),"Changed Style":t("Changed Style"),"Deleted object":t("Deleted object"),Merge:t("Merge"),Emoticons:t("Emoticons"),Doodles:t("Doodles"),Landmarks:t("Landmarks"),Bubbles:t("Bubbles"),Transportation:t("Transportation"),Beach:t("Beach"),PencilBrush:t("PencilBrush"),SprayBrush:t("SprayBrush"),CircleBrush:t("CircleBrush"),DiamondBrush:t("DiamondBrush"),VLineBrush:t("VLineBrush"),HLineBrush:t("HLineBrush"),SquareBrush:t("SquareBrush"),Square:t("Square"),square:t("square")}}}var L=a(5365),R=a(90176),C=a(53082),S=a(52853),_=a(2527),B=a(65185),N=a(20263),O=a(65893),x=a(50548);const M={text:{replaceDefault:!0,defaultCategory:"handwriting",items:[{family:"Montserrat Light",src:"customFonts/Montserrat-Light.woff2"},{family:"Montserrat Regular",src:"customFonts/Montserrat-Regular.woff2"},{family:"Montserrat Bold",src:"customFonts/Montserrat-Bold.woff2"},{family:"Montserrat Black",src:"customFonts/Montserrat-Black.woff2"},{family:"Roboto Light",src:"customFonts/Roboto-Light.woff2"},{family:"Roboto Regular",src:"customFonts/Roboto-Regular.woff2"},{family:"Roboto Bold",src:"customFonts/Roboto-Bold.woff2"},{family:"Roboto Black",src:"customFonts/Roboto-Black.woff2"},{family:"Lato Light",src:"customFonts/Lato-Light.woff2"},{family:"Lato Regular",src:"customFonts/Lato-Regular.woff2"},{family:"Lato Bold",src:"customFonts/Lato-Bold.woff2"},{family:"Lato Black",src:"customFonts/Lato-Black.woff2"},{family:"Rubik Light",src:"customFonts/Rubik-Light.woff2"},{family:"Rubik Regular",src:"customFonts/Rubik-Regular.woff2"},{family:"Rubik Bold",src:"customFonts/Rubik-Bold.woff2"},{family:"Rubik Black",src:"customFonts/Rubik-Black.woff2"},{family:"Bebas Neue Light",src:"customFonts/BebasNeueLight.woff2"},{family:"Bebas Neue Regular",src:"customFonts/BebasNeueRegular.woff2"},{family:"Bebas Neue Book",src:"customFonts/BebasNeueBook.woff2"},{family:"Bebas Neue Bold",src:"customFonts/BebasNeueBold.woff2"},{family:"Arial",src:"customFonts/ArialMT.woff2"},{family:"Arial Bold",src:"customFonts/Arial-BoldMT.woff2"}]}};function D(e,t){if("json"===e)return new Blob([t],{type:"application/json"});if("svg"===e)return new Blob([t],{type:"image/svg+xml"});const a=`image/${e}`;return((e,t="application/octet-stream")=>fetch(`data:${t};base64,${e}`).then(e=>e.blob()))(t=t.replace(/data:image\/([a-z]*)?;base64,/,""),a)}const G=l.createElement(p.A,{style:{fontSize:48},spin:!0}),U=({currentImageLink:e,newLink:t,onSave:n,uploadImageResultIsLoading:r})=>{const s=(0,_.p)(),[o,u]=(0,l.useState)(),[d,g]=(0,l.useState)(),{__:p}=(0,h.s9)();let f=(0,i.wA)();const A=(0,i.Pj)(),E=(0,i.d4)(y.C1),v=(0,i.d4)(k.sK),U=(0,i.d4)(w.yN),T=(0,l.useRef)(!1),[F,P]=(0,l.useState)(),q=(0,B.ml)(O.AZ.FILE_PROXY_EVENT_ID);(0,l.useEffect)(()=>{(async()=>{let t;try{const a=await fetch(e);t=await a.blob()}catch{if(t=await q.fire({url:e,project:U}).filter(e=>e instanceof Blob)[0],!t){const a=s.get(I.A9.em_token)||await N.di.getInstance(A,x.Y),l=await fetch(`https://app.emailmaker.ru/api/wp-json/cors-proxy/v1/get?url=${encodeURIComponent(e)}`,{headers:{authorization:`Bearer ${a}`}});t=await l.blob()}}if(t){let e=new FileReader;e.onload=()=>{null===F||void 0===F||F.tools.import.openBackgroundImage(o),e.result!==o&&(u(e.result),g(t.type))},e.readAsDataURL(t)}})().catch(e=>{})},[e,t,u,s,o,F,q,U,A]);const z=(0,l.useCallback)(()=>{u(null),g(null),f((0,k.Os)()),f((0,k.Oo)(I.lx.UPLOAD_IMAGE_MODAL))},[f]),j=(0,l.useRef)();j.current=async function(e,t,a){const l=await D(a,e);n&&n(new File([l],t,{lastModified:(new Date).getTime(),type:l.type}))};const H=(0,l.useCallback)(e=>{if(e)if(T.current&&F);else{T.current=!0;const e=E.locale?E.locale.replace("_","-"):"ru-RU",t=E.theme===I.IJ?matchMedia(I.F3).matches?I.nd:I.T:E.theme;L.A.init({selector:"#pixie-editor",baseUrl:a.p+"assets/pixie",image:o,activeLanguage:e,languages:b(e,p),tools:M,ui:{menubar:{replaceDefaultItems:!0,items:[{type:"undoWidget",align:"left"},{type:"zoomWidget",align:"center",desktopOnly:!0},{type:"button",icon:l.createElement(C.A,{style:{fontSize:20}}),align:"right",desktopOnly:!0,action:e=>{e.togglePanel("history")}},{type:"button",icon:l.createElement(S.A,{style:{fontSize:20}}),align:"right",desktopOnly:!0,action:()=>z()}]},nav:{position:"top"},activeTheme:t,mode:"inline",forceOverlayModeOnMobile:!1},onSave:async function(e,t,a){j.current(e,t,a)}}).then(e=>{P(e)}).catch(e=>{})}},[E.theme,o,F,P,E.locale,p,z]),W=(0,l.useCallback)(()=>{null===F||void 0===F||F.tools.export.save(null===e||void 0===e?void 0:e.split("/").pop().split(".")[0],null===d||void 0===d?void 0:d.split("/")[1])},[F,e,d]);return l.createElement(c.A,{afterOpenChange:H,width:"100%",style:{maxWidth:"100%",minHeight:"100vh"},className:"image-editor-modal blocks-modal",centered:!0,closable:!1,zIndex:1100,mask:!1,open:v,footer:[l.createElement(R.Ay,{key:"Cancel",className:"em-analytics__profile-cancel",onClick:z},p("Cancel")),l.createElement(R.Ay,{key:"Ok",className:"em-analytics__profile-updapixiete",id:"save",type:"primary",onClick:W},p("Update"))]},r&&l.createElement("div",{style:{position:"absolute",height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--colorBgLayout)",zIndex:10,opacity:.7}},l.createElement(m.A,{size:"large",indicator:G})),l.createElement("div",{id:"pixie-editor"}))},T=l.createElement(p.A,{style:{fontSize:48},spin:!0}),F=({currentImageLink:e,newLink:t,onSave:a,uploadImageResultIsLoading:i})=>l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("div",{className:"image-preview"},i&&l.createElement("div",{style:{position:"absolute",height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--colorBgLayout)",zIndex:10,opacity:.7}},l.createElement(m.A,{size:"large",indicator:T})),(t||e)&&l.createElement("img",{alt:"uploadedImage",src:t||e}))),l.createElement(U,{currentImageLink:e,newLink:t,onSave:a,uploadImageResultIsLoading:i}));var P=a(14516),q=a(7494),z=a(56893),j=a(236),H=a(54760),W=a(5674),K=a(71558),V=a(25672),$=a(10026);const Q="blocks",Z=({setCurrentImageLink:e,setModalHeight:t,setModalWidth:a,setImageStockList:i,imageStockList:n,currentReq:r,setCurrentReq:c,inputRef:u,setStockLink:d,customRequest:g})=>{const[f,A]=(0,l.useState)(!1),[E,y]=(0,l.useState)(2),{__:k}=(0,h.s9)(),[w]=(0,v.Jg)(),[I]=(0,v.h4)();(0,l.useEffect)(()=>{""!==r.keywords&&b()},[r.color,r.orientation]);const b=async()=>{const e=await I({query:r,page:1});e.data.results.length>0&&(i(e.data.results),setTimeout(()=>{a(1060),t("84vh")},0))},[L,R]=(0,l.useState)(null),C=(e,t,a)=>{try{const l=new URL(e),i=l.pathname.split("/").filter(Boolean),n=i.pop()||"",r=i.join("/"),s=`https://${l.host}${r?"/"+r:""}`,o=`https://px2.racs.rest/${n}`,c=l.search?l.search.slice(1):"",m=c?`${c}&w=${t}&q=${a}`:"w=644&q=96";return`${o}?${`${m}&proxy_url=${s}`}`}catch(l){return e}};return l.createElement("div",{className:"stock-tab"},l.createElement(s.A,{onValuesChange:b,className:n.length>0?"serach-results":""},l.createElement(P.A,{gutter:24},l.createElement(q.A,{span:n.length>0?"":24},l.createElement(s.A.Item,{className:"stock-search-input"},l.createElement(o.A,{onKeyDown:e=>"Space"===e.code&&b(),onPressEnter:e=>b(),allowClear:!0,size:n.length>0?"medium":"large",placeholder:k("Search image"),value:r.keywords,onChange:e=>c(t=>({...t,keywords:e.target.value})),ref:u,spellCheck:"false",suffix:l.createElement(V.A,{onClick:b,className:"cards-search__search-icon, input-icon",style:{fontSize:"16px",cursor:"pointer"}})}))),n.length>0&&l.createElement(l.Fragment,null,l.createElement(q.A,null,l.createElement(z.Ay.Group,{defaultValue:"",onChange:e=>c(t=>({...t,orientation:e.target.value}))},l.createElement(j.A,{title:k("All"),placement:"top"},l.createElement(z.Ay.Button,{value:""},l.createElement($.A,{icon:"MixedView"}))),l.createElement(j.A,{title:k("Landscape"),placement:"top"},l.createElement(z.Ay.Button,{value:"landscape"},l.createElement($.A,{icon:"LandscapeView"}))),l.createElement(j.A,{title:k("Portrait"),placement:"top"},l.createElement(z.Ay.Button,{value:"portrait"},l.createElement($.A,{icon:"PortraitView"}))),l.createElement(j.A,{title:k("Squarish"),placement:"top"},l.createElement(z.Ay.Button,{value:"squarish"},l.createElement($.A,{icon:"SquareView"}))))),l.createElement(q.A,null,l.createElement(z.Ay.Group,{defaultValue:"",className:"stock-color-filter",onChange:e=>c(t=>({...t,color:e.target.value}))},l.createElement(j.A,{title:k("All"),placement:"top"},l.createElement(z.Ay.Button,{className:"all-colors",value:""},"All")),l.createElement(j.A,{title:k("Black"),placement:"top"},l.createElement(z.Ay.Button,{className:"black-color",value:"black"},"B")),l.createElement(j.A,{title:k("Black and White"),placement:"top"},l.createElement(z.Ay.Button,{className:"bw-color",value:"black_and_white"},"B&\xa7W")),l.createElement(j.A,{title:k("White"),placement:"top"},l.createElement(z.Ay.Button,{className:"white-color",value:"white"},"W")),l.createElement(j.A,{title:k("Orange"),placement:"top"},l.createElement(z.Ay.Button,{className:"orange-color",value:"orange"},"O")),l.createElement(j.A,{title:k("Red"),placement:"top"},l.createElement(z.Ay.Button,{className:"red-color",value:"red"},"R")),l.createElement(j.A,{title:k("Purple"),placement:"top"},l.createElement(z.Ay.Button,{className:"purple-color",value:"purple"},"P")),l.createElement(j.A,{title:k("Magenta"),placement:"top"},l.createElement(z.Ay.Button,{className:"magenta-color",value:"magenta"},"M")),l.createElement(j.A,{title:k("Green"),placement:"top"},l.createElement(z.Ay.Button,{className:"green-color",value:"green"},"G")),l.createElement(j.A,{title:k("Teal"),placement:"top"},l.createElement(z.Ay.Button,{className:"teal-color",value:"teal"},"T")),l.createElement(j.A,{title:k("Blue"),placement:"top"},l.createElement(z.Ay.Button,{className:"blue-color",value:"blue"},"Blue")))))),n.length>0&&l.createElement("div",{className:"blocks-search__divider-wrapper"},l.createElement("div",{className:"ant-divider ant-divider-horizontal",role:"separator"}))),l.createElement("div",{className:"serach-output-wrapper",style:{marginRight:-10}},n.length>0&&l.createElement("div",{id:"scrollableDiv",style:{width:"100%",height:"calc(84vh - 148px)",overflow:"auto",paddingTop:24,paddingRight:14,paddingLeft:24,marginLeft:-24,lineHeight:"0",boxSizing:"unset"}},l.createElement(W.A,{dataLength:n&&n.length,next:async()=>{f||(A(!0),I({query:r,page:E}).then(e=>{i(t=>[...t,...e.data.results]),A(!1),y(e=>e+1)}).catch(()=>{A(!1)}))},hasMore:n,endMessage:l.createElement(H.A,{plain:!0},k("That`s all we could find.")," \ud83e\udd10"),scrollableTarget:"scrollableDiv",style:{overflow:"visible"},loader:null},l.createElement(K.A,{breakpointCols:{default:3},className:"my-masonry-grid",columnClassName:"my-masonry-grid_column"},n.map(t=>l.createElement("div",{className:"list-item",key:t.id,onClick:()=>{return a=t.urls,l=t.links,i=t.id,w(l.download_location),R(i),setTimeout(()=>R(null),2e3),d(`${a.raw}&w=1200&q=96`),e(`${a.raw}&w=1200&q=96`),void g(`${a.raw}&w=1200&q=96`);var a,l,i}},l.createElement("img",{className:L===t.id?"loaded-image":"",width:"322px",src:C(t.urls.raw,644,96),alt:t.description,onLoad:e=>e.target.parentNode.classList.add("loaded")}),l.createElement("p",{className:"creator-info",onClick:e=>e.stopPropagation()},"Photo by"," ",l.createElement("a",{target:"_blank",href:`${t.user.links.html}?utm_source=${Q}&utm_medium=referral`,rel:"noreferrer"},t.user.name)," ","on"," ",l.createElement("a",{target:"_blank",href:`https://unsplash.com/?utm_source=${Q}&utm_medium=referral`,rel:"noreferrer"},"Unsplash")),L===t.id&&l.createElement(m.A,{className:"ant-spin",indicator:l.createElement(p.A,{spin:!0})}))))))))};var Y=a(92828),J=a(86588),X=a(91796),ee=a(25228);const te=({images:e,transitionDuration:t=1e3})=>{const[a,i]=(0,l.useState)([]);return(0,l.useEffect)(()=>{if(e.length>0){const t=e[e.length-1];i(e=>[...e,{src:t,opacity:0}]),setTimeout(()=>{i(e=>e.map((t,a)=>a===e.length-1?{...t,opacity:1}:t))},1e3)}},[e]),l.createElement("div",{className:"slideshow-container"},a.map((e,a)=>l.createElement("img",{key:a,src:`data:image/jpeg;base64, ${e.src}`,alt:`Slide ${a+1}`,className:"slideshow-image",style:{opacity:e.opacity,transition:`opacity ${t}ms linear`}})))};var ae=a(54457),le=a(942),ie=a(91480);const ne=(0,l.memo)(({className:e,onClick:t})=>l.createElement("div",{className:`image-ai__arrow image-ai__arrow--next ${e||""}`,onClick:t},l.createElement(R.Ay,{className:"image-ai__arrow-btn image-ai__arrow-btn--next",size:"large",icon:l.createElement(J.A,null)})));ne.displayName="SampleNextArrow";const re=(0,l.memo)(({className:e,onClick:t})=>l.createElement("div",{className:`image-ai__arrow image-ai__arrow--prev ${e||""}`,onClick:t},l.createElement(R.Ay,{className:"image-ai__arrow-btn image-ai__arrow-btn--prev",size:"large",icon:l.createElement(X.A,null)})));re.displayName="SamplePrevArrow";const se=({setModalHeight:e,customRequest:t,aiTabRef:a,inputAiRef:i,isImageUploaded:n,setIsImageUploaded:r,aiImageRequest:c,setAiImageRequest:m,imageAiList:u,setImageAiList:g,isLoadingAi:A,setIsLoadingAi:E})=>{const{aiImageCounter:y,currentAiImgLimits:k,loadingDuringGeneration:w,requestStatus:b,handleGenerate:L,convertBase64ToFile:C,isShiftPressed:S,setIsShiftPressed:_,limitsInPlugin:N}=function({setModalHeight:e,customRequest:t,aiTabRef:a,isImageUploaded:i,setIsImageUploaded:n,aiImageRequest:r,imageAiList:s,setImageAiList:o,isLoadingAi:c,setIsLoadingAi:m}){const{__:u}=(0,h.s9)(),g=(0,le.rD)(),p=(0,d.hN)(),A=(0,ie.u)(),{emailId:E,blockId:y,projectId:k}=(0,f.g)(),[w]=(0,v.Mv)(),[b,{data:L=[]}]=(0,v.gg)(),R=(null===g||void 0===g?void 0:g.sendAIImageRequest)||w,C=(null===g||void 0===g?void 0:g.trigger)||b,S=(null===g||void 0===g?void 0:g.handleLimitUsageEmitter)||(0,B.ml)(O.AZ.ON_LIMIT_ID),[_,N]=(0,l.useState)(0),[x,M]=(0,l.useState)(null),[D,G]=(0,l.useState)(!1),[U,T]=(0,l.useState)(u("Evaluating the task")),[F,P]=(0,l.useState)(!1),q=E||y,{limits:z}=null!==g&&void 0!==g&&g.limits?g:{limits:{ai_img_limit:0}},{ai_img_limit:j}=z,H=j>0&&_>=j,W=!(!g.limits||!g.counters)&&I.EW.isPlugin,K=(0,l.useCallback)(()=>{S.fire({name:"AiImgCount",count:_+1})},[S,_]),V=(0,l.useMemo)(()=>!H&&(!W||0===j||_<j),[H,W,_,j]),$=(0,l.useCallback)(async()=>{T(u("Evaluating the task")),""===r||c||(m(!0),P(!0),o([]),A({event:"submit_form",action:"ai_image_generation",entity_id:E,project_id:k}),R({body:{project_id:k,request:"create-image",connection:"midjourney",message:r}}).then(({data:e,error:t})=>{if(t)throw t;if(401===e.data.status)throw new Error(I.ff);200===(null===e||void 0===e?void 0:e.data.status)?(null!==e&&void 0!==e&&e.data.task.id&&(T(e.data.task.message),M(e.data.task.id)),e.message&&p.success({id:"AI_IMAGE_SEND_SUCCESS",message:e.message,placement:"bottomRight",data:r}),C({task_id:null===e||void 0===e?void 0:e.data.task.id,entity_id:q})):(m(!1),P(!1),p.error({id:"AI_IMAGE_SEND_ERROR",message:(null===e||void 0===e?void 0:e.message)||u("Something went wrong, please try again"),placement:"bottomRight",data:r,innerException:e}))}).catch(e=>{m(!1),P(!1),(null!==e&&void 0!==e&&e.error||null!==e&&void 0!==e&&e.data)&&p.fromError("AI_IMAGE_SEND_ERROR",r,e.error||e)}))},[r,c,m,P,o,A,E,k,R,p,C,q,u]),Q=(0,l.useCallback)(()=>{V?(W&&(N(e=>e+1),K()),$()):W&&p.error({message:u("The usage limit has been exceeded"),description:u("The maximum number of requests for the current subscription period has been reached.\nSelect the appropriate plan to fulfil more requests"),placement:"bottomRight"})},[V,W,N,K,$,p,u]);(0,l.useEffect)(()=>{var e;W&&N((null===g||void 0===g||null===(e=g.counters)||void 0===e?void 0:e.ai_img_counter)||0)},[g,W]);const Z=(0,l.useCallback)(e=>{if(!i){n(!0);const a=e.match(/^data:image\/([A-Za-z-+/]+);base64,(.+)$/);if(!a)return;const l=a[1],i=a[2],r=atob(i),s=new Array(r.length);for(let e=0;e<r.length;e++)s[e]=r.charCodeAt(e);const o=new Uint8Array(s),c=new Blob([o],{type:`image/${l}`}),m=new File([c],"image.jpeg",{type:c.type});t({file:m})}},[i,n,t]),Y=(0,l.useCallback)(e=>{"error"!==e.status&&"Canceled"!==e.status?e.images?(T(e.status),100===e.progress&&(o(e.images),T(u("Evaluating the task")),M(null),P(!1))):(o([e.data]),m(!1)):(m(!1),P(!1),p.error({id:"AI_IMAGE_GET_ERROR",message:u("Something went wrong, please try again"),placement:"bottomRight",data:x}))},[o,T,u,m,e,x,p,P]);return(0,l.useEffect)(()=>{L.length>1&&Y(L[L.length-1])},[L,Y]),(0,l.useEffect)(()=>{(c||s.length>0)&&setTimeout(()=>{let t=550;a.current&&(t=a.current.offsetHeight+68),e(t)},0)},[a,L,s.length,c,e]),{aiImageCounter:_,setAiImageCounter:N,currentAiImgLimits:j,isFieldsDisabled:H,canGenerateImage:V,aiImageRequest:r,imageAiList:s,setImageAiList:o,isLoadingAi:c,setIsLoadingAi:m,loadingDuringGeneration:F,setLoadingDuringGeneration:P,requestStatus:U,setRequestStatus:T,handleGenerate:Q,handleLimitAiImgCount:K,convertBase64ToFile:Z,isShiftPressed:D,setIsShiftPressed:G,currentReqId:x,setCurrentReqId:M,limitsInPlugin:W}}({setModalHeight:e,customRequest:t,aiTabRef:a,isImageUploaded:n,setIsImageUploaded:r,aiImageRequest:c,imageAiList:u,setImageAiList:g,isLoadingAi:A,setIsLoadingAi:E}),{__:x}=(0,h.s9)(),[M,D]=(0,l.useState)(!1),G=(0,l.useCallback)(()=>D(!0),[]),U=(0,l.useCallback)(()=>D(!1),[]),T=(0,l.useCallback)(e=>m(e.target.value),[m]),F=(0,l.useCallback)(e=>{"Shift"===e.key?_(!0):"Enter"!==e.key||S||(e.preventDefault(),L())},[S,L,_]),z=(0,l.useCallback)(e=>{"Shift"===e.key&&_(!1)},[_]);return l.createElement("div",{className:"image-ai"},N&&l.createElement(ae.A,{text:"images",counter:y,limits:k,wrapperStyles:{marginTop:-25}}),l.createElement(P.A,{gutter:24,className:"image-ai__row"},l.createElement(q.A,{span:24},l.createElement(s.A.Item,{style:{margin:0}},l.createElement("span",{className:"ant-input-affix-wrapper ant-input-affix-wrapper-lg image-ai__input-affix-wrapper"+(M?" ant-input-affix-wrapper-focused":"")},l.createElement(o.A.TextArea,{ref:i,onKeyDown:F,onKeyUp:z,onFocus:G,onBlur:U,autoSize:!0,allowClear:!0,className:"text-area-input-hybrid image-ai__textarea",placeholder:x("Generate image"),value:c,onChange:T,spellCheck:"false"}),l.createElement("span",{className:"ant-input-suffix image-ai__input-suffix"},A||w?l.createElement(p.A,{className:"input-icon image-ai__input-icon",spin:!0}):l.createElement($.A,{icon:"AI",className:"input-icon image-ai__input-icon",onClick:L})))))),(A||u.length>0)&&l.createElement(Y.A,{dotPosition:"top",arrows:!0,nextArrow:l.createElement(ne,null),prevArrow:l.createElement(re,null),className:"image-ai__carousel"},A&&l.createElement("div",{className:"image-ai__loading"},l.createElement("div",{className:"spin"},l.createElement(p.A,{style:{fontSize:48},spin:!0}),l.createElement("p",{className:"status"},b))),u.length>0&&u.map((e,t)=>l.createElement("div",{key:t,className:"image-ai__image-item"},l.createElement(te,{images:u}),l.createElement("div",{className:"buttons"},u.length>0&&l.createElement(R.Ay,{onClick:()=>C(`data:image/jpeg;base64, ${e}`),icon:l.createElement(ee.A,null)},x("Use this one")))))))},oe=({setNewLink:e,setCurrentImageLink:t,setModalHeight:a,setModalWidth:i,setImageGifList:n,imageGifList:r,currentReqGif:c,setCurrentReqGif:u,inputRef:d,setStockLink:g,customRequest:f})=>{const{__:A}=(0,h.s9)(),[E,y]=(0,l.useState)(null),[k,w]=(0,l.useState)(!1),[I,b]=(0,l.useState)(25),[L]=(0,v.eo)(),R=async()=>{var e,t;const l=await L({query:c,page:0});(null===l||void 0===l||null===(e=l.data)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.length)>0&&(n(l.data.data),setTimeout(()=>{a("84vh"),i(1060)},0))},C=l.createElement(p.A,{style:{fontSize:20},spin:!0});return l.createElement("div",{className:"stock-tab"},l.createElement(s.A,{onValuesChange:R,className:r.length>0?"serach-results":""},l.createElement(P.A,{gutter:24},l.createElement(q.A,{span:r.length>0?"":24},l.createElement(s.A.Item,{className:"stock-search-input"},l.createElement(o.A,{onKeyDown:e=>"Space"===e.code&&R(),onPressEnter:e=>R(),allowClear:!0,size:r.length>0?"medium":"large",placeholder:A("Search GIFs"),value:c.keywords,onChange:e=>u(t=>({...t,keywords:e.target.value})),ref:d,spellCheck:"false",suffix:l.createElement(V.A,{onClick:R,className:"cards-search__search-icon, input-icon",style:{fontSize:"16px",cursor:"pointer"}})})))),r.length>0&&l.createElement("div",{className:"blocks-search__divider-wrapper"},l.createElement("div",{className:"ant-divider ant-divider-horizontal blocks-search__divider",role:"separator"}))),l.createElement("div",{className:"serach-output-wrapper",style:{marginRight:-10}},r.length>0&&l.createElement("div",{id:"scrollableDiv",style:{width:"100%",height:"calc(84vh - 148px)",overflow:"auto",paddingTop:24,paddingRight:14,paddingLeft:24,marginLeft:-24,lineHeight:"0",boxSizing:"unset"}},l.createElement(W.A,{dataLength:r&&r.length,next:async()=>{k||(w(!0),L({query:c,page:I}).then(e=>{n(t=>[...t,...e.data.data]),w(!1),b(e=>e+25)}).catch(()=>{w(!1)}))},hasMore:r,endMessage:l.createElement(H.A,{plain:!0},A("That`s all we could find.")," \ud83e\udd10"),scrollableTarget:"scrollableDiv",style:{overflow:"visible"},loader:l.createElement(m.A,{indicator:C})},l.createElement(K.A,{breakpointCols:{default:3},className:"my-masonry-grid",columnClassName:"my-masonry-grid_column"},r.map((e,a)=>l.createElement("div",{className:"list-item",key:e.id+a,onClick:()=>{return a=e.images.downsized.url,l=e.id,y(l),setTimeout(()=>{y(null)},2e3),g(`${a}`),t(`${a}`),void f(`${a}`);var a,l}},l.createElement("img",{className:E===e.id?"loaded-image":"",width:"322px",src:`${e.images.downsized.url}`,alt:e.title,onLoad:e=>e.target.parentNode.classList.add("loaded")}),l.createElement("a",{rel:"noreferrer",href:"https://giphy.com/",target:"_blank",onClick:e=>e.stopPropagation()},l.createElement("div",{className:"overlay-image",style:{backgroundImage:"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAkCAYAAAB/up84AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABSBJREFUeNrsWjFv2zoQVoMW8BZ18xaN3qLRW9QtW9OtW92to98vaPoP3K1b1S1b3c2jvWlUNm3lw1s8Mpu3PAo4Iocr70jKlp0COuCQlpKPx/t43x1pv3h8fEwGeT5yNoTgeclLZvza6NgxXoNaGRktjE6MpjC2NVqh92bwt4HxBI1ro0s0dgN2tvD5a8a/9vkq0M+xYKdG81A7Gp6pyBjZddrnO6N36Hkbqyn8u4L3vYC0hjLHeAbPVhC4TwAK/ewNvLsEhyxgFXLK2l/D4tvnOVrUiPEh1k/JjvLYyWENdeTcKazBBr6AdY4AqBTmbkIzhO4gvMumYLxAYKzgPTvhBBajYNwCksHYhOyYiow1KONaKYlfO8bPEWyGEfi5Iu+Vjizg7EzB3xvwWTMxWkHG4mDnMF6BnSnYncLzHWGG4BqiwZkKQMC7I0cOVTCJhvRUKNgNCmCOxhNmrBEWzwGi0Y6rIihbsnOH/JgE2hshKrLZv4Px9yhj1twafRlid/UIGWvlFdlVLirIkIM12nETGLeO2tTPECBUZuT/a7JBMpSxUybYLjulUCN2iEpHQoyuGWZJUCa8R/VGSZvGB0iOdjAO9n8EtC2zUxICSIoW0ICTmA53DCDKQzWZg89XAXZ2B2iMavBnjDKpBX6B1tnAM5aqQgGhnU2D6GmHuqw7AkaOPmP/bsHpFC1kTLqVhglS6fFNgX1MCXUHO1zR1h5AFOoSc1jjmKx/An/1PoBQasBSoZZ3hpyaOrg0IW2sRkG8JsU8CaCaLckAhfi6AG0cmeuzkyMQMtL+SiySkY3oA/EgGeICK0UOZYQKVsQpDAjm2BpsaAGQLMKnMdok3yLtpKS70yT7OUBcm7UTHb5grk5y1Csrj40MqUbUpgW7NXo+RunckODkQvdXM37iwm7b1VA7lAaVB4jUUZOUIzNxfOougAwy3GUN0qWG2IJJ09V2NcvIFE8c54nQelEHFM6C6chUhI+WZjjffDQkrenPhqmlrAC9Naof/aLhXZeNNfMZOk+MtPOVRjNmTpfcCut0+biGZ3PBj1ywWTOfqV3v+yjLFuDPRs8Ddu05vLtmsuHQ0s73wehvR0t7aGkPevfCM5fcGr0MbOW9NSSFwF52cP5KcLIv+X4EUGbCemcOqpoz73/haE4CZNkRjAR20vwENXHRc2bWEMyQuUuGVe4hc6K6rBmg7pKN0XdGX7dts9E3Rr8afUATFl1PqgLAG6T3AoX1nSVtMP9l5r5FVyiu+D14/YssRHOheGVQYNMeinrhsMcV2WVPRR1rIRT4QmiA5r4G6oxp0y6ZzFh4LvhmB84MHz1xta9vWQMrcFR/3iF+7DmEu2YoyTshRbuMvGE9hnwGPQR1tdR04aCueKrqAIgiu/AqcCf1JXPhfuoYosGHn4Hgqa6AnCK4IfSkCa1eCJRxLGnn+mX0rfDOJok4AsQAUpwQlND2++HIgNiOVO1LVRIgtXDPs0bpunEU08vktHLMpoJS1/d9qEo6h6gAzq7RRaPV+QmBeICzUUh2fIHzk0s3HedXwkEy2ReQmjn4XDzDjqkN4D/J04/y/np5KbSrrtbwAyx+kTxdf9tfpvSZIW9O3FScHJAF8PEFc5F2lQzSi5wJheoG3U/t0xYOcgBAcOHuAkr7mY9ditoAiCz2q8uvEcD8gJpSDuGNl5hfnaTJ0/fpheMUr4CitHCO6fqdesj359xh1tWiqggfdUCmcz9ZivZ7+BnQM5P/BRgABx8sJWqTxoYAAAAASUVORK5CYII=)"}})),E===e.id&&l.createElement(m.A,{className:"ant-spin",indicator:l.createElement(p.A,{spin:!0})}))))))))};var ce=a(81644),me=a(41244),ue=a(47794),de=a(74397);const ge="BACKGROUND",pe="EDITOR",he="UPLOAD",fe="STOCK",Ae="GIF",Ee="AI",{Dragger:ve}=n.A,ye=()=>{var e,t;const a=(0,le.rD)(),{__:n}=(0,h.s9)(),b=(0,i.wA)(),{projectId:L}=(0,f.g)(),[R,C]=(0,E.dS)(),[S]=(0,v.FQ)(),{modal:_}=r.A.useApp(),N=(0,d.hN)(),x=(0,i.d4)(y.B$),M=(0,i.d4)(y.C1),D=(0,i.d4)(k.cL),{request:G,resolveImagePicker:U}=(0,de.p)(),[T,P]=(0,l.useState)(""),[q,z]=(0,l.useState)(""),[j,H]=(0,l.useState)(""),[W,K]=(0,l.useState)(""),[V,$]=(0,l.useState)(he),[Q,Y]=(0,l.useState)({width:"",height:"",size:"",format:""}),[J,X]=(0,l.useState)("success"),[ee,te]=(0,l.useState)(!1),ae=l.useRef(null),ie=l.useRef(null),ne=l.useRef(null),re=l.useRef(null),ye=l.useRef(null),ke=l.useRef(null),we=l.useRef(null),Ie=l.useRef(null),be=l.useRef(null),[Le,Re]=(0,l.useState)("auto"),[Ce,Se]=(0,l.useState)(572),[_e,Be]=(0,l.useState)(null),[Ne,Oe]=(0,l.useState)(!1),[xe,Me]=(0,l.useState)({keywords:"",color:"",orientation:""}),[De,Ge]=(0,l.useState)({keywords:""}),[Ue,Te]=(0,l.useState)([]),[Fe,Pe]=(0,l.useState)([]),[qe,ze]=(0,l.useState)([]),[je,He]=(0,l.useState)(!1),[We,Ke]=(0,l.useState)(""),[Ve,$e]=(0,l.useState)(!1),[Qe,Ze]=(0,l.useState)(0),Ye=(0,i.d4)(w.yN),Je=(0,B.ml)(O.AZ.FILE_PROXY_EVENT_ID);let Xe=!(x||(null===(e=M.id)||void 0===e?void 0:e.toString())!==(null===Ye||void 0===Ye||null===(t=Ye.members)||void 0===t?void 0:t.owner.ID));const et=async e=>{if(e)try{const t=await tt(e);at({url:e}),t&&lt(t)&&it({file:t})}catch(t){}},tt=async e=>{try{const t=(await Je.fire({url:e,project:Ye})).filter(e=>e instanceof Blob)[0];if(t)return t;const a=`https://api.emailmaker.ru/tools/file-proxy.php?url=${encodeURIComponent(e)}`,l=await fetch(a);if(!l.ok)throw new Error(`Server returned ${l.status}`);const i=await l.blob();return new File([i],e.split("/").pop(),{type:i.type})}catch(t){}};document.onpaste=function(e){const t=e.clipboardData.items[0];if(V===he&&W){var l;if(0===(null===t||void 0===t||null===(l=t.type)||void 0===l?void 0:l.indexOf("image"))&&!1!==a.imageCenterLocalUploadEnabled){const e=t.getAsFile();lt(e);const a={file:e};z(""),it(a)}0===t.type.indexOf("text")&&t.getAsString(e=>{"http"===e.slice(0,4)?(z(""),P(e),at({url:e})):"meta"===e.toString().slice(1,5)&&(z(""),P(e.toString().split('"')[1]),at({url:e.toString().split('"')[1]}))})}},(0,l.useEffect)(()=>{const e=e=>{let t=null;"background"===(null===G||void 0===G?void 0:G.kind)?(t=ge,K(ge)):"img"===(null===G||void 0===G?void 0:G.kind)&&(K("IMG"),t="IMG"),null!==G&&void 0!==G&&G.currentUrl&&t&&(P(G.currentUrl),$(e))};D===I.lx.UPLOAD_IMAGE_MODAL||D===I.lx.UPLOAD_BACKGROUND_MODAL?e(pe):D===I.lx.UPLOAD_IMAGE_MODAL_AI||D===I.lx.UPLOAD_BACKGROUND_MODAL_AI?(Xe?($e(!0),Ze(2)):e(Ee),setTimeout(()=>{var e;return null===(e=be.current)||void 0===e?void 0:e.focus({cursor:"start"})},100)):D===I.lx.UPLOAD_IMAGE_MODAL_UPLOAD||D===I.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD?(e(he),setTimeout(()=>{var e;return null===(e=ke.current)||void 0===e?void 0:e.focus({cursor:"start"})},100)):D===I.lx.UPLOAD_IMAGE_MODAL_STOCK||D===I.lx.UPLOAD_BACKGROUND_MODAL_STOCK?(Xe?($e(!0),Ze(3)):e(fe),setTimeout(()=>{var e;return null===(e=Ie.current)||void 0===e?void 0:e.focus({cursor:"start"})},100)):D===I.lx.UPLOAD_IMAGE_MODAL_GIF||D===I.lx.UPLOAD_BACKGROUND_MODAL_GIF?(Xe?($e(!0),Ze(3)):e(Ae),setTimeout(()=>{var e;return null===(e=we.current)||void 0===e?void 0:e.focus({cursor:"start"})},100)):D===I.lx.UPLOAD_IMAGE_MODAL_EDIT||D===I.lx.UPLOAD_BACKGROUND_MODAL_EDIT?(Xe?($e(!0),Ze(5)):e(pe),b((0,k.Wz)(I.lx.IMAGE_EDITOR_MODAL))):K("")},[D,b,Xe,G]);const at=(0,l.useCallback)(({url:e=T||""})=>{P(e),U({url:e,meta:{mode:"select"}}),setTimeout(()=>{Me({keywords:"",color:"",orientation:""}),Ge({keywords:""}),Pe([]),Te([]),K(""),Ke(""),He(!1),H(""),z(""),$(he)},200),b((0,k.Oo)()),b((0,k.Os)())},[T,b,U]);(0,l.useEffect)(()=>{const e=q||j;e?(0,me.DI)(e).then(t=>{X(t),Se(572),setTimeout(()=>{let e=0;ie.current&&(e=ie.current.offsetHeight+62),Re(e)},0),at(e)}).catch(e=>{X(e)}):X("")},[q,j,at]),(0,l.useEffect)(()=>{T&&S(T).then(({data:e})=>{Y({width:null===e||void 0===e?void 0:e.width,height:null===e||void 0===e?void 0:e.height,size:((null===e||void 0===e?void 0:e.fileSize)/1024).toFixed(2),format:null===e||void 0===e?void 0:e.format})})},[T,S]);(0,l.useEffect)(()=>{var e;""===xe.keywords&&(null===ke||void 0===ke||null===(e=ke.current)||void 0===e||e.focus({cursor:"start"}),Pe([]),setTimeout(()=>{Re("auto"),Se(572)},0))},[xe,Pe,Re,Se]);const lt=e=>{const t="image/jpeg"===e.type||"image/png"===e.type||"image/jpg"===e.type||"image/webp"===e.type||"image/gif"===e.type||"image/svg+xml"===e.type;return t||N.error({id:"IMAGE_UPLOAD_WRONG_FORMAT",data:e,message:"Upload",description:"You can only upload JPG/JPEG/PNG/WEBP/GIF/SVG file!"}),t},it=({file:e})=>{const t="image/svg+xml"===e.type,l="image/webp"===e.type,i=e=>{const t=new Image;t.src=URL.createObjectURL(e),t.onload=()=>{(async e=>{Oe(!0);const t=e.file;try{"image/gif"!==t.type&&(e.file=await(0,A.A)(t,{maxSizeMB:a.compressMaxSize||.45,maxWidthOrHeight:a.compressMaxWidthOrHeight||2e3})),R(e).then(({error:e,data:a})=>{if(e)N.fromError("IMAGE_UPLOAD_ERROR",t,e);else{const e=(0,ue.g0)(a);var l;e.error?N.error({id:"IMAGE_UPLOAD_ERROR",data:t,innerException:400===e.error.status?(null===a||void 0===a?void 0:a.data)||(null===a||void 0===a||null===(l=a[0])||void 0===l?void 0:l.data):void 0,message:e.error.code||n("Upload failed"),description:e.error.message||n("File upload failed with status 400")}):e.file_url&&(Re("auto"),te(!1),at({url:e.file_url}),N.success({id:"IMAGE_UPLOAD_SUCCESS",data:t,message:n("The image was successfully uploaded.")}))}}).catch(e=>{}).finally(()=>{Oe(!1)})}catch(l){Oe(!1)}})({user_id:M.id,folder:L,file:e})}};t?((e,t)=>{const a=new FileReader;a.onload=function(a){const l=a.target.result,i=new Blob([l],{type:"image/svg+xml;charset=utf-8"}),n=URL.createObjectURL(i),r=new Image;r.onload=function(){const a=document.createElement("canvas");a.width=2*r.width,a.height=2*r.height,a.getContext("2d").drawImage(r,0,0,a.width,a.height),a.toBlob(a=>{const l=new File([a],e.name.replace(".svg",".png"),{type:"image/png"});t(l),URL.revokeObjectURL(n)},"image/png")},r.src=n},a.readAsText(e)})(e,e=>i(e)):l?((e,t,a=90)=>{const l=new Image;l.src=URL.createObjectURL(e),l.onload=()=>{const e=document.createElement("canvas");e.width=l.width,e.height=l.height;const i=e.getContext("2d");i.imageSmoothingEnabled=!0,i.imageSmoothingQuality="high",i.drawImage(l,0,0,e.width,e.height),e.toBlob(e=>{const a=new File([e],"converted.jpg",{type:"image/jpeg"});t(a)},"image/jpeg",a/100)},l.onerror=e=>{t(null)}})(e,e=>i(e)):i(e)},nt=e=>it({file:e});let rt=[{label:n("Upload"),key:he,children:l.createElement("div",{ref:ae,style:{paddingBottom:24}},!1!==a.imageCenterLocalUploadEnabled&&l.createElement(ve,{showUploadList:!1,name:"Image",beforeUpload:lt,customRequest:it,style:{marginBottom:10},multiple:!1,accept:"image/png, image/jpeg, image/jpg, image/webp, image/gif, image/svg+xml"},l.createElement("p",{className:"ant-upload-drag-icon"},l.createElement(g.A,null)),l.createElement("p",{className:"ant-upload-text"},n("Click to select, paste from the clipboard, or drag and drop")),l.createElement("p",{className:"ant-upload-hint"},n("Accepted formats: PNG, JPG, WEBP, SVG or GIF."))),l.createElement(s.A,{style:{padding:"0 2px 0 2px"}},l.createElement(s.A.Item,{validateStatus:J},l.createElement(o.A,{ref:ke,allowClear:!0,size:"large",placeholder:n("Paste image URL here"),value:q,onChange:e=>{const t=e.target.value;z(t),_e&&clearTimeout(_e);const a=setTimeout(()=>et(t),1e3);Be(a)},spellCheck:"false"}))))}];a.imageCenterStockEnabled&&!Xe&&rt.push({label:n("Stock"),key:fe,children:l.createElement("div",{ref:ne,style:{paddingBottom:24}},l.createElement(Z,{currentReq:xe,setCurrentReq:Me,imageStockList:Fe,setImageStockList:Pe,setModalWidth:Se,setModalHeight:Re,setStockLink:H,setCurrentImageLink:P,inputRef:Ie,customRequest:et}))}),a.imageCenterGifEnabled&&!Xe&&rt.push({label:n("GIF"),key:Ae,children:l.createElement("div",{ref:re,style:{paddingBottom:24}},l.createElement(oe,{currentReqGif:De,setCurrentReqGif:Ge,imageGifList:Ue,setImageGifList:Te,setModalWidth:Se,setModalHeight:Re,setStockLink:H,setCurrentImageLink:P,inputRef:we,customRequest:et}))}),a.elementAIimageEnabled&&!Xe&&rt.push({label:n("AI"),key:Ee,children:l.createElement("div",{ref:ye,style:{paddingBottom:24}},l.createElement(se,{setModalHeight:Re,customRequest:it,aiImageRequest:We,setAiImageRequest:Ke,imageAiList:qe,setImageAiList:ze,isLoadingAi:je,setIsLoadingAi:He,aiTabRef:ye,inputAiRef:be,isImageUploaded:ee,setIsImageUploaded:te}))}),a.imageCenterEditorEnabled&&rt.push({label:"",key:pe,children:l.createElement("div",{ref:ie},l.createElement(F,{currentImageLink:T,newLink:q,imageSize:Q,onSave:nt,uploadImageResultIsLoading:C.isLoading||!1}))});const st=l.createElement(p.A,{style:{fontSize:32,margin:-16},spin:!0});return l.createElement(l.Fragment,null,l.createElement(c.A,{width:Ce,className:"image-center blocks-modal",title:n("Image Center"),centered:!0,style:{minHeight:390},open:!!W,onOk:at,onCancel:()=>{b((0,k.Oo)()),setTimeout(()=>{P(""),z(""),Pe([]),Pe([]),Me({keywords:"",color:"",orientation:""}),Ge({keywords:""}),Re("auto"),!je&&Ke(""),Se(572),$(he)},200)},footer:V===pe?l.createElement(l.Fragment,null):null},l.createElement(m.A,{spinning:Ne,indicator:st},l.createElement(u.A,{activeKey:V,onChange:e=>{"GALLERY"===e?_.success({maskClosable:!0,centered:!0,title:n("Coming soon"),content:n("The feature is under development."),okText:n("Ok. I'll be waiting"),onOk:()=>{}}):e===pe&&""===T?_.warning({maskClosable:!0,centered:!0,title:n(""),content:n("To preview and edit the uploaded image"),okText:n("Upload Image"),onOk:()=>{$(he)}}):(setTimeout(()=>{let t=0,a=0;var l;if(e===he&&ae.current)""===xe.keywords&&(null===(l=ke.current)||void 0===l||l.focus({cursor:"start"})),t=300,a=572;else if(e===pe&&ie.current)t=ie.current.offsetHeight+62,a=572;else if(e===fe&&ne.current){var i;""===xe.keywords&&(null===(i=Ie.current)||void 0===i||i.focus({cursor:"start"})),t=130,a=572,Fe.length>0&&(a=1060,t="84vh")}else if(e===Ae&&re.current){var n;""===xe.keywords&&(null===(n=we.current)||void 0===n||n.focus({cursor:"start"})),t=130,a=572,Ue.length>0&&(a=1060,t="84vh")}else if(e===Ee&&ye.current){var r;if(""===We&&0===qe.length)null===(r=be.current)||void 0===r||r.focus({cursor:"start"}),t=130;else t=ye.current.offsetHeight+82;a=572}Re(t),Se(a)},0),$(e))},items:rt,style:{height:Le,minHeight:130}}))),l.createElement(ce.A,{open:Ve,onCancel:()=>$e(!1),initialSlide:Qe}))}}}]);
2
+ //# sourceMappingURL=8778.f3616411.js.map