@htmlbricks/hb-page-invoice 0.8.26 → 0.8.30
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/package.json +4 -4
- package/release/release.js +1 -1
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@htmlbricks/hb-page-invoice",
|
|
3
3
|
"displayName": "Svelte Invoice WebComponent",
|
|
4
4
|
"description": "Svelte Invoice WebComponent",
|
|
5
|
-
"version": "0.8.
|
|
5
|
+
"version": "0.8.30",
|
|
6
6
|
"main": "release/release.js",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"prepublish": "npm run build:release"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@htmlbricks/hb-jsutils": "^0.8.
|
|
30
|
+
"@htmlbricks/hb-jsutils": "^0.8.30",
|
|
31
31
|
"@rollup/plugin-alias": "^3.1.2",
|
|
32
32
|
"@rollup/plugin-commonjs": "^18.0.0",
|
|
33
33
|
"@rollup/plugin-json": "^4.1.0",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"typescript-transform-paths": "^2.2.3"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@htmlbricks/hb-table": "^0.8.
|
|
69
|
+
"@htmlbricks/hb-table": "^0.8.30",
|
|
70
70
|
"dayjs": "^1.10.7",
|
|
71
71
|
"debounce": "^1.2.1"
|
|
72
72
|
},
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"html5-webcomponents"
|
|
78
78
|
],
|
|
79
79
|
"contributors": [],
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "443dac4021689353f75de6f6632054899cb2042b"
|
|
81
81
|
}
|
package/release/release.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var release=function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function i(t){t.forEach(e)}function r(t){return"function"==typeof t}function o(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}let a,s;function d(t,e){return a||(a=document.createElement("a")),a.href=e,t===a.href}function u(t,e){t.appendChild(e)}function l(t,e,n){t.insertBefore(e,n||null)}function c(t){t.parentNode.removeChild(t)}function f(t){return document.createElement(t)}function h(t){return document.createTextNode(t)}function m(){return h(" ")}function p(t,e,n,i){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}function g(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function b(t,e,n){e in t?t[e]="boolean"==typeof t[e]&&""===n||n:g(t,e,n)}function y(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function v(t,e,n,i){null===n?t.style.removeProperty(e):t.style.setProperty(e,n,i?"important":"")}function $(t){const e={};for(const n of t)e[n.name]=n.value;return e}function w(t){s=t}const x=[],_=[],M=[],S=[],k=Promise.resolve();let D=!1;function T(t){M.push(t)}const L=new Set;let O=0;function Y(){const t=s;do{for(;O<x.length;){const t=x[O];O++,w(t),C(t.$$)}for(w(null),x.length=0,O=0;_.length;)_.pop()();for(let t=0;t<M.length;t+=1){const e=M[t];L.has(e)||(L.add(e),e())}M.length=0}while(x.length);for(;S.length;)S.pop()();D=!1,L.clear(),w(t)}function C(t){if(null!==t.fragment){t.update(),i(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(T)}}const E=new Set;function H(t,e){-1===t.$$.dirty[0]&&(x.push(t),D||(D=!0,k.then(Y)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function N(o,a,d,u,l,f,h,m=[-1]){const p=s;w(o);const g=o.$$={fragment:null,ctx:null,props:f,update:t,not_equal:l,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(a.context||(p?p.$$.context:[])),callbacks:n(),dirty:m,skip_bound:!1,root:a.target||p.$$.root};h&&h(g.root);let b=!1;if(g.ctx=d?d(o,a.props||{},((t,e,...n)=>{const i=n.length?n[0]:e;return g.ctx&&l(g.ctx[t],g.ctx[t]=i)&&(!g.skip_bound&&g.bound[t]&&g.bound[t](i),b&&H(o,t)),e})):[],g.update(),b=!0,i(g.before_update),g.fragment=!!u&&u(g.ctx),a.target){if(a.hydrate){const t=function(t){return Array.from(t.childNodes)}(a.target);g.fragment&&g.fragment.l(t),t.forEach(c)}else g.fragment&&g.fragment.c();a.intro&&((y=o.$$.fragment)&&y.i&&(E.delete(y),y.i(v))),function(t,n,o,a){const{fragment:s,on_mount:d,on_destroy:u,after_update:l}=t.$$;s&&s.m(n,o),a||T((()=>{const n=d.map(e).filter(r);u?u.push(...n):i(n),t.$$.on_mount=[]})),l.forEach(T)}(o,a.target,a.anchor,a.customElement),Y()}var y,v;w(p)}let j;"function"==typeof HTMLElement&&(j=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(e).filter(r);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){i(this.$$.on_disconnect)}$destroy(){!function(t,e){const n=t.$$;null!==n.fragment&&(i(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});var A="0.8.26";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function P(t){var e={exports:{}};return t(e,e.exports),e.exports}var z=P((function(t,e){t.exports=function(){var t=1e3,e=6e4,n=36e5,i="millisecond",r="second",o="minute",a="hour",s="day",d="week",u="month",l="quarter",c="year",f="date",h="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},b=function(t,e,n){var i=String(t);return!i||i.length>=e?t:""+Array(e+1-i.length).join(n)+t},y={s:b,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),i=Math.floor(n/60),r=n%60;return(e<=0?"+":"-")+b(i,2,"0")+":"+b(r,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var i=12*(n.year()-e.year())+(n.month()-e.month()),r=e.clone().add(i,u),o=n-r<0,a=e.clone().add(i+(o?-1:1),u);return+(-(i+(n-r)/(o?r-a:a-r))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:u,y:c,w:d,d:s,D:f,h:a,m:o,s:r,ms:i,Q:l}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},v="en",$={};$[v]=g;var w=function(t){return t instanceof S},x=function(t,e,n){var i;if(!t)return v;if("string"==typeof t)$[t]&&(i=t),e&&($[t]=e,i=t);else{var r=t.name;$[r]=t,i=r}return!n&&i&&(v=i),i||!n&&v},_=function(t,e){if(w(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new S(n)},M=y;M.l=x,M.i=w,M.w=function(t,e){return _(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var S=function(){function g(t){this.$L=x(t.locale,null,!0),this.parse(t)}var b=g.prototype;return b.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(M.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var i=e.match(m);if(i){var r=i[2]-1||0,o=(i[7]||"0").substring(0,3);return n?new Date(Date.UTC(i[1],r,i[3]||1,i[4]||0,i[5]||0,i[6]||0,o)):new Date(i[1],r,i[3]||1,i[4]||0,i[5]||0,i[6]||0,o)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},b.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},b.$utils=function(){return M},b.isValid=function(){return!(this.$d.toString()===h)},b.isSame=function(t,e){var n=_(t);return this.startOf(e)<=n&&n<=this.endOf(e)},b.isAfter=function(t,e){return _(t)<this.startOf(e)},b.isBefore=function(t,e){return this.endOf(e)<_(t)},b.$g=function(t,e,n){return M.u(t)?this[e]:this.set(n,t)},b.unix=function(){return Math.floor(this.valueOf()/1e3)},b.valueOf=function(){return this.$d.getTime()},b.startOf=function(t,e){var n=this,i=!!M.u(e)||e,l=M.p(t),h=function(t,e){var r=M.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return i?r:r.endOf(s)},m=function(t,e){return M.w(n.toDate()[t].apply(n.toDate("s"),(i?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},p=this.$W,g=this.$M,b=this.$D,y="set"+(this.$u?"UTC":"");switch(l){case c:return i?h(1,0):h(31,11);case u:return i?h(1,g):h(0,g+1);case d:var v=this.$locale().weekStart||0,$=(p<v?p+7:p)-v;return h(i?b-$:b+(6-$),g);case s:case f:return m(y+"Hours",0);case a:return m(y+"Minutes",1);case o:return m(y+"Seconds",2);case r:return m(y+"Milliseconds",3);default:return this.clone()}},b.endOf=function(t){return this.startOf(t,!1)},b.$set=function(t,e){var n,d=M.p(t),l="set"+(this.$u?"UTC":""),h=(n={},n[s]=l+"Date",n[f]=l+"Date",n[u]=l+"Month",n[c]=l+"FullYear",n[a]=l+"Hours",n[o]=l+"Minutes",n[r]=l+"Seconds",n[i]=l+"Milliseconds",n)[d],m=d===s?this.$D+(e-this.$W):e;if(d===u||d===c){var p=this.clone().set(f,1);p.$d[h](m),p.init(),this.$d=p.set(f,Math.min(this.$D,p.daysInMonth())).$d}else h&&this.$d[h](m);return this.init(),this},b.set=function(t,e){return this.clone().$set(t,e)},b.get=function(t){return this[M.p(t)]()},b.add=function(i,l){var f,h=this;i=Number(i);var m=M.p(l),p=function(t){var e=_(h);return M.w(e.date(e.date()+Math.round(t*i)),h)};if(m===u)return this.set(u,this.$M+i);if(m===c)return this.set(c,this.$y+i);if(m===s)return p(1);if(m===d)return p(7);var g=(f={},f[o]=e,f[a]=n,f[r]=t,f)[m]||1,b=this.$d.getTime()+i*g;return M.w(b,this)},b.subtract=function(t,e){return this.add(-1*t,e)},b.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||h;var i=t||"YYYY-MM-DDTHH:mm:ssZ",r=M.z(this),o=this.$H,a=this.$m,s=this.$M,d=n.weekdays,u=n.months,l=function(t,n,r,o){return t&&(t[n]||t(e,i))||r[n].substr(0,o)},c=function(t){return M.s(o%12||12,t,"0")},f=n.meridiem||function(t,e,n){var i=t<12?"AM":"PM";return n?i.toLowerCase():i},m={YY:String(this.$y).slice(-2),YYYY:this.$y,M:s+1,MM:M.s(s+1,2,"0"),MMM:l(n.monthsShort,s,u,3),MMMM:l(u,s),D:this.$D,DD:M.s(this.$D,2,"0"),d:String(this.$W),dd:l(n.weekdaysMin,this.$W,d,2),ddd:l(n.weekdaysShort,this.$W,d,3),dddd:d[this.$W],H:String(o),HH:M.s(o,2,"0"),h:c(1),hh:c(2),a:f(o,a,!0),A:f(o,a,!1),m:String(a),mm:M.s(a,2,"0"),s:String(this.$s),ss:M.s(this.$s,2,"0"),SSS:M.s(this.$ms,3,"0"),Z:r};return i.replace(p,(function(t,e){return e||m[t]||r.replace(":","")}))},b.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},b.diff=function(i,f,h){var m,p=M.p(f),g=_(i),b=(g.utcOffset()-this.utcOffset())*e,y=this-g,v=M.m(this,g);return v=(m={},m[c]=v/12,m[u]=v,m[l]=v/3,m[d]=(y-b)/6048e5,m[s]=(y-b)/864e5,m[a]=y/n,m[o]=y/e,m[r]=y/t,m)[p]||y,h?v:M.a(v)},b.daysInMonth=function(){return this.endOf(u).$D},b.$locale=function(){return $[this.$L]},b.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),i=x(t,e,!0);return i&&(n.$L=i),n},b.clone=function(){return M.w(this.$d,this)},b.toDate=function(){return new Date(this.valueOf())},b.toJSON=function(){return this.isValid()?this.toISOString():null},b.toISOString=function(){return this.$d.toISOString()},b.toString=function(){return this.$d.toUTCString()},g}(),k=S.prototype;return _.prototype=k,[["$ms",i],["$s",r],["$m",o],["$H",a],["$W",s],["$M",u],["$y",c],["$D",f]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),_.extend=function(t,e){return t.$i||(t(e,S,_),t.$i=!0),_},_.locale=x,_.isDayjs=w,_.unix=function(t){return _(1e3*t)},_.en=$[v],_.Ls=$,_.p={},_}()}));function I(t,e,n){var i,r,o,a,s;function d(){var u=Date.now()-a;u<e&&u>=0?i=setTimeout(d,e-u):(i=null,n||(s=t.apply(o,r),o=r=null))}null==e&&(e=100);var u=function(){o=this,r=arguments,a=Date.now();var u=n&&!i;return i||(i=setTimeout(d,e)),u&&(s=t.apply(o,r),o=r=null),s};return u.clear=function(){i&&(clearTimeout(i),i=null)},u.flush=function(){i&&(s=t.apply(o,r),o=r=null,clearTimeout(i),i=null)},u}I.debounce=I;var q=I;P((function(t,e){t.exports=function(t){function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=e(t),i={name:"it",weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),weekStart:1,monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"tra %s",past:"%s fa",s:"qualche secondo",m:"un minuto",mm:"%d minuti",h:"un' ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:function(t){return t+"º"}};return n.default.locale(i,null,!0),i}(z)}));var J=P((function(t,e){e.__esModule=!0,e.LanguageTranslator=e.addComponent=e.getChildStyleToPass=void 0,e.getChildStyleToPass=function(t,e){var n,i,r="";if(t&&(null==e?void 0:e.length)&&(null===(n=Object.keys(t))||void 0===n?void 0:n.length)&&(null===(i=null==e?void 0:e.filter((function(e){return Object.keys(t).includes(e.name)})))||void 0===i?void 0:i.length))for(var o=function(n){(null==e?void 0:e.filter((function(e){return e.name===n&&e.defaultValue!==t[n]})))&&(r+="".concat(n,":").concat(t[n],";"))},a=0,s=Object.keys(t);a<s.length;a++){o(s[a])}return r},e.addComponent=function(t,e,n){if(!document.getElementById("hb-"+t+"-script")){var i=document.createElement("script");i.id="hb-"+t+"-script",i.src="https://cdn.jsdelivr.net/npm/@htmlbricks/hb-".concat(t,"@").concat(e,"/release/release.js"),n&&location.href.includes("localhost")&&(i.src="http://localhost:6006/".concat(t,"/dist/release.js")),document.head.appendChild(i)}};var n=function(){function t(t){if(!(null==t?void 0:t.dictionary))throw new Error("no dictionary provided");this.dictionary=t.dictionary,this.setLang(null==t?void 0:t.lang)}return t.prototype.setLang=function(e){e||(e=t.getDefaultLang()),this.lang=e},t.prototype.translateWord=function(e,n){return t.getDictionaryWord(e,this.dictionary,n||this.lang)},t.prototype.translateDate=function(e,n,i){return t.formatDate(e,n,i||this.lang)},t.getDefaultLang=function(){var t,e,n,i,r,o="en";return(null===navigator||void 0===navigator?void 0:navigator.languages)&&(null===(n=null===(e=null===(t=navigator.languages[0])||void 0===t?void 0:t.split("-")[0])||void 0===e?void 0:e.toLowerCase())||void 0===n?void 0:n.length)&&(o=null===(r=null===(i=navigator.languages[0])||void 0===i?void 0:i.split("-")[0])||void 0===r?void 0:r.toLowerCase()),o},t.getDictionaryWord=function(e,n,i){var r;if(!e)throw new Error("no wordKey provided");if(!n)throw new Error("no dictionary provided");if(i&&(null===(r=n[i])||void 0===r?void 0:r[e]))return n[i][e];var o="",a=t.getDefaultLang();if(!i||a!==i){var s=null==n?void 0:n[a];(null==s?void 0:s[e])&&(o=s[e])}return o},t.formatDate=function(e,n,i){if(!e)throw new Error("no date provided");if("function"!=typeof e.getMonth)throw new Error("wrong date format");return new Intl.DateTimeFormat(i||t.getDefaultLang(),n).format(e)},t}();e.LanguageTranslator=n})),W=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,V=/\n/g,F=/^\s*/,U=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,R=/^:\s*/,Z=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,B=/^[;\s]*/,K=/^\s+|\s+$/g,Q="";function G(t){return t?t.replace(K,Q):Q}var X=function(t,e){var n,i=null;if(!t||"string"!=typeof t)return i;for(var r,o,a=function(t,e){if("string"!=typeof t)throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var n=1,i=1;function r(t){var e=t.match(V);e&&(n+=e.length);var r=t.lastIndexOf("\n");i=~r?t.length-r:i+t.length}function o(){var t={line:n,column:i};return function(e){return e.position=new a(t),u(),e}}function a(t){this.start=t,this.end={line:n,column:i},this.source=e.source}function s(r){var o=new Error(e.source+":"+n+":"+i+": "+r);if(o.reason=r,o.filename=e.source,o.line=n,o.column=i,o.source=t,!e.silent)throw o}function d(e){var n=e.exec(t);if(n){var i=n[0];return r(i),t=t.slice(i.length),n}}function u(){d(F)}function l(t){var e;for(t=t||[];e=c();)!1!==e&&t.push(e);return t}function c(){var e=o();if("/"==t.charAt(0)&&"*"==t.charAt(1)){for(var n=2;Q!=t.charAt(n)&&("*"!=t.charAt(n)||"/"!=t.charAt(n+1));)++n;if(n+=2,Q===t.charAt(n-1))return s("End of comment missing");var a=t.slice(2,n-2);return i+=2,r(a),t=t.slice(n),i+=2,e({type:"comment",comment:a})}}function f(){var t=o(),e=d(U);if(e){if(c(),!d(R))return s("property missing ':'");var n=d(Z),i=t({type:"declaration",property:G(e[0].replace(W,Q)),value:n?G(n[0].replace(W,Q)):Q});return d(B),i}}return a.prototype.content=t,u(),function(){var t,e=[];for(l(e);t=f();)!1!==t&&(e.push(t),l(e));return e}()}(t),s="function"==typeof e,d=0,u=a.length;d<u;d++)r=(n=a[d]).property,o=n.value,s?e(r,o,n):o&&(i||(i={}),i[r]=o);return i},tt={vars:[{name:"--bs-primary",valueType:"color",theme:"bootstrap",defaultValue:"#07689f"},{name:"--bs-secondary",valueType:"color",theme:"bootstrap",defaultValue:"#c9d6df"},{name:"--bs-success",valueType:"color",theme:"bootstrap",defaultValue:"#11d3bc"},{name:"--bs-info",valueType:"color",theme:"bootstrap",defaultValue:"#a2d5f2"},{name:"--bs-warning",valueType:"color",theme:"bootstrap",defaultValue:"#ffc107"},{name:"--bs-danger",valueType:"color",theme:"bootstrap",defaultValue:"#f67280"}],parts:[]};function et(e){let n;return{c(){n=h("error")},m(t,e){l(t,n,e)},p:t,d(t){t&&c(n)}}}function nt(t){let e,n,i,r,o,a,s,p,$,w,x,_,M,S,k,D,T,L,O,Y,C,E,H,N,j,A,P,I,q,J,W,V,F,U,R,Z,B,K,Q,G,X,tt,et,nt,rt,ot,at,st,dt,ut,lt,ct,ft,ht,mt,pt,gt,bt,yt,vt,$t,wt,xt,_t,Mt,St,kt,Dt,Tt,Lt,Ot,Yt,Ct,Et,Ht,Nt,jt=t[2].from.shortName+"",At=z(t[2].date).format("DD/MM/YY")+"",Pt=t[2].serial+"",zt=t[2].from.name+"",It=t[2].from.address+"",qt=t[2].from.piva+"",Jt=t[2].from.email+"",Wt=t[2].from.phone+"",Vt=t[2].to.name+"",Ft=t[2].to.address+"",Ut=t[2].to.piva+"",Rt="yes"!==t[0]&&it(t);return{c(){e=f("div"),n=f("div"),i=f("div"),r=f("img"),a=m(),s=f("span"),p=h(jt),$=m(),w=f("div"),Rt&&Rt.c(),x=m(),_=f("div"),M=f("div"),S=h("Data: "),k=h(At),D=m(),T=f("div"),L=m(),O=f("div"),Y=h("Fattura numero: "),C=h(Pt),E=m(),H=f("div"),N=f("div"),j=f("div"),A=h(zt),P=m(),I=f("div"),q=h(It),J=m(),W=f("div"),V=h(qt),F=m(),U=f("div"),R=f("div"),Z=h(Jt),B=m(),K=f("div"),Q=h(Wt),G=m(),X=f("div"),tt=f("div"),et=h(Vt),nt=m(),rt=f("div"),ot=h(Ft),at=m(),st=f("div"),dt=h(Ut),ut=m(),lt=f("div"),ct=f("div"),ft=f("hb-table"),mt=m(),pt=f("div"),gt=f("div"),bt=f("div"),yt=f("div"),vt=f("div"),$t=f("span"),$t.textContent="SubTotale:",wt=m(),xt=h(t[4]),_t=h(t[3]),Mt=m(),St=f("div"),kt=f("span"),kt.textContent="Tasse:",Dt=m(),Tt=h(t[5]),Lt=h(t[3]),Ot=m(),Yt=f("div"),Ct=f("span"),Ct.textContent="Totale:",Et=m(),Ht=h(t[8]),Nt=h(t[3]),v(r,"height","80px"),v(r,"margin","0px 0px 0px 60px"),g(r,"alt",""),d(r.src,o=t[2].from.logo)||g(r,"src",o),v(s,"margin","0px 40px 0px 40px"),g(i,"class","col"),g(w,"class","col"),g(n,"class","row"),v(n,"margin-top","20px"),g(M,"class","col"),g(T,"class","col"),g(O,"class","col"),g(_,"class","row"),v(_,"margin-top","60px"),g(N,"class","col"),g(U,"class","col"),g(X,"class","col"),g(H,"class","row"),v(H,"margin-top","40px"),b(ft,"style",t[6]),b(ft,"disablepagination","yes"),b(ft,"rows",ht=JSON.stringify(t[7])),b(ft,"headers",JSON.stringify(t[9])),g(ct,"class","col"),g(lt,"class","row"),v(lt,"margin-top","40px"),v($t,"display","inline-block"),v($t,"min-width","200px"),v(vt,"line-height","25px"),v(kt,"display","inline-block"),v(kt,"min-width","200px"),v(St,"line-height","25px"),v(Ct,"display","inline-block"),v(Ct,"min-width","200px"),v(Yt,"line-height","25px"),v(Yt,"font-weight","bold"),v(yt,"text-align","left"),v(bt,"width","300px"),v(bt,"float","right"),g(gt,"class","col"),g(pt,"class","row"),v(pt,"margin-top","40px"),g(e,"id","page"),g(e,"class","container")},m(t,o){l(t,e,o),u(e,n),u(n,i),u(i,r),u(i,a),u(i,s),u(s,p),u(n,$),u(n,w),Rt&&Rt.m(w,null),u(e,x),u(e,_),u(_,M),u(M,S),u(M,k),u(_,D),u(_,T),u(_,L),u(_,O),u(O,Y),u(O,C),u(e,E),u(e,H),u(H,N),u(N,j),u(j,A),u(N,P),u(N,I),u(I,q),u(N,J),u(N,W),u(W,V),u(H,F),u(H,U),u(U,R),u(R,Z),u(U,B),u(U,K),u(K,Q),u(H,G),u(H,X),u(X,tt),u(tt,et),u(X,nt),u(X,rt),u(rt,ot),u(X,at),u(X,st),u(st,dt),u(e,ut),u(e,lt),u(lt,ct),u(ct,ft),u(e,mt),u(e,pt),u(pt,gt),u(gt,bt),u(bt,yt),u(yt,vt),u(vt,$t),u(vt,wt),u(vt,xt),u(vt,_t),u(yt,Mt),u(yt,St),u(St,kt),u(St,Dt),u(St,Tt),u(St,Lt),u(yt,Ot),u(yt,Yt),u(Yt,Ct),u(Yt,Et),u(Yt,Ht),u(Yt,Nt)},p(t,e){4&e&&!d(r.src,o=t[2].from.logo)&&g(r,"src",o),4&e&&jt!==(jt=t[2].from.shortName+"")&&y(p,jt),"yes"!==t[0]?Rt?Rt.p(t,e):(Rt=it(t),Rt.c(),Rt.m(w,null)):Rt&&(Rt.d(1),Rt=null),4&e&&At!==(At=z(t[2].date).format("DD/MM/YY")+"")&&y(k,At),4&e&&Pt!==(Pt=t[2].serial+"")&&y(C,Pt),4&e&&zt!==(zt=t[2].from.name+"")&&y(A,zt),4&e&&It!==(It=t[2].from.address+"")&&y(q,It),4&e&&qt!==(qt=t[2].from.piva+"")&&y(V,qt),4&e&&Jt!==(Jt=t[2].from.email+"")&&y(Z,Jt),4&e&&Wt!==(Wt=t[2].from.phone+"")&&y(Q,Wt),4&e&&Vt!==(Vt=t[2].to.name+"")&&y(et,Vt),4&e&&Ft!==(Ft=t[2].to.address+"")&&y(ot,Ft),4&e&&Ut!==(Ut=t[2].to.piva+"")&&y(dt,Ut),64&e&&b(ft,"style",t[6]),128&e&&ht!==(ht=JSON.stringify(t[7]))&&b(ft,"rows",ht),16&e&&y(xt,t[4]),8&e&&y(_t,t[3]),32&e&&y(Tt,t[5]),8&e&&y(Lt,t[3]),256&e&&y(Ht,t[8]),8&e&&y(Nt,t[3])},d(t){t&&c(e),Rt&&Rt.d()}}}function it(t){let e,n,o,a,s,d;return{c(){e=f("div"),n=f("button"),n.innerHTML='<i class="bi-printer-fill"></i>',o=m(),a=f("button"),a.innerHTML='<i class="bi-arrows-fullscreen"></i>',g(n,"class","btn btn-default"),g(a,"class","btn btn-default"),v(e,"text-align","right"),v(e,"padding-right","60px")},m(i,c){l(i,e,c),u(e,n),u(e,o),u(e,a),s||(d=[p(n,"click",(function(){r(q(t[13],200))&&q(t[13],200).apply(this,arguments)})),p(a,"click",(function(){r(q(t[14],200))&&q(t[14],200).apply(this,arguments)}))],s=!0)},p(e,n){t=e},d(t){t&&c(e),s=!1,i(d)}}}function rt(e){let n;function i(t,e){return t[2]?.from&&t[2].to?nt:et}let r=i(e),o=r(e);return{c(){o.c(),n=h(""),this.c=t},m(t,e){o.m(t,e),l(t,n,e)},p(t,[e]){r===(r=i(t))&&o?o.p(t,e):(o.d(1),o=r(t),o&&(o.c(),o.m(n.parentNode,n)))},i:t,o:t,d(t){o.d(t),t&&c(n)}}}function ot(t,e,n){let i,r,{style:o}=e,a="",{id:s}=e,{printer:d}=e,{items:u}=e,{headers:l}=e;let c,f,h,m=[];J.addComponent("table",A);return t.$$set=t=>{"style"in t&&n(11,o=t.style),"id"in t&&n(10,s=t.id),"printer"in t&&n(0,d=t.printer),"items"in t&&n(1,u=t.items),"headers"in t&&n(2,l=t.headers)},t.$$.update=()=>{if(7231&t.$$.dirty){if(s||n(10,s=null),o&&(n(12,i=X(o)),n(6,a=J.getChildStyleToPass(i,null==tt?void 0:tt.vars))),d||n(0,d="no"),u?"string"==typeof u&&n(1,u=JSON.parse(u)):n(1,u=[]),l){if("string"==typeof l)switch(n(2,l=JSON.parse(l)),l.date||n(2,l.date=new Date,l),l.category||n(2,l.category="items",l),l.country||n(2,l.country="it",l),l.country){case"it":case"eu":n(3,r="€");break;case"us":n(3,r="$")}}else n(2,l=null);(null==u?void 0:u.length)&&n(7,m=u.map(((t,e)=>{var n,i;return{_id:e.toString(),price:t.unitaryPrice.toString()+r+" / "+(t.unit?t.unit:"unità"),desc:t.desc,quantity:(null===(i=null===(n=t.quantity)||void 0===n?void 0:n.toString)||void 0===i?void 0:i.call(n))||"1",subtotal:(t.unitaryPrice*(t.quantity||1)).toString()+r,vat:`${(Math.round(.01*t.taxPercentage*t.unitaryPrice*(t.quantity||1)*100)/100).toString()} (${t.taxPercentage}%)`,total:(t.unitaryPrice*(t.quantity||1)+Math.round(.01*t.taxPercentage*t.unitaryPrice*(t.quantity||1)*100)/100).toString()+r}}))),n(4,c=null==u?void 0:u.map((t=>t.unitaryPrice*(t.quantity||1))).reduce(((t,e)=>t+e),0)),n(5,f=Math.round(100*u.map((t=>t.unitaryPrice*(t.quantity||1)*t.taxPercentage*.01)).reduce(((t,e)=>t+e),0))/100),n(8,h=c+f)}},[d,u,l,r,c,f,a,m,h,[{key:"desc",label:"descrizione",nosort:!0},{key:"price",label:"prezzo",nosort:!0},{key:"quantity",label:"quantità",nosort:!0},{key:"subtotal",label:"subtotal",nosort:!0},{key:"vat",label:"iva",nosort:!0},{key:"total",label:"totale",nosort:!0}],s,o,i,()=>function(t){const e=window.open("","PRINT","height=400,width=600");e.document.write("<html><head><title>"+document.title+"</title>"),e.document.write("</head><body >"),e.document.write(`<style>@page { size: auto; margin: 0mm; }</style><hb-page-invoice printer="yes" items='${JSON.stringify(t.items)}' headers='${JSON.stringify(t.headers)}'></hb-page-invoice>`),e.document.write("</body></html>");const n=document.createElement("script");n.id="hb-page-invoice-script",n.src=`https://cdn.jsdelivr.net/npm/@htmlbricks/hb-page-invoice@${t.version}/release/release.js`,location.href.includes("localhost")&&(n.src="http://localhost:6006/page-invoice/dist/release.js"),e.document.head.appendChild(n),setTimeout((()=>{e.print(),e.close()}),2e3)}({headers:l,items:u,version:A}),()=>function(t){const e=window.open("","PRINT","height=400,width=600");e.document.write("<html><head><title>"+document.title+"</title>"),e.document.write("</head><body >"),e.document.write(`<style>@page { size: auto; margin: 0mm; }</style><hb-page-invoice items='${JSON.stringify(t.items)}' headers='${JSON.stringify(t.headers)}'></hb-page-invoice>`),e.document.write("</body></html>");const n=document.createElement("script");n.id="hb-page-invoice-script",n.src=`https://cdn.jsdelivr.net/npm/@htmlbricks/hb-page-invoice@${t.version}/release/release.js`,location.href.includes("localhost")&&(n.src="http://localhost:6006/page-invoice/dist/release.js"),e.document.head.appendChild(n)}({headers:l,items:u,version:A})]}class at extends j{constructor(t){super(),this.shadowRoot.innerHTML='<style>@charset "UTF-8";@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@latest/font/bootstrap-icons.css");:host{--bs-blue:var(--bs-primary,#07689f);--bs-indigo:#6610f2;--bs-purple:#6f42c1;--bs-pink:#d63384;--bs-red:var(--bs-danger,#f67280);--bs-orange:#fd7e14;--bs-yellow:#ffc107;--bs-green:var(--bs-warning,#ffc107);--bs-teal:#20c997;--bs-cyan:var(--bs-info,#a2d5f2);--bs-white:#fff;--bs-gray:var(--bs-secondary,#c9d6df);--bs-gray-dark:#343a40;--bs-gray-100:#f8f9fa;--bs-gray-200:#e9ecef;--bs-gray-300:#dee2e6;--bs-gray-400:#ced4da;--bs-gray-500:#adb5bd;--bs-gray-600:var(--bs-secondary,#c9d6df);--bs-gray-700:#495057;--bs-gray-800:#343a40;--bs-gray-900:#212529;--bs-primary:var(--bs-primary,#07689f);--bs-secondary:var(--bs-secondary,#c9d6df);--bs-success:var(--bs-warning,#ffc107);--bs-info:var(--bs-info,#a2d5f2);--bs-warning:#ffc107;--bs-danger:var(--bs-danger,#f67280);--bs-light:#f8f9fa;--bs-dark:#212529;--bs-primary-rgb:13, 110, 253;--bs-secondary-rgb:108, 117, 125;--bs-success-rgb:25, 135, 84;--bs-info-rgb:13, 202, 240;--bs-warning-rgb:255, 193, 7;--bs-danger-rgb:220, 53, 69;--bs-light-rgb:248, 249, 250;--bs-dark-rgb:33, 37, 41;--bs-white-rgb:255, 255, 255;--bs-black-rgb:0, 0, 0;--bs-body-color-rgb:33, 37, 41;--bs-body-bg-rgb:255, 255, 255;--bs-font-sans-serif:system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--bs-font-monospace:SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--bs-gradient:linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));--bs-body-font-family:var(--bs-font-sans-serif);--bs-body-font-size:1rem;--bs-body-font-weight:400;--bs-body-line-height:1.5;--bs-body-color:#212529;--bs-body-bg:#fff}*,*::before,*::after{box-sizing:border-box}@media(prefers-reduced-motion: no-preference){:host{scroll-behavior:smooth}}@media(min-width: 1200px){}@media(min-width: 1200px){}@media(min-width: 1200px){}@media(min-width: 1200px){}img{vertical-align:middle}button{border-radius:0}button:focus:not(:focus-visible){outline:0}button{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button{text-transform:none}button{-webkit-appearance:button}button:not(:disabled){cursor:pointer}::-moz-focus-inner{padding:0;border-style:none}@media(min-width: 1200px){}::-webkit-datetime-edit-fields-wrapper,::-webkit-datetime-edit-text,::-webkit-datetime-edit-minute,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-year-field{padding:0}::-webkit-inner-spin-button{height:auto}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-color-swatch-wrapper{padding:0}::file-selector-button{font:inherit}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}@media(min-width: 1200px){}@media(min-width: 1200px){}@media(min-width: 1200px){}@media(min-width: 1200px){}@media(min-width: 1200px){}@media(min-width: 1200px){}.container{width:100%;padding-right:var(--bs-gutter-x, 0.75rem);padding-left:var(--bs-gutter-x, 0.75rem);margin-right:auto;margin-left:auto}@media(min-width: 576px){.container{max-width:540px}}@media(min-width: 768px){.container{max-width:720px}}@media(min-width: 992px){.container{max-width:960px}}@media(min-width: 1200px){.container{max-width:1140px}}@media(min-width: 1400px){.container{max-width:1320px}}.row{--bs-gutter-x:1.5rem;--bs-gutter-y:0;display:flex;flex-wrap:wrap;margin-top:calc(-1 * var(--bs-gutter-y));margin-right:calc(-0.5 * var(--bs-gutter-x));margin-left:calc(-0.5 * var(--bs-gutter-x))}.row>*{flex-shrink:0;width:100%;max-width:100%;padding-right:calc(var(--bs-gutter-x) * 0.5);padding-left:calc(var(--bs-gutter-x) * 0.5);margin-top:var(--bs-gutter-y)}.col{flex:1 0 0%}@media(min-width: 576px){}@media(min-width: 768px){}@media(min-width: 992px){}@media(min-width: 1200px){}@media(min-width: 1400px){}.btn{display:inline-block;font-weight:400;line-height:1.5;color:#212529;text-align:center;text-decoration:none;vertical-align:middle;cursor:pointer;user-select:none;background-color:transparent;border:1px solid transparent;padding:0.375rem 0.75rem;font-size:1rem;border-radius:0.25rem;transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out}@media(prefers-reduced-motion: reduce){.btn{transition:none}}.btn:hover{color:#212529}.btn:focus{outline:0;box-shadow:0 0 0 0.25rem rgba(13, 110, 253, 0.25)}.btn:disabled{pointer-events:none;opacity:0.65}@media(min-width: 576px){}@media(min-width: 768px){}@media(min-width: 992px){}@media(min-width: 1200px){}@media(min-width: 1400px){}@media(min-width: 1200px){}@media print{}:host{font-family:"Roboto", sans-serif;display:block;margin:40px 0px 40px 0px}</style>',N(this,{target:this.shadowRoot,props:$(this.attributes),customElement:!0},ot,rt,o,{style:11,id:10,printer:0,items:1,headers:2},null),t&&(t.target&&l(t.target,this,t.anchor),t.props&&(this.$set(t.props),Y()))}static get observedAttributes(){return["style","id","printer","items","headers"]}get style(){return this.$$.ctx[11]}set style(t){this.$$set({style:t}),Y()}get id(){return this.$$.ctx[10]}set id(t){this.$$set({id:t}),Y()}get printer(){return this.$$.ctx[0]}set printer(t){this.$$set({printer:t}),Y()}get items(){return this.$$.ctx[1]}set items(t){this.$$set({items:t}),Y()}get headers(){return this.$$.ctx[2]}set headers(t){this.$$set({headers:t}),Y()}}return customElements.define("hb-page-invoice",at),at}();
|
|
1
|
+
var release=function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function i(t){t.forEach(e)}function r(t){return"function"==typeof t}function o(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}let a,s;function d(t,e){return a||(a=document.createElement("a")),a.href=e,t===a.href}function u(t,e){t.appendChild(e)}function l(t,e,n){t.insertBefore(e,n||null)}function c(t){t.parentNode.removeChild(t)}function f(t){return document.createElement(t)}function h(t){return document.createTextNode(t)}function m(){return h(" ")}function p(t,e,n,i){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}function g(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function b(t,e,n){e in t?t[e]="boolean"==typeof t[e]&&""===n||n:g(t,e,n)}function y(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function v(t,e,n,i){null===n?t.style.removeProperty(e):t.style.setProperty(e,n,i?"important":"")}function $(t){const e={};for(const n of t)e[n.name]=n.value;return e}function w(t){s=t}const x=[],_=[],M=[],S=[],k=Promise.resolve();let D=!1;function T(t){M.push(t)}const L=new Set;let O=0;function Y(){const t=s;do{for(;O<x.length;){const t=x[O];O++,w(t),C(t.$$)}for(w(null),x.length=0,O=0;_.length;)_.pop()();for(let t=0;t<M.length;t+=1){const e=M[t];L.has(e)||(L.add(e),e())}M.length=0}while(x.length);for(;S.length;)S.pop()();D=!1,L.clear(),w(t)}function C(t){if(null!==t.fragment){t.update(),i(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(T)}}const E=new Set;function H(t,e){-1===t.$$.dirty[0]&&(x.push(t),D||(D=!0,k.then(Y)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function N(o,a,d,u,l,f,h,m=[-1]){const p=s;w(o);const g=o.$$={fragment:null,ctx:null,props:f,update:t,not_equal:l,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(a.context||(p?p.$$.context:[])),callbacks:n(),dirty:m,skip_bound:!1,root:a.target||p.$$.root};h&&h(g.root);let b=!1;if(g.ctx=d?d(o,a.props||{},((t,e,...n)=>{const i=n.length?n[0]:e;return g.ctx&&l(g.ctx[t],g.ctx[t]=i)&&(!g.skip_bound&&g.bound[t]&&g.bound[t](i),b&&H(o,t)),e})):[],g.update(),b=!0,i(g.before_update),g.fragment=!!u&&u(g.ctx),a.target){if(a.hydrate){const t=function(t){return Array.from(t.childNodes)}(a.target);g.fragment&&g.fragment.l(t),t.forEach(c)}else g.fragment&&g.fragment.c();a.intro&&((y=o.$$.fragment)&&y.i&&(E.delete(y),y.i(v))),function(t,n,o,a){const{fragment:s,on_mount:d,on_destroy:u,after_update:l}=t.$$;s&&s.m(n,o),a||T((()=>{const n=d.map(e).filter(r);u?u.push(...n):i(n),t.$$.on_mount=[]})),l.forEach(T)}(o,a.target,a.anchor,a.customElement),Y()}var y,v;w(p)}let j;"function"==typeof HTMLElement&&(j=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(e).filter(r);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){i(this.$$.on_disconnect)}$destroy(){!function(t,e){const n=t.$$;null!==n.fragment&&(i(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});var A="0.8.30";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function P(t){var e={exports:{}};return t(e,e.exports),e.exports}var z=P((function(t,e){t.exports=function(){var t=1e3,e=6e4,n=36e5,i="millisecond",r="second",o="minute",a="hour",s="day",d="week",u="month",l="quarter",c="year",f="date",h="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},b=function(t,e,n){var i=String(t);return!i||i.length>=e?t:""+Array(e+1-i.length).join(n)+t},y={s:b,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),i=Math.floor(n/60),r=n%60;return(e<=0?"+":"-")+b(i,2,"0")+":"+b(r,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var i=12*(n.year()-e.year())+(n.month()-e.month()),r=e.clone().add(i,u),o=n-r<0,a=e.clone().add(i+(o?-1:1),u);return+(-(i+(n-r)/(o?r-a:a-r))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:u,y:c,w:d,d:s,D:f,h:a,m:o,s:r,ms:i,Q:l}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},v="en",$={};$[v]=g;var w=function(t){return t instanceof S},x=function(t,e,n){var i;if(!t)return v;if("string"==typeof t)$[t]&&(i=t),e&&($[t]=e,i=t);else{var r=t.name;$[r]=t,i=r}return!n&&i&&(v=i),i||!n&&v},_=function(t,e){if(w(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new S(n)},M=y;M.l=x,M.i=w,M.w=function(t,e){return _(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var S=function(){function g(t){this.$L=x(t.locale,null,!0),this.parse(t)}var b=g.prototype;return b.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(M.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var i=e.match(m);if(i){var r=i[2]-1||0,o=(i[7]||"0").substring(0,3);return n?new Date(Date.UTC(i[1],r,i[3]||1,i[4]||0,i[5]||0,i[6]||0,o)):new Date(i[1],r,i[3]||1,i[4]||0,i[5]||0,i[6]||0,o)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},b.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},b.$utils=function(){return M},b.isValid=function(){return!(this.$d.toString()===h)},b.isSame=function(t,e){var n=_(t);return this.startOf(e)<=n&&n<=this.endOf(e)},b.isAfter=function(t,e){return _(t)<this.startOf(e)},b.isBefore=function(t,e){return this.endOf(e)<_(t)},b.$g=function(t,e,n){return M.u(t)?this[e]:this.set(n,t)},b.unix=function(){return Math.floor(this.valueOf()/1e3)},b.valueOf=function(){return this.$d.getTime()},b.startOf=function(t,e){var n=this,i=!!M.u(e)||e,l=M.p(t),h=function(t,e){var r=M.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return i?r:r.endOf(s)},m=function(t,e){return M.w(n.toDate()[t].apply(n.toDate("s"),(i?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},p=this.$W,g=this.$M,b=this.$D,y="set"+(this.$u?"UTC":"");switch(l){case c:return i?h(1,0):h(31,11);case u:return i?h(1,g):h(0,g+1);case d:var v=this.$locale().weekStart||0,$=(p<v?p+7:p)-v;return h(i?b-$:b+(6-$),g);case s:case f:return m(y+"Hours",0);case a:return m(y+"Minutes",1);case o:return m(y+"Seconds",2);case r:return m(y+"Milliseconds",3);default:return this.clone()}},b.endOf=function(t){return this.startOf(t,!1)},b.$set=function(t,e){var n,d=M.p(t),l="set"+(this.$u?"UTC":""),h=(n={},n[s]=l+"Date",n[f]=l+"Date",n[u]=l+"Month",n[c]=l+"FullYear",n[a]=l+"Hours",n[o]=l+"Minutes",n[r]=l+"Seconds",n[i]=l+"Milliseconds",n)[d],m=d===s?this.$D+(e-this.$W):e;if(d===u||d===c){var p=this.clone().set(f,1);p.$d[h](m),p.init(),this.$d=p.set(f,Math.min(this.$D,p.daysInMonth())).$d}else h&&this.$d[h](m);return this.init(),this},b.set=function(t,e){return this.clone().$set(t,e)},b.get=function(t){return this[M.p(t)]()},b.add=function(i,l){var f,h=this;i=Number(i);var m=M.p(l),p=function(t){var e=_(h);return M.w(e.date(e.date()+Math.round(t*i)),h)};if(m===u)return this.set(u,this.$M+i);if(m===c)return this.set(c,this.$y+i);if(m===s)return p(1);if(m===d)return p(7);var g=(f={},f[o]=e,f[a]=n,f[r]=t,f)[m]||1,b=this.$d.getTime()+i*g;return M.w(b,this)},b.subtract=function(t,e){return this.add(-1*t,e)},b.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||h;var i=t||"YYYY-MM-DDTHH:mm:ssZ",r=M.z(this),o=this.$H,a=this.$m,s=this.$M,d=n.weekdays,u=n.months,l=function(t,n,r,o){return t&&(t[n]||t(e,i))||r[n].substr(0,o)},c=function(t){return M.s(o%12||12,t,"0")},f=n.meridiem||function(t,e,n){var i=t<12?"AM":"PM";return n?i.toLowerCase():i},m={YY:String(this.$y).slice(-2),YYYY:this.$y,M:s+1,MM:M.s(s+1,2,"0"),MMM:l(n.monthsShort,s,u,3),MMMM:l(u,s),D:this.$D,DD:M.s(this.$D,2,"0"),d:String(this.$W),dd:l(n.weekdaysMin,this.$W,d,2),ddd:l(n.weekdaysShort,this.$W,d,3),dddd:d[this.$W],H:String(o),HH:M.s(o,2,"0"),h:c(1),hh:c(2),a:f(o,a,!0),A:f(o,a,!1),m:String(a),mm:M.s(a,2,"0"),s:String(this.$s),ss:M.s(this.$s,2,"0"),SSS:M.s(this.$ms,3,"0"),Z:r};return i.replace(p,(function(t,e){return e||m[t]||r.replace(":","")}))},b.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},b.diff=function(i,f,h){var m,p=M.p(f),g=_(i),b=(g.utcOffset()-this.utcOffset())*e,y=this-g,v=M.m(this,g);return v=(m={},m[c]=v/12,m[u]=v,m[l]=v/3,m[d]=(y-b)/6048e5,m[s]=(y-b)/864e5,m[a]=y/n,m[o]=y/e,m[r]=y/t,m)[p]||y,h?v:M.a(v)},b.daysInMonth=function(){return this.endOf(u).$D},b.$locale=function(){return $[this.$L]},b.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),i=x(t,e,!0);return i&&(n.$L=i),n},b.clone=function(){return M.w(this.$d,this)},b.toDate=function(){return new Date(this.valueOf())},b.toJSON=function(){return this.isValid()?this.toISOString():null},b.toISOString=function(){return this.$d.toISOString()},b.toString=function(){return this.$d.toUTCString()},g}(),k=S.prototype;return _.prototype=k,[["$ms",i],["$s",r],["$m",o],["$H",a],["$W",s],["$M",u],["$y",c],["$D",f]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),_.extend=function(t,e){return t.$i||(t(e,S,_),t.$i=!0),_},_.locale=x,_.isDayjs=w,_.unix=function(t){return _(1e3*t)},_.en=$[v],_.Ls=$,_.p={},_}()}));function I(t,e,n){var i,r,o,a,s;function d(){var u=Date.now()-a;u<e&&u>=0?i=setTimeout(d,e-u):(i=null,n||(s=t.apply(o,r),o=r=null))}null==e&&(e=100);var u=function(){o=this,r=arguments,a=Date.now();var u=n&&!i;return i||(i=setTimeout(d,e)),u&&(s=t.apply(o,r),o=r=null),s};return u.clear=function(){i&&(clearTimeout(i),i=null)},u.flush=function(){i&&(s=t.apply(o,r),o=r=null,clearTimeout(i),i=null)},u}I.debounce=I;var q=I;P((function(t,e){t.exports=function(t){function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=e(t),i={name:"it",weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),weekStart:1,monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"tra %s",past:"%s fa",s:"qualche secondo",m:"un minuto",mm:"%d minuti",h:"un' ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:function(t){return t+"º"}};return n.default.locale(i,null,!0),i}(z)}));var J=P((function(t,e){e.__esModule=!0,e.LanguageTranslator=e.addComponent=e.getChildStyleToPass=void 0,e.getChildStyleToPass=function(t,e){var n,i,r="";if(t&&(null==e?void 0:e.length)&&(null===(n=Object.keys(t))||void 0===n?void 0:n.length)&&(null===(i=null==e?void 0:e.filter((function(e){return Object.keys(t).includes(e.name)})))||void 0===i?void 0:i.length))for(var o=function(n){(null==e?void 0:e.filter((function(e){return e.name===n&&e.defaultValue!==t[n]})))&&(r+="".concat(n,":").concat(t[n],";"))},a=0,s=Object.keys(t);a<s.length;a++){o(s[a])}return r},e.addComponent=function(t,e,n){if(!document.getElementById("hb-"+t+"-script")){var i=document.createElement("script");i.id="hb-"+t+"-script",i.src="https://cdn.jsdelivr.net/npm/@htmlbricks/hb-".concat(t,"@").concat(e,"/release/release.js"),n&&location.href.includes("localhost")&&(i.src="http://localhost:6006/".concat(t,"/dist/release.js")),document.head.appendChild(i)}};var n=function(){function t(t){if(!(null==t?void 0:t.dictionary))throw new Error("no dictionary provided");this.dictionary=t.dictionary,this.setLang(null==t?void 0:t.lang)}return t.prototype.setLang=function(e){e||(e=t.getDefaultLang()),this.lang=e},t.prototype.translateWord=function(e,n){return t.getDictionaryWord(e,this.dictionary,n||this.lang)},t.prototype.translateDate=function(e,n,i){return t.formatDate(e,n,i||this.lang)},t.getDefaultLang=function(){var t,e,n,i,r,o="en";return(null===navigator||void 0===navigator?void 0:navigator.languages)&&(null===(n=null===(e=null===(t=navigator.languages[0])||void 0===t?void 0:t.split("-")[0])||void 0===e?void 0:e.toLowerCase())||void 0===n?void 0:n.length)&&(o=null===(r=null===(i=navigator.languages[0])||void 0===i?void 0:i.split("-")[0])||void 0===r?void 0:r.toLowerCase()),o},t.getDictionaryWord=function(e,n,i){var r;if(!e)throw new Error("no wordKey provided");if(!n)throw new Error("no dictionary provided");if(i&&(null===(r=n[i])||void 0===r?void 0:r[e]))return n[i][e];var o="",a=t.getDefaultLang();if(!i||a!==i){var s=null==n?void 0:n[a];(null==s?void 0:s[e])&&(o=s[e])}return o},t.formatDate=function(e,n,i){if(!e)throw new Error("no date provided");if("function"!=typeof e.getMonth)throw new Error("wrong date format");return new Intl.DateTimeFormat(i||t.getDefaultLang(),n).format(e)},t}();e.LanguageTranslator=n})),W=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,V=/\n/g,F=/^\s*/,U=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,R=/^:\s*/,Z=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,B=/^[;\s]*/,K=/^\s+|\s+$/g,Q="";function G(t){return t?t.replace(K,Q):Q}var X=function(t,e){var n,i=null;if(!t||"string"!=typeof t)return i;for(var r,o,a=function(t,e){if("string"!=typeof t)throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var n=1,i=1;function r(t){var e=t.match(V);e&&(n+=e.length);var r=t.lastIndexOf("\n");i=~r?t.length-r:i+t.length}function o(){var t={line:n,column:i};return function(e){return e.position=new a(t),u(),e}}function a(t){this.start=t,this.end={line:n,column:i},this.source=e.source}function s(r){var o=new Error(e.source+":"+n+":"+i+": "+r);if(o.reason=r,o.filename=e.source,o.line=n,o.column=i,o.source=t,!e.silent)throw o}function d(e){var n=e.exec(t);if(n){var i=n[0];return r(i),t=t.slice(i.length),n}}function u(){d(F)}function l(t){var e;for(t=t||[];e=c();)!1!==e&&t.push(e);return t}function c(){var e=o();if("/"==t.charAt(0)&&"*"==t.charAt(1)){for(var n=2;Q!=t.charAt(n)&&("*"!=t.charAt(n)||"/"!=t.charAt(n+1));)++n;if(n+=2,Q===t.charAt(n-1))return s("End of comment missing");var a=t.slice(2,n-2);return i+=2,r(a),t=t.slice(n),i+=2,e({type:"comment",comment:a})}}function f(){var t=o(),e=d(U);if(e){if(c(),!d(R))return s("property missing ':'");var n=d(Z),i=t({type:"declaration",property:G(e[0].replace(W,Q)),value:n?G(n[0].replace(W,Q)):Q});return d(B),i}}return a.prototype.content=t,u(),function(){var t,e=[];for(l(e);t=f();)!1!==t&&(e.push(t),l(e));return e}()}(t),s="function"==typeof e,d=0,u=a.length;d<u;d++)r=(n=a[d]).property,o=n.value,s?e(r,o,n):o&&(i||(i={}),i[r]=o);return i},tt={vars:[{name:"--bs-primary",valueType:"color",theme:"bootstrap",defaultValue:"#07689f"},{name:"--bs-secondary",valueType:"color",theme:"bootstrap",defaultValue:"#c9d6df"},{name:"--bs-success",valueType:"color",theme:"bootstrap",defaultValue:"#11d3bc"},{name:"--bs-info",valueType:"color",theme:"bootstrap",defaultValue:"#a2d5f2"},{name:"--bs-warning",valueType:"color",theme:"bootstrap",defaultValue:"#ffc107"},{name:"--bs-danger",valueType:"color",theme:"bootstrap",defaultValue:"#f67280"}],parts:[]};function et(e){let n;return{c(){n=h("error")},m(t,e){l(t,n,e)},p:t,d(t){t&&c(n)}}}function nt(t){let e,n,i,r,o,a,s,p,$,w,x,_,M,S,k,D,T,L,O,Y,C,E,H,N,j,A,P,I,q,J,W,V,F,U,R,Z,B,K,Q,G,X,tt,et,nt,rt,ot,at,st,dt,ut,lt,ct,ft,ht,mt,pt,gt,bt,yt,vt,$t,wt,xt,_t,Mt,St,kt,Dt,Tt,Lt,Ot,Yt,Ct,Et,Ht,Nt,jt=t[2].from.shortName+"",At=z(t[2].date).format("DD/MM/YY")+"",Pt=t[2].serial+"",zt=t[2].from.name+"",It=t[2].from.address+"",qt=t[2].from.piva+"",Jt=t[2].from.email+"",Wt=t[2].from.phone+"",Vt=t[2].to.name+"",Ft=t[2].to.address+"",Ut=t[2].to.piva+"",Rt="yes"!==t[0]&&it(t);return{c(){e=f("div"),n=f("div"),i=f("div"),r=f("img"),a=m(),s=f("span"),p=h(jt),$=m(),w=f("div"),Rt&&Rt.c(),x=m(),_=f("div"),M=f("div"),S=h("Data: "),k=h(At),D=m(),T=f("div"),L=m(),O=f("div"),Y=h("Fattura numero: "),C=h(Pt),E=m(),H=f("div"),N=f("div"),j=f("div"),A=h(zt),P=m(),I=f("div"),q=h(It),J=m(),W=f("div"),V=h(qt),F=m(),U=f("div"),R=f("div"),Z=h(Jt),B=m(),K=f("div"),Q=h(Wt),G=m(),X=f("div"),tt=f("div"),et=h(Vt),nt=m(),rt=f("div"),ot=h(Ft),at=m(),st=f("div"),dt=h(Ut),ut=m(),lt=f("div"),ct=f("div"),ft=f("hb-table"),mt=m(),pt=f("div"),gt=f("div"),bt=f("div"),yt=f("div"),vt=f("div"),$t=f("span"),$t.textContent="SubTotale:",wt=m(),xt=h(t[4]),_t=h(t[3]),Mt=m(),St=f("div"),kt=f("span"),kt.textContent="Tasse:",Dt=m(),Tt=h(t[5]),Lt=h(t[3]),Ot=m(),Yt=f("div"),Ct=f("span"),Ct.textContent="Totale:",Et=m(),Ht=h(t[8]),Nt=h(t[3]),v(r,"height","80px"),v(r,"margin","0px 0px 0px 60px"),g(r,"alt",""),d(r.src,o=t[2].from.logo)||g(r,"src",o),v(s,"margin","0px 40px 0px 40px"),g(i,"class","col"),g(w,"class","col"),g(n,"class","row"),v(n,"margin-top","20px"),g(M,"class","col"),g(T,"class","col"),g(O,"class","col"),g(_,"class","row"),v(_,"margin-top","60px"),g(N,"class","col"),g(U,"class","col"),g(X,"class","col"),g(H,"class","row"),v(H,"margin-top","40px"),b(ft,"style",t[6]),b(ft,"disablepagination","yes"),b(ft,"rows",ht=JSON.stringify(t[7])),b(ft,"headers",JSON.stringify(t[9])),g(ct,"class","col"),g(lt,"class","row"),v(lt,"margin-top","40px"),v($t,"display","inline-block"),v($t,"min-width","200px"),v(vt,"line-height","25px"),v(kt,"display","inline-block"),v(kt,"min-width","200px"),v(St,"line-height","25px"),v(Ct,"display","inline-block"),v(Ct,"min-width","200px"),v(Yt,"line-height","25px"),v(Yt,"font-weight","bold"),v(yt,"text-align","left"),v(bt,"width","300px"),v(bt,"float","right"),g(gt,"class","col"),g(pt,"class","row"),v(pt,"margin-top","40px"),g(e,"id","page"),g(e,"class","container")},m(t,o){l(t,e,o),u(e,n),u(n,i),u(i,r),u(i,a),u(i,s),u(s,p),u(n,$),u(n,w),Rt&&Rt.m(w,null),u(e,x),u(e,_),u(_,M),u(M,S),u(M,k),u(_,D),u(_,T),u(_,L),u(_,O),u(O,Y),u(O,C),u(e,E),u(e,H),u(H,N),u(N,j),u(j,A),u(N,P),u(N,I),u(I,q),u(N,J),u(N,W),u(W,V),u(H,F),u(H,U),u(U,R),u(R,Z),u(U,B),u(U,K),u(K,Q),u(H,G),u(H,X),u(X,tt),u(tt,et),u(X,nt),u(X,rt),u(rt,ot),u(X,at),u(X,st),u(st,dt),u(e,ut),u(e,lt),u(lt,ct),u(ct,ft),u(e,mt),u(e,pt),u(pt,gt),u(gt,bt),u(bt,yt),u(yt,vt),u(vt,$t),u(vt,wt),u(vt,xt),u(vt,_t),u(yt,Mt),u(yt,St),u(St,kt),u(St,Dt),u(St,Tt),u(St,Lt),u(yt,Ot),u(yt,Yt),u(Yt,Ct),u(Yt,Et),u(Yt,Ht),u(Yt,Nt)},p(t,e){4&e&&!d(r.src,o=t[2].from.logo)&&g(r,"src",o),4&e&&jt!==(jt=t[2].from.shortName+"")&&y(p,jt),"yes"!==t[0]?Rt?Rt.p(t,e):(Rt=it(t),Rt.c(),Rt.m(w,null)):Rt&&(Rt.d(1),Rt=null),4&e&&At!==(At=z(t[2].date).format("DD/MM/YY")+"")&&y(k,At),4&e&&Pt!==(Pt=t[2].serial+"")&&y(C,Pt),4&e&&zt!==(zt=t[2].from.name+"")&&y(A,zt),4&e&&It!==(It=t[2].from.address+"")&&y(q,It),4&e&&qt!==(qt=t[2].from.piva+"")&&y(V,qt),4&e&&Jt!==(Jt=t[2].from.email+"")&&y(Z,Jt),4&e&&Wt!==(Wt=t[2].from.phone+"")&&y(Q,Wt),4&e&&Vt!==(Vt=t[2].to.name+"")&&y(et,Vt),4&e&&Ft!==(Ft=t[2].to.address+"")&&y(ot,Ft),4&e&&Ut!==(Ut=t[2].to.piva+"")&&y(dt,Ut),64&e&&b(ft,"style",t[6]),128&e&&ht!==(ht=JSON.stringify(t[7]))&&b(ft,"rows",ht),16&e&&y(xt,t[4]),8&e&&y(_t,t[3]),32&e&&y(Tt,t[5]),8&e&&y(Lt,t[3]),256&e&&y(Ht,t[8]),8&e&&y(Nt,t[3])},d(t){t&&c(e),Rt&&Rt.d()}}}function it(t){let e,n,o,a,s,d;return{c(){e=f("div"),n=f("button"),n.innerHTML='<i class="bi-printer-fill"></i>',o=m(),a=f("button"),a.innerHTML='<i class="bi-arrows-fullscreen"></i>',g(n,"class","btn btn-default"),g(a,"class","btn btn-default"),v(e,"text-align","right"),v(e,"padding-right","60px")},m(i,c){l(i,e,c),u(e,n),u(e,o),u(e,a),s||(d=[p(n,"click",(function(){r(q(t[13],200))&&q(t[13],200).apply(this,arguments)})),p(a,"click",(function(){r(q(t[14],200))&&q(t[14],200).apply(this,arguments)}))],s=!0)},p(e,n){t=e},d(t){t&&c(e),s=!1,i(d)}}}function rt(e){let n;function i(t,e){return t[2]?.from&&t[2].to?nt:et}let r=i(e),o=r(e);return{c(){o.c(),n=h(""),this.c=t},m(t,e){o.m(t,e),l(t,n,e)},p(t,[e]){r===(r=i(t))&&o?o.p(t,e):(o.d(1),o=r(t),o&&(o.c(),o.m(n.parentNode,n)))},i:t,o:t,d(t){o.d(t),t&&c(n)}}}function ot(t,e,n){let i,r,{style:o}=e,a="",{id:s}=e,{printer:d}=e,{items:u}=e,{headers:l}=e;let c,f,h,m=[];J.addComponent("table",A);return t.$$set=t=>{"style"in t&&n(11,o=t.style),"id"in t&&n(10,s=t.id),"printer"in t&&n(0,d=t.printer),"items"in t&&n(1,u=t.items),"headers"in t&&n(2,l=t.headers)},t.$$.update=()=>{if(7231&t.$$.dirty){if(s||n(10,s=null),o&&(n(12,i=X(o)),n(6,a=J.getChildStyleToPass(i,null==tt?void 0:tt.vars))),d||n(0,d="no"),u?"string"==typeof u&&n(1,u=JSON.parse(u)):n(1,u=[]),l){if("string"==typeof l)switch(n(2,l=JSON.parse(l)),l.date||n(2,l.date=new Date,l),l.category||n(2,l.category="items",l),l.country||n(2,l.country="it",l),l.country){case"it":case"eu":n(3,r="€");break;case"us":n(3,r="$")}}else n(2,l=null);(null==u?void 0:u.length)&&n(7,m=u.map(((t,e)=>{var n,i;return{_id:e.toString(),price:t.unitaryPrice.toString()+r+" / "+(t.unit?t.unit:"unità"),desc:t.desc,quantity:(null===(i=null===(n=t.quantity)||void 0===n?void 0:n.toString)||void 0===i?void 0:i.call(n))||"1",subtotal:(t.unitaryPrice*(t.quantity||1)).toString()+r,vat:`${(Math.round(.01*t.taxPercentage*t.unitaryPrice*(t.quantity||1)*100)/100).toString()} (${t.taxPercentage}%)`,total:(t.unitaryPrice*(t.quantity||1)+Math.round(.01*t.taxPercentage*t.unitaryPrice*(t.quantity||1)*100)/100).toString()+r}}))),n(4,c=null==u?void 0:u.map((t=>t.unitaryPrice*(t.quantity||1))).reduce(((t,e)=>t+e),0)),n(5,f=Math.round(100*u.map((t=>t.unitaryPrice*(t.quantity||1)*t.taxPercentage*.01)).reduce(((t,e)=>t+e),0))/100),n(8,h=c+f)}},[d,u,l,r,c,f,a,m,h,[{key:"desc",label:"descrizione",nosort:!0},{key:"price",label:"prezzo",nosort:!0},{key:"quantity",label:"quantità",nosort:!0},{key:"subtotal",label:"subtotal",nosort:!0},{key:"vat",label:"iva",nosort:!0},{key:"total",label:"totale",nosort:!0}],s,o,i,()=>function(t){const e=window.open("","PRINT","height=400,width=600");e.document.write("<html><head><title>"+document.title+"</title>"),e.document.write("</head><body >"),e.document.write(`<style>@page { size: auto; margin: 0mm; }</style><hb-page-invoice printer="yes" items='${JSON.stringify(t.items)}' headers='${JSON.stringify(t.headers)}'></hb-page-invoice>`),e.document.write("</body></html>");const n=document.createElement("script");n.id="hb-page-invoice-script",n.src=`https://cdn.jsdelivr.net/npm/@htmlbricks/hb-page-invoice@${t.version}/release/release.js`,location.href.includes("localhost")&&(n.src="http://localhost:6006/page-invoice/dist/release.js"),e.document.head.appendChild(n),setTimeout((()=>{e.print(),e.close()}),2e3)}({headers:l,items:u,version:A}),()=>function(t){const e=window.open("","PRINT","height=400,width=600");e.document.write("<html><head><title>"+document.title+"</title>"),e.document.write("</head><body >"),e.document.write(`<style>@page { size: auto; margin: 0mm; }</style><hb-page-invoice items='${JSON.stringify(t.items)}' headers='${JSON.stringify(t.headers)}'></hb-page-invoice>`),e.document.write("</body></html>");const n=document.createElement("script");n.id="hb-page-invoice-script",n.src=`https://cdn.jsdelivr.net/npm/@htmlbricks/hb-page-invoice@${t.version}/release/release.js`,location.href.includes("localhost")&&(n.src="http://localhost:6006/page-invoice/dist/release.js"),e.document.head.appendChild(n)}({headers:l,items:u,version:A})]}class at extends j{constructor(t){super(),this.shadowRoot.innerHTML='<style>@charset "UTF-8";@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@latest/font/bootstrap-icons.css");:host{--bs-blue:var(--bs-primary,#07689f);--bs-indigo:#6610f2;--bs-purple:#6f42c1;--bs-pink:#d63384;--bs-red:var(--bs-danger,#f67280);--bs-orange:#fd7e14;--bs-yellow:#ffc107;--bs-green:var(--bs-warning,#ffc107);--bs-teal:#20c997;--bs-cyan:var(--bs-info,#a2d5f2);--bs-white:#fff;--bs-gray:var(--bs-secondary,#c9d6df);--bs-gray-dark:#343a40;--bs-gray-100:#f8f9fa;--bs-gray-200:#e9ecef;--bs-gray-300:#dee2e6;--bs-gray-400:#ced4da;--bs-gray-500:#adb5bd;--bs-gray-600:var(--bs-secondary,#c9d6df);--bs-gray-700:#495057;--bs-gray-800:#343a40;--bs-gray-900:#212529;--bs-primary:var(--bs-primary,#07689f);--bs-secondary:var(--bs-secondary,#c9d6df);--bs-success:var(--bs-warning,#ffc107);--bs-info:var(--bs-info,#a2d5f2);--bs-warning:#ffc107;--bs-danger:var(--bs-danger,#f67280);--bs-light:#f8f9fa;--bs-dark:#212529;--bs-primary-rgb:13, 110, 253;--bs-secondary-rgb:108, 117, 125;--bs-success-rgb:25, 135, 84;--bs-info-rgb:13, 202, 240;--bs-warning-rgb:255, 193, 7;--bs-danger-rgb:220, 53, 69;--bs-light-rgb:248, 249, 250;--bs-dark-rgb:33, 37, 41;--bs-white-rgb:255, 255, 255;--bs-black-rgb:0, 0, 0;--bs-body-color-rgb:33, 37, 41;--bs-body-bg-rgb:255, 255, 255;--bs-font-sans-serif:system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--bs-font-monospace:SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--bs-gradient:linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));--bs-body-font-family:var(--bs-font-sans-serif);--bs-body-font-size:1rem;--bs-body-font-weight:400;--bs-body-line-height:1.5;--bs-body-color:#212529;--bs-body-bg:#fff}*,*::before,*::after{box-sizing:border-box}@media(prefers-reduced-motion: no-preference){:host{scroll-behavior:smooth}}@media(min-width: 1200px){}@media(min-width: 1200px){}@media(min-width: 1200px){}@media(min-width: 1200px){}img{vertical-align:middle}button{border-radius:0}button:focus:not(:focus-visible){outline:0}button{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button{text-transform:none}button{-webkit-appearance:button}button:not(:disabled){cursor:pointer}::-moz-focus-inner{padding:0;border-style:none}@media(min-width: 1200px){}::-webkit-datetime-edit-fields-wrapper,::-webkit-datetime-edit-text,::-webkit-datetime-edit-minute,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-year-field{padding:0}::-webkit-inner-spin-button{height:auto}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-color-swatch-wrapper{padding:0}::file-selector-button{font:inherit}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}@media(min-width: 1200px){}@media(min-width: 1200px){}@media(min-width: 1200px){}@media(min-width: 1200px){}@media(min-width: 1200px){}@media(min-width: 1200px){}.container{width:100%;padding-right:var(--bs-gutter-x, 0.75rem);padding-left:var(--bs-gutter-x, 0.75rem);margin-right:auto;margin-left:auto}@media(min-width: 576px){.container{max-width:540px}}@media(min-width: 768px){.container{max-width:720px}}@media(min-width: 992px){.container{max-width:960px}}@media(min-width: 1200px){.container{max-width:1140px}}@media(min-width: 1400px){.container{max-width:1320px}}.row{--bs-gutter-x:1.5rem;--bs-gutter-y:0;display:flex;flex-wrap:wrap;margin-top:calc(-1 * var(--bs-gutter-y));margin-right:calc(-0.5 * var(--bs-gutter-x));margin-left:calc(-0.5 * var(--bs-gutter-x))}.row>*{flex-shrink:0;width:100%;max-width:100%;padding-right:calc(var(--bs-gutter-x) * 0.5);padding-left:calc(var(--bs-gutter-x) * 0.5);margin-top:var(--bs-gutter-y)}.col{flex:1 0 0%}@media(min-width: 576px){}@media(min-width: 768px){}@media(min-width: 992px){}@media(min-width: 1200px){}@media(min-width: 1400px){}.btn{display:inline-block;font-weight:400;line-height:1.5;color:#212529;text-align:center;text-decoration:none;vertical-align:middle;cursor:pointer;user-select:none;background-color:transparent;border:1px solid transparent;padding:0.375rem 0.75rem;font-size:1rem;border-radius:0.25rem;transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out}@media(prefers-reduced-motion: reduce){.btn{transition:none}}.btn:hover{color:#212529}.btn:focus{outline:0;box-shadow:0 0 0 0.25rem rgba(13, 110, 253, 0.25)}.btn:disabled{pointer-events:none;opacity:0.65}@media(min-width: 576px){}@media(min-width: 768px){}@media(min-width: 992px){}@media(min-width: 1200px){}@media(min-width: 1400px){}@media(min-width: 1200px){}@media print{}:host{font-family:"Roboto", sans-serif;display:block;margin:40px 0px 40px 0px}</style>',N(this,{target:this.shadowRoot,props:$(this.attributes),customElement:!0},ot,rt,o,{style:11,id:10,printer:0,items:1,headers:2},null),t&&(t.target&&l(t.target,this,t.anchor),t.props&&(this.$set(t.props),Y()))}static get observedAttributes(){return["style","id","printer","items","headers"]}get style(){return this.$$.ctx[11]}set style(t){this.$$set({style:t}),Y()}get id(){return this.$$.ctx[10]}set id(t){this.$$set({id:t}),Y()}get printer(){return this.$$.ctx[0]}set printer(t){this.$$set({printer:t}),Y()}get items(){return this.$$.ctx[1]}set items(t){this.$$set({items:t}),Y()}get headers(){return this.$$.ctx[2]}set headers(t){this.$$set({headers:t}),Y()}}return customElements.define("hb-page-invoice",at),at}();
|
|
2
2
|
//# sourceMappingURL=release.js.map
|