@emailmaker/emailmaker 1.0.117-alpha.3 → 1.0.117-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.
- package/CHANGELOG.en.md +40 -3
- package/CHANGELOG.md +40 -0
- package/README.md +3 -2
- package/asset-manifest.json +44 -38
- package/emailmaker-esm.js +1 -1
- package/emailmaker.d.ts +7 -0
- package/emailmaker.js +1 -1
- package/iframe/429.js +1 -1
- package/iframe/766.js +1 -1
- package/iframe/css/sandbox-dark.css +8 -0
- package/iframe/css/sandbox-light.css +8 -0
- package/iframe/css/sandbox.css +32 -0
- package/iframe/iframe-eblock.3d39ec0d6695dfd04dfe.html +1 -0
- package/iframe/iframe.3d39ec0d6695dfd04dfe.html +1 -0
- package/iframe/index.html +1 -1
- package/iframe/js/525.f6e2f6b3.js +1 -0
- package/iframe/js/781.94ac3161.js +1 -0
- package/iframe/js/{667.a3109c1d.js.LICENSE.txt → 781.94ac3161.js.LICENSE.txt} +2 -0
- package/iframe/js/882.7804f4a0.js +1 -0
- package/iframe/sandbox-eblock.js +1 -1
- package/iframe/sandbox-eblock.js.LICENSE.txt +0 -2
- package/package.json +1 -1
- package/react/index.js +1 -1
- package/react/index.mjs +1 -1
- package/static/css/2016.6d88154a.chunk.css +2 -0
- package/static/css/2854.eaf83aed.chunk.css +2 -0
- package/static/css/8727.566a7baa.chunk.css +2 -0
- package/static/css/main.ec0d79d0.css +2 -0
- package/static/js/{1807.2f873ba8.js → 1807.544be549.js} +3 -3
- package/static/js/{1902.59ed55f8.js → 1902.46b497c9.js} +3 -3
- package/static/js/{5072.a7444daa.js → 2016.d527f648.js} +3 -3
- package/static/js/{262.3062229e.js → 262.a0c80d6d.js} +3 -3
- package/static/js/3195.56b10745.js +2 -0
- package/static/js/6256.e81830e2.js +2 -0
- package/static/js/{1716.2d977604.js → 6802.8b81b864.js} +3 -3
- package/static/js/7251.a53ab2ce.js +2 -0
- package/static/js/817.00be8b68.js +2 -0
- package/static/js/8245.117e8e2d.js +2 -0
- package/static/js/8559.f5ef7cd8.js +3 -0
- package/static/js/8727.11fb3035.js +2 -0
- package/static/js/9688.dddd5b80.js +2 -0
- package/static/js/emailmaker_core.767054b1.js +2 -0
- package/iframe/iframe-eblock.6ba89053b8c4bd89671b.html +0 -1
- package/iframe/iframe.6ba89053b8c4bd89671b.html +0 -1
- package/iframe/js/525.2a5bee62.js +0 -1
- package/iframe/js/667.a3109c1d.js +0 -1
- package/iframe/js/882.b65c6b97.js +0 -1
- package/iframe/js/882.b65c6b97.js.LICENSE.txt +0 -1
- package/static/css/2854.257728de.chunk.css +0 -2
- package/static/css/5072.72467a43.chunk.css +0 -2
- package/static/css/8727.2f8ba497.chunk.css +0 -2
- package/static/css/main.4fad2cb5.css +0 -2
- package/static/js/5243.413e6220.js +0 -3
- package/static/js/817.93306766.js +0 -2
- package/static/js/8245.d98fa2d7.js +0 -2
- package/static/js/8727.ef480f4b.js +0 -2
- package/static/js/9535.1da6d801.js +0 -2
- package/static/js/emailmaker_core.d8816d78.js +0 -2
- /package/iframe/js/{525.2a5bee62.js.LICENSE.txt → 525.f6e2f6b3.js.LICENSE.txt} +0 -0
- /package/static/js/{1807.2f873ba8.js.LICENSE.txt → 1807.544be549.js.LICENSE.txt} +0 -0
- /package/static/js/{1902.59ed55f8.js.LICENSE.txt → 1902.46b497c9.js.LICENSE.txt} +0 -0
- /package/static/js/{5072.a7444daa.js.LICENSE.txt → 2016.d527f648.js.LICENSE.txt} +0 -0
- /package/static/js/{262.3062229e.js.LICENSE.txt → 262.a0c80d6d.js.LICENSE.txt} +0 -0
- /package/static/js/{1716.2d977604.js.LICENSE.txt → 6802.8b81b864.js.LICENSE.txt} +0 -0
- /package/static/js/{5243.413e6220.js.LICENSE.txt → 8559.f5ef7cd8.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[8727],{25516:(e,t,a)=>{a.d(t,{Rt:()=>d,W5:()=>l.W5,Zq:()=>o,e0:()=>c});var r=a(1936),i=a(8855),l=a(53687);function n(e,t){if(!e)return t;if(!t)return e;return`${function(e){let t=e.length;for(;t>0&&"/"===e[t-1];)t--;return e.slice(0,t)}(e)}/${function(e){let t=0;for(;t<e.length&&"/"===e[t];)t++;return e.slice(t)}(t)}`}function o(e,t){if(/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(t))return t;const r=function(e){const t=a.p;if(e&&/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(e))return e;let r=n(t,e||"");return!r||r.startsWith("/")||/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(r)||(r="/"+r),r}(e),i=n(r,t||"");return!i||i.startsWith("/")||/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(i)?i:"/"+i}function s(e,t){return null!==e&&void 0!==e&&Object.prototype.hasOwnProperty.call(e,t)}function c(e,t,a){const r={...e,id:`FM_${e.id}`},i=(e,r)=>{const i=t.normalizeId(e);return a?a.pathForId(i,r,!0):i};if(s(r.data,"itemId")&&"string"===typeof r.data.itemId&&(r.data.itemId=i(r.data.itemId,!1)),s(r.data,"itemIds")&&Array.isArray(r.data.itemIds)&&(r.data.itemIds=r.data.itemIds.map(e=>"string"===typeof e?i(e,!1):e)),s(r.data,"folderId")){const e=r.data.folderId;"string"===typeof e?r.data.folderId=i(e,!0):null!==e&&void 0!==e||(r.data.folderId=i("",!0))}return r}function u(e){if(e){if("function"===typeof e)return e;if("string"===typeof e){const t=e,a=e=>{const{className:a,style:l,onClick:n,...o}=e,s=(0,i.p)(t);return r.createElement("span",{role:"img",className:a?`anticon ${a}`:"anticon",style:l,onClick:n,dangerouslySetInnerHTML:{__html:s},...o})};return a.displayName="IconFromSource",a}}}function d(e){if(!e)return;const t={};for(const[a,r]of Object.entries(e)){const e=u(r);e&&(t[a]=e)}return Object.keys(t).length>0?t:void 0}},58727:(e,t,a)=>{a.r(t),a.d(t,{default:()=>de});var r=a(1936),i=a(69962),l=a(57549),n=a(6403),o=a(96040),s=a(47706),c=a(84075),u=a(50028),d=a(98173),m=a(78443),g=a(22817),p=a(11157);function f(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 h=a(5365),v=a(2527),y=a(65185),b=a(20263),A=a(68876),w=a(8855),E=a(65893),I=a(50548);const k={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 L(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 C=({currentImageLink:e,prefetchedBlobUrl:t,newLink:n,onSave:o,uploadImageResultIsLoading:c})=>{const u=(0,v.p)(),[C,R]=(0,r.useState)(),[S,O]=(0,r.useState)(),{__:_}=(0,s.s9)();let U=(0,i.wA)();const B=(0,i.Pj)(),x=(0,A.rD)(),D=(0,i.d4)(d.C1),N=(0,i.d4)(m.sK),M=(0,i.d4)(g.yN),F=(0,r.useMemo)(()=>{if(null===x||void 0===x||!x.icons)return;const e={};for(const[t,a]of Object.entries(x.icons))"string"===typeof a&&(e[t]=(0,w.p)(a));return Object.keys(e).length>0?e:void 0},[null===x||void 0===x?void 0:x.icons]),G=(0,r.useRef)(!1),[T,P]=(0,r.useState)(),z=(0,y.ml)(E.AZ.FILE_PROXY_EVENT_ID);(0,r.useEffect)(()=>{(async()=>{const a=e;if(!a&&!t)return;let r;if(t)try{const e=await fetch(t);e.ok&&(r=await e.blob())}catch{r=void 0}if(!r&&a)try{const e=await fetch(a);r=await e.blob()}catch{if(r=await z.fire({url:a,project:M}).filter(e=>e instanceof Blob)[0],!r){const e=u.get(p.A9.em_token)||await b.di.getInstance(B,I.Y),t=await fetch(`https://app.emailmaker.ru/api/wp-json/cors-proxy/v1/get?url=${encodeURIComponent(a)}`,{headers:{authorization:`Bearer ${e}`}});r=await t.blob()}}if(r){let e=new FileReader;e.onload=()=>{null===T||void 0===T||T.tools.import.openBackgroundImage(C),e.result!==C&&(R(e.result),O(r.type))},e.readAsDataURL(r)}})().catch(e=>{})},[e,t,n,R,u,C,T,z,M,B]);const q=(0,r.useCallback)(()=>{R(null),O(null),U((0,m.Os)()),U((0,m.Oo)(p.lx.UPLOAD_IMAGE_MODAL))},[U]),j=(0,r.useRef)();j.current=async function(e,t,a){const r=await L(a,e);o&&o(new File([r],t,{lastModified:(new Date).getTime(),type:r.type}))};const W=(0,r.useCallback)(e=>{if(e)if(G.current&&T);else{G.current=!0;const e=D.locale?D.locale.replace("_","-"):"ru-RU",t=D.theme===p.IJ?matchMedia(p.F3).matches?p.nd:p.T:D.theme;h.A.init({selector:"#pixie-editor",baseUrl:a.p+"assets/pixie",image:C,activeLanguage:e,languages:f(e,_),tools:k,ui:{menubar:{replaceDefaultItems:!0,items:[{type:"undoWidget",align:"left"},{type:"zoomWidget",align:"center",desktopOnly:!0},{type:"button",icon:r.createElement(l.HQ,{icon:"HistoryOutlined",configIcons:F,style:{fontSize:20}}),align:"right",desktopOnly:!0,action:e=>{e.togglePanel("history")}},{type:"button",icon:r.createElement(l.HQ,{icon:"CloseOutlined",configIcons:F,style:{fontSize:20}}),align:"right",desktopOnly:!0,action:()=>q()}]},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=>{})}},[D.theme,C,T,P,D.locale,_,q,F]),H=(0,r.useCallback)(()=>{null===T||void 0===T||T.tools.export.save(null===e||void 0===e?void 0:e.split("/").pop().split(".")[0],null===S||void 0===S?void 0:S.split("/")[1])},[T,e,S]);return r.createElement(l.aF,{afterOpenChange:W,width:"100%",style:{maxWidth:"100%",minHeight:"100vh"},className:"image-editor-modal",centered:!0,closable:!1,zIndex:1100,mask:!1,open:N,footer:[r.createElement(l.$n,{key:"Cancel",className:"em-analytics__profile-cancel",onClick:q},_("Cancel")),r.createElement(l.$n,{key:"Ok",className:"em-analytics__profile-updapixiete",id:"save",type:"primary",onClick:H},_("Update"))]},c&&r.createElement("div",{style:{position:"absolute",height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--colorBgLayout)",zIndex:10,opacity:.7}},r.createElement(l.tK,{size:"large"})),r.createElement("div",{id:"pixie-editor"}))},R=({currentImageLink:e,newLink:t,previewDisplayUrl:a,resolvedPreviewObjectUrl:i,onSave:n,uploadImageResultIsLoading:o})=>{const s=a||i;return r.createElement(r.Fragment,null,r.createElement("div",null,r.createElement("div",{className:"image-preview"},o&&r.createElement("div",{style:{position:"absolute",height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--colorBgLayout)",zIndex:10,opacity:.7}},r.createElement(l.tK,{size:"large"})),s&&r.createElement("img",{alt:"uploadedImage",src:s}))),r.createElement(C,{currentImageLink:e,prefetchedBlobUrl:i,newLink:t,onSave:n,uploadImageResultIsLoading:o}))};var S=a(5674),O=a(71558),_=a(89660),U=a(53687);function B(e,t){return e?e.exhausted?{...e,src:null}:{...e,src:e.src||t||null}:null}function x({items:e,getItemId:t,getRequestUrl:a,createController:i}){const[l,n]=(0,r.useState)({}),o=(0,r.useRef)(new Map),s=(0,r.useCallback)(e=>{const r=t(e),l=a(e),n=`${r}:${l}`;if(o.current.has(n))return{itemId:r,requestUrl:l,cacheKey:n,controller:o.current.get(n)};const s=i(l);return o.current.set(n,s),{itemId:r,requestUrl:l,cacheKey:n,controller:s}},[i,t,a]);(0,r.useEffect)(()=>{const t=new Set,a={},r=e.map(e=>{var r,i;const{itemId:l,cacheKey:o,controller:c}=s(e);t.add(o),a[l]=c.src;const u=B(null===(r=c.handleChangeSrc)||void 0===r?void 0:r.call(c),c.src);return null!==u&&void 0!==u&&u.changed&&u.src&&(a[l]=u.src),null===(i=c.subscribeToSrcChange)||void 0===i?void 0:i.call(c,e=>{const t=B(e,c.src);null!==t&&void 0!==t&&t.changed&&t.src&&n(e=>e[l]===t.src?e:{...e,[l]:t.src})})}).filter(Boolean);return o.current.forEach((e,a)=>{t.has(a)||o.current.delete(a)}),n(a),()=>{r.forEach(e=>null===e||void 0===e?void 0:e())}},[s,e]);return{getDisplaySrc:(0,r.useCallback)(e=>{const{itemId:t,requestUrl:a,controller:r}=s(e);return l[t]||r.src||a},[l,s]),handleLoad:(0,r.useCallback)(e=>{s(e).controller.handleSuccess()},[s]),handleError:(0,r.useCallback)(e=>{const{itemId:t,controller:a}=s(e),r=B(a.handleError(),a.src);null!==r&&void 0!==r&&r.changed&&r.src&&n(e=>({...e,[t]:r.src}))},[s])}}var D=a(50879);const N="blocks",M=({setCurrentImageLink:e,setModalHeight:t,setModalWidth:a,setImageStockList:i,imageStockList:c,currentReq:u,setCurrentReq:d,inputRef:m,setStockLink:g,customRequest:p})=>{const f=(0,A.rD)(),h=(0,D.L)(),[v,y]=(0,r.useState)(!1),[b,w]=(0,r.useState)(2),{__:E}=(0,s.s9)(),I=(0,n.hN)(),[k]=(0,_.Jg)(),[L]=(0,_.h4)(),C=(0,r.useCallback)(e=>{var t;return e instanceof Error||"string"===typeof(null===e||void 0===e?void 0:e.message)&&e.message?e.message:"string"===typeof(null===e||void 0===e||null===(t=e.error)||void 0===t?void 0:t.message)&&e.error.message?e.error.message:E("Failed to load stock images through the configured proxy chain.")},[E]),R=(0,r.useCallback)(e=>{I.error({id:"STOCK_IMAGES_SEARCH_FAILED",message:E("Failed to load stock images"),description:C(e)})},[E,C,I]);(0,r.useEffect)(()=>{""!==u.keywords&&B()},[u.color,u.orientation]);const B=async()=>{var e;const r=await L({query:u,page:1});if(null!==r&&void 0!==r&&r.error)return R(r.error),void i([]);const l=(null===r||void 0===r||null===(e=r.data)||void 0===e?void 0:e.results)||[];l.length>0?(i(l),setTimeout(()=>{a(1060),t("84vh")},0)):i([])},[M,F]=(0,r.useState)(null),G=(0,r.useCallback)((e,t,a)=>{const r=e.includes("?")?"&":"?";return`${e}${r}w=${t}&q=${a}`},[]),T=(0,r.useCallback)(e=>(0,U.l)(e,{config:f,standalone:h,resourceType:"stockImages",intent:"display"}),[f,h]),P=(0,r.useCallback)(e=>e.id,[]),z=(0,r.useCallback)(e=>G(e.urls.raw,644,96),[G]),{getDisplaySrc:q,handleLoad:j,handleError:W}=x({items:c,getItemId:P,getRequestUrl:z,createController:T}),H=e=>t=>{j(e),t.target.parentNode.classList.add("loaded")},K=e=>()=>{W(e)};return r.createElement("div",{className:"stock-tab"},r.createElement(l.lV,{onValuesChange:B,className:c.length>0?"serach-results":""},r.createElement(l.fI,{gutter:24},r.createElement(l.fv,{span:c.length>0?"":24},r.createElement(l.lV.Item,{className:"stock-search-input"},r.createElement(l.DO,{onSearch:B,allowClear:!0,size:c.length>0?"middle":"large",placeholder:E("Search image"),value:u.keywords,onChange:e=>d(t=>({...t,keywords:e.target.value})),ref:m,spellCheck:"false",enterButton:!1}))),c.length>0&&r.createElement(r.Fragment,null,r.createElement(l.fv,null,r.createElement(l.sx.Group,{defaultValue:"",onChange:e=>d(t=>({...t,orientation:e.target.value}))},r.createElement(l.m_,{title:E("All"),placement:"top"},r.createElement(l.sx.Button,{value:""},r.createElement(o.Ay,{icon:"MixedView"}))),r.createElement(l.m_,{title:E("Landscape"),placement:"top"},r.createElement(l.sx.Button,{value:"landscape"},r.createElement(o.Ay,{icon:"LandscapeView"}))),r.createElement(l.m_,{title:E("Portrait"),placement:"top"},r.createElement(l.sx.Button,{value:"portrait"},r.createElement(o.Ay,{icon:"PortraitView"}))),r.createElement(l.m_,{title:E("Squarish"),placement:"top"},r.createElement(l.sx.Button,{value:"squarish"},r.createElement(o.Ay,{icon:"SquareView"}))))),r.createElement(l.fv,null,r.createElement(l.XD,{defaultValue:"",onChange:e=>d(t=>({...t,color:e.target.value})),options:[{value:"",colorClass:"all-colors",label:E("All")},{value:"black",colorClass:"black-color",label:E("Black")},{value:"black_and_white",colorClass:"bw-color",label:E("Black and White")},{value:"white",colorClass:"white-color",label:E("White")},{value:"orange",colorClass:"orange-color",label:E("Orange")},{value:"red",colorClass:"red-color",label:E("Red")},{value:"purple",colorClass:"purple-color",label:E("Purple")},{value:"magenta",colorClass:"magenta-color",label:E("Magenta")},{value:"green",colorClass:"green-color",label:E("Green")},{value:"teal",colorClass:"teal-color",label:E("Teal")},{value:"blue",colorClass:"blue-color",label:E("Blue")}],tooltipPlacement:"top"})))),c.length>0&&r.createElement("div",{className:"blocks-search__divider-wrapper"},r.createElement("div",{className:"ant-divider ant-divider-horizontal",role:"separator"}))),r.createElement("div",{className:"serach-output-wrapper",style:{marginRight:-10}},c.length>0&&r.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"}},r.createElement(S.A,{dataLength:c&&c.length,next:async()=>{v||(y(!0),L({query:u,page:b}).then(e=>{var t;if(null!==e&&void 0!==e&&e.error)return R(e.error),void y(!1);const a=(null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.results)||[];i(e=>[...e,...a]),y(!1),w(e=>e+1)}).catch(()=>{y(!1)}))},hasMore:c,endMessage:r.createElement(l.cG,{plain:!0},E("That`s all we could find.")," \ud83e\udd10"),scrollableTarget:"scrollableDiv",style:{overflow:"visible"},loader:null},r.createElement(O.A,{breakpointCols:{default:3},className:"my-masonry-grid",columnClassName:"my-masonry-grid_column"},c.map(t=>r.createElement("div",{className:"list-item",key:t.id,onClick:()=>{return a=t.urls,r=t.links,i=t.id,k(r.download_location),F(i),setTimeout(()=>F(null),2e3),g(`${a.raw}&w=1200&q=96`),e(`${a.raw}&w=1200&q=96`),void p(`${a.raw}&w=1200&q=96`);var a,r,i}},r.createElement("img",{className:M===t.id?"loaded-image":"",width:"322px",src:q(t),alt:t.description,onLoad:H(t),onError:K(t)}),r.createElement("p",{className:"creator-info",onClick:e=>e.stopPropagation()},"Photo by"," ",r.createElement("a",{target:"_blank",href:`${t.user.links.html}?utm_source=${N}&utm_medium=referral`,rel:"noreferrer"},t.user.name)," ","on"," ",r.createElement("a",{target:"_blank",href:`https://unsplash.com/?utm_source=${N}&utm_medium=referral`,rel:"noreferrer"},"Unsplash")),M===t.id&&r.createElement(l.tK,{className:"ant-spin",size:"small"}))))))))},F=({images:e,transitionDuration:t=1e3})=>{const[a,i]=(0,r.useState)([]);return(0,r.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]),r.createElement("div",{className:"slideshow-container"},a.map((e,a)=>r.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 G=a(57701),T=a(37444),P=a(91480);var z=a(54729),q=a(50003),j=a(46234);const W=({setModalHeight:e,customRequest:t,aiTabRef:a,inputAiRef:u,isImageUploaded:d,setIsImageUploaded:g,aiImageRequest:f,setAiImageRequest:h,imageAiList:v,setImageAiList:b,isLoadingAi:w,setIsLoadingAi:I})=>{const k=(0,c.Zp)(),L=(0,i.wA)(),{__:C,_n:R}=(0,s.s9)(),S=(0,A.rD)(),[O,U]=(0,r.useState)(!1),[B,x]=(0,r.useState)(null),{aiImageCounter:D,currentAiImgLimits:N,loadingDuringGeneration:M,requestStatus:W,handleGenerate:H,convertBase64ToFile:K,isShiftPressed:V,setIsShiftPressed:Z,limitsInPlugin:$}=function({setModalHeight:e,customRequest:t,aiTabRef:a,isImageUploaded:i,setIsImageUploaded:l,aiImageRequest:o,imageAiList:u,setImageAiList:d,isLoadingAi:m,setIsLoadingAi:g,onPluginAiImageLimitExceeded:f,onImageGenerateLimitExceeded:h}){const{__:v}=(0,s.s9)(),b=(0,A.rD)(),w=(0,n.hN)(),I=(0,P.u)(),{emailId:k,blockId:L,projectId:C}=(0,c.g)(),[R]=(0,_.Mv)(),[S,{data:O=[]}]=(0,_.gg)(),[U]=(0,G.Oq)(),B=(null===b||void 0===b?void 0:b.sendAIImageRequest)||R,x=(null===b||void 0===b?void 0:b.trigger)||S,D=(null===b||void 0===b?void 0:b.handleLimitUsageEmitter)||(0,y.ml)(E.AZ.ON_LIMIT_ID),[N,M]=(0,r.useState)(0),[F,z]=(0,r.useState)(null),[q,j]=(0,r.useState)(!1),[W,H]=(0,r.useState)(v("Evaluating the task")),[K,V]=(0,r.useState)(!1),Z=k||L,{limits:$}=null!==b&&void 0!==b&&b.limits?b:{limits:{ai_img_limit:0}},{ai_img_limit:Q}=$,Y=Q>0&&N>=Q,X=!(!b.limits||!b.counters)&&p.EW.isPlugin,J=(0,r.useCallback)(()=>{D.fire({name:"AiImgCount",count:N+1})},[D,N]),ee=(0,r.useMemo)(()=>!Y&&(!X||0===Q||N<Q),[Y,X,N,Q]),te=(0,r.useCallback)(async()=>{H(v("Evaluating the task")),""===o||m||(g(!0),V(!0),d([]),I({event:"submit_form",action:"ai_image_generation",entity_id:k,project_id:C}),B({body:{project_id:C,request:"create-image",connection:"midjourney",message:o}}).then(({data:e,error:t})=>{if(t)throw t;if(401===e.data.status)throw new Error(p.ff);200===(null===e||void 0===e?void 0:e.data.status)?(null!==e&&void 0!==e&&e.data.task.id&&(H(e.data.task.message),z(e.data.task.id)),e.message&&w.success({id:"AI_IMAGE_SEND_SUCCESS",message:e.message,placement:"bottomRight",data:o}),x({task_id:null===e||void 0===e?void 0:e.data.task.id,entity_id:Z})):(g(!1),V(!1),w.error({id:"AI_IMAGE_SEND_ERROR",message:(null===e||void 0===e?void 0:e.message)||v("Something went wrong, please try again"),placement:"bottomRight",data:o,innerException:e}))}).catch(e=>{g(!1),V(!1),(null!==e&&void 0!==e&&e.error||null!==e&&void 0!==e&&e.data)&&w.fromError("AI_IMAGE_SEND_ERROR",o,e.error||e)}))},[o,m,g,V,d,I,k,C,B,w,x,Z,v]),ae=(0,r.useCallback)(async()=>{if(ee){if(!X){var e;const t=await U("image_generate"),a=(0,T.nx)("image_generate",null===(e=t.data)||void 0===e?void 0:e.stats);if(a)return void(null===h||void 0===h||h(a))}X&&(M(e=>e+1),J()),te()}else X&&(f?f():w.error({message:v("The usage limit has been exceeded"),description:v("The maximum number of requests for the current subscription period has been reached.\nSelect the appropriate plan to fulfil more requests"),placement:"bottomRight"}))},[ee,X,U,h,M,J,te,w,v,f]);(0,r.useEffect)(()=>{var e;X&&M((null===b||void 0===b||null===(e=b.counters)||void 0===e?void 0:e.ai_img_counter)||0)},[b,X]);const re=(0,r.useCallback)(e=>{if(!i){l(!0);const a=e.match(/^data:image\/([A-Za-z-+/]+);base64,(.+)$/);if(!a)return;const r=a[1],i=a[2],n=atob(i),o=new Array(n.length);for(let e=0;e<n.length;e++)o[e]=n.charCodeAt(e);const s=new Uint8Array(o),c=new Blob([s],{type:`image/${r}`}),u=new File([c],"image.jpeg",{type:c.type});t({file:u})}},[i,l,t]),ie=(0,r.useCallback)(e=>{"error"!==e.status&&"Canceled"!==e.status?e.images?(H(e.status),100===e.progress&&(d(e.images),H(v("Evaluating the task")),z(null),V(!1))):(d([e.data]),g(!1)):(g(!1),V(!1),w.error({id:"AI_IMAGE_GET_ERROR",message:v("Something went wrong, please try again"),placement:"bottomRight",data:F}))},[d,H,v,g,e,F,w,V]);return(0,r.useEffect)(()=>{O.length>1&&ie(O[O.length-1])},[O,ie]),(0,r.useEffect)(()=>{(m||u.length>0)&&setTimeout(()=>{let t=550;a.current&&(t=a.current.offsetHeight+68),e(t)},0)},[a,O,u.length,m,e]),{aiImageCounter:N,setAiImageCounter:M,currentAiImgLimits:Q,isFieldsDisabled:Y,canGenerateImage:ee,aiImageRequest:o,imageAiList:u,setImageAiList:d,isLoadingAi:m,setIsLoadingAi:g,loadingDuringGeneration:K,setLoadingDuringGeneration:V,requestStatus:W,setRequestStatus:H,handleGenerate:ae,handleLimitAiImgCount:J,convertBase64ToFile:re,isShiftPressed:q,setIsShiftPressed:j,currentReqId:F,setCurrentReqId:z,limitsInPlugin:X}}({setModalHeight:e,customRequest:t,aiTabRef:a,isImageUploaded:d,setIsImageUploaded:g,aiImageRequest:f,imageAiList:v,setImageAiList:b,isLoadingAi:w,setIsLoadingAi:I,onPluginAiImageLimitExceeded:()=>U(!0),onImageGenerateLimitExceeded:x}),Q=O&&N>0?(0,j.r4)(N):null,Y=Q?(0,q.Si)(Q.presetId):null,X=B?(0,q.Si)(B.presetId):null,[J,ee]=(0,r.useState)(!1),te=(0,r.useCallback)(()=>ee(!0),[]),ae=(0,r.useCallback)(()=>ee(!1),[]),re=(0,r.useCallback)(e=>h(e.target.value),[h]),ie=(0,r.useCallback)(e=>{"Shift"===e.key?Z(!0):"Enter"!==e.key||V||(e.preventDefault(),H())},[V,H,Z]),le=(0,r.useCallback)(e=>{"Shift"===e.key&&Z(!1)},[Z]),ne=v[v.length-1];return r.createElement("div",{className:"image-ai"},Y&&Q?r.createElement(z.X,{open:!0,onClose:()=>U(!1),title:C(Y.titleKey),subtitle:C(Y.subtitleKey),usageResource:Y.usageResource,previousDisplay:(0,q.hO)(Q.previousLimit),nextDisplay:(0,q.hO)(Q.nextLimit),onChangePlan:()=>{U(!1),document.body.classList.remove("editor"),k("/billing"),L((0,m.qf)(p.lx.SWITCH_TO_PLAN_MODAL))}}):null,X&&B?r.createElement(z.X,{open:!0,onClose:()=>x(null),title:C(X.titleKey),subtitle:C(X.subtitleKey),usageResource:X.usageResource,previousDisplay:(0,q.hO)(B.previousLimit),nextDisplay:(0,q.hO)(B.nextLimit),onChangePlan:()=>{x(null),document.body.classList.remove("editor"),k("/billing"),L((0,m.qf)(p.lx.SWITCH_TO_PLAN_MODAL))}}):null,$&&r.createElement(l.xl,{text:`${D} ${C("of")} ${N>0?N:"\u221e"} images ${R("was used","were used",D)}`,exceeded:N>0&&D>=N,style:{marginTop:-25},extra:r.createElement("span",{style:{textDecoration:"underline",cursor:"pointer"},onClick:()=>k(S.billingPageUrl||p.vc.billing)},C("Need more?"))}),r.createElement(l.fI,{gutter:24,className:"image-ai__row"},r.createElement(l.fv,{span:24},r.createElement(l.lV.Item,{style:{margin:0}},r.createElement("span",{className:"ant-input-affix-wrapper ant-input-affix-wrapper-lg image-ai__input-affix-wrapper"+(J?" ant-input-affix-wrapper-focused":"")},r.createElement(l.fs,{ref:u,onKeyDown:ie,onKeyUp:le,onFocus:te,onBlur:ae,autoSize:!0,allowClear:!0,className:"text-area-input-hybrid image-ai__textarea",placeholder:C("Generate image"),value:f,onChange:re,spellCheck:"false"}),r.createElement("span",{className:"ant-input-suffix image-ai__input-suffix"},w||M?r.createElement(o.Ay,{icon:"LoadingOutlined",className:"input-icon image-ai__input-icon",spin:!0}):r.createElement(o.Ay,{icon:"AI",className:"input-icon image-ai__input-icon",onClick:H})))))),(w||v.length>0)&&r.createElement("div",{className:"image-ai__preview"},w&&0===v.length&&r.createElement("div",{className:"image-ai__loading"},r.createElement("div",{className:"spin"},r.createElement(o.Ay,{icon:"LoadingOutlined",style:{fontSize:48},spin:!0}),r.createElement("p",{className:"status"},W))),v.length>0&&r.createElement("div",{className:"image-ai__image-item"},r.createElement(F,{images:v}),r.createElement("div",{className:"buttons"},r.createElement(l.$n,{onClick:()=>K(`data:image/jpeg;base64, ${ne}`),icon:r.createElement(o.Ay,{icon:"CheckOutlined"})},C("Use this one"))))))},H=({setNewLink:e,setCurrentImageLink:t,setModalHeight:a,setModalWidth:i,setImageGifList:o,imageGifList:c,currentReqGif:u,setCurrentReqGif:d,inputRef:m,setStockLink:g,customRequest:p})=>{const{__:f}=(0,s.s9)(),h=(0,A.rD)(),v=(0,D.L)(),y=(0,n.hN)(),[b,w]=(0,r.useState)(null),[E,I]=(0,r.useState)(!1),[k,L]=(0,r.useState)(25),[C]=(0,_.eo)(),R=(0,r.useCallback)(e=>{var t;return e instanceof Error||"string"===typeof(null===e||void 0===e?void 0:e.message)&&e.message?e.message:"string"===typeof(null===e||void 0===e||null===(t=e.error)||void 0===t?void 0:t.message)&&e.error.message?e.error.message:f("Failed to load GIFs through the configured proxy chain.")},[f]),B=(0,r.useCallback)(e=>{y.error({id:"STOCK_GIFS_SEARCH_FAILED",message:f("Failed to load GIFs"),description:R(e)})},[f,R,y]),N=async()=>{var e,t;const r=await C({query:u,page:0});if(null!==r&&void 0!==r&&r.error)return B(r.error),void o([]);(null===r||void 0===r||null===(e=r.data)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.length)>0&&(o(r.data.data),setTimeout(()=>{a("84vh"),i(1060)},0))},M=(0,r.useCallback)(e=>(0,U.l)(e,{config:h,standalone:v,resourceType:"generic",intent:"display"}),[h,v]),F=(0,r.useCallback)(e=>e.id,[]),G=(0,r.useCallback)(e=>e.images.downsized.url,[]),{getDisplaySrc:T,handleLoad:P,handleError:z}=x({items:c,getItemId:F,getRequestUrl:G,createController:M}),q=e=>t=>{P(e),t.target.parentNode.classList.add("loaded")},j=e=>()=>{z(e)};return r.createElement("div",{className:"stock-tab"},r.createElement(l.lV,{onValuesChange:N,className:c.length>0?"serach-results":""},r.createElement(l.fI,{gutter:24},r.createElement(l.fv,{span:c.length>0?"":24},r.createElement(l.lV.Item,{className:"stock-search-input"},r.createElement(l.DO,{onSearch:N,allowClear:!0,size:c.length>0?"middle":"large",placeholder:f("Search GIFs"),value:u.keywords,onChange:e=>d(t=>({...t,keywords:e.target.value})),ref:m,spellCheck:"false",enterButton:!1})))),c.length>0&&r.createElement("div",{className:"blocks-search__divider-wrapper"},r.createElement("div",{className:"ant-divider ant-divider-horizontal",role:"separator"}))),r.createElement("div",{className:"serach-output-wrapper",style:{marginRight:-10}},c.length>0&&r.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"}},r.createElement(S.A,{dataLength:c&&c.length,next:async()=>{E||(I(!0),C({query:u,page:k}).then(e=>{if(null!==e&&void 0!==e&&e.error)return B(e.error),void I(!1);o(t=>[...t,...e.data.data]),I(!1),L(e=>e+25)}).catch(()=>{I(!1)}))},hasMore:c,endMessage:r.createElement(l.cG,{plain:!0},f("That`s all we could find.")," \ud83e\udd10"),scrollableTarget:"scrollableDiv",style:{overflow:"visible"},loader:r.createElement(l.tK,{size:"small"})},r.createElement(O.A,{breakpointCols:{default:3},className:"my-masonry-grid",columnClassName:"my-masonry-grid_column"},c.map((e,a)=>r.createElement("div",{className:"list-item",key:e.id+a,onClick:()=>{return a=e.images.downsized.url,r=e.id,w(r),setTimeout(()=>{w(null)},2e3),g(`${a}`),t(`${a}`),void p(`${a}`);var a,r}},r.createElement("img",{className:b===e.id?"loaded-image":"",width:"322px",src:T(e),alt:e.title,onLoad:q(e),onError:j(e)}),r.createElement("a",{rel:"noreferrer",href:"https://giphy.com/",target:"_blank",onClick:e=>e.stopPropagation()},r.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=)"}})),b===e.id&&r.createElement(l.tK,{className:"ant-spin",size:"small"}))))))))};var K=a(81644),V=a(13032),Z=a(85469),$=a(65287),Q=a(50644),Y=a(74937);async function X(e,t,a){if(!t)return;const r=function(e){if(null!==e&&void 0!==e&&""!==e)return e}(null!==a&&void 0!==a?a:t.rootId);let i;if("function"===typeof t.uploadFiles){i=function(e){if(null===e||void 0===e||!e.success||!Array.isArray(e.detailed))return;const t=e.detailed.find(e=>(null===e||void 0===e?void 0:e.success)&&e.data);return null===t||void 0===t?void 0:t.data}(await t.uploadFiles({folderId:r,items:[{name:e.name,size:e.size,type:e.type,folderId:r,data:e}]}))}else if("function"===typeof t.uploadFile){i=function(e,t,a){var r,i,l;if(e)return{id:e.id,name:e.name||t.name,size:null!==(r=e.size)&&void 0!==r?r:t.size,type:e.type||t.type,folderId:null!==(i=null!==(l=e.folderId)&&void 0!==l?l:a)&&void 0!==i?i:"",url:e.url,thumbnail:e.thumbnail,thumbnailUrl:e.thumbnailUrl,date:e.date,dimensions:e.dimensions,aspectRatio:e.aspectRatio,extension:e.extension,selected:e.selected,isFolder:e.isFolder,lastEdited:e.lastEdited,childrenCount:e.childrenCount}}(await t.uploadFile({name:e.name,size:e.size,type:e.type,folderId:r,data:e}),e,r)}const l=await async function(e,t){if(e){if(e.url)return e.url;if("function"===typeof t.getFileById&&e.id){const a=await t.getFileById(e.id);if(null!==a&&void 0!==a&&a.url)return a.url;if(null!==a&&void 0!==a&&a.thumbnailUrl)return a.thumbnailUrl;if(null!==a&&void 0!==a&&a.thumbnail)return a.thumbnail}if("function"===typeof t.getFileUrl&&void 0!==e.folderId&&e.name){const a=await t.getFileUrl(e.folderId||"",e.name);if(a)return a}if("function"===typeof t.getUrl&&e.name){const a=await t.getUrl(e);if(a)return a}return e.thumbnail||e.thumbnailUrl}}(i,t);return l?{item:i,url:l}:void 0}var J=a(74397),ee=a(25516),te=a(47600);const ae="BACKGROUND",re="EDITOR",ie="UPLOAD",le="STOCK",ne="GIF",oe="AI",{Dragger:se}=l.Upload,ce=V.p,ue=(e,t)=>new File([e],((e,t)=>{const a=ce(t);return!a||e.includes(".")?e:`${e}.${a}`})(((e,t="image")=>{try{const a=new URL(e).pathname.split("/").pop();return a&&decodeURIComponent(a)||t}catch{return t}})(t),e.type),{type:e.type||"application/octet-stream"}),de=({dataProvider:e})=>{var t,a;const f=(0,A.rD)(),h=(0,D.L)(),{__:v}=(0,s.s9)(),b=(0,i.wA)(),{projectId:w}=(0,c.g)(),[I]=(0,_.FQ)(),{modal:k}=l.qw.useApp(),L=(0,n.hN)(),C=(0,i.d4)(d.B$),S=(0,i.d4)(d.C1),O=(0,i.d4)(m.cL),{request:U,resolveImagePicker:B}=(0,J.p)(),[x,N]=(0,r.useState)(""),[F,G]=(0,r.useState)(""),[T,P]=(0,r.useState)(""),[z,q]=(0,r.useState)(""),[j,V]=(0,r.useState)(ie),[de,me]=(0,r.useState)({width:"",height:"",size:"",format:""}),[ge,pe]=(0,r.useState)("success"),[fe,he]=(0,r.useState)(!1),ve=r.useRef(null),ye=r.useRef(null),be=r.useRef(null),Ae=r.useRef(null),we=r.useRef(null),Ee=r.useRef(null),Ie=r.useRef(null),ke=r.useRef(null),Le=r.useRef(null),[Ce,Re]=(0,r.useState)("auto"),[Se,Oe]=(0,r.useState)(572),[_e,Ue]=(0,r.useState)(!1),[Be,xe]=(0,r.useState)({keywords:"",color:"",orientation:""}),[De,Ne]=(0,r.useState)({keywords:""}),[Me,Fe]=(0,r.useState)([]),[Ge,Te]=(0,r.useState)([]),[Pe,ze]=(0,r.useState)([]),[qe,je]=(0,r.useState)(!1),[We,He]=(0,r.useState)(""),[Ke,Ve]=(0,r.useState)(!1),[Ze,$e]=(0,r.useState)(0),Qe=(0,i.d4)(g.yN),Ye=void 0!==(null===Qe||void 0===Qe?void 0:Qe.id)?String(Qe.id):w||"",Xe=(0,y.ml)(E.AZ.UPLOAD_EVENT_ID),Je=r.useRef((0,$.a)()),et=r.useRef(""),tt=r.useRef(0),at=r.useRef(""),[rt,it]=(0,r.useState)(""),[lt,nt]=(0,r.useState)(""),ot=(0,r.useCallback)(()=>{at.current&&(URL.revokeObjectURL(at.current),at.current=""),it("")},[]),st=(0,r.useCallback)(()=>{nt("")},[]);let ct=!(C||(null===(t=S.id)||void 0===t?void 0:t.toString())!==(null===Qe||void 0===Qe||null===(a=Qe.members)||void 0===a?void 0:a.owner.ID));const ut=(0,r.useCallback)((e,t,a=v("The image could not be uploaded."))=>{const r=t instanceof Error?t.message:a;L.error({id:"IMAGE_UPLOAD_ERROR",data:e,message:v("Upload failed"),description:r})},[v,L]),dt=(0,r.useCallback)(async e=>{const t=await Xe.fire({file:e,project:Ye});return(0,Q.L8)(t)},[Ye,Xe]),mt=(0,te.O)(),gt=async e=>{if(e)try{const t=await ft(e);t&&yt(t)?await bt({file:t}):t||ut({url:e},null,v("Failed to download image from URL."))}catch(t){ut({url:e},t,v("Failed to process image URL."))}},pt=r.useRef(gt);pt.current=gt,r.useEffect(()=>{if(j!==ie||!z)return;const e=F.trim();if(!e||!e.toLowerCase().startsWith("http"))return;const t=setTimeout(()=>{pt.current(e)},1e3);return()=>{clearTimeout(t)}},[F,j,z]);const ft=async e=>{try{const t=(0,$.e)(e),a=await Je.current.resolve(t,void 0,mt);return ue(a,t)}catch(t){}};document.onpaste=function(e){var t,a;const r=null===(t=e.clipboardData)||void 0===t||null===(a=t.items)||void 0===a?void 0:a[0];if(j===ie&&z){var i,l,n;if(0===(null===r||void 0===r||null===(i=r.type)||void 0===i?void 0:i.indexOf("image"))&&!1!==f.imageCenterLocalUploadEnabled){const e=r.getAsFile();yt(e);const t={file:e};return G(""),void bt(t)}const t=null===(l=e.clipboardData)||void 0===l?void 0:l.getData("text/plain");if(t&&t.trim().toLowerCase().startsWith("http"))return e.preventDefault(),e.stopPropagation(),void G(t.trim());0===(null===r||void 0===r||null===(n=r.type)||void 0===n?void 0:n.indexOf("text"))&&r.getAsString(e=>{if(e.trim().toLowerCase().startsWith("http"))G(e.trim());else if("meta"===e.toString().slice(1,5)){const t=e.toString().split('"')[1];t&&G(t)}})}},(0,r.useEffect)(()=>{const e=e=>{let t=null;"background"===(null===U||void 0===U?void 0:U.kind)?(t=ae,q(ae)):"img"===(null===U||void 0===U?void 0:U.kind)&&(q("IMG"),t="IMG"),null!==U&&void 0!==U&&U.currentUrl&&t&&(N(U.currentUrl),V(e))};O===p.lx.UPLOAD_IMAGE_MODAL||O===p.lx.UPLOAD_BACKGROUND_MODAL?e(re):O===p.lx.UPLOAD_IMAGE_MODAL_AI||O===p.lx.UPLOAD_BACKGROUND_MODAL_AI?(ct?(Ve(!0),$e(2)):e(oe),setTimeout(()=>{var e;return null===(e=Le.current)||void 0===e?void 0:e.focus({cursor:"start"})},100)):O===p.lx.UPLOAD_IMAGE_MODAL_UPLOAD||O===p.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD?(e(ie),setTimeout(()=>{var e;return null===(e=Ee.current)||void 0===e?void 0:e.focus({cursor:"start"})},100)):O===p.lx.UPLOAD_IMAGE_MODAL_STOCK||O===p.lx.UPLOAD_BACKGROUND_MODAL_STOCK?(ct?(Ve(!0),$e(3)):e(le),setTimeout(()=>{var e;return null===(e=ke.current)||void 0===e?void 0:e.focus({cursor:"start"})},100)):O===p.lx.UPLOAD_IMAGE_MODAL_GIF||O===p.lx.UPLOAD_BACKGROUND_MODAL_GIF?(ct?(Ve(!0),$e(3)):e(ne),setTimeout(()=>{var e;return null===(e=Ie.current)||void 0===e?void 0:e.focus({cursor:"start"})},100)):O===p.lx.UPLOAD_IMAGE_MODAL_EDIT||O===p.lx.UPLOAD_BACKGROUND_MODAL_EDIT?(ct?(Ve(!0),$e(5)):e(re),b((0,m.Wz)(p.lx.IMAGE_EDITOR_MODAL))):q("")},[O,b,ct,U]);const ht=(0,r.useCallback)(({url:e=x||""})=>{N(e),B({url:e,meta:{mode:"select"}}),setTimeout(()=>{st(),ot(),xe({keywords:"",color:"",orientation:""}),Ne({keywords:""}),Te([]),Fe([]),q(""),He(""),je(!1),P(""),G(""),V(ie)},200),b((0,m.Oo)()),b((0,m.Os)())},[x,st,b,B,ot]),vt=(0,r.useCallback)((e,t)=>(Re("auto"),he(!1),ht({url:e}),L.success({id:"IMAGE_UPLOAD_SUCCESS",data:t,message:v("The image was successfully uploaded.")}),e),[v,ht,L]);(0,r.useEffect)(()=>{const t=F||T,a=(0,$.e)(t);if(!t||!a)return pe(""),et.current="",st(),ot(),void Je.current.invalidateAll();const r=et.current;r&&r!==a&&(Je.current.abandonKey(r),st(),ot()),et.current=a;const i=new AbortController,l=F?800:0,n=++tt.current,o=setTimeout(async()=>{try{const r=async()=>{const e=await Je.current.resolve(a,i.signal,mt);if(n!==tt.current)return;const{width:t,height:r}=await(0,Z.Q)(e);if(n!==tt.current)return;me({width:t,height:r,size:(e.size/1024).toFixed(2),format:ce(e.type)}),st(),at.current&&URL.revokeObjectURL(at.current);const l=URL.createObjectURL(e);at.current=l,it(l)};if(h)await r();else{const t=await(0,Y.q)(e,a);if(null!==t&&void 0!==t&&t.previewUrl&&n===tt.current){nt(t.previewUrl),ot();try{const{data:e}=await I(a);if(n!==tt.current)return;e?me({width:null===e||void 0===e?void 0:e.width,height:null===e||void 0===e?void 0:e.height,size:null!=(null===e||void 0===e?void 0:e.fileSize)?(e.fileSize/1024).toFixed(2):"",format:ce(null===e||void 0===e?void 0:e.format)}):await r()}catch{await r()}}else await r()}if(n!==tt.current)return;pe("success"),N(t),Oe(572),setTimeout(()=>{let e=0;ye.current&&(e=ye.current.offsetHeight+62),Re(e)},0)}catch(r){if("AbortError"===(null===r||void 0===r?void 0:r.name)||i.signal.aborted)return;if(n!==tt.current)return;st(),ot(),pe("error")}},l);return()=>{clearTimeout(o),i.abort()}},[F,T,h,st,mt,I,ot,e]),(0,r.useEffect)(()=>{if(!x)return;if(F||T)return;const t=(0,$.e)(x),a=new AbortController;let r=!1;const i=async()=>{const e=await Je.current.resolve(t,a.signal,mt);if(r)return;const{width:i,height:l}=await(0,Z.Q)(e);if(r)return;st(),at.current&&URL.revokeObjectURL(at.current);const n=URL.createObjectURL(e);at.current=n,it(n),me({width:i,height:l,size:(e.size/1024).toFixed(2),format:ce(e.type)})};return(async()=>{try{if(!h){const a=await(0,Y.q)(e,t);if(null!==a&&void 0!==a&&a.previewUrl&&!r){nt(a.previewUrl),ot();try{const{data:e}=await I(t);if(r)return;return void(e?me({width:null===e||void 0===e?void 0:e.width,height:null===e||void 0===e?void 0:e.height,size:null!=(null===e||void 0===e?void 0:e.fileSize)?(e.fileSize/1024).toFixed(2):"",format:ce(null===e||void 0===e?void 0:e.format)}):await i())}catch{await i()}}}await i()}catch{r||st()}})(),()=>{r=!0,a.abort()}},[h,st,x,mt,I,e,F,T]);(0,r.useEffect)(()=>{var e;""===Be.keywords&&(null===Ee||void 0===Ee||null===(e=Ee.current)||void 0===e||e.focus({cursor:"start"}),Te([]),setTimeout(()=>{Re("auto"),Oe(572)},0))},[Be,Te,Re,Oe]);const yt=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||L.error({id:"IMAGE_UPLOAD_WRONG_FORMAT",data:e,message:"Upload",description:"You can only upload JPG/JPEG/PNG/WEBP/GIF/SVG file!"}),t},bt=async({file:t})=>{try{Ue(!0);let r=t;if("image/svg+xml"===t.type){const e=await(a=t,new Promise(e=>{const t=new FileReader;t.onload=function(t){const r=t.target.result,i=new Blob([r],{type:"image/svg+xml;charset=utf-8"}),l=URL.createObjectURL(i),n=new Image;n.onload=function(){const t=document.createElement("canvas");t.width=2*n.width,t.height=2*n.height,t.getContext("2d").drawImage(n,0,0,t.width,t.height),t.toBlob(t=>{URL.revokeObjectURL(l),e(t?new File([t],a.name.replace(".svg",".png"),{type:"image/png"}):null)},"image/png")},n.onerror=()=>{URL.revokeObjectURL(l),e(null)},n.src=l},t.onerror=()=>e(null),t.readAsText(a)}));e&&(r=e)}else if("image/webp"===t.type){const e=await((e,t=90)=>new Promise(a=>{const r=new Image;r.src=URL.createObjectURL(e),r.onload=()=>{const i=document.createElement("canvas");i.width=r.width,i.height=r.height;const l=i.getContext("2d");l.imageSmoothingEnabled=!0,l.imageSmoothingQuality="high",l.drawImage(r,0,0,i.width,i.height),i.toBlob(t=>{URL.revokeObjectURL(r.src),a(t?new File([t],e.name.replace(/\.webp$/i,".jpg"),{type:"image/jpeg"}):null)},"image/jpeg",t/100)},r.onerror=()=>{URL.revokeObjectURL(r.src),a(null)}}))(t);e&&(r=e)}"image/gif"!==r.type&&(r=await(0,u.A)(r,{maxSizeMB:f.compressMaxSize||.45,maxWidthOrHeight:f.compressMaxWidthOrHeight||2e3,libURL:(0,ee.Zq)("","js/browser-image-compression.js"),useWebWorker:!0}));const i=await dt(r);if(i)return vt(i,r),i;const l=await X(r,e);return null!==l&&void 0!==l&&l.url?(vt(l.url,r),l.url):void ut(r,null)}catch(r){return void ut(t,r)}finally{Ue(!1)}var a},At=e=>bt({file:e});let wt=[{label:v("Upload"),key:ie,children:r.createElement("div",{ref:ve,style:{paddingBottom:24}},!1!==f.imageCenterLocalUploadEnabled&&r.createElement(se,{showUploadList:!1,name:"Image",beforeUpload:yt,customRequest:bt,style:{marginBottom:10},multiple:!1,accept:"image/png, image/jpeg, image/jpg, image/webp, image/gif, image/svg+xml"},r.createElement("p",{className:"ant-upload-drag-icon"},r.createElement(o.Ay,{icon:"InboxOutlined"})),r.createElement("p",{className:"ant-upload-text"},v("Click to select, paste from the clipboard, or drag and drop")),r.createElement("p",{className:"ant-upload-hint"},v("Accepted formats: PNG, JPG, WEBP, SVG or GIF."))),r.createElement(l.lV,{style:{padding:"0 2px 0 2px"}},r.createElement(l.lV.Item,{validateStatus:ge},r.createElement(l.pd,{ref:Ee,allowClear:!0,size:"large",placeholder:v("Paste image URL here"),value:F,onChange:e=>{G(e.target.value)},spellCheck:"false"}))))}];return f.imageCenterStockEnabled&&!ct&&wt.push({label:v("Stock"),key:le,children:r.createElement("div",{ref:be,style:{paddingBottom:24}},r.createElement(M,{currentReq:Be,setCurrentReq:xe,imageStockList:Ge,setImageStockList:Te,setModalWidth:Oe,setModalHeight:Re,setStockLink:P,setCurrentImageLink:N,inputRef:ke,customRequest:gt}))}),f.imageCenterGifEnabled&&!ct&&wt.push({label:v("GIF"),key:ne,children:r.createElement("div",{ref:Ae,style:{paddingBottom:24}},r.createElement(H,{currentReqGif:De,setCurrentReqGif:Ne,imageGifList:Me,setImageGifList:Fe,setModalWidth:Oe,setModalHeight:Re,setStockLink:P,setCurrentImageLink:N,inputRef:Ie,customRequest:gt}))}),f.elementAIimageEnabled&&!ct&&wt.push({label:v("AI"),key:oe,children:r.createElement("div",{ref:we,style:{paddingBottom:24}},r.createElement(W,{setModalHeight:Re,customRequest:bt,aiImageRequest:We,setAiImageRequest:He,imageAiList:Pe,setImageAiList:ze,isLoadingAi:qe,setIsLoadingAi:je,aiTabRef:we,inputAiRef:Le,isImageUploaded:fe,setIsImageUploaded:he}))}),f.imageCenterEditorEnabled&&wt.push({label:"",key:re,children:r.createElement("div",{ref:ye},r.createElement(R,{currentImageLink:x,newLink:F,previewDisplayUrl:lt,resolvedPreviewObjectUrl:rt,imageSize:de,onSave:At,uploadImageResultIsLoading:_e||!1}))}),r.createElement(r.Fragment,null,r.createElement(l.aF,{width:Se,className:"image-center",title:v("Image Center"),style:{minHeight:390},open:!!z,onOk:ht,onCancel:()=>{b((0,m.Oo)()),setTimeout(()=>{st(),ot(),N(""),G(""),Te([]),Te([]),xe({keywords:"",color:"",orientation:""}),Ne({keywords:""}),Re("auto"),!qe&&He(""),Oe(572),V(ie)},200)},footer:j===re?r.createElement(r.Fragment,null):null},r.createElement(l.tK,{spinning:_e},r.createElement(l.tU,{activeKey:j,onChange:e=>{"GALLERY"===e?k.success({maskClosable:!0,centered:!0,title:v("Coming soon"),content:v("The feature is under development."),okText:v("Ok. I'll be waiting"),onOk:()=>{}}):e===re&&""===x?k.warning({maskClosable:!0,centered:!0,title:v(""),content:v("To preview and edit the uploaded image"),okText:v("Upload Image"),onOk:()=>{V(ie)}}):(setTimeout(()=>{let t=0,a=0;var r;if(e===ie&&ve.current)""===Be.keywords&&(null===(r=Ee.current)||void 0===r||r.focus({cursor:"start"})),t=300,a=572;else if(e===re&&ye.current)t=ye.current.offsetHeight+62,a=572;else if(e===le&&be.current){var i;""===Be.keywords&&(null===(i=ke.current)||void 0===i||i.focus({cursor:"start"})),t=130,a=572,Ge.length>0&&(a=1060,t="84vh")}else if(e===ne&&Ae.current){var l;""===Be.keywords&&(null===(l=Ie.current)||void 0===l||l.focus({cursor:"start"})),t=130,a=572,Me.length>0&&(a=1060,t="84vh")}else if(e===oe&&we.current){var n;if(""===We&&0===Pe.length)null===(n=Le.current)||void 0===n||n.focus({cursor:"start"}),t=130;else t=we.current.offsetHeight+82;a=572}Re(t),Oe(a)},0),V(e))},items:wt,className:"modal-tabs",style:{height:Ce,minHeight:130}}))),r.createElement(K.A,{open:Ke,onCancel:()=>Ve(!1),initialSlide:Ze}))}}}]);
|
|
2
|
+
//# sourceMappingURL=8727.11fb3035.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[9688],{79688:(t,e,n)=>{n.r(e),n.d(e,{J:()=>Re});var r,o,i=n(78559),u={},a={},f={};function c(){return r||(r=1,Object.defineProperty(f,"__esModule",{value:!0}),f.default=function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.data=e,this.text=n.text||e,this.options=n}),f}function l(){if(o)return a;o=1,Object.defineProperty(a,"__esModule",{value:!0}),a.CODE39=void 0;var t,e=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),n=function(t){function n(t,e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),t=t.toUpperCase(),e.mod43&&(t+=function(t){return r[t]}(function(t){for(var e=0,n=0;n<t.length;n++)e+=f(t[n]);return e%43}(t))),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,t,e))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(n,t),e(n,[{key:"encode",value:function(){for(var t=u("*"),e=0;e<this.data.length;e++)t+=u(this.data[e])+"0";return{data:t+=u("*"),text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)}}]),n}(((t=c())&&t.__esModule?t:{default:t}).default),r=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","-","."," ","$","/","+","%","*"],i=[20957,29783,23639,30485,20951,29813,23669,20855,29789,23645,29975,23831,30533,22295,30149,24005,21623,29981,23837,22301,30023,23879,30545,22343,30161,24017,21959,30065,23921,22385,29015,18263,29141,17879,29045,18293,17783,29021,18269,17477,17489,17681,20753,35770];function u(t){return function(t){return i[t].toString(2)}(f(t))}function f(t){return r.indexOf(t)}return a.CODE39=n,a}var s,p,d={},h={},y={},b={};function v(){if(s)return b;var t;function e(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}s=1,Object.defineProperty(b,"__esModule",{value:!0});var n=b.SET_A=0,r=b.SET_B=1,o=b.SET_C=2;b.SHIFT=98;var i=b.START_A=103,u=b.START_B=104,a=b.START_C=105;return b.MODULO=103,b.STOP=106,b.FNC1=207,b.SET_BY_CODE=(e(t={},i,n),e(t,u,r),e(t,a,o),t),b.SWAP={101:n,100:r,99:o},b.A_START_CHAR=String.fromCharCode(208),b.B_START_CHAR=String.fromCharCode(209),b.C_START_CHAR=String.fromCharCode(210),b.A_CHARS="[\0-_\xc8-\xcf]",b.B_CHARS="[ -\x7f\xc8-\xcf]",b.C_CHARS="(\xcf*[0-9]{2}\xcf*)",b.BARS=[11011001100,11001101100,11001100110,10010011e3,10010001100,10001001100,10011001e3,10011000100,10001100100,11001001e3,11001000100,11000100100,10110011100,10011011100,10011001110,10111001100,10011101100,10011100110,11001110010,11001011100,11001001110,11011100100,11001110100,11101101110,11101001100,11100101100,11100100110,11101100100,11100110100,11100110010,11011011e3,11011000110,11000110110,10100011e3,10001011e3,10001000110,10110001e3,10001101e3,10001100010,11010001e3,11000101e3,11000100010,10110111e3,10110001110,10001101110,10111011e3,10111000110,10001110110,11101110110,11010001110,11000101110,11011101e3,11011100010,11011101110,11101011e3,11101000110,11100010110,11101101e3,11101100010,11100011010,11101111010,11001000010,11110001010,1010011e4,10100001100,1001011e4,10010000110,10000101100,10000100110,1011001e4,10110000100,1001101e4,10011000010,10000110100,10000110010,11000010010,1100101e4,11110111010,11000010100,10001111010,10100111100,10010111100,10010011110,10111100100,10011110100,10011110010,11110100100,11110010100,11110010010,11011011110,11011110110,11110110110,10101111e3,10100011110,10001011110,10111101e3,10111100010,11110101e3,11110100010,10111011110,10111101110,11101011110,11110101110,11010000100,1101001e4,11010011100,1100011101011],b}function _(){if(p)return y;p=1,Object.defineProperty(y,"__esModule",{value:!0});var t,e=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),n=(t=c())&&t.__esModule?t:{default:t},r=v(),o=function(t){function n(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,t.substring(1),e));return r.bytes=t.split("").map(function(t){return t.charCodeAt(0)}),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(n,t),e(n,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var t=this.bytes,e=t.shift()-105,o=r.SET_BY_CODE[e];if(void 0===o)throw new RangeError("The encoding does not start with a start character.");!0===this.shouldEncodeAsEan128()&&t.unshift(r.FNC1);var i=n.next(t,1,o);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:n.getBar(e)+i.result+n.getBar((i.checksum+e)%r.MODULO)+n.getBar(r.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var t=this.options.ean128||!1;return"string"==typeof t&&(t="true"===t.toLowerCase()),t}}],[{key:"getBar",value:function(t){return r.BARS[t]?r.BARS[t].toString():""}},{key:"correctIndex",value:function(t,e){if(e===r.SET_A){var n=t.shift();return n<32?n+64:n-32}return e===r.SET_B?t.shift()-32:10*(t.shift()-48)+t.shift()-48}},{key:"next",value:function(t,e,o){if(!t.length)return{result:"",checksum:0};var i=void 0,u=void 0;if(t[0]>=200){u=t.shift()-105;var a=r.SWAP[u];void 0!==a?i=n.next(t,e+1,a):(o!==r.SET_A&&o!==r.SET_B||u!==r.SHIFT||(t[0]=o===r.SET_A?t[0]>95?t[0]-96:t[0]:t[0]<32?t[0]+96:t[0]),i=n.next(t,e+1,o))}else u=n.correctIndex(t,o),i=n.next(t,e+1,o);var f=u*e;return{result:n.getBar(u)+i.result,checksum:f+i.checksum}}}]),n}(n.default);return y.default=o,y}var g,O,E={};function w(){if(O)return h;O=1,Object.defineProperty(h,"__esModule",{value:!0});var t=n(_()),e=n(function(){if(g)return E;g=1,Object.defineProperty(E,"__esModule",{value:!0});var t=v(),e=function(e){return e.match(new RegExp("^"+t.A_CHARS+"*"))[0].length},n=function(e){return e.match(new RegExp("^"+t.B_CHARS+"*"))[0].length},r=function(e){return e.match(new RegExp("^"+t.C_CHARS+"*"))[0]};function o(e,n){var r=n?t.A_CHARS:t.B_CHARS,u=e.match(new RegExp("^("+r+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(u)return u[1]+String.fromCharCode(204)+i(e.substring(u[1].length));var a=e.match(new RegExp("^"+r+"+"))[0];return a.length===e.length?e:a+String.fromCharCode(n?205:206)+o(e.substring(a.length),!n)}function i(t){var i=r(t),u=i.length;if(u===t.length)return t;t=t.substring(u);var a=e(t)>=n(t);return i+String.fromCharCode(a?206:205)+o(t,a)}return E.default=function(u){var a=void 0;if(r(u).length>=2)a=t.C_START_CHAR+i(u);else{var f=e(u)>n(u);a=(f?t.A_START_CHAR:t.B_START_CHAR)+o(u,f)}return a.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(t,e){return String.fromCharCode(203)+e})},E}());function n(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var o=function(t){function n(t,o){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),/^[\x00-\x7F\xC8-\xD3]+$/.test(t))var i=r(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,(0,e.default)(t),o));else i=r(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,t,o));return r(i)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(n,t),n}(t.default);return h.default=o,h}var m,j={};var P,x={};var S,C,A={};var T,M={},R={},k={};function L(){return T||(T=1,Object.defineProperty(k,"__esModule",{value:!0}),k.SIDE_BIN="101",k.MIDDLE_BIN="01010",k.BINARIES={L:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],G:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],R:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"],O:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],E:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"]},k.EAN2_STRUCTURE=["LL","LG","GL","GG"],k.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],k.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"]),k}var I,G,B,D={},N={};function $(){if(I)return N;I=1,Object.defineProperty(N,"__esModule",{value:!0});var t=L();return N.default=function(e,n,r){var o=e.split("").map(function(e,r){return t.BINARIES[n[r]]}).map(function(t,n){return t?t[e[n]]:""});if(r){var i=e.length-1;o=o.map(function(t,e){return e<i?t+r:t})}return o.join("")},N}function X(){if(G)return D;G=1,Object.defineProperty(D,"__esModule",{value:!0});var t=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),e=L(),n=r($());function r(t){return t&&t.__esModule?t:{default:t}}var o=function(r){function o(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,t,e));return n.fontSize=!e.flat&&e.fontSize>10*e.width?10*e.width:e.fontSize,n.guardHeight=e.height+n.fontSize/2+e.textMargin,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(o,r),t(o,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(t,e){return this.text.substr(t,e)}},{key:"leftEncode",value:function(t,e){return(0,n.default)(t,e)}},{key:"rightText",value:function(t,e){return this.text.substr(t,e)}},{key:"rightEncode",value:function(t,e){return(0,n.default)(t,e)}},{key:"encodeGuarded",value:function(){var t={fontSize:this.fontSize},n={height:this.guardHeight};return[{data:e.SIDE_BIN,options:n},{data:this.leftEncode(),text:this.leftText(),options:t},{data:e.MIDDLE_BIN,options:n},{data:this.rightEncode(),text:this.rightText(),options:t},{data:e.SIDE_BIN,options:n}]}},{key:"encodeFlat",value:function(){return{data:[e.SIDE_BIN,this.leftEncode(),e.MIDDLE_BIN,this.rightEncode(),e.SIDE_BIN].join(""),text:this.text}}}]),o}(r(c()).default);return D.default=o,D}var H,z={};var V,U={};function F(){if(V)return U;V=1,Object.defineProperty(U,"__esModule",{value:!0});var t=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),e=L(),n=r($());function r(t){return t&&t.__esModule?t:{default:t}}var o=function(r){function o(t,e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,t,e))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(o,r),t(o,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{5}$/)}},{key:"encode",value:function(){var t,r=e.EAN5_STRUCTURE[t=this.data,t.split("").map(function(t){return+t}).reduce(function(t,e,n){return n%2?t+9*e:t+3*e},0)%10];return{data:"1011"+(0,n.default)(this.data,r,"01"),text:this.text}}}]),o}(r(c()).default);return U.default=o,U}var W,Y={};function J(){if(W)return Y;W=1,Object.defineProperty(Y,"__esModule",{value:!0});var t=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),e=L(),n=r($());function r(t){return t&&t.__esModule?t:{default:t}}var o=function(r){function o(t,e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,t,e))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(o,r),t(o,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{2}$/)}},{key:"encode",value:function(){var t=e.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,n.default)(this.data,t,"01"),text:this.text}}}]),o}(r(c()).default);return Y.default=o,Y}var Q,Z={};function K(){if(Q)return Z;Q=1,Object.defineProperty(Z,"__esModule",{value:!0});var t=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();Z.checksum=o;var e=n($());function n(t){return t&&t.__esModule?t:{default:t}}var r=function(n){function r(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),-1!==t.search(/^[0-9]{11}$/)&&(t+=o(t));var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,t,e));return n.displayValue=e.displayValue,e.fontSize>10*e.width?n.fontSize=10*e.width:n.fontSize=e.fontSize,n.guardHeight=e.height+n.fontSize/2+e.textMargin,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,n),t(r,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{12}$/)&&this.data[11]==o(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var t="";return t+="101",t+=(0,e.default)(this.data.substr(0,6),"LLLLLL"),t+="01010",t+=(0,e.default)(this.data.substr(6,6),"RRRRRR"),{data:t+="101",text:this.text}}},{key:"guardedEncoding",value:function(){var t=[];return this.displayValue&&t.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),t.push({data:"101"+(0,e.default)(this.data[0],"L"),options:{height:this.guardHeight}}),t.push({data:(0,e.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),t.push({data:"01010",options:{height:this.guardHeight}}),t.push({data:(0,e.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),t.push({data:(0,e.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&t.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),t}}]),r}(n(c()).default);function o(t){var e,n=0;for(e=1;e<11;e+=2)n+=parseInt(t[e]);for(e=0;e<11;e+=2)n+=3*parseInt(t[e]);return(10-n%10)%10}return Z.default=r,Z}var q,tt,et={};function nt(){if(q)return et;q=1,Object.defineProperty(et,"__esModule",{value:!0});var t=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),e=o($()),n=o(c()),r=K();function o(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var u=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],a=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],f=function(n){function r(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r);var n=i(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,t,e));if(n.isValid=!1,-1!==t.search(/^[0-9]{6}$/))n.middleDigits=t,n.upcA=l(t,"0"),n.text=e.text||""+n.upcA[0]+t+n.upcA[n.upcA.length-1],n.isValid=!0;else{if(-1===t.search(/^[01][0-9]{7}$/))return i(n);if(n.middleDigits=t.substring(1,t.length-1),n.upcA=l(n.middleDigits,t[0]),n.upcA[n.upcA.length-1]!==t[t.length-1])return i(n);n.isValid=!0}return n.displayValue=e.displayValue,e.fontSize>10*e.width?n.fontSize=10*e.width:n.fontSize=e.fontSize,n.guardHeight=e.height+n.fontSize/2+e.textMargin,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,n),t(r,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var t="";return t+="101",t+=this.encodeMiddleDigits(),{data:t+="010101",text:this.text}}},{key:"guardedEncoding",value:function(){var t=[];return this.displayValue&&t.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),t.push({data:"101",options:{height:this.guardHeight}}),t.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),t.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&t.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),t}},{key:"encodeMiddleDigits",value:function(){var t=this.upcA[0],n=this.upcA[this.upcA.length-1],r=a[parseInt(n)][parseInt(t)];return(0,e.default)(this.middleDigits,r)}}]),r}(n.default);function l(t,e){for(var n=parseInt(t[t.length-1]),o=u[n],i="",a=0,f=0;f<o.length;f++){var c=o[f];i+="X"===c?t[a++]:c}return(i=""+e+i)+(0,r.checksum)(i)}return et.default=f,et}var rt,ot,it={},ut={},at={};function ft(){if(ot)return ut;ot=1,Object.defineProperty(ut,"__esModule",{value:!0});var t,e=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),n=(rt||(rt=1,Object.defineProperty(at,"__esModule",{value:!0}),at.START_BIN="1010",at.END_BIN="11101",at.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"]),at),r=function(t){function r(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,t),e(r,[{key:"valid",value:function(){return-1!==this.data.search(/^([0-9]{2})+$/)}},{key:"encode",value:function(){var t=this,e=this.data.match(/.{2}/g).map(function(e){return t.encodePair(e)}).join("");return{data:n.START_BIN+e+n.END_BIN,text:this.text}}},{key:"encodePair",value:function(t){var e=n.BINARIES[t[1]];return n.BINARIES[t[0]].split("").map(function(t,n){return("1"===t?"111":"1")+("1"===e[n]?"000":"0")}).join("")}}]),r}(((t=c())&&t.__esModule?t:{default:t}).default);return ut.default=r,ut}var ct,lt,st={};var pt,dt={},ht={};function yt(){if(pt)return ht;pt=1,Object.defineProperty(ht,"__esModule",{value:!0});var t,e=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),n=function(t){function n(t,e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,t,e))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(n,t),e(n,[{key:"encode",value:function(){for(var t="110",e=0;e<this.data.length;e++){var n=parseInt(this.data[e]).toString(2);n=r(n,4-n.length);for(var o=0;o<n.length;o++)t+="0"==n[o]?"100":"110"}return{data:t+="1001",text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]+$/)}}]),n}(((t=c())&&t.__esModule?t:{default:t}).default);function r(t,e){for(var n=0;n<e;n++)t="0"+t;return t}return ht.default=n,ht}var bt,vt,_t={},gt={};function Ot(){return bt||(bt=1,Object.defineProperty(gt,"__esModule",{value:!0}),gt.mod10=function(t){for(var e=0,n=0;n<t.length;n++){var r=parseInt(t[n]);(n+t.length)%2==0?e+=r:e+=2*r%10+Math.floor(2*r/10)}return(10-e%10)%10},gt.mod11=function(t){for(var e=0,n=[2,3,4,5,6,7],r=0;r<t.length;r++){var o=parseInt(t[t.length-1-r]);e+=n[r%n.length]*o}return(11-e%11)%11}),gt}var Et,wt={};var mt,jt={};var Pt,xt,St={};var Ct,At={};function Tt(){if(Ct)return At;Ct=1,Object.defineProperty(At,"__esModule",{value:!0}),At.pharmacode=void 0;var t,e=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),n=function(t){function n(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,t,e));return r.number=parseInt(t,10),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(n,t),e(n,[{key:"encode",value:function(){for(var t=this.number,e="";!isNaN(t)&&0!=t;)t%2==0?(e="11100"+e,t=(t-2)/2):(e="100"+e,t=(t-1)/2);return{data:e=e.slice(0,-2),text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),n}(((t=c())&&t.__esModule?t:{default:t}).default);return At.pharmacode=n,At}var Mt,Rt={};function kt(){if(Mt)return Rt;Mt=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.codabar=void 0;var t,e=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),n=function(t){function n(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),0===t.search(/^[0-9\-\$\:\.\+\/]+$/)&&(t="A"+t+"A");var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,t.toUpperCase(),e));return r.text=r.options.text||r.text.replace(/[A-D]/g,""),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(n,t),e(n,[{key:"valid",value:function(){return-1!==this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)}},{key:"encode",value:function(){for(var t=[],e=this.getEncodings(),n=0;n<this.data.length;n++)t.push(e[this.data.charAt(n)]),n!==this.data.length-1&&t.push("0");return{text:this.text,data:t.join("")}}},{key:"getEncodings",value:function(){return{0:"101010011",1:"101011001",2:"101001011",3:"110010101",4:"101101001",5:"110101001",6:"100101011",7:"100101101",8:"100110101",9:"110100101","-":"101001101",$:"101100101",":":"1101011011","/":"1101101011",".":"1101101101","+":"1011011011",A:"1011001001",B:"1001001011",C:"1010010011",D:"1010011001"}}}]),n}(((t=c())&&t.__esModule?t:{default:t}).default);return Rt.codabar=n,Rt}var Lt,It,Gt={},Bt={},Dt={};function Nt(){if(It)return Bt;It=1,Object.defineProperty(Bt,"__esModule",{value:!0});var t,e=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),n=(Lt||(Lt=1,Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.SYMBOLS=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","-","."," ","$","/","+","%","($)","(%)","(/)","(+)","\xff"],Dt.BINARIES=["100010100","101001000","101000100","101000010","100101000","100100100","100100010","101010000","100010010","100001010","110101000","110100100","110100010","110010100","110010010","110001010","101101000","101100100","101100010","100110100","100011010","101011000","101001100","101000110","100101100","100010110","110110100","110110010","110101100","110100110","110010110","110011010","101101100","101100110","100110110","100111010","100101110","111010100","111010010","111001010","101101110","101110110","110101110","100100110","111011010","111010110","100110010","101011110"],Dt.MULTI_SYMBOLS={"\0":["(%)","U"],"\x01":["($)","A"],"\x02":["($)","B"],"\x03":["($)","C"],"\x04":["($)","D"],"\x05":["($)","E"],"\x06":["($)","F"],"\x07":["($)","G"],"\b":["($)","H"],"\t":["($)","I"],"\n":["($)","J"],"\v":["($)","K"],"\f":["($)","L"],"\r":["($)","M"],"\x0e":["($)","N"],"\x0f":["($)","O"],"\x10":["($)","P"],"\x11":["($)","Q"],"\x12":["($)","R"],"\x13":["($)","S"],"\x14":["($)","T"],"\x15":["($)","U"],"\x16":["($)","V"],"\x17":["($)","W"],"\x18":["($)","X"],"\x19":["($)","Y"],"\x1a":["($)","Z"],"\x1b":["(%)","A"],"\x1c":["(%)","B"],"\x1d":["(%)","C"],"\x1e":["(%)","D"],"\x1f":["(%)","E"],"!":["(/)","A"],'"':["(/)","B"],"#":["(/)","C"],"&":["(/)","F"],"'":["(/)","G"],"(":["(/)","H"],")":["(/)","I"],"*":["(/)","J"],",":["(/)","L"],":":["(/)","Z"],";":["(%)","F"],"<":["(%)","G"],"=":["(%)","H"],">":["(%)","I"],"?":["(%)","J"],"@":["(%)","V"],"[":["(%)","K"],"\\":["(%)","L"],"]":["(%)","M"],"^":["(%)","N"],_:["(%)","O"],"`":["(%)","W"],a:["(+)","A"],b:["(+)","B"],c:["(+)","C"],d:["(+)","D"],e:["(+)","E"],f:["(+)","F"],g:["(+)","G"],h:["(+)","H"],i:["(+)","I"],j:["(+)","J"],k:["(+)","K"],l:["(+)","L"],m:["(+)","M"],n:["(+)","N"],o:["(+)","O"],p:["(+)","P"],q:["(+)","Q"],r:["(+)","R"],s:["(+)","S"],t:["(+)","T"],u:["(+)","U"],v:["(+)","V"],w:["(+)","W"],x:["(+)","X"],y:["(+)","Y"],z:["(+)","Z"],"{":["(%)","P"],"|":["(%)","Q"],"}":["(%)","R"],"~":["(%)","S"],"\x7f":["(%)","T"]}),Dt),r=function(t){function r(t,e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,t,e))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,t),e(r,[{key:"valid",value:function(){return/^[0-9A-Z\-. $/+%]+$/.test(this.data)}},{key:"encode",value:function(){var t=this.data.split("").flatMap(function(t){return n.MULTI_SYMBOLS[t]||t}),e=t.map(function(t){return r.getEncoding(t)}).join(""),o=r.checksum(t,20),i=r.checksum(t.concat(o),15);return{text:this.text,data:r.getEncoding("\xff")+e+r.getEncoding(o)+r.getEncoding(i)+r.getEncoding("\xff")+"1"}}}],[{key:"getEncoding",value:function(t){return n.BINARIES[r.symbolValue(t)]}},{key:"getSymbol",value:function(t){return n.SYMBOLS[t]}},{key:"symbolValue",value:function(t){return n.SYMBOLS.indexOf(t)}},{key:"checksum",value:function(t,e){var n=t.slice().reverse().reduce(function(t,n,o){var i=o%e+1;return t+r.symbolValue(n)*i},0);return r.getSymbol(n%47)}}]),r}(((t=c())&&t.__esModule?t:{default:t}).default);return Bt.default=r,Bt}var $t,Xt,Ht={};var zt,Vt,Ut={};function Ft(){if(zt)return Ut;zt=1,Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.GenericBarcode=void 0;var t,e=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),n=function(t){function n(t,e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,t,e))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(n,t),e(n,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),n}(((t=c())&&t.__esModule?t:{default:t}).default);return Ut.GenericBarcode=n,Ut}function Wt(){if(Vt)return u;Vt=1,Object.defineProperty(u,"__esModule",{value:!0});var t=l(),e=function(){if(C)return d;C=1,Object.defineProperty(d,"__esModule",{value:!0}),d.CODE128C=d.CODE128B=d.CODE128A=d.CODE128=void 0;var t=o(w()),e=o(function(){if(m)return j;m=1,Object.defineProperty(j,"__esModule",{value:!0});var t,e=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),n=(t=_())&&t.__esModule?t:{default:t},r=v(),o=function(t){function n(t,e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,r.A_START_CHAR+t,e))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(n,t),e(n,[{key:"valid",value:function(){return new RegExp("^"+r.A_CHARS+"+$").test(this.data)}}]),n}(n.default);return j.default=o,j}()),n=o(function(){if(P)return x;P=1,Object.defineProperty(x,"__esModule",{value:!0});var t,e=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),n=(t=_())&&t.__esModule?t:{default:t},r=v(),o=function(t){function n(t,e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,r.B_START_CHAR+t,e))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(n,t),e(n,[{key:"valid",value:function(){return new RegExp("^"+r.B_CHARS+"+$").test(this.data)}}]),n}(n.default);return x.default=o,x}()),r=o(function(){if(S)return A;S=1,Object.defineProperty(A,"__esModule",{value:!0});var t,e=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),n=(t=_())&&t.__esModule?t:{default:t},r=v(),o=function(t){function n(t,e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,r.C_START_CHAR+t,e))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(n,t),e(n,[{key:"valid",value:function(){return new RegExp("^"+r.C_CHARS+"+$").test(this.data)}}]),n}(n.default);return A.default=o,A}());function o(t){return t&&t.__esModule?t:{default:t}}return d.CODE128=t.default,d.CODE128A=e.default,d.CODE128B=n.default,d.CODE128C=r.default,d}(),n=function(){if(tt)return M;tt=1,Object.defineProperty(M,"__esModule",{value:!0}),M.UPCE=M.UPC=M.EAN2=M.EAN5=M.EAN8=M.EAN13=void 0;var t=u(function(){if(B)return R;B=1,Object.defineProperty(R,"__esModule",{value:!0});var t,e=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),n=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var u=o.get;return void 0!==u?u.call(r):void 0},r=L(),o=(t=X())&&t.__esModule?t:{default:t},i=function(t){return(10-t.substr(0,12).split("").map(function(t){return+t}).reduce(function(t,e,n){return n%2?t+3*e:t+e},0)%10)%10},u=function(t){function o(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),-1!==t.search(/^[0-9]{12}$/)&&(t+=i(t));var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,t,e));return n.lastChar=e.lastChar,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(o,t),e(o,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{13}$/)&&+this.data[12]===i(this.data)}},{key:"leftText",value:function(){return n(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var t=this.data.substr(1,6),e=r.EAN13_STRUCTURE[this.data[0]];return n(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"leftEncode",this).call(this,t,e)}},{key:"rightText",value:function(){return n(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var t=this.data.substr(7,6);return n(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"rightEncode",this).call(this,t,"RRRRRR")}},{key:"encodeGuarded",value:function(){var t=n(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(t.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(t.push({data:"00"}),t.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),t}}]),o}(o.default);return R.default=u,R}()),e=u(function(){if(H)return z;H=1,Object.defineProperty(z,"__esModule",{value:!0});var t,e=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),n=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var u=o.get;return void 0!==u?u.call(r):void 0},r=(t=X())&&t.__esModule?t:{default:t},o=function(t){return(10-t.substr(0,7).split("").map(function(t){return+t}).reduce(function(t,e,n){return n%2?t+e:t+3*e},0)%10)%10},i=function(t){function r(t,e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),-1!==t.search(/^[0-9]{7}$/)&&(t+=o(t)),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,t,e))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,t),e(r,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{8}$/)&&+this.data[7]===o(this.data)}},{key:"leftText",value:function(){return n(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var t=this.data.substr(0,4);return n(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"leftEncode",this).call(this,t,"LLLL")}},{key:"rightText",value:function(){return n(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var t=this.data.substr(4,4);return n(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"rightEncode",this).call(this,t,"RRRR")}}]),r}(r.default);return z.default=i,z}()),n=u(F()),r=u(J()),o=u(K()),i=u(nt());function u(t){return t&&t.__esModule?t:{default:t}}return M.EAN13=t.default,M.EAN8=e.default,M.EAN5=n.default,M.EAN2=r.default,M.UPC=o.default,M.UPCE=i.default,M}(),r=function(){if(lt)return it;lt=1,Object.defineProperty(it,"__esModule",{value:!0}),it.ITF14=it.ITF=void 0;var t=n(ft()),e=n(function(){if(ct)return st;ct=1,Object.defineProperty(st,"__esModule",{value:!0});var t,e=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),n=(t=ft())&&t.__esModule?t:{default:t},r=function(t){var e=t.substr(0,13).split("").map(function(t){return parseInt(t,10)}).reduce(function(t,e,n){return t+e*(3-n%2*2)},0);return 10*Math.ceil(e/10)-e},o=function(t){function n(t,e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),-1!==t.search(/^[0-9]{13}$/)&&(t+=r(t)),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,t,e))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(n,t),e(n,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{14}$/)&&+this.data[13]===r(this.data)}}]),n}(n.default);return st.default=o,st}());function n(t){return t&&t.__esModule?t:{default:t}}return it.ITF=t.default,it.ITF14=e.default,it}(),o=function(){if(xt)return dt;xt=1,Object.defineProperty(dt,"__esModule",{value:!0}),dt.MSI1110=dt.MSI1010=dt.MSI11=dt.MSI10=dt.MSI=void 0;var t=i(yt()),e=i(function(){if(vt)return _t;vt=1,Object.defineProperty(_t,"__esModule",{value:!0});var t,e=(t=yt())&&t.__esModule?t:{default:t},n=Ot(),r=function(t){function e(t,r){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t+(0,n.mod10)(t),r))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e}(e.default);return _t.default=r,_t}()),n=i(function(){if(Et)return wt;Et=1,Object.defineProperty(wt,"__esModule",{value:!0});var t,e=(t=yt())&&t.__esModule?t:{default:t},n=Ot(),r=function(t){function e(t,r){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t+(0,n.mod11)(t),r))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e}(e.default);return wt.default=r,wt}()),r=i(function(){if(mt)return jt;mt=1,Object.defineProperty(jt,"__esModule",{value:!0});var t,e=(t=yt())&&t.__esModule?t:{default:t},n=Ot(),r=function(t){function e(t,r){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t+=(0,n.mod10)(t),t+=(0,n.mod10)(t),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e}(e.default);return jt.default=r,jt}()),o=i(function(){if(Pt)return St;Pt=1,Object.defineProperty(St,"__esModule",{value:!0});var t,e=(t=yt())&&t.__esModule?t:{default:t},n=Ot(),r=function(t){function e(t,r){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t+=(0,n.mod11)(t),t+=(0,n.mod10)(t),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e}(e.default);return St.default=r,St}());function i(t){return t&&t.__esModule?t:{default:t}}return dt.MSI=t.default,dt.MSI10=e.default,dt.MSI11=n.default,dt.MSI1010=r.default,dt.MSI1110=o.default,dt}(),i=Tt(),a=kt(),f=function(){if(Xt)return Gt;Xt=1,Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.CODE93FullASCII=Gt.CODE93=void 0;var t=n(Nt()),e=n(function(){if($t)return Ht;$t=1,Object.defineProperty(Ht,"__esModule",{value:!0});var t,e=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),n=function(t){function n(t,e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,t,e))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(n,t),e(n,[{key:"valid",value:function(){return/^[\x00-\x7f]+$/.test(this.data)}}]),n}(((t=Nt())&&t.__esModule?t:{default:t}).default);return Ht.default=n,Ht}());function n(t){return t&&t.__esModule?t:{default:t}}return Gt.CODE93=t.default,Gt.CODE93FullASCII=e.default,Gt}(),c=Ft();return u.default={CODE39:t.CODE39,CODE128:e.CODE128,CODE128A:e.CODE128A,CODE128B:e.CODE128B,CODE128C:e.CODE128C,EAN13:n.EAN13,EAN8:n.EAN8,EAN5:n.EAN5,EAN2:n.EAN2,UPC:n.UPC,UPCE:n.UPCE,ITF14:r.ITF14,ITF:r.ITF,MSI:o.MSI,MSI10:o.MSI10,MSI11:o.MSI11,MSI1010:o.MSI1010,MSI1110:o.MSI1110,pharmacode:i.pharmacode,codabar:a.codabar,CODE93:f.CODE93,CODE93FullASCII:f.CODE93FullASCII,GenericBarcode:c.GenericBarcode},u}var Yt,Jt={};function Qt(){if(Yt)return Jt;Yt=1,Object.defineProperty(Jt,"__esModule",{value:!0});var t=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};return Jt.default=function(e,n){return t({},e,n)},Jt}var Zt,Kt,qt,te={},ee={},ne={},re={},oe={};function ie(){return qt||(qt=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.default=function(t){var e=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var n in e)e.hasOwnProperty(n)&&"string"==typeof t[n=e[n]]&&(t[n]=parseInt(t[n],10));return"string"==typeof t.displayValue&&(t.displayValue="false"!=t.displayValue),t}),oe}var ue,ae,fe={};function ce(){if(ue)return fe;ue=1,Object.defineProperty(fe,"__esModule",{value:!0});return fe.default={width:2,height:100,format:"auto",displayValue:!0,fontOptions:"",font:"monospace",text:void 0,textAlign:"center",textPosition:"bottom",textMargin:2,fontSize:20,background:"#ffffff",lineColor:"#000000",margin:10,marginTop:void 0,marginBottom:void 0,marginLeft:void 0,marginRight:void 0,valid:function(){}},fe}var le,se,pe={},de={},he={};function ye(){if(le)return he;le=1,Object.defineProperty(he,"__esModule",{value:!0}),he.getTotalWidthOfEncodings=he.calculateEncodingAttributes=he.getBarcodePadding=he.getEncodingHeight=he.getMaximumHeightOfEncodings=void 0;var t,e=(t=Qt())&&t.__esModule?t:{default:t};function n(t,e){return e.height+(e.displayValue&&t.text.length>0?e.fontSize+e.textMargin:0)+e.marginTop+e.marginBottom}function r(t,e,n){if(n.displayValue&&e<t){if("center"==n.textAlign)return Math.floor((t-e)/2);if("left"==n.textAlign)return 0;if("right"==n.textAlign)return Math.floor(t-e)}return 0}function o(t,e,n){var r;if(n)r=n;else{if("undefined"==typeof document)return 0;r=document.createElement("canvas").getContext("2d")}r.font=e.fontOptions+" "+e.fontSize+"px "+e.font;var o=r.measureText(t);return o?o.width:0}return he.getMaximumHeightOfEncodings=function(t){for(var e=0,n=0;n<t.length;n++)t[n].height>e&&(e=t[n].height);return e},he.getEncodingHeight=n,he.getBarcodePadding=r,he.calculateEncodingAttributes=function(t,i,u){for(var a=0;a<t.length;a++){var f,c=t[a],l=(0,e.default)(i,c.options);f=l.displayValue?o(c.text,l,u):0;var s=c.data.length*l.width;c.width=Math.ceil(Math.max(f,s)),c.height=n(c,l),c.barcodePadding=r(f,s,l)}},he.getTotalWidthOfEncodings=function(t){for(var e=0,n=0;n<t.length;n++)e+=t[n].width;return e},he}var be,ve={};var _e,ge,Oe={};var Ee,we,me={};function je(){if(Ee)return me;function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function n(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Ee=1,Object.defineProperty(me,"__esModule",{value:!0});var r=function(){function r(n,o){t(this,r);var i=e(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));return i.name="InvalidInputException",i.symbology=n,i.input=o,i.message='"'+i.input+'" is not a valid input for '+i.symbology,i}return n(r,Error),r}(),o=function(){function r(){t(this,r);var n=e(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));return n.name="InvalidElementException",n.message="Not supported type to render on",n}return n(r,Error),r}(),i=function(){function r(){t(this,r);var n=e(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));return n.name="NoElementException",n.message="No element to render on.",n}return n(r,Error),r}();return me.InvalidInputException=r,me.InvalidElementException=o,me.NoElementException=i,me}function Pe(){if(we)return ne;we=1,Object.defineProperty(ne,"__esModule",{value:!0});var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e=function(){if(ae)return re;ae=1,Object.defineProperty(re,"__esModule",{value:!0});var t=n(ie()),e=n(ce());function n(t){return t&&t.__esModule?t:{default:t}}return re.default=function(n){var r={};for(var o in e.default)e.default.hasOwnProperty(o)&&(n.hasAttribute("jsbarcode-"+o.toLowerCase())&&(r[o]=n.getAttribute("jsbarcode-"+o.toLowerCase())),n.hasAttribute("data-"+o.toLowerCase())&&(r[o]=n.getAttribute("data-"+o.toLowerCase())));return r.value=n.getAttribute("jsbarcode-value")||n.getAttribute("data-value"),(0,t.default)(r)},re}(),n=u(e),r=function(){if(ge)return pe;ge=1,Object.defineProperty(pe,"__esModule",{value:!0});var t=r(function(){if(se)return de;se=1,Object.defineProperty(de,"__esModule",{value:!0});var t,e=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),n=(t=Qt())&&t.__esModule?t:{default:t},r=ye(),o=function(){function t(e,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.canvas=e,this.encodings=n,this.options=r}return e(t,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var t=0;t<this.encodings.length;t++){var e=(0,n.default)(this.options,this.encodings[t].options);this.drawCanvasBarcode(e,this.encodings[t]),this.drawCanvasText(e,this.encodings[t]),this.moveCanvasDrawing(this.encodings[t])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var t=this.canvas.getContext("2d");t.save(),(0,r.calculateEncodingAttributes)(this.encodings,this.options,t);var e=(0,r.getTotalWidthOfEncodings)(this.encodings),n=(0,r.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=e+this.options.marginLeft+this.options.marginRight,this.canvas.height=n,t.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(t.fillStyle=this.options.background,t.fillRect(0,0,this.canvas.width,this.canvas.height)),t.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(t,e){var n,r=this.canvas.getContext("2d"),o=e.data;n="top"==t.textPosition?t.marginTop+t.fontSize+t.textMargin:t.marginTop,r.fillStyle=t.lineColor;for(var i=0;i<o.length;i++){var u=i*t.width+e.barcodePadding;"1"===o[i]?r.fillRect(u,n,t.width,t.height):o[i]&&r.fillRect(u,n,t.width,t.height*o[i])}}},{key:"drawCanvasText",value:function(t,e){var n,r,o=this.canvas.getContext("2d"),i=t.fontOptions+" "+t.fontSize+"px "+t.font;t.displayValue&&(r="top"==t.textPosition?t.marginTop+t.fontSize-t.textMargin:t.height+t.textMargin+t.marginTop+t.fontSize,o.font=i,"left"==t.textAlign||e.barcodePadding>0?(n=0,o.textAlign="left"):"right"==t.textAlign?(n=e.width-1,o.textAlign="right"):(n=e.width/2,o.textAlign="center"),o.fillText(e.text,n,r))}},{key:"moveCanvasDrawing",value:function(t){this.canvas.getContext("2d").translate(t.width,0)}},{key:"restoreCanvas",value:function(){this.canvas.getContext("2d").restore()}}]),t}();return de.default=o,de}()),e=r(function(){if(be)return ve;be=1,Object.defineProperty(ve,"__esModule",{value:!0});var t,e=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),n=(t=Qt())&&t.__esModule?t:{default:t},r=ye(),o="http://www.w3.org/2000/svg",i=function(){function t(e,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.svg=e,this.encodings=n,this.options=r,this.document=r.xmlDocument||document}return e(t,[{key:"render",value:function(){var t=this.options.marginLeft;this.prepareSVG();for(var e=0;e<this.encodings.length;e++){var r=this.encodings[e],o=(0,n.default)(this.options,r.options),i=this.createGroup(t,o.marginTop,this.svg);this.setGroupOptions(i,o),this.drawSvgBarcode(i,o,r),this.drawSVGText(i,o,r),t+=r.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,r.calculateEncodingAttributes)(this.encodings,this.options);var t=(0,r.getTotalWidthOfEncodings)(this.encodings),e=(0,r.getMaximumHeightOfEncodings)(this.encodings),n=t+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(n,e),this.options.background&&this.drawRect(0,0,n,e,this.svg).setAttribute("fill",this.options.background)}},{key:"drawSvgBarcode",value:function(t,e,n){var r,o=n.data;r="top"==e.textPosition?e.fontSize+e.textMargin:0;for(var i=0,u=0,a=0;a<o.length;a++)u=a*e.width+n.barcodePadding,"1"===o[a]?i++:i>0&&(this.drawRect(u-e.width*i,r,e.width*i,e.height,t),i=0);i>0&&this.drawRect(u-e.width*(i-1),r,e.width*i,e.height,t)}},{key:"drawSVGText",value:function(t,e,n){var r,i,u=this.document.createElementNS(o,"text");e.displayValue&&(u.setAttribute("font-family",e.font),u.setAttribute("font-size",e.fontSize),e.fontOptions.includes("bold")&&u.setAttribute("font-weight","bold"),e.fontOptions.includes("italic")&&u.setAttribute("font-style","italic"),i="top"==e.textPosition?e.fontSize-e.textMargin:e.height+e.textMargin+e.fontSize,"left"==e.textAlign||n.barcodePadding>0?(r=0,u.setAttribute("text-anchor","start")):"right"==e.textAlign?(r=n.width-1,u.setAttribute("text-anchor","end")):(r=n.width/2,u.setAttribute("text-anchor","middle")),u.setAttribute("x",r),u.setAttribute("y",i),u.appendChild(this.document.createTextNode(n.text)),t.appendChild(u))}},{key:"setSvgAttributes",value:function(t,e){var n=this.svg;n.setAttribute("width",t+"px"),n.setAttribute("height",e+"px"),n.setAttribute("x","0px"),n.setAttribute("y","0px"),n.setAttribute("viewBox","0 0 "+t+" "+e),n.setAttribute("xmlns",o),n.setAttribute("version","1.1")}},{key:"createGroup",value:function(t,e,n){var r=this.document.createElementNS(o,"g");return r.setAttribute("transform","translate("+t+", "+e+")"),n.appendChild(r),r}},{key:"setGroupOptions",value:function(t,e){t.setAttribute("fill",e.lineColor)}},{key:"drawRect",value:function(t,e,n,r,i){var u=this.document.createElementNS(o,"rect");return u.setAttribute("x",t),u.setAttribute("y",e),u.setAttribute("width",n),u.setAttribute("height",r),i.appendChild(u),u}}]),t}();return ve.default=i,ve}()),n=r(function(){if(_e)return Oe;_e=1,Object.defineProperty(Oe,"__esModule",{value:!0});var t=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),e=function(){function e(t,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.object=t,this.encodings=n,this.options=r}return t(e,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),e}();return Oe.default=e,Oe}());function r(t){return t&&t.__esModule?t:{default:t}}return pe.default={CanvasRenderer:t.default,SVGRenderer:e.default,ObjectRenderer:n.default},pe}(),o=u(r),i=je();function u(t){return t&&t.__esModule?t:{default:t}}return ne.default=function e(r){if("string"==typeof r)return function(t){var n=document.querySelectorAll(t);if(0!==n.length){for(var r=[],o=0;o<n.length;o++)r.push(e(n[o]));return r}}(r);if(Array.isArray(r)){for(var u=[],a=0;a<r.length;a++)u.push(e(r[a]));return u}if("undefined"!=typeof HTMLCanvasElement&&r instanceof HTMLImageElement)return function(t){var e=document.createElement("canvas");return{element:e,options:(0,n.default)(t),renderer:o.default.CanvasRenderer,afterRender:function(){t.setAttribute("src",e.toDataURL())}}}(r);if(r&&r.nodeName&&"svg"===r.nodeName.toLowerCase()||"undefined"!=typeof SVGElement&&r instanceof SVGElement)return{element:r,options:(0,n.default)(r),renderer:o.default.SVGRenderer};if("undefined"!=typeof HTMLCanvasElement&&r instanceof HTMLCanvasElement)return{element:r,options:(0,n.default)(r),renderer:o.default.CanvasRenderer};if(r&&r.getContext)return{element:r,renderer:o.default.CanvasRenderer};if(r&&"object"===(void 0===r?"undefined":t(r))&&!r.nodeName)return{element:r,renderer:o.default.ObjectRenderer};throw new i.InvalidElementException},ne}var xe,Se,Ce,Ae={};var Te=function(){if(Ce)return Se;Ce=1;var t=c(Wt()),e=c(Qt()),n=c((Zt||(Zt=1,Object.defineProperty(te,"__esModule",{value:!0}),te.default=function(t){var e=[];return function t(n){if(Array.isArray(n))for(var r=0;r<n.length;r++)t(n[r]);else n.text=n.text||"",n.data=n.data||"",e.push(n)}(t),e}),te)),r=c((Kt||(Kt=1,Object.defineProperty(ee,"__esModule",{value:!0}),ee.default=function(t){return t.marginTop=t.marginTop||t.margin,t.marginBottom=t.marginBottom||t.margin,t.marginRight=t.marginRight||t.margin,t.marginLeft=t.marginLeft||t.margin,t}),ee)),o=c(Pe()),i=c(ie()),u=c(function(){if(xe)return Ae;xe=1,Object.defineProperty(Ae,"__esModule",{value:!0});var t=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),e=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.api=t}return t(e,[{key:"handleCatch",value:function(t){if("InvalidInputException"!==t.name)throw t;if(this.api._options.valid===this.api._defaults.valid)throw t.message;this.api._options.valid(!1),this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(t){try{var e=t.apply(void 0,arguments);return this.api._options.valid(!0),e}catch(t){return this.handleCatch(t),this.api}}}]),e}();return Ae.default=e,Ae}()),a=je(),f=c(ce());function c(t){return t&&t.__esModule?t:{default:t}}var l=function(){},s=function(t,e,n){var r=new l;if(void 0===t)throw Error("No element to render on was provided.");return r._renderProperties=(0,o.default)(t),r._encodings=[],r._options=f.default,r._errorHandler=new u.default(r),void 0!==e&&((n=n||{}).format||(n.format=y()),r.options(n)[n.format](e,n).render()),r};for(var p in s.getModule=function(e){return t.default[e]},t.default)t.default.hasOwnProperty(p)&&d(t.default,p);function d(t,n){l.prototype[n]=l.prototype[n.toUpperCase()]=l.prototype[n.toLowerCase()]=function(r,o){var u=this;return u._errorHandler.wrapBarcodeCall(function(){o.text=void 0===o.text?void 0:""+o.text;var a=(0,e.default)(u._options,o);a=(0,i.default)(a);var f=t[n],c=h(r,f,a);return u._encodings.push(c),u})}}function h(t,r,o){var i=new r(t=""+t,o);if(!i.valid())throw new a.InvalidInputException(i.constructor.name,t);var u=i.encode();u=(0,n.default)(u);for(var f=0;f<u.length;f++)u[f].options=(0,e.default)(o,u[f].options);return u}function y(){return t.default.CODE128?"CODE128":Object.keys(t.default)[0]}function b(t,o,i){o=(0,n.default)(o);for(var u=0;u<o.length;u++)o[u].options=(0,e.default)(i,o[u].options),(0,r.default)(o[u].options);(0,r.default)(i),new(0,t.renderer)(t.element,o,i).render(),t.afterRender&&t.afterRender()}return l.prototype.options=function(t){return this._options=(0,e.default)(this._options,t),this},l.prototype.blank=function(t){var e=new Array(t+1).join("0");return this._encodings.push({data:e}),this},l.prototype.init=function(){var n;if(this._renderProperties)for(var r in Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]),this._renderProperties){n=this._renderProperties[r];var o=(0,e.default)(this._options,n.options);"auto"==o.format&&(o.format=y()),this._errorHandler.wrapBarcodeCall(function(){var e=h(o.value,t.default[o.format.toUpperCase()],o);b(n,e,o)})}},l.prototype.render=function(){if(!this._renderProperties)throw new a.NoElementException;if(Array.isArray(this._renderProperties))for(var t=0;t<this._renderProperties.length;t++)b(this._renderProperties[t],this._encodings,this._options);else b(this._renderProperties,this._encodings,this._options);return this},l.prototype._defaults=f.default,"undefined"!=typeof window&&(window.JsBarcode=s),"undefined"!=typeof jQuery&&(jQuery.fn.JsBarcode=function(t,e){var n=[];return jQuery(this).each(function(){n.push(this)}),s(n,t,e)}),Se=s}(),Me=(0,i.t)(Te),Re=Object.freeze({__proto__:null,default:Me})}}]);
|
|
2
|
+
//# sourceMappingURL=9688.dddd5b80.js.map
|