@mypixia/simplex-designer 1.0.14 → 1.0.16
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/README.md +7 -1
- package/dist/index.cjs.js +11 -11
- package/dist/index.es.js +431 -375
- package/dist/index.umd.js +778 -0
- package/package.json +1 -4
- /package/dist/{index.css → index_external.css} +0 -0
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";require('./
|
|
1
|
+
"use strict";require('./index_external.css');var Gt=Object.create;var xt=Object.defineProperty;var Jt=Object.getOwnPropertyDescriptor;var Yt=Object.getOwnPropertyNames;var Kt=Object.getPrototypeOf,Xt=Object.prototype.hasOwnProperty;var qt=(j,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of Yt(t))!Xt.call(j,l)&&l!==o&&xt(j,l,{get:()=>t[l],enumerable:!(i=Jt(t,l))||i.enumerable});return j};var Qt=(j,t,o)=>(o=j!=null?Gt(Kt(j)):{},qt(t||!j||!j.__esModule?xt(o,"default",{value:j,enumerable:!0}):o,j));const h=require("react"),_=require("fabric"),ye=require("axios"),Zt=require("qrcode"),er=require("react-barcode"),ne=require("react-share"),tr=require("react-dom");var st={exports:{}},tt={};/**
|
|
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 gt;function rr(){if(gt)return tt;gt=1;var j=h,t=Symbol.for("react.element"),
|
|
9
|
+
*/var gt;function rr(){if(gt)return tt;gt=1;var j=h,t=Symbol.for("react.element"),o=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,l=j.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function x(d,y,a){var v,u={},w=null,n=null;a!==void 0&&(w=""+a),y.key!==void 0&&(w=""+y.key),y.ref!==void 0&&(n=y.ref);for(v in y)i.call(y,v)&&!f.hasOwnProperty(v)&&(u[v]=y[v]);if(d&&d.defaultProps)for(v in y=d.defaultProps,y)u[v]===void 0&&(u[v]=y[v]);return{$$typeof:t,type:d,key:w,ref:n,props:u,_owner:l.current}}return tt.Fragment=o,tt.jsx=x,tt.jsxs=x,tt}var rt={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,21 +14,21 @@
|
|
|
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 mt;function sr(){return mt||(mt=1,process.env.NODE_ENV!=="production"&&function(){var j=h,t=Symbol.for("react.element"),
|
|
18
|
-
`+ge+r}}var
|
|
19
|
-
`),
|
|
20
|
-
`),X=
|
|
21
|
-
`+
|
|
17
|
+
*/var mt;function sr(){return mt||(mt=1,process.env.NODE_ENV!=="production"&&function(){var j=h,t=Symbol.for("react.element"),o=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),x=Symbol.for("react.provider"),d=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),a=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),n=Symbol.for("react.offscreen"),m=Symbol.iterator,p="@@iterator";function b(r){if(r===null||typeof r!="object")return null;var g=m&&r[m]||r[p];return typeof g=="function"?g:null}var s=j.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function C(r){{for(var g=arguments.length,S=new Array(g>1?g-1:0),z=1;z<g;z++)S[z-1]=arguments[z];R("error",r,S)}}function R(r,g,S){{var z=s.ReactDebugCurrentFrame,V=z.getStackAddendum();V!==""&&(g+="%s",S=S.concat([V]));var W=S.map(function(F){return String(F)});W.unshift("Warning: "+g),Function.prototype.apply.call(console[r],console,W)}}var I=!1,L=!1,D=!1,E=!1,T=!1,H;H=Symbol.for("react.module.reference");function Y(r){return!!(typeof r=="string"||typeof r=="function"||r===i||r===f||T||r===l||r===a||r===v||E||r===n||I||L||D||typeof r=="object"&&r!==null&&(r.$$typeof===w||r.$$typeof===u||r.$$typeof===x||r.$$typeof===d||r.$$typeof===y||r.$$typeof===H||r.getModuleId!==void 0))}function J(r,g,S){var z=r.displayName;if(z)return z;var V=g.displayName||g.name||"";return V!==""?S+"("+V+")":S}function ie(r){return r.displayName||"Context"}function re(r){if(r==null)return null;if(typeof r.tag=="number"&&C("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case i:return"Fragment";case o:return"Portal";case f:return"Profiler";case l:return"StrictMode";case a:return"Suspense";case v:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case d:var g=r;return ie(g)+".Consumer";case x:var S=r;return ie(S._context)+".Provider";case y:return J(r,r.render,"ForwardRef");case u:var z=r.displayName||null;return z!==null?z:re(r.type)||"Memo";case w:{var V=r,W=V._payload,F=V._init;try{return re(F(W))}catch{return null}}}return null}var se=Object.assign,he=0,Te,we,qe,Me,q,Pe,Fe;function He(){}He.__reactDisabledLog=!0;function ze(){{if(he===0){Te=console.log,we=console.info,qe=console.warn,Me=console.error,q=console.group,Pe=console.groupCollapsed,Fe=console.groupEnd;var r={configurable:!0,enumerable:!0,value:He,writable:!0};Object.defineProperties(console,{info:r,log:r,warn:r,error:r,group:r,groupCollapsed:r,groupEnd:r})}he++}}function Ve(){{if(he--,he===0){var r={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:se({},r,{value:Te}),info:se({},r,{value:we}),warn:se({},r,{value:qe}),error:se({},r,{value:Me}),group:se({},r,{value:q}),groupCollapsed:se({},r,{value:Pe}),groupEnd:se({},r,{value:Fe})})}he<0&&C("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Ce=s.ReactCurrentDispatcher,ge;function $(r,g,S){{if(ge===void 0)try{throw Error()}catch(V){var z=V.stack.trim().match(/\n( *(at )?)/);ge=z&&z[1]||""}return`
|
|
18
|
+
`+ge+r}}var Le=!1,Oe;{var Q=typeof WeakMap=="function"?WeakMap:Map;Oe=new Q}function Ue(r,g){if(!r||Le)return"";{var S=Oe.get(r);if(S!==void 0)return S}var z;Le=!0;var V=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var W;W=Ce.current,Ce.current=null,ze();try{if(g){var F=function(){throw Error()};if(Object.defineProperty(F.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(F,[])}catch(ce){z=ce}Reflect.construct(r,[],F)}else{try{F.call()}catch(ce){z=ce}r.call(F.prototype)}}else{try{throw Error()}catch(ce){z=ce}r()}}catch(ce){if(ce&&z&&typeof ce.stack=="string"){for(var P=ce.stack.split(`
|
|
19
|
+
`),oe=z.stack.split(`
|
|
20
|
+
`),X=P.length-1,ee=oe.length-1;X>=1&&ee>=0&&P[X]!==oe[ee];)ee--;for(;X>=1&&ee>=0;X--,ee--)if(P[X]!==oe[ee]){if(X!==1||ee!==1)do if(X--,ee--,ee<0||P[X]!==oe[ee]){var de=`
|
|
21
|
+
`+P[X].replace(" at new "," at ");return r.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",r.displayName)),typeof r=="function"&&Oe.set(r,de),de}while(X>=1&&ee>=0);break}}}finally{Le=!1,Ce.current=W,Ve(),Error.prepareStackTrace=V}var Je=r?r.displayName||r.name:"",Be=Je?$(Je):"";return typeof r=="function"&&Oe.set(r,Be),Be}function le(r,g,S){return Ue(r,!1)}function pe(r){var g=r.prototype;return!!(g&&g.isReactComponent)}function Se(r,g,S){if(r==null)return"";if(typeof r=="function")return Ue(r,pe(r));if(typeof r=="string")return $(r);switch(r){case a:return $("Suspense");case v:return $("SuspenseList")}if(typeof r=="object")switch(r.$$typeof){case y:return le(r.render);case u:return Se(r.type,g,S);case w:{var z=r,V=z._payload,W=z._init;try{return Se(W(V),g,S)}catch{}}}return""}var me=Object.prototype.hasOwnProperty,We={},ke=s.ReactDebugCurrentFrame;function Ae(r){if(r){var g=r._owner,S=Se(r.type,r._source,g?g.type:null);ke.setExtraStackFrame(S)}else ke.setExtraStackFrame(null)}function $e(r,g,S,z,V){{var W=Function.call.bind(me);for(var F in r)if(W(r,F)){var P=void 0;try{if(typeof r[F]!="function"){var oe=Error((z||"React class")+": "+S+" type `"+F+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof r[F]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw oe.name="Invariant Violation",oe}P=r[F](g,F,z,S,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(X){P=X}P&&!(P instanceof Error)&&(Ae(V),C("%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).",z||"React class",S,F,typeof P),Ae(null)),P instanceof Error&&!(P.message in We)&&(We[P.message]=!0,Ae(V),C("Failed %s type: %s",S,P.message),Ae(null))}}}var Qe=Array.isArray;function Re(r){return Qe(r)}function Ze(r){{var g=typeof Symbol=="function"&&Symbol.toStringTag,S=g&&r[Symbol.toStringTag]||r.constructor.name||"Object";return S}}function et(r){try{return Ie(r),!1}catch{return!0}}function Ie(r){return""+r}function k(r){if(et(r))return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ze(r)),Ie(r)}var O=s.ReactCurrentOwner,G={key:!0,ref:!0,__self:!0,__source:!0},B,Z;function ue(r){if(me.call(r,"ref")){var g=Object.getOwnPropertyDescriptor(r,"ref").get;if(g&&g.isReactWarning)return!1}return r.ref!==void 0}function ve(r){if(me.call(r,"key")){var g=Object.getOwnPropertyDescriptor(r,"key").get;if(g&&g.isReactWarning)return!1}return r.key!==void 0}function te(r,g){typeof r.ref=="string"&&O.current}function Ge(r,g){{var S=function(){B||(B=!0,C("%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(r,"key",{get:S,configurable:!0})}}function _e(r,g){{var S=function(){Z||(Z=!0,C("%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(r,"ref",{get:S,configurable:!0})}}var je=function(r,g,S,z,V,W,F){var P={$$typeof:t,type:r,key:g,ref:S,props:F,_owner:W};return P._store={},Object.defineProperty(P._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(P,"_self",{configurable:!1,enumerable:!1,writable:!1,value:z}),Object.defineProperty(P,"_source",{configurable:!1,enumerable:!1,writable:!1,value:V}),Object.freeze&&(Object.freeze(P.props),Object.freeze(P)),P};function c(r,g,S,z,V){{var W,F={},P=null,oe=null;S!==void 0&&(k(S),P=""+S),ve(g)&&(k(g.key),P=""+g.key),ue(g)&&(oe=g.ref,te(g,V));for(W in g)me.call(g,W)&&!G.hasOwnProperty(W)&&(F[W]=g[W]);if(r&&r.defaultProps){var X=r.defaultProps;for(W in X)F[W]===void 0&&(F[W]=X[W])}if(P||oe){var ee=typeof r=="function"?r.displayName||r.name||"Unknown":r;P&&Ge(F,ee),oe&&_e(F,ee)}return je(r,P,oe,V,z,O.current,F)}}var A=s.ReactCurrentOwner,M=s.ReactDebugCurrentFrame;function N(r){if(r){var g=r._owner,S=Se(r.type,r._source,g?g.type:null);M.setExtraStackFrame(S)}else M.setExtraStackFrame(null)}var ae;ae=!1;function be(r){return typeof r=="object"&&r!==null&&r.$$typeof===t}function U(){{if(A.current){var r=re(A.current.type);if(r)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+r+"`."}return""}}function
|
|
23
|
+
Check the render method of \``+r+"`."}return""}}function K(r){return""}var dt={};function Bt(r){{var g=U();if(!g){var S=typeof r=="string"?r:r.displayName||r.name;S&&(g=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+S+">.")}return g}}function ht(r,g){{if(!r._store||r._store.validated||r.key!=null)return;r._store.validated=!0;var S=Bt(g);if(dt[S])return;dt[S]=!0;var z="";r&&r._owner&&r._owner!==A.current&&(z=" It was passed a child from "+re(r._owner.type)+"."),N(r),C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',S,z),N(null)}}function pt(r,g){{if(typeof r!="object")return;if(
|
|
25
|
+
Check the top-level render call using <`+S+">.")}return g}}function ht(r,g){{if(!r._store||r._store.validated||r.key!=null)return;r._store.validated=!0;var S=Bt(g);if(dt[S])return;dt[S]=!0;var z="";r&&r._owner&&r._owner!==A.current&&(z=" It was passed a child from "+re(r._owner.type)+"."),N(r),C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',S,z),N(null)}}function pt(r,g){{if(typeof r!="object")return;if(Re(r))for(var S=0;S<r.length;S++){var z=r[S];be(z)&&ht(z,g)}else if(be(r))r._store&&(r._store.validated=!0);else if(r){var V=b(r);if(typeof V=="function"&&V!==r.entries)for(var W=V.call(r),F;!(F=W.next()).done;)be(F.value)&&ht(F.value,g)}}}function Dt(r){{var g=r.type;if(g==null||typeof g=="string")return;var S;if(typeof g=="function")S=g.propTypes;else if(typeof g=="object"&&(g.$$typeof===y||g.$$typeof===u))S=g.propTypes;else return;if(S){var z=re(g);$e(S,r.props,"prop",z,r)}else if(g.PropTypes!==void 0&&!ae){ae=!0;var V=re(g);C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",V||"Unknown")}typeof g.getDefaultProps=="function"&&!g.getDefaultProps.isReactClassApproved&&C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Pt(r){{for(var g=Object.keys(r.props),S=0;S<g.length;S++){var z=g[S];if(z!=="children"&&z!=="key"){N(r),C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",z),N(null);break}}r.ref!==null&&(N(r),C("Invalid attribute `ref` supplied to `React.Fragment`."),N(null))}}var ut={};function ft(r,g,S,z,V,W){{var F=Y(r);if(!F){var P="";(r===void 0||typeof r=="object"&&r!==null&&Object.keys(r).length===0)&&(P+=" 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 oe=K();oe?P+=oe:P+=U();var X;r===null?X="null":Re(r)?X="array":r!==void 0&&r.$$typeof===t?(X="<"+(re(r.type)||"Unknown")+" />",P=" Did you accidentally export a JSX literal instead of a component?"):X=typeof r,C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",X,P)}var ee=c(r,g,S,V,W);if(ee==null)return ee;if(F){var de=g.children;if(de!==void 0)if(z)if(Re(de)){for(var Je=0;Je<de.length;Je++)pt(de[Je],r);Object.freeze&&Object.freeze(de)}else C("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 pt(de,r)}if(me.call(g,"key")){var Be=re(r),ce=Object.keys(g).filter(function($t){return $t!=="key"}),at=ce.length>0?"{key: someKey, "+ce.join(": ..., ")+": ...}":"{key: someKey}";if(!ut[Be+at]){var Wt=ce.length>0?"{"+ce.join(": ..., ")+": ...}":"{}";C(`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} />`,at,_e,Wt,_e),ut[_e+at]=!0}}return r===o?Ft(Z):Dt(Z),Z}}function Pt(r,g,S){return ft(r,g,S,!0)}function Ht(r,g,S){return ft(r,g,S,!1)}var Vt=Ht,Ut=Pt;rt.Fragment=o,rt.jsx=Vt,rt.jsxs=Ut}()),rt}var vt;function nr(){return vt||(vt=1,process.env.NODE_ENV==="production"?st.exports=rr():st.exports=sr()),st.exports}var e=nr();const ir={primaryColor:"#f88300",primaryColorLight:"#6858c1",secondaryColor:"#005a53",tertiaryColor:"#FFFFFF"},or="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",cr="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",ar="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",lr="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",dr="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",hr="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",pr="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",ur="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",jt="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",bt="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",lt="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",yt="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",fr="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",xr="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",gr="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",mr="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",wt="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",Ct="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",St="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",kt="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",Nt="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",vr="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",Ot="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",At="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",It="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",Et="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",jr="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",br="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",yr="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",wr="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",Cr="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",Sr="M0 224h192V32H0v192zM64 96h64v64H64V96zm192-64v192h192V32H256zm128 128h-64V96h64v64zM0 480h192V288H0v192zm64-128h64v64H64v-64zm352-64h32v128h-96v-32h-32v96h-64V288h96v32h64v-32zm0 160h32v32h-32v-32zm-64 0h32v32h-32v-32z",kr="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",Nr="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",zt="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",Or="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",Ar="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",Ir="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",Er="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",Tr="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",Mr="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",zr="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",Lr="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",Rr="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",_r="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",Lt="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",Br="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",Dr="apcDB",ke="APCObjectStore",Fr=1;function nt(){return new Promise((j,t)=>{const i=indexedDB.open(Dr,Fr);i.onupgradeneeded=function(o){let l=o.target.result,f;l.objectStoreNames.contains(ke)?f=i.transaction.objectStore(ke):f=l.createObjectStore(ke,{keyPath:"id"}),f.indexNames.contains("nameIndex")||f.createIndex("nameIndex","name",{unique:!1})},i.onsuccess=function(o){j(o.target.result)},i.onerror=function(o){t("Database error: "+o.target.errorCode)}})}function Be(j,t,i,o){return nt().then(l=>new Promise((f,x)=>{const d=l.transaction(["APCObjectStore"],"readwrite"),y=d.objectStore("APCObjectStore"),a={id:j,classification:t,content:i,misc:o},v=y.put(a);v.onsuccess=()=>f(v.result),v.onerror=()=>x(v.error),d.oncomplete=()=>l.close()}))}function Ye(j){return nt().then(t=>new Promise((i,o)=>{const l=t.transaction([ke],"readonly"),x=l.objectStore(ke).get(j);x.onsuccess=()=>i(x.result),x.onerror=()=>o(x.error),l.oncomplete=()=>t.close()}))}function Pr(j){return nt().then(t=>new Promise((i,o)=>{const l=t.transaction([ke],"readwrite"),x=l.objectStore(ke).delete(j);x.onsuccess=()=>i(),x.onerror=()=>o(x.error),l.oncomplete=()=>t.close()}))}function Ie(j=null){return nt().then(t=>new Promise((i,o)=>{const l=t.transaction([ke],"readonly"),x=l.objectStore(ke).openCursor(),d=[];x.onsuccess=y=>{const a=y.target.result;a?((!j||j(a.value))&&d.push(a.value),a.continue()):i(d)},x.onerror=y=>{o("Failed to retrieve items: "+y.target.errorCode)},l.oncomplete=()=>{t.close()}}))}function Hr(j){const{currentTabNo:t,theme:i,apcCanvasInstance:o,apiEndpoint:l,reloadTabs:f,updateActiveSection:x,initCategory:d,initInstance:y,apiKey:a,setActiveTab:v}=j,[u,w]=h.useState(),[n,m]=h.useState(d||"Hats"),[p,b]=h.useState(!1),[s,C]=h.useState(),R=`${l}/api/v1/designer`;h.useEffect(()=>{I()},[]),h.useEffect(()=>{o&&y&&y.fabricID&&L(y.fabricID)},[y]);const I=()=>{b(!0);const E=`${R}/search-designs-images/${n}`;be.get(E).then(T=>{b(!1),T.data.object.length>0?w(T.data):C("No matching results found")}).catch(T=>{b(!1),console.error("Error fetching data:",T)})},L=E=>{const T=R+"/find-public-design/"+E;be.get(T).then(H=>{const{object:Y}=H==null?void 0:H.data;Y&&(window.location.href=`/design-center/${Y.pdid}`)}).catch(H=>{console.error("Error fetching data:",H)})},D=()=>u?u.object.map((E,T)=>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(E.fabricID),children:[e.jsxs("div",{style:{position:"absolute",top:0,right:0,backgroundColor:i.secondaryColor,padding:"5px",zIndex:1,color:"#ffffff"},children:["$",E.product.price]}),e.jsx("img",{src:E.imageURL,alt:E.description,className:"apc-mpx-widget-responsive-image"}),e.jsx("div",{children:E.product.name})]})},T)):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:E=>m(E.target.value),className:"apc-mpc-widget-input",style:{border:`solid 3px ${i.primaryColor}`,height:"40px"}})}),e.jsx("div",{children:e.jsx("button",{className:"apc-mpc-widget-btn",onClick:()=>I(),style:{backgroundColor:i.primaryColor,color:"#ffffff",height:"35px"},children:p?"...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",{}),D()]})}const Vr={fontFamily:"Arial",fontSize:"40px",color:"transparent",background:"linear-gradient(to bottom, red 0%, yellow 100%)",WebkitBackgroundClip:"text",backgroundClip:"text",cursor:"pointer"},Ur={fontFamily:"comic sans ms",fontSize:"40px",color:"#000",width:"300px",textShadow:`
|
|
30
|
+
<%s key={someKey} {...props} />`,at,Be,Wt,Be),ut[Be+at]=!0}}return r===i?Pt(ee):Dt(ee),ee}}function Ft(r,g,S){return ft(r,g,S,!0)}function Ht(r,g,S){return ft(r,g,S,!1)}var Vt=Ht,Ut=Ft;rt.Fragment=i,rt.jsx=Vt,rt.jsxs=Ut}()),rt}var vt;function nr(){return vt||(vt=1,process.env.NODE_ENV==="production"?st.exports=rr():st.exports=sr()),st.exports}var e=nr();const or={primaryColor:"#f88300",primaryColorLight:"#6858c1",secondaryColor:"#005a53",tertiaryColor:"#FFFFFF"},ir="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",cr="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",ar="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",lr="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",dr="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",hr="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",pr="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",ur="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",jt="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",bt="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",lt="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",yt="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",fr="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",xr="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",gr="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",mr="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",wt="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",Ct="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",St="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",kt="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",Nt="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",vr="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",Ot="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",At="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",It="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",Et="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",jr="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",br="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",yr="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",wr="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",Cr="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",Sr="M0 224h192V32H0v192zM64 96h64v64H64V96zm192-64v192h192V32H256zm128 128h-64V96h64v64zM0 480h192V288H0v192zm64-128h64v64H64v-64zm352-64h32v128h-96v-32h-32v96h-64V288h96v32h64v-32zm0 160h32v32h-32v-32zm-64 0h32v32h-32v-32z",kr="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",Nr="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",zt="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",Or="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",Ar="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",Ir="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",Er="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",Tr="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",Mr="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",zr="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",Lr="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",Rr="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",_r="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",Lt="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",Br="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",Dr="apcDB",Ne="APCObjectStore",Pr=1;function nt(){return new Promise((j,t)=>{const o=indexedDB.open(Dr,Pr);o.onupgradeneeded=function(i){let l=i.target.result,f;l.objectStoreNames.contains(Ne)?f=o.transaction.objectStore(Ne):f=l.createObjectStore(Ne,{keyPath:"id"}),f.indexNames.contains("nameIndex")||f.createIndex("nameIndex","name",{unique:!1})},o.onsuccess=function(i){j(i.target.result)},o.onerror=function(i){t("Database error: "+i.target.errorCode)}})}function De(j,t,o,i){return nt().then(l=>new Promise((f,x)=>{const d=l.transaction(["APCObjectStore"],"readwrite"),y=d.objectStore("APCObjectStore"),a={id:j,classification:t,content:o,misc:i},v=y.put(a);v.onsuccess=()=>f(v.result),v.onerror=()=>x(v.error),d.oncomplete=()=>l.close()}))}function Ke(j){return nt().then(t=>new Promise((o,i)=>{const l=t.transaction([Ne],"readonly"),x=l.objectStore(Ne).get(j);x.onsuccess=()=>o(x.result),x.onerror=()=>i(x.error),l.oncomplete=()=>t.close()}))}function Fr(j){return nt().then(t=>new Promise((o,i)=>{const l=t.transaction([Ne],"readwrite"),x=l.objectStore(Ne).delete(j);x.onsuccess=()=>o(),x.onerror=()=>i(x.error),l.oncomplete=()=>t.close()}))}function Ee(j=null){return nt().then(t=>new Promise((o,i)=>{const l=t.transaction([Ne],"readonly"),x=l.objectStore(Ne).openCursor(),d=[];x.onsuccess=y=>{const a=y.target.result;a?((!j||j(a.value))&&d.push(a.value),a.continue()):o(d)},x.onerror=y=>{i("Failed to retrieve items: "+y.target.errorCode)},l.oncomplete=()=>{t.close()}}))}function Hr(j){const{currentTabNo:t,theme:o,apcCanvasInstance:i,apiEndpoint:l,reloadTabs:f,updateActiveSection:x,initCategory:d,initInstance:y,apiKey:a,setActiveTab:v}=j,[u,w]=h.useState(),[n,m]=h.useState(d||"Hats"),[p,b]=h.useState(!1),[s,C]=h.useState(),R=`${l}/api/v1/designer`;h.useEffect(()=>{I()},[]),h.useEffect(()=>{i&&y&&y.fabricID&&L(y.fabricID)},[y]);const I=()=>{b(!0);const E=`${R}/search-designs-images/${n}`;ye.get(E).then(T=>{b(!1),T.data.object.length>0?w(T.data):C("No matching results found")}).catch(T=>{b(!1),console.error("Error fetching data:",T)})},L=E=>{const T=R+"/find-public-design/"+E;ye.get(T).then(H=>{const{object:Y}=H==null?void 0:H.data;Y&&(window.location.href=`/design-center/${Y.pdid}`)}).catch(H=>{console.error("Error fetching data:",H)})},D=()=>u?u.object.map((E,T)=>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(E.fabricID),children:[e.jsxs("div",{style:{position:"absolute",top:0,right:0,backgroundColor:o.secondaryColor,padding:"5px",zIndex:1,color:"#ffffff"},children:["$",E.product.price]}),e.jsx("img",{src:E.imageURL,alt:E.description,className:"apc-mpx-widget-responsive-image"}),e.jsx("div",{children:E.product.name})]})},T)):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:E=>m(E.target.value),className:"apc-mpc-widget-input",style:{border:`solid 3px ${o.primaryColor}`,height:"40px"}})}),e.jsx("div",{children:e.jsx("button",{className:"apc-mpc-widget-btn",onClick:()=>I(),style:{backgroundColor:o.primaryColor,color:"#ffffff",height:"35px"},children:p?"...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",{}),D()]})}const Vr={fontFamily:"Arial",fontSize:"40px",color:"transparent",background:"linear-gradient(to bottom, red 0%, yellow 100%)",WebkitBackgroundClip:"text",backgroundClip:"text",cursor:"pointer"},Ur={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"},Wr={fontFamily:"Arial",fontSize:"40px",color:"#000",width:"300px",transform:"skewX(20deg) skewY(10deg)",textAlign:"center",cursor:"pointer"},Gr={fontFamily:"Arial",fontSize:"40px",color:"#000",textShadow:"0 0 10px green",textAlign:"center",cursor:"pointer"},$r={fontFamily:"Arial",fontSize:"40px",color:"#000",backgroundColor:"orange",borderRadius:"5px",cursor:"pointer"},Jr={color:"black",fontSize:"40px",opacity:"0.5",fontFamily:"Arial, sans-serif",cursor:"pointer"};function Yr(j){const{apcCanvasInstance:t,isMobile:i,closeMobileModalSecondaryPanel:o}=j,l=(n,m)=>{const p=new _.fabric.Textbox("Stay Humble!",{width:300,left:200,top:200,fontFamily:n,fill:m,hasControls:!0});t.add(p),t.setActiveObject(p),i&&o(!0)},f=({primaryTextLabel:n,primaryTextFontFamily:m,primaryTextColor:p,secondaryTextLabel:b,SecondaryTextFontFamily:s,secondaryTextColor:C})=>{const R=new _.fabric.Textbox(n,{fontFamily:m,width:300,left:200,top:200,fill:p}),I=new _.fabric.Textbox(b,{fontFamily:s,fill:C,fontSize:12,width:150});I.top=R.top+R.height+10,I.left=R.left,t.add(R),t.add(I),t.setActiveObject(R),i&&o(!0)},x=(n,m)=>{const p=new _.fabric.Textbox("Adventure Awaits!",{width:300,left:200,top:200,fontFamily:n,fill:m}),b={color:"rgba(0,0,0,0.5)",blur:10,offsetX:5,offsetY:5};p.shadow=b,t.add(p),t.setActiveObject(p),i&&o(!0)},d=()=>{const n=new _.fabric.Textbox("Love More",{left:100,top:100,width:300,fontFamily:"Arial",fill:new _.fabric.Gradient({type:"linear",gradientUnits:"pixels",coords:{x1:0,y1:0,x2:0,y2:50},colorStops:[{offset:0,color:"red"},{offset:1,color:"yellow"}]})});t.add(n),t.setActiveObject(n),i&&o(!0)},y=()=>{const n=new _.fabric.Textbox("Good Vibes Only",{left:150,top:150,fontFamily:"comic sans ms",fontSize:40,width:300,fill:"#000",stroke:"#ff0000",strokeWidth:2});t.add(n),t.setActiveObject(n),i&&o(!0)},a=()=>{const n=new _.fabric.Textbox("Dream Big",{left:300,top:300,width:300,fontFamily:"Arial",fill:"#000",skewX:20,skewY:10});t.add(n),t.setActiveObject(n),i&&o(!0)},v=()=>{const n=new _.fabric.Textbox("Choose Joy",{left:350,top:350,fontFamily:"Arial",fill:"#000",opacity:.5});t.add(n),t.setActiveObject(n),i&&o(!0)},u=()=>{const n=new _.fabric.Textbox("Find Your Fire",{left:550,top:550,fontFamily:"Arial",fill:"#000",shadow:"yellow 0 0 10px"});t.add(n),t.setActiveObject(n),i&&o(!0)},w=()=>{const n=new _.fabric.Textbox("Be Kind",{left:650,top:650,fontFamily:"Arial",fill:"#000",backgroundColor:"orange"});t.add(n),t.setActiveObject(n),i&&o(!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:()=>f({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:()=>f({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:()=>d(),style:Vr,children:"Love More"}),e.jsx("div",{onClick:()=>y(),style:Ur,children:"Good Vibes Only"}),e.jsx("div",{onClick:()=>a(),style:Wr,children:"Dream Big"}),e.jsx("div",{onClick:()=>u(),style:Gr,children:"Find Your Fire"}),e.jsx("div",{onClick:()=>w(),style:$r,children:"Be Kind"}),e.jsx("div",{onClick:()=>v(),style:Jr,children:"Choose Joy"})]})})}const Rt=async j=>{try{const i=await(await fetch(j)).blob();return new Promise((o,l)=>{const f=new FileReader;f.onloadend=()=>o(f.result),f.onerror=l,f.readAsDataURL(i)})}catch(t){throw console.error("Error converting image to base64:",t),t}};function Kr({apcCanvasInstance:j,theme:t}){const[i,o]=h.useState(!1),l=a=>{const v=a.target.files[0];if(v){const u=new FileReader;u.onload=w=>x(w.target.result),u.readAsDataURL(v)}},f=a=>{a.preventDefault(),o(!1);const v=a.dataTransfer.files[0];if(v){const u=new FileReader;u.onload=w=>x(w.target.result),u.readAsDataURL(v)}},x=a=>{_.fabric.Image.fromURL(a,v=>{v.set({left:100,top:100,scaleX:.5,scaleY:.5}),j.add(v)})},d=a=>{a.preventDefault(),o(!0)},y=()=>{o(!1)};return e.jsxs("div",{style:{border:i?"2px dashed #4CAF50":"2px dashed #ccc",padding:"40px",margin:"20px",borderRadius:"10px",textAlign:"center",backgroundColor:i?"#f0fff4":"#f9f9f9",transition:"background-color 0.3s",cursor:"pointer",position:"relative"},onDragOver:d,onDragLeave:y,onDrop:f,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:i?"#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:t.primaryColor},children:e.jsx("path",{d:Lt})}),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 it(j){const{featureText:t}=j;return e.jsxs("div",{style:{padding:"10px"},children:[t??"This is a premium feature. Get API key here"," ",e.jsx("a",{href:"https://mypixia.com/api-key",target:"_blank",children:"https://mypixia.com/api-key"}),e.jsx("br",{})]})}function ot(){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 Xr(j){const{apcCanvasInstance:t,theme:i,apiKey:o,apiEndpoint:l,isMobile:f,closeMobileModalSecondaryPanel:x}=j,[d,y]=h.useState("flowers"),[a,v]=h.useState(!1),[u,w]=h.useState(),[n,m]=h.useState(!1),[p,b]=h.useState(!1),s=sessionStorage.getItem("apc_x_sub_status"),C=`${l}/api/v1/designer`;h.useEffect(()=>{I()},[]),h.useEffect(()=>{(async()=>{s==="active"?(m(!0),b(!0)):(v(!0),await R())})()},[]);const R=()=>{v(!0);const T=`${C}/get-subscription-status/${o}`;be.get(T).then(H=>{H.data.object&&H.data.object==="active"&&(sessionStorage.setItem("apc_x_sub_status","active"),m(!0))}).catch(H=>{sessionStorage.setItem("apc_x_sub_status","")}).finally(()=>{v(!1),b(!0)})},I=()=>{v(!0);const T={"X-Api-Key":o},H=`${C}/get-images/${d}`;be.get(H,{headers:T}).then(Y=>{var J;v(!1),w((J=Y.data)==null?void 0:J.object)}).catch(Y=>{console.error("Error fetching data:",Y),v(!1)})},L=async T=>{const H=await Rt(T);H&&_.fabric.Image.fromURL(H,Y=>{Y.set({left:0,top:0,scaleX:.3,scaleY:.3}),t.add(Y)}),f&&x(!0)},D=()=>u?e.jsx("div",{children:u.map(T=>e.jsx("div",{onClick:()=>L(T.urls.regular),style:{cursor:"pointer"},children:e.jsx("img",{height:300,width:300,src:T.urls.regular,alt:T.description||"No description"})},T.id))}):null,E=()=>!n&&!a&&p?e.jsx(it,{featureText:"Get premium AI images with subscription at "}):n&&!a&&p?e.jsxs("div",{children:[e.jsx("strong",{children:"- OR -"}),e.jsxs("div",{children:[e.jsx("input",{type:"text",onChange:T=>y(T.target.value),className:"apc-mpc-widget-input",style:{border:`solid 3px ${i.primaryColor}`}}),e.jsx("br",{})," ",e.jsx("br",{}),e.jsx("button",{className:"apc-mpc-widget-btn",onClick:()=>I(),style:{backgroundColor:i.primaryColor,color:"#ffffff"},children:a?"...Processing":"Search"})]}),e.jsx("br",{}),e.jsx("br",{}),D()]}):e.jsx(ot,{});return e.jsxs(h.Fragment,{children:[e.jsx("br",{}),e.jsx("br",{}),e.jsx(Kr,{apcCanvasInstance:t,theme:i}),e.jsx("br",{}),e.jsx("br",{}),E()]})}function Tt(j){const{apcCanvasInstance:t,theme:i,isMobile:o,closeMobileModalSecondaryPanel:l}=j,f=b=>{const s=new _.fabric.Rect({width:100,height:60,left:200,top:200,fill:"",stroke:i.primaryColor});t.add(s),t.setActiveObject(s),o&&l(!0)},x=b=>{const s=new _.fabric.Circle({radius:30,fill:"",stroke:i.primaryColor,left:200,top:200});t.add(s),t.setActiveObject(s),o&&l(!0)},d=b=>{const s=new _.fabric.Triangle({width:40,height:50,fill:"",stroke:i.primaryColor,left:200,top:200});t.add(s),t.setActiveObject(s),o&&l(!0)},y=b=>{const s=new _.fabric.Line([50,10,250,10],{fill:"",stroke:i.primaryColor,left:200,top:200});t.add(s),t.setActiveObject(s),o&&l(!0)},a=(b,s,C)=>{const R=s,I=s,L=Math.PI/b;let D=[],E=0;for(let T=0;T<b;T++){let H=R+Math.cos(E)*s,Y=I+Math.sin(E)*s;D.push({x:H,y:Y}),E+=L,H=R+Math.cos(E)*C,Y=I+Math.sin(E)*C,D.push({x:H,y:Y}),E+=L}return D},v=(b,s)=>{const C=Math.PI*2/b,R=s,I=s,L=[];for(let D=0;D<b;D++){const E=R+s*Math.cos(D*C),T=I+s*Math.sin(D*C);L.push({x:E,y:T})}return L},u=b=>{const s=a(5,60,30),C=new _.fabric.Polygon(s,{left:200,top:200,fill:"",stroke:i.primaryColor,strokeWidth:2,strokeLineJoin:"bevil"},!1);t.add(C),t.setActiveObject(C),o&&l(!0)},w=b=>{const s=v(6,30),C=new _.fabric.Polygon(s,{left:200,top:200,fill:"",stroke:i.primaryColor,strokeWidth:2,strokeLineJoin:"bevil"},!1);t.add(C),t.setActiveObject(C),o&&l(!0)},n=b=>{const s=new _.fabric.Path(jt,{fill:"",stroke:i.primaryColor,left:200,top:200});t.add(s),t.setActiveObject(s),o&&l(!0)},m=b=>{const s=new _.fabric.Path(bt,{fill:"",stroke:i.primaryColor,left:200,top:200});t.add(s),t.setActiveObject(s),o&&l(!0)},p=b=>{const s=new _.fabric.Path(lt,{fill:"",stroke:i.primaryColor,left:200,top:200});t.add(s),t.setActiveObject(s),o&&l(!0)};return t?e.jsxs(h.Fragment,{children:[e.jsx("br",{}),e.jsx("div",{onClick:b=>f(),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:i.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:i.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=>d(),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:i.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:i.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:i.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=>y(),style:{fontSize:"50px",cursor:"pointer"},children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",strokeWidth:"4",stroke:i.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:i.primaryColor},width:"290.658",height:"1.711"})})})})}),e.jsx("div",{onClick:b=>n(),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:i.primaryColor,children:e.jsx("path",{d:jt})})}),e.jsx("div",{onClick:b=>m(),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:i.primaryColor,children:e.jsx("path",{d:bt})})}),e.jsx("div",{onClick:b=>p(),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:i.primaryColor,children:e.jsx("path",{d:lt})})})]}):null}function qr(j){const{apcCanvasInstance:t,theme:i,isMobile:o,closeMobileModalSecondaryPanel:l}=j,f=d=>{const y=new _.fabric.Path(d,{left:200,top:200,fill:i.primaryColor,scaleX:.1,scaleY:.1});t.add(y),t.setActiveObject(y),o&&l(!0)},x=d=>{switch(d){case"icon-phone":f(cr);break;case"icon-question":f(or);break;case"icon-clock":f(ar);break;case"icon-twitter":f(lr);break;case"icon-check":f(dr);break;case"icon-pointer":f(hr);break;case"icon-mail":f(pr);break;case"icon-dollar":f(ur);break;case"icon-graduation":f(yt);break;case"icon-business-suit":f(fr);break;case"icon-chat":f(xr);break;case"icon-thumbs-up":f(gr);break;case"icon-wifi":f(mr);break;case"icon-info":f(St);break;case"icon-cart":f(Ct);break;case"icon-comment":f(wt);break;case"icon-location-map":f(kt);break;case"icon-heart-1":f(Nt);break;case"icon-arrow-right-1":f(lt);break;case"icon-xmark":f(Ot);break;case"icon-cloud":f(At);break;case"icon-smile":f(It);break;case"icon-like":f(Et);break;default:console.log("no matching type")}};return e.jsx(h.Fragment,{children:e.jsxs("div",{style:{padding:"5px"},className:o?"apc-mpx-widget-secondary-icons-mobile":"apc-mpx-widget-secondary-icons",children:[e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>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:i.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:d=>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:i.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:d=>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:i.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:d=>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:i.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:d=>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:i.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:d=>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:i.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:d=>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:i.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:d=>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:i.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:d=>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:i.primaryColor,d:yt})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>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:i.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:d=>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:i.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:d=>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:i.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:d=>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:i.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:d=>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:i.primaryColor,d:St})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>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:i.primaryColor,d:Ct})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>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:i.primaryColor,d:wt})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>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:i.primaryColor,d:kt})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>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:i.primaryColor,d:Nt})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>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:i.primaryColor,d:vr})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>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:i.primaryColor,d:Ot})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>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:i.primaryColor,d:At})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>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:i.primaryColor,d:It})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>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:i.primaryColor,d:Et})})})]})})}const Ke=({defaultValue:j,size:t,ariaLabel:i,onChange:o})=>{const[l,f]=h.useState(j),x=d=>{const y=d.target.value;f(y),o(y)};return e.jsx("input",{type:"range",value:l,min:"0",max:"100",step:"1",className:`slider ${t}`,"aria-label":i,onChange:x})};function Mt(j){const{apcCanvasInstance:t,theme:i}=j,[o,l]=h.useState(!1),f=h.useRef(null),x=()=>{l(n=>!n)},d=n=>{f.current&&f.current.contains(n.target)||l(!1)};h.useEffect(()=>(document.addEventListener("mousedown",d),()=>{document.removeEventListener("mousedown",d)}),[]);const y=(n,m)=>{if(t.getActiveObject()){if(m==="family"&&t.getActiveObject().set({fontFamily:n}),m==="bold"&&t.getActiveObject().set({fontWeight:n}),m==="italic"&&t.getActiveObject().set({fontStyle:n}),m==="underline"&&t.getActiveObject().set({underline:n}),m==="line-through"&&t.getActiveObject().set({linethrough:n}),m==="overline"&&t.getActiveObject().set({overline:n}),m==="color"&&t.getActiveObject().set({fill:n}),m==="shadow"){const p=document.getElementById("apc-text-shadow-color").value;let b=document.getElementById("apc-text-shadow-horiz").value,s=document.getElementById("apc-text-shadow-vert").value,C=document.getElementById("apc-text-shadow-blur").value;b||(b=5),s||(s=5),C||(C=5),t.getActiveObject().set({shadow:p+" "+b+" "+s+" "+C})}if(m==="stroke"){const p=document.getElementById("apc-text-stroke-color").value;let b=document.getElementById("apc-text-stroke-width").value;b||(b=1),t.getActiveObject().set({stroke:p,strokeWidth:b})}m==="bg-color"&&t.getActiveObject().set({textBackgroundColor:n}),m==="font-size"&&t.getActiveObject().set({fontSize:n}),t&&t.renderAll()}},a=n=>{if(t.getActiveObject()){const m=parseFloat(n/100);t.getActiveObject().set({opacity:m.toFixed(1)}),t&&t.renderAll()}},v=({color:n,x:m,y:p,blur:b})=>{if(t.getActiveObject()){const s=t.getActiveObject().shadow;n||(n=s?s.color:"#6a45d2"),m||(m=s?s.offsetX:5),p||(p=s?s.offsetY:5),b||(b=s?s.blur:5),t.getActiveObject().set({shadow:n+" "+m+" "+p+" "+b}),t&&t.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:i.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:i.primaryColor,d:Mr})})}),o&&e.jsxs("div",{className:"apc-mpx-widget-popper-container",ref:f,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:n=>y(n.target.value,"bg-color")})]}),e.jsxs("div",{style:{marginLeft:"10px"},children:[" Opacity",e.jsx("div",{children:e.jsx(Ke,{defaultValue:100,size:"small","aria-label":"Opacity",onChange:n=>a(n)})})]})]})}),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:n=>v({blur:n.target.value})})]}),e.jsxs("div",{style:{marginLeft:"10px"},children:[" Color",e.jsx("input",{style:{height:"25px",width:"25px",border:"none"},type:"color",onChange:n=>v({color:n.target.value})})]}),e.jsxs("div",{style:{marginLeft:"10px"},children:[" Offset X",e.jsx("div",{children:e.jsx(Ke,{defaultValue:0,size:"small","aria-label":"Opacity",onChange:n=>v({x:n})})})]}),e.jsxs("div",{style:{marginLeft:"10px"},children:[" Offset Y",e.jsx("div",{children:e.jsx(Ke,{defaultValue:0,size:"small","aria-label":"Opacity",onChange:n=>v({y:n})})})]})]})})]})]})]});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:n=>y(n.target.value,"color")})})," ",e.jsx("div",{style:{marginTop:"4px"},children:e.jsxs("select",{style:{height:"20px",border:"solid 0px #ffffff"},id:"ffamily",onChange:n=>y(n.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:n=>y(n.target.value,"font-size")})}),e.jsx("div",{style:{marginTop:"4px",marginLeft:"2px",cursor:"pointer"},role:"button",onClick:n=>t.getActiveObject().fontWeight==="normal"?y("bold","bold"):y("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:n=>t.getActiveObject().fontStyle==="normal"?y("italic","italic"):y("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:n=>t.getActiveObject().underline?y(!1,"underline"):y(!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:n=>t.getActiveObject().linethrough?y(!1,"line-through"):y(!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 Je(j){const{apcCanvasInstance:t,theme:i}=j,o=h.useRef(null),[l,f]=h.useState(!1),x=()=>{f(u=>!u)},d=(u,w)=>{if(t&&t.getActiveObject()){if(u==="bg-color"&&t.getActiveObject().set({fill:w}),u==="border-color"&&t.getActiveObject().set({stroke:w}),u==="gradient-bg-color1"||u==="gradient-bg-color2"){let n=document.getElementById("apc-object-bg-gradient-color1").value,m=document.getElementById("apc-object-bg-gradient-color2").value;const p=new _.fabric.Gradient({type:"linear",gradientUnits:"pixels",coords:{x1:0,y1:0,x2:0,y2:t.getActiveObject().height},colorStops:[{offset:0,color:n||"#000"},{offset:1,color:m||"#fff"}]});t.getActiveObject().set({fill:p})}t&&t.renderAll()}},y=u=>{if(t.getActiveObject()){const w=parseFloat(u/100);t.getActiveObject().set({opacity:w.toFixed(1)}),t&&t.renderAll()}},a=({color:u,x:w,y:n,blur:m})=>{if(t.getActiveObject()){const p=t.getActiveObject().shadow;u||(u=p?p.color:"#6a45d2"),w||(w=p?p.offsetX:5),n||(n=p?p.offsetY:5),m||(m=p?p.blur:5),t.getActiveObject().set({shadow:u+" "+w+" "+n+" "+m}),t&&t.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:i.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:i.primaryColor,d:zr})})}),l&&e.jsxs("div",{className:"apc-mpx-widget-popper-container",ref:o,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=>d("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=>d("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=>d("gradient-bg-color2",u.target.value)})]}),e.jsx("div",{style:{marginLeft:"10px"},children:e.jsxs("div",{children:["Opacity: ",e.jsx(Ke,{defaultValue:100,size:"small","aria-label":"Opacity",onChange:u=>y(u)})]})}),e.jsxs("div",{style:{marginLeft:"10px"},children:[" Border color",e.jsx("input",{style:{height:"25px",width:"25px",border:"none"},type:"color",onChange:u=>d("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=>a({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=>a({color:u.target.value})})]}),e.jsx("div",{style:{marginLeft:"10px"},children:e.jsxs("div",{children:["Offset X: ",e.jsx(Ke,{defaultValue:0,size:"small","aria-label":"Opacity",onChange:u=>a({x:u})})]})}),e.jsx("div",{style:{marginLeft:"10px"},children:e.jsxs("div",{children:["Offset Y: ",e.jsx(Ke,{defaultValue:0,size:"small","aria-label":"Opacity",onChange:u=>a({y:u})})]})})]})})]})]})]})})}function Qr(j){const{apcCanvasInstance:t,apiEndpoint:i,apiKey:o}=j,[l,f]=h.useState("art"),[x,d]=h.useState(),[y,a]=h.useState(!1),v=i+"/api/v1/designer";h.useEffect(()=>{u()},[]);const u=()=>{a(!0);const p={"X-Api-Key":o},b=`${v}/get-quote/${l}`;be.get(b,{headers:p}).then(s=>{var C;a(!1),d((C=s.data)==null?void 0:C.object)}).catch(s=>{console.error("Error fetching data:",s),a(!1)})},w=(p,b,s)=>{const C=new _.fabric.Textbox(b,{width:500,left:100,top:200,fontSize:16}),R=new _.fabric.Textbox(s,{fontSize:14,width:200,fontWeight:"bold"});R.top=C.top+C.height+10,R.left=C.left,t.add(C),t.add(R),t.setActiveObject(C)},n=p=>{a(!0),f(p),u()},m=()=>x?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:5},children:x.map((p,b)=>e.jsxs("div",{onClick:s=>w(s,p.quote,p.author),style:{cursor:"pointer",padding:"3px",textAlign:"left",color:"#210080",fontFamily:"ui-monospace",border:"1px solid #dedcdc",borderRadius:"8px"},children:[e.jsx("div",{children:p.quote}),e.jsx("div",{children:e.jsx("strong",{children:e.jsx("i",{children:p.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:m()}),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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("birthday"),children:[l==="birthday"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Birthday"]}),e.jsx("br",{})]})]})}function Zr(j){const{apcCanvasInstance:t,theme:i,apiKey:o,apiEndpoint:l,updateActiveSection:f,reloadTabs:x,currentTabNo:d,isMobile:y,closeMobileModalSecondaryPanel:a}=j,[v,u]=h.useState("background"),[w,n]=h.useState(!1),[m,p]=h.useState(),b=l+"/api/v1/designer";h.useEffect(()=>{C()},[]);const s=L=>{const D=document.getElementById("img-default-id"),E=new _.fabric.Image(D,T=>{T.set({left:100,top:200,scaleX:.5,scaleY:.5,imageSmoothing:!0})});t.add(E),y&&a(!0)},C=()=>{n(!0);const L={"X-Api-Key":o},D=`${b}/get-images/${v}`;be.get(D,{headers:L}).then(E=>{var T;n(!1),p((T=E.data)==null?void 0:T.object)}).catch(E=>{console.error("Error fetching data:",E),n(!1)})},R=L=>{_.fabric.Image.fromURL(L,function(D){D.width=t.width,D.height=t.height,D.scaleToWidth(t.width),D.scaleToHeight(t.height),t.setBackgroundImage(D);const E=localStorage.getItem("apc_x_activeTab"),T=JSON.stringify(t);Be(E,"general",T,null).then(H=>{x(d+1),t&&t.renderAll()})},{crossOrigin:"anonymous"})},I=()=>m?e.jsx("div",{children:m.map(L=>e.jsx("div",{onClick:()=>R(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 ${i.primaryColor}`}}),e.jsx("br",{})," ",e.jsx("br",{}),e.jsx("button",{className:"apc-mpc-widget-btn",onClick:()=>C(),style:{backgroundColor:i.primaryColor,color:"#ffffff"},children:w?"...Processing":"Search"})]}),e.jsx("br",{}),e.jsx("br",{}),I()]})}function es(j){const[t,i]=h.useState(""),[o,l]=h.useState(""),[f,x]=h.useState(!1),[d,y]=h.useState(!1),[a,v]=h.useState(!1),{apcCanvasInstance:u,theme:w,isMobile:n,closeMobileModalSecondaryPanel:m,apiKey:p,apiEndpoint:b}=j,s=`${b}/api/v1/designer`,C=sessionStorage.getItem("apc_x_sub_status");h.useEffect(()=>{(async()=>{C==="active"?(y(!0),v(!0)):(x(!0),await R())})()},[]);const R=()=>{x(!0);const D=`${s}/get-subscription-status/${p}`;be.get(D).then(E=>{E.data.object&&E.data.object==="active"&&(sessionStorage.setItem("apc_x_sub_status","active"),y(!0))}).catch(E=>{sessionStorage.setItem("apc_x_sub_status","")}).finally(()=>{x(!1),v(!0)})},I=()=>{Zt.toDataURL(t,{width:300},(D,E)=>{D&&console.error(D),l(E)})},L=D=>{const E=document.getElementById("apc-qr-code-img"),T=new _.fabric.Image(E,H=>{H.set({left:200,top:200,scaleX:.5,scaleY:.5,imageSmoothing:!0})});u.add(T),u.setActiveObject(T),n&&m(!0)};return!d&&!f&&a?e.jsx(it,{}):d&&!f&&a?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:D=>i(D.target.value)}),e.jsx("br",{}),e.jsx("br",{}),e.jsx("button",{className:"apc-mpc-widget-btn",style:{backgroundColor:w.primaryColor,color:"#ffffff"},disabled:!t,onClick:I,children:"Generate QR code"}),e.jsx("br",{}),e.jsx("br",{}),o&&e.jsxs("div",{className:"generated-view",onClick:()=>L(),style:{cursor:"pointer"},children:[e.jsx("img",{src:o,alt:"qr code",id:"apc-qr-code-img"}),e.jsx("a",{href:o})]})]}):e.jsx("div",{children:e.jsx(ot,{})})}function ts(j){const{apcCanvasInstance:t,theme:i,isMobile:o,closeMobileModalSecondaryPanel:l,apiKey:f,apiEndpoint:x}=j,[d,y]=h.useState(""),[a,v]=h.useState(null),[u,w]=h.useState("CODE128"),n=h.useRef(null),[m,p]=h.useState(""),[b,s]=h.useState(!1),[C,R]=h.useState(!1),[I,L]=h.useState(!1),D=sessionStorage.getItem("apc_x_sub_status"),E=`${x}/api/v1/designer`;h.useEffect(()=>{(async()=>{D==="active"?(R(!0),L(!0)):(s(!0),await T())})()},[]);const T=()=>{s(!0);const J=`${E}/get-subscription-status/${f}`;be.get(J).then(oe=>{oe.data.object&&oe.data.object==="active"&&(sessionStorage.setItem("apc_x_sub_status","active"),R(!0))}).catch(oe=>{sessionStorage.setItem("apc_x_sub_status","")}).finally(()=>{s(!1),L(!0)})},H=()=>{v(e.jsx(er,{value:d,format:u,id:"barcode-element"}));const J=document.getElementById("barcode-element");J&&p(J.innerHTML)},Y=J=>{if(n.current.innerHTML){const oe=n.current.innerHTML;let re=new Image;re.src="data:image/svg+xml,"+encodeURIComponent(oe),re.onload=function(){const se=new _.fabric.Image(re,{left:200,top:200});t.add(se),t.setActiveObject(se)}}o&&l(!0)};return!C&&!b&&I?e.jsx(it,{}):C&&!b&&I?e.jsxs(h.Fragment,{children:[e.jsx("br",{}),e.jsx("br",{}),"Enter number",e.jsx("input",{type:"text",onChange:J=>y(J.target.value),className:"apc-mpc-widget-input",style:{border:`solid 3px ${i.primaryColor}`}}),e.jsx("br",{}),e.jsx("br",{}),"Code type",e.jsxs("select",{value:u,onChange:J=>w(J.target.value),className:"apc-mpc-widget-input",style:{border:`solid 3px ${i.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:!d,onClick:()=>H(),style:{backgroundColor:i.primaryColor,color:"#ffffff"},children:"Generate Barcode"}),e.jsx("br",{}),e.jsx("br",{})," ",e.jsx("br",{}),e.jsx("br",{}),e.jsx("div",{children:a&&e.jsx("div",{ref:n,onClick:J=>Y(),style:{cursor:"pointer"},children:a})})]}):e.jsxs("div",{children:[" ",e.jsx(ot,{})]})}function rs(j){const{apcCanvasInstance:t,theme:i}=j,[o,l]=h.useState(),[f,x]=h.useState(),[d,y]=h.useState(""),a=(w,n)=>{if(t){if(w==="bg-color"&&n.target.value&&t.set({backgroundColor:n.target.value}),w==="image"&&n.target.value){const m=n.target.files[0],p=new FileReader;p.onload=function(b){const s=b.target.result;_.fabric.Image.fromURL(s,function(C){t.setBackgroundImage(C,t.renderAll.bind(t),{})})},p.readAsDataURL(m)}w==="height"&&n.target.value&&(l(n.target.value),t.setHeight(n.target.value)),w==="width"&&n.target.value&&(x(n.target.value),t.setWidth(n.target.value)),t&&t.renderAll()}},v=(w,n,m)=>{x(n),l(w),t.setWidth(n),t.setHeight(w),y(m)},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:t.height,onChange:w=>a("height",w),className:"apc-mpc-widget-input",style:{border:`solid 3px ${i.primaryColor}`}})]})})," ",e.jsx("div",{style:{display:"flex",flexDirection:"row"},children:e.jsxs("div",{children:["Width(px)",e.jsx("input",{color:"info",type:"number",value:t.width,onChange:w=>a("width",w),className:"apc-mpc-widget-input",style:{border:`solid 3px ${i.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:[d==="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:[d==="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:[d==="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:[d==="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:[d==="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:[d==="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:[d==="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:[d==="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:[d==="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:[d==="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:[d==="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:[d==="BUSINESSCARD"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Business card 3.5 x 2 in"]})})]})]});return e.jsx("div",{children:u()})}const fe=(j,t,i,o="png",l)=>new Promise((f,x)=>{const d=document.createElement("canvas"),y=JSON.parse(j),a=crypto.randomUUID();d.width=i,d.height=t;const v=new _.fabric.StaticCanvas(d,{selection:!1,height:y.height,width:y.width});v.loadFromJSON(y,function(){v.renderAll();const u=(w,n)=>{const m=URL.createObjectURL(w),p=document.createElement("a");p.href=m,p.download=n,document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(m)};if(o.toLowerCase()==="svg"){const w=v.toSVG(),n=new Blob([w],{type:"image/svg+xml"});l&&u(n,"mypixia.svg"),f(new File([n],`${a}.svg`,{type:"image/svg+xml"}))}else if(o.toLowerCase()==="pdf"){const w=v.toDataURL("image/jpeg",1);import("jspdf").then(n=>{const m=new n.jsPDF({orientation:"landscape",unit:"px",format:[d.width,d.height]});m.addImage(w,"JPEG",0,0,d.width,d.height);const b=m.output("datauristring").split(",")[1],s=ss(b,"application/pdf"),C=new File([s],`${a}.pdf`,{type:"application/pdf"}),R=`${a}.pdf`;l&&u(C,R),f(C)}).catch(n=>{console.error("Error loading jsPDF: ",n),x(n)})}else{let w,n="image/png",m="png";switch(o.toLowerCase()){case"jpeg":w=v.toDataURL("image/jpeg",1),n="image/jpeg",m="jpg";break;case"webp":w=v.toDataURL("image/webp",1),n="image/webp",m="webp";break;default:w=v.toDataURL("image/png",1);break}const p=atob(w.split(",")[1]),b=new Array(p.length);for(let I=0;I<p.length;I++)b[I]=p.charCodeAt(I);const s=new Uint8Array(b),C=new File([s],`${a}.${m}`,{type:n}),R=`${a}.${m}`;l&&u(C,R),f(C)}})});function ss(j,t){const i=atob(j),o=new Array(i.length);for(let f=0;f<i.length;f++)o[f]=i.charCodeAt(f);const l=new Uint8Array(o);return new Blob([l],{type:t})}const ns=({children:j})=>tr.createPortal(j,document.getElementById("apc-mpx-editor-modal-root"));function ct(j){const{isOpen:t,onClose:i,children:o}=j;return t?e.jsx(ns,{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:i,children:"Close"}),e.jsx("div",{className:"apc-mpx-widget-modal-content",children:o})]})})}):null}const xe=(j,t)=>{j=j.startsWith("#")?j:`#${j}`;let i=parseInt(j.slice(1,3),16),o=parseInt(j.slice(3,5),16),l=parseInt(j.slice(5,7),16);return i=parseInt(i*(100-t)/100),o=parseInt(o*(100-t)/100),l=parseInt(l*(100-t)/100),i=i.toString(16).padStart(2,"0"),o=o.toString(16).padStart(2,"0"),l=l.toString(16).padStart(2,"0"),`#${i}${o}${l}`};function _t(j){const[t,i]=h.useState(""),{apcCanvasJSON:o,height:l,width:f}=j;return h.useEffect(()=>{const x=document.createElement("canvas"),d=JSON.parse(o);x.width=f,x.height=l;const y=new _.fabric.StaticCanvas(x,{selection:!1,height:d.height,width:d.width});y.loadFromJSON(d,function(){y.renderAll();const a=y.toDataURL("image/png",1);i(a)})},[]),t?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:t,alt:"mypixia cool design",className:"apc-mpx-widget-responsive-image"})})}):"...processing"}function is(j){const{theme:t,apcCanvasInstance:i}=j,[o,l]=h.useState(!1),[f,x]=h.useState(),d=()=>{l(!0)},y=()=>{l(!1)},a=()=>{if(!i)return null;const v=JSON.stringify(i);return e.jsxs(ct,{isOpen:o,onClose:y,children:[e.jsx(_t,{apcCanvasJSON:v,height:i.height,width:i.width}),e.jsx("div",{children:e.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:5},children:[e.jsx("div",{children:e.jsx(ne.FacebookShareButton,{url:f,children:e.jsx(ne.FacebookIcon,{size:32,round:!0})})}),e.jsx("div",{children:e.jsx(ne.TwitterShareButton,{url:f,title:"Hello",children:e.jsx(ne.XIcon,{size:32,round:!0})})}),e.jsx("div",{children:e.jsx(ne.TelegramShareButton,{url:f,title:"Hello",children:e.jsx(ne.TelegramIcon,{size:32,round:!0})})}),e.jsx("div",{children:e.jsx(ne.WhatsappShareButton,{url:f,title:"Hello",separator:":: ",children:e.jsx(ne.WhatsappIcon,{size:32,round:!0})})}),e.jsx("div",{children:e.jsx(ne.LinkedinShareButton,{url:f,children:e.jsx(ne.LinkedinIcon,{size:32,round:!0})})}),e.jsx("div",{children:e.jsx(ne.PinterestShareButton,{url:"https://static.mypixia.com",media:f,children:e.jsx(ne.PinterestIcon,{size:32,round:!0})})}),e.jsx("div",{children:e.jsx(ne.RedditShareButton,{url:f,title:"Hello",windowWidth:660,windowHeight:460,children:e.jsx(ne.RedditIcon,{size:32,round:!0})})}),e.jsx("div",{children:e.jsx(ne.InstapaperShareButton,{url:f,title:"Hello",children:e.jsx(ne.InstapaperIcon,{size:32,round:!0})})})]})}),e.jsx("hr",{}),e.jsx("br",{}),e.jsx("button",{autoFocus:!0,type:"button",className:"apc-mpc-widget-btn",onClick:()=>y(),style:{backgroundColor:"red",color:"#ffffff",float:"right"},children:"Close"})]})};return e.jsxs(h.Fragment,{children:[e.jsxs("button",{className:"apc-mpc-widget-btn",onClick:()=>d(),role:"dialog",style:{backgroundColor:xe(t.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:Er})})," Share"]}),a()]})}function os(j){const{theme:t,apiKey:i,apcCanvasInstance:o,updateSelectedSections:l,updateActiveSection:f,accesories:x,getDesignFormats:d}=j,[y,a]=h.useState(!1),[v,u]=h.useState(),w=()=>{a(!0)},n=()=>{a(!1)},m=()=>({getPDF:()=>{const b=JSON.stringify(o);return fe(b,o.height,o.width,"pdf",!0).then(s=>s)},getPNG:()=>{const b=JSON.stringify(o);return fe(b,o.height,o.width,"png",!0).then(s=>s)},getSVG:()=>{const b=JSON.stringify(o);return fe(b,o.height,o.width,"svg",!0).then(s=>s)},getJPEG:()=>{const b=JSON.stringify(o);return fe(b,o.height,o.width,"jpeg",!0).then(s=>s)},getWEBP:()=>{const b=JSON.stringify(o);return fe(b,o.height,o.width,"webp",!0).then(s=>s)}}),p=()=>{if(!o)return null;const b=JSON.stringify(o);return e.jsxs(ct,{isOpen:y,onClose:n,children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[e.jsx("h3",{style:{float:"left"},children:"Download"}),e.jsx("div",{children:e.jsx(_t,{apcCanvasJSON:b,height:o.height,width:o.width})}),e.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:5},children:[e.jsx("div",{style:{color:xe(t.primaryColor,50),fontWeight:"bold",textDecoration:"underline",cursor:"pointer"},onClick:()=>m().getPDF(),children:"PDF"}),e.jsx("div",{style:{color:xe(t.primaryColor,50),fontWeight:"bold",textDecoration:"underline",cursor:"pointer"},onClick:()=>m().getSVG(),children:"SVG"}),e.jsx("div",{style:{color:xe(t.primaryColor,50),fontWeight:"bold",textDecoration:"underline",cursor:"pointer"},onClick:()=>m().getPNG(),children:"PNG"}),e.jsx("div",{style:{color:xe(t.primaryColor,50),fontWeight:"bold",textDecoration:"underline",cursor:"pointer"},onClick:()=>m().getJPEG(),children:"JPEG"}),e.jsx("div",{style:{color:xe(t.primaryColor,50),fontWeight:"bold",textDecoration:"underline",cursor:"pointer"},onClick:()=>m().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:()=>n(),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:xe(t.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:Tr})})," Download"]}),p()]})}function cs(j){var Ae;const{theme:t,activeSection:i,selectedObjectType:o,renderQuickActions:l,renderActionItems:f,canvasEl:x,zoomIn:d,zoomOut:y,apcCanvasInstance:a,setActiveSection:v,saveActiveDesign:u,reloadTabs:w,initProductName:n,historyRef:m,currentState:p,setCurrentState:b,setHistory:s,activeTabName:C,isPlainColor:R,selectedProduct:I,isMobile:L,supportedProductColors:D}=j,[E,T]=h.useState(),[H,Y]=h.useState([]),[J,oe]=h.useState(0),[re,se]=h.useState(!1),he=h.useRef(null),[Ee,ye]=h.useState(!1),[Xe,Te]=h.useState(null),[ee,De]=h.useState(),[Fe,Pe]=h.useState(),[Me,He]=h.useState(),[we,ge]=h.useState(!0),[G,ze]=h.useState(),Ne=()=>{ye(!0),se(!1)},q=()=>{ye(!1)},Ve=()=>{se(k=>!k)};h.useEffect(()=>{const k=O=>{he.current&&he.current.contains(O.target)||se(!1)};return document.addEventListener("mousedown",k),()=>{document.removeEventListener("mousedown",k)}},[]),h.useEffect(()=>{(async()=>{var O,$;if(E)try{const B=await Ye(E);He(B),(O=B==null?void 0:B.misc)!=null&&O.colorSettings&&De(B.misc.colorSettings),(($=B==null?void 0:B.misc)==null?void 0:$.type)!=="subsection"&&ze(B)}catch(B){console.error("Error fetching tab data: ",B)}})()},[E,w]),h.useEffect(()=>{(async()=>{const O=await Ie();let $=O?O.filter(B=>{var Q;return B.classification!=="cart"&&((Q=B.misc)==null?void 0:Q.type)!=="subsection"}).map(B=>B.id):[];$.length===0&&$.push("design"),J===0&&T($[0]),Y($)})()},[J,w]);const le=()=>{a&&(a.clear(),a.renderAll())},pe=k=>{if(!a)return;a.backgroundColor="transparent",a&&a.requestRenderAll();let O=a.backgroundImage;O&&(O.filters=[],O.filters.push(new _.fabric.Image.filters.BlendColor({color:k})),O.applyFilters(),a&&a.requestRenderAll(),Pe(k),u(a,Me))},Ce=()=>{if(!(!ee||(ee==null?void 0:ee.length)<=1))return ee.map((k,O)=>e.jsxs(h.Fragment,{children:[e.jsx("div",{role:"button",className:"apc-mpx-widget-circle",style:{backgroundColor:k,cursor:"pointer",border:"solid 1px #ffffff"},onClick:()=>pe(k)})," "]},O))},me=async(k,O)=>{var ue,ve;const $=(ve=(ue=a==null?void 0:a.backgroundImage)==null?void 0:ue.filters[0])==null?void 0:ve.color,B=await Ye(k);if(!B)return;const Q=B!=null&&B.content?JSON.parse(B.content):null;Q&&a?(a.clear(),a.setBackgroundImage(null),a.loadFromJSON(Q,()=>{var te;a.renderAll(),v(B),((te=B==null?void 0:B.misc)==null?void 0:te.type)!=="subsection"?(localStorage.setItem("apc_x_activeTab",k),ge(!0)):(ge(!1),$&&pe($)),T(k)})):console.error("Failed to load JSON content for section:",k)},Ue=()=>H.map(k=>e.jsx("button",{className:`tablinks ${E===k?"active":null}`,onClick:()=>me(k),children:k},k)),Se=()=>{Ie().then(k=>{if(k&&k.length>0){const O=k[0],$=JSON.parse(O.content);a.loadFromJSON($,function(){a.off("object:modified"),a.on({"object:modified":B=>{u(a,O)}}),T(O.id),localStorage.setItem("apc_x_activeTab",O.id),v(O),oe(J+1),a&&a.renderAll()})}else{let O="design";const $=JSON.stringify(a);Be(O,"general",$,null).then(B=>{Ye(O).then(Q=>{const ue=JSON.parse(Q.content);a.loadFromJSON(ue,function(){a.off("object:modified"),a.on({"object:modified":ve=>{u(a,Q)}}),T(O),localStorage.setItem("apc_x_activeTab",O),v(Q),oe(J+1),a&&a.renderAll()})})})}})},Oe=()=>{Pr(E).then(k=>{q(),Se()})},We=()=>a?e.jsxs(ct,{isOpen:Ee,onClose:q,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:()=>Oe(),style:{backgroundColor:"green",color:"#ffffff"},children:"Yes"})}),e.jsx("div",{children:e.jsx("button",{autoFocus:!0,type:"button",className:"apc-mpc-widget-btn",onClick:()=>q(),style:{backgroundColor:"red",color:"#ffffff",float:"right"},children:"Close"})})]})]}):null,qe=()=>e.jsxs("div",{className:"apc-mpx-widget-button-group-container",children:[e.jsx("div",{className:"apc-mpx-widget-generic-icon",onClick:Ve,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:Or})})}),re&&e.jsxs("div",{className:"apc-mpx-widget-popper-container",ref:he,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(t.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:zt,fill:xe(t.primaryColor,80)})})," Delete"]}),e.jsxs("li",{className:"apc-mpx-widget-popper-li",style:{height:"25px",cursor:"pointer",marginBlockStart:"5px"},onClick:()=>le(),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:Ar,fill:xe(t.primaryColor,80)})})," Clear"]})]})]})]}),Le=k=>{var ve,te,Ge,Re;const O=a.width*5,$=a.height*5,B=JSON.parse(G.content),Q=(te=(ve=B==null?void 0:B.backgroundImage)==null?void 0:ve.filters[0])==null?void 0:te.color,ue=(Re=(Ge=a==null?void 0:a.backgroundImage)==null?void 0:Ge.filters[0])==null?void 0:Re.color;Ye(k.sectionName).then(async je=>{if(je){const c=je!=null&&je.content?JSON.parse(je.content):null;c&&a?(await a.loadFromJSON(c,()=>{a.renderAll(),v(je),T(k.sectionName);const A=JSON.stringify(a),M={};M.id=k.sectionName,M.classification=I==null?void 0:I.name,M.json=A,M.misc={sectionName:k.sectionName,sectionImage:k.sectionImage,type:k.type},a.off("object:modified"),a.on({"object:modified":N=>{u(a,M)}})}),pe(ue),we||ge(!0)):console.error("Failed to load JSON content for section:",k.sectionName)}else a&&a.clear(),k.type="subsection",_.fabric.Image.fromURL(k.sectionImage,function(c){c.width=O,c.height=$,c.scaleToWidth(O),c.scaleToHeight($),a.setBackgroundImage(c),(Fe||Q)&&(c.filters=[],c.filters.push(new _.fabric.Image.filters.BlendColor({color:Fe||Q})),c.applyFilters());const A=JSON.stringify(a),M={};M.id=k.sectionName,M.classification=G.id,M.json=A,M.misc={sectionName:k.sectionName,sectionImage:k.sectionImage,type:k.type},a.off("object:modified"),a.on({"object:modified":N=>{u(a,M)}}),Be(k.sectionName,E,A,{...k}).then(N=>{a&&(a.renderAll(),we&&ge(!1),T(k.sectionName),oe(J+1))})},{crossOrigin:"anonymous"})})},Qe=()=>{if(!Me)return null;let k=[];if(I){const O=I.sections.map($=>({...$,type:"subsection"}));k.push(...O),k.push({sectionName:I==null?void 0:I.name,sectionImage:I==null?void 0:I.mainImage,type:"main"})}return k=k==null?void 0:k.map(O=>({...O,active:O.sectionName===E})),(k==null?void 0:k.length)<1?null:k==null?void 0:k.map((O,$)=>{var B,Q;return e.jsxs("div",{onClick:()=>Le(O),style:{position:"relative",backgroundColor:"#ff000026",border:"solid 1px #ffffff",padding:"2px",borderRadius:"6px",cursor:"pointer",textAlign:"center"},children:[O.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:O==null?void 0:O.sectionImage,width:50,height:50,alt:(O==null?void 0:O.sectionName)||"section image",style:{borderRadius:"6px"}})}),e.jsx("div",{style:{fontSize:"12px",color:"#333"},children:((B=O==null?void 0:O.sectionName)==null?void 0:B.length)>5?`${(Q=O==null?void 0:O.sectionName)==null?void 0:Q.substring(0,5)}...`:(O==null?void 0:O.sectionName)||"view"})]},$)})},Ze=()=>{if(m.current.length>0){const k=m.current.pop();a.loadFromJSON(k,()=>{a.renderAll(),b(k)})}};return e.jsxs(h.Fragment,{children:[e.jsx("div",{className:"tab",children:Ue()}),e.jsxs("div",{style:{display:"flex",backgroundColor:t.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:()=>Ze(),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:Ir,fill:"#ffffff"})})})," "]})})}),e.jsx("div",{style:{flexBasis:"20%"},children:o?l():null}),e.jsx("div",{style:{flexBasis:"40%",marginTop:"8px"},children:o?f():null}),qe()]}),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:((Ae=I==null?void 0:I.sections)==null?void 0:Ae.length)>0?Qe():null})}),e.jsx("div",{children:e.jsx("canvas",{id:"apc-mpx-editor-canvas",ref:x,height:1e3})}),ee&&(R||(i==null?void 0:i.plainColor)==="Y")&&we&&(ee==null?void 0:ee.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:ee&&(ee==null?void 0:ee.length)>1?Ce():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:()=>d(),children:"+"}),e.jsx("button",{style:{height:"35px",width:"65px",cursor:"pointer"},"aria-label":"zoom out",onClick:()=>y(),children:"-"})]})]}),We()]})}function as({data:j,theme:t,apcCanvasInstance:i,closeMobileModalSecondaryPanel:o,isMobile:l}){const[f,x]=h.useState({}),d=u=>{x(w=>({...w,[u]:!w[u]}))},y=async u=>{const w=await Rt(u);w&&_.fabric.Image.fromURL(w,n=>{n.set({left:100,top:100,scaleX:.3,scaleY:.3}),i.add(n),i.renderAll(),l&&o(!0)})},a=(u,w="",n=0)=>e.jsx("ul",{style:{listStyleType:"none",paddingLeft:`${n*20}px`,margin:"0"},children:Object.keys(u).map(m=>{const p=`${w}/${m}`,b=f[p];return u[m].type==="image"?e.jsx("li",{children:e.jsx("div",{onClick:()=>y(u[m].url),style:{cursor:"pointer"},children:e.jsx("img",{src:u[m].url,alt:m,style:{width:"100px",height:"auto"}})})},p):e.jsxs("li",{children:[e.jsxs("div",{onClick:()=>d(p),style:{cursor:"pointer",display:"flex",alignItems:"center",fontWeight:"bold",color:t.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:Rr,fill:t.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:_r,fill:t.primaryColorLight})})}),m]}),b&&a(u[m],p,n+1)]},p)})}),v=ls(j);return e.jsx("div",{children:a(v)})}function ls(j){const t={};return j.forEach(i=>{const o=i.name.split("/");let l=t;o.forEach((f,x)=>{l[f]||(l[f]=x===o.length-1?i:{}),l=l[f]})}),t}function ds(j){const{apcCanvasInstance:t,theme:i,apiEndpoint:o,isMobile:l,closeMobileModalSecondaryPanel:f,apiKey:x}=j,d=`${o}/api/v1/designer`,[y,a]=h.useState([]),[v,u]=h.useState(!1),[w,n]=h.useState(!1),[m,p]=h.useState(!1),b=sessionStorage.getItem("apc_x_sub_status"),s=sessionStorage.getItem("apc_x_stickers");h.useEffect(()=>{u(!0),(async()=>{b==="active"?n(!0):await R(),s?(a(JSON.parse(s)),u(!1)):await C()})()},[]);const C=()=>{u(!0);const I=`${d}/get-stickers`;be.get(I).then(L=>{L.data.object&&(a(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)})},R=()=>{u(!0);const I=`${d}/get-subscription-status/${x}`;be.get(I).then(L=>{L.data.object&&L.data.object==="active"&&(sessionStorage.setItem("apc_x_sub_status","active"),n(!0))}).catch(L=>{sessionStorage.setItem("apc_x_sub_status","")}).finally(()=>{u(!1),p(!0)})};return!w&&!v&&m?e.jsx(it,{}):w&&y.length>0&&!v?e.jsx(h.Fragment,{children:e.jsx("div",{style:{padding:"10px"},children:e.jsx(as,{data:y,theme:i,apcCanvasInstance:t,isMobile:l,closeMobileModalSecondaryPanel:f})})}):e.jsx("div",{children:e.jsx(ot,{})})}function hs(j){const{theme:t=ir,readOnly:i=!1,apiKey:o=null,handleSaveClick:l,handleCartClick:f,apiEndpoint:x,enabledModules:d=["TXT","STICKERS","SHAPES","ICONS","IMAGE","QUOTE","BACKGROUND","QRCODE","BARCODE"],actionButtons:y={share:!0,download:!0,submit:!0,addToCart:!0},initInstance:a=null,initCategory:v=null,additionalActionButton:u=null,initProductName:w,isPlainColor:n,product:m={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"}]}}=j,[p,b]=h.useState(d[0]),[s,C]=h.useState(),R=h.useRef(null),[I,L]=h.useState(),[D,E]=h.useState(!1),[T,H]=h.useState(1),Y=.1,[J,oe]=h.useState(1),[re,se]=h.useState([]),[he,Ee]=h.useState(null),[ye,Xe]=h.useState(null),[Te,ee]=h.useState(0),[De,Fe]=h.useState(),[Pe,Me]=h.useState(null),He=h.useRef([]),[we,ge]=h.useState(null),[G,ze]=h.useState(!1),[Ne,q]=h.useState(!1);h.useEffect(()=>{const c=()=>ze(window.innerWidth<600);return c(),window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[]),h.useEffect(()=>{const c=document.getElementById("apc-mpx-editor-canvas-container"),A=document.getElementById("apc-mpx-editor-canvas-container");if(!R.current||!c||!A){console.error("Canvas element is not mounted yet!");return}const M={isDrawingMode:!1,selection:!0,selectionBorderColor:"#008000",height:A.offsetHeight,width:c.offsetWidth,enableRetinaScaling:!0};let N,ae;if(i)N=new _.fabric.StaticCanvas(R.current,M);else if(N=new _.fabric.Canvas(R.current,M),ye)ae=JSON.parse(ye),N.loadFromJSON(ae,function(){});else if(a){let V;try{V=JSON.parse(a)}catch(K){console.error("Failed to parse initInstance",K)}N&&V?N.loadFromJSON(V,function(){}):console.error("Canvas or InitInstance is not properly initialized")}else{const V=new _.fabric.Textbox("Something cool!",{width:300,left:250,top:300,fontFamily:"aclonica",fill:"#6a45d2",rotate:20});V.shadow={color:"rgba(0,0,0,0.5)",blur:10,offsetX:5,offsetY:5},N.add(V),m!=null&&m.mainImage&&_.fabric.Image.fromURL(m.mainImage,function(K){K.height=A.offsetHeight,K.width=c.offsetWidth,K.scaleToWidth(A.offsetHeight),K.scaleToHeight(c.offsetWidth),N.setBackgroundImage(K),N.setActiveObject(V),pe(V),N.renderAll(),k(N)},{crossOrigin:"anonymous"})}return N.on({"selection:updated":V=>{const K=N.getActiveObject();pe(K)},"selection:created":V=>{const K=N.getActiveObject();pe(K)},"selection:cleared":V=>{Ce()},"object:modified":V=>{k(N),le(N)},"object:added":V=>{le(N)},"object:removed":V=>{le(N)},"object:created":V=>{le(N)}}),C(N),oe(c.offsetWidth),()=>{C(null),N.off({"selection:updated":V=>{const K=N.getActiveObject();pe(K)},"selection:created":V=>{const K=N.getActiveObject();pe(K)},"selection:cleared":V=>{Ce()},"object:modified":V=>{k(N),le(N)},"object:added":V=>{le(N)},"object:removed":V=>{le(N)},"object:created":V=>{le(N)}}),N.dispose()}},[ye]),h.useEffect(()=>(Ve(),document.addEventListener("keydown",c=>Ae(c)),()=>{document.removeEventListener("keydown",c=>Ae(c))}),[s]),h.useEffect(()=>{if(s){const c=document.getElementById("apc-mpx-editor-canvas-container"),A=()=>{const M=c.offsetWidth/J;s.setZoom(M)};return window.addEventListener("resize",A),()=>{window.removeEventListener("resize",A)}}},[s,T]),h.useEffect(()=>{const c=()=>{if(s&&R.current){const A=s.getWidth(),M=s.getHeight(),N=window.innerWidth,ae=window.innerHeight,V=N/A,K=ae/M,et=Math.min(V,K);s.setZoom(et/1.4),s.renderAll()}};return G&&(c(),window.addEventListener("resize",c)),()=>window.removeEventListener("resize",c)},[s,G]);const Ve=()=>{Ie().then(c=>{if(c&&c.length>0){const A=c[0].content;w===c[0].id&&Xe(A)}})},le=c=>{if(c){const A=c.toJSON();Me(M=>(He.current.push(M),A))}},pe=c=>{L(c.type)},Ce=()=>{L(null)},me=()=>{s.getActiveObject()&&s.remove(s.getActiveObject())},Ue=()=>{const c=s.getActiveObject(),A=_.fabric.util.object.clone(c);A.set({left:c.left+20,top:c.top+20}),s.add(A)},Se=c=>{Ee(c)},Oe=c=>{let A=re;A.push(c),se(A)},We=c=>{c==="lock"?s.getActiveObject().set({lockMovementX:!0,lockMovementY:!0}):s.getActiveObject().set({lockMovementX:!1,lockMovementY:!1})},qe=()=>{s&&(s.getActiveObject().bringForward(),s.renderAll())},Le=()=>{s&&(s.getActiveObject().sendBackwards(),s.renderAll())},Qe=()=>{const c=T+Y;H(c),s.setZoom(c)},Ze=()=>{const c=Math.max(T-Y,Y);H(c),s.setZoom(c)},Ae=c=>{s&&s.getActiveObject()&&s.getActiveObject().type!=="textbox"&&c.keyCode===8&&me()},k=c=>{const A=localStorage.getItem("apc_x_activeTab");if(A)Ye(A).then(M=>{if(M){const N=JSON.stringify(c);Be(M.id,M.classification,N,M.misc).then(ae=>{})}else{const N=JSON.stringify(c);Be(m.name??"design","general",N,m).then(ae=>{})}});else{const M=JSON.stringify(c);Be(m.name??"design","general",M,m).then(N=>{})}},O=(c,A)=>{const M=JSON.stringify(c);Be(A.id,A.classification,M,A.misc).then(N=>{})},$=()=>({getPDF:()=>Ie().then(c=>{let A=[];for(let M in c)fe(c[M].content,s.height,s.width,"pdf").then(N=>{A.push(N)});return A}),getPNG:()=>Ie().then(c=>{let A=[];for(let M in c)fe(c[M].content,s.height,s.width,"png").then(N=>{A.push(N)});return A}),getSVG:()=>Ie().then(c=>{let A=[];for(let M in c)fe(c[M].content,s.height,s.width,"svg").then(N=>{A.push(N)});return A}),getJPEG:()=>Ie().then(c=>{let A=[];for(let M in c)fe(c[M].content,s.height,s.width,"jpeg").then(N=>{A.push(N)});return A}),getWEBP:()=>Ie().then(c=>{let A=[];for(let M in c)fe(c[M].content,s.height,s.width,"webp").then(N=>{A.push(N)});return A}),getImageActiveTab:()=>{const c=localStorage.getItem("apc_x_activeTab");return Ye(c).then(A=>fe(A.content,s.height,s.width,"png").then(M=>{let N={};return N.file=M,N.height=s.height,N.width=s.width,N}))}}),B=()=>e.jsxs("div",{style:{marginTop:"6px",fontWeight:"bold"},children:["Replace Image: ",e.jsx("input",{type:"file",accept:"image/*",onChange:c=>Q(c)}),e.jsx("br",{})]}),Q=(c,A)=>{{const M=s.getActiveObject(),N=c.target.files[0],ae=new FileReader;ae.onload=function(V){const K=V.target.result;M.setSrc(K,function(et){et.set({angle:30}),s&&s.renderAll()})},ae.readAsDataURL(N)}s&&s.renderAll()},ue=()=>{switch(p){case"ICONS":return e.jsx(qr,{apcCanvasInstance:s,theme:t,apiKey:o,isMobile:G,closeMobileModalSecondaryPanel:c=>q(!c)});case"TEMPLATES":return e.jsx(Hr,{apcCanvasInstance:s,theme:t,apiKey:o,apiEndpoint:x,reloadTabs:c=>ee(c),updateActiveSection:c=>Se(c),initCategory:v,currentTabNo:Te,initInstance:a,setActiveTab:c=>ge(c),isMobile:G,closeMobileModalSecondaryPanel:c=>q(!c)});case"TXT":return e.jsx(Yr,{apcCanvasInstance:s,theme:t,apiKey:o,isMobile:G,closeMobileModalSecondaryPanel:c=>q(!c)});case"IMAGE":return e.jsx(Xr,{apcCanvasInstance:s,theme:t,apiKey:o,apiEndpoint:x,isMobile:G,closeMobileModalSecondaryPanel:c=>q(!c)});case"STICKERS":return e.jsx(ds,{apcCanvasInstance:s,theme:t,apiEndpoint:x,isMobile:G,apiKey:o,closeMobileModalSecondaryPanel:c=>q(!c)});case"SHAPES":return e.jsx(Tt,{apcCanvasInstance:s,theme:t,apiKey:o,isMobile:G,closeMobileModalSecondaryPanel:c=>q(!c)});case"QUOTE":return e.jsx(Qr,{apcCanvasInstance:s,theme:t,apiKey:o,apiEndpoint:x,isMobile:G,closeMobileModalSecondaryPanel:c=>q(!c)});case"BACKGROUND":return e.jsx(Zr,{apcCanvasInstance:s,theme:t,apiKey:o,apiEndpoint:x,updateActiveSection:c=>Se(c),reloadTabs:c=>ee(c),currentTabNo:Te,isMobile:G,closeMobileModalSecondaryPanel:c=>q(!c)});case"QRCODE":return e.jsx(es,{apcCanvasInstance:s,theme:t,apiKey:o,apiEndpoint:x,isMobile:G,closeMobileModalSecondaryPanel:c=>q(!c)});case"BARCODE":return e.jsx(ts,{apcCanvasInstance:s,theme:t,apiKey:o,apiEndpoint:x,isMobile:G,closeMobileModalSecondaryPanel:c=>q(!c)});case"SIZE":return e.jsx(rs,{apcCanvasInstance:s,theme:t,apiKey:o,isMobile:G,closeMobileModalSecondaryPanel:c=>q(!c)});default:return e.jsx(Tt,{apcCanvasInstance:s,theme:t,apiKey:o,isMobile:G,closeMobileModalSecondaryPanel:c=>q(!c)})}},ve=()=>{if(!I)return null;switch(I){case"text":return e.jsx(Mt,{apcCanvasInstance:s,theme:t,apiKey:o});case"textbox":return e.jsx(Mt,{apcCanvasInstance:s,theme:t,apiKey:o});case"rect":return e.jsx(Je,{apcCanvasInstance:s,theme:t,apiKey:o});case"circle":return e.jsx(Je,{apcCanvasInstance:s,theme:t,apiKey:o});case"triangle":return e.jsx(Je,{apcCanvasInstance:s,theme:t,apiKey:o});case"line":return e.jsx(Je,{apcCanvasInstance:s,theme:t,apiKey:o});case"path":return e.jsx(Je,{apcCanvasInstance:s,theme:t,apiKey:o});case"polygon":return e.jsx(Je,{apcCanvasInstance:s,theme:t,apiKey:o});case"image":return B();default:return null}},te=c=>{b(c),G&&q(!0)},Ge=()=>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:()=>me(),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:zt,fill:"#d8d4d4"})}),e.jsx("div",{className:"apc-mpx-tooltip-text",children:"Delete"})]}),e.jsxs("div",{className:"apc-mpx-tooltip-container",role:"button",onClick:()=>Le(),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:()=>We("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:()=>We("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:()=>Ue(),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"})]})]})}),Re=()=>s?e.jsx("div",{style:{height:"10vh",overflow:"auto"},children:e.jsx(ct,{isOpen:Ne,onClose:()=>q(!1),children:ue()})}):null,je=()=>s?G?Re():ue():null;return e.jsxs("div",{className:"apc-mpc-widget-wrapper",children:[e.jsxs("div",{style:{display:"flex",backgroundColor:xe(t.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:Br})})," 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&&y.share?e.jsx("div",{children:e.jsx(is,{apcCanvasInstance:s,theme:t})}):null}),e.jsx("div",{children:s&&y.download?e.jsx("div",{children:e.jsx(os,{apcCanvasInstance:s,theme:t,apiKey:o,updateSelectedSections:c=>Oe(c),updateActiveSection:c=>Se(c),accesories,getDesignFormats:$()})}):null}),e.jsx("div",{children:s&&u?e.jsx("div",{children:e.jsx("button",{className:"apc-mpc-widget-btn",onClick:()=>l($()),style:{backgroundColor:u.btnColor??t.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:[d.indexOf("TXT")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("TXT"),style:{padding:"10px",backgroundColor:p==="TXT"?t.primaryColorLight:"inherit",color:p==="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:p==="TXT"?"#ffffff":t.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:yr})}),e.jsx("div",{children:"Text"})]}):null,d.indexOf("STICKERS")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("STICKERS"),style:{padding:"10px",backgroundColor:p==="STICKERS"?t.primaryColorLight:"inherit",color:p==="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:p==="STICKERS"?"#ffffff":t.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:Lr})}),e.jsx("div",{children:"Stickers"})]}):null,d.indexOf("SHAPES")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("SHAPES"),style:{padding:"10px",backgroundColor:p==="SHAPES"?t.primaryColorLight:"inherit",color:p==="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:p==="SHAPES"?"#ffffff":t.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:jr})}),e.jsx("div",{children:"Shapes"})]}):null,d.indexOf("ICONS")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("ICONS"),style:{padding:"10px",backgroundColor:p==="ICONS"?t.primaryColorLight:"inherit",color:p==="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:p==="ICONS"?"#ffffff":t.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:br})}),e.jsx("div",{children:"Icons"})]}):null,d.indexOf("IMAGE")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("IMAGE"),style:{padding:"10px",backgroundColor:p==="IMAGE"?t.primaryColorLight:"inherit",color:p==="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:p==="IMAGE"?"#ffffff":t.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:Lt})}),e.jsx("div",{children:"Upload"})]}):null,d.indexOf("QUOTE")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("QUOTE"),style:{padding:"10px",backgroundColor:p==="QUOTE"?t.primaryColorLight:"inherit",color:p==="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:p==="QUOTE"?"#ffffff":t.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:wr})}),e.jsx("div",{children:"Quote"})]}):null,d.indexOf("BACKGROUND")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("BACKGROUND"),style:{padding:"10px",backgroundColor:p==="BACKGROUND"?t.primaryColorLight:"inherit",color:p==="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:p==="BACKGROUND"?"#ffffff":t.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:Cr})}),e.jsx("div",{children:"Background"})]}):null,d.indexOf("QRCODE")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("QRCODE"),style:{padding:"10px",backgroundColor:p==="QRCODE"?t.primaryColorLight:"inherit",color:p==="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:p==="QRCODE"?"#ffffff":t.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:Sr})}),e.jsx("div",{children:"QR Code"})]}):null,d.indexOf("BARCODE")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("BARCODE"),style:{padding:"10px",backgroundColor:p==="BARCODE"?t.primaryColorLight:"inherit",color:p==="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:p==="BARCODE"?"#ffffff":t.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:kr})}),e.jsx("div",{children:"Barcode"})]}):null,d.indexOf("SIZE")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("SIZE"),style:{padding:"10px",backgroundColor:p==="SIZE"?t.primaryColorLight:"inherit",color:p==="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:p==="SIZE"?"#ffffff":t.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:Nr})}),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(cs,{theme:t,activeSection:he,selectedObjectType:I,renderQuickActions:Ge,renderActionItems:ve,canvasEl:R,zoomIn:()=>Qe(),zoomOut:()=>Ze(),apcCanvasInstance:s,setActiveSection:c=>Ee(c),updateActiveDesignSection:c=>Se(c),saveActiveDesign:(c,A)=>O(c,A),reloadTabs:Te,activeTabName:we,supportedColors:De,initProductName:w,historyRef:He,currentState:Pe,setCurrentState:c=>Me(c),isPlainColor:n,selectedProduct:m,isMobile:G})})]}),e.jsx("div",{id:"apc-mpx-editor-modal-root"}),G?Re():null]})}module.exports=hs;
|
|
34
|
+
1px 1px 0 #ff0000`,cursor:"pointer"},Wr={fontFamily:"Arial",fontSize:"40px",color:"#000",width:"300px",transform:"skewX(20deg) skewY(10deg)",textAlign:"center",cursor:"pointer"},$r={fontFamily:"Arial",fontSize:"40px",color:"#000",textShadow:"0 0 10px green",textAlign:"center",cursor:"pointer"},Gr={fontFamily:"Arial",fontSize:"40px",color:"#000",backgroundColor:"orange",borderRadius:"5px",cursor:"pointer"},Jr={color:"black",fontSize:"40px",opacity:"0.5",fontFamily:"Arial, sans-serif",cursor:"pointer"};function Yr(j){const{apcCanvasInstance:t,isMobile:o,closeMobileModalSecondaryPanel:i}=j,l=(n,m)=>{const p=new _.fabric.Textbox("Stay Humble!",{width:300,left:200,top:200,fontFamily:n,fill:m,hasControls:!0});t.add(p),t.setActiveObject(p),o&&i(!0)},f=({primaryTextLabel:n,primaryTextFontFamily:m,primaryTextColor:p,secondaryTextLabel:b,SecondaryTextFontFamily:s,secondaryTextColor:C})=>{const R=new _.fabric.Textbox(n,{fontFamily:m,width:300,left:200,top:200,fill:p}),I=new _.fabric.Textbox(b,{fontFamily:s,fill:C,fontSize:12,width:150});I.top=R.top+R.height+10,I.left=R.left,t.add(R),t.add(I),t.setActiveObject(R),o&&i(!0)},x=(n,m)=>{const p=new _.fabric.Textbox("Adventure Awaits!",{width:300,left:200,top:200,fontFamily:n,fill:m}),b={color:"rgba(0,0,0,0.5)",blur:10,offsetX:5,offsetY:5};p.shadow=b,t.add(p),t.setActiveObject(p),o&&i(!0)},d=()=>{const n=new _.fabric.Textbox("Love More",{left:100,top:100,width:300,fontFamily:"Arial",fill:new _.fabric.Gradient({type:"linear",gradientUnits:"pixels",coords:{x1:0,y1:0,x2:0,y2:50},colorStops:[{offset:0,color:"red"},{offset:1,color:"yellow"}]})});t.add(n),t.setActiveObject(n),o&&i(!0)},y=()=>{const n=new _.fabric.Textbox("Good Vibes Only",{left:150,top:150,fontFamily:"comic sans ms",fontSize:40,width:300,fill:"#000",stroke:"#ff0000",strokeWidth:2});t.add(n),t.setActiveObject(n),o&&i(!0)},a=()=>{const n=new _.fabric.Textbox("Dream Big",{left:300,top:300,width:300,fontFamily:"Arial",fill:"#000",skewX:20,skewY:10});t.add(n),t.setActiveObject(n),o&&i(!0)},v=()=>{const n=new _.fabric.Textbox("Choose Joy",{left:350,top:350,fontFamily:"Arial",fill:"#000",opacity:.5});t.add(n),t.setActiveObject(n),o&&i(!0)},u=()=>{const n=new _.fabric.Textbox("Find Your Fire",{left:550,top:550,fontFamily:"Arial",fill:"#000",shadow:"yellow 0 0 10px"});t.add(n),t.setActiveObject(n),o&&i(!0)},w=()=>{const n=new _.fabric.Textbox("Be Kind",{left:650,top:650,fontFamily:"Arial",fill:"#000",backgroundColor:"orange"});t.add(n),t.setActiveObject(n),o&&i(!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:()=>f({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:()=>f({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:()=>d(),style:Vr,children:"Love More"}),e.jsx("div",{onClick:()=>y(),style:Ur,children:"Good Vibes Only"}),e.jsx("div",{onClick:()=>a(),style:Wr,children:"Dream Big"}),e.jsx("div",{onClick:()=>u(),style:$r,children:"Find Your Fire"}),e.jsx("div",{onClick:()=>w(),style:Gr,children:"Be Kind"}),e.jsx("div",{onClick:()=>v(),style:Jr,children:"Choose Joy"})]})})}const Rt=async j=>{try{const o=await(await fetch(j)).blob();return new Promise((i,l)=>{const f=new FileReader;f.onloadend=()=>i(f.result),f.onerror=l,f.readAsDataURL(o)})}catch(t){throw console.error("Error converting image to base64:",t),t}};function Kr({apcCanvasInstance:j,theme:t}){const[o,i]=h.useState(!1),l=a=>{const v=a.target.files[0];if(v){const u=new FileReader;u.onload=w=>x(w.target.result),u.readAsDataURL(v)}},f=a=>{a.preventDefault(),i(!1);const v=a.dataTransfer.files[0];if(v){const u=new FileReader;u.onload=w=>x(w.target.result),u.readAsDataURL(v)}},x=a=>{_.fabric.Image.fromURL(a,v=>{v.set({left:100,top:100,scaleX:.5,scaleY:.5}),j.add(v)})},d=a=>{a.preventDefault(),i(!0)},y=()=>{i(!1)};return e.jsxs("div",{style:{border:o?"2px dashed #4CAF50":"2px dashed #ccc",padding:"40px",margin:"20px",borderRadius:"10px",textAlign:"center",backgroundColor:o?"#f0fff4":"#f9f9f9",transition:"background-color 0.3s",cursor:"pointer",position:"relative"},onDragOver:d,onDragLeave:y,onDrop:f,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:o?"#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:t.primaryColor},children:e.jsx("path",{d:Lt})}),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 ot(j){const{featureText:t,theme:o,featureName:i}=j;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:i??"Premium Feature Access"}),e.jsx("p",{style:{color:"#555",fontSize:"15px",lineHeight:"1.5",marginBottom:"20px"},children:t??"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:o.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 it(){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 Xr(j){const{apcCanvasInstance:t,theme:o,apiKey:i,apiEndpoint:l,isMobile:f,closeMobileModalSecondaryPanel:x}=j,[d,y]=h.useState("flowers"),[a,v]=h.useState(!1),[u,w]=h.useState(),[n,m]=h.useState(!1),[p,b]=h.useState(!1),s=sessionStorage.getItem("apc_x_sub_status"),C=`${l}/api/v1/designer`;h.useEffect(()=>{I()},[]),h.useEffect(()=>{(async()=>{s==="active"?(m(!0),b(!0)):(v(!0),await R())})()},[]);const R=()=>{v(!0);const T=`${C}/get-subscription-status/${i}`;ye.get(T).then(H=>{H.data.object&&H.data.object==="active"&&(sessionStorage.setItem("apc_x_sub_status","active"),m(!0))}).catch(H=>{sessionStorage.setItem("apc_x_sub_status","")}).finally(()=>{v(!1),b(!0)})},I=()=>{v(!0);const T={"X-Api-Key":i},H=`${C}/get-images/${d}`;ye.get(H,{headers:T}).then(Y=>{var J;v(!1),w((J=Y.data)==null?void 0:J.object)}).catch(Y=>{console.error("Error fetching data:",Y),v(!1)})},L=async T=>{const H=await Rt(T);H&&_.fabric.Image.fromURL(H,Y=>{Y.set({left:0,top:0,scaleX:.3,scaleY:.3}),t.add(Y)}),f&&x(!0)},D=()=>u?e.jsx("div",{children:u.map(T=>e.jsx("div",{onClick:()=>L(T.urls.regular),style:{cursor:"pointer"},children:e.jsx("img",{height:300,width:300,src:T.urls.regular,alt:T.description||"No description"})},T.id))}):null,E=()=>!n&&!a&&p?e.jsx(ot,{theme:o,isPartial:!0,featureName:"AI image generation or search"}):n&&!a&&p?e.jsxs("div",{children:[e.jsx("strong",{children:"- OR -"}),e.jsxs("div",{children:[e.jsx("input",{type:"text",onChange:T=>y(T.target.value),className:"apc-mpc-widget-input",style:{border:`solid 3px ${o.primaryColor}`}}),e.jsx("br",{})," ",e.jsx("br",{}),e.jsx("button",{className:"apc-mpc-widget-btn",onClick:()=>I(),style:{backgroundColor:o.primaryColor,color:"#ffffff"},children:a?"...Processing":"Search"})]}),e.jsx("br",{}),e.jsx("br",{}),D()]}):e.jsx(it,{});return e.jsxs(h.Fragment,{children:[e.jsx("br",{}),e.jsx("br",{}),e.jsx(Kr,{apcCanvasInstance:t,theme:o}),e.jsx("br",{}),e.jsx("br",{}),E()]})}function Tt(j){const{apcCanvasInstance:t,theme:o,isMobile:i,closeMobileModalSecondaryPanel:l}=j,f=b=>{const s=new _.fabric.Rect({width:100,height:60,left:200,top:200,fill:"",stroke:o.primaryColor});t.add(s),t.setActiveObject(s),i&&l(!0)},x=b=>{const s=new _.fabric.Circle({radius:30,fill:"",stroke:o.primaryColor,left:200,top:200});t.add(s),t.setActiveObject(s),i&&l(!0)},d=b=>{const s=new _.fabric.Triangle({width:40,height:50,fill:"",stroke:o.primaryColor,left:200,top:200});t.add(s),t.setActiveObject(s),i&&l(!0)},y=b=>{const s=new _.fabric.Line([50,10,250,10],{fill:"",stroke:o.primaryColor,left:200,top:200});t.add(s),t.setActiveObject(s),i&&l(!0)},a=(b,s,C)=>{const R=s,I=s,L=Math.PI/b;let D=[],E=0;for(let T=0;T<b;T++){let H=R+Math.cos(E)*s,Y=I+Math.sin(E)*s;D.push({x:H,y:Y}),E+=L,H=R+Math.cos(E)*C,Y=I+Math.sin(E)*C,D.push({x:H,y:Y}),E+=L}return D},v=(b,s)=>{const C=Math.PI*2/b,R=s,I=s,L=[];for(let D=0;D<b;D++){const E=R+s*Math.cos(D*C),T=I+s*Math.sin(D*C);L.push({x:E,y:T})}return L},u=b=>{const s=a(5,60,30),C=new _.fabric.Polygon(s,{left:200,top:200,fill:"",stroke:o.primaryColor,strokeWidth:2,strokeLineJoin:"bevil"},!1);t.add(C),t.setActiveObject(C),i&&l(!0)},w=b=>{const s=v(6,30),C=new _.fabric.Polygon(s,{left:200,top:200,fill:"",stroke:o.primaryColor,strokeWidth:2,strokeLineJoin:"bevil"},!1);t.add(C),t.setActiveObject(C),i&&l(!0)},n=b=>{const s=new _.fabric.Path(jt,{fill:"",stroke:o.primaryColor,left:200,top:200});t.add(s),t.setActiveObject(s),i&&l(!0)},m=b=>{const s=new _.fabric.Path(bt,{fill:"",stroke:o.primaryColor,left:200,top:200});t.add(s),t.setActiveObject(s),i&&l(!0)},p=b=>{const s=new _.fabric.Path(lt,{fill:"",stroke:o.primaryColor,left:200,top:200});t.add(s),t.setActiveObject(s),i&&l(!0)};return t?e.jsxs(h.Fragment,{children:[e.jsx("br",{}),e.jsx("div",{onClick:b=>f(),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:o.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:o.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=>d(),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:o.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:o.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:o.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=>y(),style:{fontSize:"50px",cursor:"pointer"},children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",strokeWidth:"4",stroke:o.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:o.primaryColor},width:"290.658",height:"1.711"})})})})}),e.jsx("div",{onClick:b=>n(),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:o.primaryColor,children:e.jsx("path",{d:jt})})}),e.jsx("div",{onClick:b=>m(),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:o.primaryColor,children:e.jsx("path",{d:bt})})}),e.jsx("div",{onClick:b=>p(),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:o.primaryColor,children:e.jsx("path",{d:lt})})})]}):null}function qr(j){const{apcCanvasInstance:t,theme:o,isMobile:i,closeMobileModalSecondaryPanel:l}=j,f=d=>{const y=new _.fabric.Path(d,{left:200,top:200,fill:o.primaryColor,scaleX:.1,scaleY:.1});t.add(y),t.setActiveObject(y),i&&l(!0)},x=d=>{switch(d){case"icon-phone":f(cr);break;case"icon-question":f(ir);break;case"icon-clock":f(ar);break;case"icon-twitter":f(lr);break;case"icon-check":f(dr);break;case"icon-pointer":f(hr);break;case"icon-mail":f(pr);break;case"icon-dollar":f(ur);break;case"icon-graduation":f(yt);break;case"icon-business-suit":f(fr);break;case"icon-chat":f(xr);break;case"icon-thumbs-up":f(gr);break;case"icon-wifi":f(mr);break;case"icon-info":f(St);break;case"icon-cart":f(Ct);break;case"icon-comment":f(wt);break;case"icon-location-map":f(kt);break;case"icon-heart-1":f(Nt);break;case"icon-arrow-right-1":f(lt);break;case"icon-xmark":f(Ot);break;case"icon-cloud":f(At);break;case"icon-smile":f(It);break;case"icon-like":f(Et);break;default:console.log("no matching type")}};return e.jsx(h.Fragment,{children:e.jsxs("div",{style:{padding:"5px"},className:i?"apc-mpx-widget-secondary-icons-mobile":"apc-mpx-widget-secondary-icons",children:[e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>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:o.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:d=>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:o.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:d=>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:o.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:d=>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:o.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:d=>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:o.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:d=>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:o.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:d=>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:o.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:d=>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:o.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:d=>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:o.primaryColor,d:yt})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>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:o.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:d=>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:o.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:d=>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:o.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:d=>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:o.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:d=>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:o.primaryColor,d:St})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>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:o.primaryColor,d:Ct})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>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:o.primaryColor,d:wt})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>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:o.primaryColor,d:kt})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>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:o.primaryColor,d:Nt})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>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:o.primaryColor,d:vr})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>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:o.primaryColor,d:Ot})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>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:o.primaryColor,d:At})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>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:o.primaryColor,d:It})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>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:o.primaryColor,d:Et})})})]})})}const Xe=({defaultValue:j,size:t,ariaLabel:o,onChange:i})=>{const[l,f]=h.useState(j),x=d=>{const y=d.target.value;f(y),i(y)};return e.jsx("input",{type:"range",value:l,min:"0",max:"100",step:"1",className:`slider ${t}`,"aria-label":o,onChange:x})};function Mt(j){const{apcCanvasInstance:t,theme:o}=j,[i,l]=h.useState(!1),f=h.useRef(null),x=()=>{l(n=>!n)},d=n=>{f.current&&f.current.contains(n.target)||l(!1)};h.useEffect(()=>(document.addEventListener("mousedown",d),()=>{document.removeEventListener("mousedown",d)}),[]);const y=(n,m)=>{if(t.getActiveObject()){if(m==="family"&&t.getActiveObject().set({fontFamily:n}),m==="bold"&&t.getActiveObject().set({fontWeight:n}),m==="italic"&&t.getActiveObject().set({fontStyle:n}),m==="underline"&&t.getActiveObject().set({underline:n}),m==="line-through"&&t.getActiveObject().set({linethrough:n}),m==="overline"&&t.getActiveObject().set({overline:n}),m==="color"&&t.getActiveObject().set({fill:n}),m==="shadow"){const p=document.getElementById("apc-text-shadow-color").value;let b=document.getElementById("apc-text-shadow-horiz").value,s=document.getElementById("apc-text-shadow-vert").value,C=document.getElementById("apc-text-shadow-blur").value;b||(b=5),s||(s=5),C||(C=5),t.getActiveObject().set({shadow:p+" "+b+" "+s+" "+C})}if(m==="stroke"){const p=document.getElementById("apc-text-stroke-color").value;let b=document.getElementById("apc-text-stroke-width").value;b||(b=1),t.getActiveObject().set({stroke:p,strokeWidth:b})}m==="bg-color"&&t.getActiveObject().set({textBackgroundColor:n}),m==="font-size"&&t.getActiveObject().set({fontSize:n}),t&&t.renderAll()}},a=n=>{if(t.getActiveObject()){const m=parseFloat(n/100);t.getActiveObject().set({opacity:m.toFixed(1)}),t&&t.renderAll()}},v=({color:n,x:m,y:p,blur:b})=>{if(t.getActiveObject()){const s=t.getActiveObject().shadow;n||(n=s?s.color:"#6a45d2"),m||(m=s?s.offsetX:5),p||(p=s?s.offsetY:5),b||(b=s?s.blur:5),t.getActiveObject().set({shadow:n+" "+m+" "+p+" "+b}),t&&t.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:o.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:o.primaryColor,d:Mr})})}),i&&e.jsxs("div",{className:"apc-mpx-widget-popper-container",ref:f,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:n=>y(n.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:n=>a(n)})})]})]})}),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:n=>v({blur:n.target.value})})]}),e.jsxs("div",{style:{marginLeft:"10px"},children:[" Color",e.jsx("input",{style:{height:"25px",width:"25px",border:"none"},type:"color",onChange:n=>v({color:n.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:n=>v({x:n})})})]}),e.jsxs("div",{style:{marginLeft:"10px"},children:[" Offset Y",e.jsx("div",{children:e.jsx(Xe,{defaultValue:0,size:"small","aria-label":"Opacity",onChange:n=>v({y:n})})})]})]})})]})]})]});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:n=>y(n.target.value,"color")})})," ",e.jsx("div",{style:{marginTop:"4px"},children:e.jsxs("select",{style:{height:"20px",border:"solid 0px #ffffff"},id:"ffamily",onChange:n=>y(n.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:n=>y(n.target.value,"font-size")})}),e.jsx("div",{style:{marginTop:"4px",marginLeft:"2px",cursor:"pointer"},role:"button",onClick:n=>t.getActiveObject().fontWeight==="normal"?y("bold","bold"):y("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:n=>t.getActiveObject().fontStyle==="normal"?y("italic","italic"):y("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:n=>t.getActiveObject().underline?y(!1,"underline"):y(!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:n=>t.getActiveObject().linethrough?y(!1,"line-through"):y(!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(j){const{apcCanvasInstance:t,theme:o}=j,i=h.useRef(null),[l,f]=h.useState(!1),x=()=>{f(u=>!u)},d=(u,w)=>{if(t&&t.getActiveObject()){if(u==="bg-color"&&t.getActiveObject().set({fill:w}),u==="border-color"&&t.getActiveObject().set({stroke:w}),u==="gradient-bg-color1"||u==="gradient-bg-color2"){let n=document.getElementById("apc-object-bg-gradient-color1").value,m=document.getElementById("apc-object-bg-gradient-color2").value;const p=new _.fabric.Gradient({type:"linear",gradientUnits:"pixels",coords:{x1:0,y1:0,x2:0,y2:t.getActiveObject().height},colorStops:[{offset:0,color:n||"#000"},{offset:1,color:m||"#fff"}]});t.getActiveObject().set({fill:p})}t&&t.renderAll()}},y=u=>{if(t.getActiveObject()){const w=parseFloat(u/100);t.getActiveObject().set({opacity:w.toFixed(1)}),t&&t.renderAll()}},a=({color:u,x:w,y:n,blur:m})=>{if(t.getActiveObject()){const p=t.getActiveObject().shadow;u||(u=p?p.color:"#6a45d2"),w||(w=p?p.offsetX:5),n||(n=p?p.offsetY:5),m||(m=p?p.blur:5),t.getActiveObject().set({shadow:u+" "+w+" "+n+" "+m}),t&&t.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:o.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:o.primaryColor,d:zr})})}),l&&e.jsxs("div",{className:"apc-mpx-widget-popper-container",ref:i,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=>d("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=>d("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=>d("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=>y(u)})]})}),e.jsxs("div",{style:{marginLeft:"10px"},children:[" Border color",e.jsx("input",{style:{height:"25px",width:"25px",border:"none"},type:"color",onChange:u=>d("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=>a({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=>a({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=>a({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=>a({y:u})})]})})]})})]})]})]})})}function Qr(j){const{apcCanvasInstance:t,apiEndpoint:o,apiKey:i}=j,[l,f]=h.useState("art"),[x,d]=h.useState(),[y,a]=h.useState(!1),v=o+"/api/v1/designer";h.useEffect(()=>{u()},[]);const u=()=>{a(!0);const p={"X-Api-Key":i},b=`${v}/get-quote/${l}`;ye.get(b,{headers:p}).then(s=>{var C;a(!1),d((C=s.data)==null?void 0:C.object)}).catch(s=>{console.error("Error fetching data:",s),a(!1)})},w=(p,b,s)=>{const C=new _.fabric.Textbox(b,{width:500,left:100,top:200,fontSize:16}),R=new _.fabric.Textbox(s,{fontSize:14,width:200,fontWeight:"bold"});R.top=C.top+C.height+10,R.left=C.left,t.add(C),t.add(R),t.setActiveObject(C)},n=p=>{a(!0),f(p),u()},m=()=>x?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:5},children:x.map((p,b)=>e.jsxs("div",{onClick:s=>w(s,p.quote,p.author),style:{cursor:"pointer",padding:"3px",textAlign:"left",color:"#210080",fontFamily:"ui-monospace",border:"1px solid #dedcdc",borderRadius:"8px"},children:[e.jsx("div",{children:p.quote}),e.jsx("div",{children:e.jsx("strong",{children:e.jsx("i",{children:p.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:m()}),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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("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:()=>n("birthday"),children:[l==="birthday"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Birthday"]}),e.jsx("br",{})]})]})}function Zr(j){const{apcCanvasInstance:t,theme:o,apiKey:i,apiEndpoint:l,updateActiveSection:f,reloadTabs:x,currentTabNo:d,isMobile:y,closeMobileModalSecondaryPanel:a}=j,[v,u]=h.useState("background"),[w,n]=h.useState(!1),[m,p]=h.useState(),b=l+"/api/v1/designer";h.useEffect(()=>{C()},[]);const s=L=>{const D=document.getElementById("img-default-id"),E=new _.fabric.Image(D,T=>{T.set({left:100,top:200,scaleX:.5,scaleY:.5,imageSmoothing:!0})});t.add(E),y&&a(!0)},C=()=>{n(!0);const L={"X-Api-Key":i},D=`${b}/get-images/${v}`;ye.get(D,{headers:L}).then(E=>{var T;n(!1),p((T=E.data)==null?void 0:T.object)}).catch(E=>{console.error("Error fetching data:",E),n(!1)})},R=L=>{_.fabric.Image.fromURL(L,function(D){D.width=t.width,D.height=t.height,D.scaleToWidth(t.width),D.scaleToHeight(t.height),t.setBackgroundImage(D);const E=localStorage.getItem("apc_x_activeTab"),T=JSON.stringify(t);De(E,"general",T,null).then(H=>{x(d+1),t&&t.renderAll()})},{crossOrigin:"anonymous"})},I=()=>m?e.jsx("div",{children:m.map(L=>e.jsx("div",{onClick:()=>R(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 ${o.primaryColor}`}}),e.jsx("br",{})," ",e.jsx("br",{}),e.jsx("button",{className:"apc-mpc-widget-btn",onClick:()=>C(),style:{backgroundColor:o.primaryColor,color:"#ffffff"},children:w?"...Processing":"Search"})]}),e.jsx("br",{}),e.jsx("br",{}),I()]})}function es(j){const[t,o]=h.useState(""),[i,l]=h.useState(""),[f,x]=h.useState(!1),[d,y]=h.useState(!1),[a,v]=h.useState(!1),{apcCanvasInstance:u,theme:w,isMobile:n,closeMobileModalSecondaryPanel:m,apiKey:p,apiEndpoint:b}=j,s=`${b}/api/v1/designer`,C=sessionStorage.getItem("apc_x_sub_status");h.useEffect(()=>{(async()=>{C==="active"?(y(!0),v(!0)):(x(!0),await R())})()},[]);const R=()=>{x(!0);const D=`${s}/get-subscription-status/${p}`;ye.get(D).then(E=>{E.data.object&&E.data.object==="active"&&(sessionStorage.setItem("apc_x_sub_status","active"),y(!0))}).catch(E=>{sessionStorage.setItem("apc_x_sub_status","")}).finally(()=>{x(!1),v(!0)})},I=()=>{Zt.toDataURL(t,{width:300},(D,E)=>{D&&console.error(D),l(E)})},L=D=>{const E=document.getElementById("apc-qr-code-img"),T=new _.fabric.Image(E,H=>{H.set({left:200,top:200,scaleX:.5,scaleY:.5,imageSmoothing:!0})});u.add(T),u.setActiveObject(T),n&&m(!0)};return!d&&!f&&a?e.jsx(ot,{theme:w}):d&&!f&&a?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:D=>o(D.target.value)}),e.jsx("br",{}),e.jsx("br",{}),e.jsx("button",{className:"apc-mpc-widget-btn",style:{backgroundColor:w.primaryColor,color:"#ffffff"},disabled:!t,onClick:I,children:"Generate QR code"}),e.jsx("br",{}),e.jsx("br",{}),i&&e.jsxs("div",{className:"generated-view",onClick:()=>L(),style:{cursor:"pointer"},children:[e.jsx("img",{src:i,alt:"qr code",id:"apc-qr-code-img"}),e.jsx("a",{href:i})]})]}):e.jsx("div",{children:e.jsx(it,{})})}function ts(j){const{apcCanvasInstance:t,theme:o,isMobile:i,closeMobileModalSecondaryPanel:l,apiKey:f,apiEndpoint:x}=j,[d,y]=h.useState(""),[a,v]=h.useState(null),[u,w]=h.useState("CODE128"),n=h.useRef(null),[m,p]=h.useState(""),[b,s]=h.useState(!1),[C,R]=h.useState(!1),[I,L]=h.useState(!1),D=sessionStorage.getItem("apc_x_sub_status"),E=`${x}/api/v1/designer`;h.useEffect(()=>{(async()=>{D==="active"?(R(!0),L(!0)):(s(!0),await T())})()},[]);const T=()=>{s(!0);const J=`${E}/get-subscription-status/${f}`;ye.get(J).then(ie=>{ie.data.object&&ie.data.object==="active"&&(sessionStorage.setItem("apc_x_sub_status","active"),R(!0))}).catch(ie=>{sessionStorage.setItem("apc_x_sub_status","")}).finally(()=>{s(!1),L(!0)})},H=()=>{v(e.jsx(er,{value:d,format:u,id:"barcode-element"}));const J=document.getElementById("barcode-element");J&&p(J.innerHTML)},Y=J=>{if(n.current.innerHTML){const ie=n.current.innerHTML;let re=new Image;re.src="data:image/svg+xml,"+encodeURIComponent(ie),re.onload=function(){const se=new _.fabric.Image(re,{left:200,top:200});t.add(se),t.setActiveObject(se)}}i&&l(!0)};return!C&&!b&&I?e.jsx(ot,{theme:o}):C&&!b&&I?e.jsxs(h.Fragment,{children:[e.jsx("br",{}),e.jsx("br",{}),"Enter number",e.jsx("input",{type:"text",onChange:J=>y(J.target.value),className:"apc-mpc-widget-input",style:{border:`solid 3px ${o.primaryColor}`}}),e.jsx("br",{}),e.jsx("br",{}),"Code type",e.jsxs("select",{value:u,onChange:J=>w(J.target.value),className:"apc-mpc-widget-input",style:{border:`solid 3px ${o.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:!d,onClick:()=>H(),style:{backgroundColor:o.primaryColor,color:"#ffffff"},children:"Generate Barcode"}),e.jsx("br",{}),e.jsx("br",{})," ",e.jsx("br",{}),e.jsx("br",{}),e.jsx("div",{children:a&&e.jsx("div",{ref:n,onClick:J=>Y(),style:{cursor:"pointer"},children:a})})]}):e.jsxs("div",{children:[" ",e.jsx(it,{})]})}function rs(j){const{apcCanvasInstance:t,theme:o}=j,[i,l]=h.useState(),[f,x]=h.useState(),[d,y]=h.useState(""),a=(w,n)=>{if(t){if(w==="bg-color"&&n.target.value&&t.set({backgroundColor:n.target.value}),w==="image"&&n.target.value){const m=n.target.files[0],p=new FileReader;p.onload=function(b){const s=b.target.result;_.fabric.Image.fromURL(s,function(C){t.setBackgroundImage(C,t.renderAll.bind(t),{})})},p.readAsDataURL(m)}w==="height"&&n.target.value&&(l(n.target.value),t.setHeight(n.target.value)),w==="width"&&n.target.value&&(x(n.target.value),t.setWidth(n.target.value)),t&&t.renderAll()}},v=(w,n,m)=>{x(n),l(w),t.setWidth(n),t.setHeight(w),y(m)},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:t.height,onChange:w=>a("height",w),className:"apc-mpc-widget-input",style:{border:`solid 3px ${o.primaryColor}`}})]})})," ",e.jsx("div",{style:{display:"flex",flexDirection:"row"},children:e.jsxs("div",{children:["Width(px)",e.jsx("input",{color:"info",type:"number",value:t.width,onChange:w=>a("width",w),className:"apc-mpc-widget-input",style:{border:`solid 3px ${o.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:[d==="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:[d==="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:[d==="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:[d==="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:[d==="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:[d==="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:[d==="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:[d==="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:[d==="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:[d==="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:[d==="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:[d==="BUSINESSCARD"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Business card 3.5 x 2 in"]})})]})]});return e.jsx("div",{children:u()})}const fe=(j,t,o,i="png",l)=>new Promise((f,x)=>{const d=document.createElement("canvas"),y=JSON.parse(j),a=crypto.randomUUID();d.width=o,d.height=t;const v=new _.fabric.StaticCanvas(d,{selection:!1,height:y.height,width:y.width});v.loadFromJSON(y,function(){v.renderAll();const u=(w,n)=>{const m=URL.createObjectURL(w),p=document.createElement("a");p.href=m,p.download=n,document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(m)};if(i.toLowerCase()==="svg"){const w=v.toSVG(),n=new Blob([w],{type:"image/svg+xml"});l&&u(n,"mypixia.svg"),f(new File([n],`${a}.svg`,{type:"image/svg+xml"}))}else if(i.toLowerCase()==="pdf"){const w=v.toDataURL("image/jpeg",1);import("jspdf").then(n=>{const m=new n.jsPDF({orientation:"landscape",unit:"px",format:[d.width,d.height]});m.addImage(w,"JPEG",0,0,d.width,d.height);const b=m.output("datauristring").split(",")[1],s=ss(b,"application/pdf"),C=new File([s],`${a}.pdf`,{type:"application/pdf"}),R=`${a}.pdf`;l&&u(C,R),f(C)}).catch(n=>{console.error("Error loading jsPDF: ",n),x(n)})}else{let w,n="image/png",m="png";switch(i.toLowerCase()){case"jpeg":w=v.toDataURL("image/jpeg",1),n="image/jpeg",m="jpg";break;case"webp":w=v.toDataURL("image/webp",1),n="image/webp",m="webp";break;default:w=v.toDataURL("image/png",1);break}const p=atob(w.split(",")[1]),b=new Array(p.length);for(let I=0;I<p.length;I++)b[I]=p.charCodeAt(I);const s=new Uint8Array(b),C=new File([s],`${a}.${m}`,{type:n}),R=`${a}.${m}`;l&&u(C,R),f(C)}})});function ss(j,t){const o=atob(j),i=new Array(o.length);for(let f=0;f<o.length;f++)i[f]=o.charCodeAt(f);const l=new Uint8Array(i);return new Blob([l],{type:t})}const ns=({children:j})=>tr.createPortal(j,document.getElementById("apc-mpx-editor-modal-root"));function ct(j){const{isOpen:t,onClose:o,children:i}=j;return t?e.jsx(ns,{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:o,children:"Close"}),e.jsx("div",{className:"apc-mpx-widget-modal-content",children:i})]})})}):null}const xe=(j,t)=>{j=j.startsWith("#")?j:`#${j}`;let o=parseInt(j.slice(1,3),16),i=parseInt(j.slice(3,5),16),l=parseInt(j.slice(5,7),16);return o=parseInt(o*(100-t)/100),i=parseInt(i*(100-t)/100),l=parseInt(l*(100-t)/100),o=o.toString(16).padStart(2,"0"),i=i.toString(16).padStart(2,"0"),l=l.toString(16).padStart(2,"0"),`#${o}${i}${l}`};function _t(j){const[t,o]=h.useState(""),{apcCanvasJSON:i,height:l,width:f}=j;return h.useEffect(()=>{const x=document.createElement("canvas"),d=JSON.parse(i);x.width=f,x.height=l;const y=new _.fabric.StaticCanvas(x,{selection:!1,height:d.height,width:d.width});y.loadFromJSON(d,function(){y.renderAll();const a=y.toDataURL("image/png",1);o(a)})},[]),t?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:t,alt:"mypixia cool design",className:"apc-mpx-widget-responsive-image"})})}):"...processing"}function os(j){const{theme:t,apcCanvasInstance:o}=j,[i,l]=h.useState(!1),[f,x]=h.useState(),d=()=>{l(!0)},y=()=>{l(!1)},a=()=>{if(!o)return null;const v=JSON.stringify(o);return e.jsxs(ct,{isOpen:i,onClose:y,children:[e.jsx(_t,{apcCanvasJSON:v,height:o.height,width:o.width}),e.jsx("div",{children:e.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:5},children:[e.jsx("div",{children:e.jsx(ne.FacebookShareButton,{url:f,children:e.jsx(ne.FacebookIcon,{size:32,round:!0})})}),e.jsx("div",{children:e.jsx(ne.TwitterShareButton,{url:f,title:"Hello",children:e.jsx(ne.XIcon,{size:32,round:!0})})}),e.jsx("div",{children:e.jsx(ne.TelegramShareButton,{url:f,title:"Hello",children:e.jsx(ne.TelegramIcon,{size:32,round:!0})})}),e.jsx("div",{children:e.jsx(ne.WhatsappShareButton,{url:f,title:"Hello",separator:":: ",children:e.jsx(ne.WhatsappIcon,{size:32,round:!0})})}),e.jsx("div",{children:e.jsx(ne.LinkedinShareButton,{url:f,children:e.jsx(ne.LinkedinIcon,{size:32,round:!0})})}),e.jsx("div",{children:e.jsx(ne.PinterestShareButton,{url:"https://static.mypixia.com",media:f,children:e.jsx(ne.PinterestIcon,{size:32,round:!0})})}),e.jsx("div",{children:e.jsx(ne.RedditShareButton,{url:f,title:"Hello",windowWidth:660,windowHeight:460,children:e.jsx(ne.RedditIcon,{size:32,round:!0})})}),e.jsx("div",{children:e.jsx(ne.InstapaperShareButton,{url:f,title:"Hello",children:e.jsx(ne.InstapaperIcon,{size:32,round:!0})})})]})}),e.jsx("hr",{}),e.jsx("br",{}),e.jsx("button",{autoFocus:!0,type:"button",className:"apc-mpc-widget-btn",onClick:()=>y(),style:{backgroundColor:"red",color:"#ffffff",float:"right"},children:"Close"})]})};return e.jsxs(h.Fragment,{children:[e.jsxs("button",{className:"apc-mpc-widget-btn",onClick:()=>d(),role:"dialog",style:{backgroundColor:xe(t.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:Er})})," Share"]}),a()]})}function is(j){const{theme:t,apiKey:o,apcCanvasInstance:i,updateSelectedSections:l,updateActiveSection:f,accesories:x,getDesignFormats:d}=j,[y,a]=h.useState(!1),[v,u]=h.useState(),w=()=>{a(!0)},n=()=>{a(!1)},m=()=>({getPDF:()=>{const b=JSON.stringify(i);return fe(b,i.height,i.width,"pdf",!0).then(s=>s)},getPNG:()=>{const b=JSON.stringify(i);return fe(b,i.height,i.width,"png",!0).then(s=>s)},getSVG:()=>{const b=JSON.stringify(i);return fe(b,i.height,i.width,"svg",!0).then(s=>s)},getJPEG:()=>{const b=JSON.stringify(i);return fe(b,i.height,i.width,"jpeg",!0).then(s=>s)},getWEBP:()=>{const b=JSON.stringify(i);return fe(b,i.height,i.width,"webp",!0).then(s=>s)}}),p=()=>{if(!i)return null;const b=JSON.stringify(i);return e.jsxs(ct,{isOpen:y,onClose:n,children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[e.jsx("h3",{style:{float:"left"},children:"Download"}),e.jsx("div",{children:e.jsx(_t,{apcCanvasJSON:b,height:i.height,width:i.width})}),e.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:5},children:[e.jsx("div",{style:{color:xe(t.primaryColor,50),fontWeight:"bold",textDecoration:"underline",cursor:"pointer"},onClick:()=>m().getPDF(),children:"PDF"}),e.jsx("div",{style:{color:xe(t.primaryColor,50),fontWeight:"bold",textDecoration:"underline",cursor:"pointer"},onClick:()=>m().getSVG(),children:"SVG"}),e.jsx("div",{style:{color:xe(t.primaryColor,50),fontWeight:"bold",textDecoration:"underline",cursor:"pointer"},onClick:()=>m().getPNG(),children:"PNG"}),e.jsx("div",{style:{color:xe(t.primaryColor,50),fontWeight:"bold",textDecoration:"underline",cursor:"pointer"},onClick:()=>m().getJPEG(),children:"JPEG"}),e.jsx("div",{style:{color:xe(t.primaryColor,50),fontWeight:"bold",textDecoration:"underline",cursor:"pointer"},onClick:()=>m().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:()=>n(),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:xe(t.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:Tr})})," Download"]}),p()]})}function cs(j){var Ie;const{theme:t,activeSection:o,selectedObjectType:i,renderQuickActions:l,renderActionItems:f,canvasEl:x,zoomIn:d,zoomOut:y,apcCanvasInstance:a,setActiveSection:v,saveActiveDesign:u,reloadTabs:w,initProductName:n,historyRef:m,currentState:p,setCurrentState:b,setHistory:s,activeTabName:C,isPlainColor:R,selectedProduct:I,isMobile:L,supportedProductColors:D}=j,[E,T]=h.useState(),[H,Y]=h.useState([]),[J,ie]=h.useState(0),[re,se]=h.useState(!1),he=h.useRef(null),[Te,we]=h.useState(!1),[qe,Me]=h.useState(null),[q,Pe]=h.useState(),[Fe,He]=h.useState(),[ze,Ve]=h.useState(),[Ce,ge]=h.useState(!0),[$,Le]=h.useState(),Oe=()=>{we(!0),se(!1)},Q=()=>{we(!1)},Ue=()=>{se(k=>!k)};h.useEffect(()=>{const k=O=>{he.current&&he.current.contains(O.target)||se(!1)};return document.addEventListener("mousedown",k),()=>{document.removeEventListener("mousedown",k)}},[]),h.useEffect(()=>{(async()=>{var O,G;if(E)try{const B=await Ke(E);Ve(B),(O=B==null?void 0:B.misc)!=null&&O.colorSettings&&Pe(B.misc.colorSettings),((G=B==null?void 0:B.misc)==null?void 0:G.type)!=="subsection"&&Le(B)}catch(B){console.error("Error fetching tab data: ",B)}})()},[E,w]),h.useEffect(()=>{(async()=>{const O=await Ee();let G=O?O.filter(B=>{var Z;return B.classification!=="cart"&&((Z=B.misc)==null?void 0:Z.type)!=="subsection"}).map(B=>B.id):[];G.length===0&&G.push("design"),J===0&&T(G[0]),Y(G)})()},[J,w]);const le=()=>{a&&(a.clear(),a.renderAll())},pe=k=>{if(!a)return;a.backgroundColor="transparent",a&&a.requestRenderAll();let O=a.backgroundImage;O&&(O.filters=[],O.filters.push(new _.fabric.Image.filters.BlendColor({color:k})),O.applyFilters(),a&&a.requestRenderAll(),He(k),u(a,ze))},Se=()=>{if(!(!q||(q==null?void 0:q.length)<=1))return console.log("Applicable colors",q),q.map((k,O)=>e.jsxs(h.Fragment,{children:[e.jsx("div",{role:"button",className:"apc-mpx-widget-circle",style:{backgroundColor:k,cursor:"pointer",border:"solid 1px #ffffff"},onClick:()=>pe(k)})," "]},O))},me=async(k,O)=>{var ue,ve;const G=(ve=(ue=a==null?void 0:a.backgroundImage)==null?void 0:ue.filters[0])==null?void 0:ve.color,B=await Ke(k);if(!B)return;const Z=B!=null&&B.content?JSON.parse(B.content):null;Z&&a?(a.clear(),a.setBackgroundImage(null),a.loadFromJSON(Z,()=>{var te;a.renderAll(),v(B),((te=B==null?void 0:B.misc)==null?void 0:te.type)!=="subsection"?(localStorage.setItem("apc_x_activeTab",k),ge(!0)):(ge(!1),G&&pe(G)),T(k)})):console.error("Failed to load JSON content for section:",k)},We=()=>H.map(k=>e.jsx("button",{className:`tablinks ${E===k?"active":null}`,onClick:()=>me(k),children:k},k)),ke=()=>{Ee().then(k=>{if(k&&k.length>0){const O=k[0],G=JSON.parse(O.content);a.loadFromJSON(G,function(){a.off("object:modified"),a.on({"object:modified":B=>{u(a,O)}}),T(O.id),localStorage.setItem("apc_x_activeTab",O.id),v(O),ie(J+1),a&&a.renderAll()})}else{let O="design";const G=JSON.stringify(a);De(O,"general",G,null).then(B=>{Ke(O).then(Z=>{const ue=JSON.parse(Z.content);a.loadFromJSON(ue,function(){a.off("object:modified"),a.on({"object:modified":ve=>{u(a,Z)}}),T(O),localStorage.setItem("apc_x_activeTab",O),v(Z),ie(J+1),a&&a.renderAll()})})})}})},Ae=()=>{Fr(E).then(k=>{Q(),ke()})},$e=()=>a?e.jsxs(ct,{isOpen:Te,onClose:Q,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:()=>Ae(),style:{backgroundColor:"green",color:"#ffffff"},children:"Yes"})}),e.jsx("div",{children:e.jsx("button",{autoFocus:!0,type:"button",className:"apc-mpc-widget-btn",onClick:()=>Q(),style:{backgroundColor:"red",color:"#ffffff",float:"right"},children:"Close"})})]})]}):null,Qe=()=>e.jsxs("div",{className:"apc-mpx-widget-button-group-container",children:[e.jsx("div",{className:"apc-mpx-widget-generic-icon",onClick:Ue,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:Or})})}),re&&e.jsxs("div",{className:"apc-mpx-widget-popper-container",ref:he,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(t.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:()=>Oe(),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:zt,fill:xe(t.primaryColor,80)})})," Delete"]}),e.jsxs("li",{className:"apc-mpx-widget-popper-li",style:{height:"25px",cursor:"pointer",marginBlockStart:"5px"},onClick:()=>le(),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:Ar,fill:xe(t.primaryColor,80)})})," Clear"]})]})]})]}),Re=k=>{var ve,te,Ge,_e;const O=a.width*5,G=a.height*5,B=JSON.parse($.content),Z=(te=(ve=B==null?void 0:B.backgroundImage)==null?void 0:ve.filters[0])==null?void 0:te.color,ue=(_e=(Ge=a==null?void 0:a.backgroundImage)==null?void 0:Ge.filters[0])==null?void 0:_e.color;Ke(k.sectionName).then(async je=>{if(je){const c=je!=null&&je.content?JSON.parse(je.content):null;c&&a?(await a.loadFromJSON(c,()=>{a.renderAll(),v(je),T(k.sectionName);const A=JSON.stringify(a),M={};M.id=k.sectionName,M.classification=I==null?void 0:I.name,M.json=A,M.misc={sectionName:k.sectionName,sectionImage:k.sectionImage,type:k.type},a.off("object:modified"),a.on({"object:modified":N=>{u(a,M)}})}),pe(ue),Ce||ge(!0)):console.error("Failed to load JSON content for section:",k.sectionName)}else a&&a.clear(),k.type="subsection",_.fabric.Image.fromURL(k.sectionImage,function(c){c.width=O,c.height=G,c.scaleToWidth(O),c.scaleToHeight(G),a.setBackgroundImage(c),(Fe||Z)&&(c.filters=[],c.filters.push(new _.fabric.Image.filters.BlendColor({color:Fe||Z})),c.applyFilters());const A=JSON.stringify(a),M={};M.id=k.sectionName,M.classification=$.id,M.json=A,M.misc={sectionName:k.sectionName,sectionImage:k.sectionImage,type:k.type},a.off("object:modified"),a.on({"object:modified":N=>{u(a,M)}}),De(k.sectionName,E,A,{...k}).then(N=>{a&&(a.renderAll(),Ce&&ge(!1),T(k.sectionName),ie(J+1))})},{crossOrigin:"anonymous"})})},Ze=()=>{if(!ze)return null;let k=[];if(I){const O=I.sections.map(G=>({...G,type:"subsection"}));k.push(...O),k.push({sectionName:I==null?void 0:I.name,sectionImage:I==null?void 0:I.mainImage,type:"main"})}return k=k==null?void 0:k.map(O=>({...O,active:O.sectionName===E})),(k==null?void 0:k.length)<1?null:k==null?void 0:k.map((O,G)=>{var B,Z;return e.jsxs("div",{onClick:()=>Re(O),style:{position:"relative",backgroundColor:"#ff000026",border:"solid 1px #ffffff",padding:"2px",borderRadius:"6px",cursor:"pointer",textAlign:"center"},children:[O.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:O==null?void 0:O.sectionImage,width:50,height:50,alt:(O==null?void 0:O.sectionName)||"section image",style:{borderRadius:"6px"}})}),e.jsx("div",{style:{fontSize:"12px",color:"#333"},children:((B=O==null?void 0:O.sectionName)==null?void 0:B.length)>5?`${(Z=O==null?void 0:O.sectionName)==null?void 0:Z.substring(0,5)}...`:(O==null?void 0:O.sectionName)||"view"})]},G)})},et=()=>{if(m.current.length>0){const k=m.current.pop();a.loadFromJSON(k,()=>{a.renderAll(),b(k)})}};return e.jsxs(h.Fragment,{children:[e.jsx("div",{className:"tab",children:We()}),e.jsxs("div",{style:{display:"flex",backgroundColor:t.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:()=>et(),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:Ir,fill:"#ffffff"})})})," "]})})}),e.jsx("div",{style:{flexBasis:"20%"},children:i?l():null}),e.jsx("div",{style:{flexBasis:"40%",marginTop:"8px"},children:i?f():null}),Qe()]}),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:((Ie=I==null?void 0:I.sections)==null?void 0:Ie.length)>0?Ze():null})}),e.jsx("div",{children:e.jsx("canvas",{id:"apc-mpx-editor-canvas",ref:x,height:1e3})}),q&&(R||(o==null?void 0:o.plainColor)==="Y")&&Ce&&(q==null?void 0:q.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:q&&(q==null?void 0:q.length)>1?Se():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:()=>d(),children:"+"}),e.jsx("button",{style:{height:"35px",width:"65px",cursor:"pointer"},"aria-label":"zoom out",onClick:()=>y(),children:"-"})]})]}),$e()]})}function as({data:j,theme:t,apcCanvasInstance:o,closeMobileModalSecondaryPanel:i,isMobile:l}){const[f,x]=h.useState({}),d=u=>{x(w=>({...w,[u]:!w[u]}))},y=async u=>{const w=await Rt(u);w&&_.fabric.Image.fromURL(w,n=>{n.set({left:100,top:100,scaleX:.3,scaleY:.3}),o.add(n),o.renderAll(),l&&i(!0)})},a=(u,w="",n=0)=>e.jsx("ul",{style:{listStyleType:"none",paddingLeft:`${n*20}px`,margin:"0"},children:Object.keys(u).map(m=>{const p=`${w}/${m}`,b=f[p];return u[m].type==="image"?e.jsx("li",{children:e.jsx("div",{onClick:()=>y(u[m].url),style:{cursor:"pointer"},children:e.jsx("img",{src:u[m].url,alt:m,style:{width:"100px",height:"auto"}})})},p):e.jsxs("li",{children:[e.jsxs("div",{onClick:()=>d(p),style:{cursor:"pointer",display:"flex",alignItems:"center",fontWeight:"bold",color:t.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:Rr,fill:t.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:_r,fill:t.primaryColorLight})})}),m]}),b&&a(u[m],p,n+1)]},p)})}),v=ls(j);return e.jsx("div",{children:a(v)})}function ls(j){const t={};return j.forEach(o=>{const i=o.name.split("/");let l=t;i.forEach((f,x)=>{l[f]||(l[f]=x===i.length-1?o:{}),l=l[f]})}),t}function ds(j){const{apcCanvasInstance:t,theme:o,apiEndpoint:i,isMobile:l,closeMobileModalSecondaryPanel:f,apiKey:x}=j,d=`${i}/api/v1/designer`,[y,a]=h.useState([]),[v,u]=h.useState(!1),[w,n]=h.useState(!1),[m,p]=h.useState(!1),b=sessionStorage.getItem("apc_x_sub_status"),s=sessionStorage.getItem("apc_x_stickers");h.useEffect(()=>{u(!0),(async()=>{b==="active"?n(!0):await R(),s?(a(JSON.parse(s)),u(!1)):await C()})()},[]);const C=()=>{u(!0);const I=`${d}/get-stickers`;ye.get(I).then(L=>{L.data.object&&(a(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)})},R=()=>{u(!0);const I=`${d}/get-subscription-status/${x}`;ye.get(I).then(L=>{L.data.object&&L.data.object==="active"&&(sessionStorage.setItem("apc_x_sub_status","active"),n(!0))}).catch(L=>{sessionStorage.setItem("apc_x_sub_status","")}).finally(()=>{u(!1),p(!0)})};return!w&&!v&&m?e.jsx(ot,{theme:o}):w&&y.length>0&&!v?e.jsx(h.Fragment,{children:e.jsx("div",{style:{padding:"10px"},children:e.jsx(as,{data:y,theme:o,apcCanvasInstance:t,isMobile:l,closeMobileModalSecondaryPanel:f})})}):e.jsx("div",{children:e.jsx(it,{})})}function hs(j){const{theme:t=or,readOnly:o=!1,apiKey:i=null,handleSaveClick:l,handleCartClick:f,apiEndpoint:x,enabledModules:d=["TXT","STICKERS","SHAPES","ICONS","IMAGE","QUOTE","BACKGROUND","QRCODE","BARCODE"],actionButtons:y={share:!0,download:!0,submit:!0,addToCart:!0},initInstance:a=null,initCategory:v=null,additionalActionButton:u=null,initProductName:w,isPlainColor:n,product:m={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"}]}}=j,[p,b]=h.useState(d[0]),[s,C]=h.useState(),R=h.useRef(null),[I,L]=h.useState(),[D,E]=h.useState(!1),[T,H]=h.useState(1),Y=.1,[J,ie]=h.useState(1),[re,se]=h.useState([]),[he,Te]=h.useState(null),[we,qe]=h.useState(null),[Me,q]=h.useState(0),[Pe,Fe]=h.useState(),[He,ze]=h.useState(null),Ve=h.useRef([]),[Ce,ge]=h.useState(null),[$,Le]=h.useState(!1),[Oe,Q]=h.useState(!1);h.useEffect(()=>{const c=()=>Le(window.innerWidth<600);return c(),window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[]),h.useEffect(()=>{var be;const c=document.getElementById("apc-mpx-editor-canvas-container"),A=document.getElementById("apc-mpx-editor-canvas-container");if(!R.current||!c||!A){console.error("Canvas element is not mounted yet!");return}const M={isDrawingMode:!1,selection:!0,selectionBorderColor:"#008000",height:A.offsetHeight,width:c.offsetWidth,enableRetinaScaling:!0};let N,ae;if(o)N=new _.fabric.StaticCanvas(R.current,M);else if(N=new _.fabric.Canvas(R.current,M),we)ae=JSON.parse(we),N.loadFromJSON(ae,function(){});else if(a){let U;try{U=JSON.parse(a)}catch(K){console.error("Failed to parse initInstance",K)}N&&U?N.loadFromJSON(U,function(){}):console.error("Canvas or InitInstance is not properly initialized")}else{const U=new _.fabric.Textbox("Something cool!",{width:300,left:250,top:300,fontFamily:"aclonica",fill:"#6a45d2",rotate:20});U.shadow={color:"rgba(0,0,0,0.5)",blur:10,offsetX:5,offsetY:5},N.add(U),m!=null&&m.mainImage&&((be=_.fabric.Image)==null||be.fromURL(m.mainImage,function(K){K.height=A.offsetHeight,K.width=c.offsetWidth,K.scaleToWidth(A.offsetHeight),K.scaleToHeight(c.offsetWidth),N.setBackgroundImage(K),N.setActiveObject(U),pe(U),N.renderAll(),k(N)},{crossOrigin:"anonymous"}))}return N.on({"selection:updated":U=>{const K=N.getActiveObject();pe(K)},"selection:created":U=>{const K=N.getActiveObject();pe(K)},"selection:cleared":U=>{Se()},"object:modified":U=>{k(N),le(N)},"object:added":U=>{le(N)},"object:removed":U=>{le(N)},"object:created":U=>{le(N)}}),C(N),ie(c.offsetWidth),()=>{C(null),N.off({"selection:updated":U=>{const K=N.getActiveObject();pe(K)},"selection:created":U=>{const K=N.getActiveObject();pe(K)},"selection:cleared":U=>{Se()},"object:modified":U=>{k(N),le(N)},"object:added":U=>{le(N)},"object:removed":U=>{le(N)},"object:created":U=>{le(N)}}),N.dispose()}},[we]),h.useEffect(()=>(Ue(),document.addEventListener("keydown",c=>Ie(c)),()=>{document.removeEventListener("keydown",c=>Ie(c))}),[s]),h.useEffect(()=>{if(s){const c=document.getElementById("apc-mpx-editor-canvas-container"),A=()=>{const M=c.offsetWidth/J;s.setZoom(M)};return window.addEventListener("resize",A),()=>{window.removeEventListener("resize",A)}}},[s,T]),h.useEffect(()=>{const c=()=>{if(s&&R.current){const A=s.getWidth(),M=s.getHeight(),N=window.innerWidth,ae=window.innerHeight,be=N/A,U=ae/M,K=Math.min(be,U);s.setZoom(K/1.4),s.renderAll()}};return $&&(c(),window.addEventListener("resize",c)),()=>window.removeEventListener("resize",c)},[s,$]);const Ue=()=>{Ee().then(c=>{if(c&&c.length>0){const A=c[0].content;w===c[0].id&&qe(A)}})},le=c=>{if(c){const A=c.toJSON();ze(M=>(Ve.current.push(M),A))}},pe=c=>{L(c.type)},Se=()=>{L(null)},me=()=>{s.getActiveObject()&&s.remove(s.getActiveObject())},We=()=>{const c=s.getActiveObject(),A=_.fabric.util.object.clone(c);A.set({left:c.left+20,top:c.top+20}),s.add(A)},ke=c=>{Te(c)},Ae=c=>{let A=re;A.push(c),se(A)},$e=c=>{c==="lock"?s.getActiveObject().set({lockMovementX:!0,lockMovementY:!0}):s.getActiveObject().set({lockMovementX:!1,lockMovementY:!1})},Qe=()=>{s&&(s.getActiveObject().bringForward(),s.renderAll())},Re=()=>{s&&(s.getActiveObject().sendBackwards(),s.renderAll())},Ze=()=>{const c=T+Y;H(c),s.setZoom(c)},et=()=>{const c=Math.max(T-Y,Y);H(c),s.setZoom(c)},Ie=c=>{s&&s.getActiveObject()&&s.getActiveObject().type!=="textbox"&&c.keyCode===8&&me()},k=c=>{const A=localStorage.getItem("apc_x_activeTab");if(A)Ke(A).then(M=>{if(M){const N=JSON.stringify(c);De(M.id,M.classification,N,M.misc).then(ae=>{})}else{const N=JSON.stringify(c);De(m.name??"design","general",N,m).then(ae=>{})}});else{const M=JSON.stringify(c);De(m.name??"design","general",M,m).then(N=>{})}},O=(c,A)=>{const M=JSON.stringify(c);De(A.id,A.classification,M,A.misc).then(N=>{})},G=()=>({getPDF:()=>Ee().then(c=>{let A=[];for(let M in c)fe(c[M].content,s.height,s.width,"pdf").then(N=>{A.push(N)});return A}),getPNG:()=>Ee().then(c=>{let A=[];for(let M in c)fe(c[M].content,s.height,s.width,"png").then(N=>{A.push(N)});return A}),getSVG:()=>Ee().then(c=>{let A=[];for(let M in c)fe(c[M].content,s.height,s.width,"svg").then(N=>{A.push(N)});return A}),getJPEG:()=>Ee().then(c=>{let A=[];for(let M in c)fe(c[M].content,s.height,s.width,"jpeg").then(N=>{A.push(N)});return A}),getWEBP:()=>Ee().then(c=>{let A=[];for(let M in c)fe(c[M].content,s.height,s.width,"webp").then(N=>{A.push(N)});return A}),getImageActiveTab:()=>{const c=localStorage.getItem("apc_x_activeTab");return Ke(c).then(A=>fe(A.content,s.height,s.width,"png").then(M=>{let N={};return N.file=M,N.height=s.height,N.width=s.width,N}))}}),B=()=>e.jsxs("div",{style:{marginTop:"6px",fontWeight:"bold"},children:["Replace Image: ",e.jsx("input",{type:"file",accept:"image/*",onChange:c=>Z(c)}),e.jsx("br",{})]}),Z=(c,A)=>{{const M=s.getActiveObject(),N=c.target.files[0],ae=new FileReader;ae.onload=function(be){const U=be.target.result;M.setSrc(U,function(K){K.set({angle:30}),s&&s.renderAll()})},ae.readAsDataURL(N)}s&&s.renderAll()},ue=()=>{switch(p){case"ICONS":return e.jsx(qr,{apcCanvasInstance:s,theme:t,apiKey:i,isMobile:$,closeMobileModalSecondaryPanel:c=>Q(!c)});case"TEMPLATES":return e.jsx(Hr,{apcCanvasInstance:s,theme:t,apiKey:i,apiEndpoint:x,reloadTabs:c=>q(c),updateActiveSection:c=>ke(c),initCategory:v,currentTabNo:Me,initInstance:a,setActiveTab:c=>ge(c),isMobile:$,closeMobileModalSecondaryPanel:c=>Q(!c)});case"TXT":return e.jsx(Yr,{apcCanvasInstance:s,theme:t,apiKey:i,isMobile:$,closeMobileModalSecondaryPanel:c=>Q(!c)});case"IMAGE":return e.jsx(Xr,{apcCanvasInstance:s,theme:t,apiKey:i,apiEndpoint:x,isMobile:$,closeMobileModalSecondaryPanel:c=>Q(!c)});case"STICKERS":return e.jsx(ds,{apcCanvasInstance:s,theme:t,apiEndpoint:x,isMobile:$,apiKey:i,closeMobileModalSecondaryPanel:c=>Q(!c)});case"SHAPES":return e.jsx(Tt,{apcCanvasInstance:s,theme:t,apiKey:i,isMobile:$,closeMobileModalSecondaryPanel:c=>Q(!c)});case"QUOTE":return e.jsx(Qr,{apcCanvasInstance:s,theme:t,apiKey:i,apiEndpoint:x,isMobile:$,closeMobileModalSecondaryPanel:c=>Q(!c)});case"BACKGROUND":return e.jsx(Zr,{apcCanvasInstance:s,theme:t,apiKey:i,apiEndpoint:x,updateActiveSection:c=>ke(c),reloadTabs:c=>q(c),currentTabNo:Me,isMobile:$,closeMobileModalSecondaryPanel:c=>Q(!c)});case"QRCODE":return e.jsx(es,{apcCanvasInstance:s,theme:t,apiKey:i,apiEndpoint:x,isMobile:$,closeMobileModalSecondaryPanel:c=>Q(!c)});case"BARCODE":return e.jsx(ts,{apcCanvasInstance:s,theme:t,apiKey:i,apiEndpoint:x,isMobile:$,closeMobileModalSecondaryPanel:c=>Q(!c)});case"SIZE":return e.jsx(rs,{apcCanvasInstance:s,theme:t,apiKey:i,isMobile:$,closeMobileModalSecondaryPanel:c=>Q(!c)});default:return e.jsx(Tt,{apcCanvasInstance:s,theme:t,apiKey:i,isMobile:$,closeMobileModalSecondaryPanel:c=>Q(!c)})}},ve=()=>{if(!I)return null;switch(I){case"text":return e.jsx(Mt,{apcCanvasInstance:s,theme:t,apiKey:i});case"textbox":return e.jsx(Mt,{apcCanvasInstance:s,theme:t,apiKey:i});case"rect":return e.jsx(Ye,{apcCanvasInstance:s,theme:t,apiKey:i});case"circle":return e.jsx(Ye,{apcCanvasInstance:s,theme:t,apiKey:i});case"triangle":return e.jsx(Ye,{apcCanvasInstance:s,theme:t,apiKey:i});case"line":return e.jsx(Ye,{apcCanvasInstance:s,theme:t,apiKey:i});case"path":return e.jsx(Ye,{apcCanvasInstance:s,theme:t,apiKey:i});case"polygon":return e.jsx(Ye,{apcCanvasInstance:s,theme:t,apiKey:i});case"image":return B();default:return null}},te=c=>{b(c),$&&Q(!0)},Ge=()=>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:()=>me(),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:zt,fill:"#d8d4d4"})}),e.jsx("div",{className:"apc-mpx-tooltip-text",children:"Delete"})]}),e.jsxs("div",{className:"apc-mpx-tooltip-container",role:"button",onClick:()=>Re(),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"})]})]})}),_e=()=>s?e.jsx("div",{style:{height:"10vh",overflow:"auto"},children:e.jsx(ct,{isOpen:Oe,onClose:()=>Q(!1),children:ue()})}):null,je=()=>s?$?_e():ue():null;return e.jsxs("div",{className:"apc-mpc-widget-wrapper",children:[e.jsxs("div",{style:{display:"flex",backgroundColor:xe(t.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:Br})})," 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&&y.share?e.jsx("div",{children:e.jsx(os,{apcCanvasInstance:s,theme:t})}):null}),e.jsx("div",{children:s&&y.download?e.jsx("div",{children:e.jsx(is,{apcCanvasInstance:s,theme:t,apiKey:i,updateSelectedSections:c=>Ae(c),updateActiveSection:c=>ke(c),accesories,getDesignFormats:G()})}):null}),e.jsx("div",{children:s&&u?e.jsx("div",{children:e.jsx("button",{className:"apc-mpc-widget-btn",onClick:()=>l(G()),style:{backgroundColor:u.btnColor??t.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:[d.indexOf("TXT")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("TXT"),style:{padding:"10px",backgroundColor:p==="TXT"?t.primaryColorLight:"inherit",color:p==="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:p==="TXT"?"#ffffff":t.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:yr})}),e.jsx("div",{children:"Text"})]}):null,d.indexOf("STICKERS")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("STICKERS"),style:{padding:"10px",backgroundColor:p==="STICKERS"?t.primaryColorLight:"inherit",color:p==="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:p==="STICKERS"?"#ffffff":t.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:Lr})}),e.jsx("div",{children:"Stickers"})]}):null,d.indexOf("SHAPES")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("SHAPES"),style:{padding:"10px",backgroundColor:p==="SHAPES"?t.primaryColorLight:"inherit",color:p==="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:p==="SHAPES"?"#ffffff":t.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:jr})}),e.jsx("div",{children:"Shapes"})]}):null,d.indexOf("ICONS")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("ICONS"),style:{padding:"10px",backgroundColor:p==="ICONS"?t.primaryColorLight:"inherit",color:p==="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:p==="ICONS"?"#ffffff":t.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:br})}),e.jsx("div",{children:"Icons"})]}):null,d.indexOf("IMAGE")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("IMAGE"),style:{padding:"10px",backgroundColor:p==="IMAGE"?t.primaryColorLight:"inherit",color:p==="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:p==="IMAGE"?"#ffffff":t.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:Lt})}),e.jsx("div",{children:"Upload"})]}):null,d.indexOf("QUOTE")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("QUOTE"),style:{padding:"10px",backgroundColor:p==="QUOTE"?t.primaryColorLight:"inherit",color:p==="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:p==="QUOTE"?"#ffffff":t.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:wr})}),e.jsx("div",{children:"Quote"})]}):null,d.indexOf("BACKGROUND")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("BACKGROUND"),style:{padding:"10px",backgroundColor:p==="BACKGROUND"?t.primaryColorLight:"inherit",color:p==="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:p==="BACKGROUND"?"#ffffff":t.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:Cr})}),e.jsx("div",{children:"Background"})]}):null,d.indexOf("QRCODE")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("QRCODE"),style:{padding:"10px",backgroundColor:p==="QRCODE"?t.primaryColorLight:"inherit",color:p==="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:p==="QRCODE"?"#ffffff":t.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:Sr})}),e.jsx("div",{children:"QR Code"})]}):null,d.indexOf("BARCODE")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("BARCODE"),style:{padding:"10px",backgroundColor:p==="BARCODE"?t.primaryColorLight:"inherit",color:p==="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:p==="BARCODE"?"#ffffff":t.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:kr})}),e.jsx("div",{children:"Barcode"})]}):null,d.indexOf("SIZE")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("SIZE"),style:{padding:"10px",backgroundColor:p==="SIZE"?t.primaryColorLight:"inherit",color:p==="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:p==="SIZE"?"#ffffff":t.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:Nr})}),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(cs,{theme:t,activeSection:he,selectedObjectType:I,renderQuickActions:Ge,renderActionItems:ve,canvasEl:R,zoomIn:()=>Ze(),zoomOut:()=>et(),apcCanvasInstance:s,setActiveSection:c=>Te(c),updateActiveDesignSection:c=>ke(c),saveActiveDesign:(c,A)=>O(c,A),reloadTabs:Me,activeTabName:Ce,supportedColors:Pe,initProductName:w,historyRef:Ve,currentState:He,setCurrentState:c=>ze(c),isPlainColor:n,selectedProduct:m,isMobile:$})})]}),e.jsx("div",{id:"apc-mpx-editor-modal-root"}),$?_e():null]})}module.exports=hs;
|