@tachybase/plugin-action-share 1.3.24 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(k,b){typeof exports=="object"&&typeof module!="undefined"?b(exports,require("@tachybase/client"),require("react-router"),require("react/jsx-runtime"),require("react"),require("@tachybase/schema"),require("@ant-design/icons"),require("antd"),require("antd-style"),require("@emotion/css"),require("react-router-dom")):typeof define=="function"&&define.amd?define(["exports","@tachybase/client","react-router","react/jsx-runtime","react","@tachybase/schema","@ant-design/icons","antd","antd-style","@emotion/css","react-router-dom"],b):(k=typeof globalThis!="undefined"?globalThis:k||self,b(k["@tachybase/plugin-action-share"]={},k["@tachybase/client"],k["react-router"],k.jsxRuntime,k.react,k["@tachybase/schema"],k["@ant-design/icons"],k.antd,k["antd-style"],k["@emotion/css"],k["react-router-dom"]))})(this,function(k,b,L,f,U,Q,K,q,R,$,mt){"use strict";var on=Object.defineProperty,an=Object.defineProperties;var sn=Object.getOwnPropertyDescriptors;var gt=Object.getOwnPropertySymbols;var ln=Object.prototype.hasOwnProperty,cn=Object.prototype.propertyIsEnumerable;var pt=(k,b,L)=>b in k?on(k,b,{enumerable:!0,configurable:!0,writable:!0,value:L}):k[b]=L,ve=(k,b)=>{for(var L in b||(b={}))ln.call(b,L)&&pt(k,L,b[L]);if(gt)for(var L of gt(b))cn.call(b,L)&&pt(k,L,b[L]);return k},Ne=(k,b)=>an(k,sn(b));var ee=(k,b,L)=>new Promise((f,U)=>{var Q=R=>{try{q(L.next(R))}catch($){U($)}},K=R=>{try{q(L.throw(R))}catch($){U($)}},q=R=>R.done?f(R.value):Promise.resolve(R.value).then(Q,K);q((L=L.apply(k,b)).next())});const wt=R.createStyles(({css:n,token:o})=>({layout:n`
1
+ (function(U,m){typeof exports=="object"&&typeof module!="undefined"?m(exports,require("@tachybase/client"),require("react-router"),require("react/jsx-runtime"),require("react"),require("@tachybase/schema"),require("@ant-design/icons"),require("antd"),require("dayjs"),require("antd-style"),require("@emotion/css"),require("react-router-dom")):typeof define=="function"&&define.amd?define(["exports","@tachybase/client","react-router","react/jsx-runtime","react","@tachybase/schema","@ant-design/icons","antd","dayjs","antd-style","@emotion/css","react-router-dom"],m):(U=typeof globalThis!="undefined"?globalThis:U||self,m(U["@tachybase/plugin-action-share"]={},U["@tachybase/client"],U["react-router"],U.jsxRuntime,U.react,U["@tachybase/schema"],U["@ant-design/icons"],U.antd,U.dayjs,U["antd-style"],U["@emotion/css"],U["react-router-dom"]))})(this,function(U,m,q,c,D,W,K,B,_,z,Bt,At){"use strict";var vn=Object.defineProperty,Pn=Object.defineProperties;var En=Object.getOwnPropertyDescriptors;var Et=Object.getOwnPropertySymbols;var Tn=Object.prototype.hasOwnProperty,Bn=Object.prototype.propertyIsEnumerable;var Tt=(U,m,q)=>m in U?vn(U,m,{enumerable:!0,configurable:!0,writable:!0,value:q}):U[m]=q,F=(U,m)=>{for(var q in m||(m={}))Tn.call(m,q)&&Tt(U,q,m[q]);if(Et)for(var q of Et(m))Bn.call(m,q)&&Tt(U,q,m[q]);return U},V=(U,m)=>Pn(U,En(m));var ne=(U,m,q)=>new Promise((c,D)=>{var W=_=>{try{B(q.next(_))}catch(z){D(z)}},K=_=>{try{B(q.throw(_))}catch(z){D(z)}},B=_=>_.done?c(_.value):Promise.resolve(_.value).then(W,K);B((q=q.apply(U,m)).next())});const kt=z.createStyles(({css:n,token:r})=>({layout:n`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  height: 100vh;
@@ -7,21 +7,21 @@
7
7
  .ant-menu.ant-menu-dark .ant-menu-item-selected,
8
8
  .ant-menu-submenu-popup.ant-menu-dark .ant-menu-item-selected,
9
9
  .ant-menu-submenu-horizontal.ant-menu-submenu-selected {
10
- background-color: ${o.colorBgHeaderMenuActive} !important;
11
- color: ${o.colorTextHeaderMenuActive} !important;
10
+ background-color: ${r.colorBgHeaderMenuActive} !important;
11
+ color: ${r.colorTextHeaderMenuActive} !important;
12
12
  }
13
13
  .ant-menu-submenu-horizontal.ant-menu-submenu-selected > .ant-menu-submenu-title {
14
- color: ${o.colorTextHeaderMenuActive} !important;
14
+ color: ${r.colorTextHeaderMenuActive} !important;
15
15
  }
16
16
  .ant-menu-dark.ant-menu-horizontal > .ant-menu-item:hover {
17
- background-color: ${o.colorBgHeaderMenuHover} !important;
18
- color: ${o.colorTextHeaderMenuHover} !important;
17
+ background-color: ${r.colorBgHeaderMenuHover} !important;
18
+ color: ${r.colorTextHeaderMenuHover} !important;
19
19
  }
20
20
 
21
21
  height: var(--tb-header-height);
22
22
  line-height: var(--tb-header-height);
23
23
  padding: 0;
24
- background-color: ${o.colorBgHeader} !important;
24
+ background-color: ${r.colorBgHeader} !important;
25
25
 
26
26
  .ant-menu {
27
27
  background-color: transparent;
@@ -29,7 +29,7 @@
29
29
 
30
30
  .ant-menu-item,
31
31
  .ant-menu-submenu-horizontal {
32
- color: ${o.colorTextHeaderMenu} !important;
32
+ color: ${r.colorTextHeaderMenu} !important;
33
33
  }
34
34
  `,headerA:n`
35
35
  position: relative;
@@ -102,11 +102,11 @@
102
102
  z-index: 0;
103
103
  padding: 0px 50px;
104
104
  }
105
- `})),yt=R.createStyles(({css:n,token:o})=>({firstmodal:n`
105
+ `})),re=z.createStyles(({css:n,token:r})=>({firstmodal:n`
106
106
  .ant-modal-content {
107
107
  position: relative;
108
108
  overflow: hidden;
109
- border-radius: 16px;
109
+ border-radius: ${r.borderRadius};
110
110
  &::before,
111
111
  &::after {
112
112
  content: '';
@@ -127,17 +127,52 @@
127
127
  bottom: -160px;
128
128
  right: -150px;
129
129
  }
130
- .ant-modal-header {
131
- text-align: center;
132
- margin-bottom: 20px;
133
- margin-top: 15px;
134
- .ant-modal-title {
135
- font-size: x-large;
136
- font-weight: 400;
137
- }
138
- }
139
130
  .ant-modal-body {
140
131
  justify-items: center;
132
+ .modal-title {
133
+ width: 100%;
134
+ position: relative;
135
+ .title {
136
+ flex: 1;
137
+ text-align: center;
138
+ font-size: x-large;
139
+ font-weight: 400;
140
+
141
+ .history-title {
142
+ font-weight: normal;
143
+ text-align: left;
144
+ font-size: 1rem;
145
+ display: flex;
146
+ padding: 0 20px;
147
+ margin-bottom: 5px;
148
+ margin-top: 15px;
149
+ .anticon {
150
+ padding: 0 5px 0 5px;
151
+ &:hover {
152
+ background-color: #ebebeb;
153
+ cursor: pointer;
154
+ }
155
+ }
156
+ }
157
+ .share-title {
158
+ margin-bottom: 20px;
159
+ margin-top: 15px;
160
+ }
161
+ }
162
+ .modalIcon {
163
+ position: absolute;
164
+ top: -20px;
165
+ right: 0;
166
+ .anticon {
167
+ font-size: 18px;
168
+ padding: 8px;
169
+ &:hover {
170
+ background-color: #ebebeb;
171
+ cursor: pointer;
172
+ }
173
+ }
174
+ }
175
+ }
141
176
  }
142
177
  }
143
178
  `,secondmodal:n`
@@ -196,14 +231,121 @@
196
231
  width: 280px;
197
232
  height: 360px;
198
233
  }
199
- `}));function Ct(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var J={},te,Ie;function bt(){return Ie||(Ie=1,te=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),te}var ne={},H={},ke;function j(){if(ke)return H;ke=1;let n;const o=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return H.getSymbolSize=function(r){if(!r)throw new Error('"version" cannot be null or undefined');if(r<1||r>40)throw new Error('"version" should be in range from 1 to 40');return r*4+17},H.getSymbolTotalCodewords=function(r){return o[r]},H.getBCHDigit=function(i){let r=0;for(;i!==0;)r++,i>>>=1;return r},H.setToSJISFunction=function(r){if(typeof r!="function")throw new Error('"toSJISFunc" is not a valid function.');n=r},H.isKanjiModeEnabled=function(){return typeof n!="undefined"},H.toSJIS=function(r){return n(r)},H}var re={},Le;function oe(){return Le||(Le=1,function(n){n.L={bit:1},n.M={bit:0},n.Q={bit:3},n.H={bit:2};function o(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"l":case"low":return n.L;case"m":case"medium":return n.M;case"q":case"quartile":return n.Q;case"h":case"high":return n.H;default:throw new Error("Unknown EC Level: "+i)}}n.isValid=function(r){return r&&typeof r.bit!="undefined"&&r.bit>=0&&r.bit<4},n.from=function(r,t){if(n.isValid(r))return r;try{return o(r)}catch(e){return t}}}(re)),re}var ie,qe;function Et(){if(qe)return ie;qe=1;function n(){this.buffer=[],this.length=0}return n.prototype={get:function(o){const i=Math.floor(o/8);return(this.buffer[i]>>>7-o%8&1)===1},put:function(o,i){for(let r=0;r<i;r++)this.putBit((o>>>i-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(o){const i=Math.floor(this.length/8);this.buffer.length<=i&&this.buffer.push(0),o&&(this.buffer[i]|=128>>>this.length%8),this.length++}},ie=n,ie}var ae,De;function xt(){if(De)return ae;De=1;function n(o){if(!o||o<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=o,this.data=new Uint8Array(o*o),this.reservedBit=new Uint8Array(o*o)}return n.prototype.set=function(o,i,r,t){const e=o*this.size+i;this.data[e]=r,t&&(this.reservedBit[e]=!0)},n.prototype.get=function(o,i){return this.data[o*this.size+i]},n.prototype.xor=function(o,i,r){this.data[o*this.size+i]^=r},n.prototype.isReserved=function(o,i){return this.reservedBit[o*this.size+i]},ae=n,ae}var se={},Ue;function St(){return Ue||(Ue=1,function(n){const o=j().getSymbolSize;n.getRowColCoords=function(r){if(r===1)return[];const t=Math.floor(r/7)+2,e=o(r),a=e===145?26:Math.ceil((e-13)/(2*t-2))*2,s=[e-7];for(let l=1;l<t-1;l++)s[l]=s[l-1]-a;return s.push(6),s.reverse()},n.getPositions=function(r){const t=[],e=n.getRowColCoords(r),a=e.length;for(let s=0;s<a;s++)for(let l=0;l<a;l++)s===0&&l===0||s===0&&l===a-1||s===a-1&&l===0||t.push([e[s],e[l]]);return t}}(se)),se}var le={},Re;function Bt(){if(Re)return le;Re=1;const n=j().getSymbolSize,o=7;return le.getPositions=function(r){const t=n(r);return[[0,0],[t-o,0],[0,t-o]]},le}var ce={},Fe;function At(){return Fe||(Fe=1,function(n){n.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const o={N1:3,N2:3,N3:40,N4:10};n.isValid=function(t){return t!=null&&t!==""&&!isNaN(t)&&t>=0&&t<=7},n.from=function(t){return n.isValid(t)?parseInt(t,10):void 0},n.getPenaltyN1=function(t){const e=t.size;let a=0,s=0,l=0,c=null,h=null;for(let p=0;p<e;p++){s=l=0,c=h=null;for(let d=0;d<e;d++){let u=t.get(p,d);u===c?s++:(s>=5&&(a+=o.N1+(s-5)),c=u,s=1),u=t.get(d,p),u===h?l++:(l>=5&&(a+=o.N1+(l-5)),h=u,l=1)}s>=5&&(a+=o.N1+(s-5)),l>=5&&(a+=o.N1+(l-5))}return a},n.getPenaltyN2=function(t){const e=t.size;let a=0;for(let s=0;s<e-1;s++)for(let l=0;l<e-1;l++){const c=t.get(s,l)+t.get(s,l+1)+t.get(s+1,l)+t.get(s+1,l+1);(c===4||c===0)&&a++}return a*o.N2},n.getPenaltyN3=function(t){const e=t.size;let a=0,s=0,l=0;for(let c=0;c<e;c++){s=l=0;for(let h=0;h<e;h++)s=s<<1&2047|t.get(c,h),h>=10&&(s===1488||s===93)&&a++,l=l<<1&2047|t.get(h,c),h>=10&&(l===1488||l===93)&&a++}return a*o.N3},n.getPenaltyN4=function(t){let e=0;const a=t.data.length;for(let l=0;l<a;l++)e+=t.data[l];return Math.abs(Math.ceil(e*100/a/5)-10)*o.N4};function i(r,t,e){switch(r){case n.Patterns.PATTERN000:return(t+e)%2===0;case n.Patterns.PATTERN001:return t%2===0;case n.Patterns.PATTERN010:return e%3===0;case n.Patterns.PATTERN011:return(t+e)%3===0;case n.Patterns.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2===0;case n.Patterns.PATTERN101:return t*e%2+t*e%3===0;case n.Patterns.PATTERN110:return(t*e%2+t*e%3)%2===0;case n.Patterns.PATTERN111:return(t*e%3+(t+e)%2)%2===0;default:throw new Error("bad maskPattern:"+r)}}n.applyMask=function(t,e){const a=e.size;for(let s=0;s<a;s++)for(let l=0;l<a;l++)e.isReserved(l,s)||e.xor(l,s,i(t,l,s))},n.getBestMask=function(t,e){const a=Object.keys(n.Patterns).length;let s=0,l=1/0;for(let c=0;c<a;c++){e(c),n.applyMask(c,t);const h=n.getPenaltyN1(t)+n.getPenaltyN2(t)+n.getPenaltyN3(t)+n.getPenaltyN4(t);n.applyMask(c,t),h<l&&(l=h,s=c)}return s}}(ce)),ce}var Z={},_e;function ze(){if(_e)return Z;_e=1;const n=oe(),o=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],i=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return Z.getBlocksCount=function(t,e){switch(e){case n.L:return o[(t-1)*4+0];case n.M:return o[(t-1)*4+1];case n.Q:return o[(t-1)*4+2];case n.H:return o[(t-1)*4+3];default:return}},Z.getTotalCodewordsCount=function(t,e){switch(e){case n.L:return i[(t-1)*4+0];case n.M:return i[(t-1)*4+1];case n.Q:return i[(t-1)*4+2];case n.H:return i[(t-1)*4+3];default:return}},Z}var ue={},G={},He;function Tt(){if(He)return G;He=1;const n=new Uint8Array(512),o=new Uint8Array(256);return function(){let r=1;for(let t=0;t<255;t++)n[t]=r,o[r]=t,r<<=1,r&256&&(r^=285);for(let t=255;t<512;t++)n[t]=n[t-255]}(),G.log=function(r){if(r<1)throw new Error("log("+r+")");return o[r]},G.exp=function(r){return n[r]},G.mul=function(r,t){return r===0||t===0?0:n[o[r]+o[t]]},G}var Oe;function Mt(){return Oe||(Oe=1,function(n){const o=Tt();n.mul=function(r,t){const e=new Uint8Array(r.length+t.length-1);for(let a=0;a<r.length;a++)for(let s=0;s<t.length;s++)e[a+s]^=o.mul(r[a],t[s]);return e},n.mod=function(r,t){let e=new Uint8Array(r);for(;e.length-t.length>=0;){const a=e[0];for(let l=0;l<t.length;l++)e[l]^=o.mul(t[l],a);let s=0;for(;s<e.length&&e[s]===0;)s++;e=e.slice(s)}return e},n.generateECPolynomial=function(r){let t=new Uint8Array([1]);for(let e=0;e<r;e++)t=n.mul(t,new Uint8Array([1,o.exp(e)]));return t}}(ue)),ue}var de,je;function Pt(){if(je)return de;je=1;const n=Mt();function o(i){this.genPoly=void 0,this.degree=i,this.degree&&this.initialize(this.degree)}return o.prototype.initialize=function(r){this.degree=r,this.genPoly=n.generateECPolynomial(this.degree)},o.prototype.encode=function(r){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(r.length+this.degree);t.set(r);const e=n.mod(t,this.genPoly),a=this.degree-e.length;if(a>0){const s=new Uint8Array(this.degree);return s.set(e,a),s}return e},de=o,de}var he={},fe={},ge={},Ve;function Ke(){return Ve||(Ve=1,ge.isValid=function(o){return!isNaN(o)&&o>=1&&o<=40}),ge}var F={},Je;function Ye(){if(Je)return F;Je=1;const n="[0-9]+",o="[A-Z $%*+\\-./:]+";let i="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";i=i.replace(/u/g,"\\u");const r="(?:(?![A-Z0-9 $%*+\\-./:]|"+i+`)(?:.|[\r
200
- ]))+`;F.KANJI=new RegExp(i,"g"),F.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),F.BYTE=new RegExp(r,"g"),F.NUMERIC=new RegExp(n,"g"),F.ALPHANUMERIC=new RegExp(o,"g");const t=new RegExp("^"+i+"$"),e=new RegExp("^"+n+"$"),a=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return F.testKanji=function(l){return t.test(l)},F.testNumeric=function(l){return e.test(l)},F.testAlphanumeric=function(l){return a.test(l)},F}var Qe;function V(){return Qe||(Qe=1,function(n){const o=Ke(),i=Ye();n.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},n.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},n.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},n.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},n.MIXED={bit:-1},n.getCharCountIndicator=function(e,a){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!o.isValid(a))throw new Error("Invalid version: "+a);return a>=1&&a<10?e.ccBits[0]:a<27?e.ccBits[1]:e.ccBits[2]},n.getBestModeForData=function(e){return i.testNumeric(e)?n.NUMERIC:i.testAlphanumeric(e)?n.ALPHANUMERIC:i.testKanji(e)?n.KANJI:n.BYTE},n.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},n.isValid=function(e){return e&&e.bit&&e.ccBits};function r(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return n.NUMERIC;case"alphanumeric":return n.ALPHANUMERIC;case"kanji":return n.KANJI;case"byte":return n.BYTE;default:throw new Error("Unknown mode: "+t)}}n.from=function(e,a){if(n.isValid(e))return e;try{return r(e)}catch(s){return a}}}(fe)),fe}var $e;function vt(){return $e||($e=1,function(n){const o=j(),i=ze(),r=oe(),t=V(),e=Ke(),a=7973,s=o.getBCHDigit(a);function l(d,u,g){for(let m=1;m<=40;m++)if(u<=n.getCapacity(m,g,d))return m}function c(d,u){return t.getCharCountIndicator(d,u)+4}function h(d,u){let g=0;return d.forEach(function(m){const I=c(m.mode,u);g+=I+m.getBitsLength()}),g}function p(d,u){for(let g=1;g<=40;g++)if(h(d,g)<=n.getCapacity(g,u,t.MIXED))return g}n.from=function(u,g){return e.isValid(u)?parseInt(u,10):g},n.getCapacity=function(u,g,m){if(!e.isValid(u))throw new Error("Invalid QR Code version");typeof m=="undefined"&&(m=t.BYTE);const I=o.getSymbolTotalCodewords(u),w=i.getTotalCodewordsCount(u,g),N=(I-w)*8;if(m===t.MIXED)return N;const T=N-c(m,u);switch(m){case t.NUMERIC:return Math.floor(T/10*3);case t.ALPHANUMERIC:return Math.floor(T/11*2);case t.KANJI:return Math.floor(T/13);case t.BYTE:default:return Math.floor(T/8)}},n.getBestVersionForData=function(u,g){let m;const I=r.from(g,r.M);if(Array.isArray(u)){if(u.length>1)return p(u,I);if(u.length===0)return 1;m=u[0]}else m=u;return l(m.mode,m.getLength(),I)},n.getEncodedBits=function(u){if(!e.isValid(u)||u<7)throw new Error("Invalid QR Code version");let g=u<<12;for(;o.getBCHDigit(g)-s>=0;)g^=a<<o.getBCHDigit(g)-s;return u<<12|g}}(he)),he}var pe={},Ge;function Nt(){if(Ge)return pe;Ge=1;const n=j(),o=1335,i=21522,r=n.getBCHDigit(o);return pe.getEncodedBits=function(e,a){const s=e.bit<<3|a;let l=s<<10;for(;n.getBCHDigit(l)-r>=0;)l^=o<<n.getBCHDigit(l)-r;return(s<<10|l)^i},pe}var me={},we,We;function It(){if(We)return we;We=1;const n=V();function o(i){this.mode=n.NUMERIC,this.data=i.toString()}return o.getBitsLength=function(r){return 10*Math.floor(r/3)+(r%3?r%3*3+1:0)},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(r){let t,e,a;for(t=0;t+3<=this.data.length;t+=3)e=this.data.substr(t,3),a=parseInt(e,10),r.put(a,10);const s=this.data.length-t;s>0&&(e=this.data.substr(t),a=parseInt(e,10),r.put(a,s*3+1))},we=o,we}var ye,Ze;function kt(){if(Ze)return ye;Ze=1;const n=V(),o=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function i(r){this.mode=n.ALPHANUMERIC,this.data=r}return i.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){let e;for(e=0;e+2<=this.data.length;e+=2){let a=o.indexOf(this.data[e])*45;a+=o.indexOf(this.data[e+1]),t.put(a,11)}this.data.length%2&&t.put(o.indexOf(this.data[e]),6)},ye=i,ye}var Ce,Xe;function Lt(){if(Xe)return Ce;Xe=1;const n=V();function o(i){this.mode=n.BYTE,typeof i=="string"?this.data=new TextEncoder().encode(i):this.data=new Uint8Array(i)}return o.getBitsLength=function(r){return r*8},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(i){for(let r=0,t=this.data.length;r<t;r++)i.put(this.data[r],8)},Ce=o,Ce}var be,et;function qt(){if(et)return be;et=1;const n=V(),o=j();function i(r){this.mode=n.KANJI,this.data=r}return i.getBitsLength=function(t){return t*13},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(r){let t;for(t=0;t<this.data.length;t++){let e=o.toSJIS(this.data[t]);if(e>=33088&&e<=40956)e-=33088;else if(e>=57408&&e<=60351)e-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+`
201
- Make sure your charset is UTF-8`);e=(e>>>8&255)*192+(e&255),r.put(e,13)}},be=i,be}var Ee={exports:{}},tt;function Dt(){return tt||(tt=1,function(n){var o={single_source_shortest_paths:function(i,r,t){var e={},a={};a[r]=0;var s=o.PriorityQueue.make();s.push(r,0);for(var l,c,h,p,d,u,g,m,I;!s.empty();){l=s.pop(),c=l.value,p=l.cost,d=i[c]||{};for(h in d)d.hasOwnProperty(h)&&(u=d[h],g=p+u,m=a[h],I=typeof a[h]=="undefined",(I||m>g)&&(a[h]=g,s.push(h,g),e[h]=c))}if(typeof t!="undefined"&&typeof a[t]=="undefined"){var w=["Could not find a path from ",r," to ",t,"."].join("");throw new Error(w)}return e},extract_shortest_path_from_predecessor_list:function(i,r){for(var t=[],e=r;e;)t.push(e),i[e],e=i[e];return t.reverse(),t},find_path:function(i,r,t){var e=o.single_source_shortest_paths(i,r,t);return o.extract_shortest_path_from_predecessor_list(e,t)},PriorityQueue:{make:function(i){var r=o.PriorityQueue,t={},e;i=i||{};for(e in r)r.hasOwnProperty(e)&&(t[e]=r[e]);return t.queue=[],t.sorter=i.sorter||r.default_sorter,t},default_sorter:function(i,r){return i.cost-r.cost},push:function(i,r){var t={value:i,cost:r};this.queue.push(t),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};n.exports=o}(Ee)),Ee.exports}var nt;function Ut(){return nt||(nt=1,function(n){const o=V(),i=It(),r=kt(),t=Lt(),e=qt(),a=Ye(),s=j(),l=Dt();function c(w){return unescape(encodeURIComponent(w)).length}function h(w,N,T){const M=[];let D;for(;(D=w.exec(T))!==null;)M.push({data:D[0],index:D.index,mode:N,length:D[0].length});return M}function p(w){const N=h(a.NUMERIC,o.NUMERIC,w),T=h(a.ALPHANUMERIC,o.ALPHANUMERIC,w);let M,D;return s.isKanjiModeEnabled()?(M=h(a.BYTE,o.BYTE,w),D=h(a.KANJI,o.KANJI,w)):(M=h(a.BYTE_KANJI,o.BYTE,w),D=[]),N.concat(T,M,D).sort(function(B,S){return B.index-S.index}).map(function(B){return{data:B.data,mode:B.mode,length:B.length}})}function d(w,N){switch(N){case o.NUMERIC:return i.getBitsLength(w);case o.ALPHANUMERIC:return r.getBitsLength(w);case o.KANJI:return e.getBitsLength(w);case o.BYTE:return t.getBitsLength(w)}}function u(w){return w.reduce(function(N,T){const M=N.length-1>=0?N[N.length-1]:null;return M&&M.mode===T.mode?(N[N.length-1].data+=T.data,N):(N.push(T),N)},[])}function g(w){const N=[];for(let T=0;T<w.length;T++){const M=w[T];switch(M.mode){case o.NUMERIC:N.push([M,{data:M.data,mode:o.ALPHANUMERIC,length:M.length},{data:M.data,mode:o.BYTE,length:M.length}]);break;case o.ALPHANUMERIC:N.push([M,{data:M.data,mode:o.BYTE,length:M.length}]);break;case o.KANJI:N.push([M,{data:M.data,mode:o.BYTE,length:c(M.data)}]);break;case o.BYTE:N.push([{data:M.data,mode:o.BYTE,length:c(M.data)}])}}return N}function m(w,N){const T={},M={start:{}};let D=["start"];for(let C=0;C<w.length;C++){const B=w[C],S=[];for(let y=0;y<B.length;y++){const P=B[y],E=""+C+y;S.push(E),T[E]={node:P,lastCount:0},M[E]={};for(let A=0;A<D.length;A++){const x=D[A];T[x]&&T[x].node.mode===P.mode?(M[x][E]=d(T[x].lastCount+P.length,P.mode)-d(T[x].lastCount,P.mode),T[x].lastCount+=P.length):(T[x]&&(T[x].lastCount=P.length),M[x][E]=d(P.length,P.mode)+4+o.getCharCountIndicator(P.mode,N))}}D=S}for(let C=0;C<D.length;C++)M[D[C]].end=0;return{map:M,table:T}}function I(w,N){let T;const M=o.getBestModeForData(w);if(T=o.from(N,M),T!==o.BYTE&&T.bit<M.bit)throw new Error('"'+w+'" cannot be encoded with mode '+o.toString(T)+`.
202
- Suggested mode is: `+o.toString(M));switch(T===o.KANJI&&!s.isKanjiModeEnabled()&&(T=o.BYTE),T){case o.NUMERIC:return new i(w);case o.ALPHANUMERIC:return new r(w);case o.KANJI:return new e(w);case o.BYTE:return new t(w)}}n.fromArray=function(N){return N.reduce(function(T,M){return typeof M=="string"?T.push(I(M,null)):M.data&&T.push(I(M.data,M.mode)),T},[])},n.fromString=function(N,T){const M=p(N,s.isKanjiModeEnabled()),D=g(M),C=m(D,T),B=l.find_path(C.map,"start","end"),S=[];for(let y=1;y<B.length-1;y++)S.push(C.table[B[y]].node);return n.fromArray(u(S))},n.rawSplit=function(N){return n.fromArray(p(N,s.isKanjiModeEnabled()))}}(me)),me}var rt;function Rt(){if(rt)return ne;rt=1;const n=j(),o=oe(),i=Et(),r=xt(),t=St(),e=Bt(),a=At(),s=ze(),l=Pt(),c=vt(),h=Nt(),p=V(),d=Ut();function u(C,B){const S=C.size,y=e.getPositions(B);for(let P=0;P<y.length;P++){const E=y[P][0],A=y[P][1];for(let x=-1;x<=7;x++)if(!(E+x<=-1||S<=E+x))for(let v=-1;v<=7;v++)A+v<=-1||S<=A+v||(x>=0&&x<=6&&(v===0||v===6)||v>=0&&v<=6&&(x===0||x===6)||x>=2&&x<=4&&v>=2&&v<=4?C.set(E+x,A+v,!0,!0):C.set(E+x,A+v,!1,!0))}}function g(C){const B=C.size;for(let S=8;S<B-8;S++){const y=S%2===0;C.set(S,6,y,!0),C.set(6,S,y,!0)}}function m(C,B){const S=t.getPositions(B);for(let y=0;y<S.length;y++){const P=S[y][0],E=S[y][1];for(let A=-2;A<=2;A++)for(let x=-2;x<=2;x++)A===-2||A===2||x===-2||x===2||A===0&&x===0?C.set(P+A,E+x,!0,!0):C.set(P+A,E+x,!1,!0)}}function I(C,B){const S=C.size,y=c.getEncodedBits(B);let P,E,A;for(let x=0;x<18;x++)P=Math.floor(x/3),E=x%3+S-8-3,A=(y>>x&1)===1,C.set(P,E,A,!0),C.set(E,P,A,!0)}function w(C,B,S){const y=C.size,P=h.getEncodedBits(B,S);let E,A;for(E=0;E<15;E++)A=(P>>E&1)===1,E<6?C.set(E,8,A,!0):E<8?C.set(E+1,8,A,!0):C.set(y-15+E,8,A,!0),E<8?C.set(8,y-E-1,A,!0):E<9?C.set(8,15-E-1+1,A,!0):C.set(8,15-E-1,A,!0);C.set(y-8,8,1,!0)}function N(C,B){const S=C.size;let y=-1,P=S-1,E=7,A=0;for(let x=S-1;x>0;x-=2)for(x===6&&x--;;){for(let v=0;v<2;v++)if(!C.isReserved(P,x-v)){let O=!1;A<B.length&&(O=(B[A]>>>E&1)===1),C.set(P,x-v,O),E--,E===-1&&(A++,E=7)}if(P+=y,P<0||S<=P){P-=y,y=-y;break}}}function T(C,B,S){const y=new i;S.forEach(function(v){y.put(v.mode.bit,4),y.put(v.getLength(),p.getCharCountIndicator(v.mode,C)),v.write(y)});const P=n.getSymbolTotalCodewords(C),E=s.getTotalCodewordsCount(C,B),A=(P-E)*8;for(y.getLengthInBits()+4<=A&&y.put(0,4);y.getLengthInBits()%8!==0;)y.putBit(0);const x=(A-y.getLengthInBits())/8;for(let v=0;v<x;v++)y.put(v%2?17:236,8);return M(y,C,B)}function M(C,B,S){const y=n.getSymbolTotalCodewords(B),P=s.getTotalCodewordsCount(B,S),E=y-P,A=s.getBlocksCount(B,S),x=y%A,v=A-x,O=Math.floor(y/A),W=Math.floor(E/A),tn=W+1,dt=O-W,nn=new l(dt);let Ae=0;const X=new Array(A),ht=new Array(A);let Te=0;const rn=new Uint8Array(C.buffer);for(let Y=0;Y<A;Y++){const Pe=Y<v?W:tn;X[Y]=rn.slice(Ae,Ae+Pe),ht[Y]=nn.encode(X[Y]),Ae+=Pe,Te=Math.max(Te,Pe)}const Me=new Uint8Array(y);let ft=0,_,z;for(_=0;_<Te;_++)for(z=0;z<A;z++)_<X[z].length&&(Me[ft++]=X[z][_]);for(_=0;_<dt;_++)for(z=0;z<A;z++)Me[ft++]=ht[z][_];return Me}function D(C,B,S,y){let P;if(Array.isArray(C))P=d.fromArray(C);else if(typeof C=="string"){let O=B;if(!O){const W=d.rawSplit(C);O=c.getBestVersionForData(W,S)}P=d.fromString(C,O||40)}else throw new Error("Invalid data");const E=c.getBestVersionForData(P,S);if(!E)throw new Error("The amount of data is too big to be stored in a QR Code");if(!B)B=E;else if(B<E)throw new Error(`
234
+ `,historyModal:n`
235
+ .ant-modal-content {
236
+ padding-left: 0;
237
+ padding-right: 0;
238
+ &::before,
239
+ &::after {
240
+ background: none;
241
+ }
242
+ }
243
+ `})),De=z.createStyles(({css:n,token:r})=>({form:n`
244
+ margin: 0;
245
+ .ant-picker {
246
+ width: 100%;
247
+ }
248
+ .setPassWord {
249
+ width: 100%;
250
+ }
251
+ .password {
252
+ display: flex;
253
+ .ant-btn {
254
+ border: none;
255
+ color: #2196f4;
256
+ box-shadow: none;
257
+ background-color: rgb(0 0 0 / 0%);
258
+ }
259
+ .pw-cancel {
260
+ color: #c1c1c1;
261
+ }
262
+ }
263
+ `,collapse:n`
264
+ width: 100%;
265
+ background-color: rgb(0 0 0 / 0%);
266
+ .ant-collapse-header-text {
267
+ text-align: right;
268
+ }
269
+ .submit {
270
+ width: 100%;
271
+ }
272
+ `,datePickFooter:n`
273
+ display: flex;
274
+ justify-content: space-between;
275
+ align-items: center;
276
+ `})),It=z.createStyles(({css:n,token:r})=>({modal:n`
277
+ .ant-modal-content {
278
+ position: relative;
279
+ overflow: hidden;
280
+ border-radius: ${(r==null?void 0:r.borderRadius)||"0px"};
281
+ &::before,
282
+ &::after {
283
+ content: '';
284
+ position: absolute;
285
+ width: 300px;
286
+ height: 300px;
287
+ background: radial-gradient(circle, rgba(0, 149, 255, 0.11) 0%, transparent 70%);
288
+ z-index: 0;
289
+ pointer-events: none;
290
+ }
291
+
292
+ &::before {
293
+ top: -165px;
294
+ left: -10px;
295
+ }
296
+
297
+ &::after {
298
+ bottom: -160px;
299
+ right: -150px;
300
+ }
301
+ .ant-modal-body {
302
+ color: #747474;
303
+ padding: 30px 0 10px 0;
304
+ .ant-input {
305
+ border-radius: ${(r==null?void 0:r.borderRadius)||"0px"};
306
+ }
307
+ .error {
308
+ color: red;
309
+ margin-top: 5px;
310
+ .anticon {
311
+ margin-right: 5px;
312
+ }
313
+ }
314
+ .shareTime {
315
+ margin-top: 30px;
316
+ text-align: right;
317
+ }
318
+ }
319
+ }
320
+ `})),Ue=z.createStyles(({css:n,token:r})=>({collapse:n`
321
+ width: 100%;
322
+ max-height: 70vh;
323
+ overflow-y: scroll;
324
+ padding: 20px;
325
+ .ant-collapse {
326
+ border-radius: ${(r==null?void 0:r.borderRadius)||"0px"};
327
+ .ant-collapse-header {
328
+ display: flex;
329
+ justify-content: space-between;
330
+ flex-wrap: wrap;
331
+ }
332
+ }
333
+ `,collapseExtra:n`
334
+ .anticon {
335
+ padding: 5px;
336
+ &:hover {
337
+ background-color: #ebebeb;
338
+ cursor: pointer;
339
+ }
340
+ }
341
+ `}));function Mt(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Q={},oe,qe;function Nt(){return qe||(qe=1,oe=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),oe}var ae={},j={},Fe;function J(){if(Fe)return j;Fe=1;let n;const r=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return j.getSymbolSize=function(o){if(!o)throw new Error('"version" cannot be null or undefined');if(o<1||o>40)throw new Error('"version" should be in range from 1 to 40');return o*4+17},j.getSymbolTotalCodewords=function(o){return r[o]},j.getBCHDigit=function(a){let o=0;for(;a!==0;)o++,a>>>=1;return o},j.setToSJISFunction=function(o){if(typeof o!="function")throw new Error('"toSJISFunc" is not a valid function.');n=o},j.isKanjiModeEnabled=function(){return typeof n!="undefined"},j.toSJIS=function(o){return n(o)},j}var ie={},Ve;function se(){return Ve||(Ve=1,function(n){n.L={bit:1},n.M={bit:0},n.Q={bit:3},n.H={bit:2};function r(a){if(typeof a!="string")throw new Error("Param is not a string");switch(a.toLowerCase()){case"l":case"low":return n.L;case"m":case"medium":return n.M;case"q":case"quartile":return n.Q;case"h":case"high":return n.H;default:throw new Error("Unknown EC Level: "+a)}}n.isValid=function(o){return o&&typeof o.bit!="undefined"&&o.bit>=0&&o.bit<4},n.from=function(o,e){if(n.isValid(o))return o;try{return r(o)}catch(t){return e}}}(ie)),ie}var le,_e;function Lt(){if(_e)return le;_e=1;function n(){this.buffer=[],this.length=0}return n.prototype={get:function(r){const a=Math.floor(r/8);return(this.buffer[a]>>>7-r%8&1)===1},put:function(r,a){for(let o=0;o<a;o++)this.putBit((r>>>a-o-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(r){const a=Math.floor(this.length/8);this.buffer.length<=a&&this.buffer.push(0),r&&(this.buffer[a]|=128>>>this.length%8),this.length++}},le=n,le}var ce,ze;function Dt(){if(ze)return ce;ze=1;function n(r){if(!r||r<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=r,this.data=new Uint8Array(r*r),this.reservedBit=new Uint8Array(r*r)}return n.prototype.set=function(r,a,o,e){const t=r*this.size+a;this.data[t]=o,e&&(this.reservedBit[t]=!0)},n.prototype.get=function(r,a){return this.data[r*this.size+a]},n.prototype.xor=function(r,a,o){this.data[r*this.size+a]^=o},n.prototype.isReserved=function(r,a){return this.reservedBit[r*this.size+a]},ce=n,ce}var ue={},Oe;function Ut(){return Oe||(Oe=1,function(n){const r=J().getSymbolSize;n.getRowColCoords=function(o){if(o===1)return[];const e=Math.floor(o/7)+2,t=r(o),i=t===145?26:Math.ceil((t-13)/(2*e-2))*2,l=[t-7];for(let s=1;s<e-1;s++)l[s]=l[s-1]-i;return l.push(6),l.reverse()},n.getPositions=function(o){const e=[],t=n.getRowColCoords(o),i=t.length;for(let l=0;l<i;l++)for(let s=0;s<i;s++)l===0&&s===0||l===0&&s===i-1||l===i-1&&s===0||e.push([t[l],t[s]]);return e}}(ue)),ue}var de={},$e;function qt(){if($e)return de;$e=1;const n=J().getSymbolSize,r=7;return de.getPositions=function(o){const e=n(o);return[[0,0],[e-r,0],[0,e-r]]},de}var he={},He;function Ft(){return He||(He=1,function(n){n.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const r={N1:3,N2:3,N3:40,N4:10};n.isValid=function(e){return e!=null&&e!==""&&!isNaN(e)&&e>=0&&e<=7},n.from=function(e){return n.isValid(e)?parseInt(e,10):void 0},n.getPenaltyN1=function(e){const t=e.size;let i=0,l=0,s=0,d=null,p=null;for(let y=0;y<t;y++){l=s=0,d=p=null;for(let h=0;h<t;h++){let u=e.get(y,h);u===d?l++:(l>=5&&(i+=r.N1+(l-5)),d=u,l=1),u=e.get(h,y),u===p?s++:(s>=5&&(i+=r.N1+(s-5)),p=u,s=1)}l>=5&&(i+=r.N1+(l-5)),s>=5&&(i+=r.N1+(s-5))}return i},n.getPenaltyN2=function(e){const t=e.size;let i=0;for(let l=0;l<t-1;l++)for(let s=0;s<t-1;s++){const d=e.get(l,s)+e.get(l,s+1)+e.get(l+1,s)+e.get(l+1,s+1);(d===4||d===0)&&i++}return i*r.N2},n.getPenaltyN3=function(e){const t=e.size;let i=0,l=0,s=0;for(let d=0;d<t;d++){l=s=0;for(let p=0;p<t;p++)l=l<<1&2047|e.get(d,p),p>=10&&(l===1488||l===93)&&i++,s=s<<1&2047|e.get(p,d),p>=10&&(s===1488||s===93)&&i++}return i*r.N3},n.getPenaltyN4=function(e){let t=0;const i=e.data.length;for(let s=0;s<i;s++)t+=e.data[s];return Math.abs(Math.ceil(t*100/i/5)-10)*r.N4};function a(o,e,t){switch(o){case n.Patterns.PATTERN000:return(e+t)%2===0;case n.Patterns.PATTERN001:return e%2===0;case n.Patterns.PATTERN010:return t%3===0;case n.Patterns.PATTERN011:return(e+t)%3===0;case n.Patterns.PATTERN100:return(Math.floor(e/2)+Math.floor(t/3))%2===0;case n.Patterns.PATTERN101:return e*t%2+e*t%3===0;case n.Patterns.PATTERN110:return(e*t%2+e*t%3)%2===0;case n.Patterns.PATTERN111:return(e*t%3+(e+t)%2)%2===0;default:throw new Error("bad maskPattern:"+o)}}n.applyMask=function(e,t){const i=t.size;for(let l=0;l<i;l++)for(let s=0;s<i;s++)t.isReserved(s,l)||t.xor(s,l,a(e,s,l))},n.getBestMask=function(e,t){const i=Object.keys(n.Patterns).length;let l=0,s=1/0;for(let d=0;d<i;d++){t(d),n.applyMask(d,e);const p=n.getPenaltyN1(e)+n.getPenaltyN2(e)+n.getPenaltyN3(e)+n.getPenaltyN4(e);n.applyMask(d,e),p<s&&(s=p,l=d)}return l}}(he)),he}var ee={},je;function Ye(){if(je)return ee;je=1;const n=se(),r=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],a=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return ee.getBlocksCount=function(e,t){switch(t){case n.L:return r[(e-1)*4+0];case n.M:return r[(e-1)*4+1];case n.Q:return r[(e-1)*4+2];case n.H:return r[(e-1)*4+3];default:return}},ee.getTotalCodewordsCount=function(e,t){switch(t){case n.L:return a[(e-1)*4+0];case n.M:return a[(e-1)*4+1];case n.Q:return a[(e-1)*4+2];case n.H:return a[(e-1)*4+3];default:return}},ee}var fe={},Z={},Ke;function Vt(){if(Ke)return Z;Ke=1;const n=new Uint8Array(512),r=new Uint8Array(256);return function(){let o=1;for(let e=0;e<255;e++)n[e]=o,r[o]=e,o<<=1,o&256&&(o^=285);for(let e=255;e<512;e++)n[e]=n[e-255]}(),Z.log=function(o){if(o<1)throw new Error("log("+o+")");return r[o]},Z.exp=function(o){return n[o]},Z.mul=function(o,e){return o===0||e===0?0:n[r[o]+r[e]]},Z}var Je;function _t(){return Je||(Je=1,function(n){const r=Vt();n.mul=function(o,e){const t=new Uint8Array(o.length+e.length-1);for(let i=0;i<o.length;i++)for(let l=0;l<e.length;l++)t[i+l]^=r.mul(o[i],e[l]);return t},n.mod=function(o,e){let t=new Uint8Array(o);for(;t.length-e.length>=0;){const i=t[0];for(let s=0;s<e.length;s++)t[s]^=r.mul(e[s],i);let l=0;for(;l<t.length&&t[l]===0;)l++;t=t.slice(l)}return t},n.generateECPolynomial=function(o){let e=new Uint8Array([1]);for(let t=0;t<o;t++)e=n.mul(e,new Uint8Array([1,r.exp(t)]));return e}}(fe)),fe}var ge,Ge;function zt(){if(Ge)return ge;Ge=1;const n=_t();function r(a){this.genPoly=void 0,this.degree=a,this.degree&&this.initialize(this.degree)}return r.prototype.initialize=function(o){this.degree=o,this.genPoly=n.generateECPolynomial(this.degree)},r.prototype.encode=function(o){if(!this.genPoly)throw new Error("Encoder not initialized");const e=new Uint8Array(o.length+this.degree);e.set(o);const t=n.mod(e,this.genPoly),i=this.degree-t.length;if(i>0){const l=new Uint8Array(this.degree);return l.set(t,i),l}return t},ge=r,ge}var pe={},me={},ye={},Qe;function Re(){return Qe||(Qe=1,ye.isValid=function(r){return!isNaN(r)&&r>=1&&r<=40}),ye}var O={},We;function Ze(){if(We)return O;We=1;const n="[0-9]+",r="[A-Z $%*+\\-./:]+";let a="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";a=a.replace(/u/g,"\\u");const o="(?:(?![A-Z0-9 $%*+\\-./:]|"+a+`)(?:.|[\r
342
+ ]))+`;O.KANJI=new RegExp(a,"g"),O.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),O.BYTE=new RegExp(o,"g"),O.NUMERIC=new RegExp(n,"g"),O.ALPHANUMERIC=new RegExp(r,"g");const e=new RegExp("^"+a+"$"),t=new RegExp("^"+n+"$"),i=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return O.testKanji=function(s){return e.test(s)},O.testNumeric=function(s){return t.test(s)},O.testAlphanumeric=function(s){return i.test(s)},O}var Xe;function G(){return Xe||(Xe=1,function(n){const r=Re(),a=Ze();n.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},n.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},n.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},n.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},n.MIXED={bit:-1},n.getCharCountIndicator=function(t,i){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!r.isValid(i))throw new Error("Invalid version: "+i);return i>=1&&i<10?t.ccBits[0]:i<27?t.ccBits[1]:t.ccBits[2]},n.getBestModeForData=function(t){return a.testNumeric(t)?n.NUMERIC:a.testAlphanumeric(t)?n.ALPHANUMERIC:a.testKanji(t)?n.KANJI:n.BYTE},n.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")},n.isValid=function(t){return t&&t.bit&&t.ccBits};function o(e){if(typeof e!="string")throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return n.NUMERIC;case"alphanumeric":return n.ALPHANUMERIC;case"kanji":return n.KANJI;case"byte":return n.BYTE;default:throw new Error("Unknown mode: "+e)}}n.from=function(t,i){if(n.isValid(t))return t;try{return o(t)}catch(l){return i}}}(me)),me}var et;function Ot(){return et||(et=1,function(n){const r=J(),a=Ye(),o=se(),e=G(),t=Re(),i=7973,l=r.getBCHDigit(i);function s(h,u,f){for(let g=1;g<=40;g++)if(u<=n.getCapacity(g,f,h))return g}function d(h,u){return e.getCharCountIndicator(h,u)+4}function p(h,u){let f=0;return h.forEach(function(g){const I=d(g.mode,u);f+=I+g.getBitsLength()}),f}function y(h,u){for(let f=1;f<=40;f++)if(p(h,f)<=n.getCapacity(f,u,e.MIXED))return f}n.from=function(u,f){return t.isValid(u)?parseInt(u,10):f},n.getCapacity=function(u,f,g){if(!t.isValid(u))throw new Error("Invalid QR Code version");typeof g=="undefined"&&(g=e.BYTE);const I=r.getSymbolTotalCodewords(u),x=a.getTotalCodewordsCount(u,f),M=(I-x)*8;if(g===e.MIXED)return M;const b=M-d(g,u);switch(g){case e.NUMERIC:return Math.floor(b/10*3);case e.ALPHANUMERIC:return Math.floor(b/11*2);case e.KANJI:return Math.floor(b/13);case e.BYTE:default:return Math.floor(b/8)}},n.getBestVersionForData=function(u,f){let g;const I=o.from(f,o.M);if(Array.isArray(u)){if(u.length>1)return y(u,I);if(u.length===0)return 1;g=u[0]}else g=u;return s(g.mode,g.getLength(),I)},n.getEncodedBits=function(u){if(!t.isValid(u)||u<7)throw new Error("Invalid QR Code version");let f=u<<12;for(;r.getBCHDigit(f)-l>=0;)f^=i<<r.getBCHDigit(f)-l;return u<<12|f}}(pe)),pe}var be={},tt;function $t(){if(tt)return be;tt=1;const n=J(),r=1335,a=21522,o=n.getBCHDigit(r);return be.getEncodedBits=function(t,i){const l=t.bit<<3|i;let s=l<<10;for(;n.getBCHDigit(s)-o>=0;)s^=r<<n.getBCHDigit(s)-o;return(l<<10|s)^a},be}var we={},Ce,nt;function Ht(){if(nt)return Ce;nt=1;const n=G();function r(a){this.mode=n.NUMERIC,this.data=a.toString()}return r.getBitsLength=function(o){return 10*Math.floor(o/3)+(o%3?o%3*3+1:0)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(o){let e,t,i;for(e=0;e+3<=this.data.length;e+=3)t=this.data.substr(e,3),i=parseInt(t,10),o.put(i,10);const l=this.data.length-e;l>0&&(t=this.data.substr(e),i=parseInt(t,10),o.put(i,l*3+1))},Ce=r,Ce}var xe,rt;function jt(){if(rt)return xe;rt=1;const n=G(),r=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function a(o){this.mode=n.ALPHANUMERIC,this.data=o}return a.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)},a.prototype.getLength=function(){return this.data.length},a.prototype.getBitsLength=function(){return a.getBitsLength(this.data.length)},a.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let i=r.indexOf(this.data[t])*45;i+=r.indexOf(this.data[t+1]),e.put(i,11)}this.data.length%2&&e.put(r.indexOf(this.data[t]),6)},xe=a,xe}var Se,ot;function Yt(){if(ot)return Se;ot=1;const n=G();function r(a){this.mode=n.BYTE,typeof a=="string"?this.data=new TextEncoder().encode(a):this.data=new Uint8Array(a)}return r.getBitsLength=function(o){return o*8},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(a){for(let o=0,e=this.data.length;o<e;o++)a.put(this.data[o],8)},Se=r,Se}var ve,at;function Kt(){if(at)return ve;at=1;const n=G(),r=J();function a(o){this.mode=n.KANJI,this.data=o}return a.getBitsLength=function(e){return e*13},a.prototype.getLength=function(){return this.data.length},a.prototype.getBitsLength=function(){return a.getBitsLength(this.data.length)},a.prototype.write=function(o){let e;for(e=0;e<this.data.length;e++){let t=r.toSJIS(this.data[e]);if(t>=33088&&t<=40956)t-=33088;else if(t>=57408&&t<=60351)t-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
343
+ Make sure your charset is UTF-8`);t=(t>>>8&255)*192+(t&255),o.put(t,13)}},ve=a,ve}var Pe={exports:{}},it;function Jt(){return it||(it=1,function(n){var r={single_source_shortest_paths:function(a,o,e){var t={},i={};i[o]=0;var l=r.PriorityQueue.make();l.push(o,0);for(var s,d,p,y,h,u,f,g,I;!l.empty();){s=l.pop(),d=s.value,y=s.cost,h=a[d]||{};for(p in h)h.hasOwnProperty(p)&&(u=h[p],f=y+u,g=i[p],I=typeof i[p]=="undefined",(I||g>f)&&(i[p]=f,l.push(p,f),t[p]=d))}if(typeof e!="undefined"&&typeof i[e]=="undefined"){var x=["Could not find a path from ",o," to ",e,"."].join("");throw new Error(x)}return t},extract_shortest_path_from_predecessor_list:function(a,o){for(var e=[],t=o;t;)e.push(t),a[t],t=a[t];return e.reverse(),e},find_path:function(a,o,e){var t=r.single_source_shortest_paths(a,o,e);return r.extract_shortest_path_from_predecessor_list(t,e)},PriorityQueue:{make:function(a){var o=r.PriorityQueue,e={},t;a=a||{};for(t in o)o.hasOwnProperty(t)&&(e[t]=o[t]);return e.queue=[],e.sorter=a.sorter||o.default_sorter,e},default_sorter:function(a,o){return a.cost-o.cost},push:function(a,o){var e={value:a,cost:o};this.queue.push(e),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};n.exports=r}(Pe)),Pe.exports}var st;function Gt(){return st||(st=1,function(n){const r=G(),a=Ht(),o=jt(),e=Yt(),t=Kt(),i=Ze(),l=J(),s=Jt();function d(x){return unescape(encodeURIComponent(x)).length}function p(x,M,b){const C=[];let L;for(;(L=x.exec(b))!==null;)C.push({data:L[0],index:L.index,mode:M,length:L[0].length});return C}function y(x){const M=p(i.NUMERIC,r.NUMERIC,x),b=p(i.ALPHANUMERIC,r.ALPHANUMERIC,x);let C,L;return l.isKanjiModeEnabled()?(C=p(i.BYTE,r.BYTE,x),L=p(i.KANJI,r.KANJI,x)):(C=p(i.BYTE_KANJI,r.BYTE,x),L=[]),M.concat(b,C,L).sort(function(v,P){return v.index-P.index}).map(function(v){return{data:v.data,mode:v.mode,length:v.length}})}function h(x,M){switch(M){case r.NUMERIC:return a.getBitsLength(x);case r.ALPHANUMERIC:return o.getBitsLength(x);case r.KANJI:return t.getBitsLength(x);case r.BYTE:return e.getBitsLength(x)}}function u(x){return x.reduce(function(M,b){const C=M.length-1>=0?M[M.length-1]:null;return C&&C.mode===b.mode?(M[M.length-1].data+=b.data,M):(M.push(b),M)},[])}function f(x){const M=[];for(let b=0;b<x.length;b++){const C=x[b];switch(C.mode){case r.NUMERIC:M.push([C,{data:C.data,mode:r.ALPHANUMERIC,length:C.length},{data:C.data,mode:r.BYTE,length:C.length}]);break;case r.ALPHANUMERIC:M.push([C,{data:C.data,mode:r.BYTE,length:C.length}]);break;case r.KANJI:M.push([C,{data:C.data,mode:r.BYTE,length:d(C.data)}]);break;case r.BYTE:M.push([{data:C.data,mode:r.BYTE,length:d(C.data)}])}}return M}function g(x,M){const b={},C={start:{}};let L=["start"];for(let w=0;w<x.length;w++){const v=x[w],P=[];for(let S=0;S<v.length;S++){const k=v[S],T=""+w+S;P.push(T),b[T]={node:k,lastCount:0},C[T]={};for(let A=0;A<L.length;A++){const E=L[A];b[E]&&b[E].node.mode===k.mode?(C[E][T]=h(b[E].lastCount+k.length,k.mode)-h(b[E].lastCount,k.mode),b[E].lastCount+=k.length):(b[E]&&(b[E].lastCount=k.length),C[E][T]=h(k.length,k.mode)+4+r.getCharCountIndicator(k.mode,M))}}L=P}for(let w=0;w<L.length;w++)C[L[w]].end=0;return{map:C,table:b}}function I(x,M){let b;const C=r.getBestModeForData(x);if(b=r.from(M,C),b!==r.BYTE&&b.bit<C.bit)throw new Error('"'+x+'" cannot be encoded with mode '+r.toString(b)+`.
344
+ Suggested mode is: `+r.toString(C));switch(b===r.KANJI&&!l.isKanjiModeEnabled()&&(b=r.BYTE),b){case r.NUMERIC:return new a(x);case r.ALPHANUMERIC:return new o(x);case r.KANJI:return new t(x);case r.BYTE:return new e(x)}}n.fromArray=function(M){return M.reduce(function(b,C){return typeof C=="string"?b.push(I(C,null)):C.data&&b.push(I(C.data,C.mode)),b},[])},n.fromString=function(M,b){const C=y(M,l.isKanjiModeEnabled()),L=f(C),w=g(L,b),v=s.find_path(w.map,"start","end"),P=[];for(let S=1;S<v.length-1;S++)P.push(w.table[v[S]].node);return n.fromArray(u(P))},n.rawSplit=function(M){return n.fromArray(y(M,l.isKanjiModeEnabled()))}}(we)),we}var lt;function Qt(){if(lt)return ae;lt=1;const n=J(),r=se(),a=Lt(),o=Dt(),e=Ut(),t=qt(),i=Ft(),l=Ye(),s=zt(),d=Ot(),p=$t(),y=G(),h=Gt();function u(w,v){const P=w.size,S=t.getPositions(v);for(let k=0;k<S.length;k++){const T=S[k][0],A=S[k][1];for(let E=-1;E<=7;E++)if(!(T+E<=-1||P<=T+E))for(let N=-1;N<=7;N++)A+N<=-1||P<=A+N||(E>=0&&E<=6&&(N===0||N===6)||N>=0&&N<=6&&(E===0||E===6)||E>=2&&E<=4&&N>=2&&N<=4?w.set(T+E,A+N,!0,!0):w.set(T+E,A+N,!1,!0))}}function f(w){const v=w.size;for(let P=8;P<v-8;P++){const S=P%2===0;w.set(P,6,S,!0),w.set(6,P,S,!0)}}function g(w,v){const P=e.getPositions(v);for(let S=0;S<P.length;S++){const k=P[S][0],T=P[S][1];for(let A=-2;A<=2;A++)for(let E=-2;E<=2;E++)A===-2||A===2||E===-2||E===2||A===0&&E===0?w.set(k+A,T+E,!0,!0):w.set(k+A,T+E,!1,!0)}}function I(w,v){const P=w.size,S=d.getEncodedBits(v);let k,T,A;for(let E=0;E<18;E++)k=Math.floor(E/3),T=E%3+P-8-3,A=(S>>E&1)===1,w.set(k,T,A,!0),w.set(T,k,A,!0)}function x(w,v,P){const S=w.size,k=p.getEncodedBits(v,P);let T,A;for(T=0;T<15;T++)A=(k>>T&1)===1,T<6?w.set(T,8,A,!0):T<8?w.set(T+1,8,A,!0):w.set(S-15+T,8,A,!0),T<8?w.set(8,S-T-1,A,!0):T<9?w.set(8,15-T-1+1,A,!0):w.set(8,15-T-1,A,!0);w.set(S-8,8,1,!0)}function M(w,v){const P=w.size;let S=-1,k=P-1,T=7,A=0;for(let E=P-1;E>0;E-=2)for(E===6&&E--;;){for(let N=0;N<2;N++)if(!w.isReserved(k,E-N)){let Y=!1;A<v.length&&(Y=(v[A]>>>T&1)===1),w.set(k,E-N,Y),T--,T===-1&&(A++,T=7)}if(k+=S,k<0||P<=k){k-=S,S=-S;break}}}function b(w,v,P){const S=new a;P.forEach(function(N){S.put(N.mode.bit,4),S.put(N.getLength(),y.getCharCountIndicator(N.mode,w)),N.write(S)});const k=n.getSymbolTotalCodewords(w),T=l.getTotalCodewordsCount(w,v),A=(k-T)*8;for(S.getLengthInBits()+4<=A&&S.put(0,4);S.getLengthInBits()%8!==0;)S.putBit(0);const E=(A-S.getLengthInBits())/8;for(let N=0;N<E;N++)S.put(N%2?17:236,8);return C(S,w,v)}function C(w,v,P){const S=n.getSymbolTotalCodewords(v),k=l.getTotalCodewordsCount(v,P),T=S-k,A=l.getBlocksCount(v,P),E=S%A,N=A-E,Y=Math.floor(S/A),X=Math.floor(T/A),Cn=X+1,St=Y-X,xn=new s(St);let Ie=0;const te=new Array(A),vt=new Array(A);let Me=0;const Sn=new Uint8Array(w.buffer);for(let R=0;R<A;R++){const Le=R<N?X:Cn;te[R]=Sn.slice(Ie,Ie+Le),vt[R]=xn.encode(te[R]),Ie+=Le,Me=Math.max(Me,Le)}const Ne=new Uint8Array(S);let Pt=0,$,H;for($=0;$<Me;$++)for(H=0;H<A;H++)$<te[H].length&&(Ne[Pt++]=te[H][$]);for($=0;$<St;$++)for(H=0;H<A;H++)Ne[Pt++]=vt[H][$];return Ne}function L(w,v,P,S){let k;if(Array.isArray(w))k=h.fromArray(w);else if(typeof w=="string"){let Y=v;if(!Y){const X=h.rawSplit(w);Y=d.getBestVersionForData(X,P)}k=h.fromString(w,Y||40)}else throw new Error("Invalid data");const T=d.getBestVersionForData(k,P);if(!T)throw new Error("The amount of data is too big to be stored in a QR Code");if(!v)v=T;else if(v<T)throw new Error(`
203
345
  The chosen QR Code version cannot contain this amount of data.
204
- Minimum version required to store current data is: `+E+`.
205
- `);const A=T(B,S,P),x=n.getSymbolSize(B),v=new r(x);return u(v,B),g(v),m(v,B),w(v,S,0),B>=7&&I(v,B),N(v,A),isNaN(y)&&(y=a.getBestMask(v,w.bind(null,v,S))),a.applyMask(y,v),w(v,S,y),{modules:v,version:B,errorCorrectionLevel:S,maskPattern:y,segments:P}}return ne.create=function(B,S){if(typeof B=="undefined"||B==="")throw new Error("No input text");let y=o.M,P,E;return typeof S!="undefined"&&(y=o.from(S.errorCorrectionLevel,o.M),P=c.from(S.version),E=a.from(S.maskPattern),S.toSJISFunc&&n.setToSJISFunction(S.toSJISFunc)),D(B,P,y,E)},ne}var xe={},Se={},ot;function it(){return ot||(ot=1,function(n){function o(i){if(typeof i=="number"&&(i=i.toString()),typeof i!="string")throw new Error("Color should be defined as hex string");let r=i.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+i);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(e){return[e,e]}))),r.length===6&&r.push("F","F");const t=parseInt(r.join(""),16);return{r:t>>24&255,g:t>>16&255,b:t>>8&255,a:t&255,hex:"#"+r.slice(0,6).join("")}}n.getOptions=function(r){r||(r={}),r.color||(r.color={});const t=typeof r.margin=="undefined"||r.margin===null||r.margin<0?4:r.margin,e=r.width&&r.width>=21?r.width:void 0,a=r.scale||4;return{width:e,scale:e?4:a,margin:t,color:{dark:o(r.color.dark||"#000000ff"),light:o(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},n.getScale=function(r,t){return t.width&&t.width>=r+t.margin*2?t.width/(r+t.margin*2):t.scale},n.getImageWidth=function(r,t){const e=n.getScale(r,t);return Math.floor((r+t.margin*2)*e)},n.qrToImageData=function(r,t,e){const a=t.modules.size,s=t.modules.data,l=n.getScale(a,e),c=Math.floor((a+e.margin*2)*l),h=e.margin*l,p=[e.color.light,e.color.dark];for(let d=0;d<c;d++)for(let u=0;u<c;u++){let g=(d*c+u)*4,m=e.color.light;if(d>=h&&u>=h&&d<c-h&&u<c-h){const I=Math.floor((d-h)/l),w=Math.floor((u-h)/l);m=p[s[I*a+w]?1:0]}r[g++]=m.r,r[g++]=m.g,r[g++]=m.b,r[g]=m.a}}}(Se)),Se}var at;function Ft(){return at||(at=1,function(n){const o=it();function i(t,e,a){t.clearRect(0,0,e.width,e.height),e.style||(e.style={}),e.height=a,e.width=a,e.style.height=a+"px",e.style.width=a+"px"}function r(){try{return document.createElement("canvas")}catch(t){throw new Error("You need to specify a canvas element")}}n.render=function(e,a,s){let l=s,c=a;typeof l=="undefined"&&(!a||!a.getContext)&&(l=a,a=void 0),a||(c=r()),l=o.getOptions(l);const h=o.getImageWidth(e.modules.size,l),p=c.getContext("2d"),d=p.createImageData(h,h);return o.qrToImageData(d.data,e,l),i(p,c,h),p.putImageData(d,0,0),c},n.renderToDataURL=function(e,a,s){let l=s;typeof l=="undefined"&&(!a||!a.getContext)&&(l=a,a=void 0),l||(l={});const c=n.render(e,a,l),h=l.type||"image/png",p=l.rendererOpts||{};return c.toDataURL(h,p.quality)}}(xe)),xe}var Be={},st;function _t(){if(st)return Be;st=1;const n=it();function o(t,e){const a=t.a/255,s=e+'="'+t.hex+'"';return a<1?s+" "+e+'-opacity="'+a.toFixed(2).slice(1)+'"':s}function i(t,e,a){let s=t+e;return typeof a!="undefined"&&(s+=" "+a),s}function r(t,e,a){let s="",l=0,c=!1,h=0;for(let p=0;p<t.length;p++){const d=Math.floor(p%e),u=Math.floor(p/e);!d&&!c&&(c=!0),t[p]?(h++,p>0&&d>0&&t[p-1]||(s+=c?i("M",d+a,.5+u+a):i("m",l,0),l=0,c=!1),d+1<e&&t[p+1]||(s+=i("h",h),h=0)):l++}return s}return Be.render=function(e,a,s){const l=n.getOptions(a),c=e.modules.size,h=e.modules.data,p=c+l.margin*2,d=l.color.light.a?"<path "+o(l.color.light,"fill")+' d="M0 0h'+p+"v"+p+'H0z"/>':"",u="<path "+o(l.color.dark,"stroke")+' d="'+r(h,c,l.margin)+'"/>',g='viewBox="0 0 '+p+" "+p+'"',I='<svg xmlns="http://www.w3.org/2000/svg" '+(l.width?'width="'+l.width+'" height="'+l.width+'" ':"")+g+' shape-rendering="crispEdges">'+d+u+`</svg>
206
- `;return typeof s=="function"&&s(null,I),I},Be}var lt;function zt(){if(lt)return J;lt=1;const n=bt(),o=Rt(),i=Ft(),r=_t();function t(e,a,s,l,c){const h=[].slice.call(arguments,1),p=h.length,d=typeof h[p-1]=="function";if(!d&&!n())throw new Error("Callback required as last argument");if(d){if(p<2)throw new Error("Too few arguments provided");p===2?(c=s,s=a,a=l=void 0):p===3&&(a.getContext&&typeof c=="undefined"?(c=l,l=void 0):(c=l,l=s,s=a,a=void 0))}else{if(p<1)throw new Error("Too few arguments provided");return p===1?(s=a,a=l=void 0):p===2&&!a.getContext&&(l=s,s=a,a=void 0),new Promise(function(u,g){try{const m=o.create(s,l);u(e(m,a,l))}catch(m){g(m)}})}try{const u=o.create(s,l);c(null,e(u,a,l))}catch(u){c(u)}}return J.create=o.create,J.toCanvas=t.bind(null,i.render),J.toDataURL=t.bind(null,i.renderToDataURL),J.toString=t.bind(null,function(e,a,s){return r.render(e,s)}),J}var Ht=zt();const Ot=Ct(Ht),ct=({title:n,uid:o})=>{var I;const i=Q.useFieldSchema(),r=L.useMatch("/admin/:name"),t=L.useMatch("/share/:name"),e=L.useMatch("/mobile/:name"),a=b.useIsMobile(),s=r||t||e,c=(a?window.location.href.replace("/mobile","/share"):window.location.href.replace("/admin","/share")).replace((I=s==null?void 0:s.params)==null?void 0:I.name,o||i["x-uid"]).replace(window.location.search||"",""),{t:h}=b.useTranslation(),[p,d]=U.useState(),u=b.useCompile();return Ot.toDataURL(c,{width:170},(w,N)=>{if(w){console.error(w);return}p||d(N)}),{copyLink:()=>{navigator.clipboard.writeText(c).then(w=>{q.message.open({type:"success",content:f.jsxs(f.Fragment,{children:[h("Replicated"),f.jsx("span",{style:{color:"#3279FE"},children:u(n||"")}),h("page link")]})})})},imageAction:()=>f.jsx(jt,{link:p,title:n})}},jt=n=>{const{link:o,title:i}=n,r=U.useRef(null),{t}=b.useTranslation(),{currentUserCtx:e}=b.useCurrentUserVariable(),a=b.useCompile();U.useEffect(()=>{Vt(r,o,e,t)},[]);const s=()=>{const c=r.current;if(c){const h=c.toDataURL("image/png"),p=document.createElement("a");p.href=h,p.download="Tachybase-Share.png",p.click(),q.message.open({type:"success",content:f.jsxs(f.Fragment,{children:[t("Saved"),f.jsx("span",{style:{color:"#3279FE"},children:a(i||"")}),t("QR code")]})})}},l=()=>{const c=r.current;c&&navigator.clipboard&&c.toBlob(h=>ee(null,null,function*(){if(h)try{const p=new ClipboardItem({"image/png":h});yield navigator.clipboard.write([p]),q.message.open({type:"success",content:f.jsxs(f.Fragment,{children:[t("Replicated"),f.jsx("span",{style:{color:"#3279FE"},children:a(i||"")}),t("QR code")]})})}catch(p){q.message.error(t("Copy failed, please try again"))}}),"image/png")};return f.jsxs("div",{style:{marginTop:"23px",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[f.jsx("canvas",{ref:r,width:240,height:260,style:{width:"240px",height:"260px",pointerEvents:"none"}}),f.jsxs("div",{style:{width:"100%",display:"flex",justifyContent:"space-between",marginTop:"10px"},children:[f.jsx(q.Button,{onClick:s,style:{width:"49%"},children:t("Save Picture")}),f.jsx(q.Button,{onClick:l,style:{width:"49%"},children:t("Copy QR code")})]})]})},Vt=(n,o,i,r)=>{const t=n.current,e=t.getContext("2d"),a=window.devicePixelRatio,{width:s,height:l}=t;t.width=Math.round(s*a),t.height=Math.round(l*a),t.style.width=s+"px",t.style.height=l+"px",e.scale(a,a),e.filter="blur(20px)";const c=e.createLinearGradient(0,0,t.width,t.height);c.addColorStop(0,"rgba(255, 255, 255, 1)"),c.addColorStop(1,"rgba(234, 238, 246, 0.80)"),e.fillStyle=c,e.fillRect(0,0,t.width,t.height);const h=(d,u)=>{const m=e.createRadialGradient(d,u,0,d,u,100);m.addColorStop(0,"rgba(255, 255, 255, 1)"),m.addColorStop(1,"rgba(217, 238, 255, 0.216)"),e.fillStyle=m,e.beginPath(),e.arc(d,u,100,0,Math.PI*2),e.fill()};h(60,30),h(190,280),e.filter="none",e.fillStyle="#AAAAAA",e.font="13px Arial",e.textAlign="center",e.fillText(`${i.nickname}`,t.width/4,30);const p=new Image;p.src=o,p.onload=()=>{const d=p.width,u=p.height,g=(t.width-d)/8,m=40,I=3,w=20;e.beginPath(),e.moveTo(g+w,m),e.arcTo(g+d,m,g+d,m+u,w),e.arcTo(g+d,m+u,g,m+u,w),e.arcTo(g,m+u,g,m,w),e.arcTo(g,m,g+d,m,w),e.closePath(),e.clip(),e.drawImage(p,g+I,m+I,d-2*I,u-2*I),e.lineWidth=I,e.strokeStyle="#000",e.beginPath(),e.moveTo(g+w,m),e.arcTo(g+d,m,g+d,m+u,w),e.arcTo(g+d,m+u,g,m+u,w),e.arcTo(g,m+u,g,m,w),e.arcTo(g,m,g+d,m,w),e.closePath(),e.stroke()},e.fillStyle="#AAAAAA",e.font="13px Arial",e.textAlign="center",e.fillText(r("Scan the code to view the sharing"),t.width/4,230),e.fillStyle="rgba(50, 121, 254, 1)",e.font="14px Arial",e.textAlign="center",e.fillText("灵矶(Tachybase)",t.width/4,250)},Kt=Q.connect(n=>{var T;const o=b.usePageExtendComponentContext(),{disablePageHeader:i,fieldSchema:r={},title:t="",enableSharePage:e,isExtra:a}=o,s=L.useMatch("/share/:name"),l=(T=r==null?void 0:r["x-component-props"])==null?void 0:T.hidePageTitle,[c,h]=U.useState(!1),[p,d]=U.useState(!1),u=b.useCompile(),{t:g}=b.useTranslation(),m=l?void 0:r.title||u(t),{styles:I}=yt(),{copyLink:w,imageAction:N}=ct({title:m,uid:r["x-uid"]});return f.jsxs(f.Fragment,{children:[!s&&a&&f.jsx(q.Button,{icon:f.jsx(K.ShareAltOutlined,{}),onClick:()=>{h(!0)},style:{visibility:`${e?"visible":"hidden"}`}}),!a&&i&&e&&!s&&f.jsx("div",{className:"tb-page-header-button",children:f.jsx(q.Button,{icon:f.jsx(K.ShareAltOutlined,{}),onClick:()=>{h(!0)},children:g("Share")})}),f.jsxs(q.Modal,{open:c,className:I.firstmodal,title:g("Share"),footer:null,width:500,onCancel:()=>{h(!1)},children:[f.jsxs("div",{className:I.secondmodal,children:[f.jsxs("div",{className:"tb-header-modal-list",onClick:w,children:[f.jsx(b.Icon,{type:"PaperClipOutlined"}),g("Copy link")]}),f.jsxs("div",{className:"tb-header-modal-list",onClick:()=>{d(!0)},children:[f.jsx(b.Icon,{type:"QrcodeOutlined"}),g("Generate QR code")]})]}),f.jsx(q.Modal,{className:I.imageModal,open:p,footer:null,onCancel:()=>{d(!1)},children:N()})]})]})});function Jt(){const n=new URL(window.location.href),o=b.useAPIClient(),i=n.searchParams.get("token");return i&&o.auth.setToken(i),o.auth.getToken()}const Yt=()=>{var t,e,a,s,l;const{styles:n}=wt(),o=b.useApp(),i=b.useSystemSettings(),r=U.useRef();return f.jsx(q.Layout,{style:{height:"100%"},children:f.jsxs(q.Layout.Content,{className:$.css`
346
+ Minimum version required to store current data is: `+T+`.
347
+ `);const A=b(v,P,k),E=n.getSymbolSize(v),N=new o(E);return u(N,v),f(N),g(N,v),x(N,P,0),v>=7&&I(N,v),M(N,A),isNaN(S)&&(S=i.getBestMask(N,x.bind(null,N,P))),i.applyMask(S,N),x(N,P,S),{modules:N,version:v,errorCorrectionLevel:P,maskPattern:S,segments:k}}return ae.create=function(v,P){if(typeof v=="undefined"||v==="")throw new Error("No input text");let S=r.M,k,T;return typeof P!="undefined"&&(S=r.from(P.errorCorrectionLevel,r.M),k=d.from(P.version),T=i.from(P.maskPattern),P.toSJISFunc&&n.setToSJISFunction(P.toSJISFunc)),L(v,k,S,T)},ae}var Ee={},Te={},ct;function ut(){return ct||(ct=1,function(n){function r(a){if(typeof a=="number"&&(a=a.toString()),typeof a!="string")throw new Error("Color should be defined as hex string");let o=a.slice().replace("#","").split("");if(o.length<3||o.length===5||o.length>8)throw new Error("Invalid hex color: "+a);(o.length===3||o.length===4)&&(o=Array.prototype.concat.apply([],o.map(function(t){return[t,t]}))),o.length===6&&o.push("F","F");const e=parseInt(o.join(""),16);return{r:e>>24&255,g:e>>16&255,b:e>>8&255,a:e&255,hex:"#"+o.slice(0,6).join("")}}n.getOptions=function(o){o||(o={}),o.color||(o.color={});const e=typeof o.margin=="undefined"||o.margin===null||o.margin<0?4:o.margin,t=o.width&&o.width>=21?o.width:void 0,i=o.scale||4;return{width:t,scale:t?4:i,margin:e,color:{dark:r(o.color.dark||"#000000ff"),light:r(o.color.light||"#ffffffff")},type:o.type,rendererOpts:o.rendererOpts||{}}},n.getScale=function(o,e){return e.width&&e.width>=o+e.margin*2?e.width/(o+e.margin*2):e.scale},n.getImageWidth=function(o,e){const t=n.getScale(o,e);return Math.floor((o+e.margin*2)*t)},n.qrToImageData=function(o,e,t){const i=e.modules.size,l=e.modules.data,s=n.getScale(i,t),d=Math.floor((i+t.margin*2)*s),p=t.margin*s,y=[t.color.light,t.color.dark];for(let h=0;h<d;h++)for(let u=0;u<d;u++){let f=(h*d+u)*4,g=t.color.light;if(h>=p&&u>=p&&h<d-p&&u<d-p){const I=Math.floor((h-p)/s),x=Math.floor((u-p)/s);g=y[l[I*i+x]?1:0]}o[f++]=g.r,o[f++]=g.g,o[f++]=g.b,o[f]=g.a}}}(Te)),Te}var dt;function Rt(){return dt||(dt=1,function(n){const r=ut();function a(e,t,i){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=i,t.width=i,t.style.height=i+"px",t.style.width=i+"px"}function o(){try{return document.createElement("canvas")}catch(e){throw new Error("You need to specify a canvas element")}}n.render=function(t,i,l){let s=l,d=i;typeof s=="undefined"&&(!i||!i.getContext)&&(s=i,i=void 0),i||(d=o()),s=r.getOptions(s);const p=r.getImageWidth(t.modules.size,s),y=d.getContext("2d"),h=y.createImageData(p,p);return r.qrToImageData(h.data,t,s),a(y,d,p),y.putImageData(h,0,0),d},n.renderToDataURL=function(t,i,l){let s=l;typeof s=="undefined"&&(!i||!i.getContext)&&(s=i,i=void 0),s||(s={});const d=n.render(t,i,s),p=s.type||"image/png",y=s.rendererOpts||{};return d.toDataURL(p,y.quality)}}(Ee)),Ee}var Be={},ht;function Wt(){if(ht)return Be;ht=1;const n=ut();function r(e,t){const i=e.a/255,l=t+'="'+e.hex+'"';return i<1?l+" "+t+'-opacity="'+i.toFixed(2).slice(1)+'"':l}function a(e,t,i){let l=e+t;return typeof i!="undefined"&&(l+=" "+i),l}function o(e,t,i){let l="",s=0,d=!1,p=0;for(let y=0;y<e.length;y++){const h=Math.floor(y%t),u=Math.floor(y/t);!h&&!d&&(d=!0),e[y]?(p++,y>0&&h>0&&e[y-1]||(l+=d?a("M",h+i,.5+u+i):a("m",s,0),s=0,d=!1),h+1<t&&e[y+1]||(l+=a("h",p),p=0)):s++}return l}return Be.render=function(t,i,l){const s=n.getOptions(i),d=t.modules.size,p=t.modules.data,y=d+s.margin*2,h=s.color.light.a?"<path "+r(s.color.light,"fill")+' d="M0 0h'+y+"v"+y+'H0z"/>':"",u="<path "+r(s.color.dark,"stroke")+' d="'+o(p,d,s.margin)+'"/>',f='viewBox="0 0 '+y+" "+y+'"',I='<svg xmlns="http://www.w3.org/2000/svg" '+(s.width?'width="'+s.width+'" height="'+s.width+'" ':"")+f+' shape-rendering="crispEdges">'+h+u+`</svg>
348
+ `;return typeof l=="function"&&l(null,I),I},Be}var ft;function Zt(){if(ft)return Q;ft=1;const n=Nt(),r=Qt(),a=Rt(),o=Wt();function e(t,i,l,s,d){const p=[].slice.call(arguments,1),y=p.length,h=typeof p[y-1]=="function";if(!h&&!n())throw new Error("Callback required as last argument");if(h){if(y<2)throw new Error("Too few arguments provided");y===2?(d=l,l=i,i=s=void 0):y===3&&(i.getContext&&typeof d=="undefined"?(d=s,s=void 0):(d=s,s=l,l=i,i=void 0))}else{if(y<1)throw new Error("Too few arguments provided");return y===1?(l=i,i=s=void 0):y===2&&!i.getContext&&(s=l,l=i,i=void 0),new Promise(function(u,f){try{const g=r.create(l,s);u(t(g,i,s))}catch(g){f(g)}})}try{const u=r.create(l,s);d(null,t(u,i,s))}catch(u){d(u)}}return Q.create=r.create,Q.toCanvas=e.bind(null,a.render),Q.toDataURL=e.bind(null,a.renderToDataURL),Q.toString=e.bind(null,function(t,i,l){return o.render(t,l)}),Q}var Xt=Zt();const en=Mt(Xt),Ae=D.createContext({shareValue:{linkStatus:!0,password:null,permanent:!1,shareTime:null,permission:"view",generateLink:null,createdBy:null,updatedBy:null,tabs:[]},setShareValue:n=>{}}),ke=()=>D.useContext(Ae),gt=n=>{var b;const{title:r,uid:a}=n,o=W.useFieldSchema(),e=q.useMatch("/admin/:name"),t=q.useMatch("/share/:name"),i=q.useMatch("/mobile/:name"),l=m.useIsMobile(),s=e||t||i,d=l?window.location.href.replace("/mobile","/share"):window.location.href.replace("/admin","/share"),{t:p}=m.useTranslation(),{shareValue:y}=ke(),h=m.useCompile(),u=m.useAPIClient(),[f,g]=D.useState(""),I=d.replace((b=s==null?void 0:s.params)==null?void 0:b.name,a||o["x-uid"]).replace(window.location.search||"","");return D.useEffect(()=>{g("")},[y]),{copyLink:C=>{const L=typeof C=="string"?C:f;L?pt(L,r,h,p):u.resource("sharePageConfig").create({values:V(F({},y),{generateLink:I})}).then(w=>{const v=I+"/"+(w==null?void 0:w.data.data.id);g(v),pt(v,r,h,p)})},imageAction:C=>{const L=typeof C=="string"?C:f;return c.jsx(tn,{link:I,title:r,shareLink:L,setShareLink:g})}}},tn=n=>{const{link:r,title:a,shareLink:o,setShareLink:e}=n,t=D.useRef(null),{t:i}=m.useTranslation(),{currentUserCtx:l}=m.useCurrentUserVariable(),s=m.useCompile(),{shareValue:d}=ke(),p=m.useAPIClient();D.useEffect(()=>{o?en.toDataURL(o,{width:170},(u,f)=>{if(u){console.error(u);return}f&&nn(t,f,l,i)}):p.resource("sharePageConfig").create({values:V(F({},d),{generateLink:r})}).then(u=>{e(r+"/"+(u==null?void 0:u.data.data.id))})},[o]);const y=()=>{const u=t.current;if(u){const f=u.toDataURL("image/png"),g=document.createElement("a");g.href=f,g.download="Tachybase-Share.png",g.click(),B.message.open({type:"success",content:c.jsxs(c.Fragment,{children:[i("Saved"),c.jsx("span",{style:{color:"#3279FE"},children:s(a||"")}),i("QR code")]})})}},h=()=>{const u=t.current;u&&navigator.clipboard&&u.toBlob(f=>ne(null,null,function*(){if(f)try{const g=new ClipboardItem({"image/png":f});yield navigator.clipboard.write([g]),B.message.open({type:"success",content:c.jsxs(c.Fragment,{children:[i("Replicated"),c.jsx("span",{style:{color:"#3279FE"},children:s(a||"")}),i("QR code")]})})}catch(g){B.message.error(i("Copy failed, please try again"))}}),"image/png")};return c.jsxs("div",{style:{marginTop:"23px",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[c.jsx("canvas",{ref:t,width:240,height:260,style:{width:"240px",height:"260px",pointerEvents:"none"}}),c.jsxs("div",{style:{width:"100%",display:"flex",justifyContent:"space-between",marginTop:"10px"},children:[c.jsx(B.Button,{onClick:y,style:{width:"49%"},children:i("Save Picture")}),c.jsx(B.Button,{onClick:h,style:{width:"49%"},children:i("Copy QR code")})]})]})},nn=(n,r,a,o)=>{const e=n.current,t=e.getContext("2d"),i=window.devicePixelRatio,{width:l,height:s}=e;e.width=Math.round(l*i),e.height=Math.round(s*i),e.style.width=l+"px",e.style.height=s+"px",t.scale(i,i),t.filter="blur(20px)";const d=t.createLinearGradient(0,0,e.width,e.height);d.addColorStop(0,"rgba(255, 255, 255, 1)"),d.addColorStop(1,"rgba(234, 238, 246, 0.80)"),t.fillStyle=d,t.fillRect(0,0,e.width,e.height);const p=(h,u)=>{const g=t.createRadialGradient(h,u,0,h,u,100);g.addColorStop(0,"rgba(255, 255, 255, 1)"),g.addColorStop(1,"rgba(217, 238, 255, 0.216)"),t.fillStyle=g,t.beginPath(),t.arc(h,u,100,0,Math.PI*2),t.fill()};p(60,30),p(190,280),t.filter="none",t.fillStyle="#AAAAAA",t.font="13px Arial",t.textAlign="center",t.fillText(`${a.nickname}`,e.width/4,30);const y=new Image;y.src=r,y.onload=()=>{const h=y.width,u=y.height,f=(e.width-h)/8,g=40,I=3,x=20;t.beginPath(),t.moveTo(f+x,g),t.arcTo(f+h,g,f+h,g+u,x),t.arcTo(f+h,g+u,f,g+u,x),t.arcTo(f,g+u,f,g,x),t.arcTo(f,g,f+h,g,x),t.closePath(),t.clip(),t.drawImage(y,f+I,g+I,h-2*I,u-2*I),t.lineWidth=I,t.strokeStyle="#000",t.beginPath(),t.moveTo(f+x,g),t.arcTo(f+h,g,f+h,g+u,x),t.arcTo(f+h,g+u,f,g+u,x),t.arcTo(f,g+u,f,g,x),t.arcTo(f,g,f+h,g,x),t.closePath(),t.stroke()},t.fillStyle="#AAAAAA",t.font="13px Arial",t.textAlign="center",t.fillText(o("Scan the code to view the sharing"),e.width/4,230),t.fillStyle="rgba(50, 121, 254, 1)",t.font="14px Arial",t.textAlign="center",t.fillText("灵矶(Tachybase)",e.width/4,250)},pt=(n,r,a,o)=>{navigator.clipboard.writeText(n).then(e=>{B.message.open({type:"success",content:c.jsxs(c.Fragment,{children:[o("Replicated"),c.jsx("span",{style:{color:"#3279FE"},children:a(r||"")}),o("page link")]})})})},rn={title:"sharePageConfig",name:"sharePageConfig",fields:[{name:"createdAt",interface:"createdAt",type:"date",field:"createdAt",uiSchema:{type:"datetime",title:'{{t("Created at")}}',"x-component":"DatePicker","x-component-props":{},"x-read-pretty":!0}},{name:"createdBy",interface:"createdBy",type:"belongsTo",target:"users",foreignKey:"createdById",uiSchema:{type:"object",title:'{{t("Created by")}}',"x-component":"AssociationField","x-component-props":{fieldNames:{value:"id",label:"nickname"}},"x-read-pretty":!0}},{type:"date",field:"updatedAt",name:"updatedAt",interface:"updatedAt",uiSchema:{type:"string",title:'{{t("Last updated at")}}',"x-component":"DatePicker","x-component-props":{},"x-read-pretty":!0}},{type:"belongsTo",target:"users",foreignKey:"updatedById",name:"updatedBy",interface:"updatedBy",uiSchema:{type:"object",title:'{{t("Last updated by")}}',"x-component":"AssociationField","x-component-props":{fieldNames:{value:"id",label:"nickname"}},"x-read-pretty":!0}},{type:"bigInt",name:"id",primaryKey:!0,autoIncrement:!0,interface:"id",uiSchema:{type:"number",title:'{{t("ID")}}',"x-component":"InputNumber","x-read-pretty":!0}},{interface:"checkbox",name:"linkStatus",type:"boolean",uiSchema:{title:"linkStatus",type:"boolean","x-component":"Checkbox","x-component-props":{shouUnchecked:!0}}},{type:"password",name:"password",interface:"password",hidden:!0,uiSchema:{type:"string",title:'{{t("Password")}}',"x-component":"Password"}},{interface:"checkbox",name:"permanent",type:"boolean",uiSchema:{title:"permanent",type:"boolean","x-component":"Checkbox","x-component-props":{shouUnchecked:!1}}},{interface:"datetime",name:"shareTime",type:"date",uiSchema:{title:'{{t("ShareTime")}}',type:"string","x-component":"DatePicker","x-component-props":{dateFormat:"YYYY-MM-DD",gmt:!1,showTime:!1}}},{interface:"radioGroup",name:"permission",type:"string",uiSchema:{title:'{{t("Permission")}}',tye:"string","x-component":"Radio.Group",enum:[{value:"edit",label:'{{t("Editable")}}',color:"gold"},{value:"view",label:'{{t("View Only")}}',color:"green"}]}},{interface:"url",name:"generateLink",type:"text",uiSchema:{title:"generateLink",tye:"string","x-component":"Input.URL"}},{interface:"input",type:"jsonb",name:"tabs",uiSchema:{type:"object",title:"tabs","x-component":"Json","x-component-props":{style:{height:"100px"}}}}]},mt=D.createContext({aclRoleShareMenuUiSchemas:[]}),on=n=>{var e;const r=m.useAPIClient(),a=q.useMatch("/share/:name/:id"),{data:o}=m.useRequest({resource:"roles",action:"get",params:{filter:{name:r.auth.role},appends:["menuShareUiSchemas"],paginate:!1}},{ready:!!r.auth.role&&!a,refreshDeps:[r.auth.role]});return c.jsx(mt.Provider,{value:{aclRoleShareMenuUiSchemas:((e=o==null?void 0:o.data)==null?void 0:e.menuShareUiSchemas)||[]},children:c.jsx(m.ExtendCollectionsProvider,{collections:[rn],children:n.children})})},an=()=>D.useContext(mt),yt=()=>{const{aclRoleShareMenuUiSchemas:n}=an(),r=q.useParams();return(n==null?void 0:n.filter(o=>o["x-uid"]===r.name)).length>0},bt=n=>{const{shareValue:r,setShareValue:a,allTabs:o}=n,{t:e}=m.useTranslation(),[t,i]=D.useState({visible:!1,value:r.password}),l=m.useACLRoleContext(),{styles:s}=De(),[d,p]=D.useState({setPw:!0,edit:!1}),[y,h]=D.useState(!1),[u,f]=D.useState(o),g=m.useAPIClient();D.useEffect(()=>{r.password||(i({visible:!1,value:r.password}),p({setPw:!r.password,edit:!1}))},[r]);const I=()=>{if(r.shareTime&&_().isAfter(r.shareTime)){B.message.warning(e("Please reset the link time limit"));return}g.resource("sharePageConfig").update({filterByTk:r.id,values:r}).then(C=>{h(!1),B.message.success(e("Saved successfully"))})},x=b=>{const C=r.tabs?r.tabs.findIndex(L=>L.value===b.value):-1;if(b.value==="all")C>=0?a(V(F({},r),{tabs:[]})):a(V(F({},r),{tabs:[...u]}));else if(C>=0){const L=r.tabs.filter(w=>w.value!=="all"&&w.value!==b.value);a(V(F({},r),{tabs:L}))}else a(V(F({},r),{tabs:[...r.tabs||[],b.data]}));h(!0)},M=b=>{if(b&&!u&&r.generateLink){const C=r.generateLink.split("/").pop();g.request({url:`/uiSchemas:getProperties/${C}`}).then(L=>{var P,S,k,T;const w=((S=(P=L==null?void 0:L.data)==null?void 0:P.data)==null?void 0:S.bodyProperties)||((T=(k=L==null?void 0:L.data)==null?void 0:k.data)==null?void 0:T.properties),v=Object.entries(w||{}).map(([A,E],N)=>({label:E.title||`${e("Tab")}${N+1}`,value:E["x-uid"],xUid:E["x-uid"],schemaName:A,title:E.title}));v.length>1&&v.unshift({label:e("Select all"),value:"all",xUid:"",schemaName:"",title:""}),f(v)})}};return c.jsxs(B.Form,{layout:"vertical",className:s.form,children:[c.jsx(B.Form.Item,{label:`${e("Sharing permission")}:`,children:c.jsx(B.Radio.Group,{onChange:b=>{h(!0),a(V(F({},r),{permission:b.target.value}))},value:r.permission,options:[{value:"edit",label:e("Editable"),disabled:!l.strategy.actions.includes("update")},{value:"view",label:e("View only")}]})}),c.jsx(B.Form.Item,{label:`${e("Select tab")}:`,children:c.jsx(B.Select,{mode:"multiple",maxTagCount:"responsive",options:u,value:r.tabs,optionRender:b=>{var C;return c.jsxs("div",{onClick:()=>{x(b)},children:[c.jsx(B.Checkbox,{checked:((C=r==null?void 0:r.tabs)==null?void 0:C.find(L=>L.value===b.value))||!1,style:{paddingRight:"5px"},onChange:()=>{x(b)}}),b.label]})},tagRender:b=>b.value==="all"?null:c.jsx(B.Tag,{children:b.label}),onDropdownVisibleChange:M})}),c.jsx(B.Form.Item,{label:`${e("Link timeliness")}:`,children:c.jsx(B.DatePicker,{showToday:!1,value:r.shareTime?_(r.shareTime):null,onChange:b=>{h(!0),a(V(F({},r),{shareTime:b}))},minDate:_(),renderExtraFooter:()=>c.jsxs("div",{className:s.datePickFooter,children:[e("Permanently valid"),c.jsx(B.Button,{type:"primary",onClick:()=>{h(!0),a(V(F({},r),{shareTime:null}))},children:e("Confirm")})]})})}),c.jsxs(B.Form.Item,{label:`${e("Set access password")}:`,children:[d.setPw&&c.jsx(B.Button,{className:"setPassWord",onClick:()=>p(V(F({},d),{setPw:!1})),children:e("Set access password")}),!d.setPw&&c.jsxs("div",{className:"password",children:[c.jsx(B.Input.Password,{visibilityToggle:{visible:t.visible,onVisibleChange:()=>{i(V(F({},t),{visible:!t.visible}))}},disabled:d.edit,onChange:b=>{i(V(F({},t),{value:b.target.value}))},value:t.value}),!d.edit&&c.jsx(B.Button,{className:"pw-cancel",onClick:()=>{h(!0),p(V(F({},d),{setPw:!0})),a(V(F({},r),{password:null}))},children:e("Cancel")}),!d.edit&&c.jsx(B.Button,{className:"pw-submit",onClick:()=>{h(!0),p({setPw:!1,edit:!0}),a(V(F({},r),{password:t.value}))},children:e("Submit")}),d.edit&&c.jsx(B.Button,{className:"pw-edit",onClick:()=>{p({setPw:!1,edit:!1})},children:e("Edit")})]})]}),r.id&&y&&c.jsx(B.Form.Item,{className:"submit",children:c.jsx(B.Button,{type:"primary",onClick:I,block:!0,children:e("Save")})})]})},sn=n=>{const{styles:r}=De(),{t:a}=m.useTranslation();return c.jsx(B.Collapse,{items:[{key:"1",label:`${a("Expand Settings")}`,children:c.jsx(bt,F({},n))}],bordered:!1,className:r.collapse,expandIconPosition:"end"})},ln=W.connect(n=>{const r=m.usePageExtendComponentContext(),{disablePageHeader:a,enableSharePage:o,isExtra:e}=r,t=q.useMatch("/share/:name"),[i,l]=D.useState(!1),{t:s}=m.useTranslation(),{styles:d}=re(),p=yt(),y=!t&&e,{currentUserCtx:h}=m.useCurrentUserVariable(),u=!e&&a&&o&&!t,f=m.usePageExtendComponentContext(),{fieldSchema:g}=f,I=D.useMemo(()=>{const w=Object.entries(g.properties||{}).map(([v,P],S)=>({label:P.title||`${s("Tab")}${S+1}`,value:P["x-uid"],xUid:P["x-uid"],schemaName:v,title:P.title}));return w.length>1&&w.unshift({label:s("Select all"),value:"all",xUid:"",schemaName:"",title:""}),w},[g]),x={linkStatus:!0,password:null,permanent:!1,shareTime:null,permission:"view",generateLink:null,createdBy:h,updatedBy:h,tabs:I},[M,b]=D.useState(x),[C,L]=D.useState(!1);return p&&c.jsxs(c.Fragment,{children:[y&&c.jsx(B.Button,{icon:c.jsx(K.ShareAltOutlined,{}),onClick:()=>{l(!0)},style:{visibility:`${o?"visible":"hidden"}`}}),u&&c.jsx("div",{className:"tb-page-header-button",children:c.jsx(B.Button,{icon:c.jsx(K.ShareAltOutlined,{}),onClick:()=>{l(!0)},children:s("Share")})}),c.jsxs(B.Modal,{open:i,className:`${d.firstmodal} ${C?d.historyModal:""}`,footer:null,width:500,closable:!1,children:[c.jsxs("div",{className:"modal-title",children:[c.jsx("div",{className:"title",children:C?c.jsxs("div",{className:"history-title",children:[c.jsx(m.Icon,{type:"LeftOutlined",onClick:()=>{L(!1)}}),c.jsxs("div",{children:[" ",s("Historical records")]})]}):c.jsx("div",{className:"share-title",children:s("Share")})}),c.jsxs("div",{className:"modalIcon",children:[!C&&c.jsx(m.Icon,{type:"clockCircleOutlined",onClick:()=>{L(!0)}}),c.jsx(m.Icon,{type:"closeOutlined",onClick:()=>{l(!1),b(x)}})]})]}),c.jsx(Ae.Provider,{value:{shareValue:M,setShareValue:b},children:C?c.jsx(Ct,{}):c.jsx(wt,{allTabs:I})})]})]})}),wt=n=>{var I;const{allTabs:r}=n,{styles:a}=re(),o=m.useCompile(),{t:e}=m.useTranslation(),{shareValue:t,setShareValue:i}=ke(),l=m.usePageExtendComponentContext(),{fieldSchema:s={},title:d=""}=l,y=((I=s==null?void 0:s["x-component-props"])==null?void 0:I.hidePageTitle)?void 0:s.title||o(d),{copyLink:h,imageAction:u}=gt({title:y,uid:s["x-uid"]}),[f,g]=D.useState(!1);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:`${a.secondmodal} secondmodal`,children:[c.jsxs("div",{className:"tb-header-modal-list",onClick:h,children:[c.jsx(m.Icon,{type:"PaperClipOutlined"}),e("Copy link")]}),c.jsxs("div",{className:"tb-header-modal-list",onClick:()=>{g(!0)},children:[c.jsx(m.Icon,{type:"QrcodeOutlined"}),e("Generate QR code")]})]}),c.jsx(sn,{shareValue:t,setShareValue:i,allTabs:r}),c.jsx(B.Modal,{className:a.imageModal,open:f,footer:null,onCancel:()=>{g(!1)},children:u?u():null})]})},Ct=n=>{const{style:r}=n,[a,o]=D.useState([]),{currentUserCtx:e}=m.useCurrentUserVariable(),{styles:t}=Ue(),{t:i}=m.useTranslation(),{run:l}=m.useRequest({resource:"sharePageConfig",action:"list",params:{filter:{createdById:e.id},sort:["-createdAt"]}},{manual:!0,onSuccess(s){var p;const d=(p=s==null?void 0:s.data)==null?void 0:p.map(y=>({key:y.id,label:_(y.createdAt).format("YYYY-MM-DD")+i("Add"),children:c.jsx(cn,{item:y}),extra:c.jsx(un,{item:y,run:l})}));o(d)}});return D.useEffect(()=>{e&&l()},[e]),c.jsx("div",{className:`${t.collapse} ${r}`,children:c.jsx(B.Collapse,{items:a,collapsible:"icon"})})},cn=({item:n})=>{const[r,a]=D.useState(n);return c.jsx(bt,{shareValue:r,setShareValue:a})},un=({item:n,run:r})=>{const{styles:a}=Ue(),o=m.useAPIClient(),[e,t]=D.useState(!1),i=o.resource("sharePageConfig"),{copyLink:l,imageAction:s}=gt({}),{styles:d}=re(),{t:p}=m.useTranslation(),[y,h]=D.useState(n.linkStatus),u=(f,g)=>{switch(f){case"del":i.destroy({filterByTk:n.id}).then(I=>{r(),B.message.success(p("The deletion was successful."))});break;case"qr":t(!0);break;case"link":l(`${n.generateLink}/${n.id}`);break;case"status":i.update({filterByTk:n.id,values:V(F({},n),{linkStatus:g})});break}};return c.jsxs("div",{className:`${a.collapseExtra} collapseExtra`,children:[c.jsx(m.Icon,{type:"deleteOutlined",onClick:()=>{u("del")}}),c.jsx(m.Icon,{type:"qrcodeOutlined",onClick:()=>{u("qr")}}),c.jsx(m.Icon,{type:"linkOutlined",onClick:()=>{u("link")}}),c.jsx(B.Switch,{size:"small",checked:y,onClick:f=>{h(f),u("status",f)}}),e&&c.jsx(B.Modal,{className:d.imageModal,open:e,footer:null,onCancel:()=>{t(!1)},children:s?s(`${n.generateLink}/${n.id}`):null})]})},dn=n=>{const{setIsVerify:r,data:a,modalVisible:o,setModalVisible:e}=n,{t}=m.useTranslation(),{shareTime:i,createdBy:l,linkStatus:s}=(a==null?void 0:a.data)||{},{styles:d}=It(),{id:p}=q.useParams(),[y,h]=D.useState(!0),u=i?_(i).format("YYYY-MM-DD"):t("Permanently valid"),[f,g]=D.useState(""),[I,x]=D.useState(!1),{run:M}=m.useRequest({resource:"sharePageConfig",action:"verifyIn",method:"post",params:{values:{password:f,id:p}}},{manual:!0,onSuccess(w){w.data.valid?(r(!0),e(!1),sessionStorage.setItem("sharePassword",a.data.password),sessionStorage.setItem("sharePassword-id",a.data.id)):x(!0)}}),{pathname:b,search:C}=q.useLocation(),L=q.useNavigate();return D.useEffect(()=>{y&&i&&_().isAfter(i)?(h(!1),B.message.warning(t("The link has expired. If you need to retrieve it again, please contact the relevant personnel"))):!(a!=null&&a.data)&&y?(h(!1),B.message.warning(t("The link does not exist. Please confirm if the link is correct or contact the relevant personnel"))):!s&&y&&(h(!1),B.message.warning(t("This link is currently not open. If you have any questions, please contact the relevant personnel")))},[]),y&&c.jsx(B.Modal,{open:o,title:`${t("From")}(${l==null?void 0:l.nickname})${t("Sharing")}`,onCancel:()=>{e(!1);const w=`?redirent=${b}${C}`;L(`/signin${w}`)},className:d.modal,onOk:()=>{M()},children:c.jsxs("div",{children:[c.jsxs("div",{children:[t("Please enter the sharing password"),c.jsx(B.Input,{onChange:w=>{g(w.target.value),I&&x(!1)}}),c.jsxs("div",{className:"error",style:{visibility:I?"visible":"hidden"},children:[c.jsx(K.ExclamationCircleFilled,{}),t("Password error, please re-enter")]})]}),c.jsxs("div",{className:"shareTime",children:[t("Link timeliness"),":",u]})]})})};function hn(){const n=new URL(window.location.href),r=m.useAPIClient(),a=n.searchParams.get("token");return a&&r.auth.setToken(a),r.auth.getToken()}const fn=()=>{var e,t,i,l,s;const{styles:n}=kt(),r=m.useApp(),a=m.useSystemSettings(),o=D.useRef();return c.jsx(B.Layout,{style:{height:"100%"},children:c.jsxs(B.Layout.Content,{className:Bt.css`
207
349
  display: flex;
208
350
  flex-direction: column;
209
351
  position: relative;
@@ -219,7 +361,7 @@ Minimum version required to store current data is: `+E+`.
219
361
  z-index: 0;
220
362
  padding: 0px 50px;
221
363
  }
222
- `,children:[f.jsx(q.Layout.Header,{className:n.header,children:f.jsxs("div",{className:n.headerA,children:[f.jsxs("div",{className:n.headerB,children:[f.jsxs("div",{className:n.titleContainer,onClick:()=>{location.href=o.adminUrl},children:[f.jsx("img",{className:n.logo,src:(a=(e=(t=i==null?void 0:i.data)==null?void 0:t.data)==null?void 0:e.logo)==null?void 0:a.url}),f.jsx("h1",{className:n.title,children:(l=(s=i==null?void 0:i.data)==null?void 0:s.data)==null?void 0:l.title})]}),f.jsx(b.MenuEditor,{sideMenuRef:r}),f.jsx("div",{className:n.headerTabs,children:f.jsx(b.AdminTabs,{})})]}),f.jsxs("div",{className:n.right,children:[f.jsx(b.PinnedPluginList,{belongToFilter:"pinnedmenu"}),f.jsx(b.CurrentUser,{})]})]})}),f.jsx(mt.Outlet,{})]})})},Qt=()=>Jt()?f.jsx(b.AdminProvider,{children:f.jsx(Yt,{})}):f.jsx($t,{});function $t(){const{pathname:n,search:o}=L.useLocation(),i=`?redirect=${n}${o}`;return f.jsx(L.Navigate,{replace:!0,to:`/signin${i}`})}function Gt(){const n=L.useParams();return f.jsx(b.RemoteSchemaComponent,{uid:n.name})}const Wt=()=>{var t;const{dn:n}=b.useDesignable(),{t:o}=b.useTranslation(),i=Q.useFieldSchema(),{title:r}=b.useSchemaToolbar();return{title:o("Enable Share page"),checked:(t=i["x-component-props"])==null?void 0:t.enableSharePage,onChange(e){i["x-component-props"]=i["x-component-props"]||{},i["x-component-props"].enableSharePage=e,i["x-extend-components"]=Ne(ve({},i["x-extend-components"]),{ShareButton:{name:"ShareButton",component:"ShareButton"}}),i.title||(i.title=r),n.emit("patch",{schema:{"x-uid":i["x-uid"],"x-component-props":i["x-component-props"],"x-extend-components":i["x-extend-components"],title:i.title}}),n.refresh()}}},Zt=({fieldSchema:n})=>{var t;const{t:o}=b.useTranslation(),{title:i}=b.useSchemaToolbar(),{dn:r}=b.useDesignable();return f.jsx(b.SchemaSettingsSwitchItem,{checked:(t=n["x-component-props"])==null?void 0:t.enableSharePage,title:o("Enable Share page"),onChange:e=>ee(null,null,function*(){n["x-component-props"]=n["x-component-props"]||{},n["x-component-props"].enableSharePage=e,n["x-extend-components"]=Ne(ve({},n["x-extend-components"]),{sharePage:{name:"sharePage",component:"MShareModal"}}),n.title||(n.title=i),r.emit("patch",{schema:{"x-uid":n["x-uid"],"x-component-props":n["x-component-props"],"x-extend-components":n["x-extend-components"],title:n.title}}),r.refresh()})})},Xt=R.createStyles(({css:n,token:o})=>({firstmodal:n`
364
+ `,children:[c.jsx(B.Layout.Header,{className:n.header,children:c.jsxs("div",{className:n.headerA,children:[c.jsxs("div",{className:n.headerB,children:[c.jsxs("div",{className:n.titleContainer,onClick:()=>{location.href=r.adminUrl},children:[c.jsx("img",{className:n.logo,src:(i=(t=(e=a==null?void 0:a.data)==null?void 0:e.data)==null?void 0:t.logo)==null?void 0:i.url}),c.jsx("h1",{className:n.title,children:(s=(l=a==null?void 0:a.data)==null?void 0:l.data)==null?void 0:s.title})]}),c.jsx(m.MenuEditor,{sideMenuRef:o}),c.jsx("div",{className:n.headerTabs,children:c.jsx(m.AdminTabs,{})})]}),c.jsxs("div",{className:n.right,children:[c.jsx(m.PinnedPluginList,{belongToFilter:"pinnedmenu"}),c.jsx(m.CurrentUser,{})]})]})}),c.jsx("div",{style:{padding:"0px 5px"},children:c.jsx(At.Outlet,{})})]})})},gn=()=>{var p,y,h,u,f;hn();const{id:n}=q.useParams(),r=location.href,a=r.substring(0,r.lastIndexOf("/")),{data:o}=m.useRequest({resource:"sharePageConfig",action:"get",params:{filter:{id:n,generateLink:a},appends:["createdBy"]}}),[e,t]=D.useState(!1),[i,l]=D.useState(!0),s=sessionStorage.getItem("sharePassword"),d=sessionStorage.getItem("sharePassword-id");return(s&&d===n&&((p=o==null?void 0:o.data)!=null&&p.linkStatus)&&!e&&!_().isAfter((y=o==null?void 0:o.data)==null?void 0:y.shareTime)||(h=o==null?void 0:o.data)!=null&&h.linkStatus&&!((u=o==null?void 0:o.data)!=null&&u.password)&&!e&&!_().isAfter((f=o==null?void 0:o.data)==null?void 0:f.shareTime))&&t(!0),c.jsx(m.AdminProvider,{children:e?c.jsx(fn,{}):c.jsx(dn,{data:o,isVerify:e,setIsVerify:t,modalVisible:i,setModalVisible:l})})};function pn(){const n=q.useParams();return c.jsx(m.RemoteSchemaComponent,{uid:n.name})}const mn=()=>{var e;const{dn:n}=m.useDesignable(),{t:r}=m.useTranslation(),a=W.useFieldSchema(),{title:o}=m.useSchemaToolbar();return{title:r("Enable Share page"),checked:(e=a["x-component-props"])==null?void 0:e.enableSharePage,onChange(t){a["x-component-props"]=a["x-component-props"]||{},a["x-component-props"].enableSharePage=t,a["x-extend-components"]=V(F({},a["x-extend-components"]),{ShareButton:{name:"ShareButton",component:"ShareButton"}}),a.title||(a.title=o),n.emit("patch",{schema:{"x-uid":a["x-uid"],"x-component-props":a["x-component-props"],"x-extend-components":a["x-extend-components"],title:a.title}}),n.refresh()}}},yn=({fieldSchema:n})=>{var e;const{t:r}=m.useTranslation(),{title:a}=m.useSchemaToolbar(),{dn:o}=m.useDesignable();return c.jsx(m.SchemaSettingsSwitchItem,{checked:(e=n["x-component-props"])==null?void 0:e.enableSharePage,title:r("Enable Share page"),onChange:t=>ne(null,null,function*(){n["x-component-props"]=n["x-component-props"]||{},n["x-component-props"].enableSharePage=t,n["x-extend-components"]=V(F({},n["x-extend-components"]),{sharePage:{name:"sharePage",component:"MShareModal"}}),n.title||(n.title=a),o.emit("patch",{schema:{"x-uid":n["x-uid"],"x-component-props":n["x-component-props"],"x-extend-components":n["x-extend-components"],title:n.title}}),o.refresh()})})},bn=z.createStyles(({css:n,token:r})=>({firstmodal:n`
223
365
  .ant-modal-content {
224
366
  position: relative;
225
367
  overflow: hidden;
@@ -254,64 +396,70 @@ Minimum version required to store current data is: `+E+`.
254
396
  font-weight: 400;
255
397
  }
256
398
  }
257
- .ant-modal-body {
258
- justify-items: center;
259
- }
260
399
  }
261
- `,secondmodal:n`
262
- display: flex;
263
- justify-content: center;
264
- align-items: center;
265
- width: 100%;
266
- margin-top: 20px;
267
- margin-bottom: 40px;
268
- position: relative;
269
- gap: 15%;
270
- padding-left: 8%;
271
- padding-right: 8%;
272
- .tb-header-modal-list {
273
- width: 50%;
274
- gap: 10px;
275
- display: flex;
276
- flex-direction: column;
277
- justify-content: center;
278
- text-align: center;
279
- border: 1px solid transparent;
280
- border-color: rgba(203, 227, 254, 0.62);
281
- box-shadow: none;
282
- border-radius: 12px;
283
- padding: 16px;
284
- transition:
285
- box-shadow 0.2s ease,
286
- transform 0.2s ease;
287
- z-index: 1;
288
- position: relative;
289
- &:hover {
290
- border-color: rgba(0, 120, 255, 0.3);
291
- box-shadow: 0 4px 16px rgba(0, 120, 255, 0.15);
292
- }
293
- &:active {
294
- box-shadow: none;
295
- transform: translateY(2px);
296
- }
297
- .anticon {
400
+ .ant-modal-body {
401
+ .modal-title {
298
402
  width: 100%;
299
- display: flex;
300
- justify-content: center;
301
- svg {
302
- width: 30px;
303
- height: 30px;
403
+ position: relative;
404
+ .title {
405
+ flex: 1;
406
+ text-align: center;
407
+ font-size: large;
408
+ font-weight: 400;
409
+ .history-title {
410
+ font-weight: normal;
411
+ text-align: left;
412
+ font-size: 1rem;
413
+ display: flex;
414
+ padding: 0 20px;
415
+ margin-bottom: 5px;
416
+ margin-top: 15px;
417
+ .anticon {
418
+ padding: 0 5px 0 5px;
419
+ &:hover {
420
+ background-color: #ebebeb;
421
+ cursor: pointer;
422
+ }
423
+ }
424
+ }
425
+ .share-title {
426
+ margin: 20px 0;
427
+ }
428
+ }
429
+ .modalIcon {
430
+ position: absolute;
431
+ top: -15px;
432
+ right: 7px;
433
+ .anticon {
434
+ font-size: 18px;
435
+ padding: 8px;
436
+ &:hover {
437
+ background-color: #ebebeb;
438
+ cursor: pointer;
439
+ }
440
+ }
304
441
  }
305
442
  }
306
- .tb-header-modal-list-text {
307
- text-align: center;
443
+ .secondmodal {
444
+ display: flex;
445
+ justify-content: center;
446
+ align-items: center;
447
+ width: 100%;
448
+ margin-top: 20px;
449
+ margin-bottom: 40px;
450
+ position: relative;
451
+ gap: 15%;
452
+ padding-left: 8%;
453
+ padding-right: 8%;
308
454
  }
309
455
  }
310
- `,imageModal:n`
311
- display: flex;
312
- justify-content: center;
313
- .ant-modal-content {
314
- width: 280px;
315
- height: 360px;
456
+ `,collapse:n`
457
+ .ant-collapse-extra {
458
+ width: 100%;
459
+ .collapseExtra {
460
+ width: 100%;
461
+ display: flex;
462
+ justify-content: space-between;
463
+ }
316
464
  }
317
- `})),en=()=>{const{fieldSchema:n,isHeaderEnabled:o,title:i,enabledSharePage:r}=b.usePageExtendComponentContext(),t=n==null?void 0:n["x-uid"],[e,a]=U.useState(!1),{styles:s}=Xt(),{t:l}=b.useTranslation(),{copyLink:c,imageAction:h}=ct({title:i,uid:t}),[p,d]=U.useState(!1);return f.jsxs(f.Fragment,{children:[o&&r&&f.jsx(q.Button,{icon:f.jsx(K.ShareAltOutlined,{}),onClick:()=>{d(!0)}}),!o&&r&&f.jsx("div",{style:{display:"flex",justifyContent:"end",backgroundColor:"#ffffff",paddingRight:"20px"},children:f.jsx(q.Button,{icon:f.jsx(K.ShareAltOutlined,{}),style:{border:"none"},onClick:()=>{d(!0)}})}),f.jsxs(q.Modal,{open:p,className:s.firstmodal,title:l("Share"),footer:null,width:300,onCancel:()=>{d(!1)},children:[f.jsxs("div",{className:s.secondmodal,children:[f.jsxs("div",{className:"tb-header-modal-list",onClick:c,children:[f.jsx(b.Icon,{type:"PaperClipOutlined"}),l("Copy link")]}),f.jsxs("div",{className:"tb-header-modal-list",onClick:()=>{a(!0)},children:[f.jsx(b.Icon,{type:"QrcodeOutlined"}),l("Generate QR code")]})]}),f.jsx(q.Modal,{className:s.imageModal,open:e,footer:null,onCancel:()=>{a(!1)},children:h()})]})]})};class ut extends b.Plugin{load(){return ee(this,null,function*(){this.app.addComponents({ShareButton:Kt,MEnableSharePage:Zt,MShareModal:en}),this.router.add("share",{path:"/share",Component:Qt}),this.router.add("share.page",{path:"/share/:name",Component:Gt}),this.schemaSettingsManager.addItem("MPage:Dropdown","Menablesharepage",{type:"item",useVisible(){return!L.useMatch("/share/:name")},Component:"MEnableSharePage"}),this.schemaSettingsManager.addItem("PageSettings","enablesharepage",{type:"switch",useVisible(){return!L.useMatch("/share/:name")},useComponentProps:Wt})})}}k.PluginShareClient=ut,k.default=ut,Object.defineProperties(k,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
465
+ `})),wn=()=>{const{fieldSchema:n,isHeaderEnabled:r,enabledSharePage:a}=m.usePageExtendComponentContext();n==null||n["x-uid"];const{styles:o}=bn(),{t:e}=m.useTranslation(),{currentUserCtx:t}=m.useCurrentUserVariable(),[i,l]=D.useState(!1),s=m.useCompile(),d=D.useMemo(()=>{var I,x;const g=Object.entries(((x=(I=n.properties)==null?void 0:I.tabs)==null?void 0:x.properties)||n.properties||{}).map(([M,b],C)=>({label:s(b.title)||`${e("Tab")}${C+1}`,value:b["x-uid"],xUid:b["x-uid"],schemaName:M,title:b.title}));return g.length>1&&g.unshift({label:e("Select all"),value:"all",xUid:"",schemaName:"",title:""}),g},[n]),p={linkStatus:!0,password:null,permanent:!1,shareTime:null,permission:"view",generateLink:null,createdBy:t,updatedBy:t,tabs:d},[y,h]=D.useState(p),[u,f]=D.useState(!1);return c.jsxs(c.Fragment,{children:[r&&a&&c.jsx(B.Button,{icon:c.jsx(K.ShareAltOutlined,{}),onClick:()=>{l(!0)}}),!r&&a&&c.jsx("div",{style:{display:"flex",justifyContent:"end",backgroundColor:"#ffffff",paddingRight:"20px"},children:c.jsx(B.Button,{icon:c.jsx(K.ShareAltOutlined,{}),style:{border:"none"},onClick:()=>{l(!0)}})}),c.jsxs(B.Modal,{open:i,className:o.firstmodal,footer:null,width:300,closable:!1,children:[c.jsxs("div",{className:"modal-title",children:[c.jsx("div",{className:"title",children:u?c.jsxs("div",{className:"history-title",children:[c.jsx(m.Icon,{type:"LeftOutlined",onClick:()=>{f(!1)}}),c.jsxs("div",{children:[" ",e("Historical records")]})]}):c.jsx("div",{className:"share-title",children:e("Share")})}),c.jsxs("div",{className:"modalIcon",children:[!u&&c.jsx(m.Icon,{type:"clockCircleOutlined",onClick:()=>{f(!0)}}),c.jsx(m.Icon,{type:"closeOutlined",onClick:()=>{l(!1),h(p)}})]})]}),c.jsx(Ae.Provider,{value:{shareValue:y,setShareValue:h},children:u?c.jsx(Ct,{style:o.collapse}):c.jsx(wt,{allTabs:d})})]})]})};class xt extends m.Plugin{load(){return ne(this,null,function*(){this.app.addProvider(on),this.app.addComponents({ShareButton:ln,MEnableSharePage:yn,MShareModal:wn}),this.router.add("share",{path:"/share",Component:gn}),this.router.add("share.page",{path:"/share/:name/:id",Component:pn}),this.schemaSettingsManager.addItem("MPage:Dropdown","Menablesharepage",{type:"item",useVisible(){return!q.useMatch("/share/:name/:id")},Component:"MEnableSharePage"}),this.schemaSettingsManager.addItem("PageSettings","enablesharepage",{type:"switch",useVisible(){const r=q.useMatch("/share/:name/:id"),a=yt();return!r&&a},useComponentProps:mn})})}}U.PluginShareClient=xt,U.default=xt,Object.defineProperties(U,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1,5 +1,4 @@
1
1
  export declare const useModalStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
2
  firstmodal: import("antd-style").SerializedStyles;
3
- secondmodal: import("antd-style").SerializedStyles;
4
- imageModal: import("antd-style").SerializedStyles;
3
+ collapse: import("antd-style").SerializedStyles;
5
4
  }>;