@mypixia/simplex-designer 1.0.17 → 1.1.0

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/dist/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";require('./index_external.css');var Kt=Object.create;var mt=Object.defineProperty;var Xt=Object.getOwnPropertyDescriptor;var qt=Object.getOwnPropertyNames;var Qt=Object.getPrototypeOf,Zt=Object.prototype.hasOwnProperty;var er=(m,r,n,c)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of qt(r))!Zt.call(m,a)&&a!==n&&mt(m,a,{get:()=>r[a],enumerable:!(c=Xt(r,a))||c.enumerable});return m};var tr=(m,r,n)=>(n=m!=null?Kt(Qt(m)):{},er(r||!m||!m.__esModule?mt(n,"default",{value:m,enumerable:!0}):n,m));const p=require("react"),B=require("fabric"),ve=require("axios"),rr=require("qrcode"),nr=require("react-barcode"),oe=require("react-share"),sr=require("react-dom");var st={exports:{}},tt={};/**
1
+ "use strict";require('./index_external.css');var Kt=Object.create;var bt=Object.defineProperty;var Xt=Object.getOwnPropertyDescriptor;var qt=Object.getOwnPropertyNames;var Qt=Object.getPrototypeOf,Zt=Object.prototype.hasOwnProperty;var er=(m,r,n,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of qt(r))!Zt.call(m,l)&&l!==n&&bt(m,l,{get:()=>r[l],enumerable:!(a=Xt(r,l))||a.enumerable});return m};var tr=(m,r,n)=>(n=m!=null?Kt(Qt(m)):{},er(r||!m||!m.__esModule?bt(n,"default",{value:m,enumerable:!0}):n,m));const h=require("react"),B=require("fabric"),Ce=require("axios"),rr=require("qrcode"),nr=require("react-barcode"),ce=require("react-share"),sr=require("react-dom");var dt={exports:{}},ct={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var vt;function ir(){if(vt)return tt;vt=1;var m=p,r=Symbol.for("react.element"),n=Symbol.for("react.fragment"),c=Object.prototype.hasOwnProperty,a=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d={key:!0,ref:!0,__self:!0,__source:!0};function x(h,j,o){var v,u={},w=null,i=null;o!==void 0&&(w=""+o),j.key!==void 0&&(w=""+j.key),j.ref!==void 0&&(i=j.ref);for(v in j)c.call(j,v)&&!d.hasOwnProperty(v)&&(u[v]=j[v]);if(h&&h.defaultProps)for(v in j=h.defaultProps,j)u[v]===void 0&&(u[v]=j[v]);return{$$typeof:r,type:h,key:w,ref:i,props:u,_owner:a.current}}return tt.Fragment=n,tt.jsx=x,tt.jsxs=x,tt}var rt={};/**
9
+ */var yt;function ir(){if(yt)return ct;yt=1;var m=h,r=Symbol.for("react.element"),n=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,l=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d={key:!0,ref:!0,__self:!0,__source:!0};function x(p,j,c){var v,u={},w=null,i=null;c!==void 0&&(w=""+c),j.key!==void 0&&(w=""+j.key),j.ref!==void 0&&(i=j.ref);for(v in j)a.call(j,v)&&!d.hasOwnProperty(v)&&(u[v]=j[v]);if(p&&p.defaultProps)for(v in j=p.defaultProps,j)u[v]===void 0&&(u[v]=j[v]);return{$$typeof:r,type:p,key:w,ref:i,props:u,_owner:l.current}}return ct.Fragment=n,ct.jsx=x,ct.jsxs=x,ct}var at={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,21 +14,81 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var jt;function or(){return jt||(jt=1,process.env.NODE_ENV!=="production"&&function(){var m=p,r=Symbol.for("react.element"),n=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),x=Symbol.for("react.provider"),h=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),o=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),i=Symbol.for("react.offscreen"),y=Symbol.iterator,f="@@iterator";function b(t){if(t===null||typeof t!="object")return null;var g=y&&t[y]||t[f];return typeof g=="function"?g:null}var s=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function k(t){{for(var g=arguments.length,S=new Array(g>1?g-1:0),M=1;M<g;M++)S[M-1]=arguments[M];_("error",t,S)}}function _(t,g,S){{var M=s.ReactDebugCurrentFrame,$=M.getStackAddendum();$!==""&&(g+="%s",S=S.concat([$]));var G=S.map(function(U){return String(U)});G.unshift("Warning: "+g),Function.prototype.apply.call(console[t],console,G)}}var T=!1,R=!1,P=!1,z=!1,I=!1,H;H=Symbol.for("react.module.reference");function X(t){return!!(typeof t=="string"||typeof t=="function"||t===c||t===d||I||t===a||t===o||t===v||z||t===i||T||R||P||typeof t=="object"&&t!==null&&(t.$$typeof===w||t.$$typeof===u||t.$$typeof===x||t.$$typeof===h||t.$$typeof===j||t.$$typeof===H||t.getModuleId!==void 0))}function Q(t,g,S){var M=t.displayName;if(M)return M;var $=g.displayName||g.name||"";return $!==""?S+"("+$+")":S}function ie(t){return t.displayName||"Context"}function re(t){if(t==null)return null;if(typeof t.tag=="number"&&k("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case c:return"Fragment";case n:return"Portal";case d:return"Profiler";case a:return"StrictMode";case o:return"Suspense";case v:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case h:var g=t;return ie(g)+".Consumer";case x:var S=t;return ie(S._context)+".Provider";case j:return Q(t,t.render,"ForwardRef");case u:var M=t.displayName||null;return M!==null?M:re(t.type)||"Memo";case w:{var $=t,G=$._payload,U=$._init;try{return re(U(G))}catch{return null}}}return null}var ae=Object.assign,pe=0,je,Ne,Me,ze,Ve,ne,qe;function Re(){}Re.__reactDisabledLog=!0;function Ue(){{if(pe===0){je=console.log,Ne=console.info,Me=console.warn,ze=console.error,Ve=console.group,ne=console.groupCollapsed,qe=console.groupEnd;var t={configurable:!0,enumerable:!0,value:Re,writable:!0};Object.defineProperties(console,{info:t,log:t,warn:t,error:t,group:t,groupCollapsed:t,groupEnd:t})}pe++}}function Le(){{if(pe--,pe===0){var t={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ae({},t,{value:je}),info:ae({},t,{value:Ne}),warn:ae({},t,{value:Me}),error:ae({},t,{value:ze}),group:ae({},t,{value:Ve}),groupCollapsed:ae({},t,{value:ne}),groupEnd:ae({},t,{value:qe})})}pe<0&&k("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var _e=s.ReactCurrentDispatcher,be;function J(t,g,S){{if(be===void 0)try{throw Error()}catch($){var M=$.stack.trim().match(/\n( *(at )?)/);be=M&&M[1]||""}return`
18
- `+be+t}}var Oe=!1,Ae;{var se=typeof WeakMap=="function"?WeakMap:Map;Ae=new se}function Ie(t,g){if(!t||Oe)return"";{var S=Ae.get(t);if(S!==void 0)return S}var M;Oe=!0;var $=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var G;G=_e.current,_e.current=null,Ue();try{if(g){var U=function(){throw Error()};if(Object.defineProperty(U.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(U,[])}catch(le){M=le}Reflect.construct(t,[],U)}else{try{U.call()}catch(le){M=le}t.call(U.prototype)}}else{try{throw Error()}catch(le){M=le}t()}}catch(le){if(le&&M&&typeof le.stack=="string"){for(var V=le.stack.split(`
19
- `),ce=M.stack.split(`
20
- `),q=V.length-1,ee=ce.length-1;q>=1&&ee>=0&&V[q]!==ce[ee];)ee--;for(;q>=1&&ee>=0;q--,ee--)if(V[q]!==ce[ee]){if(q!==1||ee!==1)do if(q--,ee--,ee<0||V[q]!==ce[ee]){var he=`
21
- `+V[q].replace(" at new "," at ");return t.displayName&&he.includes("<anonymous>")&&(he=he.replace("<anonymous>",t.displayName)),typeof t=="function"&&Ae.set(t,he),he}while(q>=1&&ee>=0);break}}}finally{Oe=!1,_e.current=G,Le(),Error.prepareStackTrace=$}var Ge=t?t.displayName||t.name:"",Pe=Ge?J(Ge):"";return typeof t=="function"&&Ae.set(t,Pe),Pe}function de(t,g,S){return Ie(t,!1)}function ye(t){var g=t.prototype;return!!(g&&g.isReactComponent)}function ue(t,g,S){if(t==null)return"";if(typeof t=="function")return Ie(t,ye(t));if(typeof t=="string")return J(t);switch(t){case o:return J("Suspense");case v:return J("SuspenseList")}if(typeof t=="object")switch(t.$$typeof){case j:return de(t.render);case u:return ue(t.type,g,S);case w:{var M=t,$=M._payload,G=M._init;try{return ue(G($),g,S)}catch{}}}return""}var ge=Object.prototype.hasOwnProperty,We={},we=s.ReactDebugCurrentFrame;function Ee(t){if(t){var g=t._owner,S=ue(t.type,t._source,g?g.type:null);we.setExtraStackFrame(S)}else we.setExtraStackFrame(null)}function $e(t,g,S,M,$){{var G=Function.call.bind(ge);for(var U in t)if(G(t,U)){var V=void 0;try{if(typeof t[U]!="function"){var ce=Error((M||"React class")+": "+S+" type `"+U+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof t[U]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ce.name="Invariant Violation",ce}V=t[U](g,U,M,S,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(q){V=q}V&&!(V instanceof Error)&&(Ee($),k("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",M||"React class",S,U,typeof V),Ee(null)),V instanceof Error&&!(V.message in We)&&(We[V.message]=!0,Ee($),k("Failed %s type: %s",S,V.message),Ee(null))}}}var Qe=Array.isArray;function Be(t){return Qe(t)}function Ze(t){{var g=typeof Symbol=="function"&&Symbol.toStringTag,S=g&&t[Symbol.toStringTag]||t.constructor.name||"Object";return S}}function et(t){try{return De(t),!1}catch{return!0}}function De(t){return""+t}function Ce(t){if(et(t))return k("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ze(t)),De(t)}var N=s.ReactCurrentOwner,A={key:!0,ref:!0,__self:!0,__source:!0},Y,F;function Z(t){if(ge.call(t,"ref")){var g=Object.getOwnPropertyDescriptor(t,"ref").get;if(g&&g.isReactWarning)return!1}return t.ref!==void 0}function me(t){if(ge.call(t,"key")){var g=Object.getOwnPropertyDescriptor(t,"key").get;if(g&&g.isReactWarning)return!1}return t.key!==void 0}function te(t,g){typeof t.ref=="string"&&N.current}function Se(t,g){{var S=function(){Y||(Y=!0,k("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",g))};S.isReactWarning=!0,Object.defineProperty(t,"key",{get:S,configurable:!0})}}function Fe(t,g){{var S=function(){F||(F=!0,k("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",g))};S.isReactWarning=!0,Object.defineProperty(t,"ref",{get:S,configurable:!0})}}var Je=function(t,g,S,M,$,G,U){var V={$$typeof:r,type:t,key:g,ref:S,props:U,_owner:G};return V._store={},Object.defineProperty(V._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(V,"_self",{configurable:!1,enumerable:!1,writable:!1,value:M}),Object.defineProperty(V,"_source",{configurable:!1,enumerable:!1,writable:!1,value:$}),Object.freeze&&(Object.freeze(V.props),Object.freeze(V)),V};function l(t,g,S,M,$){{var G,U={},V=null,ce=null;S!==void 0&&(Ce(S),V=""+S),me(g)&&(Ce(g.key),V=""+g.key),Z(g)&&(ce=g.ref,te(g,$));for(G in g)ge.call(g,G)&&!A.hasOwnProperty(G)&&(U[G]=g[G]);if(t&&t.defaultProps){var q=t.defaultProps;for(G in q)U[G]===void 0&&(U[G]=q[G])}if(V||ce){var ee=typeof t=="function"?t.displayName||t.name||"Unknown":t;V&&Se(U,ee),ce&&Fe(U,ee)}return Je(t,V,ce,$,M,N.current,U)}}var O=s.ReactCurrentOwner,E=s.ReactDebugCurrentFrame;function C(t){if(t){var g=t._owner,S=ue(t.type,t._source,g?g.type:null);E.setExtraStackFrame(S)}else E.setExtraStackFrame(null)}var W;W=!1;function K(t){return typeof t=="object"&&t!==null&&t.$$typeof===r}function L(){{if(O.current){var t=re(O.current.type);if(t)return`
17
+ */var wt;function or(){return wt||(wt=1,process.env.NODE_ENV!=="production"&&function(){var m=h,r=Symbol.for("react.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),x=Symbol.for("react.provider"),p=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),i=Symbol.for("react.offscreen"),y=Symbol.iterator,f="@@iterator";function b(t){if(t===null||typeof t!="object")return null;var g=y&&t[y]||t[f];return typeof g=="function"?g:null}var s=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function k(t){{for(var g=arguments.length,S=new Array(g>1?g-1:0),M=1;M<g;M++)S[M-1]=arguments[M];_("error",t,S)}}function _(t,g,S){{var M=s.ReactDebugCurrentFrame,$=M.getStackAddendum();$!==""&&(g+="%s",S=S.concat([$]));var Y=S.map(function(U){return String(U)});Y.unshift("Warning: "+g),Function.prototype.apply.call(console[t],console,Y)}}var z=!1,L=!1,F=!1,R=!1,E=!1,P;P=Symbol.for("react.module.reference");function X(t){return!!(typeof t=="string"||typeof t=="function"||t===a||t===d||E||t===l||t===c||t===v||R||t===i||z||L||F||typeof t=="object"&&t!==null&&(t.$$typeof===w||t.$$typeof===u||t.$$typeof===x||t.$$typeof===p||t.$$typeof===j||t.$$typeof===P||t.getModuleId!==void 0))}function Q(t,g,S){var M=t.displayName;if(M)return M;var $=g.displayName||g.name||"";return $!==""?S+"("+$+")":S}function oe(t){return t.displayName||"Context"}function te(t){if(t==null)return null;if(typeof t.tag=="number"&&k("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case a:return"Fragment";case n:return"Portal";case d:return"Profiler";case l:return"StrictMode";case c:return"Suspense";case v:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case p:var g=t;return oe(g)+".Consumer";case x:var S=t;return oe(S._context)+".Provider";case j:return Q(t,t.render,"ForwardRef");case u:var M=t.displayName||null;return M!==null?M:te(t.type)||"Memo";case w:{var $=t,Y=$._payload,U=$._init;try{return te(U(Y))}catch{return null}}}return null}var de=Object.assign,xe=0,Se,Ie,_e,Be,Je,re,rt;function De(){}De.__reactDisabledLog=!0;function Ge(){{if(xe===0){Se=console.log,Ie=console.info,_e=console.warn,Be=console.error,Je=console.group,re=console.groupCollapsed,rt=console.groupEnd;var t={configurable:!0,enumerable:!0,value:De,writable:!0};Object.defineProperties(console,{info:t,log:t,warn:t,error:t,group:t,groupCollapsed:t,groupEnd:t})}xe++}}function Fe(){{if(xe--,xe===0){var t={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:de({},t,{value:Se}),info:de({},t,{value:Ie}),warn:de({},t,{value:_e}),error:de({},t,{value:Be}),group:de({},t,{value:Je}),groupCollapsed:de({},t,{value:re}),groupEnd:de({},t,{value:rt})})}xe<0&&k("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var He=s.ReactCurrentDispatcher,ke;function J(t,g,S){{if(ke===void 0)try{throw Error()}catch($){var M=$.stack.trim().match(/\n( *(at )?)/);ke=M&&M[1]||""}return`
18
+ `+ke+t}}var Ee=!1,Te;{var ne=typeof WeakMap=="function"?WeakMap:Map;Te=new ne}function ze(t,g){if(!t||Ee)return"";{var S=Te.get(t);if(S!==void 0)return S}var M;Ee=!0;var $=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Y;Y=He.current,He.current=null,Ge();try{if(g){var U=function(){throw Error()};if(Object.defineProperty(U.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(U,[])}catch(he){M=he}Reflect.construct(t,[],U)}else{try{U.call()}catch(he){M=he}t.call(U.prototype)}}else{try{throw Error()}catch(he){M=he}t()}}catch(he){if(he&&M&&typeof he.stack=="string"){for(var V=he.stack.split(`
19
+ `),le=M.stack.split(`
20
+ `),q=V.length-1,Z=le.length-1;q>=1&&Z>=0&&V[q]!==le[Z];)Z--;for(;q>=1&&Z>=0;q--,Z--)if(V[q]!==le[Z]){if(q!==1||Z!==1)do if(q--,Z--,Z<0||V[q]!==le[Z]){var fe=`
21
+ `+V[q].replace(" at new "," at ");return t.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",t.displayName)),typeof t=="function"&&Te.set(t,fe),fe}while(q>=1&&Z>=0);break}}}finally{Ee=!1,He.current=Y,Fe(),Error.prepareStackTrace=$}var Qe=t?t.displayName||t.name:"",We=Qe?J(Qe):"";return typeof t=="function"&&Te.set(t,We),We}function nt(t,g,S){return ze(t,!1)}function ue(t){var g=t.prototype;return!!(g&&g.isReactComponent)}function pe(t,g,S){if(t==null)return"";if(typeof t=="function")return ze(t,ue(t));if(typeof t=="string")return J(t);switch(t){case c:return J("Suspense");case v:return J("SuspenseList")}if(typeof t=="object")switch(t.$$typeof){case j:return nt(t.render);case u:return pe(t.type,g,S);case w:{var M=t,$=M._payload,Y=M._init;try{return pe(Y($),g,S)}catch{}}}return""}var be=Object.prototype.hasOwnProperty,Pe={},Ye=s.ReactDebugCurrentFrame;function ge(t){if(t){var g=t._owner,S=pe(t.type,t._source,g?g.type:null);Ye.setExtraStackFrame(S)}else Ye.setExtraStackFrame(null)}function st(t,g,S,M,$){{var Y=Function.call.bind(be);for(var U in t)if(Y(t,U)){var V=void 0;try{if(typeof t[U]!="function"){var le=Error((M||"React class")+": "+S+" type `"+U+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof t[U]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw le.name="Invariant Violation",le}V=t[U](g,U,M,S,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(q){V=q}V&&!(V instanceof Error)&&(ge($),k("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",M||"React class",S,U,typeof V),ge(null)),V instanceof Error&&!(V.message in Pe)&&(Pe[V.message]=!0,ge($),k("Failed %s type: %s",S,V.message),ge(null))}}}var Ke=Array.isArray;function Ve(t){return Ke(t)}function it(t){{var g=typeof Symbol=="function"&&Symbol.toStringTag,S=g&&t[Symbol.toStringTag]||t.constructor.name||"Object";return S}}function ot(t){try{return Xe(t),!1}catch{return!0}}function Xe(t){return""+t}function Me(t){if(ot(t))return k("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",it(t)),Xe(t)}var N=s.ReactCurrentOwner,A={key:!0,ref:!0,__self:!0,__source:!0},G,D;function ee(t){if(be.call(t,"ref")){var g=Object.getOwnPropertyDescriptor(t,"ref").get;if(g&&g.isReactWarning)return!1}return t.ref!==void 0}function me(t){if(be.call(t,"key")){var g=Object.getOwnPropertyDescriptor(t,"key").get;if(g&&g.isReactWarning)return!1}return t.key!==void 0}function ye(t,g){typeof t.ref=="string"&&N.current}function se(t,g){{var S=function(){G||(G=!0,k("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",g))};S.isReactWarning=!0,Object.defineProperty(t,"key",{get:S,configurable:!0})}}function qe(t,g){{var S=function(){D||(D=!0,k("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",g))};S.isReactWarning=!0,Object.defineProperty(t,"ref",{get:S,configurable:!0})}}var Ue=function(t,g,S,M,$,Y,U){var V={$$typeof:r,type:t,key:g,ref:S,props:U,_owner:Y};return V._store={},Object.defineProperty(V._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(V,"_self",{configurable:!1,enumerable:!1,writable:!1,value:M}),Object.defineProperty(V,"_source",{configurable:!1,enumerable:!1,writable:!1,value:$}),Object.freeze&&(Object.freeze(V.props),Object.freeze(V)),V};function we(t,g,S,M,$){{var Y,U={},V=null,le=null;S!==void 0&&(Me(S),V=""+S),me(g)&&(Me(g.key),V=""+g.key),ee(g)&&(le=g.ref,ye(g,$));for(Y in g)be.call(g,Y)&&!A.hasOwnProperty(Y)&&(U[Y]=g[Y]);if(t&&t.defaultProps){var q=t.defaultProps;for(Y in q)U[Y]===void 0&&(U[Y]=q[Y])}if(V||le){var Z=typeof t=="function"?t.displayName||t.name||"Unknown":t;V&&se(U,Z),le&&qe(U,Z)}return Ue(t,V,le,$,M,N.current,U)}}var o=s.ReactCurrentOwner,I=s.ReactDebugCurrentFrame;function O(t){if(t){var g=t._owner,S=pe(t.type,t._source,g?g.type:null);I.setExtraStackFrame(S)}else I.setExtraStackFrame(null)}var C;C=!1;function W(t){return typeof t=="object"&&t!==null&&t.$$typeof===r}function K(){{if(o.current){var t=te(o.current.type);if(t)return`
22
22
 
23
- Check the render method of \``+t+"`."}return""}}function D(t){return""}var pt={};function Pt(t){{var g=L();if(!g){var S=typeof t=="string"?t:t.displayName||t.name;S&&(g=`
23
+ Check the render method of \``+t+"`."}return""}}function H(t){return""}var T={};function ae(t){{var g=K();if(!g){var S=typeof t=="string"?t:t.displayName||t.name;S&&(g=`
24
24
 
25
- Check the top-level render call using <`+S+">.")}return g}}function ut(t,g){{if(!t._store||t._store.validated||t.key!=null)return;t._store.validated=!0;var S=Pt(g);if(pt[S])return;pt[S]=!0;var M="";t&&t._owner&&t._owner!==O.current&&(M=" It was passed a child from "+re(t._owner.type)+"."),C(t),k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',S,M),C(null)}}function ft(t,g){{if(typeof t!="object")return;if(Be(t))for(var S=0;S<t.length;S++){var M=t[S];K(M)&&ut(M,g)}else if(K(t))t._store&&(t._store.validated=!0);else if(t){var $=b(t);if(typeof $=="function"&&$!==t.entries)for(var G=$.call(t),U;!(U=G.next()).done;)K(U.value)&&ut(U.value,g)}}}function Ht(t){{var g=t.type;if(g==null||typeof g=="string")return;var S;if(typeof g=="function")S=g.propTypes;else if(typeof g=="object"&&(g.$$typeof===j||g.$$typeof===u))S=g.propTypes;else return;if(S){var M=re(g);$e(S,t.props,"prop",M,t)}else if(g.PropTypes!==void 0&&!W){W=!0;var $=re(g);k("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",$||"Unknown")}typeof g.getDefaultProps=="function"&&!g.getDefaultProps.isReactClassApproved&&k("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Vt(t){{for(var g=Object.keys(t.props),S=0;S<g.length;S++){var M=g[S];if(M!=="children"&&M!=="key"){C(t),k("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",M),C(null);break}}t.ref!==null&&(C(t),k("Invalid attribute `ref` supplied to `React.Fragment`."),C(null))}}var xt={};function gt(t,g,S,M,$,G){{var U=X(t);if(!U){var V="";(t===void 0||typeof t=="object"&&t!==null&&Object.keys(t).length===0)&&(V+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ce=D();ce?V+=ce:V+=L();var q;t===null?q="null":Be(t)?q="array":t!==void 0&&t.$$typeof===r?(q="<"+(re(t.type)||"Unknown")+" />",V=" Did you accidentally export a JSX literal instead of a component?"):q=typeof t,k("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",q,V)}var ee=l(t,g,S,$,G);if(ee==null)return ee;if(U){var he=g.children;if(he!==void 0)if(M)if(Be(he)){for(var Ge=0;Ge<he.length;Ge++)ft(he[Ge],t);Object.freeze&&Object.freeze(he)}else k("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else ft(he,t)}if(ge.call(g,"key")){var Pe=re(t),le=Object.keys(g).filter(function(Yt){return Yt!=="key"}),dt=le.length>0?"{key: someKey, "+le.join(": ..., ")+": ...}":"{key: someKey}";if(!xt[Pe+dt]){var Gt=le.length>0?"{"+le.join(": ..., ")+": ...}":"{}";k(`A props object containing a "key" prop is being spread into JSX:
25
+ Check the top-level render call using <`+S+">.")}return g}}function ie(t,g){{if(!t._store||t._store.validated||t.key!=null)return;t._store.validated=!0;var S=ae(g);if(T[S])return;T[S]=!0;var M="";t&&t._owner&&t._owner!==o.current&&(M=" It was passed a child from "+te(t._owner.type)+"."),O(t),k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',S,M),O(null)}}function Re(t,g){{if(typeof t!="object")return;if(Ve(t))for(var S=0;S<t.length;S++){var M=t[S];W(M)&&ie(M,g)}else if(W(t))t._store&&(t._store.validated=!0);else if(t){var $=b(t);if(typeof $=="function"&&$!==t.entries)for(var Y=$.call(t),U;!(U=Y.next()).done;)W(U.value)&&ie(U.value,g)}}}function Ne(t){{var g=t.type;if(g==null||typeof g=="string")return;var S;if(typeof g=="function")S=g.propTypes;else if(typeof g=="object"&&(g.$$typeof===j||g.$$typeof===u))S=g.propTypes;else return;if(S){var M=te(g);st(S,t.props,"prop",M,t)}else if(g.PropTypes!==void 0&&!C){C=!0;var $=te(g);k("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",$||"Unknown")}typeof g.getDefaultProps=="function"&&!g.getDefaultProps.isReactClassApproved&&k("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Oe(t){{for(var g=Object.keys(t.props),S=0;S<g.length;S++){var M=g[S];if(M!=="children"&&M!=="key"){O(t),k("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",M),O(null);break}}t.ref!==null&&(O(t),k("Invalid attribute `ref` supplied to `React.Fragment`."),O(null))}}var vt={};function jt(t,g,S,M,$,Y){{var U=X(t);if(!U){var V="";(t===void 0||typeof t=="object"&&t!==null&&Object.keys(t).length===0)&&(V+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var le=H();le?V+=le:V+=K();var q;t===null?q="null":Ve(t)?q="array":t!==void 0&&t.$$typeof===r?(q="<"+(te(t.type)||"Unknown")+" />",V=" Did you accidentally export a JSX literal instead of a component?"):q=typeof t,k("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",q,V)}var Z=we(t,g,S,$,Y);if(Z==null)return Z;if(U){var fe=g.children;if(fe!==void 0)if(M)if(Ve(fe)){for(var Qe=0;Qe<fe.length;Qe++)Re(fe[Qe],t);Object.freeze&&Object.freeze(fe)}else k("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Re(fe,t)}if(be.call(g,"key")){var We=te(t),he=Object.keys(g).filter(function(Yt){return Yt!=="key"}),gt=he.length>0?"{key: someKey, "+he.join(": ..., ")+": ...}":"{key: someKey}";if(!vt[We+gt]){var Gt=he.length>0?"{"+he.join(": ..., ")+": ...}":"{}";k(`A props object containing a "key" prop is being spread into JSX:
26
26
  let props = %s;
27
27
  <%s {...props} />
28
28
  React keys must be passed directly to JSX without using spread:
29
29
  let props = %s;
30
- <%s key={someKey} {...props} />`,dt,Pe,Gt,Pe),xt[Pe+dt]=!0}}return t===c?Vt(ee):Ht(ee),ee}}function Ut(t,g,S){return gt(t,g,S,!0)}function Wt(t,g,S){return gt(t,g,S,!1)}var $t=Wt,Jt=Ut;rt.Fragment=c,rt.jsx=$t,rt.jsxs=Jt}()),rt}var bt;function cr(){return bt||(bt=1,process.env.NODE_ENV==="production"?st.exports=ir():st.exports=or()),st.exports}var e=cr();const ar={primaryColor:"#f88300",primaryColorLight:"#6858c1",secondaryColor:"#005a53",tertiaryColor:"#FFFFFF"},lr="M80 160c0-35.3 28.7-64 64-64h32c35.3 0 64 28.7 64 64v3.6c0 21.8-11.1 42.1-29.4 53.8l-42.2 27.1c-25.2 16.2-40.4 44.1-40.4 74V320c0 17.7 14.3 32 32 32s32-14.3 32-32v-1.4c0-8.2 4.2-15.8 11-20.2l42.2-27.1c36.6-23.6 58.8-64.1 58.8-107.7V160c0-70.7-57.3-128-128-128H144C73.3 32 16 89.3 16 160c0 17.7 14.3 32 32 32s32-14.3 32-32zm80 320a40 40 0 1 0 0-80 40 40 0 1 0 0 80z",dr="M164.9 24.6c-7.7-18.6-28-28.5-47.4-23.2l-88 24C12.1 30.2 0 46 0 64C0 311.4 200.6 512 448 512c18 0 33.8-12.1 38.6-29.5l24-88c5.3-19.4-4.6-39.7-23.2-47.4l-96-40c-16.3-6.8-35.2-2.1-46.3 11.6L304.7 368C234.3 334.7 177.3 277.7 144 207.3L193.3 167c13.7-11.2 18.4-30 11.6-46.3l-40-96z",hr="M464 256A208 208 0 1 1 48 256a208 208 0 1 1 416 0zM0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM232 120V256c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2V120c0-13.3-10.7-24-24-24s-24 10.7-24 24z",pr="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z",ur="M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z",fr="M160 64c0-8.8 7.2-16 16-16s16 7.2 16 16V200c0 10.3 6.6 19.5 16.4 22.8s20.6-.1 26.8-8.3c3-3.9 7.6-6.4 12.8-6.4c8.8 0 16 7.2 16 16c0 10.3 6.6 19.5 16.4 22.8s20.6-.1 26.8-8.3c3-3.9 7.6-6.4 12.8-6.4c7.8 0 14.3 5.6 15.7 13c1.6 8.2 7.3 15.1 15.1 18s16.7 1.6 23.3-3.6c2.7-2.1 6.1-3.4 9.9-3.4c8.8 0 16 7.2 16 16l0 16V392c0 39.8-32.2 72-72 72H272 212.3h-.9c-37.4 0-72.4-18.7-93.2-49.9L50.7 312.9c-4.9-7.4-2.9-17.3 4.4-22.2s17.3-2.9 22.2 4.4L116 353.2c5.9 8.8 16.8 12.7 26.9 9.7s17-12.4 17-23V320 64zM176 0c-35.3 0-64 28.7-64 64V261.7C91.2 238 55.5 232.8 28.5 250.7C-.9 270.4-8.9 310.1 10.8 339.5L78.3 440.8c29.7 44.5 79.6 71.2 133.1 71.2h.9H272h56c66.3 0 120-53.7 120-120V288l0-16c0-35.3-28.7-64-64-64c-4.5 0-8.8 .5-13 1.3c-11.7-15.4-30.2-25.3-51-25.3c-6.9 0-13.5 1.1-19.7 3.1C288.7 170.7 269.6 160 248 160c-2.7 0-5.4 .2-8 .5V64c0-35.3-28.7-64-64-64zm48 304c0-8.8-7.2-16-16-16s-16 7.2-16 16v96c0 8.8 7.2 16 16 16s16-7.2 16-16V304zm48-16c-8.8 0-16 7.2-16 16v96c0 8.8 7.2 16 16 16s16-7.2 16-16V304c0-8.8-7.2-16-16-16zm80 16c0-8.8-7.2-16-16-16s-16 7.2-16 16v96c0 8.8 7.2 16 16 16s16-7.2 16-16V304z",xr="M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48H48zM0 176V384c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V176L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z",gr="M160 0c17.7 0 32 14.3 32 32V67.7c1.6 .2 3.1 .4 4.7 .7c.4 .1 .7 .1 1.1 .2l48 8.8c17.4 3.2 28.9 19.9 25.7 37.2s-19.9 28.9-37.2 25.7l-47.5-8.7c-31.3-4.6-58.9-1.5-78.3 6.2s-27.2 18.3-29 28.1c-2 10.7-.5 16.7 1.2 20.4c1.8 3.9 5.5 8.3 12.8 13.2c16.3 10.7 41.3 17.7 73.7 26.3l2.9 .8c28.6 7.6 63.6 16.8 89.6 33.8c14.2 9.3 27.6 21.9 35.9 39.5c8.5 17.9 10.3 37.9 6.4 59.2c-6.9 38-33.1 63.4-65.6 76.7c-13.7 5.6-28.6 9.2-44.4 11V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V445.1c-.4-.1-.9-.1-1.3-.2l-.2 0 0 0c-24.4-3.8-64.5-14.3-91.5-26.3c-16.1-7.2-23.4-26.1-16.2-42.2s26.1-23.4 42.2-16.2c20.9 9.3 55.3 18.5 75.2 21.6c31.9 4.7 58.2 2 76-5.3c16.9-6.9 24.6-16.9 26.8-28.9c1.9-10.6 .4-16.7-1.3-20.4c-1.9-4-5.6-8.4-13-13.3c-16.4-10.7-41.5-17.7-74-26.3l-2.8-.7 0 0C119.4 279.3 84.4 270 58.4 253c-14.2-9.3-27.5-22-35.8-39.6c-8.4-17.9-10.1-37.9-6.1-59.2C23.7 116 52.3 91.2 84.8 78.3c13.3-5.3 27.9-8.9 43.2-11V32c0-17.7 14.3-32 32-32z",yt="M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9L464.4 300.4c30.4-28.3 47.6-68 47.6-109.5v-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1v5.8c0 41.5 17.2 81.2 47.6 109.5z",wt="M234.5 5.7c13.9-5 29.1-5 43.1 0l192 68.6C495 83.4 512 107.5 512 134.6V377.4c0 27-17 51.2-42.5 60.3l-192 68.6c-13.9 5-29.1 5-43.1 0l-192-68.6C17 428.6 0 404.5 0 377.4V134.6c0-27 17-51.2 42.5-60.3l192-68.6zM256 66L82.3 128 256 190l173.7-62L256 66zm32 368.6l160-57.1v-188L288 246.6v188z",ht="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z",Ct="M320 32c-8.1 0-16.1 1.4-23.7 4.1L15.8 137.4C6.3 140.9 0 149.9 0 160s6.3 19.1 15.8 22.6l57.9 20.9C57.3 229.3 48 259.8 48 291.9v28.1c0 28.4-10.8 57.7-22.3 80.8c-6.5 13-13.9 25.8-22.5 37.6C0 442.7-.9 448.3 .9 453.4s6 8.9 11.2 10.2l64 16c4.2 1.1 8.7 .3 12.4-2s6.3-6.1 7.1-10.4c8.6-42.8 4.3-81.2-2.1-108.7C90.3 344.3 86 329.8 80 316.5V291.9c0-30.2 10.2-58.7 27.9-81.5c12.9-15.5 29.6-28 49.2-35.7l157-61.7c8.2-3.2 17.5 .8 20.7 9s-.8 17.5-9 20.7l-157 61.7c-12.4 4.9-23.3 12.4-32.2 21.6l159.6 57.6c7.6 2.7 15.6 4.1 23.7 4.1s16.1-1.4 23.7-4.1L624.2 182.6c9.5-3.4 15.8-12.5 15.8-22.6s-6.3-19.1-15.8-22.6L343.7 36.1C336.1 33.4 328.1 32 320 32zM128 408c0 35.3 86 72 192 72s192-36.7 192-72L496.7 262.6 354.5 314c-11.1 4-22.8 6-34.5 6s-23.5-2-34.5-6L143.3 262.6 128 408z",mr="M184 48H328c4.4 0 8 3.6 8 8V96H176V56c0-4.4 3.6-8 8-8zm-56 8V96H64C28.7 96 0 124.7 0 160v96H192 352h8.2c32.3-39.1 81.1-64 135.8-64c5.4 0 10.7 .2 16 .7V160c0-35.3-28.7-64-64-64H384V56c0-30.9-25.1-56-56-56H184c-30.9 0-56 25.1-56 56zM320 352H224c-17.7 0-32-14.3-32-32V288H0V416c0 35.3 28.7 64 64 64H360.2C335.1 449.6 320 410.5 320 368c0-5.4 .2-10.7 .7-16l-.7 0zm320 16a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zM496 288c8.8 0 16 7.2 16 16v48h32c8.8 0 16 7.2 16 16s-7.2 16-16 16H496c-8.8 0-16-7.2-16-16V304c0-8.8 7.2-16 16-16z",vr="M88.2 309.1c9.8-18.3 6.8-40.8-7.5-55.8C59.4 230.9 48 204 48 176c0-63.5 63.8-128 160-128s160 64.5 160 128s-63.8 128-160 128c-13.1 0-25.8-1.3-37.8-3.6c-10.4-2-21.2-.6-30.7 4.2c-4.1 2.1-8.3 4.1-12.6 6c-16 7.2-32.9 13.5-49.9 18c2.8-4.6 5.4-9.1 7.9-13.6c1.1-1.9 2.2-3.9 3.2-5.9zM0 176c0 41.8 17.2 80.1 45.9 110.3c-.9 1.7-1.9 3.5-2.8 5.1c-10.3 18.4-22.3 36.5-36.6 52.1c-6.6 7-8.3 17.2-4.6 25.9C5.8 378.3 14.4 384 24 384c43 0 86.5-13.3 122.7-29.7c4.8-2.2 9.6-4.5 14.2-6.8c15.1 3 30.9 4.5 47.1 4.5c114.9 0 208-78.8 208-176S322.9 0 208 0S0 78.8 0 176zM432 480c16.2 0 31.9-1.6 47.1-4.5c4.6 2.3 9.4 4.6 14.2 6.8C529.5 498.7 573 512 616 512c9.6 0 18.2-5.7 22-14.5c3.8-8.8 2-19-4.6-25.9c-14.2-15.6-26.2-33.7-36.6-52.1c-.9-1.7-1.9-3.4-2.8-5.1C622.8 384.1 640 345.8 640 304c0-94.4-87.9-171.5-198.2-175.8c4.1 15.2 6.2 31.2 6.2 47.8l0 .6c87.2 6.7 144 67.5 144 127.4c0 28-11.4 54.9-32.7 77.2c-14.3 15-17.3 37.6-7.5 55.8c1.1 2 2.2 4 3.2 5.9c2.5 4.5 5.2 9 7.9 13.6c-17-4.5-33.9-10.7-49.9-18c-4.3-1.9-8.5-3.9-12.6-6c-9.5-4.8-20.3-6.2-30.7-4.2c-12.1 2.4-24.7 3.6-37.8 3.6c-61.7 0-110-26.5-136.8-62.3c-16 5.4-32.8 9.4-50 11.8C279 439.8 350 480 432 480z",jr="M323.8 34.8c-38.2-10.9-78.1 11.2-89 49.4l-5.7 20c-3.7 13-10.4 25-19.5 35l-51.3 56.4c-8.9 9.8-8.2 25 1.6 33.9s25 8.2 33.9-1.6l51.3-56.4c14.1-15.5 24.4-34 30.1-54.1l5.7-20c3.6-12.7 16.9-20.1 29.7-16.5s20.1 16.9 16.5 29.7l-5.7 20c-5.7 19.9-14.7 38.7-26.6 55.5c-5.2 7.3-5.8 16.9-1.7 24.9s12.3 13 21.3 13L448 224c8.8 0 16 7.2 16 16c0 6.8-4.3 12.7-10.4 15c-7.4 2.8-13 9-14.9 16.7s.1 15.8 5.3 21.7c2.5 2.8 4 6.5 4 10.6c0 7.8-5.6 14.3-13 15.7c-8.2 1.6-15.1 7.3-18 15.1s-1.6 16.7 3.6 23.3c2.1 2.7 3.4 6.1 3.4 9.9c0 6.7-4.2 12.6-10.2 14.9c-11.5 4.5-17.7 16.9-14.4 28.8c.4 1.3 .6 2.8 .6 4.3c0 8.8-7.2 16-16 16H286.5c-12.6 0-25-3.7-35.5-10.7l-61.7-41.1c-11-7.4-25.9-4.4-33.3 6.7s-4.4 25.9 6.7 33.3l61.7 41.1c18.4 12.3 40 18.8 62.1 18.8H384c34.7 0 62.9-27.6 64-62c14.6-11.7 24-29.7 24-50c0-4.5-.5-8.8-1.3-13c15.4-11.7 25.3-30.2 25.3-51c0-6.5-1-12.8-2.8-18.7C504.8 273.7 512 257.7 512 240c0-35.3-28.6-64-64-64l-92.3 0c4.7-10.4 8.7-21.2 11.8-32.2l5.7-20c10.9-38.2-11.2-78.1-49.4-89zM32 192c-17.7 0-32 14.3-32 32V448c0 17.7 14.3 32 32 32H96c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32H32z",br="M54.2 202.9C123.2 136.7 216.8 96 320 96s196.8 40.7 265.8 106.9c12.8 12.2 33 11.8 45.2-.9s11.8-33-.9-45.2C549.7 79.5 440.4 32 320 32S90.3 79.5 9.8 156.7C-2.9 169-3.3 189.2 8.9 202s32.5 13.2 45.2 .9zM320 256c56.8 0 108.6 21.1 148.2 56c13.3 11.7 33.5 10.4 45.2-2.8s10.4-33.5-2.8-45.2C459.8 219.2 393 192 320 192s-139.8 27.2-190.5 72c-13.3 11.7-14.5 31.9-2.8 45.2s31.9 14.5 45.2 2.8c39.5-34.9 91.3-56 148.2-56zm64 160a64 64 0 1 0 -128 0 64 64 0 1 0 128 0z",St="M123.6 391.3c12.9-9.4 29.6-11.8 44.6-6.4c26.5 9.6 56.2 15.1 87.8 15.1c124.7 0 208-80.5 208-160s-83.3-160-208-160S48 160.5 48 240c0 32 12.4 62.8 35.7 89.2c8.6 9.7 12.8 22.5 11.8 35.5c-1.4 18.1-5.7 34.7-11.3 49.4c17-7.9 31.1-16.7 39.4-22.7zM21.2 431.9c1.8-2.7 3.5-5.4 5.1-8.1c10-16.6 19.5-38.4 21.4-62.9C17.7 326.8 0 285.1 0 240C0 125.1 114.6 32 256 32s256 93.1 256 208s-114.6 208-256 208c-37.1 0-72.3-6.4-104.1-17.9c-11.9 8.7-31.3 20.6-54.3 30.6c-15.1 6.6-32.3 12.6-50.1 16.1c-.8 .2-1.6 .3-2.4 .5c-4.4 .8-8.7 1.5-13.2 1.9c-.2 0-.5 .1-.7 .1c-5.1 .5-10.2 .8-15.3 .8c-6.5 0-12.3-3.9-14.8-9.9c-2.5-6-1.1-12.8 3.4-17.4c4.1-4.2 7.8-8.7 11.3-13.5c1.7-2.3 3.3-4.6 4.8-6.9c.1-.2 .2-.3 .3-.5z",kt="M0 24C0 10.7 10.7 0 24 0H69.5c22 0 41.5 12.8 50.6 32h411c26.3 0 45.5 25 38.6 50.4l-41 152.3c-8.5 31.4-37 53.3-69.5 53.3H170.7l5.4 28.5c2.2 11.3 12.1 19.5 23.6 19.5H488c13.3 0 24 10.7 24 24s-10.7 24-24 24H199.7c-34.6 0-64.3-24.6-70.7-58.5L77.4 54.5c-.7-3.8-4-6.5-7.9-6.5H24C10.7 48 0 37.3 0 24zM128 464a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm336-48a48 48 0 1 1 0 96 48 48 0 1 1 0-96z",Nt="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336h24V272H216c-13.3 0-24-10.7-24-24s10.7-24 24-24h48c13.3 0 24 10.7 24 24v88h8c13.3 0 24 10.7 24 24s-10.7 24-24 24H216c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z",Ot="M215.7 499.2C267 435 384 279.4 384 192C384 86 298 0 192 0S0 86 0 192c0 87.4 117 243 168.3 307.2c12.3 15.3 35.1 15.3 47.4 0zM192 128a64 64 0 1 1 0 128 64 64 0 1 1 0-128z",At="M225.8 468.2l-2.5-2.3L48.1 303.2C17.4 274.7 0 234.7 0 192.8v-3.3c0-70.4 50-130.8 119.2-144C158.6 37.9 198.9 47 231 69.6c9 6.4 17.4 13.8 25 22.3c4.2-4.8 8.7-9.2 13.5-13.3c3.7-3.2 7.5-6.2 11.5-9c0 0 0 0 0 0C313.1 47 353.4 37.9 392.8 45.4C462 58.6 512 119.1 512 189.5v3.3c0 41.9-17.4 81.9-48.1 110.4L288.7 465.9l-2.5 2.3c-8.2 7.6-19 11.9-30.2 11.9s-22-4.2-30.2-11.9zM239.1 145c-.4-.3-.7-.7-1-1.1l-17.8-20c0 0-.1-.1-.1-.1c0 0 0 0 0 0c-23.1-25.9-58-37.7-92-31.2C81.6 101.5 48 142.1 48 189.5v3.3c0 28.5 11.9 55.8 32.8 75.2L256 430.7 431.2 268c20.9-19.4 32.8-46.7 32.8-75.2v-3.3c0-47.3-33.6-88-80.1-96.9c-34-6.5-69 5.4-92 31.2c0 0 0 0-.1 .1s0 0-.1 .1l-17.8 20c-.3 .4-.7 .7-1 1.1c-4.5 4.5-10.6 7-16.9 7s-12.4-2.5-16.9-7z",yr="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z",It="M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z",Et="M0 336c0 79.5 64.5 144 144 144H512c70.7 0 128-57.3 128-128c0-61.9-44-113.6-102.4-125.4c4.1-10.7 6.4-22.4 6.4-34.6c0-53-43-96-96-96c-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32C167.6 32 96 103.6 96 192c0 2.7 .1 5.4 .2 8.1C40.2 219.8 0 273.2 0 336z",Tt="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM164.1 325.5C182 346.2 212.6 368 256 368s74-21.8 91.9-42.5c5.8-6.7 15.9-7.4 22.6-1.6s7.4 15.9 1.6 22.6C349.8 372.1 311.1 400 256 400s-93.8-27.9-116.1-53.5c-5.8-6.7-5.1-16.8 1.6-22.6s16.8-5.1 22.6 1.6zM144.4 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z",Mt="M48 256C48 141.1 141.1 48 256 48c63.1 0 119.6 28.1 157.8 72.5c8.6 10.1 23.8 11.2 33.8 2.6s11.2-23.8 2.6-33.8C403.3 34.6 333.7 0 256 0C114.6 0 0 114.6 0 256v40c0 13.3 10.7 24 24 24s24-10.7 24-24V256zm458.5-52.9c-2.7-13-15.5-21.3-28.4-18.5s-21.3 15.5-18.5 28.4c2.9 13.9 4.5 28.3 4.5 43.1v40c0 13.3 10.7 24 24 24s24-10.7 24-24V256c0-18.1-1.9-35.8-5.5-52.9zM256 80c-19 0-37.4 3-54.5 8.6c-15.2 5-18.7 23.7-8.3 35.9c7.1 8.3 18.8 10.8 29.4 7.9c10.6-2.9 21.8-4.4 33.4-4.4c70.7 0 128 57.3 128 128v24.9c0 25.2-1.5 50.3-4.4 75.3c-1.7 14.6 9.4 27.8 24.2 27.8c11.8 0 21.9-8.6 23.3-20.3c3.3-27.4 5-55 5-82.7V256c0-97.2-78.8-176-176-176zM150.7 148.7c-9.1-10.6-25.3-11.4-33.9-.4C93.7 178 80 215.4 80 256v24.9c0 24.2-2.6 48.4-7.8 71.9C68.8 368.4 80.1 384 96.1 384c10.5 0 19.9-7 22.2-17.3c6.4-28.1 9.7-56.8 9.7-85.8V256c0-27.2 8.5-52.4 22.9-73.1c7.2-10.4 8-24.6-.2-34.2zM256 160c-53 0-96 43-96 96v24.9c0 35.9-4.6 71.5-13.8 106.1c-3.8 14.3 6.7 29 21.5 29c9.5 0 17.9-6.2 20.4-15.4c10.5-39 15.9-79.2 15.9-119.7V256c0-28.7 23.3-52 52-52s52 23.3 52 52v24.9c0 36.3-3.5 72.4-10.4 107.9c-2.7 13.9 7.7 27.2 21.8 27.2c10.2 0 19-7 21-17c7.7-38.8 11.6-78.3 11.6-118.1V256c0-53-43-96-96-96zm24 96c0-13.3-10.7-24-24-24s-24 10.7-24 24v24.9c0 59.9-11 119.3-32.5 175.2l-5.9 15.3c-4.8 12.4 1.4 26.3 13.8 31s26.3-1.4 31-13.8l5.9-15.3C267.9 411.9 280 346.7 280 280.9V256z",wr="M315.4 15.5C309.7 5.9 299.2 0 288 0s-21.7 5.9-27.4 15.5l-96 160c-5.9 9.9-6.1 22.2-.4 32.2s16.3 16.2 27.8 16.2H384c11.5 0 22.2-6.2 27.8-16.2s5.5-22.3-.4-32.2l-96-160zM288 312V456c0 22.1 17.9 40 40 40H472c22.1 0 40-17.9 40-40V312c0-22.1-17.9-40-40-40H328c-22.1 0-40 17.9-40 40zM128 512a128 128 0 1 0 0-256 128 128 0 1 0 0 256z",Cr="M116.7 219.4a15.7 15.7 0 0 0 22.7 0l96.8-99.8c28.2-29 26.5-77.1-4.9-103.9C203.8-7.7 163-3.5 137.9 22.4L128 32.6l-9.9-10.1C93.1-3.5 52.3-7.7 24.9 15.6c-31.4 26.8-33 74.9-5 103.9zm143.9 100.5h-48l-7.1-14.2a27.4 27.4 0 0 0 -25.7-17.8h-71.7a27.4 27.4 0 0 0 -25.7 17.8l-7 14.2h-48A27.5 27.5 0 0 0 0 347.3v137.3A27.4 27.4 0 0 0 27.4 512h233.1A27.5 27.5 0 0 0 288 484.6V347.3a27.5 27.5 0 0 0 -27.4-27.5zM144 468a52 52 0 1 1 52-52 52 52 0 0 1 -52 52zm355.4-115.9h-60.6l22.4-50.8c2.1-6.7-3.9-13.2-12.2-13.2h-75.6c-6.3 0-11.7 3.9-12.5 9.1l-16.8 106.9c-1 6.3 4.9 11.9 12.5 11.9h62.3l-24.2 83c-1.9 6.7 4.2 12.9 12.2 12.9a13.3 13.3 0 0 0 10.9-5.3l92.4-138.9c4.9-6.9-1.2-15.7-10.9-15.7zM478.1 .3L329.5 23.2C314.9 25.4 304 38.9 304 54.8V161.6a83.3 83.3 0 0 0 -16-1.7c-35.4 0-64 21.5-64 48s28.7 48 64 48c35.2 0 63.7-21.3 64-47.7V99.7l112-17.2v47.2a83.3 83.3 0 0 0 -16-1.7c-35.4 0-64 21.5-64 48s28.7 48 64 48c35.2 0 63.7-21.3 64-47.7V32c0-19.5-16-34.4-33.9-31.7z",Sr="M432 416h-23.4L277.9 53.7A32 32 0 0 0 247.6 32h-47.2a32 32 0 0 0 -30.3 21.7L39.4 416H16a16 16 0 0 0 -16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0 -16-16h-19.6l23.3-64h152.6l23.3 64H304a16 16 0 0 0 -16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0 -16-16zM176.9 272L224 142.5 271.2 272z",kr="M464 32H336c-26.5 0-48 21.5-48 48v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48zm-288 0H48C21.5 32 0 53.5 0 80v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48z",Nr="M608 0H160a32 32 0 0 0 -32 32v96h160V64h192v320h128a32 32 0 0 0 32-32V32a32 32 0 0 0 -32-32zM232 103a9 9 0 0 1 -9 9h-30a9 9 0 0 1 -9-9V73a9 9 0 0 1 9-9h30a9 9 0 0 1 9 9zm352 208a9 9 0 0 1 -9 9h-30a9 9 0 0 1 -9-9v-30a9 9 0 0 1 9-9h30a9 9 0 0 1 9 9zm0-104a9 9 0 0 1 -9 9h-30a9 9 0 0 1 -9-9v-30a9 9 0 0 1 9-9h30a9 9 0 0 1 9 9zm0-104a9 9 0 0 1 -9 9h-30a9 9 0 0 1 -9-9V73a9 9 0 0 1 9-9h30a9 9 0 0 1 9 9zm-168 57H32a32 32 0 0 0 -32 32v288a32 32 0 0 0 32 32h384a32 32 0 0 0 32-32V192a32 32 0 0 0 -32-32zM96 224a32 32 0 1 1 -32 32 32 32 0 0 1 32-32zm288 224H64v-32l64-64 32 32 128-128 96 96z",Or="M0 224h192V32H0v192zM64 96h64v64H64V96zm192-64v192h192V32H256zm128 128h-64V96h64v64zM0 480h192V288H0v192zm64-128h64v64H64v-64zm352-64h32v128h-96v-32h-32v96h-64V288h96v32h64v-32zm0 160h32v32h-32v-32zm-64 0h32v32h-32v-32z",Ar="M0 448V64h18v384H0zm26.9-.3V64H36v383.7h-9.1zm27.1 0V64h8.9v383.7H54zm44.9 0V64h8.9v383.7h-8.9zm36 0V64h17.7v383.7h-17.7zm44.9 0V64h8.9v383.7h-8.9zm18 0V64h8.9v383.7h-8.9zm18 0V64h8.9v383.7h-8.9zm35.7 0V64h18v383.7h-18zm44.9 0V64h18v383.7h-18zm36 0V64h18v383.7h-18zm36 0V64h18v383.7h-18zm26.9 0V64h18v383.7h-18zm45.1 0V64h26.9v383.7h-26.9zm35.7 0V64h9.1v383.7H476zm18 .3V64h18v384h-18z",Ir="M0 180V56c0-13.3 10.7-24 24-24h124c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H64v84c0 6.6-5.4 12-12 12H12c-6.6 0-12-5.4-12-12zM288 44v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12V56c0-13.3-10.7-24-24-24H300c-6.6 0-12 5.4-12 12zm148 276h-40c-6.6 0-12 5.4-12 12v84h-84c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24V332c0-6.6-5.4-12-12-12zM160 468v-40c0-6.6-5.4-12-12-12H64v-84c0-6.6-5.4-12-12-12H12c-6.6 0-12 5.4-12 12v124c0 13.3 10.7 24 24 24h124c6.6 0 12-5.4 12-12z",Lt="M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1 -32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1 -32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1 -32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.7 23.7 0 0 0 -21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0 -16-16z",Er="M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z",Tr="M576 128c0-35.3-28.7-64-64-64H205.3c-17 0-33.3 6.7-45.3 18.7L9.4 233.4c-6 6-9.4 14.1-9.4 22.6s3.4 16.6 9.4 22.6L160 429.3c12 12 28.3 18.7 45.3 18.7H512c35.3 0 64-28.7 64-64V128zM271 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z",Mr="M 6 3.6 V 0 L 0 6 l 6 6 V 8 c 6 -0.27 7.53 3.76 7.88 5.77 a 0.27 0.27 0 0 0 0.53 0 C 17.08 2.86 6 3.6 6 3.6 Z",zr="M352 224c53 0 96-43 96-96s-43-96-96-96s-96 43-96 96c0 4 .2 8 .7 11.9l-94.1 47C145.4 170.2 121.9 160 96 160c-53 0-96 43-96 96s43 96 96 96c25.9 0 49.4-10.2 66.6-26.9l94.1 47c-.5 3.9-.7 7.8-.7 11.9c0 53 43 96 96 96s96-43 96-96s-43-96-96-96c-25.9 0-49.4 10.2-66.6 26.9l-94.1-47c.5-3.9 .7-7.8 .7-11.9s-.2-8-.7-11.9l94.1-47C302.6 213.8 326.1 224 352 224z",Rr="M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32V274.7l-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 274.7V32zM64 352c-35.3 0-64 28.7-64 64v32c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V416c0-35.3-28.7-64-64-64H346.5l-45.3 45.3c-25 25-65.5 25-90.5 0L165.5 352H64zm368 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z",Lr="M254 52.8C249.3 40.3 237.3 32 224 32s-25.3 8.3-30 20.8L57.8 416 32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-1.8 0 18-48 159.6 0 18 48-1.8 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-25.8 0L254 52.8zM279.8 304l-111.6 0L224 155.1 279.8 304z",_r="M448 256c0-106-86-192-192-192l0 384c106 0 192-86 192-192zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z",Br="M256 0L576 0c35.3 0 64 28.7 64 64l0 224c0 35.3-28.7 64-64 64l-320 0c-35.3 0-64-28.7-64-64l0-224c0-35.3 28.7-64 64-64zM476 106.7C471.5 100 464 96 456 96s-15.5 4-20 10.7l-56 84L362.7 169c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6l80 0 48 0 144 0c8.9 0 17-4.9 21.2-12.7s3.7-17.3-1.2-24.6l-96-144zM336 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM64 128l96 0 0 256 0 32c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-32 160 0 0 64c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 192c0-35.3 28.7-64 64-64zm8 64c-8.8 0-16 7.2-16 16l0 16c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-16 0zm0 104c-8.8 0-16 7.2-16 16l0 16c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-16 0zm0 104c-8.8 0-16 7.2-16 16l0 16c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-16 0zm336 16l0 16c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-16 0c-8.8 0-16 7.2-16 16z",Dr="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM184 232l144 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-144 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z",Fr="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM232 344l0-64-64 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l64 0 0-64c0-13.3 10.7-24 24-24s24 10.7 24 24l0 64 64 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-64 0 0 64c0 13.3-10.7 24-24 24s-24-10.7-24-24z",_t="M296 384h-80c-13.3 0-24-10.7-24-24V192h-87.7c-17.8 0-26.7-21.5-14.1-34.1L242.3 5.7c7.5-7.5 19.8-7.5 27.3 0l152.2 152.2c12.6 12.6 3.7 34.1-14.1 34.1H320v168c0 13.3-10.7 24-24 24zm216-8v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h136v8c0 30.9 25.1 56 56 56h80c30.9 0 56-25.1 56-56v-8h136c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z",Pr="M134.1 296H436c6.6 0 12-5.4 12-12v-56c0-6.6-5.4-12-12-12H134.1v-46.1c0-21.4-25.9-32.1-41-17L7 239c-9.4 9.4-9.4 24.6 0 33.9l86.1 86.1c15.1 15.1 41 4.4 41-17V296z",Hr="apcDB",ke="APCObjectStore",Vr=1;function ot(){return new Promise((m,r)=>{const n=indexedDB.open(Hr,Vr);n.onupgradeneeded=function(c){let a=c.target.result,d;a.objectStoreNames.contains(ke)?d=n.transaction.objectStore(ke):d=a.createObjectStore(ke,{keyPath:"id"}),d.indexNames.contains("nameIndex")||d.createIndex("nameIndex","name",{unique:!1})},n.onsuccess=function(c){m(c.target.result)},n.onerror=function(c){r("Database error: "+c.target.errorCode)}})}function He(m,r,n,c){return ot().then(a=>new Promise((d,x)=>{const h=a.transaction(["APCObjectStore"],"readwrite"),j=h.objectStore("APCObjectStore"),o={id:m,classification:r,content:n,misc:c},v=j.put(o);v.onsuccess=()=>d(v.result),v.onerror=()=>x(v.error),h.oncomplete=()=>a.close()}))}function Ke(m){return ot().then(r=>new Promise((n,c)=>{const a=r.transaction([ke],"readonly"),x=a.objectStore(ke).get(m);x.onsuccess=()=>n(x.result),x.onerror=()=>c(x.error),a.oncomplete=()=>r.close()}))}function Ur(m){return ot().then(r=>new Promise((n,c)=>{const a=r.transaction([ke],"readwrite"),x=a.objectStore(ke).delete(m);x.onsuccess=()=>n(),x.onerror=()=>c(x.error),a.oncomplete=()=>r.close()}))}function Te(m=null){return ot().then(r=>new Promise((n,c)=>{const a=r.transaction([ke],"readonly"),x=a.objectStore(ke).openCursor(),h=[];x.onsuccess=j=>{const o=j.target.result;o?((!m||m(o.value))&&h.push(o.value),o.continue()):n(h)},x.onerror=j=>{c("Failed to retrieve items: "+j.target.errorCode)},a.oncomplete=()=>{r.close()}}))}function Wr(m){const{currentTabNo:r,theme:n,apcCanvasInstance:c,apiEndpoint:a,reloadTabs:d,updateActiveSection:x,initCategory:h,initInstance:j,apiKey:o,setActiveTab:v}=m,[u,w]=p.useState(),[i,y]=p.useState(h||"Hats"),[f,b]=p.useState(!1),[s,k]=p.useState(),_=`${a}/api/v1/designer`;p.useEffect(()=>{T()},[]),p.useEffect(()=>{c&&j&&j.fabricID&&R(j.fabricID)},[j]);const T=()=>{b(!0);const z=`${_}/search-designs-images/${i}`;ve.get(z).then(I=>{b(!1),I.data.object.length>0?w(I.data):k("No matching results found")}).catch(I=>{b(!1),console.error("Error fetching data:",I)})},R=z=>{const I=_+"/find-public-design/"+z;ve.get(I).then(H=>{const{object:X}=H==null?void 0:H.data;X&&(window.location.href=`/design-center/${X.pdid}`)}).catch(H=>{console.error("Error fetching data:",H)})},P=()=>u?u.object.map((z,I)=>e.jsx(p.Fragment,{children:e.jsxs("div",{style:{position:"relative",backgroundColor:"#ffffff",boxShadow:"0 4px 8px rgba(0, 0, 0, 0.1)",borderRadius:"2px",overflow:"hidden",marginBottom:"9px"},tabIndex:0,className:"apc-mpx-widget-responsive-image-container",onClick:()=>R(z.fabricID),children:[e.jsxs("div",{style:{position:"absolute",top:0,right:0,backgroundColor:n.secondaryColor,padding:"5px",zIndex:1,color:"#ffffff"},children:["$",z.product.price]}),e.jsx("img",{src:z.imageURL,alt:z.description,className:"apc-mpx-widget-responsive-image"}),e.jsx("div",{children:z.product.name})]})},I)):null;return e.jsxs(p.Fragment,{children:[e.jsx("br",{}),e.jsxs("div",{style:{display:"flex",flexDirection:"row"},children:[e.jsx("div",{children:e.jsx("input",{placeholder:"Search templates",type:"text",onChange:z=>y(z.target.value),className:"apc-mpc-widget-input",style:{border:`solid 3px ${n.primaryColor}`,height:"40px"}})}),e.jsx("div",{children:e.jsx("button",{className:"apc-mpc-widget-btn",onClick:()=>T(),style:{backgroundColor:n.primaryColor,color:"#ffffff",height:"35px"},children:f?"...Processing":"Search"})})]}),s?e.jsxs("div",{style:{color:"orangered",fontWeight:"bold"},children:[e.jsx("br",{}),s]}):null,e.jsx("br",{})," ",e.jsx("br",{})," ",e.jsx("br",{}),P()]})}const $r={fontFamily:"Arial",fontSize:"40px",color:"transparent",background:"linear-gradient(to bottom, red 0%, yellow 100%)",WebkitBackgroundClip:"text",backgroundClip:"text",cursor:"pointer"},Jr={fontFamily:"comic sans ms",fontSize:"40px",color:"#000",width:"300px",textShadow:`
30
+ <%s key={someKey} {...props} />`,gt,We,Gt,We),vt[We+gt]=!0}}return t===a?Oe(Z):Ne(Z),Z}}function Ut(t,g,S){return jt(t,g,S,!0)}function Wt(t,g,S){return jt(t,g,S,!1)}var $t=Wt,Jt=Ut;at.Fragment=a,at.jsx=$t,at.jsxs=Jt}()),at}var Ct;function cr(){return Ct||(Ct=1,process.env.NODE_ENV==="production"?dt.exports=ir():dt.exports=or()),dt.exports}var e=cr();const ar={primaryColor:"#f88300",primaryColorLight:"#6858c1",secondaryColor:"#005a53",tertiaryColor:"#FFFFFF"},lr="M80 160c0-35.3 28.7-64 64-64h32c35.3 0 64 28.7 64 64v3.6c0 21.8-11.1 42.1-29.4 53.8l-42.2 27.1c-25.2 16.2-40.4 44.1-40.4 74V320c0 17.7 14.3 32 32 32s32-14.3 32-32v-1.4c0-8.2 4.2-15.8 11-20.2l42.2-27.1c36.6-23.6 58.8-64.1 58.8-107.7V160c0-70.7-57.3-128-128-128H144C73.3 32 16 89.3 16 160c0 17.7 14.3 32 32 32s32-14.3 32-32zm80 320a40 40 0 1 0 0-80 40 40 0 1 0 0 80z",dr="M164.9 24.6c-7.7-18.6-28-28.5-47.4-23.2l-88 24C12.1 30.2 0 46 0 64C0 311.4 200.6 512 448 512c18 0 33.8-12.1 38.6-29.5l24-88c5.3-19.4-4.6-39.7-23.2-47.4l-96-40c-16.3-6.8-35.2-2.1-46.3 11.6L304.7 368C234.3 334.7 177.3 277.7 144 207.3L193.3 167c13.7-11.2 18.4-30 11.6-46.3l-40-96z",pr="M464 256A208 208 0 1 1 48 256a208 208 0 1 1 416 0zM0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM232 120V256c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2V120c0-13.3-10.7-24-24-24s-24 10.7-24 24z",hr="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z",ur="M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z",fr="M160 64c0-8.8 7.2-16 16-16s16 7.2 16 16V200c0 10.3 6.6 19.5 16.4 22.8s20.6-.1 26.8-8.3c3-3.9 7.6-6.4 12.8-6.4c8.8 0 16 7.2 16 16c0 10.3 6.6 19.5 16.4 22.8s20.6-.1 26.8-8.3c3-3.9 7.6-6.4 12.8-6.4c7.8 0 14.3 5.6 15.7 13c1.6 8.2 7.3 15.1 15.1 18s16.7 1.6 23.3-3.6c2.7-2.1 6.1-3.4 9.9-3.4c8.8 0 16 7.2 16 16l0 16V392c0 39.8-32.2 72-72 72H272 212.3h-.9c-37.4 0-72.4-18.7-93.2-49.9L50.7 312.9c-4.9-7.4-2.9-17.3 4.4-22.2s17.3-2.9 22.2 4.4L116 353.2c5.9 8.8 16.8 12.7 26.9 9.7s17-12.4 17-23V320 64zM176 0c-35.3 0-64 28.7-64 64V261.7C91.2 238 55.5 232.8 28.5 250.7C-.9 270.4-8.9 310.1 10.8 339.5L78.3 440.8c29.7 44.5 79.6 71.2 133.1 71.2h.9H272h56c66.3 0 120-53.7 120-120V288l0-16c0-35.3-28.7-64-64-64c-4.5 0-8.8 .5-13 1.3c-11.7-15.4-30.2-25.3-51-25.3c-6.9 0-13.5 1.1-19.7 3.1C288.7 170.7 269.6 160 248 160c-2.7 0-5.4 .2-8 .5V64c0-35.3-28.7-64-64-64zm48 304c0-8.8-7.2-16-16-16s-16 7.2-16 16v96c0 8.8 7.2 16 16 16s16-7.2 16-16V304zm48-16c-8.8 0-16 7.2-16 16v96c0 8.8 7.2 16 16 16s16-7.2 16-16V304c0-8.8-7.2-16-16-16zm80 16c0-8.8-7.2-16-16-16s-16 7.2-16 16v96c0 8.8 7.2 16 16 16s16-7.2 16-16V304z",xr="M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48H48zM0 176V384c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V176L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z",gr="M160 0c17.7 0 32 14.3 32 32V67.7c1.6 .2 3.1 .4 4.7 .7c.4 .1 .7 .1 1.1 .2l48 8.8c17.4 3.2 28.9 19.9 25.7 37.2s-19.9 28.9-37.2 25.7l-47.5-8.7c-31.3-4.6-58.9-1.5-78.3 6.2s-27.2 18.3-29 28.1c-2 10.7-.5 16.7 1.2 20.4c1.8 3.9 5.5 8.3 12.8 13.2c16.3 10.7 41.3 17.7 73.7 26.3l2.9 .8c28.6 7.6 63.6 16.8 89.6 33.8c14.2 9.3 27.6 21.9 35.9 39.5c8.5 17.9 10.3 37.9 6.4 59.2c-6.9 38-33.1 63.4-65.6 76.7c-13.7 5.6-28.6 9.2-44.4 11V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V445.1c-.4-.1-.9-.1-1.3-.2l-.2 0 0 0c-24.4-3.8-64.5-14.3-91.5-26.3c-16.1-7.2-23.4-26.1-16.2-42.2s26.1-23.4 42.2-16.2c20.9 9.3 55.3 18.5 75.2 21.6c31.9 4.7 58.2 2 76-5.3c16.9-6.9 24.6-16.9 26.8-28.9c1.9-10.6 .4-16.7-1.3-20.4c-1.9-4-5.6-8.4-13-13.3c-16.4-10.7-41.5-17.7-74-26.3l-2.8-.7 0 0C119.4 279.3 84.4 270 58.4 253c-14.2-9.3-27.5-22-35.8-39.6c-8.4-17.9-10.1-37.9-6.1-59.2C23.7 116 52.3 91.2 84.8 78.3c13.3-5.3 27.9-8.9 43.2-11V32c0-17.7 14.3-32 32-32z",St="M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9L464.4 300.4c30.4-28.3 47.6-68 47.6-109.5v-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1v5.8c0 41.5 17.2 81.2 47.6 109.5z",kt="M234.5 5.7c13.9-5 29.1-5 43.1 0l192 68.6C495 83.4 512 107.5 512 134.6V377.4c0 27-17 51.2-42.5 60.3l-192 68.6c-13.9 5-29.1 5-43.1 0l-192-68.6C17 428.6 0 404.5 0 377.4V134.6c0-27 17-51.2 42.5-60.3l192-68.6zM256 66L82.3 128 256 190l173.7-62L256 66zm32 368.6l160-57.1v-188L288 246.6v188z",mt="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z",Nt="M320 32c-8.1 0-16.1 1.4-23.7 4.1L15.8 137.4C6.3 140.9 0 149.9 0 160s6.3 19.1 15.8 22.6l57.9 20.9C57.3 229.3 48 259.8 48 291.9v28.1c0 28.4-10.8 57.7-22.3 80.8c-6.5 13-13.9 25.8-22.5 37.6C0 442.7-.9 448.3 .9 453.4s6 8.9 11.2 10.2l64 16c4.2 1.1 8.7 .3 12.4-2s6.3-6.1 7.1-10.4c8.6-42.8 4.3-81.2-2.1-108.7C90.3 344.3 86 329.8 80 316.5V291.9c0-30.2 10.2-58.7 27.9-81.5c12.9-15.5 29.6-28 49.2-35.7l157-61.7c8.2-3.2 17.5 .8 20.7 9s-.8 17.5-9 20.7l-157 61.7c-12.4 4.9-23.3 12.4-32.2 21.6l159.6 57.6c7.6 2.7 15.6 4.1 23.7 4.1s16.1-1.4 23.7-4.1L624.2 182.6c9.5-3.4 15.8-12.5 15.8-22.6s-6.3-19.1-15.8-22.6L343.7 36.1C336.1 33.4 328.1 32 320 32zM128 408c0 35.3 86 72 192 72s192-36.7 192-72L496.7 262.6 354.5 314c-11.1 4-22.8 6-34.5 6s-23.5-2-34.5-6L143.3 262.6 128 408z",mr="M184 48H328c4.4 0 8 3.6 8 8V96H176V56c0-4.4 3.6-8 8-8zm-56 8V96H64C28.7 96 0 124.7 0 160v96H192 352h8.2c32.3-39.1 81.1-64 135.8-64c5.4 0 10.7 .2 16 .7V160c0-35.3-28.7-64-64-64H384V56c0-30.9-25.1-56-56-56H184c-30.9 0-56 25.1-56 56zM320 352H224c-17.7 0-32-14.3-32-32V288H0V416c0 35.3 28.7 64 64 64H360.2C335.1 449.6 320 410.5 320 368c0-5.4 .2-10.7 .7-16l-.7 0zm320 16a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zM496 288c8.8 0 16 7.2 16 16v48h32c8.8 0 16 7.2 16 16s-7.2 16-16 16H496c-8.8 0-16-7.2-16-16V304c0-8.8 7.2-16 16-16z",vr="M88.2 309.1c9.8-18.3 6.8-40.8-7.5-55.8C59.4 230.9 48 204 48 176c0-63.5 63.8-128 160-128s160 64.5 160 128s-63.8 128-160 128c-13.1 0-25.8-1.3-37.8-3.6c-10.4-2-21.2-.6-30.7 4.2c-4.1 2.1-8.3 4.1-12.6 6c-16 7.2-32.9 13.5-49.9 18c2.8-4.6 5.4-9.1 7.9-13.6c1.1-1.9 2.2-3.9 3.2-5.9zM0 176c0 41.8 17.2 80.1 45.9 110.3c-.9 1.7-1.9 3.5-2.8 5.1c-10.3 18.4-22.3 36.5-36.6 52.1c-6.6 7-8.3 17.2-4.6 25.9C5.8 378.3 14.4 384 24 384c43 0 86.5-13.3 122.7-29.7c4.8-2.2 9.6-4.5 14.2-6.8c15.1 3 30.9 4.5 47.1 4.5c114.9 0 208-78.8 208-176S322.9 0 208 0S0 78.8 0 176zM432 480c16.2 0 31.9-1.6 47.1-4.5c4.6 2.3 9.4 4.6 14.2 6.8C529.5 498.7 573 512 616 512c9.6 0 18.2-5.7 22-14.5c3.8-8.8 2-19-4.6-25.9c-14.2-15.6-26.2-33.7-36.6-52.1c-.9-1.7-1.9-3.4-2.8-5.1C622.8 384.1 640 345.8 640 304c0-94.4-87.9-171.5-198.2-175.8c4.1 15.2 6.2 31.2 6.2 47.8l0 .6c87.2 6.7 144 67.5 144 127.4c0 28-11.4 54.9-32.7 77.2c-14.3 15-17.3 37.6-7.5 55.8c1.1 2 2.2 4 3.2 5.9c2.5 4.5 5.2 9 7.9 13.6c-17-4.5-33.9-10.7-49.9-18c-4.3-1.9-8.5-3.9-12.6-6c-9.5-4.8-20.3-6.2-30.7-4.2c-12.1 2.4-24.7 3.6-37.8 3.6c-61.7 0-110-26.5-136.8-62.3c-16 5.4-32.8 9.4-50 11.8C279 439.8 350 480 432 480z",jr="M323.8 34.8c-38.2-10.9-78.1 11.2-89 49.4l-5.7 20c-3.7 13-10.4 25-19.5 35l-51.3 56.4c-8.9 9.8-8.2 25 1.6 33.9s25 8.2 33.9-1.6l51.3-56.4c14.1-15.5 24.4-34 30.1-54.1l5.7-20c3.6-12.7 16.9-20.1 29.7-16.5s20.1 16.9 16.5 29.7l-5.7 20c-5.7 19.9-14.7 38.7-26.6 55.5c-5.2 7.3-5.8 16.9-1.7 24.9s12.3 13 21.3 13L448 224c8.8 0 16 7.2 16 16c0 6.8-4.3 12.7-10.4 15c-7.4 2.8-13 9-14.9 16.7s.1 15.8 5.3 21.7c2.5 2.8 4 6.5 4 10.6c0 7.8-5.6 14.3-13 15.7c-8.2 1.6-15.1 7.3-18 15.1s-1.6 16.7 3.6 23.3c2.1 2.7 3.4 6.1 3.4 9.9c0 6.7-4.2 12.6-10.2 14.9c-11.5 4.5-17.7 16.9-14.4 28.8c.4 1.3 .6 2.8 .6 4.3c0 8.8-7.2 16-16 16H286.5c-12.6 0-25-3.7-35.5-10.7l-61.7-41.1c-11-7.4-25.9-4.4-33.3 6.7s-4.4 25.9 6.7 33.3l61.7 41.1c18.4 12.3 40 18.8 62.1 18.8H384c34.7 0 62.9-27.6 64-62c14.6-11.7 24-29.7 24-50c0-4.5-.5-8.8-1.3-13c15.4-11.7 25.3-30.2 25.3-51c0-6.5-1-12.8-2.8-18.7C504.8 273.7 512 257.7 512 240c0-35.3-28.6-64-64-64l-92.3 0c4.7-10.4 8.7-21.2 11.8-32.2l5.7-20c10.9-38.2-11.2-78.1-49.4-89zM32 192c-17.7 0-32 14.3-32 32V448c0 17.7 14.3 32 32 32H96c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32H32z",br="M54.2 202.9C123.2 136.7 216.8 96 320 96s196.8 40.7 265.8 106.9c12.8 12.2 33 11.8 45.2-.9s11.8-33-.9-45.2C549.7 79.5 440.4 32 320 32S90.3 79.5 9.8 156.7C-2.9 169-3.3 189.2 8.9 202s32.5 13.2 45.2 .9zM320 256c56.8 0 108.6 21.1 148.2 56c13.3 11.7 33.5 10.4 45.2-2.8s10.4-33.5-2.8-45.2C459.8 219.2 393 192 320 192s-139.8 27.2-190.5 72c-13.3 11.7-14.5 31.9-2.8 45.2s31.9 14.5 45.2 2.8c39.5-34.9 91.3-56 148.2-56zm64 160a64 64 0 1 0 -128 0 64 64 0 1 0 128 0z",Ot="M123.6 391.3c12.9-9.4 29.6-11.8 44.6-6.4c26.5 9.6 56.2 15.1 87.8 15.1c124.7 0 208-80.5 208-160s-83.3-160-208-160S48 160.5 48 240c0 32 12.4 62.8 35.7 89.2c8.6 9.7 12.8 22.5 11.8 35.5c-1.4 18.1-5.7 34.7-11.3 49.4c17-7.9 31.1-16.7 39.4-22.7zM21.2 431.9c1.8-2.7 3.5-5.4 5.1-8.1c10-16.6 19.5-38.4 21.4-62.9C17.7 326.8 0 285.1 0 240C0 125.1 114.6 32 256 32s256 93.1 256 208s-114.6 208-256 208c-37.1 0-72.3-6.4-104.1-17.9c-11.9 8.7-31.3 20.6-54.3 30.6c-15.1 6.6-32.3 12.6-50.1 16.1c-.8 .2-1.6 .3-2.4 .5c-4.4 .8-8.7 1.5-13.2 1.9c-.2 0-.5 .1-.7 .1c-5.1 .5-10.2 .8-15.3 .8c-6.5 0-12.3-3.9-14.8-9.9c-2.5-6-1.1-12.8 3.4-17.4c4.1-4.2 7.8-8.7 11.3-13.5c1.7-2.3 3.3-4.6 4.8-6.9c.1-.2 .2-.3 .3-.5z",At="M0 24C0 10.7 10.7 0 24 0H69.5c22 0 41.5 12.8 50.6 32h411c26.3 0 45.5 25 38.6 50.4l-41 152.3c-8.5 31.4-37 53.3-69.5 53.3H170.7l5.4 28.5c2.2 11.3 12.1 19.5 23.6 19.5H488c13.3 0 24 10.7 24 24s-10.7 24-24 24H199.7c-34.6 0-64.3-24.6-70.7-58.5L77.4 54.5c-.7-3.8-4-6.5-7.9-6.5H24C10.7 48 0 37.3 0 24zM128 464a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm336-48a48 48 0 1 1 0 96 48 48 0 1 1 0-96z",It="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336h24V272H216c-13.3 0-24-10.7-24-24s10.7-24 24-24h48c13.3 0 24 10.7 24 24v88h8c13.3 0 24 10.7 24 24s-10.7 24-24 24H216c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z",Et="M215.7 499.2C267 435 384 279.4 384 192C384 86 298 0 192 0S0 86 0 192c0 87.4 117 243 168.3 307.2c12.3 15.3 35.1 15.3 47.4 0zM192 128a64 64 0 1 1 0 128 64 64 0 1 1 0-128z",Tt="M225.8 468.2l-2.5-2.3L48.1 303.2C17.4 274.7 0 234.7 0 192.8v-3.3c0-70.4 50-130.8 119.2-144C158.6 37.9 198.9 47 231 69.6c9 6.4 17.4 13.8 25 22.3c4.2-4.8 8.7-9.2 13.5-13.3c3.7-3.2 7.5-6.2 11.5-9c0 0 0 0 0 0C313.1 47 353.4 37.9 392.8 45.4C462 58.6 512 119.1 512 189.5v3.3c0 41.9-17.4 81.9-48.1 110.4L288.7 465.9l-2.5 2.3c-8.2 7.6-19 11.9-30.2 11.9s-22-4.2-30.2-11.9zM239.1 145c-.4-.3-.7-.7-1-1.1l-17.8-20c0 0-.1-.1-.1-.1c0 0 0 0 0 0c-23.1-25.9-58-37.7-92-31.2C81.6 101.5 48 142.1 48 189.5v3.3c0 28.5 11.9 55.8 32.8 75.2L256 430.7 431.2 268c20.9-19.4 32.8-46.7 32.8-75.2v-3.3c0-47.3-33.6-88-80.1-96.9c-34-6.5-69 5.4-92 31.2c0 0 0 0-.1 .1s0 0-.1 .1l-17.8 20c-.3 .4-.7 .7-1 1.1c-4.5 4.5-10.6 7-16.9 7s-12.4-2.5-16.9-7z",yr="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z",zt="M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z",Mt="M0 336c0 79.5 64.5 144 144 144H512c70.7 0 128-57.3 128-128c0-61.9-44-113.6-102.4-125.4c4.1-10.7 6.4-22.4 6.4-34.6c0-53-43-96-96-96c-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32C167.6 32 96 103.6 96 192c0 2.7 .1 5.4 .2 8.1C40.2 219.8 0 273.2 0 336z",Rt="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM164.1 325.5C182 346.2 212.6 368 256 368s74-21.8 91.9-42.5c5.8-6.7 15.9-7.4 22.6-1.6s7.4 15.9 1.6 22.6C349.8 372.1 311.1 400 256 400s-93.8-27.9-116.1-53.5c-5.8-6.7-5.1-16.8 1.6-22.6s16.8-5.1 22.6 1.6zM144.4 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z",Lt="M48 256C48 141.1 141.1 48 256 48c63.1 0 119.6 28.1 157.8 72.5c8.6 10.1 23.8 11.2 33.8 2.6s11.2-23.8 2.6-33.8C403.3 34.6 333.7 0 256 0C114.6 0 0 114.6 0 256v40c0 13.3 10.7 24 24 24s24-10.7 24-24V256zm458.5-52.9c-2.7-13-15.5-21.3-28.4-18.5s-21.3 15.5-18.5 28.4c2.9 13.9 4.5 28.3 4.5 43.1v40c0 13.3 10.7 24 24 24s24-10.7 24-24V256c0-18.1-1.9-35.8-5.5-52.9zM256 80c-19 0-37.4 3-54.5 8.6c-15.2 5-18.7 23.7-8.3 35.9c7.1 8.3 18.8 10.8 29.4 7.9c10.6-2.9 21.8-4.4 33.4-4.4c70.7 0 128 57.3 128 128v24.9c0 25.2-1.5 50.3-4.4 75.3c-1.7 14.6 9.4 27.8 24.2 27.8c11.8 0 21.9-8.6 23.3-20.3c3.3-27.4 5-55 5-82.7V256c0-97.2-78.8-176-176-176zM150.7 148.7c-9.1-10.6-25.3-11.4-33.9-.4C93.7 178 80 215.4 80 256v24.9c0 24.2-2.6 48.4-7.8 71.9C68.8 368.4 80.1 384 96.1 384c10.5 0 19.9-7 22.2-17.3c6.4-28.1 9.7-56.8 9.7-85.8V256c0-27.2 8.5-52.4 22.9-73.1c7.2-10.4 8-24.6-.2-34.2zM256 160c-53 0-96 43-96 96v24.9c0 35.9-4.6 71.5-13.8 106.1c-3.8 14.3 6.7 29 21.5 29c9.5 0 17.9-6.2 20.4-15.4c10.5-39 15.9-79.2 15.9-119.7V256c0-28.7 23.3-52 52-52s52 23.3 52 52v24.9c0 36.3-3.5 72.4-10.4 107.9c-2.7 13.9 7.7 27.2 21.8 27.2c10.2 0 19-7 21-17c7.7-38.8 11.6-78.3 11.6-118.1V256c0-53-43-96-96-96zm24 96c0-13.3-10.7-24-24-24s-24 10.7-24 24v24.9c0 59.9-11 119.3-32.5 175.2l-5.9 15.3c-4.8 12.4 1.4 26.3 13.8 31s26.3-1.4 31-13.8l5.9-15.3C267.9 411.9 280 346.7 280 280.9V256z",wr="M315.4 15.5C309.7 5.9 299.2 0 288 0s-21.7 5.9-27.4 15.5l-96 160c-5.9 9.9-6.1 22.2-.4 32.2s16.3 16.2 27.8 16.2H384c11.5 0 22.2-6.2 27.8-16.2s5.5-22.3-.4-32.2l-96-160zM288 312V456c0 22.1 17.9 40 40 40H472c22.1 0 40-17.9 40-40V312c0-22.1-17.9-40-40-40H328c-22.1 0-40 17.9-40 40zM128 512a128 128 0 1 0 0-256 128 128 0 1 0 0 256z",Cr="M116.7 219.4a15.7 15.7 0 0 0 22.7 0l96.8-99.8c28.2-29 26.5-77.1-4.9-103.9C203.8-7.7 163-3.5 137.9 22.4L128 32.6l-9.9-10.1C93.1-3.5 52.3-7.7 24.9 15.6c-31.4 26.8-33 74.9-5 103.9zm143.9 100.5h-48l-7.1-14.2a27.4 27.4 0 0 0 -25.7-17.8h-71.7a27.4 27.4 0 0 0 -25.7 17.8l-7 14.2h-48A27.5 27.5 0 0 0 0 347.3v137.3A27.4 27.4 0 0 0 27.4 512h233.1A27.5 27.5 0 0 0 288 484.6V347.3a27.5 27.5 0 0 0 -27.4-27.5zM144 468a52 52 0 1 1 52-52 52 52 0 0 1 -52 52zm355.4-115.9h-60.6l22.4-50.8c2.1-6.7-3.9-13.2-12.2-13.2h-75.6c-6.3 0-11.7 3.9-12.5 9.1l-16.8 106.9c-1 6.3 4.9 11.9 12.5 11.9h62.3l-24.2 83c-1.9 6.7 4.2 12.9 12.2 12.9a13.3 13.3 0 0 0 10.9-5.3l92.4-138.9c4.9-6.9-1.2-15.7-10.9-15.7zM478.1 .3L329.5 23.2C314.9 25.4 304 38.9 304 54.8V161.6a83.3 83.3 0 0 0 -16-1.7c-35.4 0-64 21.5-64 48s28.7 48 64 48c35.2 0 63.7-21.3 64-47.7V99.7l112-17.2v47.2a83.3 83.3 0 0 0 -16-1.7c-35.4 0-64 21.5-64 48s28.7 48 64 48c35.2 0 63.7-21.3 64-47.7V32c0-19.5-16-34.4-33.9-31.7z",Sr="M432 416h-23.4L277.9 53.7A32 32 0 0 0 247.6 32h-47.2a32 32 0 0 0 -30.3 21.7L39.4 416H16a16 16 0 0 0 -16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0 -16-16h-19.6l23.3-64h152.6l23.3 64H304a16 16 0 0 0 -16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0 -16-16zM176.9 272L224 142.5 271.2 272z",kr="M464 32H336c-26.5 0-48 21.5-48 48v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48zm-288 0H48C21.5 32 0 53.5 0 80v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48z",Nr="M608 0H160a32 32 0 0 0 -32 32v96h160V64h192v320h128a32 32 0 0 0 32-32V32a32 32 0 0 0 -32-32zM232 103a9 9 0 0 1 -9 9h-30a9 9 0 0 1 -9-9V73a9 9 0 0 1 9-9h30a9 9 0 0 1 9 9zm352 208a9 9 0 0 1 -9 9h-30a9 9 0 0 1 -9-9v-30a9 9 0 0 1 9-9h30a9 9 0 0 1 9 9zm0-104a9 9 0 0 1 -9 9h-30a9 9 0 0 1 -9-9v-30a9 9 0 0 1 9-9h30a9 9 0 0 1 9 9zm0-104a9 9 0 0 1 -9 9h-30a9 9 0 0 1 -9-9V73a9 9 0 0 1 9-9h30a9 9 0 0 1 9 9zm-168 57H32a32 32 0 0 0 -32 32v288a32 32 0 0 0 32 32h384a32 32 0 0 0 32-32V192a32 32 0 0 0 -32-32zM96 224a32 32 0 1 1 -32 32 32 32 0 0 1 32-32zm288 224H64v-32l64-64 32 32 128-128 96 96z",Or="M0 224h192V32H0v192zM64 96h64v64H64V96zm192-64v192h192V32H256zm128 128h-64V96h64v64zM0 480h192V288H0v192zm64-128h64v64H64v-64zm352-64h32v128h-96v-32h-32v96h-64V288h96v32h64v-32zm0 160h32v32h-32v-32zm-64 0h32v32h-32v-32z",Ar="M0 448V64h18v384H0zm26.9-.3V64H36v383.7h-9.1zm27.1 0V64h8.9v383.7H54zm44.9 0V64h8.9v383.7h-8.9zm36 0V64h17.7v383.7h-17.7zm44.9 0V64h8.9v383.7h-8.9zm18 0V64h8.9v383.7h-8.9zm18 0V64h8.9v383.7h-8.9zm35.7 0V64h18v383.7h-18zm44.9 0V64h18v383.7h-18zm36 0V64h18v383.7h-18zm36 0V64h18v383.7h-18zm26.9 0V64h18v383.7h-18zm45.1 0V64h26.9v383.7h-26.9zm35.7 0V64h9.1v383.7H476zm18 .3V64h18v384h-18z",Ir="M0 180V56c0-13.3 10.7-24 24-24h124c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H64v84c0 6.6-5.4 12-12 12H12c-6.6 0-12-5.4-12-12zM288 44v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12V56c0-13.3-10.7-24-24-24H300c-6.6 0-12 5.4-12 12zm148 276h-40c-6.6 0-12 5.4-12 12v84h-84c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24V332c0-6.6-5.4-12-12-12zM160 468v-40c0-6.6-5.4-12-12-12H64v-84c0-6.6-5.4-12-12-12H12c-6.6 0-12 5.4-12 12v124c0 13.3 10.7 24 24 24h124c6.6 0 12-5.4 12-12z",Dt="M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1 -32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1 -32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1 -32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.7 23.7 0 0 0 -21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0 -16-16z",Er="M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z",Tr="M576 128c0-35.3-28.7-64-64-64H205.3c-17 0-33.3 6.7-45.3 18.7L9.4 233.4c-6 6-9.4 14.1-9.4 22.6s3.4 16.6 9.4 22.6L160 429.3c12 12 28.3 18.7 45.3 18.7H512c35.3 0 64-28.7 64-64V128zM271 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z",zr="M 6 3.6 V 0 L 0 6 l 6 6 V 8 c 6 -0.27 7.53 3.76 7.88 5.77 a 0.27 0.27 0 0 0 0.53 0 C 17.08 2.86 6 3.6 6 3.6 Z",Mr="M352 224c53 0 96-43 96-96s-43-96-96-96s-96 43-96 96c0 4 .2 8 .7 11.9l-94.1 47C145.4 170.2 121.9 160 96 160c-53 0-96 43-96 96s43 96 96 96c25.9 0 49.4-10.2 66.6-26.9l94.1 47c-.5 3.9-.7 7.8-.7 11.9c0 53 43 96 96 96s96-43 96-96s-43-96-96-96c-25.9 0-49.4 10.2-66.6 26.9l-94.1-47c.5-3.9 .7-7.8 .7-11.9s-.2-8-.7-11.9l94.1-47C302.6 213.8 326.1 224 352 224z",Rr="M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32V274.7l-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 274.7V32zM64 352c-35.3 0-64 28.7-64 64v32c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V416c0-35.3-28.7-64-64-64H346.5l-45.3 45.3c-25 25-65.5 25-90.5 0L165.5 352H64zm368 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z",Lr="M254 52.8C249.3 40.3 237.3 32 224 32s-25.3 8.3-30 20.8L57.8 416 32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-1.8 0 18-48 159.6 0 18 48-1.8 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-25.8 0L254 52.8zM279.8 304l-111.6 0L224 155.1 279.8 304z",_r="M448 256c0-106-86-192-192-192l0 384c106 0 192-86 192-192zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z",Br="M256 0L576 0c35.3 0 64 28.7 64 64l0 224c0 35.3-28.7 64-64 64l-320 0c-35.3 0-64-28.7-64-64l0-224c0-35.3 28.7-64 64-64zM476 106.7C471.5 100 464 96 456 96s-15.5 4-20 10.7l-56 84L362.7 169c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6l80 0 48 0 144 0c8.9 0 17-4.9 21.2-12.7s3.7-17.3-1.2-24.6l-96-144zM336 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM64 128l96 0 0 256 0 32c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-32 160 0 0 64c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 192c0-35.3 28.7-64 64-64zm8 64c-8.8 0-16 7.2-16 16l0 16c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-16 0zm0 104c-8.8 0-16 7.2-16 16l0 16c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-16 0zm0 104c-8.8 0-16 7.2-16 16l0 16c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-16 0zm336 16l0 16c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-16 0c-8.8 0-16 7.2-16 16z",Dr="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM184 232l144 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-144 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z",Fr="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM232 344l0-64-64 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l64 0 0-64c0-13.3 10.7-24 24-24s24 10.7 24 24l0 64 64 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-64 0 0 64c0 13.3-10.7 24-24 24s-24-10.7-24-24z",Ft="M296 384h-80c-13.3 0-24-10.7-24-24V192h-87.7c-17.8 0-26.7-21.5-14.1-34.1L242.3 5.7c7.5-7.5 19.8-7.5 27.3 0l152.2 152.2c12.6 12.6 3.7 34.1-14.1 34.1H320v168c0 13.3-10.7 24-24 24zm216-8v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h136v8c0 30.9 25.1 56 56 56h80c30.9 0 56-25.1 56-56v-8h136c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z",Hr="M134.1 296H436c6.6 0 12-5.4 12-12v-56c0-6.6-5.4-12-12-12H134.1v-46.1c0-21.4-25.9-32.1-41-17L7 239c-9.4 9.4-9.4 24.6 0 33.9l86.1 86.1c15.1 15.1 41 4.4 41-17V296z",Pr="apcDB",Ae="APCObjectStore",Vr=1;function ht(){return new Promise((m,r)=>{const n=indexedDB.open(Pr,Vr);n.onupgradeneeded=function(a){let l=a.target.result,d;l.objectStoreNames.contains(Ae)?d=n.transaction.objectStore(Ae):d=l.createObjectStore(Ae,{keyPath:"id"}),d.indexNames.contains("nameIndex")||d.createIndex("nameIndex","name",{unique:!1})},n.onsuccess=function(a){m(a.target.result)},n.onerror=function(a){r("Database error: "+a.target.errorCode)}})}function $e(m,r,n,a){return ht().then(l=>new Promise((d,x)=>{const p=l.transaction(["APCObjectStore"],"readwrite"),j=p.objectStore("APCObjectStore"),c={id:m,classification:r,content:n,misc:a},v=j.put(c);v.onsuccess=()=>d(v.result),v.onerror=()=>x(v.error),p.oncomplete=()=>l.close()}))}function et(m){return ht().then(r=>new Promise((n,a)=>{const l=r.transaction([Ae],"readonly"),x=l.objectStore(Ae).get(m);x.onsuccess=()=>n(x.result),x.onerror=()=>a(x.error),l.oncomplete=()=>r.close()}))}function Ur(m){return ht().then(r=>new Promise((n,a)=>{const l=r.transaction([Ae],"readwrite"),x=l.objectStore(Ae).delete(m);x.onsuccess=()=>n(),x.onerror=()=>a(x.error),l.oncomplete=()=>r.close()}))}function Le(m=null){return ht().then(r=>new Promise((n,a)=>{const l=r.transaction([Ae],"readonly"),x=l.objectStore(Ae).openCursor(),p=[];x.onsuccess=j=>{const c=j.target.result;c?((!m||m(c.value))&&p.push(c.value),c.continue()):n(p)},x.onerror=j=>{a("Failed to retrieve items: "+j.target.errorCode)},l.oncomplete=()=>{r.close()}}))}function Wr(m){const{currentTabNo:r,theme:n,apcCanvasInstance:a,apiEndpoint:l,reloadTabs:d,updateActiveSection:x,initCategory:p,initInstance:j,apiKey:c,setActiveTab:v}=m,[u,w]=h.useState(),[i,y]=h.useState(p||"Hats"),[f,b]=h.useState(!1),[s,k]=h.useState(),_=`${l}/api/v1/designer`;h.useEffect(()=>{z()},[]),h.useEffect(()=>{a&&j&&j.fabricID&&L(j.fabricID)},[j]);const z=()=>{b(!0);const R=`${_}/search-designs-images/${i}`;Ce.get(R).then(E=>{b(!1),E.data.object.length>0?w(E.data):k("No matching results found")}).catch(E=>{b(!1),console.error("Error fetching data:",E)})},L=R=>{const E=_+"/find-public-design/"+R;Ce.get(E).then(P=>{const{object:X}=P==null?void 0:P.data;X&&(window.location.href=`/design-center/${X.pdid}`)}).catch(P=>{console.error("Error fetching data:",P)})},F=()=>u?u.object.map((R,E)=>e.jsx(h.Fragment,{children:e.jsxs("div",{style:{position:"relative",backgroundColor:"#ffffff",boxShadow:"0 4px 8px rgba(0, 0, 0, 0.1)",borderRadius:"2px",overflow:"hidden",marginBottom:"9px"},tabIndex:0,className:"apc-mpx-widget-responsive-image-container",onClick:()=>L(R.fabricID),children:[e.jsxs("div",{style:{position:"absolute",top:0,right:0,backgroundColor:n.secondaryColor,padding:"5px",zIndex:1,color:"#ffffff"},children:["$",R.product.price]}),e.jsx("img",{src:R.imageURL,alt:R.description,className:"apc-mpx-widget-responsive-image"}),e.jsx("div",{children:R.product.name})]})},E)):null;return e.jsxs(h.Fragment,{children:[e.jsx("br",{}),e.jsxs("div",{style:{display:"flex",flexDirection:"row"},children:[e.jsx("div",{children:e.jsx("input",{placeholder:"Search templates",type:"text",onChange:R=>y(R.target.value),className:"apc-mpc-widget-input",style:{border:`solid 3px ${n.primaryColor}`,height:"40px"}})}),e.jsx("div",{children:e.jsx("button",{className:"apc-mpc-widget-btn",onClick:()=>z(),style:{backgroundColor:n.primaryColor,color:"#ffffff",height:"35px"},children:f?"...Processing":"Search"})})]}),s?e.jsxs("div",{style:{color:"orangered",fontWeight:"bold"},children:[e.jsx("br",{}),s]}):null,e.jsx("br",{})," ",e.jsx("br",{})," ",e.jsx("br",{}),F()]})}const $r={fontFamily:"Arial",fontSize:"40px",color:"transparent",background:"linear-gradient(to bottom, red 0%, yellow 100%)",WebkitBackgroundClip:"text",backgroundClip:"text",cursor:"pointer"},Jr={fontFamily:"comic sans ms",fontSize:"40px",color:"#000",width:"300px",textShadow:`
31
31
  -1px -1px 0 #ff0000,
32
32
  1px -1px 0 #ff0000,
33
33
  -1px 1px 0 #ff0000,
34
- 1px 1px 0 #ff0000`,cursor:"pointer"},Gr={fontFamily:"Arial",fontSize:"40px",color:"#000",width:"300px",transform:"skewX(20deg) skewY(10deg)",textAlign:"center",cursor:"pointer"},Yr={fontFamily:"Arial",fontSize:"40px",color:"#000",textShadow:"0 0 10px green",textAlign:"center",cursor:"pointer"},Kr={fontFamily:"Arial",fontSize:"40px",color:"#000",backgroundColor:"orange",borderRadius:"5px",cursor:"pointer"},Xr={color:"black",fontSize:"40px",opacity:"0.5",fontFamily:"Arial, sans-serif",cursor:"pointer"};function qr(m){const{apcCanvasInstance:r,isMobile:n,closeMobileModalSecondaryPanel:c}=m,a=(i,y)=>{const f=new B.fabric.Textbox("Stay Humble!",{width:300,left:200,top:200,fontFamily:i,fill:y,hasControls:!0});r.add(f),r.setActiveObject(f),n&&c(!0)},d=({primaryTextLabel:i,primaryTextFontFamily:y,primaryTextColor:f,secondaryTextLabel:b,SecondaryTextFontFamily:s,secondaryTextColor:k})=>{const _=new B.fabric.Textbox(i,{fontFamily:y,width:300,left:200,top:200,fill:f}),T=new B.fabric.Textbox(b,{fontFamily:s,fill:k,fontSize:12,width:150});T.top=_.top+_.height+10,T.left=_.left,r.add(_),r.add(T),r.setActiveObject(_),n&&c(!0)},x=(i,y)=>{const f=new B.fabric.Textbox("Adventure Awaits!",{width:300,left:200,top:200,fontFamily:i,fill:y}),b={color:"rgba(0,0,0,0.5)",blur:10,offsetX:5,offsetY:5};f.shadow=b,r.add(f),r.setActiveObject(f),n&&c(!0)},h=()=>{const i=new B.fabric.Textbox("Love More",{left:100,top:100,width:300,fontFamily:"Arial",fill:new B.fabric.Gradient({type:"linear",gradientUnits:"pixels",coords:{x1:0,y1:0,x2:0,y2:50},colorStops:[{offset:0,color:"red"},{offset:1,color:"yellow"}]})});r.add(i),r.setActiveObject(i),n&&c(!0)},j=()=>{const i=new B.fabric.Textbox("Good Vibes Only",{left:150,top:150,fontFamily:"comic sans ms",fontSize:40,width:300,fill:"#000",stroke:"#ff0000",strokeWidth:2});r.add(i),r.setActiveObject(i),n&&c(!0)},o=()=>{const i=new B.fabric.Textbox("Dream Big",{left:300,top:300,width:300,fontFamily:"Arial",fill:"#000",skewX:20,skewY:10});r.add(i),r.setActiveObject(i),n&&c(!0)},v=()=>{const i=new B.fabric.Textbox("Choose Joy",{left:350,top:350,fontFamily:"Arial",fill:"#000",opacity:.5});r.add(i),r.setActiveObject(i),n&&c(!0)},u=()=>{const i=new B.fabric.Textbox("Find Your Fire",{left:550,top:550,fontFamily:"Arial",fill:"#000",shadow:"yellow 0 0 10px"});r.add(i),r.setActiveObject(i),n&&c(!0)},w=()=>{const i=new B.fabric.Textbox("Be Kind",{left:650,top:650,fontFamily:"Arial",fill:"#000",backgroundColor:"orange"});r.add(i),r.setActiveObject(i),n&&c(!0)};return e.jsx(p.Fragment,{children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[e.jsx("div",{style:{fontSize:"20px",cursor:"pointer"},onClick:()=>a("Arial, sans-serif","#6a45d2"),children:e.jsx("span",{style:{color:"#6a45d2",fontFamily:"Arial, sans-serif",fontSize:"30px"},children:"Stay Humble "})}),e.jsx("div",{style:{fontSize:"20px",cursor:"pointer"},onClick:()=>d({primaryTextLabel:"Life is full of",primaryTextFontFamily:"Rock Salt, cursive",primaryTextColor:"black",secondaryTextLabel:"surprises",SecondaryTextFontFamily:"Arial, sans-serif",secondaryTextColor:"black"}),children:e.jsxs("span",{style:{color:"black",fontFamily:"Rock Salt, cursive",fontSize:"30px"},children:["Life is full of ",e.jsx("div",{style:{fontFamily:"Arial, sans-serif",fontSize:"14px"},children:"surprises"})," "]})}),e.jsx("div",{style:{fontSize:"20px",cursor:"pointer",paddingLeft:"20px"},onClick:()=>d({primaryTextLabel:"You are invited!",primaryTextFontFamily:"Bilbao Swash Caps",primaryTextColor:"green",secondaryTextLabel:"Taste the best wines from the best makers",SecondaryTextFontFamily:"Arial, sans-serif",secondaryTextColor:"green"}),children:e.jsxs("span",{style:{color:"green",fontFamily:"Bilbao Swash Caps",fontSize:"30px"},children:["You are invited! ",e.jsx("div",{style:{color:"green",fontFamily:"Arial, sans-serif",fontSize:"14px",textAlign:"right"},children:"Taste the best wines from the best makers"})," "]})}),e.jsx("div",{style:{fontSize:"20px",cursor:"pointer",paddingLeft:"20px"},onClick:()=>x("aclonica","#6a45d2"),children:e.jsx("span",{style:{color:"#6a45d2",fontFamily:"aclonica",fontSize:"30px",textShadow:"2px 2px 4px rgba(0, 0, 0, 2)"},children:"Adventure Awaits "})}),e.jsx("div",{onClick:()=>h(),style:$r,children:"Love More"}),e.jsx("div",{onClick:()=>j(),style:Jr,children:"Good Vibes Only"}),e.jsx("div",{onClick:()=>o(),style:Gr,children:"Dream Big"}),e.jsx("div",{onClick:()=>u(),style:Yr,children:"Find Your Fire"}),e.jsx("div",{onClick:()=>w(),style:Kr,children:"Be Kind"}),e.jsx("div",{onClick:()=>v(),style:Xr,children:"Choose Joy"})]})})}const Bt=async m=>{try{const n=await(await fetch(m)).blob();return new Promise((c,a)=>{const d=new FileReader;d.onloadend=()=>c(d.result),d.onerror=a,d.readAsDataURL(n)})}catch(r){throw console.error("Error converting image to base64:",r),r}};function Qr({apcCanvasInstance:m,theme:r}){const[n,c]=p.useState(!1),a=o=>{const v=o.target.files[0];if(v){const u=new FileReader;u.onload=w=>x(w.target.result),u.readAsDataURL(v)}},d=o=>{o.preventDefault(),c(!1);const v=o.dataTransfer.files[0];if(v){const u=new FileReader;u.onload=w=>x(w.target.result),u.readAsDataURL(v)}},x=o=>{B.fabric.Image.fromURL(o,v=>{v.set({left:100,top:100,scaleX:.5,scaleY:.5}),m.add(v)})},h=o=>{o.preventDefault(),c(!0)},j=()=>{c(!1)};return e.jsxs("div",{style:{border:n?"2px dashed #4CAF50":"2px dashed #ccc",padding:"40px",margin:"20px",borderRadius:"10px",textAlign:"center",backgroundColor:n?"#f0fff4":"#f9f9f9",transition:"background-color 0.3s",cursor:"pointer",position:"relative"},onDragOver:h,onDragLeave:j,onDrop:d,onClick:()=>document.getElementById("file-input").click(),children:[e.jsx("input",{type:"file",accept:"image/*",style:{display:"none"},id:"file-input",onChange:a}),e.jsxs("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:n?"#4CAF50":"#ccc",fontSize:"48px"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"18",viewBox:"0 0 512 512",style:{fill:r.primaryColor},children:e.jsx("path",{d:_t})}),e.jsx("br",{})," ",e.jsx("br",{})]}),e.jsx("label",{htmlFor:"file-input",style:{display:"block",marginTop:"80px",fontSize:"16px",color:"#333"},children:"Click or drag & drop to upload an image"}),e.jsx("div",{style:{fontSize:"12px",color:"#888"},children:"Supports PNG, JPG, WEBP formats"})]})}function ct(m){const{featureText:r,theme:n,featureName:c}=m;return e.jsxs("div",{className:"premium-feature-container",style:{padding:"20px",backgroundColor:"#f8f9fa",borderRadius:"8px",boxShadow:"0 2px 10px rgba(0,0,0,0.05)",textAlign:"center",maxWidth:"400px",margin:"0 auto"},children:[e.jsx("div",{style:{marginBottom:"16px"},children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{color:"#ffc107"},children:[e.jsx("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"}),e.jsx("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"})]})}),e.jsx("h3",{style:{color:"#333",fontSize:"18px",fontWeight:"600",marginBottom:"12px"},children:c??"Premium Feature Access"}),e.jsx("p",{style:{color:"#555",fontSize:"15px",lineHeight:"1.5",marginBottom:"20px"},children:r??"This advanced feature requires a premium subscription to access."}),e.jsxs("a",{href:"https://mypixia.com/developer",target:"_blank",rel:"noopener noreferrer",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",backgroundColor:n.primaryColor,color:"white",padding:"10px 20px",borderRadius:"4px",textDecoration:"none",fontWeight:"500",transition:"background-color 0.2s ease"},onMouseOver:a=>a.currentTarget.style.backgroundColor="#3a45bf",onMouseOut:a=>a.currentTarget.style.backgroundColor="#4c5bf2",children:[e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{marginRight:"8px"},children:[e.jsx("path",{d:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20z"}),e.jsx("path",{d:"M12 8v8"}),e.jsx("path",{d:"M8 12h8"})]}),"Get API Key"]}),e.jsx("p",{style:{fontSize:"13px",color:"#777",marginTop:"16px"},children:"Unlock premium design features to create your perfect custom product"})]})}function at(){return e.jsxs("div",{className:"loading-container",children:[e.jsxs("div",{className:"spinner",children:[e.jsx("div",{className:"spinner-circle"}),e.jsx("div",{className:"spinner-circle-inner"})]}),e.jsx("p",{className:"loading-text",children:"Loading..."})]})}function Zr(m){const{apcCanvasInstance:r,theme:n,apiKey:c,apiEndpoint:a,isMobile:d,closeMobileModalSecondaryPanel:x}=m,[h,j]=p.useState("flowers"),[o,v]=p.useState(!1),[u,w]=p.useState(),[i,y]=p.useState(!1),[f,b]=p.useState(!1),s=sessionStorage.getItem("apc_x_sub_status"),k=`${a}/api/v1/designer`;p.useEffect(()=>{T()},[]),p.useEffect(()=>{(async()=>{s==="active"?(y(!0),b(!0)):(v(!0),await _())})()},[]);const _=()=>{v(!0);const I=`${k}/get-subscription-status/${c}`;ve.get(I).then(H=>{H.data.object&&H.data.object==="active"&&(sessionStorage.setItem("apc_x_sub_status","active"),y(!0))}).catch(H=>{sessionStorage.setItem("apc_x_sub_status","")}).finally(()=>{v(!1),b(!0)})},T=()=>{v(!0);const I={"X-Api-Key":c},H=`${k}/get-images/${h}`;ve.get(H,{headers:I}).then(X=>{var Q;v(!1),w((Q=X.data)==null?void 0:Q.object)}).catch(X=>{console.error("Error fetching data:",X),v(!1)})},R=async I=>{const H=await Bt(I);H&&B.fabric.Image.fromURL(H,X=>{X.set({left:0,top:0,scaleX:.3,scaleY:.3}),r.add(X)}),d&&x(!0)},P=()=>u?e.jsx("div",{children:u.map(I=>e.jsx("div",{onClick:()=>R(I.urls.regular),style:{cursor:"pointer"},children:e.jsx("img",{height:300,width:300,src:I.urls.regular,alt:I.description||"No description"})},I.id))}):null,z=()=>!i&&!o&&f?e.jsx(ct,{theme:n,isPartial:!0,featureName:"AI image generation or search"}):i&&!o&&f?e.jsxs("div",{children:[e.jsx("strong",{children:"- OR -"}),e.jsxs("div",{children:[e.jsx("input",{type:"text",onChange:I=>j(I.target.value),className:"apc-mpc-widget-input",style:{border:`solid 3px ${n.primaryColor}`}}),e.jsx("br",{})," ",e.jsx("br",{}),e.jsx("button",{className:"apc-mpc-widget-btn",onClick:()=>T(),style:{backgroundColor:n.primaryColor,color:"#ffffff"},children:o?"...Processing":"Search"})]}),e.jsx("br",{}),e.jsx("br",{}),P()]}):e.jsx(at,{});return e.jsxs(p.Fragment,{children:[e.jsx("br",{}),e.jsx("br",{}),e.jsx(Qr,{apcCanvasInstance:r,theme:n}),e.jsx("br",{}),e.jsx("br",{}),z()]})}function zt(m){const{apcCanvasInstance:r,theme:n,isMobile:c,closeMobileModalSecondaryPanel:a}=m,d=b=>{const s=new B.fabric.Rect({width:100,height:60,left:200,top:200,fill:"",stroke:n.primaryColor});r.add(s),r.setActiveObject(s),c&&a(!0)},x=b=>{const s=new B.fabric.Circle({radius:30,fill:"",stroke:n.primaryColor,left:200,top:200});r.add(s),r.setActiveObject(s),c&&a(!0)},h=b=>{const s=new B.fabric.Triangle({width:40,height:50,fill:"",stroke:n.primaryColor,left:200,top:200});r.add(s),r.setActiveObject(s),c&&a(!0)},j=b=>{const s=new B.fabric.Line([50,10,250,10],{fill:"",stroke:n.primaryColor,left:200,top:200});r.add(s),r.setActiveObject(s),c&&a(!0)},o=(b,s,k)=>{const _=s,T=s,R=Math.PI/b;let P=[],z=0;for(let I=0;I<b;I++){let H=_+Math.cos(z)*s,X=T+Math.sin(z)*s;P.push({x:H,y:X}),z+=R,H=_+Math.cos(z)*k,X=T+Math.sin(z)*k,P.push({x:H,y:X}),z+=R}return P},v=(b,s)=>{const k=Math.PI*2/b,_=s,T=s,R=[];for(let P=0;P<b;P++){const z=_+s*Math.cos(P*k),I=T+s*Math.sin(P*k);R.push({x:z,y:I})}return R},u=b=>{const s=o(5,60,30),k=new B.fabric.Polygon(s,{left:200,top:200,fill:"",stroke:n.primaryColor,strokeWidth:2,strokeLineJoin:"bevil"},!1);r.add(k),r.setActiveObject(k),c&&a(!0)},w=b=>{const s=v(6,30),k=new B.fabric.Polygon(s,{left:200,top:200,fill:"",stroke:n.primaryColor,strokeWidth:2,strokeLineJoin:"bevil"},!1);r.add(k),r.setActiveObject(k),c&&a(!0)},i=b=>{const s=new B.fabric.Path(yt,{fill:"",stroke:n.primaryColor,left:200,top:200});r.add(s),r.setActiveObject(s),c&&a(!0)},y=b=>{const s=new B.fabric.Path(wt,{fill:"",stroke:n.primaryColor,left:200,top:200});r.add(s),r.setActiveObject(s),c&&a(!0)},f=b=>{const s=new B.fabric.Path(ht,{fill:"",stroke:n.primaryColor,left:200,top:200});r.add(s),r.setActiveObject(s),c&&a(!0)};return r?e.jsxs(p.Fragment,{children:[e.jsx("br",{}),e.jsx("div",{onClick:b=>d(),style:{fontSize:"50px",cursor:"pointer"},children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"76",width:"76",viewBox:"0 0 712 712",fill:"none",strokeWidth:"4",stroke:n.primaryColor,children:e.jsx("path",{d:"M512 512H0V0h512v512z"})})}),e.jsx("div",{onClick:b=>x(),style:{fontSize:"50px",cursor:"pointer"},children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"66",width:"66",viewBox:"0 0 512 512",fill:"none",strokeWidth:"4",stroke:n.primaryColor,children:e.jsx("path",{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"})})}),e.jsx("div",{onClick:b=>h(),draggable:!0,style:{fontSize:"50px",cursor:"pointer"},children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"106",width:"106",viewBox:"0 0 320 512",fill:"none",strokeWidth:"4",stroke:n.primaryColor,children:e.jsx("path",{d:"M288.7 352H31.3c-17.8 0-26.7-21.5-14.1-34.1l128.7-128.7c7.8-7.8 20.5-7.8 28.3 0l128.7 128.7c12.6 12.6 3.7 34.1-14.1 34.1z"})})}),e.jsx("div",{onClick:b=>u(),style:{fontSize:"50px",cursor:"pointer"},children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"86",width:"86",viewBox:"0 0 576 512",fill:"none",strokeWidth:"4",stroke:n.primaryColor,children:e.jsx("path",{d:"M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"})})}),e.jsx("div",{onClick:b=>w(),style:{fontSize:"50px",cursor:"pointer"},children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",strokeWidth:"4",stroke:n.primaryColor,height:"80px",width:"80px",version:"1.1",id:"Capa_1",viewBox:"0 0 184.751 184.751",children:e.jsx("path",{d:"M0,92.375l46.188-80h92.378l46.185,80l-46.185,80H46.188L0,92.375z"})})}),e.jsx("div",{onClick:b=>j(),style:{fontSize:"50px",cursor:"pointer"},children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",strokeWidth:"4",stroke:n.primaryColor,id:"Capa_1",width:"86px",height:"86px",viewBox:"0 0 290.658 290.658",children:e.jsx("g",{children:e.jsx("g",{children:e.jsx("rect",{y:"139.474",style:{fill:n.primaryColor},width:"290.658",height:"1.711"})})})})}),e.jsx("div",{onClick:b=>i(),style:{fontSize:"50px",cursor:"pointer"},children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"86",width:"86",viewBox:"0 0 512 512",fill:"none",strokeWidth:"4",stroke:n.primaryColor,children:e.jsx("path",{d:yt})})}),e.jsx("div",{onClick:b=>y(),style:{fontSize:"50px",cursor:"pointer"},children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"86",width:"86",viewBox:"0 0 512 512",fill:"none",strokeWidth:"4",stroke:n.primaryColor,children:e.jsx("path",{d:wt})})}),e.jsx("div",{onClick:b=>f(),style:{fontSize:"50px",cursor:"pointer"},children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"86",width:"86",viewBox:"0 0 448 512",fill:"none",strokeWidth:"4",stroke:n.primaryColor,children:e.jsx("path",{d:ht})})})]}):null}function en(m){const{apcCanvasInstance:r,theme:n,isMobile:c,closeMobileModalSecondaryPanel:a}=m,d=h=>{const j=new B.fabric.Path(h,{left:200,top:200,fill:n.primaryColor,scaleX:.1,scaleY:.1});r.add(j),r.setActiveObject(j),c&&a(!0)},x=h=>{switch(h){case"icon-phone":d(dr);break;case"icon-question":d(lr);break;case"icon-clock":d(hr);break;case"icon-twitter":d(pr);break;case"icon-check":d(ur);break;case"icon-pointer":d(fr);break;case"icon-mail":d(xr);break;case"icon-dollar":d(gr);break;case"icon-graduation":d(Ct);break;case"icon-business-suit":d(mr);break;case"icon-chat":d(vr);break;case"icon-thumbs-up":d(jr);break;case"icon-wifi":d(br);break;case"icon-info":d(Nt);break;case"icon-cart":d(kt);break;case"icon-comment":d(St);break;case"icon-location-map":d(Ot);break;case"icon-heart-1":d(At);break;case"icon-arrow-right-1":d(ht);break;case"icon-xmark":d(It);break;case"icon-cloud":d(Et);break;case"icon-smile":d(Tt);break;case"icon-like":d(Mt);break;default:console.log("no matching type")}};return e.jsx(p.Fragment,{children:e.jsxs("div",{style:{padding:"5px"},className:c?"apc-mpx-widget-secondary-icons-mobile":"apc-mpx-widget-secondary-icons",children:[e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:h=>x("icon-phone"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:n.primaryColor,d:"M164.9 24.6c-7.7-18.6-28-28.5-47.4-23.2l-88 24C12.1 30.2 0 46 0 64C0 311.4 200.6 512 448 512c18 0 33.8-12.1 38.6-29.5l24-88c5.3-19.4-4.6-39.7-23.2-47.4l-96-40c-16.3-6.8-35.2-2.1-46.3 11.6L304.7 368C234.3 334.7 177.3 277.7 144 207.3L193.3 167c13.7-11.2 18.4-30 11.6-46.3l-40-96z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:h=>x("icon-question"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 320 512",children:e.jsx("path",{fill:n.primaryColor,d:"M80 160c0-35.3 28.7-64 64-64h32c35.3 0 64 28.7 64 64v3.6c0 21.8-11.1 42.1-29.4 53.8l-42.2 27.1c-25.2 16.2-40.4 44.1-40.4 74V320c0 17.7 14.3 32 32 32s32-14.3 32-32v-1.4c0-8.2 4.2-15.8 11-20.2l42.2-27.1c36.6-23.6 58.8-64.1 58.8-107.7V160c0-70.7-57.3-128-128-128H144C73.3 32 16 89.3 16 160c0 17.7 14.3 32 32 32s32-14.3 32-32zm80 320a40 40 0 1 0 0-80 40 40 0 1 0 0 80z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:h=>x("icon-clock"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:n.primaryColor,d:"M464 256A208 208 0 1 1 48 256a208 208 0 1 1 416 0zM0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM232 120V256c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2V120c0-13.3-10.7-24-24-24s-24 10.7-24 24z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:h=>x("icon-twitter"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:n.primaryColor,d:"M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:h=>x("icon-check"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 448 512",children:e.jsx("path",{fill:n.primaryColor,d:"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:h=>x("icon-pointer"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 448 512",children:e.jsx("path",{fill:n.primaryColor,d:"M160 64c0-8.8 7.2-16 16-16s16 7.2 16 16V200c0 10.3 6.6 19.5 16.4 22.8s20.6-.1 26.8-8.3c3-3.9 7.6-6.4 12.8-6.4c8.8 0 16 7.2 16 16c0 10.3 6.6 19.5 16.4 22.8s20.6-.1 26.8-8.3c3-3.9 7.6-6.4 12.8-6.4c7.8 0 14.3 5.6 15.7 13c1.6 8.2 7.3 15.1 15.1 18s16.7 1.6 23.3-3.6c2.7-2.1 6.1-3.4 9.9-3.4c8.8 0 16 7.2 16 16l0 16V392c0 39.8-32.2 72-72 72H272 212.3h-.9c-37.4 0-72.4-18.7-93.2-49.9L50.7 312.9c-4.9-7.4-2.9-17.3 4.4-22.2s17.3-2.9 22.2 4.4L116 353.2c5.9 8.8 16.8 12.7 26.9 9.7s17-12.4 17-23V320 64zM176 0c-35.3 0-64 28.7-64 64V261.7C91.2 238 55.5 232.8 28.5 250.7C-.9 270.4-8.9 310.1 10.8 339.5L78.3 440.8c29.7 44.5 79.6 71.2 133.1 71.2h.9H272h56c66.3 0 120-53.7 120-120V288l0-16c0-35.3-28.7-64-64-64c-4.5 0-8.8 .5-13 1.3c-11.7-15.4-30.2-25.3-51-25.3c-6.9 0-13.5 1.1-19.7 3.1C288.7 170.7 269.6 160 248 160c-2.7 0-5.4 .2-8 .5V64c0-35.3-28.7-64-64-64zm48 304c0-8.8-7.2-16-16-16s-16 7.2-16 16v96c0 8.8 7.2 16 16 16s16-7.2 16-16V304zm48-16c-8.8 0-16 7.2-16 16v96c0 8.8 7.2 16 16 16s16-7.2 16-16V304c0-8.8-7.2-16-16-16zm80 16c0-8.8-7.2-16-16-16s-16 7.2-16 16v96c0 8.8 7.2 16 16 16s16-7.2 16-16V304z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:h=>x("icon-mail"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:n.primaryColor,d:"M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48H48zM0 176V384c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V176L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:h=>x("icon-dollar"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 320 512",children:e.jsx("path",{fill:n.primaryColor,d:"M160 0c17.7 0 32 14.3 32 32V67.7c1.6 .2 3.1 .4 4.7 .7c.4 .1 .7 .1 1.1 .2l48 8.8c17.4 3.2 28.9 19.9 25.7 37.2s-19.9 28.9-37.2 25.7l-47.5-8.7c-31.3-4.6-58.9-1.5-78.3 6.2s-27.2 18.3-29 28.1c-2 10.7-.5 16.7 1.2 20.4c1.8 3.9 5.5 8.3 12.8 13.2c16.3 10.7 41.3 17.7 73.7 26.3l2.9 .8c28.6 7.6 63.6 16.8 89.6 33.8c14.2 9.3 27.6 21.9 35.9 39.5c8.5 17.9 10.3 37.9 6.4 59.2c-6.9 38-33.1 63.4-65.6 76.7c-13.7 5.6-28.6 9.2-44.4 11V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V445.1c-.4-.1-.9-.1-1.3-.2l-.2 0 0 0c-24.4-3.8-64.5-14.3-91.5-26.3c-16.1-7.2-23.4-26.1-16.2-42.2s26.1-23.4 42.2-16.2c20.9 9.3 55.3 18.5 75.2 21.6c31.9 4.7 58.2 2 76-5.3c16.9-6.9 24.6-16.9 26.8-28.9c1.9-10.6 .4-16.7-1.3-20.4c-1.9-4-5.6-8.4-13-13.3c-16.4-10.7-41.5-17.7-74-26.3l-2.8-.7 0 0C119.4 279.3 84.4 270 58.4 253c-14.2-9.3-27.5-22-35.8-39.6c-8.4-17.9-10.1-37.9-6.1-59.2C23.7 116 52.3 91.2 84.8 78.3c13.3-5.3 27.9-8.9 43.2-11V32c0-17.7 14.3-32 32-32z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:h=>x("icon-graduation"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 640 512",children:e.jsx("path",{fill:n.primaryColor,d:Ct})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:h=>x("icon-business-suit"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 640 512",children:e.jsx("path",{fill:n.primaryColor,d:"M184 48H328c4.4 0 8 3.6 8 8V96H176V56c0-4.4 3.6-8 8-8zm-56 8V96H64C28.7 96 0 124.7 0 160v96H192 352h8.2c32.3-39.1 81.1-64 135.8-64c5.4 0 10.7 .2 16 .7V160c0-35.3-28.7-64-64-64H384V56c0-30.9-25.1-56-56-56H184c-30.9 0-56 25.1-56 56zM320 352H224c-17.7 0-32-14.3-32-32V288H0V416c0 35.3 28.7 64 64 64H360.2C335.1 449.6 320 410.5 320 368c0-5.4 .2-10.7 .7-16l-.7 0zm320 16a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zM496 288c8.8 0 16 7.2 16 16v48h32c8.8 0 16 7.2 16 16s-7.2 16-16 16H496c-8.8 0-16-7.2-16-16V304c0-8.8 7.2-16 16-16z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:h=>x("icon-chat"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 640 512",children:e.jsx("path",{fill:n.primaryColor,d:"M88.2 309.1c9.8-18.3 6.8-40.8-7.5-55.8C59.4 230.9 48 204 48 176c0-63.5 63.8-128 160-128s160 64.5 160 128s-63.8 128-160 128c-13.1 0-25.8-1.3-37.8-3.6c-10.4-2-21.2-.6-30.7 4.2c-4.1 2.1-8.3 4.1-12.6 6c-16 7.2-32.9 13.5-49.9 18c2.8-4.6 5.4-9.1 7.9-13.6c1.1-1.9 2.2-3.9 3.2-5.9zM0 176c0 41.8 17.2 80.1 45.9 110.3c-.9 1.7-1.9 3.5-2.8 5.1c-10.3 18.4-22.3 36.5-36.6 52.1c-6.6 7-8.3 17.2-4.6 25.9C5.8 378.3 14.4 384 24 384c43 0 86.5-13.3 122.7-29.7c4.8-2.2 9.6-4.5 14.2-6.8c15.1 3 30.9 4.5 47.1 4.5c114.9 0 208-78.8 208-176S322.9 0 208 0S0 78.8 0 176zM432 480c16.2 0 31.9-1.6 47.1-4.5c4.6 2.3 9.4 4.6 14.2 6.8C529.5 498.7 573 512 616 512c9.6 0 18.2-5.7 22-14.5c3.8-8.8 2-19-4.6-25.9c-14.2-15.6-26.2-33.7-36.6-52.1c-.9-1.7-1.9-3.4-2.8-5.1C622.8 384.1 640 345.8 640 304c0-94.4-87.9-171.5-198.2-175.8c4.1 15.2 6.2 31.2 6.2 47.8l0 .6c87.2 6.7 144 67.5 144 127.4c0 28-11.4 54.9-32.7 77.2c-14.3 15-17.3 37.6-7.5 55.8c1.1 2 2.2 4 3.2 5.9c2.5 4.5 5.2 9 7.9 13.6c-17-4.5-33.9-10.7-49.9-18c-4.3-1.9-8.5-3.9-12.6-6c-9.5-4.8-20.3-6.2-30.7-4.2c-12.1 2.4-24.7 3.6-37.8 3.6c-61.7 0-110-26.5-136.8-62.3c-16 5.4-32.8 9.4-50 11.8C279 439.8 350 480 432 480z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:h=>x("icon-thumbs-up"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:n.primaryColor,d:"M323.8 34.8c-38.2-10.9-78.1 11.2-89 49.4l-5.7 20c-3.7 13-10.4 25-19.5 35l-51.3 56.4c-8.9 9.8-8.2 25 1.6 33.9s25 8.2 33.9-1.6l51.3-56.4c14.1-15.5 24.4-34 30.1-54.1l5.7-20c3.6-12.7 16.9-20.1 29.7-16.5s20.1 16.9 16.5 29.7l-5.7 20c-5.7 19.9-14.7 38.7-26.6 55.5c-5.2 7.3-5.8 16.9-1.7 24.9s12.3 13 21.3 13L448 224c8.8 0 16 7.2 16 16c0 6.8-4.3 12.7-10.4 15c-7.4 2.8-13 9-14.9 16.7s.1 15.8 5.3 21.7c2.5 2.8 4 6.5 4 10.6c0 7.8-5.6 14.3-13 15.7c-8.2 1.6-15.1 7.3-18 15.1s-1.6 16.7 3.6 23.3c2.1 2.7 3.4 6.1 3.4 9.9c0 6.7-4.2 12.6-10.2 14.9c-11.5 4.5-17.7 16.9-14.4 28.8c.4 1.3 .6 2.8 .6 4.3c0 8.8-7.2 16-16 16H286.5c-12.6 0-25-3.7-35.5-10.7l-61.7-41.1c-11-7.4-25.9-4.4-33.3 6.7s-4.4 25.9 6.7 33.3l61.7 41.1c18.4 12.3 40 18.8 62.1 18.8H384c34.7 0 62.9-27.6 64-62c14.6-11.7 24-29.7 24-50c0-4.5-.5-8.8-1.3-13c15.4-11.7 25.3-30.2 25.3-51c0-6.5-1-12.8-2.8-18.7C504.8 273.7 512 257.7 512 240c0-35.3-28.6-64-64-64l-92.3 0c4.7-10.4 8.7-21.2 11.8-32.2l5.7-20c10.9-38.2-11.2-78.1-49.4-89zM32 192c-17.7 0-32 14.3-32 32V448c0 17.7 14.3 32 32 32H96c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32H32z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:h=>x("icon-wifi"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 640 512",children:e.jsx("path",{fill:n.primaryColor,d:"M54.2 202.9C123.2 136.7 216.8 96 320 96s196.8 40.7 265.8 106.9c12.8 12.2 33 11.8 45.2-.9s11.8-33-.9-45.2C549.7 79.5 440.4 32 320 32S90.3 79.5 9.8 156.7C-2.9 169-3.3 189.2 8.9 202s32.5 13.2 45.2 .9zM320 256c56.8 0 108.6 21.1 148.2 56c13.3 11.7 33.5 10.4 45.2-2.8s10.4-33.5-2.8-45.2C459.8 219.2 393 192 320 192s-139.8 27.2-190.5 72c-13.3 11.7-14.5 31.9-2.8 45.2s31.9 14.5 45.2 2.8c39.5-34.9 91.3-56 148.2-56zm64 160a64 64 0 1 0 -128 0 64 64 0 1 0 128 0z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:h=>x("icon-info"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:n.primaryColor,d:Nt})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:h=>x("icon-cart"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 576 512",children:e.jsx("path",{fill:n.primaryColor,d:kt})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:h=>x("icon-comment"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:n.primaryColor,d:St})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:h=>x("icon-location-map"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 384 512",children:e.jsx("path",{fill:n.primaryColor,d:Ot})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:h=>x("icon-heart-1"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:n.primaryColor,d:At})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:h=>x("icon-arrow-right-1"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 448 512",children:e.jsx("path",{fill:n.primaryColor,d:yr})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:h=>x("icon-xmark"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 384 512",children:e.jsx("path",{fill:n.primaryColor,d:It})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:h=>x("icon-cloud"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 640 512",children:e.jsx("path",{fill:n.primaryColor,d:Et})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:h=>x("icon-smile"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:n.primaryColor,d:Tt})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:h=>x("icon-like"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:n.primaryColor,d:Mt})})})]})})}const Xe=({defaultValue:m,size:r,ariaLabel:n,onChange:c})=>{const[a,d]=p.useState(m),x=h=>{const j=h.target.value;d(j),c(j)};return e.jsx("input",{type:"range",value:a,min:"0",max:"100",step:"1",className:`slider ${r}`,"aria-label":n,onChange:x})};function Rt(m){const{apcCanvasInstance:r,theme:n}=m,[c,a]=p.useState(!1),d=p.useRef(null),x=()=>{a(i=>!i)},h=i=>{d.current&&d.current.contains(i.target)||a(!1)};p.useEffect(()=>(document.addEventListener("mousedown",h),()=>{document.removeEventListener("mousedown",h)}),[]);const j=(i,y)=>{if(r.getActiveObject()){if(y==="family"&&r.getActiveObject().set({fontFamily:i}),y==="bold"&&r.getActiveObject().set({fontWeight:i}),y==="italic"&&r.getActiveObject().set({fontStyle:i}),y==="underline"&&r.getActiveObject().set({underline:i}),y==="line-through"&&r.getActiveObject().set({linethrough:i}),y==="overline"&&r.getActiveObject().set({overline:i}),y==="color"&&r.getActiveObject().set({fill:i}),y==="shadow"){const f=document.getElementById("apc-text-shadow-color").value;let b=document.getElementById("apc-text-shadow-horiz").value,s=document.getElementById("apc-text-shadow-vert").value,k=document.getElementById("apc-text-shadow-blur").value;b||(b=5),s||(s=5),k||(k=5),r.getActiveObject().set({shadow:f+" "+b+" "+s+" "+k})}if(y==="stroke"){const f=document.getElementById("apc-text-stroke-color").value;let b=document.getElementById("apc-text-stroke-width").value;b||(b=1),r.getActiveObject().set({stroke:f,strokeWidth:b})}y==="bg-color"&&r.getActiveObject().set({textBackgroundColor:i}),y==="font-size"&&r.getActiveObject().set({fontSize:i}),r&&r.renderAll()}},o=i=>{if(r.getActiveObject()){const y=parseFloat(i/100);r.getActiveObject().set({opacity:y.toFixed(1)}),r&&r.renderAll()}},v=({color:i,x:y,y:f,blur:b})=>{if(r.getActiveObject()){const s=r.getActiveObject().shadow;i||(i=s?s.color:"#6a45d2"),y||(y=s?s.offsetX:5),f||(f=s?s.offsetY:5),b||(b=s?s.blur:5),r.getActiveObject().set({shadow:i+" "+y+" "+f+" "+b}),r&&r.renderAll()}},u=()=>e.jsxs("div",{className:"apc-mpx-widget-button-group-container",children:[" ",e.jsx("button",{className:"apc-mpx-widget-effects-button",onClick:x,style:{color:n.primaryColor,cursor:"pointer"},children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",height:"15px",width:"15px",children:e.jsx("path",{fill:n.primaryColor,d:Lr})})}),c&&e.jsxs("div",{className:"apc-mpx-widget-popper-container",ref:d,children:[e.jsx("div",{className:"apc-mpx-widget-popper-arrow-up"}),e.jsxs("ul",{id:"split-button-menu",autoFocus:!0,children:[e.jsx("li",{className:"apc-mpx-widget-popper-li",children:e.jsxs("div",{style:{textAlign:"left"},children:[e.jsx("div",{style:{fontWeight:"bold",color:"purple"},children:"Background"}),e.jsxs("div",{style:{marginLeft:"10px"},children:[" Color",e.jsx("input",{style:{height:"25px",width:"25px",border:"none"},type:"color",onChange:i=>j(i.target.value,"bg-color")})]}),e.jsxs("div",{style:{marginLeft:"10px"},children:[" Opacity",e.jsx("div",{children:e.jsx(Xe,{defaultValue:100,size:"small","aria-label":"Opacity",onChange:i=>o(i)})})]})]})}),e.jsx("li",{className:"apc-mpx-widget-popper-li",children:e.jsxs("div",{style:{textAlign:"left"},children:[e.jsx("div",{style:{fontWeight:"bold",color:"purple"},children:"Shadow"}),e.jsxs("div",{style:{marginLeft:"10px"},children:["Blur ",e.jsx("input",{type:"text",style:{height:"22px",width:"20px"},onChange:i=>v({blur:i.target.value})})]}),e.jsxs("div",{style:{marginLeft:"10px"},children:[" Color",e.jsx("input",{style:{height:"25px",width:"25px",border:"none"},type:"color",onChange:i=>v({color:i.target.value})})]}),e.jsxs("div",{style:{marginLeft:"10px"},children:[" Offset X",e.jsx("div",{children:e.jsx(Xe,{defaultValue:0,size:"small","aria-label":"Opacity",onChange:i=>v({x:i})})})]}),e.jsxs("div",{style:{marginLeft:"10px"},children:[" Offset Y",e.jsx("div",{children:e.jsx(Xe,{defaultValue:0,size:"small","aria-label":"Opacity",onChange:i=>v({y:i})})})]})]})})]})]})]});return e.jsx(p.Fragment,{children:e.jsxs("div",{style:{display:"flex",flexDirection:"row",color:"#ffffff"},children:[e.jsx("div",{style:{marginTop:"4px",marginLeft:"2px"},children:e.jsx("input",{style:{height:"20px",width:"30px",border:"solid 0px #ffffff"},type:"color",onChange:i=>j(i.target.value,"color")})})," ",e.jsx("div",{style:{marginTop:"4px"},children:e.jsxs("select",{style:{height:"20px",border:"solid 0px #ffffff"},id:"ffamily",onChange:i=>j(i.target.value,"family"),children:[e.jsx("option",{value:"comic sans ms",children:"Comic Sans MS"}),e.jsx("option",{value:"frankruehl",children:"FrankRuehl"}),e.jsx("option",{value:"lucida Bright",children:"Lucida Bright"}),e.jsx("option",{value:"bradley Hand",children:"Bradley Hand"}),e.jsx("option",{value:"Times New Roman",children:"Times New Roman"}),e.jsx("option",{value:"Georgia",children:"Georgia"}),e.jsx("option",{value:"Garamond",children:"Garamond"}),e.jsx("option",{value:"Baskerville",children:"Baskerville"}),e.jsx("option",{value:"Palatino",children:"Palatino"}),e.jsx("option",{value:"Book Antiqua",children:"Book Antiqua"}),e.jsx("option",{value:"Arial",children:"Arial"}),e.jsx("option",{value:"Helvetica",children:"Helvetica"}),e.jsx("option",{value:"Verdana",children:"Verdana"}),e.jsx("option",{value:"Tahoma",children:"Tahoma"}),e.jsx("option",{value:"Futura",children:"Futura"}),e.jsx("option",{value:"Calibri",children:"Calibri"}),e.jsx("option",{value:"Courier New",children:"Courier New"}),e.jsx("option",{value:"Consolas",children:"Consolas"}),e.jsx("option",{value:"Monaco",children:"Monaco"}),e.jsx("option",{value:"Brush Script",children:"Brush Script"}),e.jsx("option",{value:"Lucida Handwriting",children:"Lucida Handwriting"}),e.jsx("option",{value:"Zapfino",children:"Zapfino"}),e.jsx("option",{value:"Impact",children:"Impact"}),e.jsx("option",{value:"Cooper Black",children:"Cooper Black"}),e.jsx("option",{value:"Papyrus",children:"Papyrus"}),e.jsx("option",{value:"Comic Sans MS",children:"Comic Sans MS"}),e.jsx("option",{value:"Gotham",children:"Gotham"}),e.jsx("option",{value:"Franklin Gothic",children:"Franklin Gothic"}),e.jsx("option",{value:"DIN",children:"DIN"}),e.jsx("option",{value:"Rockwell",children:"Rockwell"}),e.jsx("option",{value:"Century Gothic",children:"Century Gothic"}),e.jsx("option",{value:"Trebuchet MS",children:"Trebuchet MS"}),e.jsx("option",{value:"Lobster",children:"Lobster"}),e.jsx("option",{value:"Roboto",children:"Roboto"}),e.jsx("option",{value:"Myriad Pro",children:"Myriad Pro"}),e.jsx("option",{value:"Gill Sans",children:"Gill Sans"}),e.jsx("option",{value:"Bodoni",children:"Bodoni"}),e.jsx("option",{value:"Perpetua",children:"Perpetua"}),e.jsx("option",{value:"Akzidenz-Grotesk",children:"Akzidenz-Grotesk"}),e.jsx("option",{value:"Source Sans Pro",children:"Source Sans Pro"}),e.jsx("option",{value:"Lato",children:"Lato"}),e.jsx("option",{value:"Noto Sans",children:"Noto Sans"}),e.jsx("option",{value:"Open Sans",children:"Open Sans"}),e.jsx("option",{value:"Montserrat",children:"Montserrat"})]})})," ",e.jsx("div",{style:{marginTop:"4px"},children:e.jsx("input",{defaultValue:40,style:{width:"50px",height:"20px",border:"solid 0px #ffffff"},type:"number",onChange:i=>j(i.target.value,"font-size")})}),e.jsx("div",{style:{marginTop:"4px",marginLeft:"2px",cursor:"pointer"},role:"button",onClick:i=>r.getActiveObject().fontWeight==="normal"?j("bold","bold"):j("normal","bold"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16px",width:"16px",viewBox:"0 0 384 512",children:e.jsx("path",{fill:"#ffffff",d:"M333.5 238a122 122 0 0 0 27-65.2C367.9 96.5 308 32 233.4 32H34a16 16 0 0 0 -16 16v48a16 16 0 0 0 16 16h31.9v288H34a16 16 0 0 0 -16 16v48a16 16 0 0 0 16 16h209.3c70.8 0 134.1-51.8 141-122.4 4.7-48.5-16.4-92.1-50.8-119.6zM145.7 112h87.8a48 48 0 0 1 0 96h-87.8zm87.8 288h-87.8V288h87.8a56 56 0 0 1 0 112z"})})}),e.jsx("div",{style:{marginTop:"4px",marginLeft:"2px",cursor:"pointer"},role:"button",onClick:i=>r.getActiveObject().fontStyle==="normal"?j("italic","italic"):j("normal","italic"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16px",width:"16px",viewBox:"0 0 320 512",children:e.jsx("path",{fill:"#ffffff",d:"M320 48v32a16 16 0 0 1 -16 16h-62.8l-80 320H208a16 16 0 0 1 16 16v32a16 16 0 0 1 -16 16H16a16 16 0 0 1 -16-16v-32a16 16 0 0 1 16-16h62.8l80-320H112a16 16 0 0 1 -16-16V48a16 16 0 0 1 16-16h192a16 16 0 0 1 16 16z"})})}),e.jsx("div",{style:{marginTop:"4px",marginLeft:"2px",cursor:"pointer"},role:"button",onClick:i=>r.getActiveObject().underline?j(!1,"underline"):j(!0,"underline"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16px",width:"16px",viewBox:"0 0 448 512",children:e.jsx("path",{fill:"#ffffff",d:"M32 64h32v160c0 88.2 71.8 160 160 160s160-71.8 160-160V64h32a16 16 0 0 0 16-16V16a16 16 0 0 0 -16-16H272a16 16 0 0 0 -16 16v32a16 16 0 0 0 16 16h32v160a80 80 0 0 1 -160 0V64h32a16 16 0 0 0 16-16V16a16 16 0 0 0 -16-16H32a16 16 0 0 0 -16 16v32a16 16 0 0 0 16 16zm400 384H16a16 16 0 0 0 -16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0 -16-16z"})})}),e.jsx("div",{style:{marginTop:"4px",marginLeft:"2px",cursor:"pointer"},role:"button","aria-label":"Italics",onClick:i=>r.getActiveObject().linethrough?j(!1,"line-through"):j(!0,"line-through"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16px",width:"16px",viewBox:"0 0 512 512",children:e.jsx("path",{fill:"#ffffff",d:"M496 224H293.9l-87.2-26.8A43.6 43.6 0 0 1 219.6 112h66.8A49.9 49.9 0 0 1 331 139.6a16 16 0 0 0 21.5 7.2l42.9-21.5a16 16 0 0 0 7.2-21.5l-.5-1A128 128 0 0 0 287.5 32h-68a123.7 123.7 0 0 0 -123 135.6c2 20.9 10.1 39.8 21.8 56.4H16a16 16 0 0 0 -16 16v32a16 16 0 0 0 16 16h480a16 16 0 0 0 16-16v-32a16 16 0 0 0 -16-16zm-180.2 96A43 43 0 0 1 336 356.5 43.6 43.6 0 0 1 292.5 400h-66.8A49.9 49.9 0 0 1 181 372.4a16 16 0 0 0 -21.5-7.2l-42.9 21.5a16 16 0 0 0 -7.2 21.5l.5 1A128 128 0 0 0 224.5 480h68a123.7 123.7 0 0 0 123-135.6 114.3 114.3 0 0 0 -5.3-24.4z"})})}),e.jsx("div",{children:u()})]})})}function Ye(m){const{apcCanvasInstance:r,theme:n}=m,c=p.useRef(null),[a,d]=p.useState(!1),x=()=>{d(u=>!u)},h=(u,w)=>{if(r&&r.getActiveObject()){if(u==="bg-color"&&r.getActiveObject().set({fill:w}),u==="border-color"&&r.getActiveObject().set({stroke:w}),u==="gradient-bg-color1"||u==="gradient-bg-color2"){let i=document.getElementById("apc-object-bg-gradient-color1").value,y=document.getElementById("apc-object-bg-gradient-color2").value;const f=new B.fabric.Gradient({type:"linear",gradientUnits:"pixels",coords:{x1:0,y1:0,x2:0,y2:r.getActiveObject().height},colorStops:[{offset:0,color:i||"#000"},{offset:1,color:y||"#fff"}]});r.getActiveObject().set({fill:f})}r&&r.renderAll()}},j=u=>{if(r.getActiveObject()){const w=parseFloat(u/100);r.getActiveObject().set({opacity:w.toFixed(1)}),r&&r.renderAll()}},o=({color:u,x:w,y:i,blur:y})=>{if(r.getActiveObject()){const f=r.getActiveObject().shadow;u||(u=f?f.color:"#6a45d2"),w||(w=f?f.offsetX:5),i||(i=f?f.offsetY:5),y||(y=f?f.blur:5),r.getActiveObject().set({shadow:u+" "+w+" "+i+" "+y}),r&&r.renderAll()}};return e.jsx(p.Fragment,{children:e.jsxs("div",{className:"apc-mpx-widget-button-group-container",children:[e.jsx("button",{className:"apc-mpx-widget-effects-button",onClick:x,style:{color:n.primaryColor,fontWeight:"bold",cursor:"pointer",borderRadius:"25px"},children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",height:"22px",width:"22px",children:e.jsx("path",{fill:n.primaryColor,d:_r})})}),a&&e.jsxs("div",{className:"apc-mpx-widget-popper-container",ref:c,style:{marginLeft:"20%"},children:[e.jsx("div",{className:"apc-mpx-widget-popper-arrow-up"}),e.jsxs("ul",{id:"split-button-menu",autoFocus:!0,children:[e.jsx("li",{className:"apc-mpx-widget-popper-li",children:e.jsxs("div",{style:{textAlign:"left"},children:[e.jsx("div",{style:{fontWeight:"bold",color:"purple"},children:"Background"}),e.jsxs("div",{style:{marginLeft:"10px"},children:[" Color",e.jsx("input",{style:{height:"25px",width:"25px",border:"none"},type:"color",onChange:u=>h("bg-color",u.target.value)})]}),e.jsxs("div",{style:{marginLeft:"10px"},children:["Gradient:",e.jsx("input",{style:{height:"25px",width:"25px",border:"none"},className:"editor-color-input-selector",id:"apc-object-bg-gradient-color1",type:"color",onChange:u=>h("gradient-bg-color1",u.target.value)}),e.jsx("input",{style:{height:"25px",width:"25px",border:"none"},className:"editor-color-input-selector",id:"apc-object-bg-gradient-color2",type:"color",onChange:u=>h("gradient-bg-color2",u.target.value)})]}),e.jsx("div",{style:{marginLeft:"10px"},children:e.jsxs("div",{children:["Opacity: ",e.jsx(Xe,{defaultValue:100,size:"small","aria-label":"Opacity",onChange:u=>j(u)})]})}),e.jsxs("div",{style:{marginLeft:"10px"},children:[" Border color",e.jsx("input",{style:{height:"25px",width:"25px",border:"none"},type:"color",onChange:u=>h("border-color",u.target.value)})]})]})}),e.jsx("li",{className:"apc-mpx-widget-popper-li",children:e.jsxs("div",{style:{textAlign:"left"},children:[e.jsx("div",{style:{fontWeight:"bold",color:"purple"},children:"Shadow"}),e.jsxs("div",{style:{marginLeft:"10px"},children:["Blur width ",e.jsx("input",{type:"text",style:{height:"22px",width:"25px"},onChange:u=>o({blur:u.target.value})})]}),e.jsxs("div",{style:{marginLeft:"10px"},children:[" Color",e.jsx("input",{style:{height:"25px",width:"25px",border:"none"},type:"color",onChange:u=>o({color:u.target.value})})]}),e.jsx("div",{style:{marginLeft:"10px"},children:e.jsxs("div",{children:["Offset X: ",e.jsx(Xe,{defaultValue:0,size:"small","aria-label":"Opacity",onChange:u=>o({x:u})})]})}),e.jsx("div",{style:{marginLeft:"10px"},children:e.jsxs("div",{children:["Offset Y: ",e.jsx(Xe,{defaultValue:0,size:"small","aria-label":"Opacity",onChange:u=>o({y:u})})]})})]})})]})]})]})})}function tn(m){const{apcCanvasInstance:r,apiEndpoint:n,apiKey:c}=m,[a,d]=p.useState("art"),[x,h]=p.useState(),[j,o]=p.useState(!1),v=n+"/api/v1/designer";p.useEffect(()=>{u()},[]);const u=()=>{o(!0);const f={"X-Api-Key":c},b=`${v}/get-quote/${a}`;ve.get(b,{headers:f}).then(s=>{var k;o(!1),h((k=s.data)==null?void 0:k.object)}).catch(s=>{console.error("Error fetching data:",s),o(!1)})},w=(f,b,s)=>{const k=new B.fabric.Textbox(b,{width:500,left:100,top:200,fontSize:16}),_=new B.fabric.Textbox(s,{fontSize:14,width:200,fontWeight:"bold"});_.top=k.top+k.height+10,_.left=k.left,r.add(k),r.add(_),r.setActiveObject(k)},i=f=>{o(!0),d(f),u()},y=()=>x?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:5},children:x.map((f,b)=>e.jsxs("div",{onClick:s=>w(s,f.quote,f.author),style:{cursor:"pointer",padding:"3px",textAlign:"left",color:"#210080",fontFamily:"ui-monospace",border:"1px solid #dedcdc",borderRadius:"8px"},children:[e.jsx("div",{children:f.quote}),e.jsx("div",{children:e.jsx("strong",{children:e.jsx("i",{children:f.author})})}),e.jsx("br",{})]},b))}):null;return e.jsxs(p.Fragment,{children:[e.jsx("h3",{children:"Quotes"}),e.jsx("br",{}),e.jsx("br",{}),e.jsx("div",{children:y()}),e.jsx("br",{}),e.jsx("br",{}),e.jsx("br",{}),e.jsxs("div",{style:{padding:"3px"},children:[e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("best"),children:[a==="best"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Best"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("business"),children:[a==="business"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Business"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("car"),children:[a==="car"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Car"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("change"),children:[a==="change"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Change"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("computers"),children:[a==="computers"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Computers"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("cool"),children:[a==="cool"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Cool"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("courage"),children:[a==="courage"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Courage"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("dad"),children:[a==="dad"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Dad"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("dating"),children:[a==="dating"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Date"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("death"),children:[a==="death"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Death"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("design"),children:[a==="design"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Design"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("dreams"),children:[a==="dreams"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Dreams"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("education"),children:[a==="education"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Education"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("inspirational"),children:[a==="inspirational"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Inspirational"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("happiness"),children:[a==="happiness"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Happiness"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("health"),children:[a==="health"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Health"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("humor"),children:[a==="humor"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Humor"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("marriage"),children:[a==="marriage"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Marriage"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("money"),children:[a==="money"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Money"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("graduation"),children:[a==="graduation"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Graduation"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("hope"),children:[a==="hope"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Hope"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("love"),children:[a==="love"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Love"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("god"),children:[a==="god"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"God"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("equality"),children:[a==="equality"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Equality"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("failure"),children:[a==="failure"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Failure"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("fear"),children:[a==="fear"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Fear"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("legal"),children:[a==="legal"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Legal"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("attitude"),children:[a==="attitude"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Attitude"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("beauty"),children:[a==="beauty"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Beauty"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("age"),children:[a==="age"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Age"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("art"),children:[a==="art"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Art"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("birthday"),children:[a==="birthday"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Birthday"]}),e.jsx("br",{})]})]})}function rn(m){const{apcCanvasInstance:r,theme:n,apiKey:c,apiEndpoint:a,updateActiveSection:d,reloadTabs:x,currentTabNo:h,isMobile:j,closeMobileModalSecondaryPanel:o}=m,[v,u]=p.useState("background"),[w,i]=p.useState(!1),[y,f]=p.useState(),b=a+"/api/v1/designer";p.useEffect(()=>{k()},[]);const s=R=>{const P=document.getElementById("img-default-id"),z=new B.fabric.Image(P,I=>{I.set({left:100,top:200,scaleX:.5,scaleY:.5,imageSmoothing:!0})});r.add(z),j&&o(!0)},k=()=>{i(!0);const R={"X-Api-Key":c},P=`${b}/get-images/${v}`;ve.get(P,{headers:R}).then(z=>{var I;i(!1),f((I=z.data)==null?void 0:I.object)}).catch(z=>{console.error("Error fetching data:",z),i(!1)})},_=R=>{B.fabric.Image.fromURL(R,function(P){P.width=r.width,P.height=r.height,P.scaleToWidth(r.width),P.scaleToHeight(r.height),r.setBackgroundImage(P);const z=sessionStorage.getItem("apc_x_activeTab"),I=JSON.stringify(r);He(z,"general",I,null).then(H=>{x(h+1),r&&r.renderAll()})},{crossOrigin:"anonymous"})},T=()=>y?e.jsx("div",{children:y.map(R=>e.jsx("div",{onClick:()=>_(R.urls.regular),style:{cursor:"pointer"},children:e.jsx("img",{height:300,width:300,src:R.urls.regular,alt:R.description||"No description"})},R.id))}):null;return e.jsxs(p.Fragment,{children:[e.jsx("br",{}),e.jsx("br",{}),e.jsxs("div",{style:{cursor:"pointer"},onClick:()=>s(),children:[e.jsx("img",{alt:"sample-image",id:"img-default-id",src:"https://mypixia.com/images/img-default.png",height:"200",width:"300"})," ",e.jsx("br",{}),"From my device"]}),e.jsx("br",{}),e.jsx("br",{}),e.jsx("strong",{children:"- OR -"}),e.jsxs("div",{children:[e.jsx("input",{type:"text",onChange:R=>u(R.target.value),className:"apc-mpc-widget-input",style:{border:`solid 3px ${n.primaryColor}`}}),e.jsx("br",{})," ",e.jsx("br",{}),e.jsx("button",{className:"apc-mpc-widget-btn",onClick:()=>k(),style:{backgroundColor:n.primaryColor,color:"#ffffff"},children:w?"...Processing":"Search"})]}),e.jsx("br",{}),e.jsx("br",{}),T()]})}function nn(m){const[r,n]=p.useState(""),[c,a]=p.useState(""),[d,x]=p.useState(!1),[h,j]=p.useState(!1),[o,v]=p.useState(!1),{apcCanvasInstance:u,theme:w,isMobile:i,closeMobileModalSecondaryPanel:y,apiKey:f,apiEndpoint:b}=m,s=`${b}/api/v1/designer`,k=sessionStorage.getItem("apc_x_sub_status");p.useEffect(()=>{(async()=>{k==="active"?(j(!0),v(!0)):(x(!0),await _())})()},[]);const _=()=>{x(!0);const P=`${s}/get-subscription-status/${f}`;ve.get(P).then(z=>{z.data.object&&z.data.object==="active"&&(sessionStorage.setItem("apc_x_sub_status","active"),j(!0))}).catch(z=>{sessionStorage.setItem("apc_x_sub_status","")}).finally(()=>{x(!1),v(!0)})},T=()=>{rr.toDataURL(r,{width:300},(P,z)=>{P&&console.error(P),a(z)})},R=P=>{const z=document.getElementById("apc-qr-code-img"),I=new B.fabric.Image(z,H=>{H.set({left:200,top:200,scaleX:.5,scaleY:.5,imageSmoothing:!0})});u.add(I),u.setActiveObject(I),i&&y(!0)};return!h&&!d&&o?e.jsx(ct,{theme:w}):h&&!d&&o?e.jsxs(p.Fragment,{children:[e.jsx("br",{}),e.jsx("br",{}),"Enter data such as url",e.jsx("br",{}),e.jsx("input",{className:"apc-mpc-widget-input",style:{border:`solid 3px ${w.primaryColor}`},type:"text",onChange:P=>n(P.target.value)}),e.jsx("br",{}),e.jsx("br",{}),e.jsx("button",{className:"apc-mpc-widget-btn",style:{backgroundColor:w.primaryColor,color:"#ffffff"},disabled:!r,onClick:T,children:"Generate QR code"}),e.jsx("br",{}),e.jsx("br",{}),c&&e.jsxs("div",{className:"generated-view",onClick:()=>R(),style:{cursor:"pointer"},children:[e.jsx("img",{src:c,alt:"qr code",id:"apc-qr-code-img"}),e.jsx("a",{href:c})]})]}):e.jsx("div",{children:e.jsx(at,{})})}function sn(m){const{apcCanvasInstance:r,theme:n,isMobile:c,closeMobileModalSecondaryPanel:a,apiKey:d,apiEndpoint:x}=m,[h,j]=p.useState(""),[o,v]=p.useState(null),[u,w]=p.useState("CODE128"),i=p.useRef(null),[y,f]=p.useState(""),[b,s]=p.useState(!1),[k,_]=p.useState(!1),[T,R]=p.useState(!1),P=sessionStorage.getItem("apc_x_sub_status"),z=`${x}/api/v1/designer`;p.useEffect(()=>{(async()=>{P==="active"?(_(!0),R(!0)):(s(!0),await I())})()},[]);const I=()=>{s(!0);const Q=`${z}/get-subscription-status/${d}`;ve.get(Q).then(ie=>{ie.data.object&&ie.data.object==="active"&&(sessionStorage.setItem("apc_x_sub_status","active"),_(!0))}).catch(ie=>{sessionStorage.setItem("apc_x_sub_status","")}).finally(()=>{s(!1),R(!0)})},H=()=>{v(e.jsx(nr,{value:h,format:u,id:"barcode-element"}));const Q=document.getElementById("barcode-element");Q&&f(Q.innerHTML)},X=Q=>{if(i.current.innerHTML){const ie=i.current.innerHTML;let re=new Image;re.src="data:image/svg+xml,"+encodeURIComponent(ie),re.onload=function(){const ae=new B.fabric.Image(re,{left:200,top:200});r.add(ae),r.setActiveObject(ae)}}c&&a(!0)};return!k&&!b&&T?e.jsx(ct,{theme:n}):k&&!b&&T?e.jsxs(p.Fragment,{children:[e.jsx("br",{}),e.jsx("br",{}),"Enter number",e.jsx("input",{type:"text",onChange:Q=>j(Q.target.value),className:"apc-mpc-widget-input",style:{border:`solid 3px ${n.primaryColor}`}}),e.jsx("br",{}),e.jsx("br",{}),"Code type",e.jsxs("select",{value:u,onChange:Q=>w(Q.target.value),className:"apc-mpc-widget-input",style:{border:`solid 3px ${n.primaryColor}`},children:[e.jsx("option",{value:"CODE128",children:"CODE128"}),e.jsx("option",{value:"EAN13",children:"EAN / UPC"}),e.jsx("option",{value:"CODE39",children:"CODE39"}),e.jsx("option",{value:"ITF14",children:"ITF-14"}),e.jsx("option",{value:"MSI10",children:"MSI10"}),e.jsx("option",{value:"pharmacode",children:"Pharmacode"}),e.jsx("option",{value:"codabar",children:"Codabar"})]}),e.jsx("br",{}),e.jsx("br",{}),e.jsx("button",{className:"apc-mpc-widget-btn",disabled:!h,onClick:()=>H(),style:{backgroundColor:n.primaryColor,color:"#ffffff"},children:"Generate Barcode"}),e.jsx("br",{}),e.jsx("br",{})," ",e.jsx("br",{}),e.jsx("br",{}),e.jsx("div",{children:o&&e.jsx("div",{ref:i,onClick:Q=>X(),style:{cursor:"pointer"},children:o})})]}):e.jsxs("div",{children:[" ",e.jsx(at,{})]})}function on(m){const{apcCanvasInstance:r,theme:n}=m,[c,a]=p.useState(),[d,x]=p.useState(),[h,j]=p.useState(""),o=(w,i)=>{if(r){if(w==="bg-color"&&i.target.value&&r.set({backgroundColor:i.target.value}),w==="image"&&i.target.value){const y=i.target.files[0],f=new FileReader;f.onload=function(b){const s=b.target.result;B.fabric.Image.fromURL(s,function(k){r.setBackgroundImage(k,r.renderAll.bind(r),{})})},f.readAsDataURL(y)}w==="height"&&i.target.value&&(a(i.target.value),r.setHeight(i.target.value)),w==="width"&&i.target.value&&(x(i.target.value),r.setWidth(i.target.value)),r&&r.renderAll()}},v=(w,i,y)=>{x(i),a(w),r.setWidth(i),r.setHeight(w),j(y)},u=()=>e.jsxs("div",{children:[e.jsx("br",{}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row"},children:e.jsxs("div",{children:["Height(px)",e.jsx("input",{type:"number",value:r.height,onChange:w=>o("height",w),className:"apc-mpc-widget-input",style:{border:`solid 3px ${n.primaryColor}`}})]})})," ",e.jsx("div",{style:{display:"flex",flexDirection:"row"},children:e.jsxs("div",{children:["Width(px)",e.jsx("input",{color:"info",type:"number",value:r.width,onChange:w=>o("width",w),className:"apc-mpc-widget-input",style:{border:`solid 3px ${n.primaryColor}`}})]})}),e.jsx("br",{}),e.jsx("br",{}),e.jsx("div",{style:{textAlign:"left"},children:e.jsx("h3",{children:"Standard dimensions"})}),e.jsx("br",{})," ",e.jsx("br",{}),e.jsxs("div",{children:[e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>v(1440,2560,"YOUC"),children:[h==="YOUC"?e.jsx("span",{style:{color:"green"},children:"✓"}):null," Youtube Channel : 2560 x 1440 px"]})}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>v(1080,1920,"FULLHD"),children:[h==="FULLHD"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Full HD : 1920 x 1080 px"]})}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>v(1080,1080,"INSTAP"),children:[h==="INSTAP"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Instagram Post:1080 x 1080 px"]})}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>v(1920,1080,"INSTAS"),children:[h==="INSTAS"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Instagram Story: 1080 x 1920 px"]})}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>v(1080,1080,"INSTAA"),children:[h==="INSTAA"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Instagram Ad: 1080 x 1080 px"]})}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>v(788,940,"FACEP"),children:[h==="FACEP"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Facebook Post: 940 x 788 px"]})}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>v(315,851,"FACEC"),children:[h==="FACEC"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Facebook Cover: 851 x 315 px"]})}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>v(628,1200,"FACEA"),children:[h==="FACEA"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Facebook Ad: 1200 x 628 px"]})}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>v(720,1280,"YOUT"),children:[h==="YOUT"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Youtube Thumbnail: 1280 x 720 px"]})}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>v(534,534,"INVITE"),children:[h==="INVITE"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Invitation : 14 x 14 cm"]})}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>v(1112,788,"A4"),children:[h==="A4"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"A4 : 788 x 1112 px"]})}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>v(192,336,"BUSINESSCARD"),children:[h==="BUSINESSCARD"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Business card 3.5 x 2 in"]})})]})]});return e.jsx("div",{children:u()})}const fe=(m,r,n,c="png",a)=>new Promise((d,x)=>{const h=document.createElement("canvas"),j=JSON.parse(m),o=crypto.randomUUID();h.width=n,h.height=r;const v=new B.fabric.StaticCanvas(h,{selection:!1,height:j.height,width:j.width});v.loadFromJSON(j,function(){if(v.renderAll(),c.toLowerCase()==="svg"){const u=v.toSVG(),w=new Blob([u],{type:"image/svg+xml"});a&&it(w,"mypixia.svg"),d(new File([w],`${o}.svg`,{type:"image/svg+xml"}))}else if(c.toLowerCase()==="pdf"){const u=v.toDataURL("image/jpeg",1);import("jspdf").then(w=>{const i=new w.jsPDF({orientation:"landscape",unit:"px",format:[h.width,h.height]});i.addImage(u,"JPEG",0,0,h.width,h.height);const f=i.output("datauristring").split(",")[1],b=cn(f,"application/pdf"),s=new File([b],`${o}.pdf`,{type:"application/pdf"}),k=`${o}.pdf`;a&&it(s,k),d(s)}).catch(w=>{console.error("Error loading jsPDF: ",w),x(w)})}else{let u,w="image/png",i="png";switch(c.toLowerCase()){case"jpeg":u=v.toDataURL("image/jpeg",1),w="image/jpeg",i="jpg";break;case"webp":u=v.toDataURL("image/webp",1),w="image/webp",i="webp";break;default:u=v.toDataURL("image/png",1);break}const y=atob(u.split(",")[1]),f=new Array(y.length);for(let _=0;_<y.length;_++)f[_]=y.charCodeAt(_);const b=new Uint8Array(f),s=new File([b],`${o}.${i}`,{type:w}),k=`${o}.${i}`;a&&it(s,k),d(s)}})}),nt=async({fabricString:m,height:r,width:n,download:c})=>{const a=JSON.parse(m),d=crypto.randomUUID();return new Promise((x,h)=>{const j=document.createElement("canvas"),o=new B.fabric.Canvas(j,{height:r,width:n});o.loadFromJSON(a,()=>{o.setBackgroundImage(null,o.renderAll.bind(o));const v=o.toDataURL({format:"png"});fetch(v).then(u=>u.blob()).then(u=>{const w=new File([u],`${d}.png`,{type:"image/png"}),i=`${d}.png`;c&&it(w,i),x(w)}).catch(u=>h(u))})})},it=(m,r)=>{const n=URL.createObjectURL(m),c=document.createElement("a");c.href=n,c.download=r,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(n)};function cn(m,r){const n=atob(m),c=new Array(n.length);for(let d=0;d<n.length;d++)c[d]=n.charCodeAt(d);const a=new Uint8Array(c);return new Blob([a],{type:r})}const an=({children:m})=>sr.createPortal(m,document.getElementById("apc-mpx-editor-modal-root"));function lt(m){const{isOpen:r,onClose:n,children:c}=m;return r?e.jsx(an,{children:e.jsx("div",{className:"apc-mpx-widget-modal-overlay",children:e.jsxs("div",{className:"apc-mpx-widget-modal",children:[e.jsx("button",{style:{color:"red"},className:"apc-mpx-widget-modal-close-btn",onClick:n,children:"Close"}),e.jsx("div",{className:"apc-mpx-widget-modal-content",children:c})]})})}):null}const xe=(m,r)=>{m=m.startsWith("#")?m:`#${m}`;let n=parseInt(m.slice(1,3),16),c=parseInt(m.slice(3,5),16),a=parseInt(m.slice(5,7),16);return n=parseInt(n*(100-r)/100),c=parseInt(c*(100-r)/100),a=parseInt(a*(100-r)/100),n=n.toString(16).padStart(2,"0"),c=c.toString(16).padStart(2,"0"),a=a.toString(16).padStart(2,"0"),`#${n}${c}${a}`};function Dt(m){const[r,n]=p.useState(""),{apcCanvasJSON:c,height:a,width:d}=m;return p.useEffect(()=>{const x=document.createElement("canvas"),h=JSON.parse(c);x.width=d,x.height=a;const j=new B.fabric.StaticCanvas(x,{selection:!1,height:h.height,width:h.width});j.loadFromJSON(h,function(){j.renderAll();const o=j.toDataURL("image/png",1);n(o)})},[]),r?e.jsx("div",{children:e.jsx("div",{className:"apc-mpx-widget-responsive-image-container",style:{cursor:"pointer",maxHeight:"500px",maxWidth:"500px"},children:e.jsx("img",{src:r,alt:"mypixia cool design",className:"apc-mpx-widget-responsive-image"})})}):"...processing"}function ln(m){const{theme:r,apcCanvasInstance:n}=m,[c,a]=p.useState(!1),[d,x]=p.useState(),h=()=>{a(!0)},j=()=>{a(!1)},o=()=>{if(!n)return null;const v=JSON.stringify(n);return e.jsxs(lt,{isOpen:c,onClose:j,children:[e.jsx(Dt,{apcCanvasJSON:v,height:n.height,width:n.width}),e.jsx("div",{children:e.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:5},children:[e.jsx("div",{children:e.jsx(oe.FacebookShareButton,{url:d,children:e.jsx(oe.FacebookIcon,{size:32,round:!0})})}),e.jsx("div",{children:e.jsx(oe.TwitterShareButton,{url:d,title:"Hello",children:e.jsx(oe.XIcon,{size:32,round:!0})})}),e.jsx("div",{children:e.jsx(oe.TelegramShareButton,{url:d,title:"Hello",children:e.jsx(oe.TelegramIcon,{size:32,round:!0})})}),e.jsx("div",{children:e.jsx(oe.WhatsappShareButton,{url:d,title:"Hello",separator:":: ",children:e.jsx(oe.WhatsappIcon,{size:32,round:!0})})}),e.jsx("div",{children:e.jsx(oe.LinkedinShareButton,{url:d,children:e.jsx(oe.LinkedinIcon,{size:32,round:!0})})}),e.jsx("div",{children:e.jsx(oe.PinterestShareButton,{url:"https://static.mypixia.com",media:d,children:e.jsx(oe.PinterestIcon,{size:32,round:!0})})}),e.jsx("div",{children:e.jsx(oe.RedditShareButton,{url:d,title:"Hello",windowWidth:660,windowHeight:460,children:e.jsx(oe.RedditIcon,{size:32,round:!0})})}),e.jsx("div",{children:e.jsx(oe.InstapaperShareButton,{url:d,title:"Hello",children:e.jsx(oe.InstapaperIcon,{size:32,round:!0})})})]})}),e.jsx("hr",{}),e.jsx("br",{}),e.jsx("button",{autoFocus:!0,type:"button",className:"apc-mpc-widget-btn",onClick:()=>j(),style:{backgroundColor:"red",color:"#ffffff",float:"right"},children:"Close"})]})};return e.jsxs(p.Fragment,{children:[e.jsxs("button",{className:"apc-mpc-widget-btn",onClick:()=>h(),role:"dialog",style:{backgroundColor:xe(r.primaryColor,40),color:"#ffffff",float:"right"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:"#ffffff",d:zr})}),"  Share"]}),o()]})}function dn(m){const{theme:r,apiKey:n,apcCanvasInstance:c,updateSelectedSections:a,updateActiveSection:d,accesories:x,getDesignFormats:h}=m,[j,o]=p.useState(!1),[v,u]=p.useState(),w=()=>{o(!0)},i=()=>{o(!1)},y=()=>({getPDF:()=>{const b=JSON.stringify(c);return fe(b,c.height,c.width,"pdf",!0).then(s=>s)},getPNG:()=>{const b=JSON.stringify(c);return fe(b,c.height,c.width,"png",!0).then(s=>s)},getSVG:()=>{const b=JSON.stringify(c);return fe(b,c.height,c.width,"svg",!0).then(s=>s)},getJPEG:()=>{const b=JSON.stringify(c);return fe(b,c.height,c.width,"jpeg",!0).then(s=>s)},getWEBP:()=>{const b=JSON.stringify(c);return fe(b,c.height,c.width,"webp",!0).then(s=>s)}}),f=()=>{if(!c)return null;const b=JSON.stringify(c);return e.jsxs(lt,{isOpen:j,onClose:i,children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[e.jsx("h3",{style:{float:"left"},children:"Download"}),e.jsx("div",{children:e.jsx(Dt,{apcCanvasJSON:b,height:c.height,width:c.width})}),e.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:5},children:[e.jsx("div",{style:{color:xe(r.primaryColor,50),fontWeight:"bold",textDecoration:"underline",cursor:"pointer"},onClick:()=>y().getPDF(),children:"PDF"}),e.jsx("div",{style:{color:xe(r.primaryColor,50),fontWeight:"bold",textDecoration:"underline",cursor:"pointer"},onClick:()=>y().getSVG(),children:"SVG"}),e.jsx("div",{style:{color:xe(r.primaryColor,50),fontWeight:"bold",textDecoration:"underline",cursor:"pointer"},onClick:()=>y().getPNG(),children:"PNG"}),e.jsx("div",{style:{color:xe(r.primaryColor,50),fontWeight:"bold",textDecoration:"underline",cursor:"pointer"},onClick:()=>y().getJPEG(),children:"JPEG"}),e.jsx("div",{style:{color:xe(r.primaryColor,50),fontWeight:"bold",textDecoration:"underline",cursor:"pointer"},onClick:()=>y().getWEBP(),children:"WEBP"})]})]}),e.jsx("br",{}),e.jsx("br",{}),e.jsx("hr",{}),e.jsx("br",{}),e.jsx("button",{autoFocus:!0,type:"button",className:"apc-mpc-widget-btn",onClick:()=>i(),style:{backgroundColor:"red",color:"#ffffff",float:"right"},children:"Close"})]})};return e.jsxs(p.Fragment,{children:[e.jsxs("button",{className:"apc-mpc-widget-btn",onClick:()=>w(),role:"dialog",style:{backgroundColor:xe(r.primaryColor,40),color:"#ffffff",float:"right"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:"#ffffff",d:Rr})}),"  Download"]}),f()]})}function hn(m){var Ce;const{theme:r,activeSection:n,selectedObjectType:c,renderQuickActions:a,renderActionItems:d,canvasEl:x,zoomIn:h,zoomOut:j,apcCanvasInstance:o,setActiveSection:v,saveActiveDesign:u,reloadTabs:w,initProductName:i,historyRef:y,currentState:f,setCurrentState:b,setHistory:s,activeTabName:k,isPlainColor:_,selectedProduct:T,isMobile:R,supportedProductColors:P,canvasId:z}=m,[I,H]=p.useState(),[X,Q]=p.useState([]),[ie,re]=p.useState(0),[ae,pe]=p.useState(!1),je=p.useRef(null),[Ne,Me]=p.useState(!1),[ze,Ve]=p.useState(null),[ne,qe]=p.useState(),[Re,Ue]=p.useState(),[Le,_e]=p.useState(),[be,J]=p.useState(!0),[Oe,Ae]=p.useState(),se=()=>{Me(!0),pe(!1)},Ie=()=>{Me(!1)},de=()=>{pe(N=>!N)};p.useEffect(()=>{const N=A=>{je.current&&je.current.contains(A.target)||pe(!1)};return document.addEventListener("mousedown",N),()=>{document.removeEventListener("mousedown",N)}},[]),p.useEffect(()=>{(async()=>{var A,Y;if(I)try{const F=await Ke(I);_e(F),(A=F==null?void 0:F.misc)!=null&&A.colorSettings&&qe(F.misc.colorSettings),((Y=F==null?void 0:F.misc)==null?void 0:Y.type)!=="subsection"&&Ae(F)}catch(F){console.error("Error fetching tab data: ",F)}})()},[I,w]),p.useEffect(()=>{(async()=>{const A=await Te();let Y=A?A.filter(F=>{var Z;return F.classification!=="cart"&&((Z=F.misc)==null?void 0:Z.type)!=="subsection"}).map(F=>F.id):[];Y.length===0&&Y.push("design"),ie===0&&H(Y[0]),Q(Y)})()},[ie,w]);const ye=()=>{o&&(o.clear(),o.renderAll())},ue=N=>{if(!o)return;o.backgroundColor="transparent",o&&o.requestRenderAll();let A=o.backgroundImage;A&&(A.filters=[],A.filters.push(new B.fabric.Image.filters.BlendColor({color:N})),A.applyFilters(),o&&o.requestRenderAll(),Ue(N),u(o,Le))},ge=()=>{if(!(!ne||(ne==null?void 0:ne.length)<=1))return ne.map((N,A)=>e.jsxs(p.Fragment,{children:[e.jsx("div",{role:"button",className:"apc-mpx-widget-circle",style:{backgroundColor:N,cursor:"pointer",border:"solid 1px #ffffff"},onClick:()=>ue(N)})," "]},A))},We=async(N,A)=>{var me,te;const Y=(te=(me=o==null?void 0:o.backgroundImage)==null?void 0:me.filters[0])==null?void 0:te.color,F=await Ke(N);if(!F)return;const Z=F!=null&&F.content?JSON.parse(F.content):null;Z&&o?(o.clear(),o.setBackgroundImage(null),o.loadFromJSON(Z,()=>{var Se;o.renderAll(),v(F),((Se=F==null?void 0:F.misc)==null?void 0:Se.type)!=="subsection"?(sessionStorage.setItem("apc_x_activeTab",N),J(!0)):(J(!1),Y&&ue(Y)),H(N)})):console.error("Failed to load JSON content for section:",N)},we=()=>X.map(N=>e.jsx("button",{className:`tablinks ${I===N?"active":null}`,onClick:()=>We(N),children:N},N)),Ee=()=>{Te().then(N=>{if(N&&N.length>0){const A=N[0],Y=JSON.parse(A.content);o.loadFromJSON(Y,function(){o.off("object:modified"),o.on({"object:modified":F=>{u(o,A)}}),H(A.id),sessionStorage.setItem("apc_x_activeTab",A.id),v(A),re(ie+1),o&&o.renderAll()})}else{let A="design";const Y=JSON.stringify(o);He(A,"general",Y,null).then(F=>{Ke(A).then(Z=>{const me=JSON.parse(Z.content);o.loadFromJSON(me,function(){o.off("object:modified"),o.on({"object:modified":te=>{u(o,Z)}}),H(A),sessionStorage.setItem("apc_x_activeTab",A),v(Z),re(ie+1),o&&o.renderAll()})})})}})},$e=()=>{Ur(I).then(N=>{Ie(),Ee()})},Qe=()=>o?e.jsxs(lt,{isOpen:Ne,onClose:Ie,children:[e.jsx("div",{children:e.jsxs("h3",{style:{marginLeft:"30%",color:"green"},children:["Are you sure you want to delete ",e.jsx("u",{children:I})," ?"]})}),e.jsx("br",{}),e.jsx("br",{}),e.jsx("hr",{}),e.jsx("br",{}),e.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:10},children:[e.jsx("div",{children:e.jsx("button",{autoFocus:!0,type:"button",className:"apc-mpc-widget-btn",onClick:()=>$e(),style:{backgroundColor:"green",color:"#ffffff"},children:"Yes"})}),e.jsx("div",{children:e.jsx("button",{autoFocus:!0,type:"button",className:"apc-mpc-widget-btn",onClick:()=>Ie(),style:{backgroundColor:"red",color:"#ffffff",float:"right"},children:"Close"})})]})]}):null,Be=()=>e.jsxs("div",{className:"apc-mpx-widget-button-group-container",children:[e.jsx("div",{className:"apc-mpx-widget-generic-icon",onClick:de,children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 448 512",children:e.jsx("path",{fill:"#ffffff",d:Er})})}),ae&&e.jsxs("div",{className:"apc-mpx-widget-popper-container",ref:je,children:[e.jsx("div",{className:"apc-mpx-widget-popper-arrow-up"}),e.jsxs("ul",{autoFocus:!0,style:{paddingInlineStart:"2px",marginBlockStart:"6px",marginBlockEnd:"2px",fontSize:"13px",padding:"3px",color:xe(r.primaryColor,80),width:"max-content"},children:[e.jsxs("li",{className:"apc-mpx-widget-popper-li",style:{height:"25px",cursor:"pointer",borderBottom:"1px solid #d7d7d7"},onClick:()=>se(),role:"dialog",children:[e.jsx("svg",{className:"apc-mpx-hover-div",xmlns:"http://www.w3.org/2000/svg",height:"16",width:"14",viewBox:"0 0 448 512",children:e.jsx("path",{d:Lt,fill:xe(r.primaryColor,80)})}),"  Delete"]}),e.jsxs("li",{className:"apc-mpx-widget-popper-li",style:{height:"25px",cursor:"pointer",marginBlockStart:"5px"},onClick:()=>ye(),role:"dialog",children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",className:"apc-mpx-hover-div",width:"14",viewBox:"0 0 576 512",children:e.jsx("path",{d:Tr,fill:xe(r.primaryColor,80)})}),"  Clear"]})]})]})]}),Ze=N=>{var te,Se,Fe,Je;const A=o.width*5,Y=o.height*5,F=JSON.parse(Oe.content),Z=(Se=(te=F==null?void 0:F.backgroundImage)==null?void 0:te.filters[0])==null?void 0:Se.color,me=(Je=(Fe=o==null?void 0:o.backgroundImage)==null?void 0:Fe.filters[0])==null?void 0:Je.color;Ke(N.sectionName).then(async l=>{if(l){const O=l!=null&&l.content?JSON.parse(l.content):null;O&&o?(await o.loadFromJSON(O,()=>{o.renderAll(),v(l),H(N.sectionName);const E=JSON.stringify(o),C={};C.id=N.sectionName,C.classification=T==null?void 0:T.name,C.json=E,C.misc={sectionName:N.sectionName,sectionImage:N.sectionImage,type:N.type},o.off("object:modified"),o.on({"object:modified":W=>{u(o,C)}})}),ue(me),be||J(!0)):console.error("Failed to load JSON content for section:",N.sectionName)}else o&&o.clear(),N.type="subsection",B.fabric.Image.fromURL(N.sectionImage,function(O){O.width=A,O.height=Y,O.scaleToWidth(A),O.scaleToHeight(Y),o.setBackgroundImage(O),(Re||Z)&&(O.filters=[],O.filters.push(new B.fabric.Image.filters.BlendColor({color:Re||Z})),O.applyFilters());const E=JSON.stringify(o),C={};C.id=N.sectionName,C.classification=Oe.id,C.json=E,C.misc={sectionName:N.sectionName,sectionImage:N.sectionImage,type:N.type},o.off("object:modified"),o.on({"object:modified":W=>{u(o,C)}}),He(N.sectionName,I,E,{...N}).then(W=>{o&&(o.renderAll(),be&&J(!1),H(N.sectionName),re(ie+1))})},{crossOrigin:"anonymous"})})},et=()=>{if(!Le)return null;let N=[];if(T){const A=T.sections.map(Y=>({...Y,type:"subsection"}));N.push(...A),N.push({sectionName:T==null?void 0:T.name,sectionImage:T==null?void 0:T.mainImage,type:"main"})}return N=N==null?void 0:N.map(A=>({...A,active:A.sectionName===I})),(N==null?void 0:N.length)<1?null:N==null?void 0:N.map((A,Y)=>{var F,Z;return e.jsxs("div",{onClick:()=>Ze(A),style:{position:"relative",backgroundColor:"#ff000026",border:"solid 1px #ffffff",padding:"2px",borderRadius:"6px",cursor:"pointer",textAlign:"center"},children:[A.active&&e.jsx("div",{style:{position:"absolute",top:"5px",right:"5px",width:"12px",height:"12px",backgroundColor:"green",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx("span",{style:{color:"white",fontSize:"8px",fontWeight:"bold"},children:"✓"})}),!R&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"5px"},children:e.jsx("img",{src:A==null?void 0:A.sectionImage,width:50,height:50,alt:(A==null?void 0:A.sectionName)||"section image",style:{borderRadius:"6px"}})}),e.jsx("div",{style:{fontSize:"12px",color:"#333"},children:((F=A==null?void 0:A.sectionName)==null?void 0:F.length)>5?`${(Z=A==null?void 0:A.sectionName)==null?void 0:Z.substring(0,5)}...`:(A==null?void 0:A.sectionName)||"view"})]},Y)})},De=()=>{if(y.current.length>0){const N=y.current.pop();o.loadFromJSON(N,()=>{o.renderAll(),b(N)})}};return e.jsxs(p.Fragment,{children:[e.jsx("div",{className:"tab",children:we()}),e.jsxs("div",{style:{display:"flex",backgroundColor:r.primaryColor,flexDirection:"row",padding:"3px",color:"#ffffff",minHeight:"30px"},children:[e.jsx("div",{style:{flexBasis:"40%",marginTop:"8px"},children:e.jsx("div",{style:{display:"flex",flexDirection:"row"},children:e.jsxs("div",{children:[e.jsx("button",{style:{border:"none",backgroundColor:"transparent",color:"#ffffff",fontWeight:"bold",cursor:"pointer",height:"12px"},onClick:()=>De(),title:"UNDO",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"25",className:"apc-mpx-hover-div",width:"25",viewBox:"0 0 16 16",children:e.jsx("path",{d:Mr,fill:"#ffffff"})})})," "]})})}),e.jsx("div",{style:{flexBasis:"20%"},children:c?a():null}),e.jsx("div",{style:{flexBasis:"40%",marginTop:"8px"},children:c?d():null}),Be()]}),e.jsxs("div",{id:"apc-mpx-editor-canvas-container",style:{minHeight:"90vh",padding:"3px",overflowX:"hidden",position:"relative"},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"row"},children:[e.jsx("div",{children:e.jsx("div",{style:{zIndex:1e3,overflow:"hidden",position:"absolute",marginLeft:"1%",display:"flex",flexDirection:"row"},children:((Ce=T==null?void 0:T.sections)==null?void 0:Ce.length)>0?et():null})}),e.jsx("div",{children:e.jsx("canvas",{id:z??"apc-mpx-editor-canvas",ref:x,height:1e3})}),ne&&(_||(n==null?void 0:n.plainColor)==="Y")&&be&&(ne==null?void 0:ne.length)>1?e.jsxs("div",{style:{zIndex:1e3,overflow:"hidden",position:"absolute",marginLeft:"90%"},children:[e.jsx("br",{}),e.jsx("div",{style:{backgroundColor:"#ff000026",border:"solid 1px #ccc",padding:"3px",borderRadius:"6px"},children:ne&&(ne==null?void 0:ne.length)>1?ge():null})]}):null]}),e.jsxs("div",{style:{marginLeft:"45%"},children:[e.jsx("br",{}),e.jsx("button",{style:{height:"35px",width:"65px",cursor:"pointer"},"aria-label":"zoom in",onClick:()=>h(),children:"+"}),e.jsx("button",{style:{height:"35px",width:"65px",cursor:"pointer"},"aria-label":"zoom out",onClick:()=>j(),children:"-"})]})]}),Qe()]})}function pn({data:m,theme:r,apcCanvasInstance:n,closeMobileModalSecondaryPanel:c,isMobile:a}){const[d,x]=p.useState({}),h=u=>{x(w=>({...w,[u]:!w[u]}))},j=async u=>{const w=await Bt(u);w&&B.fabric.Image.fromURL(w,i=>{i.set({left:100,top:100,scaleX:.3,scaleY:.3}),n.add(i),n.renderAll(),a&&c(!0)})},o=(u,w="",i=0)=>e.jsx("ul",{style:{listStyleType:"none",paddingLeft:`${i*20}px`,margin:"0"},children:Object.keys(u).map(y=>{const f=`${w}/${y}`,b=d[f];return u[y].type==="image"?e.jsx("li",{children:e.jsx("div",{onClick:()=>j(u[y].url),style:{cursor:"pointer"},children:e.jsx("img",{src:u[y].url,alt:y,style:{width:"100px",height:"auto"}})})},f):e.jsxs("li",{children:[e.jsxs("div",{onClick:()=>h(f),style:{cursor:"pointer",display:"flex",alignItems:"center",fontWeight:"bold",color:r.primaryColorLight},children:[e.jsx("div",{style:{marginRight:"5px"},children:b?e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",height:15,width:15,children:e.jsx("path",{d:Dr,fill:r.primaryColorLight})}):e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",height:15,width:15,children:e.jsx("path",{d:Fr,fill:r.primaryColorLight})})}),y]}),b&&o(u[y],f,i+1)]},f)})}),v=un(m);return e.jsx("div",{children:o(v)})}function un(m){const r={};return m.forEach(n=>{const c=n.name.split("/");let a=r;c.forEach((d,x)=>{a[d]||(a[d]=x===c.length-1?n:{}),a=a[d]})}),r}function fn(m){const{apcCanvasInstance:r,theme:n,apiEndpoint:c,isMobile:a,closeMobileModalSecondaryPanel:d,apiKey:x}=m,h=`${c}/api/v1/designer`,[j,o]=p.useState([]),[v,u]=p.useState(!1),[w,i]=p.useState(!1),[y,f]=p.useState(!1),b=sessionStorage.getItem("apc_x_sub_status"),s=sessionStorage.getItem("apc_x_stickers");p.useEffect(()=>{u(!0),(async()=>{b==="active"?i(!0):await _(),s?(o(JSON.parse(s)),u(!1)):await k()})()},[]);const k=()=>{u(!0);const T=`${h}/get-stickers`;ve.get(T).then(R=>{R.data.object&&(o(R.data.object.contents),sessionStorage.setItem("apc_x_stickers",JSON.stringify(R.data.object.contents)))}).catch(R=>{console.error("Error fetching data:",R)}).finally(()=>{u(!1)})},_=()=>{u(!0);const T=`${h}/get-subscription-status/${x}`;ve.get(T).then(R=>{R.data.object&&R.data.object==="active"&&(sessionStorage.setItem("apc_x_sub_status","active"),i(!0))}).catch(R=>{sessionStorage.setItem("apc_x_sub_status","")}).finally(()=>{u(!1),f(!0)})};return!w&&!v&&y?e.jsx(ct,{theme:n}):w&&j.length>0&&!v?e.jsx(p.Fragment,{children:e.jsx("div",{style:{padding:"10px"},children:e.jsx(pn,{data:j,theme:n,apcCanvasInstance:r,isMobile:a,closeMobileModalSecondaryPanel:d})})}):e.jsx("div",{children:e.jsx(at,{})})}const Ft=p.forwardRef((m,r)=>{const{theme:n=ar,canvasId:c=null,readOnly:a=!1,apiKey:d=null,apiEndpoint:x,enabledModules:h=["TXT","STICKERS","SHAPES","ICONS","IMAGE","QUOTE","BACKGROUND","QRCODE","BARCODE"],actionButtons:j={share:!1,download:!0},initInstance:o=null,initCategory:v=null,additionalActionButton:u=null,initProductName:w,isPlainColor:i,product:y={name:"Premium Crew Neck T-Shirt",category:"Tshirts",description:"Men's crew neck t-shirts",plainColor:"Y",mainImage:"https://static.mypixia.com/prod/products/96ca4acb-c426-4619-a2c4-7acd95b78451.png",colorSettings:["#FF0000","#0000FF","#008000","#000000","#FFFFFF","#808080","#FFFF00"],sections:[{sectionName:"Sleeve-left",sectionImage:"https://static.mypixia.com/prod/products/27b8c138-af4e-4ea0-833d-88b10fbd3cf7.png"},{sectionName:"Back",sectionImage:"https://static.mypixia.com/prod/products/d4c53776-7b7d-41c5-a6b5-2bf5876cd26e.png"}]}}=m,[f,b]=p.useState(h[0]),[s,k]=p.useState(),_=p.useRef(null),[T,R]=p.useState(),[P,z]=p.useState(!1),[I,H]=p.useState(1),X=.1,[Q,ie]=p.useState(1),[re,ae]=p.useState([]),[pe,je]=p.useState(null),[Ne,Me]=p.useState(null),[ze,Ve]=p.useState(0),[ne,qe]=p.useState(),[Re,Ue]=p.useState(null),Le=p.useRef([]),[_e,be]=p.useState(null),[J,Oe]=p.useState(!1),[Ae,se]=p.useState(!1);p.useEffect(()=>{const l=()=>Oe(window.innerWidth<600);return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[]),p.useEffect(()=>{var K;const l=document.getElementById("apc-mpx-editor-canvas-container"),O=document.getElementById("apc-mpx-editor-canvas-container");if(!_.current||!l||!O){console.error("Canvas element is not mounted yet!");return}const E={isDrawingMode:!1,selection:!0,selectionBorderColor:"#008000",height:O.offsetHeight,width:l.offsetWidth,enableRetinaScaling:!0};let C,W;if(a)C=new B.fabric.StaticCanvas(_.current,E);else if(C=new B.fabric.Canvas(_.current,E),Ne)W=JSON.parse(Ne),C.loadFromJSON(W,function(){});else if(o){let L;try{L=JSON.parse(o)}catch(D){console.error("Failed to parse initInstance",D)}C&&L?C.loadFromJSON(L,function(){}):console.error("Canvas or InitInstance is not properly initialized")}else{const L=new B.fabric.Textbox("Something cool!",{width:300,left:250,top:300,fontFamily:"aclonica",fill:"#6a45d2",rotate:20});L.shadow={color:"rgba(0,0,0,0.5)",blur:10,offsetX:5,offsetY:5},C.add(L),y!=null&&y.mainImage&&((K=B.fabric.Image)==null||K.fromURL(y.mainImage,function(D){D.height=O.offsetHeight,D.width=l.offsetWidth,D.scaleToWidth(O.offsetHeight),D.scaleToHeight(l.offsetWidth),C.setBackgroundImage(D),C.setActiveObject(L),ye(L),C&&(C.renderAll(),Ce(C))},{crossOrigin:"anonymous"}))}return C.on({"selection:updated":L=>{const D=C.getActiveObject();ye(D)},"selection:created":L=>{const D=C.getActiveObject();ye(D)},"selection:cleared":L=>{ue()},"object:modified":L=>{Ce(C),de(C)},"object:added":L=>{de(C)},"object:removed":L=>{de(C)},"object:created":L=>{de(C)}}),k(C),ie(l.offsetWidth),()=>{k(null),C.off({"selection:updated":L=>{const D=C.getActiveObject();ye(D)},"selection:created":L=>{const D=C.getActiveObject();ye(D)},"selection:cleared":L=>{ue()},"object:modified":L=>{Ce(C),de(C)},"object:added":L=>{de(C)},"object:removed":L=>{de(C)},"object:created":L=>{de(C)}}),C.dispose()}},[Ne]),p.useEffect(()=>(Ie(),document.addEventListener("keydown",l=>De(l)),()=>{document.removeEventListener("keydown",l=>De(l))}),[s]),p.useEffect(()=>{if(s){const l=document.getElementById("apc-mpx-editor-canvas-container"),O=()=>{const E=l.offsetWidth/Q;s.setZoom(E)};return window.addEventListener("resize",O),()=>{window.removeEventListener("resize",O)}}},[s,I]),p.useEffect(()=>{const l=()=>{if(s&&_.current){const O=s.getWidth(),E=s.getHeight(),C=window.innerWidth,W=window.innerHeight,K=C/O,L=W/E,D=Math.min(K,L);s.setZoom(D/1.4),s.renderAll()}};return J&&(l(),window.addEventListener("resize",l)),()=>window.removeEventListener("resize",l)},[s,J]),p.useImperativeHandle(r,()=>({getDesign:()=>A()}),[s]),p.useEffect(()=>{if(c&&s){const l=document.getElementById(c);l&&(l.instance={getDesignFormats:A})}},[c,s]);const Ie=()=>{Te().then(l=>{if(l&&l.length>0){const O=l[0].content;w===l[0].id&&Me(O)}})},de=l=>{if(l){const O=l.toJSON();Ue(E=>(Le.current.push(E),O))}},ye=l=>{R(l.type)},ue=()=>{R(null)},ge=()=>{s.getActiveObject()&&s.remove(s.getActiveObject())},We=()=>{const l=s.getActiveObject(),O=B.fabric.util.object.clone(l);O.set({left:l.left+20,top:l.top+20}),s.add(O)},we=l=>{je(l)},Ee=l=>{let O=re;O.push(l),ae(O)},$e=l=>{l==="lock"?s.getActiveObject().set({lockMovementX:!0,lockMovementY:!0}):s.getActiveObject().set({lockMovementX:!1,lockMovementY:!1})},Qe=()=>{s&&(s.getActiveObject().bringForward(),s.renderAll())},Be=()=>{s&&(s.getActiveObject().sendBackwards(),s.renderAll())},Ze=()=>{const l=I+X;H(l),s.setZoom(l)},et=()=>{const l=Math.max(I-X,X);H(l),s.setZoom(l)},De=l=>{s&&s.getActiveObject()&&s.getActiveObject().type!=="textbox"&&l.keyCode===8&&ge()},Ce=l=>{const O=sessionStorage.getItem("apc_x_activeTab");if(O)Ke(O).then(E=>{if(E){const C=JSON.stringify(l);He(E.id,E.classification,C,E.misc).then(W=>{})}else{const C=JSON.stringify(l);He(y.name??"design","general",C,y).then(W=>{})}});else{const E=JSON.stringify(l);He(y.name??"design","general",E,y).then(C=>{})}},N=(l,O)=>{const E=JSON.stringify(l);He(O.id,O.classification,E,O.misc).then(C=>{})},A=()=>({getPDF:()=>{const{height:l,width:O}=s;return Te().then(async E=>{let C=[];for(let W in E){let K,L;await fe(E[W].content,l,O,"pdf").then(D=>{K=D}),await nt({fabricString:E[W].content,height:l,width:O}).then(D=>{L=D}),C.push({fullDesign:K,printReady:L})}return C})},getPNG:()=>{const{height:l,width:O}=s;return Te().then(async E=>{let C=[];for(let W in E){let K,L;await fe(E[W].content,l,O,"png").then(D=>{K=D}),await nt({fabricString:E[W].content,height:l,width:O}).then(D=>{L=D}),C.push({fullDesign:K,printReady:L})}return C})},getSVG:()=>{const{height:l,width:O}=s;return Te().then(async E=>{let C=[];for(let W in E){let K,L;await fe(E[W].content,l,O,"svg").then(D=>{K=D}),await nt({fabricString:E[W].content,height:l,width:O}).then(D=>{L=D}),C.push({fullDesign:K,printReady:L})}return C})},getJPEG:()=>{const{height:l,width:O}=s;return Te().then(async E=>{let C=[];for(let W in E){let K,L;await fe(E[W].content,l,O,"jpeg").then(D=>{K=D}),await nt({fabricString:E[W].content,height:l,width:O}).then(D=>{L=D}),C.push({fullDesign:K,printReady:L})}return C})},getWEBP:()=>{const{height:l,width:O}=s;return Te().then(async E=>{let C=[];for(let W in E){let K,L;await fe(E[W].content,l,O,"webp").then(D=>{K=D}),await nt({fabricString:E[W].content,height:l,width:O}).then(D=>{L=D}),C.push({fullDesign:K,printReady:L})}return C})},getImageActiveTab:()=>{const l=sessionStorage.getItem("apc_x_activeTab");return Ke(l).then(O=>fe(O.content,s.height,s.width,"png").then(E=>{let C={};return C.file=E,C.height=s.height,C.width=s.width,C}))}}),Y=()=>e.jsxs("div",{style:{marginTop:"6px",fontWeight:"bold"},children:["Replace Image: ",e.jsx("input",{type:"file",accept:"image/*",onChange:l=>F(l)}),e.jsx("br",{})]}),F=(l,O)=>{{const E=s.getActiveObject(),C=l.target.files[0],W=new FileReader;W.onload=function(K){const L=K.target.result;E.setSrc(L,function(D){D.set({angle:30}),s&&s.renderAll()})},W.readAsDataURL(C)}s&&s.renderAll()},Z=()=>{switch(f){case"ICONS":return e.jsx(en,{apcCanvasInstance:s,theme:n,apiKey:d,isMobile:J,closeMobileModalSecondaryPanel:l=>se(!l)});case"TEMPLATES":return e.jsx(Wr,{apcCanvasInstance:s,theme:n,apiKey:d,apiEndpoint:x,reloadTabs:l=>Ve(l),updateActiveSection:l=>we(l),initCategory:v,currentTabNo:ze,initInstance:o,setActiveTab:l=>be(l),isMobile:J,closeMobileModalSecondaryPanel:l=>se(!l)});case"TXT":return e.jsx(qr,{apcCanvasInstance:s,theme:n,apiKey:d,isMobile:J,closeMobileModalSecondaryPanel:l=>se(!l)});case"IMAGE":return e.jsx(Zr,{apcCanvasInstance:s,theme:n,apiKey:d,apiEndpoint:x,isMobile:J,closeMobileModalSecondaryPanel:l=>se(!l)});case"STICKERS":return e.jsx(fn,{apcCanvasInstance:s,theme:n,apiEndpoint:x,isMobile:J,apiKey:d,closeMobileModalSecondaryPanel:l=>se(!l)});case"SHAPES":return e.jsx(zt,{apcCanvasInstance:s,theme:n,apiKey:d,isMobile:J,closeMobileModalSecondaryPanel:l=>se(!l)});case"QUOTE":return e.jsx(tn,{apcCanvasInstance:s,theme:n,apiKey:d,apiEndpoint:x,isMobile:J,closeMobileModalSecondaryPanel:l=>se(!l)});case"BACKGROUND":return e.jsx(rn,{apcCanvasInstance:s,theme:n,apiKey:d,apiEndpoint:x,updateActiveSection:l=>we(l),reloadTabs:l=>Ve(l),currentTabNo:ze,isMobile:J,closeMobileModalSecondaryPanel:l=>se(!l)});case"QRCODE":return e.jsx(nn,{apcCanvasInstance:s,theme:n,apiKey:d,apiEndpoint:x,isMobile:J,closeMobileModalSecondaryPanel:l=>se(!l)});case"BARCODE":return e.jsx(sn,{apcCanvasInstance:s,theme:n,apiKey:d,apiEndpoint:x,isMobile:J,closeMobileModalSecondaryPanel:l=>se(!l)});case"SIZE":return e.jsx(on,{apcCanvasInstance:s,theme:n,apiKey:d,isMobile:J,closeMobileModalSecondaryPanel:l=>se(!l)});default:return e.jsx(zt,{apcCanvasInstance:s,theme:n,apiKey:d,isMobile:J,closeMobileModalSecondaryPanel:l=>se(!l)})}},me=()=>{if(!T)return null;switch(T){case"text":return e.jsx(Rt,{apcCanvasInstance:s,theme:n,apiKey:d});case"textbox":return e.jsx(Rt,{apcCanvasInstance:s,theme:n,apiKey:d});case"rect":return e.jsx(Ye,{apcCanvasInstance:s,theme:n,apiKey:d});case"circle":return e.jsx(Ye,{apcCanvasInstance:s,theme:n,apiKey:d});case"triangle":return e.jsx(Ye,{apcCanvasInstance:s,theme:n,apiKey:d});case"line":return e.jsx(Ye,{apcCanvasInstance:s,theme:n,apiKey:d});case"path":return e.jsx(Ye,{apcCanvasInstance:s,theme:n,apiKey:d});case"polygon":return e.jsx(Ye,{apcCanvasInstance:s,theme:n,apiKey:d});case"image":return Y();default:return null}},te=l=>{b(l),J&&se(!0)},Se=()=>e.jsx("div",{id:"selectionRectangle",style:{marginLeft:"auto",position:"relative"},children:e.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:10,marginTop:"8px"},children:[e.jsxs("div",{className:"apc-mpx-tooltip-container",role:"button",onClick:()=>ge(),style:{cursor:"pointer"},children:[e.jsx("svg",{className:"apc-mpx-hover-div",xmlns:"http://www.w3.org/2000/svg",height:"16",width:"14",viewBox:"0 0 448 512",children:e.jsx("path",{d:Lt,fill:"#d8d4d4"})}),e.jsx("div",{className:"apc-mpx-tooltip-text",children:"Delete"})]}),e.jsxs("div",{className:"apc-mpx-tooltip-container",role:"button",onClick:()=>Be(),style:{cursor:"pointer"},children:[e.jsxs("svg",{className:"apc-mpx-hover-div",xmlns:"http://www.w3.org/2000/svg",fill:"#d8d4d4",width:"20px",height:"20px",viewBox:"0 0 32 32",children:[e.jsx("path",{d:"M28,10H22V4a2,2,0,0,0-2-2H4A2,2,0,0,0,2,4V20a2,2,0,0,0,2,2h6v6a2.0023,2.0023,0,0,0,2,2H28a2.0023,2.0023,0,0,0,2-2V12A2.0023,2.0023,0,0,0,28,10ZM12,28V12H28l.0015,16Z"}),e.jsx("rect",{style:{fill:"none"},width:"32",height:"32"})]}),e.jsx("div",{className:"apc-mpx-tooltip-text",children:"Send to back"})]}),e.jsxs("div",{className:"apc-mpx-tooltip-container",role:"button",onClick:()=>Qe(),style:{cursor:"pointer"},children:[e.jsxs("svg",{className:"apc-mpx-hover-div",xmlns:"http://www.w3.org/2000/svg",fill:"#d8d4d4",width:"20px",height:"20px",viewBox:"0 0 32 32",children:[e.jsx("path",{d:"M28,10H22V4a2.0023,2.0023,0,0,0-2-2H4A2.0023,2.0023,0,0,0,2,4V20a2.0023,2.0023,0,0,0,2,2h6v6a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V12A2,2,0,0,0,28,10ZM4,20,3.9985,4H20v6H12a2,2,0,0,0-2,2v8Z"}),e.jsx("rect",{style:{fill:"none"},height:"32",width:"32"})]}),e.jsx("div",{className:"apc-mpx-tooltip-text",children:"Bring to front"})]}),e.jsxs("div",{className:"apc-mpx-tooltip-container",onClick:()=>$e("lock"),style:{cursor:"pointer"},children:[e.jsx("svg",{className:"apc-mpx-hover-div",xmlns:"http://www.w3.org/2000/svg",height:"16",width:"14",viewBox:"0 0 448 512",children:e.jsx("path",{fill:"#d8d4d4",d:"M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z"})}),e.jsx("div",{className:"apc-mpx-tooltip-text",children:"Lock"})]}),e.jsxs("div",{className:"apc-mpx-tooltip-container",onClick:()=>$e("unlock"),style:{cursor:"pointer"},children:[e.jsx("svg",{className:"apc-mpx-hover-div",xmlns:"http://www.w3.org/2000/svg",height:"16",width:"18",viewBox:"0 0 576 512",children:e.jsx("path",{fill:"#d8d4d4",d:"M423.5 0C339.5 .3 272 69.5 272 153.5V224H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48h-48v-71.1c0-39.6 31.7-72.5 71.3-72.9 40-.4 72.7 32.1 72.7 72v80c0 13.3 10.7 24 24 24h32c13.3 0 24-10.7 24-24v-80C576 68 507.5-.3 423.5 0z"})}),e.jsx("div",{className:"apc-mpx-tooltip-text",children:"Unlock"})]}),e.jsxs("div",{className:"apc-mpx-tooltip-container",onClick:()=>We(),style:{cursor:"pointer"},children:[e.jsx("svg",{className:"apc-mpx-hover-div",xmlns:"http://www.w3.org/2000/svg",height:"16",width:"16",viewBox:"0 0 512 512",children:e.jsx("path",{fill:"#d8d4d4",d:"M464 0c26.5 0 48 21.5 48 48v288c0 26.5-21.5 48-48 48H176c-26.5 0-48-21.5-48-48V48c0-26.5 21.5-48 48-48h288M176 416c-44.1 0-80-35.9-80-80V128H48c-26.5 0-48 21.5-48 48v288c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48v-48H176z"})}),e.jsx("div",{className:"apc-mpx-tooltip-text",children:"Duplicate"})]})]})}),Fe=()=>s?e.jsx("div",{style:{height:"10vh",overflow:"auto"},children:e.jsx(lt,{isOpen:Ae,onClose:()=>se(!1),children:Z()})}):null,Je=()=>s?J?Fe():Z():null;return e.jsxs("div",{className:"apc-mpc-widget-wrapper",children:[e.jsxs("div",{style:{display:"flex",backgroundColor:xe(n.primaryColor,70),flexDirection:"row",padding:"3px",color:"#ffffff",minHeight:"30px"},children:[e.jsx("div",{style:{flexBasis:"40%"},children:e.jsx("div",{style:{float:"left"},children:e.jsxs("button",{onClick:()=>window.history.back(),style:{backgroundColor:"transparent",color:"#ffffff",border:"solid #ffffff 1px",padding:"4px",width:"auto",borderRadius:"4px",fontWeight:"bold"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 448 512",children:e.jsx("path",{fill:"#ffffff",d:Pr})})," Back"]})})}),e.jsx("div",{style:{flexBasis:"20%"}}),e.jsx("div",{style:{flexBasis:"40%"},children:e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:10},children:e.jsx("div",{children:e.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:5},children:[e.jsx("div",{children:s&&j.share?e.jsx("div",{children:e.jsx(ln,{apcCanvasInstance:s,theme:n})}):null}),e.jsx("div",{children:s&&j.download?e.jsx("div",{children:e.jsx(dn,{apcCanvasInstance:s,theme:n,apiKey:d,updateSelectedSections:l=>Ee(l),updateActiveSection:l=>we(l),accesories,getDesignFormats:A()})}):null}),e.jsx("div",{children:s&&u?e.jsx("div",{children:e.jsx("button",{className:"apc-mpc-widget-btn",onClick:()=>u.btnAction(),style:{backgroundColor:u.btnColor??n.primaryColorLight,color:"#ffffff",border:"solid #ffffff 1px"},children:u.btnLabel})}):null})]})})})})]}),e.jsxs("div",{className:"apc-mpc-widget-colums",children:[e.jsx("div",{className:"apc-mpc-widget-colum-modules-container",children:e.jsxs("div",{className:"apc-mypixia-widget-primary-nav-container",children:[h.indexOf("TXT")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("TXT"),style:{padding:"10px",backgroundColor:f==="TXT"?n.primaryColorLight:"inherit",color:f==="TXT"?"#ffffff":"inherit"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"14",viewBox:"0 0 448 512",style:{fill:f==="TXT"?"#ffffff":n.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:Sr})}),e.jsx("div",{children:"Text"})]}):null,h.indexOf("STICKERS")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("STICKERS"),style:{padding:"10px",backgroundColor:f==="STICKERS"?n.primaryColorLight:"inherit",color:f==="STICKERS"?"#ffffff":"inherit"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"20",viewBox:"0 0 640 512",style:{fill:f==="STICKERS"?"#ffffff":n.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:Br})}),e.jsx("div",{children:"Stickers"})]}):null,h.indexOf("SHAPES")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("SHAPES"),style:{padding:"10px",backgroundColor:f==="SHAPES"?n.primaryColorLight:"inherit",color:f==="SHAPES"?"#ffffff":"inherit"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"16",viewBox:"0 0 512 512",style:{fill:f==="SHAPES"?"#ffffff":n.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:wr})}),e.jsx("div",{children:"Shapes"})]}):null,h.indexOf("ICONS")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("ICONS"),style:{padding:"10px",backgroundColor:f==="ICONS"?n.primaryColorLight:"inherit",color:f==="ICONS"?"#ffffff":"inherit"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"16",viewBox:"0 0 512 512",style:{fill:f==="ICONS"?"#ffffff":n.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:Cr})}),e.jsx("div",{children:"Icons"})]}):null,h.indexOf("IMAGE")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("IMAGE"),style:{padding:"10px",backgroundColor:f==="IMAGE"?n.primaryColorLight:"inherit",color:f==="IMAGE"?"#ffffff":"inherit"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"18",viewBox:"0 0 512 512",style:{fill:f==="IMAGE"?"#ffffff":n.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:_t})}),e.jsx("div",{children:"Upload"})]}):null,h.indexOf("QUOTE")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("QUOTE"),style:{padding:"10px",backgroundColor:f==="QUOTE"?n.primaryColorLight:"inherit",color:f==="QUOTE"?"#ffffff":"inherit"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"16",viewBox:"0 0 512 512",style:{fill:f==="QUOTE"?"#ffffff":n.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:kr})}),e.jsx("div",{children:"Quote"})]}):null,h.indexOf("BACKGROUND")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("BACKGROUND"),style:{padding:"10px",backgroundColor:f==="BACKGROUND"?n.primaryColorLight:"inherit",color:f==="BACKGROUND"?"#ffffff":"inherit"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"20",viewBox:"0 0 640 512",style:{fill:f==="BACKGROUND"?"#ffffff":n.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:Nr})}),e.jsx("div",{children:"Background"})]}):null,h.indexOf("QRCODE")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("QRCODE"),style:{padding:"10px",backgroundColor:f==="QRCODE"?n.primaryColorLight:"inherit",color:f==="QRCODE"?"#ffffff":"inherit"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"20",viewBox:"0 0 640 512",style:{fill:f==="QRCODE"?"#ffffff":n.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:Or})}),e.jsx("div",{children:"QR Code"})]}):null,h.indexOf("BARCODE")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("BARCODE"),style:{padding:"10px",backgroundColor:f==="BARCODE"?n.primaryColorLight:"inherit",color:f==="BARCODE"?"#ffffff":"inherit"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"16",viewBox:"0 0 512 512",style:{fill:f==="BARCODE"?"#ffffff":n.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:Ar})}),e.jsx("div",{children:"Barcode"})]}):null,h.indexOf("SIZE")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("SIZE"),style:{padding:"10px",backgroundColor:f==="SIZE"?n.primaryColorLight:"inherit",color:f==="SIZE"?"#ffffff":"inherit"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"14",viewBox:"0 0 448 512",style:{fill:f==="SIZE"?"#ffffff":n.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:Ir})}),e.jsx("div",{children:"Size"})]}):null]})}),e.jsx("div",{className:"apc-mpc-widget-colum-features-container",children:Je()}),e.jsx("div",{className:"apc-mpc-widget-colum-editor-container",children:e.jsx(hn,{theme:n,activeSection:pe,selectedObjectType:T,renderQuickActions:Se,renderActionItems:me,canvasEl:_,zoomIn:()=>Ze(),zoomOut:()=>et(),apcCanvasInstance:s,setActiveSection:l=>je(l),updateActiveDesignSection:l=>we(l),saveActiveDesign:(l,O)=>N(l,O),reloadTabs:ze,activeTabName:_e,supportedColors:ne,initProductName:w,historyRef:Le,currentState:Re,setCurrentState:l=>Ue(l),isPlainColor:i,selectedProduct:y,isMobile:J,canvasId:c})})]}),e.jsx("div",{id:"apc-mpx-editor-modal-root"}),J?Fe():null]})});Ft.displayName="Mypixia";module.exports=Ft;
34
+ 1px 1px 0 #ff0000`,cursor:"pointer"},Gr={fontFamily:"Arial",fontSize:"40px",color:"#000",width:"300px",transform:"skewX(20deg) skewY(10deg)",textAlign:"center",cursor:"pointer"},Yr={fontFamily:"Arial",fontSize:"40px",color:"#000",textShadow:"0 0 10px green",textAlign:"center",cursor:"pointer"},Kr={fontFamily:"Arial",fontSize:"40px",color:"#000",backgroundColor:"orange",borderRadius:"5px",cursor:"pointer"},Xr={color:"black",fontSize:"40px",opacity:"0.5",fontFamily:"Arial, sans-serif",cursor:"pointer"};function qr(m){const{apcCanvasInstance:r,isMobile:n,closeMobileModalSecondaryPanel:a}=m,l=(i,y)=>{const f=new B.fabric.Textbox("Stay Humble!",{width:300,left:200,top:200,fontFamily:i,fill:y,hasControls:!0});r.add(f),r.setActiveObject(f),n&&a(!0)},d=({primaryTextLabel:i,primaryTextFontFamily:y,primaryTextColor:f,secondaryTextLabel:b,SecondaryTextFontFamily:s,secondaryTextColor:k})=>{const _=new B.fabric.Textbox(i,{fontFamily:y,width:300,left:200,top:200,fill:f}),z=new B.fabric.Textbox(b,{fontFamily:s,fill:k,fontSize:12,width:150});z.top=_.top+_.height+10,z.left=_.left,r.add(_),r.add(z),r.setActiveObject(_),n&&a(!0)},x=(i,y)=>{const f=new B.fabric.Textbox("Adventure Awaits!",{width:300,left:200,top:200,fontFamily:i,fill:y}),b={color:"rgba(0,0,0,0.5)",blur:10,offsetX:5,offsetY:5};f.shadow=b,r.add(f),r.setActiveObject(f),n&&a(!0)},p=()=>{const i=new B.fabric.Textbox("Love More",{left:100,top:100,width:300,fontFamily:"Arial",fill:new B.fabric.Gradient({type:"linear",gradientUnits:"pixels",coords:{x1:0,y1:0,x2:0,y2:50},colorStops:[{offset:0,color:"red"},{offset:1,color:"yellow"}]})});r.add(i),r.setActiveObject(i),n&&a(!0)},j=()=>{const i=new B.fabric.Textbox("Good Vibes Only",{left:150,top:150,fontFamily:"comic sans ms",fontSize:40,width:300,fill:"#000",stroke:"#ff0000",strokeWidth:2});r.add(i),r.setActiveObject(i),n&&a(!0)},c=()=>{const i=new B.fabric.Textbox("Dream Big",{left:300,top:300,width:300,fontFamily:"Arial",fill:"#000",skewX:20,skewY:10});r.add(i),r.setActiveObject(i),n&&a(!0)},v=()=>{const i=new B.fabric.Textbox("Choose Joy",{left:350,top:350,fontFamily:"Arial",fill:"#000",opacity:.5});r.add(i),r.setActiveObject(i),n&&a(!0)},u=()=>{const i=new B.fabric.Textbox("Find Your Fire",{left:550,top:550,fontFamily:"Arial",fill:"#000",shadow:"yellow 0 0 10px"});r.add(i),r.setActiveObject(i),n&&a(!0)},w=()=>{const i=new B.fabric.Textbox("Be Kind",{left:650,top:650,fontFamily:"Arial",fill:"#000",backgroundColor:"orange"});r.add(i),r.setActiveObject(i),n&&a(!0)};return e.jsx(h.Fragment,{children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[e.jsx("div",{style:{fontSize:"20px",cursor:"pointer"},onClick:()=>l("Arial, sans-serif","#6a45d2"),children:e.jsx("span",{style:{color:"#6a45d2",fontFamily:"Arial, sans-serif",fontSize:"30px"},children:"Stay Humble "})}),e.jsx("div",{style:{fontSize:"20px",cursor:"pointer"},onClick:()=>d({primaryTextLabel:"Life is full of",primaryTextFontFamily:"Rock Salt, cursive",primaryTextColor:"black",secondaryTextLabel:"surprises",SecondaryTextFontFamily:"Arial, sans-serif",secondaryTextColor:"black"}),children:e.jsxs("span",{style:{color:"black",fontFamily:"Rock Salt, cursive",fontSize:"30px"},children:["Life is full of ",e.jsx("div",{style:{fontFamily:"Arial, sans-serif",fontSize:"14px"},children:"surprises"})," "]})}),e.jsx("div",{style:{fontSize:"20px",cursor:"pointer",paddingLeft:"20px"},onClick:()=>d({primaryTextLabel:"You are invited!",primaryTextFontFamily:"Bilbao Swash Caps",primaryTextColor:"green",secondaryTextLabel:"Taste the best wines from the best makers",SecondaryTextFontFamily:"Arial, sans-serif",secondaryTextColor:"green"}),children:e.jsxs("span",{style:{color:"green",fontFamily:"Bilbao Swash Caps",fontSize:"30px"},children:["You are invited! ",e.jsx("div",{style:{color:"green",fontFamily:"Arial, sans-serif",fontSize:"14px",textAlign:"right"},children:"Taste the best wines from the best makers"})," "]})}),e.jsx("div",{style:{fontSize:"20px",cursor:"pointer",paddingLeft:"20px"},onClick:()=>x("aclonica","#6a45d2"),children:e.jsx("span",{style:{color:"#6a45d2",fontFamily:"aclonica",fontSize:"30px",textShadow:"2px 2px 4px rgba(0, 0, 0, 2)"},children:"Adventure Awaits "})}),e.jsx("div",{onClick:()=>p(),style:$r,children:"Love More"}),e.jsx("div",{onClick:()=>j(),style:Jr,children:"Good Vibes Only"}),e.jsx("div",{onClick:()=>c(),style:Gr,children:"Dream Big"}),e.jsx("div",{onClick:()=>u(),style:Yr,children:"Find Your Fire"}),e.jsx("div",{onClick:()=>w(),style:Kr,children:"Be Kind"}),e.jsx("div",{onClick:()=>v(),style:Xr,children:"Choose Joy"})]})})}const Ht=async m=>{try{const n=await(await fetch(m)).blob();return new Promise((a,l)=>{const d=new FileReader;d.onloadend=()=>a(d.result),d.onerror=l,d.readAsDataURL(n)})}catch(r){throw console.error("Error converting image to base64:",r),r}};function Qr({apcCanvasInstance:m,theme:r}){const[n,a]=h.useState(!1),l=c=>{const v=c.target.files[0];if(v){const u=new FileReader;u.onload=w=>x(w.target.result),u.readAsDataURL(v)}},d=c=>{c.preventDefault(),a(!1);const v=c.dataTransfer.files[0];if(v){const u=new FileReader;u.onload=w=>x(w.target.result),u.readAsDataURL(v)}},x=c=>{B.fabric.Image.fromURL(c,v=>{v.set({left:100,top:100,scaleX:.5,scaleY:.5}),m.add(v)})},p=c=>{c.preventDefault(),a(!0)},j=()=>{a(!1)};return e.jsxs("div",{style:{border:n?"2px dashed #4CAF50":"2px dashed #ccc",padding:"40px",margin:"20px",borderRadius:"10px",textAlign:"center",backgroundColor:n?"#f0fff4":"#f9f9f9",transition:"background-color 0.3s",cursor:"pointer",position:"relative"},onDragOver:p,onDragLeave:j,onDrop:d,onClick:()=>document.getElementById("file-input").click(),children:[e.jsx("input",{type:"file",accept:"image/*",style:{display:"none"},id:"file-input",onChange:l}),e.jsxs("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:n?"#4CAF50":"#ccc",fontSize:"48px"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"18",viewBox:"0 0 512 512",style:{fill:r.primaryColor},children:e.jsx("path",{d:Ft})}),e.jsx("br",{})," ",e.jsx("br",{})]}),e.jsx("label",{htmlFor:"file-input",style:{display:"block",marginTop:"80px",fontSize:"16px",color:"#333"},children:"Click or drag & drop to upload an image"}),e.jsx("div",{style:{fontSize:"12px",color:"#888"},children:"Supports PNG, JPG, WEBP formats"})]})}function ut(m){const{featureText:r,theme:n,featureName:a}=m;return e.jsxs("div",{className:"premium-feature-container",style:{padding:"20px",backgroundColor:"#f8f9fa",borderRadius:"8px",boxShadow:"0 2px 10px rgba(0,0,0,0.05)",textAlign:"center",maxWidth:"400px",margin:"0 auto"},children:[e.jsx("div",{style:{marginBottom:"16px"},children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{color:"#ffc107"},children:[e.jsx("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"}),e.jsx("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"})]})}),e.jsx("h3",{style:{color:"#333",fontSize:"18px",fontWeight:"600",marginBottom:"12px"},children:a??"Premium Feature Access"}),e.jsx("p",{style:{color:"#555",fontSize:"15px",lineHeight:"1.5",marginBottom:"20px"},children:r??"This advanced feature requires a premium subscription to access."}),e.jsxs("a",{href:"https://mypixia.com/developer",target:"_blank",rel:"noopener noreferrer",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",backgroundColor:n.primaryColor,color:"white",padding:"10px 20px",borderRadius:"4px",textDecoration:"none",fontWeight:"500",transition:"background-color 0.2s ease"},onMouseOver:l=>l.currentTarget.style.backgroundColor="#3a45bf",onMouseOut:l=>l.currentTarget.style.backgroundColor="#4c5bf2",children:[e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{marginRight:"8px"},children:[e.jsx("path",{d:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20z"}),e.jsx("path",{d:"M12 8v8"}),e.jsx("path",{d:"M8 12h8"})]}),"Get API Key"]}),e.jsx("p",{style:{fontSize:"13px",color:"#777",marginTop:"16px"},children:"Unlock premium design features to create your perfect custom product"})]})}function ft(){return e.jsxs("div",{className:"loading-container",children:[e.jsxs("div",{className:"spinner",children:[e.jsx("div",{className:"spinner-circle"}),e.jsx("div",{className:"spinner-circle-inner"})]}),e.jsx("p",{className:"loading-text",children:"Loading..."})]})}function Zr(m){const{apcCanvasInstance:r,theme:n,apiKey:a,apiEndpoint:l,isMobile:d,closeMobileModalSecondaryPanel:x}=m,[p,j]=h.useState("flowers"),[c,v]=h.useState(!1),[u,w]=h.useState(),[i,y]=h.useState(!1),[f,b]=h.useState(!1),s=sessionStorage.getItem("apc_x_sub_status"),k=`${l}/api/v1/designer`;h.useEffect(()=>{z()},[]),h.useEffect(()=>{(async()=>{s==="active"?(y(!0),b(!0)):(v(!0),await _())})()},[]);const _=()=>{v(!0);const E=`${k}/get-subscription-status/${a}`;Ce.get(E).then(P=>{P.data.object&&P.data.object==="active"&&(sessionStorage.setItem("apc_x_sub_status","active"),y(!0))}).catch(P=>{sessionStorage.setItem("apc_x_sub_status","")}).finally(()=>{v(!1),b(!0)})},z=()=>{v(!0);const E={"X-Api-Key":a},P=`${k}/get-images/${p}`;Ce.get(P,{headers:E}).then(X=>{var Q;v(!1),w((Q=X.data)==null?void 0:Q.object)}).catch(X=>{console.error("Error fetching data:",X),v(!1)})},L=async E=>{const P=await Ht(E);P&&B.fabric.Image.fromURL(P,X=>{X.set({left:0,top:0,scaleX:.3,scaleY:.3}),r.add(X)}),d&&x(!0)},F=()=>u?e.jsx("div",{children:u.map(E=>e.jsx("div",{onClick:()=>L(E.urls.regular),style:{cursor:"pointer"},children:e.jsx("img",{height:300,width:300,src:E.urls.regular,alt:E.description||"No description"})},E.id))}):null,R=()=>!i&&!c&&f?e.jsx(ut,{theme:n,isPartial:!0,featureName:"AI image generation or search"}):i&&!c&&f?e.jsxs("div",{children:[e.jsx("strong",{children:"- OR -"}),e.jsxs("div",{children:[e.jsx("input",{type:"text",onChange:E=>j(E.target.value),className:"apc-mpc-widget-input",style:{border:`solid 3px ${n.primaryColor}`}}),e.jsx("br",{})," ",e.jsx("br",{}),e.jsx("button",{className:"apc-mpc-widget-btn",onClick:()=>z(),style:{backgroundColor:n.primaryColor,color:"#ffffff"},children:c?"...Processing":"Search"})]}),e.jsx("br",{}),e.jsx("br",{}),F()]}):e.jsx(ft,{});return e.jsxs(h.Fragment,{children:[e.jsx("br",{}),e.jsx("br",{}),e.jsx(Qr,{apcCanvasInstance:r,theme:n}),e.jsx("br",{}),e.jsx("br",{}),R()]})}function _t(m){const{apcCanvasInstance:r,theme:n,isMobile:a,closeMobileModalSecondaryPanel:l}=m,d=b=>{const s=new B.fabric.Rect({width:100,height:60,left:200,top:200,fill:"",stroke:n.primaryColor});r.add(s),r.setActiveObject(s),a&&l(!0)},x=b=>{const s=new B.fabric.Circle({radius:30,fill:"",stroke:n.primaryColor,left:200,top:200});r.add(s),r.setActiveObject(s),a&&l(!0)},p=b=>{const s=new B.fabric.Triangle({width:40,height:50,fill:"",stroke:n.primaryColor,left:200,top:200});r.add(s),r.setActiveObject(s),a&&l(!0)},j=b=>{const s=new B.fabric.Line([50,10,250,10],{fill:"",stroke:n.primaryColor,left:200,top:200});r.add(s),r.setActiveObject(s),a&&l(!0)},c=(b,s,k)=>{const _=s,z=s,L=Math.PI/b;let F=[],R=0;for(let E=0;E<b;E++){let P=_+Math.cos(R)*s,X=z+Math.sin(R)*s;F.push({x:P,y:X}),R+=L,P=_+Math.cos(R)*k,X=z+Math.sin(R)*k,F.push({x:P,y:X}),R+=L}return F},v=(b,s)=>{const k=Math.PI*2/b,_=s,z=s,L=[];for(let F=0;F<b;F++){const R=_+s*Math.cos(F*k),E=z+s*Math.sin(F*k);L.push({x:R,y:E})}return L},u=b=>{const s=c(5,60,30),k=new B.fabric.Polygon(s,{left:200,top:200,fill:"",stroke:n.primaryColor,strokeWidth:2,strokeLineJoin:"bevil"},!1);r.add(k),r.setActiveObject(k),a&&l(!0)},w=b=>{const s=v(6,30),k=new B.fabric.Polygon(s,{left:200,top:200,fill:"",stroke:n.primaryColor,strokeWidth:2,strokeLineJoin:"bevil"},!1);r.add(k),r.setActiveObject(k),a&&l(!0)},i=b=>{const s=new B.fabric.Path(St,{fill:"",stroke:n.primaryColor,left:200,top:200});r.add(s),r.setActiveObject(s),a&&l(!0)},y=b=>{const s=new B.fabric.Path(kt,{fill:"",stroke:n.primaryColor,left:200,top:200});r.add(s),r.setActiveObject(s),a&&l(!0)},f=b=>{const s=new B.fabric.Path(mt,{fill:"",stroke:n.primaryColor,left:200,top:200});r.add(s),r.setActiveObject(s),a&&l(!0)};return r?e.jsxs(h.Fragment,{children:[e.jsx("br",{}),e.jsx("div",{onClick:b=>d(),style:{fontSize:"50px",cursor:"pointer"},children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"76",width:"76",viewBox:"0 0 712 712",fill:"none",strokeWidth:"4",stroke:n.primaryColor,children:e.jsx("path",{d:"M512 512H0V0h512v512z"})})}),e.jsx("div",{onClick:b=>x(),style:{fontSize:"50px",cursor:"pointer"},children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"66",width:"66",viewBox:"0 0 512 512",fill:"none",strokeWidth:"4",stroke:n.primaryColor,children:e.jsx("path",{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"})})}),e.jsx("div",{onClick:b=>p(),draggable:!0,style:{fontSize:"50px",cursor:"pointer"},children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"106",width:"106",viewBox:"0 0 320 512",fill:"none",strokeWidth:"4",stroke:n.primaryColor,children:e.jsx("path",{d:"M288.7 352H31.3c-17.8 0-26.7-21.5-14.1-34.1l128.7-128.7c7.8-7.8 20.5-7.8 28.3 0l128.7 128.7c12.6 12.6 3.7 34.1-14.1 34.1z"})})}),e.jsx("div",{onClick:b=>u(),style:{fontSize:"50px",cursor:"pointer"},children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"86",width:"86",viewBox:"0 0 576 512",fill:"none",strokeWidth:"4",stroke:n.primaryColor,children:e.jsx("path",{d:"M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"})})}),e.jsx("div",{onClick:b=>w(),style:{fontSize:"50px",cursor:"pointer"},children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",strokeWidth:"4",stroke:n.primaryColor,height:"80px",width:"80px",version:"1.1",id:"Capa_1",viewBox:"0 0 184.751 184.751",children:e.jsx("path",{d:"M0,92.375l46.188-80h92.378l46.185,80l-46.185,80H46.188L0,92.375z"})})}),e.jsx("div",{onClick:b=>j(),style:{fontSize:"50px",cursor:"pointer"},children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",strokeWidth:"4",stroke:n.primaryColor,id:"Capa_1",width:"86px",height:"86px",viewBox:"0 0 290.658 290.658",children:e.jsx("g",{children:e.jsx("g",{children:e.jsx("rect",{y:"139.474",style:{fill:n.primaryColor},width:"290.658",height:"1.711"})})})})}),e.jsx("div",{onClick:b=>i(),style:{fontSize:"50px",cursor:"pointer"},children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"86",width:"86",viewBox:"0 0 512 512",fill:"none",strokeWidth:"4",stroke:n.primaryColor,children:e.jsx("path",{d:St})})}),e.jsx("div",{onClick:b=>y(),style:{fontSize:"50px",cursor:"pointer"},children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"86",width:"86",viewBox:"0 0 512 512",fill:"none",strokeWidth:"4",stroke:n.primaryColor,children:e.jsx("path",{d:kt})})}),e.jsx("div",{onClick:b=>f(),style:{fontSize:"50px",cursor:"pointer"},children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"86",width:"86",viewBox:"0 0 448 512",fill:"none",strokeWidth:"4",stroke:n.primaryColor,children:e.jsx("path",{d:mt})})})]}):null}function en(m){const{apcCanvasInstance:r,theme:n,isMobile:a,closeMobileModalSecondaryPanel:l}=m,d=p=>{const j=new B.fabric.Path(p,{left:200,top:200,fill:n.primaryColor,scaleX:.1,scaleY:.1});r.add(j),r.setActiveObject(j),a&&l(!0)},x=p=>{switch(p){case"icon-phone":d(dr);break;case"icon-question":d(lr);break;case"icon-clock":d(pr);break;case"icon-twitter":d(hr);break;case"icon-check":d(ur);break;case"icon-pointer":d(fr);break;case"icon-mail":d(xr);break;case"icon-dollar":d(gr);break;case"icon-graduation":d(Nt);break;case"icon-business-suit":d(mr);break;case"icon-chat":d(vr);break;case"icon-thumbs-up":d(jr);break;case"icon-wifi":d(br);break;case"icon-info":d(It);break;case"icon-cart":d(At);break;case"icon-comment":d(Ot);break;case"icon-location-map":d(Et);break;case"icon-heart-1":d(Tt);break;case"icon-arrow-right-1":d(mt);break;case"icon-xmark":d(zt);break;case"icon-cloud":d(Mt);break;case"icon-smile":d(Rt);break;case"icon-like":d(Lt);break;default:console.log("no matching type")}};return e.jsx(h.Fragment,{children:e.jsxs("div",{style:{padding:"5px"},className:a?"apc-mpx-widget-secondary-icons-mobile":"apc-mpx-widget-secondary-icons",children:[e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:p=>x("icon-phone"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:n.primaryColor,d:"M164.9 24.6c-7.7-18.6-28-28.5-47.4-23.2l-88 24C12.1 30.2 0 46 0 64C0 311.4 200.6 512 448 512c18 0 33.8-12.1 38.6-29.5l24-88c5.3-19.4-4.6-39.7-23.2-47.4l-96-40c-16.3-6.8-35.2-2.1-46.3 11.6L304.7 368C234.3 334.7 177.3 277.7 144 207.3L193.3 167c13.7-11.2 18.4-30 11.6-46.3l-40-96z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:p=>x("icon-question"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 320 512",children:e.jsx("path",{fill:n.primaryColor,d:"M80 160c0-35.3 28.7-64 64-64h32c35.3 0 64 28.7 64 64v3.6c0 21.8-11.1 42.1-29.4 53.8l-42.2 27.1c-25.2 16.2-40.4 44.1-40.4 74V320c0 17.7 14.3 32 32 32s32-14.3 32-32v-1.4c0-8.2 4.2-15.8 11-20.2l42.2-27.1c36.6-23.6 58.8-64.1 58.8-107.7V160c0-70.7-57.3-128-128-128H144C73.3 32 16 89.3 16 160c0 17.7 14.3 32 32 32s32-14.3 32-32zm80 320a40 40 0 1 0 0-80 40 40 0 1 0 0 80z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:p=>x("icon-clock"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:n.primaryColor,d:"M464 256A208 208 0 1 1 48 256a208 208 0 1 1 416 0zM0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM232 120V256c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2V120c0-13.3-10.7-24-24-24s-24 10.7-24 24z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:p=>x("icon-twitter"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:n.primaryColor,d:"M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:p=>x("icon-check"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 448 512",children:e.jsx("path",{fill:n.primaryColor,d:"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:p=>x("icon-pointer"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 448 512",children:e.jsx("path",{fill:n.primaryColor,d:"M160 64c0-8.8 7.2-16 16-16s16 7.2 16 16V200c0 10.3 6.6 19.5 16.4 22.8s20.6-.1 26.8-8.3c3-3.9 7.6-6.4 12.8-6.4c8.8 0 16 7.2 16 16c0 10.3 6.6 19.5 16.4 22.8s20.6-.1 26.8-8.3c3-3.9 7.6-6.4 12.8-6.4c7.8 0 14.3 5.6 15.7 13c1.6 8.2 7.3 15.1 15.1 18s16.7 1.6 23.3-3.6c2.7-2.1 6.1-3.4 9.9-3.4c8.8 0 16 7.2 16 16l0 16V392c0 39.8-32.2 72-72 72H272 212.3h-.9c-37.4 0-72.4-18.7-93.2-49.9L50.7 312.9c-4.9-7.4-2.9-17.3 4.4-22.2s17.3-2.9 22.2 4.4L116 353.2c5.9 8.8 16.8 12.7 26.9 9.7s17-12.4 17-23V320 64zM176 0c-35.3 0-64 28.7-64 64V261.7C91.2 238 55.5 232.8 28.5 250.7C-.9 270.4-8.9 310.1 10.8 339.5L78.3 440.8c29.7 44.5 79.6 71.2 133.1 71.2h.9H272h56c66.3 0 120-53.7 120-120V288l0-16c0-35.3-28.7-64-64-64c-4.5 0-8.8 .5-13 1.3c-11.7-15.4-30.2-25.3-51-25.3c-6.9 0-13.5 1.1-19.7 3.1C288.7 170.7 269.6 160 248 160c-2.7 0-5.4 .2-8 .5V64c0-35.3-28.7-64-64-64zm48 304c0-8.8-7.2-16-16-16s-16 7.2-16 16v96c0 8.8 7.2 16 16 16s16-7.2 16-16V304zm48-16c-8.8 0-16 7.2-16 16v96c0 8.8 7.2 16 16 16s16-7.2 16-16V304c0-8.8-7.2-16-16-16zm80 16c0-8.8-7.2-16-16-16s-16 7.2-16 16v96c0 8.8 7.2 16 16 16s16-7.2 16-16V304z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:p=>x("icon-mail"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:n.primaryColor,d:"M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48H48zM0 176V384c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V176L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:p=>x("icon-dollar"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 320 512",children:e.jsx("path",{fill:n.primaryColor,d:"M160 0c17.7 0 32 14.3 32 32V67.7c1.6 .2 3.1 .4 4.7 .7c.4 .1 .7 .1 1.1 .2l48 8.8c17.4 3.2 28.9 19.9 25.7 37.2s-19.9 28.9-37.2 25.7l-47.5-8.7c-31.3-4.6-58.9-1.5-78.3 6.2s-27.2 18.3-29 28.1c-2 10.7-.5 16.7 1.2 20.4c1.8 3.9 5.5 8.3 12.8 13.2c16.3 10.7 41.3 17.7 73.7 26.3l2.9 .8c28.6 7.6 63.6 16.8 89.6 33.8c14.2 9.3 27.6 21.9 35.9 39.5c8.5 17.9 10.3 37.9 6.4 59.2c-6.9 38-33.1 63.4-65.6 76.7c-13.7 5.6-28.6 9.2-44.4 11V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V445.1c-.4-.1-.9-.1-1.3-.2l-.2 0 0 0c-24.4-3.8-64.5-14.3-91.5-26.3c-16.1-7.2-23.4-26.1-16.2-42.2s26.1-23.4 42.2-16.2c20.9 9.3 55.3 18.5 75.2 21.6c31.9 4.7 58.2 2 76-5.3c16.9-6.9 24.6-16.9 26.8-28.9c1.9-10.6 .4-16.7-1.3-20.4c-1.9-4-5.6-8.4-13-13.3c-16.4-10.7-41.5-17.7-74-26.3l-2.8-.7 0 0C119.4 279.3 84.4 270 58.4 253c-14.2-9.3-27.5-22-35.8-39.6c-8.4-17.9-10.1-37.9-6.1-59.2C23.7 116 52.3 91.2 84.8 78.3c13.3-5.3 27.9-8.9 43.2-11V32c0-17.7 14.3-32 32-32z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:p=>x("icon-graduation"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 640 512",children:e.jsx("path",{fill:n.primaryColor,d:Nt})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:p=>x("icon-business-suit"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 640 512",children:e.jsx("path",{fill:n.primaryColor,d:"M184 48H328c4.4 0 8 3.6 8 8V96H176V56c0-4.4 3.6-8 8-8zm-56 8V96H64C28.7 96 0 124.7 0 160v96H192 352h8.2c32.3-39.1 81.1-64 135.8-64c5.4 0 10.7 .2 16 .7V160c0-35.3-28.7-64-64-64H384V56c0-30.9-25.1-56-56-56H184c-30.9 0-56 25.1-56 56zM320 352H224c-17.7 0-32-14.3-32-32V288H0V416c0 35.3 28.7 64 64 64H360.2C335.1 449.6 320 410.5 320 368c0-5.4 .2-10.7 .7-16l-.7 0zm320 16a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zM496 288c8.8 0 16 7.2 16 16v48h32c8.8 0 16 7.2 16 16s-7.2 16-16 16H496c-8.8 0-16-7.2-16-16V304c0-8.8 7.2-16 16-16z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:p=>x("icon-chat"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 640 512",children:e.jsx("path",{fill:n.primaryColor,d:"M88.2 309.1c9.8-18.3 6.8-40.8-7.5-55.8C59.4 230.9 48 204 48 176c0-63.5 63.8-128 160-128s160 64.5 160 128s-63.8 128-160 128c-13.1 0-25.8-1.3-37.8-3.6c-10.4-2-21.2-.6-30.7 4.2c-4.1 2.1-8.3 4.1-12.6 6c-16 7.2-32.9 13.5-49.9 18c2.8-4.6 5.4-9.1 7.9-13.6c1.1-1.9 2.2-3.9 3.2-5.9zM0 176c0 41.8 17.2 80.1 45.9 110.3c-.9 1.7-1.9 3.5-2.8 5.1c-10.3 18.4-22.3 36.5-36.6 52.1c-6.6 7-8.3 17.2-4.6 25.9C5.8 378.3 14.4 384 24 384c43 0 86.5-13.3 122.7-29.7c4.8-2.2 9.6-4.5 14.2-6.8c15.1 3 30.9 4.5 47.1 4.5c114.9 0 208-78.8 208-176S322.9 0 208 0S0 78.8 0 176zM432 480c16.2 0 31.9-1.6 47.1-4.5c4.6 2.3 9.4 4.6 14.2 6.8C529.5 498.7 573 512 616 512c9.6 0 18.2-5.7 22-14.5c3.8-8.8 2-19-4.6-25.9c-14.2-15.6-26.2-33.7-36.6-52.1c-.9-1.7-1.9-3.4-2.8-5.1C622.8 384.1 640 345.8 640 304c0-94.4-87.9-171.5-198.2-175.8c4.1 15.2 6.2 31.2 6.2 47.8l0 .6c87.2 6.7 144 67.5 144 127.4c0 28-11.4 54.9-32.7 77.2c-14.3 15-17.3 37.6-7.5 55.8c1.1 2 2.2 4 3.2 5.9c2.5 4.5 5.2 9 7.9 13.6c-17-4.5-33.9-10.7-49.9-18c-4.3-1.9-8.5-3.9-12.6-6c-9.5-4.8-20.3-6.2-30.7-4.2c-12.1 2.4-24.7 3.6-37.8 3.6c-61.7 0-110-26.5-136.8-62.3c-16 5.4-32.8 9.4-50 11.8C279 439.8 350 480 432 480z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:p=>x("icon-thumbs-up"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:n.primaryColor,d:"M323.8 34.8c-38.2-10.9-78.1 11.2-89 49.4l-5.7 20c-3.7 13-10.4 25-19.5 35l-51.3 56.4c-8.9 9.8-8.2 25 1.6 33.9s25 8.2 33.9-1.6l51.3-56.4c14.1-15.5 24.4-34 30.1-54.1l5.7-20c3.6-12.7 16.9-20.1 29.7-16.5s20.1 16.9 16.5 29.7l-5.7 20c-5.7 19.9-14.7 38.7-26.6 55.5c-5.2 7.3-5.8 16.9-1.7 24.9s12.3 13 21.3 13L448 224c8.8 0 16 7.2 16 16c0 6.8-4.3 12.7-10.4 15c-7.4 2.8-13 9-14.9 16.7s.1 15.8 5.3 21.7c2.5 2.8 4 6.5 4 10.6c0 7.8-5.6 14.3-13 15.7c-8.2 1.6-15.1 7.3-18 15.1s-1.6 16.7 3.6 23.3c2.1 2.7 3.4 6.1 3.4 9.9c0 6.7-4.2 12.6-10.2 14.9c-11.5 4.5-17.7 16.9-14.4 28.8c.4 1.3 .6 2.8 .6 4.3c0 8.8-7.2 16-16 16H286.5c-12.6 0-25-3.7-35.5-10.7l-61.7-41.1c-11-7.4-25.9-4.4-33.3 6.7s-4.4 25.9 6.7 33.3l61.7 41.1c18.4 12.3 40 18.8 62.1 18.8H384c34.7 0 62.9-27.6 64-62c14.6-11.7 24-29.7 24-50c0-4.5-.5-8.8-1.3-13c15.4-11.7 25.3-30.2 25.3-51c0-6.5-1-12.8-2.8-18.7C504.8 273.7 512 257.7 512 240c0-35.3-28.6-64-64-64l-92.3 0c4.7-10.4 8.7-21.2 11.8-32.2l5.7-20c10.9-38.2-11.2-78.1-49.4-89zM32 192c-17.7 0-32 14.3-32 32V448c0 17.7 14.3 32 32 32H96c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32H32z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:p=>x("icon-wifi"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 640 512",children:e.jsx("path",{fill:n.primaryColor,d:"M54.2 202.9C123.2 136.7 216.8 96 320 96s196.8 40.7 265.8 106.9c12.8 12.2 33 11.8 45.2-.9s11.8-33-.9-45.2C549.7 79.5 440.4 32 320 32S90.3 79.5 9.8 156.7C-2.9 169-3.3 189.2 8.9 202s32.5 13.2 45.2 .9zM320 256c56.8 0 108.6 21.1 148.2 56c13.3 11.7 33.5 10.4 45.2-2.8s10.4-33.5-2.8-45.2C459.8 219.2 393 192 320 192s-139.8 27.2-190.5 72c-13.3 11.7-14.5 31.9-2.8 45.2s31.9 14.5 45.2 2.8c39.5-34.9 91.3-56 148.2-56zm64 160a64 64 0 1 0 -128 0 64 64 0 1 0 128 0z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:p=>x("icon-info"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:n.primaryColor,d:It})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:p=>x("icon-cart"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 576 512",children:e.jsx("path",{fill:n.primaryColor,d:At})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:p=>x("icon-comment"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:n.primaryColor,d:Ot})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:p=>x("icon-location-map"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 384 512",children:e.jsx("path",{fill:n.primaryColor,d:Et})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:p=>x("icon-heart-1"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:n.primaryColor,d:Tt})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:p=>x("icon-arrow-right-1"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 448 512",children:e.jsx("path",{fill:n.primaryColor,d:yr})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:p=>x("icon-xmark"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 384 512",children:e.jsx("path",{fill:n.primaryColor,d:zt})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:p=>x("icon-cloud"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 640 512",children:e.jsx("path",{fill:n.primaryColor,d:Mt})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:p=>x("icon-smile"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:n.primaryColor,d:Rt})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:p=>x("icon-like"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:n.primaryColor,d:Lt})})})]})})}const tt=({defaultValue:m,size:r,ariaLabel:n,onChange:a})=>{const[l,d]=h.useState(m),x=p=>{const j=p.target.value;d(j),a(j)};return e.jsx("input",{type:"range",value:l,min:"0",max:"100",step:"1",className:`slider ${r}`,"aria-label":n,onChange:x})};function Bt(m){const{apcCanvasInstance:r,theme:n}=m,[a,l]=h.useState(!1),d=h.useRef(null),x=()=>{l(i=>!i)},p=i=>{d.current&&d.current.contains(i.target)||l(!1)};h.useEffect(()=>(document.addEventListener("mousedown",p),()=>{document.removeEventListener("mousedown",p)}),[]);const j=(i,y)=>{if(r.getActiveObject()){if(y==="family"&&r.getActiveObject().set({fontFamily:i}),y==="bold"&&r.getActiveObject().set({fontWeight:i}),y==="italic"&&r.getActiveObject().set({fontStyle:i}),y==="underline"&&r.getActiveObject().set({underline:i}),y==="line-through"&&r.getActiveObject().set({linethrough:i}),y==="overline"&&r.getActiveObject().set({overline:i}),y==="color"&&r.getActiveObject().set({fill:i}),y==="shadow"){const f=document.getElementById("apc-text-shadow-color").value;let b=document.getElementById("apc-text-shadow-horiz").value,s=document.getElementById("apc-text-shadow-vert").value,k=document.getElementById("apc-text-shadow-blur").value;b||(b=5),s||(s=5),k||(k=5),r.getActiveObject().set({shadow:f+" "+b+" "+s+" "+k})}if(y==="stroke"){const f=document.getElementById("apc-text-stroke-color").value;let b=document.getElementById("apc-text-stroke-width").value;b||(b=1),r.getActiveObject().set({stroke:f,strokeWidth:b})}y==="bg-color"&&r.getActiveObject().set({textBackgroundColor:i}),y==="font-size"&&r.getActiveObject().set({fontSize:i}),r&&r.renderAll()}},c=i=>{if(r.getActiveObject()){const y=parseFloat(i/100);r.getActiveObject().set({opacity:y.toFixed(1)}),r&&r.renderAll()}},v=({color:i,x:y,y:f,blur:b})=>{if(r.getActiveObject()){const s=r.getActiveObject().shadow;i||(i=s?s.color:"#6a45d2"),y||(y=s?s.offsetX:5),f||(f=s?s.offsetY:5),b||(b=s?s.blur:5),r.getActiveObject().set({shadow:i+" "+y+" "+f+" "+b}),r&&r.renderAll()}},u=()=>e.jsxs("div",{className:"apc-mpx-widget-button-group-container",children:[" ",e.jsx("button",{className:"apc-mpx-widget-effects-button",onClick:x,style:{color:n.primaryColor,cursor:"pointer"},children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",height:"15px",width:"15px",children:e.jsx("path",{fill:n.primaryColor,d:Lr})})}),a&&e.jsxs("div",{className:"apc-mpx-widget-popper-container",ref:d,children:[e.jsx("div",{className:"apc-mpx-widget-popper-arrow-up"}),e.jsxs("ul",{id:"split-button-menu",autoFocus:!0,children:[e.jsx("li",{className:"apc-mpx-widget-popper-li",children:e.jsxs("div",{style:{textAlign:"left"},children:[e.jsx("div",{style:{fontWeight:"bold",color:"purple"},children:"Background"}),e.jsxs("div",{style:{marginLeft:"10px"},children:[" Color",e.jsx("input",{style:{height:"25px",width:"25px",border:"none"},type:"color",onChange:i=>j(i.target.value,"bg-color")})]}),e.jsxs("div",{style:{marginLeft:"10px"},children:[" Opacity",e.jsx("div",{children:e.jsx(tt,{defaultValue:100,size:"small","aria-label":"Opacity",onChange:i=>c(i)})})]})]})}),e.jsx("li",{className:"apc-mpx-widget-popper-li",children:e.jsxs("div",{style:{textAlign:"left"},children:[e.jsx("div",{style:{fontWeight:"bold",color:"purple"},children:"Shadow"}),e.jsxs("div",{style:{marginLeft:"10px"},children:["Blur ",e.jsx("input",{type:"text",style:{height:"22px",width:"20px"},onChange:i=>v({blur:i.target.value})})]}),e.jsxs("div",{style:{marginLeft:"10px"},children:[" Color",e.jsx("input",{style:{height:"25px",width:"25px",border:"none"},type:"color",onChange:i=>v({color:i.target.value})})]}),e.jsxs("div",{style:{marginLeft:"10px"},children:[" Offset X",e.jsx("div",{children:e.jsx(tt,{defaultValue:0,size:"small","aria-label":"Opacity",onChange:i=>v({x:i})})})]}),e.jsxs("div",{style:{marginLeft:"10px"},children:[" Offset Y",e.jsx("div",{children:e.jsx(tt,{defaultValue:0,size:"small","aria-label":"Opacity",onChange:i=>v({y:i})})})]})]})})]})]})]});return e.jsx(h.Fragment,{children:e.jsxs("div",{style:{display:"flex",flexDirection:"row",color:"#ffffff"},children:[e.jsx("div",{style:{marginTop:"4px",marginLeft:"2px"},children:e.jsx("input",{style:{height:"20px",width:"30px",border:"solid 0px #ffffff"},type:"color",onChange:i=>j(i.target.value,"color")})})," ",e.jsx("div",{style:{marginTop:"4px"},children:e.jsxs("select",{style:{height:"20px",border:"solid 0px #ffffff"},id:"ffamily",onChange:i=>j(i.target.value,"family"),children:[e.jsx("option",{value:"comic sans ms",children:"Comic Sans MS"}),e.jsx("option",{value:"frankruehl",children:"FrankRuehl"}),e.jsx("option",{value:"lucida Bright",children:"Lucida Bright"}),e.jsx("option",{value:"bradley Hand",children:"Bradley Hand"}),e.jsx("option",{value:"Times New Roman",children:"Times New Roman"}),e.jsx("option",{value:"Georgia",children:"Georgia"}),e.jsx("option",{value:"Garamond",children:"Garamond"}),e.jsx("option",{value:"Baskerville",children:"Baskerville"}),e.jsx("option",{value:"Palatino",children:"Palatino"}),e.jsx("option",{value:"Book Antiqua",children:"Book Antiqua"}),e.jsx("option",{value:"Arial",children:"Arial"}),e.jsx("option",{value:"Helvetica",children:"Helvetica"}),e.jsx("option",{value:"Verdana",children:"Verdana"}),e.jsx("option",{value:"Tahoma",children:"Tahoma"}),e.jsx("option",{value:"Futura",children:"Futura"}),e.jsx("option",{value:"Calibri",children:"Calibri"}),e.jsx("option",{value:"Courier New",children:"Courier New"}),e.jsx("option",{value:"Consolas",children:"Consolas"}),e.jsx("option",{value:"Monaco",children:"Monaco"}),e.jsx("option",{value:"Brush Script",children:"Brush Script"}),e.jsx("option",{value:"Lucida Handwriting",children:"Lucida Handwriting"}),e.jsx("option",{value:"Zapfino",children:"Zapfino"}),e.jsx("option",{value:"Impact",children:"Impact"}),e.jsx("option",{value:"Cooper Black",children:"Cooper Black"}),e.jsx("option",{value:"Papyrus",children:"Papyrus"}),e.jsx("option",{value:"Comic Sans MS",children:"Comic Sans MS"}),e.jsx("option",{value:"Gotham",children:"Gotham"}),e.jsx("option",{value:"Franklin Gothic",children:"Franklin Gothic"}),e.jsx("option",{value:"DIN",children:"DIN"}),e.jsx("option",{value:"Rockwell",children:"Rockwell"}),e.jsx("option",{value:"Century Gothic",children:"Century Gothic"}),e.jsx("option",{value:"Trebuchet MS",children:"Trebuchet MS"}),e.jsx("option",{value:"Lobster",children:"Lobster"}),e.jsx("option",{value:"Roboto",children:"Roboto"}),e.jsx("option",{value:"Myriad Pro",children:"Myriad Pro"}),e.jsx("option",{value:"Gill Sans",children:"Gill Sans"}),e.jsx("option",{value:"Bodoni",children:"Bodoni"}),e.jsx("option",{value:"Perpetua",children:"Perpetua"}),e.jsx("option",{value:"Akzidenz-Grotesk",children:"Akzidenz-Grotesk"}),e.jsx("option",{value:"Source Sans Pro",children:"Source Sans Pro"}),e.jsx("option",{value:"Lato",children:"Lato"}),e.jsx("option",{value:"Noto Sans",children:"Noto Sans"}),e.jsx("option",{value:"Open Sans",children:"Open Sans"}),e.jsx("option",{value:"Montserrat",children:"Montserrat"})]})})," ",e.jsx("div",{style:{marginTop:"4px"},children:e.jsx("input",{defaultValue:40,style:{width:"50px",height:"20px",border:"solid 0px #ffffff"},type:"number",onChange:i=>j(i.target.value,"font-size")})}),e.jsx("div",{style:{marginTop:"4px",marginLeft:"2px",cursor:"pointer"},role:"button",onClick:i=>r.getActiveObject().fontWeight==="normal"?j("bold","bold"):j("normal","bold"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16px",width:"16px",viewBox:"0 0 384 512",children:e.jsx("path",{fill:"#ffffff",d:"M333.5 238a122 122 0 0 0 27-65.2C367.9 96.5 308 32 233.4 32H34a16 16 0 0 0 -16 16v48a16 16 0 0 0 16 16h31.9v288H34a16 16 0 0 0 -16 16v48a16 16 0 0 0 16 16h209.3c70.8 0 134.1-51.8 141-122.4 4.7-48.5-16.4-92.1-50.8-119.6zM145.7 112h87.8a48 48 0 0 1 0 96h-87.8zm87.8 288h-87.8V288h87.8a56 56 0 0 1 0 112z"})})}),e.jsx("div",{style:{marginTop:"4px",marginLeft:"2px",cursor:"pointer"},role:"button",onClick:i=>r.getActiveObject().fontStyle==="normal"?j("italic","italic"):j("normal","italic"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16px",width:"16px",viewBox:"0 0 320 512",children:e.jsx("path",{fill:"#ffffff",d:"M320 48v32a16 16 0 0 1 -16 16h-62.8l-80 320H208a16 16 0 0 1 16 16v32a16 16 0 0 1 -16 16H16a16 16 0 0 1 -16-16v-32a16 16 0 0 1 16-16h62.8l80-320H112a16 16 0 0 1 -16-16V48a16 16 0 0 1 16-16h192a16 16 0 0 1 16 16z"})})}),e.jsx("div",{style:{marginTop:"4px",marginLeft:"2px",cursor:"pointer"},role:"button",onClick:i=>r.getActiveObject().underline?j(!1,"underline"):j(!0,"underline"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16px",width:"16px",viewBox:"0 0 448 512",children:e.jsx("path",{fill:"#ffffff",d:"M32 64h32v160c0 88.2 71.8 160 160 160s160-71.8 160-160V64h32a16 16 0 0 0 16-16V16a16 16 0 0 0 -16-16H272a16 16 0 0 0 -16 16v32a16 16 0 0 0 16 16h32v160a80 80 0 0 1 -160 0V64h32a16 16 0 0 0 16-16V16a16 16 0 0 0 -16-16H32a16 16 0 0 0 -16 16v32a16 16 0 0 0 16 16zm400 384H16a16 16 0 0 0 -16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0 -16-16z"})})}),e.jsx("div",{style:{marginTop:"4px",marginLeft:"2px",cursor:"pointer"},role:"button","aria-label":"Italics",onClick:i=>r.getActiveObject().linethrough?j(!1,"line-through"):j(!0,"line-through"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16px",width:"16px",viewBox:"0 0 512 512",children:e.jsx("path",{fill:"#ffffff",d:"M496 224H293.9l-87.2-26.8A43.6 43.6 0 0 1 219.6 112h66.8A49.9 49.9 0 0 1 331 139.6a16 16 0 0 0 21.5 7.2l42.9-21.5a16 16 0 0 0 7.2-21.5l-.5-1A128 128 0 0 0 287.5 32h-68a123.7 123.7 0 0 0 -123 135.6c2 20.9 10.1 39.8 21.8 56.4H16a16 16 0 0 0 -16 16v32a16 16 0 0 0 16 16h480a16 16 0 0 0 16-16v-32a16 16 0 0 0 -16-16zm-180.2 96A43 43 0 0 1 336 356.5 43.6 43.6 0 0 1 292.5 400h-66.8A49.9 49.9 0 0 1 181 372.4a16 16 0 0 0 -21.5-7.2l-42.9 21.5a16 16 0 0 0 -7.2 21.5l.5 1A128 128 0 0 0 224.5 480h68a123.7 123.7 0 0 0 123-135.6 114.3 114.3 0 0 0 -5.3-24.4z"})})}),e.jsx("div",{children:u()})]})})}function Ze(m){const{apcCanvasInstance:r,theme:n}=m,a=h.useRef(null),[l,d]=h.useState(!1),x=()=>{d(u=>!u)},p=(u,w)=>{if(r&&r.getActiveObject()){if(u==="bg-color"&&r.getActiveObject().set({fill:w}),u==="border-color"&&r.getActiveObject().set({stroke:w}),u==="gradient-bg-color1"||u==="gradient-bg-color2"){let i=document.getElementById("apc-object-bg-gradient-color1").value,y=document.getElementById("apc-object-bg-gradient-color2").value;const f=new B.fabric.Gradient({type:"linear",gradientUnits:"pixels",coords:{x1:0,y1:0,x2:0,y2:r.getActiveObject().height},colorStops:[{offset:0,color:i||"#000"},{offset:1,color:y||"#fff"}]});r.getActiveObject().set({fill:f})}r&&r.renderAll()}},j=u=>{if(r.getActiveObject()){const w=parseFloat(u/100);r.getActiveObject().set({opacity:w.toFixed(1)}),r&&r.renderAll()}},c=({color:u,x:w,y:i,blur:y})=>{if(r.getActiveObject()){const f=r.getActiveObject().shadow;u||(u=f?f.color:"#6a45d2"),w||(w=f?f.offsetX:5),i||(i=f?f.offsetY:5),y||(y=f?f.blur:5),r.getActiveObject().set({shadow:u+" "+w+" "+i+" "+y}),r&&r.renderAll()}};return e.jsx(h.Fragment,{children:e.jsxs("div",{className:"apc-mpx-widget-button-group-container",children:[e.jsx("button",{className:"apc-mpx-widget-effects-button",onClick:x,style:{color:n.primaryColor,fontWeight:"bold",cursor:"pointer",borderRadius:"25px"},children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",height:"22px",width:"22px",children:e.jsx("path",{fill:n.primaryColor,d:_r})})}),l&&e.jsxs("div",{className:"apc-mpx-widget-popper-container",ref:a,style:{marginLeft:"20%"},children:[e.jsx("div",{className:"apc-mpx-widget-popper-arrow-up"}),e.jsxs("ul",{id:"split-button-menu",autoFocus:!0,children:[e.jsx("li",{className:"apc-mpx-widget-popper-li",children:e.jsxs("div",{style:{textAlign:"left"},children:[e.jsx("div",{style:{fontWeight:"bold",color:"purple"},children:"Background"}),e.jsxs("div",{style:{marginLeft:"10px"},children:[" Color",e.jsx("input",{style:{height:"25px",width:"25px",border:"none"},type:"color",onChange:u=>p("bg-color",u.target.value)})]}),e.jsxs("div",{style:{marginLeft:"10px"},children:["Gradient:",e.jsx("input",{style:{height:"25px",width:"25px",border:"none"},className:"editor-color-input-selector",id:"apc-object-bg-gradient-color1",type:"color",onChange:u=>p("gradient-bg-color1",u.target.value)}),e.jsx("input",{style:{height:"25px",width:"25px",border:"none"},className:"editor-color-input-selector",id:"apc-object-bg-gradient-color2",type:"color",onChange:u=>p("gradient-bg-color2",u.target.value)})]}),e.jsx("div",{style:{marginLeft:"10px"},children:e.jsxs("div",{children:["Opacity: ",e.jsx(tt,{defaultValue:100,size:"small","aria-label":"Opacity",onChange:u=>j(u)})]})}),e.jsxs("div",{style:{marginLeft:"10px"},children:[" Border color",e.jsx("input",{style:{height:"25px",width:"25px",border:"none"},type:"color",onChange:u=>p("border-color",u.target.value)})]})]})}),e.jsx("li",{className:"apc-mpx-widget-popper-li",children:e.jsxs("div",{style:{textAlign:"left"},children:[e.jsx("div",{style:{fontWeight:"bold",color:"purple"},children:"Shadow"}),e.jsxs("div",{style:{marginLeft:"10px"},children:["Blur width ",e.jsx("input",{type:"text",style:{height:"22px",width:"25px"},onChange:u=>c({blur:u.target.value})})]}),e.jsxs("div",{style:{marginLeft:"10px"},children:[" Color",e.jsx("input",{style:{height:"25px",width:"25px",border:"none"},type:"color",onChange:u=>c({color:u.target.value})})]}),e.jsx("div",{style:{marginLeft:"10px"},children:e.jsxs("div",{children:["Offset X: ",e.jsx(tt,{defaultValue:0,size:"small","aria-label":"Opacity",onChange:u=>c({x:u})})]})}),e.jsx("div",{style:{marginLeft:"10px"},children:e.jsxs("div",{children:["Offset Y: ",e.jsx(tt,{defaultValue:0,size:"small","aria-label":"Opacity",onChange:u=>c({y:u})})]})})]})})]})]})]})})}function tn(m){const{apcCanvasInstance:r,apiEndpoint:n,apiKey:a}=m,[l,d]=h.useState("art"),[x,p]=h.useState(),[j,c]=h.useState(!1),v=n+"/api/v1/designer";h.useEffect(()=>{u()},[]);const u=()=>{c(!0);const f={"X-Api-Key":a},b=`${v}/get-quote/${l}`;Ce.get(b,{headers:f}).then(s=>{var k;c(!1),p((k=s.data)==null?void 0:k.object)}).catch(s=>{console.error("Error fetching data:",s),c(!1)})},w=(f,b,s)=>{const k=new B.fabric.Textbox(b,{width:500,left:100,top:200,fontSize:16}),_=new B.fabric.Textbox(s,{fontSize:14,width:200,fontWeight:"bold"});_.top=k.top+k.height+10,_.left=k.left,r.add(k),r.add(_),r.setActiveObject(k)},i=f=>{c(!0),d(f),u()},y=()=>x?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:5},children:x.map((f,b)=>e.jsxs("div",{onClick:s=>w(s,f.quote,f.author),style:{cursor:"pointer",padding:"3px",textAlign:"left",color:"#210080",fontFamily:"ui-monospace",border:"1px solid #dedcdc",borderRadius:"8px"},children:[e.jsx("div",{children:f.quote}),e.jsx("div",{children:e.jsx("strong",{children:e.jsx("i",{children:f.author})})}),e.jsx("br",{})]},b))}):null;return e.jsxs(h.Fragment,{children:[e.jsx("h3",{children:"Quotes"}),e.jsx("br",{}),e.jsx("br",{}),e.jsx("div",{children:y()}),e.jsx("br",{}),e.jsx("br",{}),e.jsx("br",{}),e.jsxs("div",{style:{padding:"3px"},children:[e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("best"),children:[l==="best"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Best"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("business"),children:[l==="business"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Business"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("car"),children:[l==="car"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Car"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("change"),children:[l==="change"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Change"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("computers"),children:[l==="computers"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Computers"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("cool"),children:[l==="cool"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Cool"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("courage"),children:[l==="courage"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Courage"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("dad"),children:[l==="dad"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Dad"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("dating"),children:[l==="dating"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Date"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("death"),children:[l==="death"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Death"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("design"),children:[l==="design"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Design"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("dreams"),children:[l==="dreams"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Dreams"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("education"),children:[l==="education"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Education"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("inspirational"),children:[l==="inspirational"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Inspirational"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("happiness"),children:[l==="happiness"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Happiness"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("health"),children:[l==="health"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Health"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("humor"),children:[l==="humor"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Humor"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("marriage"),children:[l==="marriage"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Marriage"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("money"),children:[l==="money"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Money"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("graduation"),children:[l==="graduation"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Graduation"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("hope"),children:[l==="hope"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Hope"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("love"),children:[l==="love"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Love"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("god"),children:[l==="god"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"God"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("equality"),children:[l==="equality"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Equality"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("failure"),children:[l==="failure"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Failure"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("fear"),children:[l==="fear"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Fear"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("legal"),children:[l==="legal"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Legal"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("attitude"),children:[l==="attitude"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Attitude"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("beauty"),children:[l==="beauty"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Beauty"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("age"),children:[l==="age"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Age"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("art"),children:[l==="art"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Art"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>i("birthday"),children:[l==="birthday"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Birthday"]}),e.jsx("br",{})]})]})}function rn(m){const{apcCanvasInstance:r,theme:n,apiKey:a,apiEndpoint:l,updateActiveSection:d,reloadTabs:x,currentTabNo:p,isMobile:j,closeMobileModalSecondaryPanel:c}=m,[v,u]=h.useState("background"),[w,i]=h.useState(!1),[y,f]=h.useState(),b=l+"/api/v1/designer";h.useEffect(()=>{k()},[]);const s=L=>{const F=document.getElementById("img-default-id"),R=new B.fabric.Image(F,E=>{E.set({left:100,top:200,scaleX:.5,scaleY:.5,imageSmoothing:!0})});r.add(R),j&&c(!0)},k=()=>{i(!0);const L={"X-Api-Key":a},F=`${b}/get-images/${v}`;Ce.get(F,{headers:L}).then(R=>{var E;i(!1),f((E=R.data)==null?void 0:E.object)}).catch(R=>{console.error("Error fetching data:",R),i(!1)})},_=L=>{B.fabric.Image.fromURL(L,function(F){F.width=r.width,F.height=r.height,F.scaleToWidth(r.width),F.scaleToHeight(r.height),r.setBackgroundImage(F);const R=sessionStorage.getItem("apc_x_activeTab"),E=JSON.stringify(r);$e(R,"general",E,null).then(P=>{x(p+1),r&&r.renderAll()})},{crossOrigin:"anonymous"})},z=()=>y?e.jsx("div",{children:y.map(L=>e.jsx("div",{onClick:()=>_(L.urls.regular),style:{cursor:"pointer"},children:e.jsx("img",{height:300,width:300,src:L.urls.regular,alt:L.description||"No description"})},L.id))}):null;return e.jsxs(h.Fragment,{children:[e.jsx("br",{}),e.jsx("br",{}),e.jsxs("div",{style:{cursor:"pointer"},onClick:()=>s(),children:[e.jsx("img",{alt:"sample-image",id:"img-default-id",src:"https://mypixia.com/images/img-default.png",height:"200",width:"300"})," ",e.jsx("br",{}),"From my device"]}),e.jsx("br",{}),e.jsx("br",{}),e.jsx("strong",{children:"- OR -"}),e.jsxs("div",{children:[e.jsx("input",{type:"text",onChange:L=>u(L.target.value),className:"apc-mpc-widget-input",style:{border:`solid 3px ${n.primaryColor}`}}),e.jsx("br",{})," ",e.jsx("br",{}),e.jsx("button",{className:"apc-mpc-widget-btn",onClick:()=>k(),style:{backgroundColor:n.primaryColor,color:"#ffffff"},children:w?"...Processing":"Search"})]}),e.jsx("br",{}),e.jsx("br",{}),z()]})}function nn(m){const[r,n]=h.useState(""),[a,l]=h.useState(""),[d,x]=h.useState(!1),[p,j]=h.useState(!1),[c,v]=h.useState(!1),{apcCanvasInstance:u,theme:w,isMobile:i,closeMobileModalSecondaryPanel:y,apiKey:f,apiEndpoint:b}=m,s=`${b}/api/v1/designer`,k=sessionStorage.getItem("apc_x_sub_status");h.useEffect(()=>{(async()=>{k==="active"?(j(!0),v(!0)):(x(!0),await _())})()},[]);const _=()=>{x(!0);const F=`${s}/get-subscription-status/${f}`;Ce.get(F).then(R=>{R.data.object&&R.data.object==="active"&&(sessionStorage.setItem("apc_x_sub_status","active"),j(!0))}).catch(R=>{sessionStorage.setItem("apc_x_sub_status","")}).finally(()=>{x(!1),v(!0)})},z=()=>{rr.toDataURL(r,{width:300},(F,R)=>{F&&console.error(F),l(R)})},L=F=>{const R=document.getElementById("apc-qr-code-img"),E=new B.fabric.Image(R,P=>{P.set({left:200,top:200,scaleX:.5,scaleY:.5,imageSmoothing:!0})});u.add(E),u.setActiveObject(E),i&&y(!0)};return!p&&!d&&c?e.jsx(ut,{theme:w}):p&&!d&&c?e.jsxs(h.Fragment,{children:[e.jsx("br",{}),e.jsx("br",{}),"Enter data such as url",e.jsx("br",{}),e.jsx("input",{className:"apc-mpc-widget-input",style:{border:`solid 3px ${w.primaryColor}`},type:"text",onChange:F=>n(F.target.value)}),e.jsx("br",{}),e.jsx("br",{}),e.jsx("button",{className:"apc-mpc-widget-btn",style:{backgroundColor:w.primaryColor,color:"#ffffff"},disabled:!r,onClick:z,children:"Generate QR code"}),e.jsx("br",{}),e.jsx("br",{}),a&&e.jsxs("div",{className:"generated-view",onClick:()=>L(),style:{cursor:"pointer"},children:[e.jsx("img",{src:a,alt:"qr code",id:"apc-qr-code-img"}),e.jsx("a",{href:a})]})]}):e.jsx("div",{children:e.jsx(ft,{})})}function sn(m){const{apcCanvasInstance:r,theme:n,isMobile:a,closeMobileModalSecondaryPanel:l,apiKey:d,apiEndpoint:x}=m,[p,j]=h.useState(""),[c,v]=h.useState(null),[u,w]=h.useState("CODE128"),i=h.useRef(null),[y,f]=h.useState(""),[b,s]=h.useState(!1),[k,_]=h.useState(!1),[z,L]=h.useState(!1),F=sessionStorage.getItem("apc_x_sub_status"),R=`${x}/api/v1/designer`;h.useEffect(()=>{(async()=>{F==="active"?(_(!0),L(!0)):(s(!0),await E())})()},[]);const E=()=>{s(!0);const Q=`${R}/get-subscription-status/${d}`;Ce.get(Q).then(oe=>{oe.data.object&&oe.data.object==="active"&&(sessionStorage.setItem("apc_x_sub_status","active"),_(!0))}).catch(oe=>{sessionStorage.setItem("apc_x_sub_status","")}).finally(()=>{s(!1),L(!0)})},P=()=>{v(e.jsx(nr,{value:p,format:u,id:"barcode-element"}));const Q=document.getElementById("barcode-element");Q&&f(Q.innerHTML)},X=Q=>{if(i.current.innerHTML){const oe=i.current.innerHTML;let te=new Image;te.src="data:image/svg+xml,"+encodeURIComponent(oe),te.onload=function(){const de=new B.fabric.Image(te,{left:200,top:200});r.add(de),r.setActiveObject(de)}}a&&l(!0)};return!k&&!b&&z?e.jsx(ut,{theme:n}):k&&!b&&z?e.jsxs(h.Fragment,{children:[e.jsx("br",{}),e.jsx("br",{}),"Enter number",e.jsx("input",{type:"text",onChange:Q=>j(Q.target.value),className:"apc-mpc-widget-input",style:{border:`solid 3px ${n.primaryColor}`}}),e.jsx("br",{}),e.jsx("br",{}),"Code type",e.jsxs("select",{value:u,onChange:Q=>w(Q.target.value),className:"apc-mpc-widget-input",style:{border:`solid 3px ${n.primaryColor}`},children:[e.jsx("option",{value:"CODE128",children:"CODE128"}),e.jsx("option",{value:"EAN13",children:"EAN / UPC"}),e.jsx("option",{value:"CODE39",children:"CODE39"}),e.jsx("option",{value:"ITF14",children:"ITF-14"}),e.jsx("option",{value:"MSI10",children:"MSI10"}),e.jsx("option",{value:"pharmacode",children:"Pharmacode"}),e.jsx("option",{value:"codabar",children:"Codabar"})]}),e.jsx("br",{}),e.jsx("br",{}),e.jsx("button",{className:"apc-mpc-widget-btn",disabled:!p,onClick:()=>P(),style:{backgroundColor:n.primaryColor,color:"#ffffff"},children:"Generate Barcode"}),e.jsx("br",{}),e.jsx("br",{})," ",e.jsx("br",{}),e.jsx("br",{}),e.jsx("div",{children:c&&e.jsx("div",{ref:i,onClick:Q=>X(),style:{cursor:"pointer"},children:c})})]}):e.jsxs("div",{children:[" ",e.jsx(ft,{})]})}function on(m){const{apcCanvasInstance:r,theme:n}=m,[a,l]=h.useState(),[d,x]=h.useState(),[p,j]=h.useState(""),c=(w,i)=>{if(r){if(w==="bg-color"&&i.target.value&&r.set({backgroundColor:i.target.value}),w==="image"&&i.target.value){const y=i.target.files[0],f=new FileReader;f.onload=function(b){const s=b.target.result;B.fabric.Image.fromURL(s,function(k){r.setBackgroundImage(k,r.renderAll.bind(r),{})})},f.readAsDataURL(y)}w==="height"&&i.target.value&&(l(i.target.value),r.setHeight(i.target.value)),w==="width"&&i.target.value&&(x(i.target.value),r.setWidth(i.target.value)),r&&r.renderAll()}},v=(w,i,y)=>{x(i),l(w),r.setWidth(i),r.setHeight(w),j(y)},u=()=>e.jsxs("div",{children:[e.jsx("br",{}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row"},children:e.jsxs("div",{children:["Height(px)",e.jsx("input",{type:"number",value:r.height,onChange:w=>c("height",w),className:"apc-mpc-widget-input",style:{border:`solid 3px ${n.primaryColor}`}})]})})," ",e.jsx("div",{style:{display:"flex",flexDirection:"row"},children:e.jsxs("div",{children:["Width(px)",e.jsx("input",{color:"info",type:"number",value:r.width,onChange:w=>c("width",w),className:"apc-mpc-widget-input",style:{border:`solid 3px ${n.primaryColor}`}})]})}),e.jsx("br",{}),e.jsx("br",{}),e.jsx("div",{style:{textAlign:"left"},children:e.jsx("h3",{children:"Standard dimensions"})}),e.jsx("br",{})," ",e.jsx("br",{}),e.jsxs("div",{children:[e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>v(1440,2560,"YOUC"),children:[p==="YOUC"?e.jsx("span",{style:{color:"green"},children:"✓"}):null," Youtube Channel : 2560 x 1440 px"]})}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>v(1080,1920,"FULLHD"),children:[p==="FULLHD"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Full HD : 1920 x 1080 px"]})}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>v(1080,1080,"INSTAP"),children:[p==="INSTAP"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Instagram Post:1080 x 1080 px"]})}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>v(1920,1080,"INSTAS"),children:[p==="INSTAS"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Instagram Story: 1080 x 1920 px"]})}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>v(1080,1080,"INSTAA"),children:[p==="INSTAA"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Instagram Ad: 1080 x 1080 px"]})}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>v(788,940,"FACEP"),children:[p==="FACEP"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Facebook Post: 940 x 788 px"]})}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>v(315,851,"FACEC"),children:[p==="FACEC"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Facebook Cover: 851 x 315 px"]})}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>v(628,1200,"FACEA"),children:[p==="FACEA"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Facebook Ad: 1200 x 628 px"]})}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>v(720,1280,"YOUT"),children:[p==="YOUT"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Youtube Thumbnail: 1280 x 720 px"]})}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>v(534,534,"INVITE"),children:[p==="INVITE"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Invitation : 14 x 14 cm"]})}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>v(1112,788,"A4"),children:[p==="A4"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"A4 : 788 x 1112 px"]})}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>v(192,336,"BUSINESSCARD"),children:[p==="BUSINESSCARD"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Business card 3.5 x 2 in"]})})]})]});return e.jsx("div",{children:u()})}const ve=(m,r,n,a="png",l)=>new Promise((d,x)=>{const p=document.createElement("canvas"),j=JSON.parse(m),c=crypto.randomUUID();p.width=n,p.height=r;const v=new B.fabric.StaticCanvas(p,{selection:!1,height:j.height,width:j.width});v.loadFromJSON(j,function(){if(v.renderAll(),a.toLowerCase()==="svg"){const u=v.toSVG(),w=new Blob([u],{type:"image/svg+xml"});l&&pt(w,"mypixia.svg"),d(new File([w],`${c}.svg`,{type:"image/svg+xml"}))}else if(a.toLowerCase()==="pdf"){const u=v.toDataURL("image/jpeg",1);import("jspdf").then(w=>{const i=new w.jsPDF({orientation:"landscape",unit:"px",format:[p.width,p.height]});i.addImage(u,"JPEG",0,0,p.width,p.height);const f=i.output("datauristring").split(",")[1],b=cn(f,"application/pdf"),s=new File([b],`${c}.pdf`,{type:"application/pdf"}),k=`${c}.pdf`;l&&pt(s,k),d(s)}).catch(w=>{console.error("Error loading jsPDF: ",w),x(w)})}else{let u,w="image/png",i="png";switch(a.toLowerCase()){case"jpeg":u=v.toDataURL("image/jpeg",1),w="image/jpeg",i="jpg";break;case"webp":u=v.toDataURL("image/webp",1),w="image/webp",i="webp";break;default:u=v.toDataURL("image/png",1);break}const y=atob(u.split(",")[1]),f=new Array(y.length);for(let _=0;_<y.length;_++)f[_]=y.charCodeAt(_);const b=new Uint8Array(f),s=new File([b],`${c}.${i}`,{type:w}),k=`${c}.${i}`;l&&pt(s,k),d(s)}})}),lt=async({fabricString:m,height:r,width:n,download:a})=>{const l=JSON.parse(m),d=crypto.randomUUID();return new Promise((x,p)=>{const j=document.createElement("canvas"),c=new B.fabric.Canvas(j,{height:r,width:n});c.loadFromJSON(l,()=>{c.setBackgroundImage(null,c.renderAll.bind(c));const v=c.toDataURL({format:"png"});fetch(v).then(u=>u.blob()).then(u=>{const w=new File([u],`${d}.png`,{type:"image/png"}),i=`${d}.png`;a&&pt(w,i),x(w)}).catch(u=>p(u))})})},pt=(m,r)=>{const n=URL.createObjectURL(m),a=document.createElement("a");a.href=n,a.download=r,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(n)};function cn(m,r){const n=atob(m),a=new Array(n.length);for(let d=0;d<n.length;d++)a[d]=n.charCodeAt(d);const l=new Uint8Array(a);return new Blob([l],{type:r})}const an=({children:m})=>sr.createPortal(m,document.getElementById("apc-mpx-editor-modal-root"));function xt(m){const{isOpen:r,onClose:n,children:a}=m;return r?e.jsx(an,{children:e.jsx("div",{className:"apc-mpx-widget-modal-overlay",children:e.jsxs("div",{className:"apc-mpx-widget-modal",children:[e.jsx("button",{style:{color:"red"},className:"apc-mpx-widget-modal-close-btn",onClick:n,children:"Close"}),e.jsx("div",{className:"apc-mpx-widget-modal-content",children:a})]})})}):null}const je=(m,r)=>{m=m.startsWith("#")?m:`#${m}`;let n=parseInt(m.slice(1,3),16),a=parseInt(m.slice(3,5),16),l=parseInt(m.slice(5,7),16);return n=parseInt(n*(100-r)/100),a=parseInt(a*(100-r)/100),l=parseInt(l*(100-r)/100),n=n.toString(16).padStart(2,"0"),a=a.toString(16).padStart(2,"0"),l=l.toString(16).padStart(2,"0"),`#${n}${a}${l}`};function Pt(m){const[r,n]=h.useState(""),{apcCanvasJSON:a,height:l,width:d}=m;return h.useEffect(()=>{const x=document.createElement("canvas"),p=JSON.parse(a);x.width=d,x.height=l;const j=new B.fabric.StaticCanvas(x,{selection:!1,height:p.height,width:p.width});j.loadFromJSON(p,function(){j.renderAll();const c=j.toDataURL("image/png",1);n(c)})},[]),r?e.jsx("div",{children:e.jsx("div",{className:"apc-mpx-widget-responsive-image-container",style:{cursor:"pointer",maxHeight:"500px",maxWidth:"500px"},children:e.jsx("img",{src:r,alt:"mypixia cool design",className:"apc-mpx-widget-responsive-image"})})}):"...processing"}function ln(m){const{theme:r,apcCanvasInstance:n}=m,[a,l]=h.useState(!1),[d,x]=h.useState(),p=()=>{l(!0)},j=()=>{l(!1)},c=()=>{if(!n)return null;const v=JSON.stringify(n);return e.jsxs(xt,{isOpen:a,onClose:j,children:[e.jsx(Pt,{apcCanvasJSON:v,height:n.height,width:n.width}),e.jsx("div",{children:e.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:5},children:[e.jsx("div",{children:e.jsx(ce.FacebookShareButton,{url:d,children:e.jsx(ce.FacebookIcon,{size:32,round:!0})})}),e.jsx("div",{children:e.jsx(ce.TwitterShareButton,{url:d,title:"Hello",children:e.jsx(ce.XIcon,{size:32,round:!0})})}),e.jsx("div",{children:e.jsx(ce.TelegramShareButton,{url:d,title:"Hello",children:e.jsx(ce.TelegramIcon,{size:32,round:!0})})}),e.jsx("div",{children:e.jsx(ce.WhatsappShareButton,{url:d,title:"Hello",separator:":: ",children:e.jsx(ce.WhatsappIcon,{size:32,round:!0})})}),e.jsx("div",{children:e.jsx(ce.LinkedinShareButton,{url:d,children:e.jsx(ce.LinkedinIcon,{size:32,round:!0})})}),e.jsx("div",{children:e.jsx(ce.PinterestShareButton,{url:"https://static.mypixia.com",media:d,children:e.jsx(ce.PinterestIcon,{size:32,round:!0})})}),e.jsx("div",{children:e.jsx(ce.RedditShareButton,{url:d,title:"Hello",windowWidth:660,windowHeight:460,children:e.jsx(ce.RedditIcon,{size:32,round:!0})})}),e.jsx("div",{children:e.jsx(ce.InstapaperShareButton,{url:d,title:"Hello",children:e.jsx(ce.InstapaperIcon,{size:32,round:!0})})})]})}),e.jsx("hr",{}),e.jsx("br",{}),e.jsx("button",{autoFocus:!0,type:"button",className:"apc-mpc-widget-btn",onClick:()=>j(),style:{backgroundColor:"red",color:"#ffffff",float:"right"},children:"Close"})]})};return e.jsxs(h.Fragment,{children:[e.jsxs("button",{className:"apc-mpc-widget-btn",onClick:()=>p(),role:"dialog",style:{backgroundColor:je(r.primaryColor,40),color:"#ffffff",float:"right"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:"#ffffff",d:Mr})}),"  Share"]}),c()]})}function dn(m){const{theme:r,apiKey:n,apcCanvasInstance:a,updateSelectedSections:l,updateActiveSection:d,accesories:x,getDesignFormats:p}=m,[j,c]=h.useState(!1),[v,u]=h.useState(),w=()=>{c(!0)},i=()=>{c(!1)},y=()=>({getPDF:()=>{const b=JSON.stringify(a);return ve(b,a.height,a.width,"pdf",!0).then(s=>s)},getPNG:()=>{const b=JSON.stringify(a);return ve(b,a.height,a.width,"png",!0).then(s=>s)},getSVG:()=>{const b=JSON.stringify(a);return ve(b,a.height,a.width,"svg",!0).then(s=>s)},getJPEG:()=>{const b=JSON.stringify(a);return ve(b,a.height,a.width,"jpeg",!0).then(s=>s)},getWEBP:()=>{const b=JSON.stringify(a);return ve(b,a.height,a.width,"webp",!0).then(s=>s)}}),f=()=>{if(!a)return null;const b=JSON.stringify(a);return e.jsxs(xt,{isOpen:j,onClose:i,children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[e.jsx("h3",{style:{float:"left"},children:"Download"}),e.jsx("div",{children:e.jsx(Pt,{apcCanvasJSON:b,height:a.height,width:a.width})}),e.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:5},children:[e.jsx("div",{style:{color:je(r.primaryColor,50),fontWeight:"bold",textDecoration:"underline",cursor:"pointer"},onClick:()=>y().getPDF(),children:"PDF"}),e.jsx("div",{style:{color:je(r.primaryColor,50),fontWeight:"bold",textDecoration:"underline",cursor:"pointer"},onClick:()=>y().getSVG(),children:"SVG"}),e.jsx("div",{style:{color:je(r.primaryColor,50),fontWeight:"bold",textDecoration:"underline",cursor:"pointer"},onClick:()=>y().getPNG(),children:"PNG"}),e.jsx("div",{style:{color:je(r.primaryColor,50),fontWeight:"bold",textDecoration:"underline",cursor:"pointer"},onClick:()=>y().getJPEG(),children:"JPEG"}),e.jsx("div",{style:{color:je(r.primaryColor,50),fontWeight:"bold",textDecoration:"underline",cursor:"pointer"},onClick:()=>y().getWEBP(),children:"WEBP"})]})]}),e.jsx("br",{}),e.jsx("br",{}),e.jsx("hr",{}),e.jsx("br",{}),e.jsx("button",{autoFocus:!0,type:"button",className:"apc-mpc-widget-btn",onClick:()=>i(),style:{backgroundColor:"red",color:"#ffffff",float:"right"},children:"Close"})]})};return e.jsxs(h.Fragment,{children:[e.jsxs("button",{className:"apc-mpc-widget-btn",onClick:()=>w(),role:"dialog",style:{backgroundColor:je(r.primaryColor,40),color:"#ffffff",float:"right"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:"#ffffff",d:Rr})}),"  Download"]}),f()]})}function pn(m){var Me;const{theme:r,activeSection:n,selectedObjectType:a,renderQuickActions:l,renderActionItems:d,canvasEl:x,zoomIn:p,zoomOut:j,apcCanvasInstance:c,setActiveSection:v,saveActiveDesign:u,reloadTabs:w,initProductName:i,historyRef:y,currentState:f,setCurrentState:b,setHistory:s,activeTabName:k,isPlainColor:_,selectedProduct:z,isMobile:L,supportedProductColors:F,canvasId:R}=m,[E,P]=h.useState(),[X,Q]=h.useState([]),[oe,te]=h.useState(0),[de,xe]=h.useState(!1),Se=h.useRef(null),[Ie,_e]=h.useState(!1),[Be,Je]=h.useState(null),[re,rt]=h.useState(),[De,Ge]=h.useState(),[Fe,He]=h.useState(),[ke,J]=h.useState(!0),[Ee,Te]=h.useState(),ne=()=>{_e(!0),xe(!1)},ze=()=>{_e(!1)},nt=()=>{xe(N=>!N)};h.useEffect(()=>{const N=A=>{Se.current&&Se.current.contains(A.target)||xe(!1)};return document.addEventListener("mousedown",N),()=>{document.removeEventListener("mousedown",N)}},[]),h.useEffect(()=>{(async()=>{var A,G;if(E)try{const D=await et(E);He(D),(A=D==null?void 0:D.misc)!=null&&A.colorSettings&&rt(D.misc.colorSettings),((G=D==null?void 0:D.misc)==null?void 0:G.type)!=="subsection"&&Te(D)}catch(D){console.error("Error fetching tab data: ",D)}})()},[E,w]),h.useEffect(()=>{(async()=>{const A=await Le();let G=A?A.filter(D=>{var ee;return D.classification!=="cart"&&((ee=D.misc)==null?void 0:ee.type)!=="subsection"}).map(D=>D.id):[];G.length===0&&G.push("design"),oe===0&&P(G[0]),Q(G)})()},[oe,w]);const ue=()=>{c&&(c.clear(),c.renderAll())},pe=N=>{if(!c)return;c.backgroundColor="transparent",c&&c.requestRenderAll();let A=c.backgroundImage;A&&(A.filters=[],A.filters.push(new B.fabric.Image.filters.BlendColor({color:N})),A.applyFilters(),c&&c.requestRenderAll(),Ge(N),u(c,Fe))},be=()=>{if(!(!re||(re==null?void 0:re.length)<=1))return re.map((N,A)=>e.jsxs(h.Fragment,{children:[e.jsx("div",{role:"button",className:"apc-mpx-widget-circle",style:{backgroundColor:N,cursor:"pointer",border:"solid 1px #ffffff"},onClick:()=>pe(N)})," "]},A))},Pe=async(N,A)=>{var me,ye;const G=(ye=(me=c==null?void 0:c.backgroundImage)==null?void 0:me.filters[0])==null?void 0:ye.color,D=await et(N);if(!D)return;const ee=D!=null&&D.content?JSON.parse(D.content):null;ee&&c?(c.clear(),c.setBackgroundImage(null),c.loadFromJSON(ee,()=>{var se;c.renderAll(),v(D),((se=D==null?void 0:D.misc)==null?void 0:se.type)!=="subsection"?(sessionStorage.setItem("apc_x_activeTab",N),J(!0)):(J(!1),G&&pe(G)),P(N)})):console.error("Failed to load JSON content for section:",N)},Ye=()=>X.map(N=>e.jsx("button",{className:`tablinks ${E===N?"active":null}`,onClick:()=>Pe(N),children:N},N)),ge=()=>{Le().then(N=>{if(N&&N.length>0){const A=N[0],G=JSON.parse(A.content);c.loadFromJSON(G,function(){c.off("object:modified"),c.on({"object:modified":D=>{u(c,A)}}),P(A.id),sessionStorage.setItem("apc_x_activeTab",A.id),v(A),te(oe+1),c&&c.renderAll()})}else{let A="design";const G=JSON.stringify(c);$e(A,"general",G,null).then(D=>{et(A).then(ee=>{const me=JSON.parse(ee.content);c.loadFromJSON(me,function(){c.off("object:modified"),c.on({"object:modified":ye=>{u(c,ee)}}),P(A),sessionStorage.setItem("apc_x_activeTab",A),v(ee),te(oe+1),c&&c.renderAll()})})})}})},st=()=>{Ur(E).then(N=>{ze(),ge()})},Ke=()=>c?e.jsxs(xt,{isOpen:Ie,onClose:ze,children:[e.jsx("div",{children:e.jsxs("h3",{style:{marginLeft:"30%",color:"green"},children:["Are you sure you want to delete ",e.jsx("u",{children:E})," ?"]})}),e.jsx("br",{}),e.jsx("br",{}),e.jsx("hr",{}),e.jsx("br",{}),e.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:10},children:[e.jsx("div",{children:e.jsx("button",{autoFocus:!0,type:"button",className:"apc-mpc-widget-btn",onClick:()=>st(),style:{backgroundColor:"green",color:"#ffffff"},children:"Yes"})}),e.jsx("div",{children:e.jsx("button",{autoFocus:!0,type:"button",className:"apc-mpc-widget-btn",onClick:()=>ze(),style:{backgroundColor:"red",color:"#ffffff",float:"right"},children:"Close"})})]})]}):null,Ve=()=>e.jsxs("div",{className:"apc-mpx-widget-button-group-container",children:[e.jsx("div",{className:"apc-mpx-widget-generic-icon",onClick:nt,children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 448 512",children:e.jsx("path",{fill:"#ffffff",d:Er})})}),de&&e.jsxs("div",{className:"apc-mpx-widget-popper-container",ref:Se,children:[e.jsx("div",{className:"apc-mpx-widget-popper-arrow-up"}),e.jsxs("ul",{autoFocus:!0,style:{paddingInlineStart:"2px",marginBlockStart:"6px",marginBlockEnd:"2px",fontSize:"13px",padding:"3px",color:je(r.primaryColor,80),width:"max-content"},children:[e.jsxs("li",{className:"apc-mpx-widget-popper-li",style:{height:"25px",cursor:"pointer",borderBottom:"1px solid #d7d7d7"},onClick:()=>ne(),role:"dialog",children:[e.jsx("svg",{className:"apc-mpx-hover-div",xmlns:"http://www.w3.org/2000/svg",height:"16",width:"14",viewBox:"0 0 448 512",children:e.jsx("path",{d:Dt,fill:je(r.primaryColor,80)})}),"  Delete"]}),e.jsxs("li",{className:"apc-mpx-widget-popper-li",style:{height:"25px",cursor:"pointer",marginBlockStart:"5px"},onClick:()=>ue(),role:"dialog",children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",className:"apc-mpx-hover-div",width:"14",viewBox:"0 0 576 512",children:e.jsx("path",{d:Tr,fill:je(r.primaryColor,80)})}),"  Clear"]})]})]})]}),it=N=>{var ye,se,qe,Ue;const A=c.width*5,G=c.height*5,D=JSON.parse(Ee.content),ee=(se=(ye=D==null?void 0:D.backgroundImage)==null?void 0:ye.filters[0])==null?void 0:se.color,me=(Ue=(qe=c==null?void 0:c.backgroundImage)==null?void 0:qe.filters[0])==null?void 0:Ue.color;et(N.sectionName).then(async we=>{if(we){const o=we!=null&&we.content?JSON.parse(we.content):null;o&&c?(await c.loadFromJSON(o,()=>{c.renderAll(),v(we),P(N.sectionName);const I=JSON.stringify(c),O={};O.id=N.sectionName,O.classification=z==null?void 0:z.name,O.json=I,O.misc={sectionName:N.sectionName,sectionImage:N.sectionImage,type:N.type},c.off("object:modified"),c.on({"object:modified":C=>{u(c,O)}})}),pe(me),ke||J(!0)):console.error("Failed to load JSON content for section:",N.sectionName)}else c&&c.clear(),N.type="subsection",B.fabric.Image.fromURL(N.sectionImage,function(o){o.width=A,o.height=G,o.scaleToWidth(A),o.scaleToHeight(G),c.setBackgroundImage(o),(De||ee)&&(o.filters=[],o.filters.push(new B.fabric.Image.filters.BlendColor({color:De||ee})),o.applyFilters());const I=JSON.stringify(c),O={};O.id=N.sectionName,O.classification=Ee.id,O.json=I,O.misc={sectionName:N.sectionName,sectionImage:N.sectionImage,type:N.type},c.off("object:modified"),c.on({"object:modified":C=>{u(c,O)}}),$e(N.sectionName,E,I,{...N}).then(C=>{c&&(c.renderAll(),ke&&J(!1),P(N.sectionName),te(oe+1))})},{crossOrigin:"anonymous"})})},ot=()=>{if(!Fe)return null;let N=[];if(z){const A=z.sections.map(G=>({...G,type:"subsection"}));N.push(...A),N.push({sectionName:z==null?void 0:z.name,sectionImage:z==null?void 0:z.mainImage,type:"main"})}return N=N==null?void 0:N.map(A=>({...A,active:A.sectionName===E})),(N==null?void 0:N.length)<1?null:N==null?void 0:N.map((A,G)=>{var D,ee;return e.jsxs("div",{onClick:()=>it(A),style:{position:"relative",backgroundColor:"#ff000026",border:"solid 1px #ffffff",padding:"2px",borderRadius:"6px",cursor:"pointer",textAlign:"center"},children:[A.active&&e.jsx("div",{style:{position:"absolute",top:"5px",right:"5px",width:"12px",height:"12px",backgroundColor:"green",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx("span",{style:{color:"white",fontSize:"8px",fontWeight:"bold"},children:"✓"})}),!L&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"5px"},children:e.jsx("img",{src:A==null?void 0:A.sectionImage,width:50,height:50,alt:(A==null?void 0:A.sectionName)||"section image",style:{borderRadius:"6px"}})}),e.jsx("div",{style:{fontSize:"12px",color:"#333"},children:((D=A==null?void 0:A.sectionName)==null?void 0:D.length)>5?`${(ee=A==null?void 0:A.sectionName)==null?void 0:ee.substring(0,5)}...`:(A==null?void 0:A.sectionName)||"view"})]},G)})},Xe=()=>{if(y.current.length>0){const N=y.current.pop();c.loadFromJSON(N,()=>{c.renderAll(),b(N)})}};return e.jsxs(h.Fragment,{children:[e.jsx("div",{className:"tab",children:Ye()}),e.jsxs("div",{style:{display:"flex",backgroundColor:r.primaryColor,flexDirection:"row",padding:"3px",color:"#ffffff",minHeight:"30px"},children:[e.jsx("div",{style:{flexBasis:"40%",marginTop:"8px"},children:e.jsx("div",{style:{display:"flex",flexDirection:"row"},children:e.jsxs("div",{children:[e.jsx("button",{style:{border:"none",backgroundColor:"transparent",color:"#ffffff",fontWeight:"bold",cursor:"pointer",height:"12px"},onClick:()=>Xe(),title:"UNDO",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"25",className:"apc-mpx-hover-div",width:"25",viewBox:"0 0 16 16",children:e.jsx("path",{d:zr,fill:"#ffffff"})})})," "]})})}),e.jsx("div",{style:{flexBasis:"20%"},children:a?l():null}),e.jsx("div",{style:{flexBasis:"40%",marginTop:"8px"},children:a?d():null}),Ve()]}),e.jsxs("div",{id:"apc-mpx-editor-canvas-container",style:{minHeight:"90vh",padding:"3px",overflowX:"hidden",position:"relative"},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"row"},children:[e.jsx("div",{children:e.jsx("div",{style:{zIndex:1e3,overflow:"hidden",position:"absolute",marginLeft:"1%",display:"flex",flexDirection:"row",marginTop:"1.3rem"},children:((Me=z==null?void 0:z.sections)==null?void 0:Me.length)>0?ot():null})}),e.jsx("div",{children:e.jsx("canvas",{id:R??"apc-mpx-editor-canvas",ref:x,height:1e3})}),re&&(_||(n==null?void 0:n.plainColor)==="Y")&&ke&&(re==null?void 0:re.length)>1?e.jsxs("div",{style:{zIndex:1e3,overflow:"hidden",position:"absolute",marginLeft:"90%"},children:[e.jsx("br",{}),e.jsx("div",{style:{backgroundColor:"#ff000026",border:"solid 1px #ccc",padding:"3px",borderRadius:"6px"},children:re&&(re==null?void 0:re.length)>1?be():null})]}):null]}),e.jsxs("div",{style:{marginLeft:"45%"},children:[e.jsx("br",{}),e.jsx("button",{style:{height:"35px",width:"65px",cursor:"pointer"},"aria-label":"zoom in",onClick:()=>p(),children:"+"}),e.jsx("button",{style:{height:"35px",width:"65px",cursor:"pointer"},"aria-label":"zoom out",onClick:()=>j(),children:"-"})]})]}),Ke()]})}function hn({data:m,theme:r,apcCanvasInstance:n,closeMobileModalSecondaryPanel:a,isMobile:l}){const[d,x]=h.useState({}),p=u=>{x(w=>({...w,[u]:!w[u]}))},j=async u=>{const w=await Ht(u);w&&B.fabric.Image.fromURL(w,i=>{i.set({left:100,top:100,scaleX:.3,scaleY:.3}),n.add(i),n.renderAll(),l&&a(!0)})},c=(u,w="",i=0)=>e.jsx("ul",{style:{listStyleType:"none",paddingLeft:`${i*20}px`,margin:"0"},children:Object.keys(u).map(y=>{const f=`${w}/${y}`,b=d[f];return u[y].type==="image"?e.jsx("li",{children:e.jsx("div",{onClick:()=>j(u[y].url),style:{cursor:"pointer"},children:e.jsx("img",{src:u[y].url,alt:y,style:{width:"100px",height:"auto"}})})},f):e.jsxs("li",{children:[e.jsxs("div",{onClick:()=>p(f),style:{cursor:"pointer",display:"flex",alignItems:"center",fontWeight:"bold",color:r.primaryColorLight},children:[e.jsx("div",{style:{marginRight:"5px"},children:b?e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",height:15,width:15,children:e.jsx("path",{d:Dr,fill:r.primaryColorLight})}):e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",height:15,width:15,children:e.jsx("path",{d:Fr,fill:r.primaryColorLight})})}),y]}),b&&c(u[y],f,i+1)]},f)})}),v=un(m);return e.jsx("div",{children:c(v)})}function un(m){const r={};return m.forEach(n=>{const a=n.name.split("/");let l=r;a.forEach((d,x)=>{l[d]||(l[d]=x===a.length-1?n:{}),l=l[d]})}),r}function fn(m){const{apcCanvasInstance:r,theme:n,apiEndpoint:a,isMobile:l,closeMobileModalSecondaryPanel:d,apiKey:x}=m,p=`${a}/api/v1/designer`,[j,c]=h.useState([]),[v,u]=h.useState(!1),[w,i]=h.useState(!1),[y,f]=h.useState(!1),b=sessionStorage.getItem("apc_x_sub_status"),s=sessionStorage.getItem("apc_x_stickers");h.useEffect(()=>{u(!0),(async()=>{b==="active"?i(!0):await _(),s?(c(JSON.parse(s)),u(!1)):await k()})()},[]);const k=()=>{u(!0);const z=`${p}/get-stickers`;Ce.get(z).then(L=>{L.data.object&&(c(L.data.object.contents),sessionStorage.setItem("apc_x_stickers",JSON.stringify(L.data.object.contents)))}).catch(L=>{console.error("Error fetching data:",L)}).finally(()=>{u(!1)})},_=()=>{u(!0);const z=`${p}/get-subscription-status/${x}`;Ce.get(z).then(L=>{L.data.object&&L.data.object==="active"&&(sessionStorage.setItem("apc_x_sub_status","active"),i(!0))}).catch(L=>{sessionStorage.setItem("apc_x_sub_status","")}).finally(()=>{u(!1),f(!0)})};return!w&&!v&&y?e.jsx(ut,{theme:n}):w&&j.length>0&&!v?e.jsx(h.Fragment,{children:e.jsx("div",{style:{padding:"10px"},children:e.jsx(hn,{data:j,theme:n,apcCanvasInstance:r,isMobile:l,closeMobileModalSecondaryPanel:d})})}):e.jsx("div",{children:e.jsx(ft,{})})}const Vt=h.forwardRef((m,r)=>{const{theme:n=ar,canvasId:a=null,readOnly:l=!1,apiKey:d=null,apiEndpoint:x,enabledModules:p=["TXT","STICKERS","SHAPES","ICONS","IMAGE","QUOTE","BACKGROUND","QRCODE","BARCODE"],actionButtons:j={share:!1,download:!0},initInstance:c=null,initCategory:v=null,additionalActionButton:u=null,initProductName:w,isPlainColor:i,product:y={name:"Premium Crew Neck T-Shirt",category:"Tshirts",description:"Men's crew neck t-shirts",plainColor:"Y",mainImage:"https://static.mypixia.com/prod/products/96ca4acb-c426-4619-a2c4-7acd95b78451.png",colorSettings:["#FF0000","#0000FF","#008000","#000000","#FFFFFF","#808080","#FFFF00"],sections:[{sectionName:"Sleeve-left",sectionImage:"https://static.mypixia.com/prod/products/27b8c138-af4e-4ea0-833d-88b10fbd3cf7.png"},{sectionName:"Back",sectionImage:"https://static.mypixia.com/prod/products/d4c53776-7b7d-41c5-a6b5-2bf5876cd26e.png"}]}}=m,[f,b]=h.useState(p[0]),[s,k]=h.useState(),_=h.useRef(null),[z,L]=h.useState(),[F,R]=h.useState(!1),[E,P]=h.useState(1),X=.1,[Q,oe]=h.useState(1),[te,de]=h.useState([]),[xe,Se]=h.useState(null),[Ie,_e]=h.useState(null),[Be,Je]=h.useState(0),[re,rt]=h.useState(),[De,Ge]=h.useState(null),Fe=h.useRef([]),[He,ke]=h.useState(null),[J,Ee]=h.useState(!1),[Te,ne]=h.useState(!1);h.useEffect(()=>{const o=()=>Ee(window.innerWidth<600);return o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[]),h.useEffect(()=>{var K;const o=document.getElementById("apc-mpx-editor-canvas-container"),I=document.getElementById("apc-mpx-editor-canvas-container");if(!_.current||!o||!I){console.error("Canvas element is not mounted yet!");return}o.style.position="relative";const O={isDrawingMode:!1,selection:!0,selectionBorderColor:"#008000",height:I.offsetHeight,width:o.offsetWidth,enableRetinaScaling:!0};let C,W;if(l)C=new B.fabric.StaticCanvas(_.current,O);else if(C=new B.fabric.Canvas(_.current,O),ze(o).updateRulers(C.getWidth(),C.getHeight()),Ie)W=JSON.parse(Ie),C.loadFromJSON(W,function(){});else if(c){let T;try{T=JSON.parse(c)}catch(ae){console.error("Failed to parse initInstance",ae)}C&&T?C.loadFromJSON(T,function(){}):console.error("Canvas or InitInstance is not properly initialized")}else{const T=new B.fabric.Textbox("Something cool!",{width:300,left:250,top:300,fontFamily:"aclonica",fill:"#6a45d2",rotate:20});T.shadow={color:"rgba(0,0,0,0.5)",blur:10,offsetX:5,offsetY:5},C.add(T),y!=null&&y.mainImage&&((K=B.fabric.Image)==null||K.fromURL(y.mainImage,function(ae){ae.height=I.offsetHeight,ae.width=o.offsetWidth,ae.scaleToWidth(I.offsetHeight),ae.scaleToHeight(o.offsetWidth),C.setBackgroundImage(ae),C.setActiveObject(T),pe(T),C&&(C.renderAll(),N(C))},{crossOrigin:"anonymous"}))}return C.on({"selection:updated":H=>{const T=C.getActiveObject();pe(T)},"selection:created":H=>{const T=C.getActiveObject();pe(T)},"selection:cleared":H=>{be()},"object:modified":H=>{N(C),ue(C)},"object:added":H=>{ue(C)},"object:removed":H=>{ue(C)},"object:created":H=>{ue(C)}}),k(C),oe(o.offsetWidth),()=>{k(null),C.off({"selection:updated":H=>{const T=C.getActiveObject();pe(T)},"selection:created":H=>{const T=C.getActiveObject();pe(T)},"selection:cleared":H=>{be()},"object:modified":H=>{N(C),ue(C)},"object:added":H=>{ue(C)},"object:removed":H=>{ue(C)},"object:created":H=>{ue(C)}}),C.dispose()}},[Ie]),h.useEffect(()=>(nt(),document.addEventListener("keydown",o=>Me(o)),()=>{document.removeEventListener("keydown",o=>Me(o))}),[s]),h.useEffect(()=>{if(s){const o=document.getElementById("apc-mpx-editor-canvas-container"),I=()=>{const O=o.offsetWidth/Q;s.setZoom(O)};return window.addEventListener("resize",I),()=>{window.removeEventListener("resize",I)}}},[s,E]),h.useEffect(()=>{const o=()=>{if(s&&_.current){const I=s.getWidth(),O=s.getHeight(),C=window.innerWidth,W=window.innerHeight,K=C/I,H=W/O,T=Math.min(K,H);s.setZoom(T/1.4),s.renderAll()}};return J&&(o(),window.addEventListener("resize",o)),()=>window.removeEventListener("resize",o)},[s,J]),h.useImperativeHandle(r,()=>({getDesign:()=>G()}),[s]),h.useEffect(()=>{if(a&&s){const o=document.getElementById(a);o&&(o.instance={getDesignFormats:G})}},[a,s]);const ze=o=>{const O=document.createElement("div");O.id="horizontal-ruler",O.style.cssText=`
35
+ position: absolute;
36
+ top: 0;
37
+ left: 20px;
38
+ right: 0;
39
+ height: 20px;
40
+ background: #f0f0f0;
41
+ border-bottom: 1px solid #ccc;
42
+ z-index: 1000;
43
+ overflow: hidden;
44
+ `;const C=document.createElement("div");C.id="vertical-ruler",C.style.cssText=`
45
+ position: absolute;
46
+ top: 20px;
47
+ left: 0;
48
+ bottom: 0;
49
+ width: 20px;
50
+ background: #f0f0f0;
51
+ border-right: 1px solid #ccc;
52
+ z-index: 1000;
53
+ overflow: hidden;
54
+ `;const W=document.createElement("div");W.style.cssText=`
55
+ position: absolute;
56
+ top: 0;
57
+ left: 0;
58
+ width: 20px;
59
+ height: 20px;
60
+ background: #e0e0e0;
61
+ border-right: 1px solid #ccc;
62
+ border-bottom: 1px solid #ccc;
63
+ z-index: 1001;
64
+ `;const K=(T,ae)=>{T.innerHTML="";for(let ie=0;ie<=ae;ie+=10){const Re=document.createElement("div"),Ne=ie%50===0;if(Re.style.cssText=`
65
+ position: absolute;
66
+ left: ${ie}px;
67
+ top: ${Ne?"8px":"12px"};
68
+ width: 1px;
69
+ height: ${Ne?"12px":"8px"};
70
+ background: #666;
71
+ `,T.appendChild(Re),Ne&&ie>0){const Oe=document.createElement("span");Oe.textContent=ie,Oe.style.cssText=`
72
+ position: absolute;
73
+ left: ${ie-8}px;
74
+ top: 2px;
75
+ font-size: 10px;
76
+ color: #333;
77
+ font-family: Arial, sans-serif;
78
+ `,T.appendChild(Oe)}}},H=(T,ae)=>{T.innerHTML="";for(let ie=0;ie<=ae;ie+=10){const Re=document.createElement("div"),Ne=ie%50===0;if(Re.style.cssText=`
79
+ position: absolute;
80
+ top: ${ie}px;
81
+ left: ${Ne?"8px":"12px"};
82
+ height: 1px;
83
+ width: ${Ne?"12px":"8px"};
84
+ background: #666;
85
+ `,T.appendChild(Re),Ne&&ie>0){const Oe=document.createElement("span");Oe.textContent=ie,Oe.style.cssText=`
86
+ position: absolute;
87
+ top: ${ie-6}px;
88
+ left: 2px;
89
+ font-size: 10px;
90
+ color: #333;
91
+ font-family: Arial, sans-serif;
92
+ transform: rotate(-90deg);
93
+ transform-origin: center;
94
+ `,T.appendChild(Oe)}}};return o.appendChild(O),o.appendChild(C),o.appendChild(W),{horizontalRuler:O,verticalRuler:C,corner:W,updateRulers:(T,ae)=>{K(O,T),H(C,ae)}}},nt=()=>{Le().then(o=>{if(o&&o.length>0){const I=o[0].content;w===o[0].id&&_e(I)}})},ue=o=>{if(o){const I=o.toJSON();Ge(O=>(Fe.current.push(O),I))}},pe=o=>{L(o.type)},be=()=>{L(null)},Pe=()=>{s.getActiveObject()&&s.remove(s.getActiveObject())},Ye=()=>{const o=s.getActiveObject(),I=B.fabric.util.object.clone(o);I.set({left:o.left+20,top:o.top+20}),s.add(I)},ge=o=>{Se(o)},st=o=>{let I=te;I.push(o),de(I)},Ke=o=>{o==="lock"?s.getActiveObject().set({lockMovementX:!0,lockMovementY:!0}):s.getActiveObject().set({lockMovementX:!1,lockMovementY:!1})},Ve=()=>{s&&(s.getActiveObject().bringForward(),s.renderAll())},it=()=>{s&&(s.getActiveObject().sendBackwards(),s.renderAll())},ot=()=>{const o=E+X;P(o),s.setZoom(o)},Xe=()=>{const o=Math.max(E-X,X);P(o),s.setZoom(o)},Me=o=>{s&&s.getActiveObject()&&s.getActiveObject().type!=="textbox"&&o.keyCode===8&&Pe()},N=o=>{const I=sessionStorage.getItem("apc_x_activeTab");if(I)et(I).then(O=>{if(O){const C=JSON.stringify(o);$e(O.id,O.classification,C,O.misc).then(W=>{})}else{const C=JSON.stringify(o);$e(y.name??"design","general",C,y).then(W=>{})}});else{const O=JSON.stringify(o);$e(y.name??"design","general",O,y).then(C=>{})}},A=(o,I)=>{const O=JSON.stringify(o);$e(I.id,I.classification,O,I.misc).then(C=>{})},G=()=>({getPDF:()=>{const{height:o,width:I}=s;return Le().then(async O=>{let C=[];for(let W in O){let K,H;await ve(O[W].content,o,I,"pdf").then(T=>{K=T}),await lt({fabricString:O[W].content,height:o,width:I}).then(T=>{H=T}),C.push({fullDesign:K,printReady:H})}return C})},getPNG:()=>{const{height:o,width:I}=s;return Le().then(async O=>{let C=[];for(let W in O){let K,H;await ve(O[W].content,o,I,"png").then(T=>{K=T}),await lt({fabricString:O[W].content,height:o,width:I}).then(T=>{H=T}),C.push({fullDesign:K,printReady:H})}return C})},getSVG:()=>{const{height:o,width:I}=s;return Le().then(async O=>{let C=[];for(let W in O){let K,H;await ve(O[W].content,o,I,"svg").then(T=>{K=T}),await lt({fabricString:O[W].content,height:o,width:I}).then(T=>{H=T}),C.push({fullDesign:K,printReady:H})}return C})},getJPEG:()=>{const{height:o,width:I}=s;return Le().then(async O=>{let C=[];for(let W in O){let K,H;await ve(O[W].content,o,I,"jpeg").then(T=>{K=T}),await lt({fabricString:O[W].content,height:o,width:I}).then(T=>{H=T}),C.push({fullDesign:K,printReady:H})}return C})},getWEBP:()=>{const{height:o,width:I}=s;return Le().then(async O=>{let C=[];for(let W in O){let K,H;await ve(O[W].content,o,I,"webp").then(T=>{K=T}),await lt({fabricString:O[W].content,height:o,width:I}).then(T=>{H=T}),C.push({fullDesign:K,printReady:H})}return C})},getImageActiveTab:()=>{const o=sessionStorage.getItem("apc_x_activeTab");return et(o).then(I=>ve(I.content,s.height,s.width,"png").then(O=>{let C={};return C.file=O,C.height=s.height,C.width=s.width,C}))}}),D=()=>e.jsxs("div",{style:{marginTop:"6px",fontWeight:"bold"},children:["Replace Image: ",e.jsx("input",{type:"file",accept:"image/*",onChange:o=>ee(o)}),e.jsx("br",{})]}),ee=(o,I)=>{{const O=s.getActiveObject(),C=o.target.files[0],W=new FileReader;W.onload=function(K){const H=K.target.result;O.setSrc(H,function(T){T.set({angle:30}),s&&s.renderAll()})},W.readAsDataURL(C)}s&&s.renderAll()},me=()=>{switch(f){case"ICONS":return e.jsx(en,{apcCanvasInstance:s,theme:n,apiKey:d,isMobile:J,closeMobileModalSecondaryPanel:o=>ne(!o)});case"TEMPLATES":return e.jsx(Wr,{apcCanvasInstance:s,theme:n,apiKey:d,apiEndpoint:x,reloadTabs:o=>Je(o),updateActiveSection:o=>ge(o),initCategory:v,currentTabNo:Be,initInstance:c,setActiveTab:o=>ke(o),isMobile:J,closeMobileModalSecondaryPanel:o=>ne(!o)});case"TXT":return e.jsx(qr,{apcCanvasInstance:s,theme:n,apiKey:d,isMobile:J,closeMobileModalSecondaryPanel:o=>ne(!o)});case"IMAGE":return e.jsx(Zr,{apcCanvasInstance:s,theme:n,apiKey:d,apiEndpoint:x,isMobile:J,closeMobileModalSecondaryPanel:o=>ne(!o)});case"STICKERS":return e.jsx(fn,{apcCanvasInstance:s,theme:n,apiEndpoint:x,isMobile:J,apiKey:d,closeMobileModalSecondaryPanel:o=>ne(!o)});case"SHAPES":return e.jsx(_t,{apcCanvasInstance:s,theme:n,apiKey:d,isMobile:J,closeMobileModalSecondaryPanel:o=>ne(!o)});case"QUOTE":return e.jsx(tn,{apcCanvasInstance:s,theme:n,apiKey:d,apiEndpoint:x,isMobile:J,closeMobileModalSecondaryPanel:o=>ne(!o)});case"BACKGROUND":return e.jsx(rn,{apcCanvasInstance:s,theme:n,apiKey:d,apiEndpoint:x,updateActiveSection:o=>ge(o),reloadTabs:o=>Je(o),currentTabNo:Be,isMobile:J,closeMobileModalSecondaryPanel:o=>ne(!o)});case"QRCODE":return e.jsx(nn,{apcCanvasInstance:s,theme:n,apiKey:d,apiEndpoint:x,isMobile:J,closeMobileModalSecondaryPanel:o=>ne(!o)});case"BARCODE":return e.jsx(sn,{apcCanvasInstance:s,theme:n,apiKey:d,apiEndpoint:x,isMobile:J,closeMobileModalSecondaryPanel:o=>ne(!o)});case"SIZE":return e.jsx(on,{apcCanvasInstance:s,theme:n,apiKey:d,isMobile:J,closeMobileModalSecondaryPanel:o=>ne(!o)});default:return e.jsx(_t,{apcCanvasInstance:s,theme:n,apiKey:d,isMobile:J,closeMobileModalSecondaryPanel:o=>ne(!o)})}},ye=()=>{if(!z)return null;switch(z){case"text":return e.jsx(Bt,{apcCanvasInstance:s,theme:n,apiKey:d});case"textbox":return e.jsx(Bt,{apcCanvasInstance:s,theme:n,apiKey:d});case"rect":return e.jsx(Ze,{apcCanvasInstance:s,theme:n,apiKey:d});case"circle":return e.jsx(Ze,{apcCanvasInstance:s,theme:n,apiKey:d});case"triangle":return e.jsx(Ze,{apcCanvasInstance:s,theme:n,apiKey:d});case"line":return e.jsx(Ze,{apcCanvasInstance:s,theme:n,apiKey:d});case"path":return e.jsx(Ze,{apcCanvasInstance:s,theme:n,apiKey:d});case"polygon":return e.jsx(Ze,{apcCanvasInstance:s,theme:n,apiKey:d});case"image":return D();default:return null}},se=o=>{b(o),J&&ne(!0)},qe=()=>e.jsx("div",{id:"selectionRectangle",style:{marginLeft:"auto",position:"relative"},children:e.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:10,marginTop:"8px"},children:[e.jsxs("div",{className:"apc-mpx-tooltip-container",role:"button",onClick:()=>Pe(),style:{cursor:"pointer"},children:[e.jsx("svg",{className:"apc-mpx-hover-div",xmlns:"http://www.w3.org/2000/svg",height:"16",width:"14",viewBox:"0 0 448 512",children:e.jsx("path",{d:Dt,fill:"#d8d4d4"})}),e.jsx("div",{className:"apc-mpx-tooltip-text",children:"Delete"})]}),e.jsxs("div",{className:"apc-mpx-tooltip-container",role:"button",onClick:()=>it(),style:{cursor:"pointer"},children:[e.jsxs("svg",{className:"apc-mpx-hover-div",xmlns:"http://www.w3.org/2000/svg",fill:"#d8d4d4",width:"20px",height:"20px",viewBox:"0 0 32 32",children:[e.jsx("path",{d:"M28,10H22V4a2,2,0,0,0-2-2H4A2,2,0,0,0,2,4V20a2,2,0,0,0,2,2h6v6a2.0023,2.0023,0,0,0,2,2H28a2.0023,2.0023,0,0,0,2-2V12A2.0023,2.0023,0,0,0,28,10ZM12,28V12H28l.0015,16Z"}),e.jsx("rect",{style:{fill:"none"},width:"32",height:"32"})]}),e.jsx("div",{className:"apc-mpx-tooltip-text",children:"Send to back"})]}),e.jsxs("div",{className:"apc-mpx-tooltip-container",role:"button",onClick:()=>Ve(),style:{cursor:"pointer"},children:[e.jsxs("svg",{className:"apc-mpx-hover-div",xmlns:"http://www.w3.org/2000/svg",fill:"#d8d4d4",width:"20px",height:"20px",viewBox:"0 0 32 32",children:[e.jsx("path",{d:"M28,10H22V4a2.0023,2.0023,0,0,0-2-2H4A2.0023,2.0023,0,0,0,2,4V20a2.0023,2.0023,0,0,0,2,2h6v6a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V12A2,2,0,0,0,28,10ZM4,20,3.9985,4H20v6H12a2,2,0,0,0-2,2v8Z"}),e.jsx("rect",{style:{fill:"none"},height:"32",width:"32"})]}),e.jsx("div",{className:"apc-mpx-tooltip-text",children:"Bring to front"})]}),e.jsxs("div",{className:"apc-mpx-tooltip-container",onClick:()=>Ke("lock"),style:{cursor:"pointer"},children:[e.jsx("svg",{className:"apc-mpx-hover-div",xmlns:"http://www.w3.org/2000/svg",height:"16",width:"14",viewBox:"0 0 448 512",children:e.jsx("path",{fill:"#d8d4d4",d:"M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z"})}),e.jsx("div",{className:"apc-mpx-tooltip-text",children:"Lock"})]}),e.jsxs("div",{className:"apc-mpx-tooltip-container",onClick:()=>Ke("unlock"),style:{cursor:"pointer"},children:[e.jsx("svg",{className:"apc-mpx-hover-div",xmlns:"http://www.w3.org/2000/svg",height:"16",width:"18",viewBox:"0 0 576 512",children:e.jsx("path",{fill:"#d8d4d4",d:"M423.5 0C339.5 .3 272 69.5 272 153.5V224H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48h-48v-71.1c0-39.6 31.7-72.5 71.3-72.9 40-.4 72.7 32.1 72.7 72v80c0 13.3 10.7 24 24 24h32c13.3 0 24-10.7 24-24v-80C576 68 507.5-.3 423.5 0z"})}),e.jsx("div",{className:"apc-mpx-tooltip-text",children:"Unlock"})]}),e.jsxs("div",{className:"apc-mpx-tooltip-container",onClick:()=>Ye(),style:{cursor:"pointer"},children:[e.jsx("svg",{className:"apc-mpx-hover-div",xmlns:"http://www.w3.org/2000/svg",height:"16",width:"16",viewBox:"0 0 512 512",children:e.jsx("path",{fill:"#d8d4d4",d:"M464 0c26.5 0 48 21.5 48 48v288c0 26.5-21.5 48-48 48H176c-26.5 0-48-21.5-48-48V48c0-26.5 21.5-48 48-48h288M176 416c-44.1 0-80-35.9-80-80V128H48c-26.5 0-48 21.5-48 48v288c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48v-48H176z"})}),e.jsx("div",{className:"apc-mpx-tooltip-text",children:"Duplicate"})]})]})}),Ue=()=>s?e.jsx("div",{style:{height:"10vh",overflow:"auto"},children:e.jsx(xt,{isOpen:Te,onClose:()=>ne(!1),children:me()})}):null,we=()=>s?J?Ue():me():null;return e.jsxs("div",{className:"apc-mpc-widget-wrapper",children:[e.jsxs("div",{style:{display:"flex",backgroundColor:je(n.primaryColor,70),flexDirection:"row",padding:"3px",color:"#ffffff",minHeight:"30px"},children:[e.jsx("div",{style:{flexBasis:"40%"},children:e.jsx("div",{style:{float:"left"},children:e.jsxs("button",{onClick:()=>window.history.back(),style:{backgroundColor:"transparent",color:"#ffffff",border:"solid #ffffff 1px",padding:"4px",width:"auto",borderRadius:"4px",fontWeight:"bold"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 448 512",children:e.jsx("path",{fill:"#ffffff",d:Hr})})," Back"]})})}),e.jsx("div",{style:{flexBasis:"20%"}}),e.jsx("div",{style:{flexBasis:"40%"},children:e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:10},children:e.jsx("div",{children:e.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:5},children:[e.jsx("div",{children:s&&j.share?e.jsx("div",{children:e.jsx(ln,{apcCanvasInstance:s,theme:n})}):null}),e.jsx("div",{children:s&&j.download?e.jsx("div",{children:e.jsx(dn,{apcCanvasInstance:s,theme:n,apiKey:d,updateSelectedSections:o=>st(o),updateActiveSection:o=>ge(o),accesories,getDesignFormats:G()})}):null}),e.jsx("div",{children:s&&u?e.jsx("div",{children:e.jsx("button",{className:"apc-mpc-widget-btn",onClick:()=>u.btnAction(),style:{backgroundColor:u.btnColor??n.primaryColorLight,color:"#ffffff",border:"solid #ffffff 1px"},children:u.btnLabel})}):null})]})})})})]}),e.jsxs("div",{className:"apc-mpc-widget-colums",children:[e.jsx("div",{className:"apc-mpc-widget-colum-modules-container",children:e.jsxs("div",{className:"apc-mypixia-widget-primary-nav-container",children:[p.indexOf("TXT")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>se("TXT"),style:{padding:"10px",backgroundColor:f==="TXT"?n.primaryColorLight:"inherit",color:f==="TXT"?"#ffffff":"inherit"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"14",viewBox:"0 0 448 512",style:{fill:f==="TXT"?"#ffffff":n.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:Sr})}),e.jsx("div",{children:"Text"})]}):null,p.indexOf("STICKERS")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>se("STICKERS"),style:{padding:"10px",backgroundColor:f==="STICKERS"?n.primaryColorLight:"inherit",color:f==="STICKERS"?"#ffffff":"inherit"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"20",viewBox:"0 0 640 512",style:{fill:f==="STICKERS"?"#ffffff":n.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:Br})}),e.jsx("div",{children:"Stickers"})]}):null,p.indexOf("SHAPES")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>se("SHAPES"),style:{padding:"10px",backgroundColor:f==="SHAPES"?n.primaryColorLight:"inherit",color:f==="SHAPES"?"#ffffff":"inherit"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"16",viewBox:"0 0 512 512",style:{fill:f==="SHAPES"?"#ffffff":n.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:wr})}),e.jsx("div",{children:"Shapes"})]}):null,p.indexOf("ICONS")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>se("ICONS"),style:{padding:"10px",backgroundColor:f==="ICONS"?n.primaryColorLight:"inherit",color:f==="ICONS"?"#ffffff":"inherit"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"16",viewBox:"0 0 512 512",style:{fill:f==="ICONS"?"#ffffff":n.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:Cr})}),e.jsx("div",{children:"Icons"})]}):null,p.indexOf("IMAGE")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>se("IMAGE"),style:{padding:"10px",backgroundColor:f==="IMAGE"?n.primaryColorLight:"inherit",color:f==="IMAGE"?"#ffffff":"inherit"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"18",viewBox:"0 0 512 512",style:{fill:f==="IMAGE"?"#ffffff":n.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:Ft})}),e.jsx("div",{children:"Upload"})]}):null,p.indexOf("QUOTE")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>se("QUOTE"),style:{padding:"10px",backgroundColor:f==="QUOTE"?n.primaryColorLight:"inherit",color:f==="QUOTE"?"#ffffff":"inherit"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"16",viewBox:"0 0 512 512",style:{fill:f==="QUOTE"?"#ffffff":n.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:kr})}),e.jsx("div",{children:"Quote"})]}):null,p.indexOf("BACKGROUND")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>se("BACKGROUND"),style:{padding:"10px",backgroundColor:f==="BACKGROUND"?n.primaryColorLight:"inherit",color:f==="BACKGROUND"?"#ffffff":"inherit"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"20",viewBox:"0 0 640 512",style:{fill:f==="BACKGROUND"?"#ffffff":n.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:Nr})}),e.jsx("div",{children:"Background"})]}):null,p.indexOf("QRCODE")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>se("QRCODE"),style:{padding:"10px",backgroundColor:f==="QRCODE"?n.primaryColorLight:"inherit",color:f==="QRCODE"?"#ffffff":"inherit"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"20",viewBox:"0 0 640 512",style:{fill:f==="QRCODE"?"#ffffff":n.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:Or})}),e.jsx("div",{children:"QR Code"})]}):null,p.indexOf("BARCODE")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>se("BARCODE"),style:{padding:"10px",backgroundColor:f==="BARCODE"?n.primaryColorLight:"inherit",color:f==="BARCODE"?"#ffffff":"inherit"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"16",viewBox:"0 0 512 512",style:{fill:f==="BARCODE"?"#ffffff":n.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:Ar})}),e.jsx("div",{children:"Barcode"})]}):null,p.indexOf("SIZE")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>se("SIZE"),style:{padding:"10px",backgroundColor:f==="SIZE"?n.primaryColorLight:"inherit",color:f==="SIZE"?"#ffffff":"inherit"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"14",viewBox:"0 0 448 512",style:{fill:f==="SIZE"?"#ffffff":n.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:Ir})}),e.jsx("div",{children:"Size"})]}):null]})}),e.jsx("div",{className:"apc-mpc-widget-colum-features-container",children:we()}),e.jsx("div",{className:"apc-mpc-widget-colum-editor-container",children:e.jsx(pn,{theme:n,activeSection:xe,selectedObjectType:z,renderQuickActions:qe,renderActionItems:ye,canvasEl:_,zoomIn:()=>ot(),zoomOut:()=>Xe(),apcCanvasInstance:s,setActiveSection:o=>Se(o),updateActiveDesignSection:o=>ge(o),saveActiveDesign:(o,I)=>A(o,I),reloadTabs:Be,activeTabName:He,supportedColors:re,initProductName:w,historyRef:Fe,currentState:De,setCurrentState:o=>Ge(o),isPlainColor:i,selectedProduct:y,isMobile:J,canvasId:a})})]}),e.jsx("div",{id:"apc-mpx-editor-modal-root"}),J?Ue():null]})});Vt.displayName="Mypixia";module.exports=Vt;