var kt=Object.defineProperty;var gt=Object.getOwnPropertySymbols;var vt=Object.prototype.hasOwnProperty,Dt=Object.prototype.propertyIsEnumerable;var ht=(t,e,n)=>e in t?kt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,X=(t,e)=>{for(var n in e||(e={}))vt.call(e,n)&&ht(t,n,e[n]);if(gt)for(var n of gt(e))Dt.call(e,n)&&ht(t,n,e[n]);return t};import{t as Ut,_ as R}from"./plugin-vue_export-helper.8f6f5b47.js";const Ft=Vue.defineComponent({name:"magic-ui-component",props:{config:{type:Object,default:()=>({})}},setup(t){var i;const e=(i=Vue.getCurrentInstance())==null?void 0:i.proxy,n=Vue.inject("app");return Vue.provide("hoc",e),{tagName:Vue.computed(()=>`magic-ui-${Ut(t.config.type)}`),style:Vue.computed(()=>n==null?void 0:n.transformStyle(t.config.style)),display:()=>{var o;const r=(o=t.config)==null?void 0:o.display;return typeof r=="function"?r(n):r!==!1}}}});function zt(t,e,n,i,r,o){return t.display()?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(t.tagName),{key:0,id:t.config.id,class:Vue.normalizeClass(`magic-ui-component${t.config.className?` ${t.config.className}`:""}`),style:Vue.normalizeStyle(t.style),config:t.config},null,8,["id","class","style","config"])):Vue.createCommentVNode("",!0)}var wt=R(Ft,[["render",zt]]),$=t=>{var r,o;const e=Vue.inject("app"),n=(r=e==null?void 0:e.page)==null?void 0:r.getNode(t.config.id),i=(o=Vue.getCurrentInstance())==null?void 0:o.proxy;return n==null||n.emit("created",i),Vue.onMounted(()=>{n==null||n.emit("mounted",i)}),Vue.onUnmounted(()=>{n==null||n.emit("destroy",i)}),e};const Ot=Vue.defineComponent({name:"magic-ui-page",components:{"magic-ui-component":wt},props:{config:{type:Object,default:()=>({})}},setup(t){const e=$(t);return{style:Vue.computed(()=>e==null?void 0:e.transformStyle(t.config.style||{})),refresh(){window.location.reload()}}}}),jt=["id"];function Ht(t,e,n,i,r,o){const s=Vue.resolveComponent("magic-ui-component");return Vue.openBlock(),Vue.createElementBlock("div",{id:`${t.config.id||""}`,class:Vue.normalizeClass(`magic-ui-page${t.config.className?` ${t.config.className}`:""}`),style:Vue.normalizeStyle(t.style)},[Vue.renderSlot(t.$slots,"default"),(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(t.config.items,u=>(Vue.openBlock(),Vue.createBlock(s,{key:u.id,config:u},null,8,["config"]))),128))],14,jt)}var Kt=R(Ot,[["render",Ht]]),Jt=t=>({show:()=>{t.config.style.display="initial"},hide:()=>{t.config.style.display="none"}});const Yt=Vue.defineComponent({name:"magic-ui-container",components:{"magic-ui-component":wt},props:{config:{type:Object,default:()=>({})}},setup(t){const e=$(t);return X({style:Vue.computed(()=>e==null?void 0:e.transformStyle(t.config.style||{})),display:()=>{var i;const n=(i=t.config)==null?void 0:i.display;return typeof n=="function"?n(e):n!==!1}},Jt(t))}}),qt=["id"];function Gt(t,e,n,i,r,o){const s=Vue.resolveComponent("magic-ui-component");return t.display()?(Vue.openBlock(),Vue.createElementBlock("div",{key:0,id:`${t.config.id||""}`,class:Vue.normalizeClass(`magic-ui-container${t.config.className?` ${t.config.className}`:""}`),style:Vue.normalizeStyle(t.style)},[Vue.renderSlot(t.$slots,"default"),(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(t.config.items,u=>(Vue.openBlock(),Vue.createBlock(s,{key:u.id,config:u},null,8,["config"]))),128))],14,qt)):Vue.createCommentVNode("",!0)}var Qt=R(Yt,[["render",Gt]]);const Wt=Vue.defineComponent({name:"magic-ui-button",props:{config:{type:Object,default:()=>({})},model:{type:Object,default:()=>({})}},setup(t){var u;$(t);const e=(u=Vue.getCurrentInstance())==null?void 0:u.proxy,n=Vue.reactive([]),i=Vue.computed(()=>[typeof t.config.preAction=="function"?t.config.preAction:()=>!0,...n,typeof t.config.postAction=="function"?t.config.postAction:()=>!0]);function r(c){n.push(c)}async function o(){for(const c of i.value)if(typeof c=="function"&&await c(e,{model:t.model})===!1)break}const s=Vue.computed(()=>{var c,a,l;return{type:"text",text:((c=t.config)==null?void 0:c.text)||"",disabledText:((a=t.config)==null?void 0:a.disabledText)||"",html:((l=t.config)==null?void 0:l.html)||""}});return{pushAction:r,clickHandler:o,textConfig:s}}});function Zt(t,e,n,i,r,o){const s=Vue.resolveComponent("magic-ui-text");return Vue.openBlock(),Vue.createElementBlock("button",{class:"magic-ui-button",onClick:e[0]||(e[0]=(...u)=>t.clickHandler&&t.clickHandler(...u))},[Vue.renderSlot(t.$slots,"default",{},()=>[Vue.createVNode(s,{config:t.textConfig},null,8,["config"])])])}var Xt=R(Wt,[["render",Zt]]);const xt=Vue.defineComponent({name:"magic-ui-text",props:{config:{type:Object,default:()=>({})},model:{type:Object,default:()=>({})},vars:{type:Object,default:()=>({})}},setup(t){var r;$(t);const e=(r=Vue.getCurrentInstance())==null?void 0:r.proxy,n=Vue.inject("hoc");return{displayText:Vue.computed(()=>{var u,c;let o=((u=t.config)==null?void 0:u.text)||"";const{vars:s}=t;if((n==null?void 0:n.disabled)&&((c=t.config)==null?void 0:c.disabledText)&&(o=t.config.disabledText),typeof o=="function")return o.bind(e)(e,{model:t.model});if(Object.prototype.toString.call(s)==="[object Object]"){let a=o;return Object.entries(s).forEach(([l,C])=>{a=a.replace(new RegExp(`{{${l}}}`,"g"),C)}),a}return o||""})}},render(){var e,n,i,r;const t=(e=this.config)!=null&&e.multiple?"magic-ui-text":"magic-ui-text magic-ui-text--single-line";return typeof((n=this.$slots)==null?void 0:n.default)=="function"?Vue.h("span",{class:t},[((r=(i=this.$slots)==null?void 0:i.default)==null?void 0:r.call(i))||""]):Vue.h("span",X({class:t},this.displayText?{innerHTML:this.displayText}:{}))}}),te=Vue.defineComponent({name:"magic-ui-img",props:{config:{type:Object,default:()=>({})},model:{type:Object,default:()=>({})}},setup(t){return $(t),{clickHandler(){t.config.url&&(window.location.href=t.config.url)}}}}),ee=["src"];function ne(t,e,n,i,r,o){return Vue.openBlock(),Vue.createElementBlock("img",{class:"magic-ui-img",src:t.config.src,onClick:e[0]||(e[0]=(...s)=>t.clickHandler&&t.clickHandler(...s))},null,8,ee)}var oe=R(te,[["render",ne]]),O={},re=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},Ct={},N={};let ut;const ie=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];N.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};N.getSymbolTotalCodewords=function(e){return ie[e]};N.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e};N.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');ut=e};N.isKanjiModeEnabled=function(){return typeof ut!="undefined"};N.toSJIS=function(e){return ut(e)};var q={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+n)}}t.isValid=function(i){return i&&typeof i.bit!="undefined"&&i.bit>=0&&i.bit<4},t.from=function(i,r){if(t.isValid(i))return i;try{return e(i)}catch{return r}}})(q);function Et(){this.buffer=[],this.length=0}Et.prototype={get:function(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let n=0;n>>e-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var se=Et;function j(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}j.prototype.set=function(t,e,n,i){const r=t*this.size+e;this.data[r]=n,i&&(this.reservedBit[r]=!0)};j.prototype.get=function(t,e){return this.data[t*this.size+e]};j.prototype.xor=function(t,e,n){this.data[t*this.size+e]^=n};j.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var ce=j,Bt={};(function(t){const e=N.getSymbolSize;t.getRowColCoords=function(i){if(i===1)return[];const r=Math.floor(i/7)+2,o=e(i),s=o===145?26:Math.ceil((o-13)/(2*r-2))*2,u=[o-7];for(let c=1;c=0&&r<=7},t.from=function(r){return t.isValid(r)?parseInt(r,10):void 0},t.getPenaltyN1=function(r){const o=r.size;let s=0,u=0,c=0,a=null,l=null;for(let C=0;C=5&&(s+=e.N1+(u-5)),a=f,u=1),f=r.get(m,C),f===l?c++:(c>=5&&(s+=e.N1+(c-5)),l=f,c=1)}u>=5&&(s+=e.N1+(u-5)),c>=5&&(s+=e.N1+(c-5))}return s},t.getPenaltyN2=function(r){const o=r.size;let s=0;for(let u=0;u=10&&(u===1488||u===93)&&s++,c=c<<1&2047|r.get(l,a),l>=10&&(c===1488||c===93)&&s++}return s*e.N3},t.getPenaltyN4=function(r){let o=0;const s=r.data.length;for(let c=0;c=0;){const s=o[0];for(let c=0;c0){const o=new Uint8Array(this.degree);return o.set(i,r),o}return i};var ae=at,Vt={},P={},lt={};lt.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var I={};const It="[0-9]+",le="[A-Z $%*+\\-./:]+";let z="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";z=z.replace(/u/g,"\\u");const fe="(?:(?![A-Z0-9 $%*+\\-./:]|"+z+`)(?:.|[\r ]))+`;I.KANJI=new RegExp(z,"g");I.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");I.BYTE=new RegExp(fe,"g");I.NUMERIC=new RegExp(It,"g");I.ALPHANUMERIC=new RegExp(le,"g");const de=new RegExp("^"+z+"$"),ge=new RegExp("^"+It+"$"),he=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");I.testKanji=function(e){return de.test(e)};I.testNumeric=function(e){return ge.test(e)};I.testAlphanumeric=function(e){return he.test(e)};(function(t){const e=lt,n=I;t.NUMERIC={id:"Numeric",bit:1<<0,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:1<<1,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:1<<2,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:1<<3,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(o,s){if(!o.ccBits)throw new Error("Invalid mode: "+o);if(!e.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?o.ccBits[0]:s<27?o.ccBits[1]:o.ccBits[2]},t.getBestModeForData=function(o){return n.testNumeric(o)?t.NUMERIC:n.testAlphanumeric(o)?t.ALPHANUMERIC:n.testKanji(o)?t.KANJI:t.BYTE},t.toString=function(o){if(o&&o.id)return o.id;throw new Error("Invalid mode")},t.isValid=function(o){return o&&o.bit&&o.ccBits};function i(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+r)}}t.from=function(o,s){if(t.isValid(o))return o;try{return i(o)}catch{return s}}})(P);(function(t){const e=N,n=G,i=q,r=P,o=lt,s=1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,u=e.getBCHDigit(s);function c(m,f,y){for(let p=1;p<=40;p++)if(f<=t.getCapacity(p,y,m))return p}function a(m,f){return r.getCharCountIndicator(m,f)+4}function l(m,f){let y=0;return m.forEach(function(p){y+=a(p.mode,f)+p.getBitsLength()}),y}function C(m,f){for(let y=1;y<=40;y++)if(l(m,y)<=t.getCapacity(y,f,r.MIXED))return y}t.from=function(f,y){return o.isValid(f)?parseInt(f,10):y},t.getCapacity=function(f,y,p){if(!o.isValid(f))throw new Error("Invalid QR Code version");typeof p=="undefined"&&(p=r.BYTE);const A=e.getSymbolTotalCodewords(f),h=n.getTotalCodewordsCount(f,y),w=(A-h)*8;if(p===r.MIXED)return w;const g=w-a(p,f);switch(p){case r.NUMERIC:return Math.floor(g/10*3);case r.ALPHANUMERIC:return Math.floor(g/11*2);case r.KANJI:return Math.floor(g/13);case r.BYTE:default:return Math.floor(g/8)}},t.getBestVersionForData=function(f,y){let p;const A=i.from(y,i.M);if(Array.isArray(f)){if(f.length>1)return C(f,A);if(f.length===0)return 1;p=f[0]}else p=f;return c(p.mode,p.getLength(),A)},t.getEncodedBits=function(f){if(!o.isValid(f)||f<7)throw new Error("Invalid QR Code version");let y=f<<12;for(;e.getBCHDigit(y)-u>=0;)y^=s<=0;)r^=Mt<0&&(i=this.data.substr(n),r=parseInt(i,10),e.put(r,o*3+1))};var pe=L;const we=P,x=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function k(t){this.mode=we.ALPHANUMERIC,this.data=t}k.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};k.prototype.getLength=function(){return this.data.length};k.prototype.getBitsLength=function(){return k.getBitsLength(this.data.length)};k.prototype.write=function(e){let n;for(n=0;n+2<=this.data.length;n+=2){let i=x.indexOf(this.data[n])*45;i+=x.indexOf(this.data[n+1]),e.put(i,11)}this.data.length%2&&e.put(x.indexOf(this.data[n]),6)};var Ce=k,Ee=function(e){for(var n=[],i=e.length,r=0;r=55296&&o<=56319&&i>r+1){var s=e.charCodeAt(r+1);s>=56320&&s<=57343&&(o=(o-55296)*1024+s-56320+65536,r+=1)}if(o<128){n.push(o);continue}if(o<2048){n.push(o>>6|192),n.push(o&63|128);continue}if(o<55296||o>=57344&&o<65536){n.push(o>>12|224),n.push(o>>6&63|128),n.push(o&63|128);continue}if(o>=65536&&o<=1114111){n.push(o>>18|240),n.push(o>>12&63|128),n.push(o>>6&63|128),n.push(o&63|128);continue}n.push(239,191,189)}return new Uint8Array(n).buffer};const Be=Ee,be=P;function v(t){this.mode=be.BYTE,this.data=new Uint8Array(Be(t))}v.getBitsLength=function(e){return e*8};v.prototype.getLength=function(){return this.data.length};v.prototype.getBitsLength=function(){return v.getBitsLength(this.data.length)};v.prototype.write=function(t){for(let e=0,n=this.data.length;e=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+` Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),t.put(n,13)}};var Ve=D,Pt={exports:{}};(function(t){var e={single_source_shortest_paths:function(n,i,r){var o={},s={};s[i]=0;var u=e.PriorityQueue.make();u.push(i,0);for(var c,a,l,C,m,f,y,p,A;!u.empty();){c=u.pop(),a=c.value,C=c.cost,m=n[a]||{};for(l in m)m.hasOwnProperty(l)&&(f=m[l],y=C+f,p=s[l],A=typeof s[l]=="undefined",(A||p>y)&&(s[l]=y,u.push(l,y),o[l]=a))}if(typeof r!="undefined"&&typeof s[r]=="undefined"){var h=["Could not find a path from ",i," to ",r,"."].join("");throw new Error(h)}return o},extract_shortest_path_from_predecessor_list:function(n,i){for(var r=[],o=i;o;)r.push(o),o=n[o];return r.reverse(),r},find_path:function(n,i,r){var o=e.single_source_shortest_paths(n,i,r);return e.extract_shortest_path_from_predecessor_list(o,r)},PriorityQueue:{make:function(n){var i=e.PriorityQueue,r={},o;n=n||{};for(o in i)i.hasOwnProperty(o)&&(r[o]=i[o]);return r.queue=[],r.sorter=n.sorter||i.default_sorter,r},default_sorter:function(n,i){return n.cost-i.cost},push:function(n,i){var r={value:n,cost:i};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e})(Pt);(function(t){const e=P,n=pe,i=Ce,r=Ae,o=Ve,s=I,u=N,c=Pt.exports;function a(h){return unescape(encodeURIComponent(h)).length}function l(h,w,g){const d=[];let E;for(;(E=h.exec(g))!==null;)d.push({data:E[0],index:E.index,mode:w,length:E[0].length});return d}function C(h){const w=l(s.NUMERIC,e.NUMERIC,h),g=l(s.ALPHANUMERIC,e.ALPHANUMERIC,h);let d,E;return u.isKanjiModeEnabled()?(d=l(s.BYTE,e.BYTE,h),E=l(s.KANJI,e.KANJI,h)):(d=l(s.BYTE_KANJI,e.BYTE,h),E=[]),w.concat(g,d,E).sort(function(b,T){return b.index-T.index}).map(function(b){return{data:b.data,mode:b.mode,length:b.length}})}function m(h,w){switch(w){case e.NUMERIC:return n.getBitsLength(h);case e.ALPHANUMERIC:return i.getBitsLength(h);case e.KANJI:return o.getBitsLength(h);case e.BYTE:return r.getBitsLength(h)}}function f(h){return h.reduce(function(w,g){const d=w.length-1>=0?w[w.length-1]:null;return d&&d.mode===g.mode?(w[w.length-1].data+=g.data,w):(w.push(g),w)},[])}function y(h){const w=[];for(let g=0;g=0&&u<=6&&(c===0||c===6)||c>=0&&c<=6&&(u===0||u===6)||u>=2&&u<=4&&c>=2&&c<=4?t.set(o+u,s+c,!0,!0):t.set(o+u,s+c,!1,!0))}}function ke(t){const e=t.size;for(let n=8;n>u&1)===1,t.set(r,o,s,!0),t.set(o,r,s,!0)}function nt(t,e,n){const i=t.size,r=Re.getEncodedBits(e,n);let o,s;for(o=0;o<15;o++)s=(r>>o&1)===1,o<6?t.set(o,8,s,!0):o<8?t.set(o+1,8,s,!0):t.set(i-15+o,8,s,!0),o<8?t.set(8,i-o-1,s,!0):o<9?t.set(8,15-o-1+1,s,!0):t.set(8,15-o-1,s,!0);t.set(i-8,8,1,!0)}function Ue(t,e){const n=t.size;let i=-1,r=n-1,o=7,s=0;for(let u=n-1;u>0;u-=2)for(u===6&&u--;;){for(let c=0;c<2;c++)if(!t.isReserved(r,u-c)){let a=!1;s>>o&1)===1),t.set(r,u-c,a),o--,o===-1&&(s++,o=7)}if(r+=i,r<0||n<=r){r-=i,i=-i;break}}}function Fe(t,e,n){const i=new Ie;n.forEach(function(c){i.put(c.mode.bit,4),i.put(c.getLength(),$e.getCharCountIndicator(c.mode,t)),c.write(i)});const r=W.getSymbolTotalCodewords(t),o=st.getTotalCodewordsCount(t,e),s=(r-o)*8;for(i.getLengthInBits()+4<=s&&i.put(0,4);i.getLengthInBits()%8!==0;)i.putBit(0);const u=(s-i.getLengthInBits())/8;for(let c=0;c=7&&De(c,e),Ue(c,s),isNaN(i)&&(i=it.getBestMask(c,nt.bind(null,c,n))),it.applyMask(i,c),nt(c,n,i),{modules:c,version:e,errorCorrectionLevel:n,maskPattern:i,segments:r}}Ct.create=function(e,n){if(typeof e=="undefined"||e==="")throw new Error("No input text");let i=tt.M,r,o;return typeof n!="undefined"&&(i=tt.from(n.errorCorrectionLevel,tt.M),r=Y.from(n.version),o=it.from(n.maskPattern),n.toSJISFunc&&W.setToSJISFunction(n.toSJISFunc)),Oe(e,r,i,o)};var Rt={},ft={};(function(t){function e(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let i=n.slice().replace("#","").split("");if(i.length<3||i.length===5||i.length>8)throw new Error("Invalid hex color: "+n);(i.length===3||i.length===4)&&(i=Array.prototype.concat.apply([],i.map(function(o){return[o,o]}))),i.length===6&&i.push("F","F");const r=parseInt(i.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:r&255,hex:"#"+i.slice(0,6).join("")}}t.getOptions=function(i){i||(i={}),i.color||(i.color={});const r=typeof i.margin=="undefined"||i.margin===null||i.margin<0?4:i.margin,o=i.width&&i.width>=21?i.width:void 0,s=i.scale||4;return{width:o,scale:o?4:s,margin:r,color:{dark:e(i.color.dark||"#000000ff"),light:e(i.color.light||"#ffffffff")},type:i.type,rendererOpts:i.rendererOpts||{}}},t.getScale=function(i,r){return r.width&&r.width>=i+r.margin*2?r.width/(i+r.margin*2):r.scale},t.getImageWidth=function(i,r){const o=t.getScale(i,r);return Math.floor((i+r.margin*2)*o)},t.qrToImageData=function(i,r,o){const s=r.modules.size,u=r.modules.data,c=t.getScale(s,o),a=Math.floor((s+o.margin*2)*c),l=o.margin*c,C=[o.color.light,o.color.dark];for(let m=0;m=l&&f>=l&&m0&&c>0&&t[u-1]||(i+=o?ot("M",c+n,.5+a+n):ot("m",r,0),r=0,o=!1),c+1':"",a="',l='viewBox="0 0 '+u+" "+u+'"',C=r.width?'width="'+r.width+'" height="'+r.width+'" ':"",m=''+c+a+` `;return typeof i=="function"&&i(null,m),m};const Ke=re,ct=Ct,Lt=Rt,Je=$t;function dt(t,e,n,i,r){const o=[].slice.call(arguments,1),s=o.length,u=typeof o[s-1]=="function";if(!u&&!Ke())throw new Error("Callback required as last argument");if(u){if(s<2)throw new Error("Too few arguments provided");s===2?(r=n,n=e,e=i=void 0):s===3&&(e.getContext&&typeof r=="undefined"?(r=i,i=void 0):(r=i,i=n,n=e,e=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(n=e,e=i=void 0):s===2&&!e.getContext&&(i=n,n=e,e=void 0),new Promise(function(c,a){try{const l=ct.create(n,i);c(t(l,e,i))}catch(l){a(l)}})}try{const c=ct.create(n,i);r(null,t(c,e,i))}catch(c){r(c)}}O.create=ct.create;O.toCanvas=dt.bind(null,Lt.render);O.toDataURL=dt.bind(null,Lt.renderToDataURL);O.toString=dt.bind(null,function(t,e,n){return Je.render(t,n)});const Ye=Vue.defineComponent({name:"magic-ui-qrcode",props:{config:{type:Object,default:()=>({})},model:{type:Object,default:()=>({})}},setup(t){$(t);const e=Vue.ref();return Vue.watch(()=>t.config.url,(n="")=>{O.toDataURL(n,(i,r)=>{i&&console.error(i),e.value=r})},{immediate:!0}),{imgUrl:e}}}),qe=["src"];function Ge(t,e,n,i,r,o){return Vue.openBlock(),Vue.createElementBlock("img",{class:"magic-ui-qrcode",src:t.imgUrl},null,8,qe)}var Qe=R(Ye,[["render",Ge]]);const We=Vue.defineComponent({name:"magic-ui-overlay",props:{config:{type:Object,default:()=>({})},model:{type:Object,default:()=>({})}},setup(t){var s;const e=Vue.ref(!1),n=$(t),i=(s=n==null?void 0:n.page)==null?void 0:s.getNode(t.config.id),r=()=>{e.value=!0,n&&n.emit("overlay:open",i)},o=()=>{e.value=!1,n&&n.emit("overlay:close",i)};return n==null||n.on("editor:select",(u,c)=>{c.find(a=>a.id===t.config.id)?r():o()}),{visible:e,openOverlay:r,closeOverlay:o}}});function Ze(t,e,n,i,r,o){const s=Vue.resolveComponent("magic-ui-container");return t.visible?(Vue.openBlock(),Vue.createBlock(s,{key:0,class:"magic-ui-overlay",config:{items:t.config.items}},{default:Vue.withCtx(()=>[Vue.renderSlot(t.$slots,"default")]),_:3},8,["config"])):Vue.createCommentVNode("",!0)}var Xe=R(We,[["render",Ze]]);const xe={page:Kt,container:Qt,button:Xt,text:xt,img:oe,qrcode:Qe,overlay:Xe},tn={},en={components:xe,plugins:tn};window.magicPresetComponents=en;export{en as default}; //# sourceMappingURL=comp-entry.4b446d21.js.map