@sv-print/plugin-api-image 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # @sv-print/plugin-api-image
2
+
3
+ 给 sv-print 提供导出图片的 API 插件。
4
+
5
+ ## 安装
6
+
7
+ ```bash
8
+ npm install @sv-print/plugin-api-image
9
+ ```
10
+
11
+ ## 使用
12
+
13
+ sv-print 插件引入的两种方式见:[sv-print 插件引入的两种方式:https://www.ibujian.cn/svp/plugin/a02.html](https://www.ibujian.cn/svp/plugin/a02.html)
14
+
15
+ ```js
16
+ import pluginEleBwip from "@sv-print/plugin-ele-bwip-js";
17
+ const plugins = [pluginEleBwip({})];
18
+ ```
19
+
20
+ ## License
21
+
22
+ LGPL
23
+
24
+ ### 开源使用须知
25
+
26
+ 1.请自觉遵守 LGPL 协议,其他用途可联系作者;
27
+
28
+ 2.允许用于个人学习、毕业设计、教学案例、公益事业、商业使用;
29
+
30
+ 3.如果商用必须保留版权信息,请自觉遵守;
31
+
32
+ 4.禁止将本开源的代码和资源进行任何形式任何名义的出售,否则产生的一切任何后果责任由侵权者自负;
33
+
34
+ 5.商用请仔细审查代码和漏洞,不得用于任一国家许可范围之外的商业应用,产生的一切任何后果责任自负;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var E=(c,x,e)=>new Promise((a,s)=>{var h=i=>{try{v(e.next(i))}catch(p){s(p)}},b=i=>{try{v(e.throw(i))}catch(p){s(p)}},v=i=>i.done?a(i.value):Promise.resolve(i.value).then(h,b);v((e=e.apply(c,x)).next())});const J=require("html-to-image");function L(c){if(c&&c.__esModule)return c;const x=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const e in c)if(e!=="default"){const a=Object.getOwnPropertyDescriptor(c,e);Object.defineProperty(x,e,a.get?a:{enumerable:!0,get:()=>c[e]})}}return x.default=c,Object.freeze(x)}const N=L(J);(function(c,x){const e=P,a=c();for(;[];)try{if(parseInt(e(256))/1*(-parseInt(e(251))/2)+parseInt(e(202))/3+-parseInt(e(240))/4*(-parseInt(e(262))/5)+-parseInt(e(249))/6+-parseInt(e(257))/7*(parseInt(e(265))/8)+parseInt(e(214))/9+parseInt(e(209))/10*(-parseInt(e(266))/11)===x)break;a.push(a.shift())}catch(s){a.push(a.shift())}})(O,895242);function P(c,x){const e=O();return P=function(a,s){return a=a-198,e[a]},P(c,x)}function O(){const c=["devicePixelRatio","pop","none","add","download.jpg","clear","hinnn","loadAllImages","gif","blob","getHtml","bmp","drawImage","getContext","width","png","log","end","toType","2140296JIAPBS","limit","svg","appendChild","start",".jpg","run","80HKLNvz","clearRect","toBlob","floor","toLowerCase","14153616tpUZDS","css","then","base64","isDownload","extend","promise","onProgress","indexOf","createElement",".hiprint-printPanel .hiprint-printPaper","printPanels","resolve","cur","queue","removeTempContainer","length","push","html","height","name","webp","onload","quality","#fff","baseURI","4mSGYjc","IMG","toCanvas","createTempContainer","canvas","svg2canvas","ceil","replace","imageSmoothingEnabled","3318840FwheCH","toDataURL","2enrpHW","display","http","tagName","remove","221627spbDRI","238pIEAXC","jpeg","includes","click","pixelRatio","2667735awVlxc","total","src","199624IHMSBy","414139JwxQRn","type","image/jpeg","url","toImage \u5931\u8D25(\u53EF\u80FD\u60A8\u7684\u56FE\u7247\u8D44\u6E90\u65E0\u6CD5\u6B63\u5E38\u52A0\u8F7D): "];return O=function(){return c},O()}const Q=function(c,x){return E(this,null,function*(){const e=P;let a=this,s=globalThis.$.Deferred(),h=!![],b=10,v=(i,p)=>{const f=P,T=Math[f(212)](i/p*100);console[f(199)](f(227),i,f(263),p),console[f(199)]("toImage percent: ",T+"%")};if(this[e(225)][e(230)]){let i=globalThis.$[e(219)]({filter:t=>{const n=e;return t[n(254)]!=n(241)||t[n(254)]=="IMG"&&(["jpg",n(258),n(198),n(279),n(282),n(235),n(204)][n(259)](t[n(264)].split(".")[n(272)]()[n(213)]())||t[n(264)]!=t.baseURI||t[n(264)][n(222)](n(253))>-1&&t.src!=t[n(239)]||t[n(264)][n(222)](n(217))>-1)},backgroundColor:e(238)},x||{}),p=yield this[e(281)](c,x);x&&x[e(218)]!=null&&(h=x[e(218)]),x&&x.onProgress!=null&&(v=x[e(221)]),x&&x[e(203)]!=null&&(b=x[e(203)]),globalThis.$(p)[e(215)]("width","")[e(215)](e(233),""),this[e(243)]();let f=this.getTempContainer();this[e(245)](p,i),f[e(232)](p[0]);let T=f.find(e(224))[e(230)];globalThis.$(p)[e(215)]("position:fixed"),this[e(278)](p,function(){const t=e;try{let n=[],H=Math[t(246)](T/b),$=T%b||1;const u=document[t(223)](t(244)),S=u[t(284)]("2d"),U=f.width()*(i[t(261)]||globalThis[t(271)]);for(let w=0;w<H;w++){S[t(210)](0,0,u.width,u.height);const C=w==H-1;let q=0,D=C?$:b;for(let g=0;g<D;g++){S.clearRect(0,0,u[t(285)],u[t(233)]);const r=w*b+g,y=f.find(t(224))[r];globalThis[t(277)][t(228)][t(274)](function(R){const _=t;N[_(242)](y,i)[_(216)](function(m){const l=_;let I=m[l(284)]("2d");I[l(248)]=![];let j=m[l(250)](l(268),i.quality||.92),o=new Image;o[l(264)]=j,o[l(236)]=function(){const d=l;g===0&&(u[d(285)]=U,u[d(233)]=o[d(233)]*D),q+=o.height,S[d(283)](o,0,q-o[d(233)],U,o[d(233)]),v(r+1,T),R()}})})}globalThis.hinnn[t(228)][t(274)](function(g){const r=t;let y=i[r(267)]||r(268),R=i[r(201)]||r(269),_=i[r(237)]||.8;if(h){let m=u[r(250)](y,_),l=new Image;l[r(264)]=m,l[r(236)]=function(){const I=r;n[I(231)]({url:m,start:w*b+1,end:w*b+D}),C&&(globalThis[I(277)][I(228)][I(276)](),a.removeTempContainer(),n.forEach(j=>{const o=I;let d=document[o(223)]("a"),A=x[o(234)]||o(275);A[o(222)](".")==-1&&(A+=o(207));let G=A.split(".").pop(),B=A[o(247)]("."+G,"")+"_"+j[o(206)]+"-"+j[o(200)]+"."+G;d.style[o(252)]=o(273),d.setAttribute("download",B),d.setAttribute("href",j[o(269)]),document.body[o(205)](d),d[o(260)](),d[o(255)]()})),g()};return}if(R=="url"){n.push(u[r(250)](y,_)),C&&(globalThis[r(277)][r(228)].clear(),a[r(229)](),s[r(226)](n)),g();return}R==r(280)&&u[r(211)](function(m){const l=r;n.push(m),C&&(globalThis.hinnn[l(228)].clear(),a[l(229)](),s[l(226)](n)),g()},y,_)})}globalThis[t(277)][t(228)][t(208)]()}catch(n){console.error(t(270)),console[t(199)](n)}})}return s[e(220)]()})};function k(){var c=["defineProperty","154908jgjsRx","27WstqnP","newPrintTemplate","363625tshdTi","add toImage Api","9gphsIY","1161755vwfrIX","1449328biOYGf","2199246sJUgcZ","167046aGRQjC","toImage","add toImage Api to PrintTemplate","45538AUpZQg"];return k=function(){return c},k()}(function(c,x){for(var e=M,a=c();[];)try{var s=-parseInt(e(415))/1+-parseInt(e(410))/2*(parseInt(e(417))/3)+parseInt(e(412))/4+-parseInt(e(404))/5+-parseInt(e(407))/6+parseInt(e(406))/7+-parseInt(e(405))/8*(-parseInt(e(413))/9);if(s===x)break;a.push(a.shift())}catch(h){a.push(a.shift())}})(k,204279);function M(c,x){var e=k();return M=function(a,s){a=a-404;var h=e[a];return h},M(c,x)}function Y(c){var x=M;return{name:"add toImage Api",description:x(416),hooks:[{hook:x(414),name:x(409),description:x(409),priority:1,run:({template:e,options:a})=>{var s=x;Object[s(411)](e,s(408),{value:Q,enumerable:![],writable:!![],configurable:!![]})}}],leastHiprintVersion:"0.3.0"}}module.exports=Y;
1
+ "use strict";var W=(r,t,e)=>new Promise((a,l)=>{var h=c=>{try{I(e.next(c))}catch(b){l(b)}},u=c=>{try{I(e.throw(c))}catch(b){l(b)}},I=c=>c.done?a(c.value):Promise.resolve(c.value).then(h,u);I((e=e.apply(r,t)).next())});const E=require("html-to-image");function F(r){if(r&&r.__esModule)return r;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const a=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(t,e,a.get?a:{enumerable:!0,get:()=>r[e]})}}return t.default=r,Object.freeze(t)}const L=F(E);(function(r,t){const e=j,a=r();for(;[];)try{if(parseInt(e(289))/1+-parseInt(e(367))/2+parseInt(e(324))/3*(parseInt(e(316))/4)+-parseInt(e(306))/5+parseInt(e(325))/6*(parseInt(e(336))/7)+parseInt(e(344))/8*(parseInt(e(334))/9)+-parseInt(e(308))/10*(-parseInt(e(286))/11)===t)break;a.push(a.shift())}catch(l){a.push(a.shift())}})(M,710956);function M(){const r=["toDataURL","height","baseURI","find","position:fixed","display","download.jpg","loadAllImages","indexOf","length","jpg","remove",".jpg","start","removeTempContainer","log","pixelRatio","add","698464IYwzVZ","resolve","devicePixelRatio","queue","quality","push","imageSmoothingEnabled","run","tagName","image/jpeg","onProgress","toImage percent: ","getHtml","1738qOahFf","toType","floor","451297HqroPf","forEach","includes","svg","getContext","clear","png","getTempContainer","name","jpeg","css","src","IMG","end",".hiprint-printPanel .hiprint-printPaper","style","width","5644560azgNiN","createElement","5920pDYpGT","toImage \u5931\u8D25(\u53EF\u80FD\u60A8\u7684\u56FE\u7247\u8D44\u6E90\u65E0\u6CD5\u6B63\u5E38\u52A0\u8F7D): ","body","appendChild","then","drawImage","onload","hinnn","1052056OdLMHP","url","replace","cur","limit","#fff","isDownload","download","6hwSYbH","6XXeNZP","clearRect","gif","canvas","printPanels","base64","split","promise","none","9xKBDjH","extend","3945767IekuVg","ceil","click","http","toLowerCase","pop","toCanvas","blob","4436464MMWMcf","href","setAttribute","total","bmp"];return M=function(){return r},M()}function j(r,t){const e=M();return j=function(a,l){return a=a-277,e[a]},j(r,t)}const U=function(r,t){return W(this,null,function*(){const e=j;let a=this,l=globalThis.$.Deferred(),h=!![],u=10,I=(c,b)=>{const p=j,T=Math[p(288)](c/b*100);console[p(364)](p(319),c,p(347),b),console[p(364)](p(284),T+"%")};if(this[e(329)].length){let c=globalThis.$[e(335)]({filter:x=>{const n=e;return x.tagName!=n(301)||x[n(281)]==n(301)&&([n(359),n(298),n(295),n(327),n(348),"webp",n(292)][n(291)](x[n(300)].split(".")[n(341)]()[n(340)]())||x[n(300)]!=x.baseURI||x.src[n(357)](n(339))>-1&&x[n(300)]!=x[n(351)]||x[n(300)][n(357)](n(330))>-1)},backgroundColor:e(321)},t||{}),b=yield this[e(285)](r,t);t&&t[e(322)]!=null&&(h=t.isDownload),t&&t[e(283)]!=null&&(I=t.onProgress),t&&t[e(320)]!=null&&(u=t.limit),globalThis.$(b)[e(299)]("width","")[e(299)](e(350),""),this.createTempContainer();let p=this[e(296)]();this.svg2canvas(b,c),p.html(b[0]);let T=p[e(352)](e(303))[e(358)];globalThis.$(b)[e(299)](e(353)),this[e(356)](b,function(){const x=e;try{let n=[],R=Math[x(337)](T/u),X=T%u||1;const f=document[x(307)](x(328)),C=f[x(293)]("2d"),H=p.width()*(c[x(365)]||globalThis[x(369)]);for(let v=0;v<R;v++){C[x(326)](0,0,f[x(305)],f[x(350)]);const O=v==R-1;let G=0,D=O?X:u;for(let g=0;g<D;g++){C[x(326)](0,0,f[x(305)],f.height);const i=v*u+g,y=p[x(352)](x(303))[i];globalThis[x(315)][x(370)].add(function(k){const _=x;L[_(342)](y,c)[_(312)](function(m){const s=_;let w=m[s(293)]("2d");w[s(279)]=![];let P=m.toDataURL(s(282),c[s(277)]||.92),o=new Image;o[s(300)]=P,o[s(314)]=function(){const d=s;g===0&&(f[d(305)]=H,f.height=o[d(350)]*D),G+=o[d(350)],C[d(313)](o,0,G-o[d(350)],H,o[d(350)]),I(i+1,T),k()}})})}globalThis[x(315)].queue[x(366)](function(g){const i=x;let y=c.type||i(282),k=c[i(287)]||"url",_=c.quality||.8;if(h){let m=f[i(349)](y,_),s=new Image;s[i(300)]=m,s[i(314)]=function(){const w=i;n.push({url:m,start:v*u+1,end:v*u+D}),O&&(globalThis.hinnn[w(370)].clear(),a[w(363)](),n[w(290)](P=>{const o=w;let d=document.createElement("a"),q=t[o(297)]||o(355);q.indexOf(".")==-1&&(q+=o(361));let S=q[o(331)](".")[o(341)](),Y=q[o(318)]("."+S,"")+"_"+P[o(362)]+"-"+P[o(302)]+"."+S;d[o(304)][o(354)]=o(333),d.setAttribute(o(323),Y),d[o(346)](o(345),P[o(317)]),document[o(310)][o(311)](d),d[o(338)](),d[o(360)]()})),g()};return}if(k==i(317)){n.push(f[i(349)](y,_)),O&&(globalThis[i(315)][i(370)][i(294)](),a[i(363)](),l[i(368)](n)),g();return}k==i(343)&&f.toBlob(function(m){const s=i;n[s(278)](m),O&&(globalThis[s(315)][s(370)].clear(),a[s(363)](),l[s(368)](n)),g()},y,_)})}globalThis[x(315)].queue[x(280)]()}catch(n){console.error(x(309)),console[x(364)](n)}})}return l[e(332)]()})};function N(r,t){var e=A();return N=function(a,l){a=a-132;var h=e[a];return h},N(r,t)}(function(r,t){for(var e=N,a=r();[];)try{var l=parseInt(e(141))/1+-parseInt(e(142))/2*(parseInt(e(144))/3)+-parseInt(e(143))/4*(-parseInt(e(139))/5)+-parseInt(e(138))/6+-parseInt(e(136))/7+-parseInt(e(134))/8*(-parseInt(e(132))/9)+parseInt(e(137))/10;if(l===t)break;a.push(a.shift())}catch(h){a.push(a.shift())}})(A,429921);function Z(r){var t=N;return{name:"add toImage Api",description:"add toImage Api",hooks:[{hook:t(140),name:t(135),description:t(135),priority:1,run:({template:e,options:a})=>{var l=t;Object.defineProperty(e,l(133),{value:U,enumerable:![],writable:!![],configurable:!![]})}}],leastHiprintVersion:"0.3.0"}}function A(){var r=["add toImage Api to PrintTemplate","53613RFXdgt","2654180GiWpZa","899760buZBGF","42740jYPwWY","newPrintTemplate","243290IFIGAk","765172hmfXSH","196NPJNIG","6qNKtTX","72dAWOWk","toImage","425152nOqmtJ"];return A=function(){return r},A()}module.exports=Z;
package/dist/index.mjs CHANGED
@@ -1,153 +1,153 @@
1
- var $ = (i, n, x) => new Promise((a, s) => {
2
- var b = (r) => {
1
+ var X = (c, n, x) => new Promise((o, l) => {
2
+ var h = (r) => {
3
3
  try {
4
- v(x.next(r));
4
+ I(x.next(r));
5
5
  } catch (p) {
6
- s(p);
6
+ l(p);
7
7
  }
8
8
  }, u = (r) => {
9
9
  try {
10
- v(x.throw(r));
10
+ I(x.throw(r));
11
11
  } catch (p) {
12
- s(p);
12
+ l(p);
13
13
  }
14
- }, v = (r) => r.done ? a(r.value) : Promise.resolve(r.value).then(b, u);
15
- v((x = x.apply(i, n)).next());
14
+ }, I = (r) => r.done ? o(r.value) : Promise.resolve(r.value).then(h, u);
15
+ I((x = x.apply(c, n)).next());
16
16
  });
17
- import * as L from "html-to-image";
18
- (function(i, n) {
19
- const x = P, a = i();
17
+ import * as F from "html-to-image";
18
+ (function(c, n) {
19
+ const x = k, o = c();
20
20
  for (; []; )
21
21
  try {
22
- if (parseInt(x(256)) / 1 * (-parseInt(x(251)) / 2) + parseInt(x(202)) / 3 + -parseInt(x(240)) / 4 * (-parseInt(x(262)) / 5) + -parseInt(x(249)) / 6 + -parseInt(x(257)) / 7 * (parseInt(x(265)) / 8) + parseInt(x(214)) / 9 + parseInt(x(209)) / 10 * (-parseInt(x(266)) / 11) === n)
22
+ if (parseInt(x(289)) / 1 + -parseInt(x(367)) / 2 + parseInt(x(324)) / 3 * (parseInt(x(316)) / 4) + -parseInt(x(306)) / 5 + parseInt(x(325)) / 6 * (parseInt(x(336)) / 7) + parseInt(x(344)) / 8 * (parseInt(x(334)) / 9) + -parseInt(x(308)) / 10 * (-parseInt(x(286)) / 11) === n)
23
23
  break;
24
- a.push(a.shift());
25
- } catch (s) {
26
- a.push(a.shift());
24
+ o.push(o.shift());
25
+ } catch (l) {
26
+ o.push(o.shift());
27
27
  }
28
- })(k, 895242);
29
- function P(i, n) {
30
- const x = k();
31
- return P = function(a, s) {
32
- return a = a - 198, x[a];
33
- }, P(i, n);
28
+ })(C, 710956);
29
+ function C() {
30
+ const c = ["toDataURL", "height", "baseURI", "find", "position:fixed", "display", "download.jpg", "loadAllImages", "indexOf", "length", "jpg", "remove", ".jpg", "start", "removeTempContainer", "log", "pixelRatio", "add", "698464IYwzVZ", "resolve", "devicePixelRatio", "queue", "quality", "push", "imageSmoothingEnabled", "run", "tagName", "image/jpeg", "onProgress", "toImage percent: ", "getHtml", "1738qOahFf", "toType", "floor", "451297HqroPf", "forEach", "includes", "svg", "getContext", "clear", "png", "getTempContainer", "name", "jpeg", "css", "src", "IMG", "end", ".hiprint-printPanel .hiprint-printPaper", "style", "width", "5644560azgNiN", "createElement", "5920pDYpGT", "toImage \u5931\u8D25(\u53EF\u80FD\u60A8\u7684\u56FE\u7247\u8D44\u6E90\u65E0\u6CD5\u6B63\u5E38\u52A0\u8F7D): ", "body", "appendChild", "then", "drawImage", "onload", "hinnn", "1052056OdLMHP", "url", "replace", "cur", "limit", "#fff", "isDownload", "download", "6hwSYbH", "6XXeNZP", "clearRect", "gif", "canvas", "printPanels", "base64", "split", "promise", "none", "9xKBDjH", "extend", "3945767IekuVg", "ceil", "click", "http", "toLowerCase", "pop", "toCanvas", "blob", "4436464MMWMcf", "href", "setAttribute", "total", "bmp"];
31
+ return C = function() {
32
+ return c;
33
+ }, C();
34
34
  }
35
- function k() {
36
- const i = ["devicePixelRatio", "pop", "none", "add", "download.jpg", "clear", "hinnn", "loadAllImages", "gif", "blob", "getHtml", "bmp", "drawImage", "getContext", "width", "png", "log", "end", "toType", "2140296JIAPBS", "limit", "svg", "appendChild", "start", ".jpg", "run", "80HKLNvz", "clearRect", "toBlob", "floor", "toLowerCase", "14153616tpUZDS", "css", "then", "base64", "isDownload", "extend", "promise", "onProgress", "indexOf", "createElement", ".hiprint-printPanel .hiprint-printPaper", "printPanels", "resolve", "cur", "queue", "removeTempContainer", "length", "push", "html", "height", "name", "webp", "onload", "quality", "#fff", "baseURI", "4mSGYjc", "IMG", "toCanvas", "createTempContainer", "canvas", "svg2canvas", "ceil", "replace", "imageSmoothingEnabled", "3318840FwheCH", "toDataURL", "2enrpHW", "display", "http", "tagName", "remove", "221627spbDRI", "238pIEAXC", "jpeg", "includes", "click", "pixelRatio", "2667735awVlxc", "total", "src", "199624IHMSBy", "414139JwxQRn", "type", "image/jpeg", "url", "toImage \u5931\u8D25(\u53EF\u80FD\u60A8\u7684\u56FE\u7247\u8D44\u6E90\u65E0\u6CD5\u6B63\u5E38\u52A0\u8F7D): "];
37
- return k = function() {
38
- return i;
39
- }, k();
35
+ function k(c, n) {
36
+ const x = C();
37
+ return k = function(o, l) {
38
+ return o = o - 277, x[o];
39
+ }, k(c, n);
40
40
  }
41
- const O = function(i, n) {
42
- return $(this, null, function* () {
43
- const x = P;
44
- let a = this, s = globalThis.$.Deferred(), b = !![], u = 10, v = (r, p) => {
45
- const f = P, T = Math[f(212)](r / p * 100);
46
- console[f(199)](f(227), r, f(263), p), console[f(199)]("toImage percent: ", T + "%");
41
+ const L = function(c, n) {
42
+ return X(this, null, function* () {
43
+ const x = k;
44
+ let o = this, l = globalThis.$.Deferred(), h = !![], u = 10, I = (r, p) => {
45
+ const b = k, T = Math[b(288)](r / p * 100);
46
+ console[b(364)](b(319), r, b(347), p), console[b(364)](b(284), T + "%");
47
47
  };
48
- if (this[x(225)][x(230)]) {
49
- let r = globalThis.$[x(219)]({ filter: (e) => {
48
+ if (this[x(329)].length) {
49
+ let r = globalThis.$[x(335)]({ filter: (e) => {
50
50
  const t = x;
51
- return e[t(254)] != t(241) || e[t(254)] == "IMG" && (["jpg", t(258), t(198), t(279), t(282), t(235), t(204)][t(259)](e[t(264)].split(".")[t(272)]()[t(213)]()) || e[t(264)] != e.baseURI || e[t(264)][t(222)](t(253)) > -1 && e.src != e[t(239)] || e[t(264)][t(222)](t(217)) > -1);
52
- }, backgroundColor: x(238) }, n || {}), p = yield this[x(281)](i, n);
53
- n && n[x(218)] != null && (b = n[x(218)]), n && n.onProgress != null && (v = n[x(221)]), n && n[x(203)] != null && (u = n[x(203)]), globalThis.$(p)[x(215)]("width", "")[x(215)](x(233), ""), this[x(243)]();
54
- let f = this.getTempContainer();
55
- this[x(245)](p, r), f[x(232)](p[0]);
56
- let T = f.find(x(224))[x(230)];
57
- globalThis.$(p)[x(215)]("position:fixed"), this[x(278)](p, function() {
51
+ return e.tagName != t(301) || e[t(281)] == t(301) && ([t(359), t(298), t(295), t(327), t(348), "webp", t(292)][t(291)](e[t(300)].split(".")[t(341)]()[t(340)]()) || e[t(300)] != e.baseURI || e.src[t(357)](t(339)) > -1 && e[t(300)] != e[t(351)] || e[t(300)][t(357)](t(330)) > -1);
52
+ }, backgroundColor: x(321) }, n || {}), p = yield this[x(285)](c, n);
53
+ n && n[x(322)] != null && (h = n.isDownload), n && n[x(283)] != null && (I = n.onProgress), n && n[x(320)] != null && (u = n.limit), globalThis.$(p)[x(299)]("width", "")[x(299)](x(350), ""), this.createTempContainer();
54
+ let b = this[x(296)]();
55
+ this.svg2canvas(p, r), b.html(p[0]);
56
+ let T = b[x(352)](x(303))[x(358)];
57
+ globalThis.$(p)[x(299)](x(353)), this[x(356)](p, function() {
58
58
  const e = x;
59
59
  try {
60
- let t = [], M = Math[e(246)](T / u), B = T % u || 1;
61
- const h = document[e(223)](e(244)), D = h[e(284)]("2d"), S = f.width() * (r[e(261)] || globalThis[e(271)]);
62
- for (let w = 0; w < M; w++) {
63
- D[e(210)](0, 0, h.width, h.height);
64
- const R = w == M - 1;
65
- let q = 0, G = R ? B : u;
66
- for (let g = 0; g < G; g++) {
67
- D.clearRect(0, 0, h[e(285)], h[e(233)]);
68
- const c = w * u + g, y = f.find(e(224))[c];
69
- globalThis[e(277)][e(228)][e(274)](function(j) {
60
+ let t = [], M = Math[e(337)](T / u), Y = T % u || 1;
61
+ const f = document[e(307)](e(328)), D = f[e(293)]("2d"), O = b.width() * (r[e(365)] || globalThis[e(369)]);
62
+ for (let v = 0; v < M; v++) {
63
+ D[e(326)](0, 0, f[e(305)], f[e(350)]);
64
+ const q = v == M - 1;
65
+ let G = 0, H = q ? Y : u;
66
+ for (let g = 0; g < H; g++) {
67
+ D[e(326)](0, 0, f[e(305)], f.height);
68
+ const i = v * u + g, P = b[e(352)](e(303))[i];
69
+ globalThis[e(315)][e(370)].add(function(j) {
70
70
  const _ = e;
71
- L[_(242)](y, r)[_(216)](function(m) {
72
- const d = _;
73
- let I = m[d(284)]("2d");
74
- I[d(248)] = ![];
75
- let C = m[d(250)](d(268), r.quality || 0.92), o = new Image();
76
- o[d(264)] = C, o[d(236)] = function() {
77
- const l = d;
78
- g === 0 && (h[l(285)] = S, h[l(233)] = o[l(233)] * G), q += o.height, D[l(283)](o, 0, q - o[l(233)], S, o[l(233)]), v(c + 1, T), j();
71
+ F[_(342)](P, r)[_(312)](function(m) {
72
+ const s = _;
73
+ let w = m[s(293)]("2d");
74
+ w[s(279)] = ![];
75
+ let y = m.toDataURL(s(282), r[s(277)] || 0.92), a = new Image();
76
+ a[s(300)] = y, a[s(314)] = function() {
77
+ const d = s;
78
+ g === 0 && (f[d(305)] = O, f.height = a[d(350)] * H), G += a[d(350)], D[d(313)](a, 0, G - a[d(350)], O, a[d(350)]), I(i + 1, T), j();
79
79
  };
80
80
  });
81
81
  });
82
82
  }
83
- globalThis.hinnn[e(228)][e(274)](function(g) {
84
- const c = e;
85
- let y = r[c(267)] || c(268), j = r[c(201)] || c(269), _ = r[c(237)] || 0.8;
86
- if (b) {
87
- let m = h[c(250)](y, _), d = new Image();
88
- d[c(264)] = m, d[c(236)] = function() {
89
- const I = c;
90
- t[I(231)]({ url: m, start: w * u + 1, end: w * u + G }), R && (globalThis[I(277)][I(228)][I(276)](), a.removeTempContainer(), t.forEach((C) => {
91
- const o = I;
92
- let l = document[o(223)]("a"), A = n[o(234)] || o(275);
93
- A[o(222)](".") == -1 && (A += o(207));
94
- let E = A.split(".").pop(), J = A[o(247)]("." + E, "") + "_" + C[o(206)] + "-" + C[o(200)] + "." + E;
95
- l.style[o(252)] = o(273), l.setAttribute("download", J), l.setAttribute("href", C[o(269)]), document.body[o(205)](l), l[o(260)](), l[o(255)]();
83
+ globalThis[e(315)].queue[e(366)](function(g) {
84
+ const i = e;
85
+ let P = r.type || i(282), j = r[i(287)] || "url", _ = r.quality || 0.8;
86
+ if (h) {
87
+ let m = f[i(349)](P, _), s = new Image();
88
+ s[i(300)] = m, s[i(314)] = function() {
89
+ const w = i;
90
+ t.push({ url: m, start: v * u + 1, end: v * u + H }), q && (globalThis.hinnn[w(370)].clear(), o[w(363)](), t[w(290)]((y) => {
91
+ const a = w;
92
+ let d = document.createElement("a"), A = n[a(297)] || a(355);
93
+ A.indexOf(".") == -1 && (A += a(361));
94
+ let W = A[a(331)](".")[a(341)](), E = A[a(318)]("." + W, "") + "_" + y[a(362)] + "-" + y[a(302)] + "." + W;
95
+ d[a(304)][a(354)] = a(333), d.setAttribute(a(323), E), d[a(346)](a(345), y[a(317)]), document[a(310)][a(311)](d), d[a(338)](), d[a(360)]();
96
96
  })), g();
97
97
  };
98
98
  return;
99
99
  }
100
- if (j == "url") {
101
- t.push(h[c(250)](y, _)), R && (globalThis[c(277)][c(228)].clear(), a[c(229)](), s[c(226)](t)), g();
100
+ if (j == i(317)) {
101
+ t.push(f[i(349)](P, _)), q && (globalThis[i(315)][i(370)][i(294)](), o[i(363)](), l[i(368)](t)), g();
102
102
  return;
103
103
  }
104
- j == c(280) && h[c(211)](function(m) {
105
- const d = c;
106
- t.push(m), R && (globalThis.hinnn[d(228)].clear(), a[d(229)](), s[d(226)](t)), g();
107
- }, y, _);
104
+ j == i(343) && f.toBlob(function(m) {
105
+ const s = i;
106
+ t[s(278)](m), q && (globalThis[s(315)][s(370)].clear(), o[s(363)](), l[s(368)](t)), g();
107
+ }, P, _);
108
108
  });
109
109
  }
110
- globalThis[e(277)][e(228)][e(208)]();
110
+ globalThis[e(315)].queue[e(280)]();
111
111
  } catch (t) {
112
- console.error(e(270)), console[e(199)](t);
112
+ console.error(e(309)), console[e(364)](t);
113
113
  }
114
114
  });
115
115
  }
116
- return s[x(220)]();
116
+ return l[x(332)]();
117
117
  });
118
118
  };
119
- function H() {
120
- var i = ["defineProperty", "154908jgjsRx", "27WstqnP", "newPrintTemplate", "363625tshdTi", "add toImage Api", "9gphsIY", "1161755vwfrIX", "1449328biOYGf", "2199246sJUgcZ", "167046aGRQjC", "toImage", "add toImage Api to PrintTemplate", "45538AUpZQg"];
121
- return H = function() {
122
- return i;
123
- }, H();
119
+ function N(c, n) {
120
+ var x = R();
121
+ return N = function(o, l) {
122
+ o = o - 132;
123
+ var h = x[o];
124
+ return h;
125
+ }, N(c, n);
124
126
  }
125
- (function(i, n) {
126
- for (var x = U, a = i(); []; )
127
+ (function(c, n) {
128
+ for (var x = N, o = c(); []; )
127
129
  try {
128
- var s = -parseInt(x(415)) / 1 + -parseInt(x(410)) / 2 * (parseInt(x(417)) / 3) + parseInt(x(412)) / 4 + -parseInt(x(404)) / 5 + -parseInt(x(407)) / 6 + parseInt(x(406)) / 7 + -parseInt(x(405)) / 8 * (-parseInt(x(413)) / 9);
129
- if (s === n)
130
+ var l = parseInt(x(141)) / 1 + -parseInt(x(142)) / 2 * (parseInt(x(144)) / 3) + -parseInt(x(143)) / 4 * (-parseInt(x(139)) / 5) + -parseInt(x(138)) / 6 + -parseInt(x(136)) / 7 + -parseInt(x(134)) / 8 * (-parseInt(x(132)) / 9) + parseInt(x(137)) / 10;
131
+ if (l === n)
130
132
  break;
131
- a.push(a.shift());
132
- } catch (b) {
133
- a.push(a.shift());
133
+ o.push(o.shift());
134
+ } catch (h) {
135
+ o.push(o.shift());
134
136
  }
135
- })(H, 204279);
136
- function U(i, n) {
137
- var x = H();
138
- return U = function(a, s) {
139
- a = a - 404;
140
- var b = x[a];
141
- return b;
142
- }, U(i, n);
143
- }
144
- function Y(i) {
145
- var n = U;
146
- return { name: "add toImage Api", description: n(416), hooks: [{ hook: n(414), name: n(409), description: n(409), priority: 1, run: ({ template: x, options: a }) => {
147
- var s = n;
148
- Object[s(411)](x, s(408), { value: O, enumerable: ![], writable: !![], configurable: !![] });
137
+ })(R, 429921);
138
+ function Z(c) {
139
+ var n = N;
140
+ return { name: "add toImage Api", description: "add toImage Api", hooks: [{ hook: n(140), name: n(135), description: n(135), priority: 1, run: ({ template: x, options: o }) => {
141
+ var l = n;
142
+ Object.defineProperty(x, l(133), { value: L, enumerable: ![], writable: !![], configurable: !![] });
149
143
  } }], leastHiprintVersion: "0.3.0" };
150
144
  }
145
+ function R() {
146
+ var c = ["add toImage Api to PrintTemplate", "53613RFXdgt", "2654180GiWpZa", "899760buZBGF", "42740jYPwWY", "newPrintTemplate", "243290IFIGAk", "765172hmfXSH", "196NPJNIG", "6qNKtTX", "72dAWOWk", "toImage", "425152nOqmtJ"];
147
+ return R = function() {
148
+ return c;
149
+ }, R();
150
+ }
151
151
  export {
152
- Y as default
152
+ Z as default
153
153
  };
package/dist/index.umd.js CHANGED
@@ -1 +1 @@
1
- (function(h,_){typeof exports=="object"&&typeof module!="undefined"?module.exports=_(require("html-to-image")):typeof define=="function"&&define.amd?define(["html-to-image"],_):(h=typeof globalThis!="undefined"?globalThis:h||self,h.pluginApiImage=_(h.htmlToImage))})(this,function(h){"use strict";var N=(h,_,P)=>new Promise((I,v)=>{var U=u=>{try{b(P.next(u))}catch(a){v(a)}},C=u=>{try{b(P.throw(u))}catch(a){v(a)}},b=u=>u.done?I(u.value):Promise.resolve(u.value).then(U,C);b((P=P.apply(h,_)).next())});function _(a){if(a&&a.__esModule)return a;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const e in a)if(e!=="default"){const o=Object.getOwnPropertyDescriptor(a,e);Object.defineProperty(t,e,o.get?o:{enumerable:!0,get:()=>a[e]})}}return t.default=a,Object.freeze(t)}const P=_(h);(function(a,t){const e=I,o=a();for(;[];)try{if(parseInt(e(256))/1*(-parseInt(e(251))/2)+parseInt(e(202))/3+-parseInt(e(240))/4*(-parseInt(e(262))/5)+-parseInt(e(249))/6+-parseInt(e(257))/7*(parseInt(e(265))/8)+parseInt(e(214))/9+parseInt(e(209))/10*(-parseInt(e(266))/11)===t)break;o.push(o.shift())}catch(d){o.push(o.shift())}})(v,895242);function I(a,t){const e=v();return I=function(o,d){return o=o-198,e[o]},I(a,t)}function v(){const a=["devicePixelRatio","pop","none","add","download.jpg","clear","hinnn","loadAllImages","gif","blob","getHtml","bmp","drawImage","getContext","width","png","log","end","toType","2140296JIAPBS","limit","svg","appendChild","start",".jpg","run","80HKLNvz","clearRect","toBlob","floor","toLowerCase","14153616tpUZDS","css","then","base64","isDownload","extend","promise","onProgress","indexOf","createElement",".hiprint-printPanel .hiprint-printPaper","printPanels","resolve","cur","queue","removeTempContainer","length","push","html","height","name","webp","onload","quality","#fff","baseURI","4mSGYjc","IMG","toCanvas","createTempContainer","canvas","svg2canvas","ceil","replace","imageSmoothingEnabled","3318840FwheCH","toDataURL","2enrpHW","display","http","tagName","remove","221627spbDRI","238pIEAXC","jpeg","includes","click","pixelRatio","2667735awVlxc","total","src","199624IHMSBy","414139JwxQRn","type","image/jpeg","url","toImage \u5931\u8D25(\u53EF\u80FD\u60A8\u7684\u56FE\u7247\u8D44\u6E90\u65E0\u6CD5\u6B63\u5E38\u52A0\u8F7D): "];return v=function(){return a},v()}const U=function(a,t){return N(this,null,function*(){const e=I;let o=this,d=globalThis.$.Deferred(),R=!![],T=10,E=(l,g)=>{const f=I,O=Math[f(212)](l/g*100);console[f(199)](f(227),l,f(263),g),console[f(199)]("toImage percent: ",O+"%")};if(this[e(225)][e(230)]){let l=globalThis.$[e(219)]({filter:x=>{const n=e;return x[n(254)]!=n(241)||x[n(254)]=="IMG"&&(["jpg",n(258),n(198),n(279),n(282),n(235),n(204)][n(259)](x[n(264)].split(".")[n(272)]()[n(213)]())||x[n(264)]!=x.baseURI||x[n(264)][n(222)](n(253))>-1&&x.src!=x[n(239)]||x[n(264)][n(222)](n(217))>-1)},backgroundColor:e(238)},t||{}),g=yield this[e(281)](a,t);t&&t[e(218)]!=null&&(R=t[e(218)]),t&&t.onProgress!=null&&(E=t[e(221)]),t&&t[e(203)]!=null&&(T=t[e(203)]),globalThis.$(g)[e(215)]("width","")[e(215)](e(233),""),this[e(243)]();let f=this.getTempContainer();this[e(245)](g,l),f[e(232)](g[0]);let O=f.find(e(224))[e(230)];globalThis.$(g)[e(215)]("position:fixed"),this[e(278)](g,function(){const x=e;try{let n=[],$=Math[x(246)](O/T),Q=O%T||1;const p=document[x(223)](x(244)),q=p[x(284)]("2d"),B=f.width()*(l[x(261)]||globalThis[x(271)]);for(let A=0;A<$;A++){q[x(210)](0,0,p.width,p.height);const S=A==$-1;let J=0,G=S?Q:T;for(let m=0;m<G;m++){q.clearRect(0,0,p[x(285)],p[x(233)]);const i=A*T+m,k=f.find(x(224))[i];globalThis[x(277)][x(228)][x(274)](function(D){const w=x;P[w(242)](k,l)[w(216)](function(y){const r=w;let j=y[r(284)]("2d");j[r(248)]=![];let M=y[r(250)](r(268),l.quality||.92),c=new Image;c[r(264)]=M,c[r(236)]=function(){const s=r;m===0&&(p[s(285)]=B,p[s(233)]=c[s(233)]*G),J+=c.height,q[s(283)](c,0,J-c[s(233)],B,c[s(233)]),E(i+1,O),D()}})})}globalThis.hinnn[x(228)][x(274)](function(m){const i=x;let k=l[i(267)]||i(268),D=l[i(201)]||i(269),w=l[i(237)]||.8;if(R){let y=p[i(250)](k,w),r=new Image;r[i(264)]=y,r[i(236)]=function(){const j=i;n[j(231)]({url:y,start:A*T+1,end:A*T+G}),S&&(globalThis[j(277)][j(228)][j(276)](),o.removeTempContainer(),n.forEach(M=>{const c=j;let s=document[c(223)]("a"),H=t[c(234)]||c(275);H[c(222)](".")==-1&&(H+=c(207));let L=H.split(".").pop(),Y=H[c(247)]("."+L,"")+"_"+M[c(206)]+"-"+M[c(200)]+"."+L;s.style[c(252)]=c(273),s.setAttribute("download",Y),s.setAttribute("href",M[c(269)]),document.body[c(205)](s),s[c(260)](),s[c(255)]()})),m()};return}if(D=="url"){n.push(p[i(250)](k,w)),S&&(globalThis[i(277)][i(228)].clear(),o[i(229)](),d[i(226)](n)),m();return}D==i(280)&&p[i(211)](function(y){const r=i;n.push(y),S&&(globalThis.hinnn[r(228)].clear(),o[r(229)](),d[r(226)](n)),m()},k,w)})}globalThis[x(277)][x(228)][x(208)]()}catch(n){console.error(x(270)),console[x(199)](n)}})}return d[e(220)]()})};function C(){var a=["defineProperty","154908jgjsRx","27WstqnP","newPrintTemplate","363625tshdTi","add toImage Api","9gphsIY","1161755vwfrIX","1449328biOYGf","2199246sJUgcZ","167046aGRQjC","toImage","add toImage Api to PrintTemplate","45538AUpZQg"];return C=function(){return a},C()}(function(a,t){for(var e=b,o=a();[];)try{var d=-parseInt(e(415))/1+-parseInt(e(410))/2*(parseInt(e(417))/3)+parseInt(e(412))/4+-parseInt(e(404))/5+-parseInt(e(407))/6+parseInt(e(406))/7+-parseInt(e(405))/8*(-parseInt(e(413))/9);if(d===t)break;o.push(o.shift())}catch(R){o.push(o.shift())}})(C,204279);function b(a,t){var e=C();return b=function(o,d){o=o-404;var R=e[o];return R},b(a,t)}function u(a){var t=b;return{name:"add toImage Api",description:t(416),hooks:[{hook:t(414),name:t(409),description:t(409),priority:1,run:({template:e,options:o})=>{var d=t;Object[d(411)](e,d(408),{value:U,enumerable:![],writable:!![],configurable:!![]})}}],leastHiprintVersion:"0.3.0"}}return u});
1
+ (function(b,_){typeof exports=="object"&&typeof module!="undefined"?module.exports=_(require("html-to-image")):typeof define=="function"&&define.amd?define(["html-to-image"],_):(b=typeof globalThis!="undefined"?globalThis:b||self,b.pluginApiImage=_(b.htmlToImage))})(this,function(b){"use strict";var L=(b,_,w)=>new Promise((y,h)=>{var H=l=>{try{q(w.next(l))}catch(a){h(a)}},P=l=>{try{q(w.throw(l))}catch(a){h(a)}},q=l=>l.done?y(l.value):Promise.resolve(l.value).then(H,P);q((w=w.apply(b,_)).next())});function _(a){if(a&&a.__esModule)return a;const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const e in a)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(a,e);Object.defineProperty(n,e,i.get?i:{enumerable:!0,get:()=>a[e]})}}return n.default=a,Object.freeze(n)}const w=_(b);(function(a,n){const e=h,i=a();for(;[];)try{if(parseInt(e(289))/1+-parseInt(e(367))/2+parseInt(e(324))/3*(parseInt(e(316))/4)+-parseInt(e(306))/5+parseInt(e(325))/6*(parseInt(e(336))/7)+parseInt(e(344))/8*(parseInt(e(334))/9)+-parseInt(e(308))/10*(-parseInt(e(286))/11)===n)break;i.push(i.shift())}catch(d){i.push(i.shift())}})(y,710956);function y(){const a=["toDataURL","height","baseURI","find","position:fixed","display","download.jpg","loadAllImages","indexOf","length","jpg","remove",".jpg","start","removeTempContainer","log","pixelRatio","add","698464IYwzVZ","resolve","devicePixelRatio","queue","quality","push","imageSmoothingEnabled","run","tagName","image/jpeg","onProgress","toImage percent: ","getHtml","1738qOahFf","toType","floor","451297HqroPf","forEach","includes","svg","getContext","clear","png","getTempContainer","name","jpeg","css","src","IMG","end",".hiprint-printPanel .hiprint-printPaper","style","width","5644560azgNiN","createElement","5920pDYpGT","toImage \u5931\u8D25(\u53EF\u80FD\u60A8\u7684\u56FE\u7247\u8D44\u6E90\u65E0\u6CD5\u6B63\u5E38\u52A0\u8F7D): ","body","appendChild","then","drawImage","onload","hinnn","1052056OdLMHP","url","replace","cur","limit","#fff","isDownload","download","6hwSYbH","6XXeNZP","clearRect","gif","canvas","printPanels","base64","split","promise","none","9xKBDjH","extend","3945767IekuVg","ceil","click","http","toLowerCase","pop","toCanvas","blob","4436464MMWMcf","href","setAttribute","total","bmp"];return y=function(){return a},y()}function h(a,n){const e=y();return h=function(i,d){return i=i-277,e[i]},h(a,n)}const H=function(a,n){return L(this,null,function*(){const e=h;let i=this,d=globalThis.$.Deferred(),j=!![],I=10,W=(p,g)=>{const f=h,A=Math[f(288)](p/g*100);console[f(364)](f(319),p,f(347),g),console[f(364)](f(284),A+"%")};if(this[e(329)].length){let p=globalThis.$[e(335)]({filter:x=>{const t=e;return x.tagName!=t(301)||x[t(281)]==t(301)&&([t(359),t(298),t(295),t(327),t(348),"webp",t(292)][t(291)](x[t(300)].split(".")[t(341)]()[t(340)]())||x[t(300)]!=x.baseURI||x.src[t(357)](t(339))>-1&&x[t(300)]!=x[t(351)]||x[t(300)][t(357)](t(330))>-1)},backgroundColor:e(321)},n||{}),g=yield this[e(285)](a,n);n&&n[e(322)]!=null&&(j=n.isDownload),n&&n[e(283)]!=null&&(W=n.onProgress),n&&n[e(320)]!=null&&(I=n.limit),globalThis.$(g)[e(299)]("width","")[e(299)](e(350),""),this.createTempContainer();let f=this[e(296)]();this.svg2canvas(g,p),f.html(g[0]);let A=f[e(352)](e(303))[e(358)];globalThis.$(g)[e(299)](e(353)),this[e(356)](g,function(){const x=e;try{let t=[],X=Math[x(337)](A/I),U=A%I||1;const u=document[x(307)](x(328)),G=u[x(293)]("2d"),Y=f.width()*(p[x(365)]||globalThis[x(369)]);for(let O=0;O<X;O++){G[x(326)](0,0,u[x(305)],u[x(350)]);const C=O==X-1;let E=0,S=C?U:I;for(let m=0;m<S;m++){G[x(326)](0,0,u[x(305)],u.height);const r=O*I+m,M=f[x(352)](x(303))[r];globalThis[x(315)][x(370)].add(function(D){const T=x;w[T(342)](M,p)[T(312)](function(v){const c=T;let k=v[c(293)]("2d");k[c(279)]=![];let N=v.toDataURL(c(282),p[c(277)]||.92),o=new Image;o[c(300)]=N,o[c(314)]=function(){const s=c;m===0&&(u[s(305)]=Y,u.height=o[s(350)]*S),E+=o[s(350)],G[s(313)](o,0,E-o[s(350)],Y,o[s(350)]),W(r+1,A),D()}})})}globalThis[x(315)].queue[x(366)](function(m){const r=x;let M=p.type||r(282),D=p[r(287)]||"url",T=p.quality||.8;if(j){let v=u[r(349)](M,T),c=new Image;c[r(300)]=v,c[r(314)]=function(){const k=r;t.push({url:v,start:O*I+1,end:O*I+S}),C&&(globalThis.hinnn[k(370)].clear(),i[k(363)](),t[k(290)](N=>{const o=k;let s=document.createElement("a"),R=n[o(297)]||o(355);R.indexOf(".")==-1&&(R+=o(361));let F=R[o(331)](".")[o(341)](),Z=R[o(318)]("."+F,"")+"_"+N[o(362)]+"-"+N[o(302)]+"."+F;s[o(304)][o(354)]=o(333),s.setAttribute(o(323),Z),s[o(346)](o(345),N[o(317)]),document[o(310)][o(311)](s),s[o(338)](),s[o(360)]()})),m()};return}if(D==r(317)){t.push(u[r(349)](M,T)),C&&(globalThis[r(315)][r(370)][r(294)](),i[r(363)](),d[r(368)](t)),m();return}D==r(343)&&u.toBlob(function(v){const c=r;t[c(278)](v),C&&(globalThis[c(315)][c(370)].clear(),i[c(363)](),d[c(368)](t)),m()},M,T)})}globalThis[x(315)].queue[x(280)]()}catch(t){console.error(x(309)),console[x(364)](t)}})}return d[e(332)]()})};function P(a,n){var e=l();return P=function(i,d){i=i-132;var j=e[i];return j},P(a,n)}(function(a,n){for(var e=P,i=a();[];)try{var d=parseInt(e(141))/1+-parseInt(e(142))/2*(parseInt(e(144))/3)+-parseInt(e(143))/4*(-parseInt(e(139))/5)+-parseInt(e(138))/6+-parseInt(e(136))/7+-parseInt(e(134))/8*(-parseInt(e(132))/9)+parseInt(e(137))/10;if(d===n)break;i.push(i.shift())}catch(j){i.push(i.shift())}})(l,429921);function q(a){var n=P;return{name:"add toImage Api",description:"add toImage Api",hooks:[{hook:n(140),name:n(135),description:n(135),priority:1,run:({template:e,options:i})=>{var d=n;Object.defineProperty(e,d(133),{value:H,enumerable:![],writable:!![],configurable:!![]})}}],leastHiprintVersion:"0.3.0"}}function l(){var a=["add toImage Api to PrintTemplate","53613RFXdgt","2654180GiWpZa","899760buZBGF","42740jYPwWY","newPrintTemplate","243290IFIGAk","765172hmfXSH","196NPJNIG","6qNKtTX","72dAWOWk","toImage","425152nOqmtJ"];return l=function(){return a},l()}return q});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sv-print/plugin-api-image",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "add image api to print template",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",